@vue-pdf-viewer/shared 1.0.0-beta.4 → 1.0.0-beta.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 CHANGED
@@ -1,16 +1,13 @@
1
1
  import { type InjectionKey, type Reactive, type ComputedRef } from "vue";
2
- import type { LocaleKey, Localization, PluginContext, ViewerCoreState, VPVCoreState } from "./index";
3
- import { EventAnnotation, FreeTextFontColor, HighlightColor } from "./enumerators";
2
+ import type { LocaleKey, Localization, PluginContext } from "./index";
3
+ import { EventAnnotation, EventCore, FreeTextFontColor, HighlightColor } from "./enumerators";
4
4
  export declare const PLUGIN_ID: {
5
5
  ANNOTATIONS: string;
6
6
  };
7
7
  export declare const Locales: Record<LocaleKey, Localization>;
8
8
  export declare const SYMBOL_SHARED_UI: InjectionKey<Reactive<PluginContext["shared"]["ui"]>>;
9
9
  export declare const SYMBOL_LOCALIZATION: InjectionKey<ComputedRef<Localization> | undefined>;
10
- export declare const SYMBOL_VIEWER_CORE_STATE: InjectionKey<ViewerCoreState>;
11
- export declare const SYMBOL_VPV_CORE_STATE: InjectionKey<Reactive<VPVCoreState>>;
12
10
  export declare const EVENT_ANNOTATION: typeof EventAnnotation;
11
+ export declare const EVENT_CORE: typeof EventCore;
13
12
  export declare const DEFAULT_HIGHLIGHT_COLORS: Record<HighlightColor, string>;
14
13
  export declare const DEFAULT_FREE_TEXT_FONT_COLORS: Record<FreeTextFontColor, string>;
15
- export declare const DEFAULT_VIEWER_CORE_STATE: ViewerCoreState;
16
- export declare const DEFAULT_VPV_CORE_STATE: VPVCoreState;
package/dist/const.js CHANGED
@@ -1,5 +1,4 @@
1
- import { ref, } from "vue";
2
- import { EventAnnotation, FreeTextFontColor, HighlightColor, } from "./enumerators";
1
+ import { EventAnnotation, EventCore, FreeTextFontColor, HighlightColor, } from "./enumerators";
3
2
  import en from "./locales/en_US.json";
4
3
  import cn from "./locales/zh_CN.json";
5
4
  import it from "./locales/it_IT.json";
@@ -18,9 +17,8 @@ export const Locales = {
18
17
  };
19
18
  export const SYMBOL_SHARED_UI = Symbol("VPV Shared UIs");
20
19
  export const SYMBOL_LOCALIZATION = Symbol("VPV Current Localization");
21
- export const SYMBOL_VIEWER_CORE_STATE = Symbol("VPV Viewer Core State");
22
- export const SYMBOL_VPV_CORE_STATE = Symbol("VPV Core State");
23
20
  export const EVENT_ANNOTATION = EventAnnotation;
