@vue-pdf-viewer/shared 1.0.0-beta.3 → 1.0.0-beta.4

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,5 +1,5 @@
1
1
  import { type InjectionKey, type Reactive, type ComputedRef } from "vue";
2
- import type { LocaleKey, Localization, PluginContext, ViewerCoreState } from "./index";
2
+ import type { LocaleKey, Localization, PluginContext, ViewerCoreState, VPVCoreState } from "./index";
3
3
  import { EventAnnotation, FreeTextFontColor, HighlightColor } from "./enumerators";
4
4
  export declare const PLUGIN_ID: {
5
5
  ANNOTATIONS: string;
@@ -8,7 +8,9 @@ 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
10
  export declare const SYMBOL_VIEWER_CORE_STATE: InjectionKey<ViewerCoreState>;
11
+ export declare const SYMBOL_VPV_CORE_STATE: InjectionKey<Reactive<VPVCoreState>>;
11
12
  export declare const EVENT_ANNOTATION: typeof EventAnnotation;
12
13
  export declare const DEFAULT_HIGHLIGHT_COLORS: Record<HighlightColor, string>;
13
14
  export declare const DEFAULT_FREE_TEXT_FONT_COLORS: Record<FreeTextFontColor, string>;
14
15
  export declare const DEFAULT_VIEWER_CORE_STATE: ViewerCoreState;
16
+ export declare const DEFAULT_VPV_CORE_STATE: VPVCoreState;
package/dist/const.js CHANGED
@@ -19,6 +19,7 @@ export const Locales = {
19
19
  export const SYMBOL_SHARED_UI = Symbol("VPV Shared UIs");
20
20
  export const SYMBOL_LOCALIZATION = Symbol("VPV Current Localization");
21
21
  export const SYMBOL_VIEWER_CORE_STATE = Symbol("VPV Viewer Core State");
22
+ export const SYMBOL_VPV_CORE_STATE = Symbol("VPV Core State");
22
23
  export const EVENT_ANNOTATION = EventAnnotation;
23
24
  export const DEFAULT_HIGHLIGHT_COLORS = {
24
25
  [HighlightColor.Purple]: "Purple",
@@ -67,3 +68,11 @@ export const DEFAULT_VIEWER_CORE_STATE = {
67
68
  }
68
69
  },
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
+ };
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Component, ComponentInternalInstance, ComputedRef, Ref } from "vue";
1
+ import type { Component, ComponentInternalInstance, ComputedRef, Reactive, Ref } from "vue";
2
2
  export interface ViewerCoreState {
3
3
  currentPageIndex: Ref<number>;
4
4
  firstPageRotation: Ref<number>;
@@ -10,6 +10,14 @@ export interface ViewerCoreState {
10
10
  export type ViewerCoreValues = {
11
11
  [K in keyof Omit<ViewerCoreState, "update">]: ViewerCoreState[K] extends Ref<infer V> ? V : never;
12
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
+ }
13
21
  export type LocaleKey = "en_US" | "zh_CN" | "it_IT" | "pt_PT" | "th_TH" | string;
14
22
  export type Localization = {
15
23
  searchButtonTooltip: string;
@@ -127,6 +135,7 @@ export interface PluginContext {
127
135
  shared: {
128
136
  localization: ComputedRef<Localization>;
129
137
  viewerCoreState: ViewerCoreState;
138
+ vpvCoreState: Reactive<VPVCoreState>;
130
139
  ui: {
131
140
  AppButton?: Component;
132
141
  AppTooltip?: Component;
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.3",
4
+ "version": "1.0.0-beta.4",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",