21
+ export const EVENT_CORE = EventCore;
24
22
  export const DEFAULT_HIGHLIGHT_COLORS = {
25
23
  [HighlightColor.Purple]: "Purple",
26
24
  [HighlightColor.Cyan]: "Cyan",
@@ -43,36 +41,3 @@ export const DEFAULT_FREE_TEXT_FONT_COLORS = {
43
41
  [FreeTextFontColor.Yellow]: "Yellow",
44
42
  [FreeTextFontColor.Green]: "Green",
45
43
  };
46
- export const DEFAULT_VIEWER_CORE_STATE = {
47
- currentPageIndex: ref(0),
48
- firstPageRotation: ref(0),
49
- scale: ref(1),
50
- isEditing: ref(false),
51
- rotation: ref(0),
52
- update: (state) => {
53
- if (state.currentPageIndex !== undefined) {
54
- DEFAULT_VIEWER_CORE_STATE.currentPageIndex.value = state.currentPageIndex;
55
- }
56
- if (state.firstPageRotation !== undefined) {
57
- DEFAULT_VIEWER_CORE_STATE.firstPageRotation.value =
58
- state.firstPageRotation;
59
- }
60
- if (state.rotation !== undefined) {
61
- DEFAULT_VIEWER_CORE_STATE.rotation.value = state.rotation;
62
- }
63
- if (state.scale !== undefined) {
64
- DEFAULT_VIEWER_CORE_STATE.scale.value = state.scale;
65
- }
66
- if (state.isEditing !== undefined) {
67
- DEFAULT_VIEWER_CORE_STATE.isEditing.value = state.isEditing;
68
- }
69
- },
70
- };
71
- export const DEFAULT_VPV_CORE_STATE = {
72
- currentPageIndex: 0,
73
- firstPageRotation: 0,
74
- scale: 1,
75
- isEditing: false,
76
- rotation: 0,
77
- update: (state) => Object.assign(DEFAULT_VPV_CORE_STATE, state),
78
- };
@@ -4,6 +4,9 @@ export declare enum EventAnnotation {
4
4
  signature = "vpv:annotation:signature",
5
5
  image = "vpv:annotation:image"
6
6
  }
7
+ export declare enum EventCore {
8
+ Rotate = "vpv:rotate"
9
+ }
7
10
  export declare enum HighlightColor {
8
11
  Purple = "#CAAAFF",
9
12
  Cyan = "#65EDE9",
@@ -5,6 +5,10 @@ export var EventAnnotation;
5
5
  EventAnnotation["signature"] = "vpv:annotation:signature";
6
6
  EventAnnotation["image"] = "vpv:annotation:image";
7
7
  })(EventAnnotation || (EventAnnotation = {}));
8
+ export var EventCore;
9
+ (function (EventCore) {
10
+ EventCore["Rotate"] = "vpv:rotate";
11
+ })(EventCore || (EventCore = {}));
8
12
  export var HighlightColor;
9
13
  (function (HighlightColor) {
10
14
  HighlightColor["Purple"] = "#CAAAFF";
package/dist/types.d.ts CHANGED
@@ -1,23 +1,5 @@
1
- import type { Component, ComponentInternalInstance, ComputedRef, Reactive, Ref } from "vue";
2
- export interface ViewerCoreState {
3
- currentPageIndex: Ref<number>;
4
- firstPageRotation: Ref<number>;
5
- scale: Ref<number>;
6
- isEditing: Ref<boolean>;
7
- rotation: Ref<number>;
8
- update: (state: Partial<ViewerCoreValues>) => void;
9
- }
10
- export type ViewerCoreValues = {
11
- [K in keyof Omit<ViewerCoreState, "update">]: ViewerCoreState[K] extends Ref<infer V> ? V : never;
12
- };
13
- export interface VPVCoreState {
14
- currentPageIndex: number;
15
- firstPageRotation: number;
16
- scale: number;
17
- isEditing: boolean;
18
- rotation: number;
19
- update: (state: Partial<VPVCoreState>) => void;
20
- }
1
+ import type { Component, ComponentInternalInstance, ComputedRef } from "vue";
2
+ import { EventAnnotation, EventCore } from "./enumerators";
21
3
  export type LocaleKey = "en_US" | "zh_CN" | "it_IT" | "pt_PT" | "th_TH" | string;
22
4
  export type Localization = {
23
5
  searchButtonTooltip: string;
@@ -134,8 +116,6 @@ export interface PluginContext {
134
116
  };
135
117
  shared: {
136
118
  localization: ComputedRef<Localization>;
137
- viewerCoreState: ViewerCoreState;
138
- vpvCoreState: Reactive<VPVCoreState>;
139
119
  ui: {
140
120
  AppButton?: Component;
141
121
  AppTooltip?: Component;
@@ -161,3 +141,4 @@ export type FreeTextFontColors = (LabelValuePair[] | string[]) & {
161
141
  length: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
162
142
  };
163
143
  export type AnnotationFreeTextFontColors = FreeTextFontColors | null;
144
+ export type VPVEvent = EventAnnotation | EventCore;
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { EventAnnotation } from "./enumerators";
2
- export declare const getEventName: (instanceId: number, event: EventAnnotation) => string;
1
+ import { VPVEvent } from "./types";
2
+ export declare const getEventName: (instanceId: number, event: VPVEvent) => string;
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.0-beta.4",
4
+ "version": "1.0.0-beta.5",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",