liutian 2 månader sedan
förälder
incheckning
85af4c8532

+ 11 - 3
packages/webviewer-core/src/DocumentViewer.js

@@ -1,4 +1,5 @@
 import EventHandler from './EventHandler';
+import { documentViewerEvent } from './constant/index.js'
 
 /**
  * Represents a full-featured control used for displaying a Document. The viewer supports text selection and text search, and several page view modes.
@@ -12,7 +13,7 @@ class DocumentViewer extends EventHandler {
    */
   constructor(defaults) {
     super();
-    
+
     /**
      * Contains a list of available fit modes for the DocumentViewer.
      * @property {function} FitWidth - Zoom level is constrained such that the current page's width will exactly fill the available space.
@@ -20,6 +21,9 @@ class DocumentViewer extends EventHandler {
      * @property {function} Zoom - Zoom level is not constrained.
      */
     this.FitMode = null;
+    this.bookMarks = []
+
+    this.pagesViewer = []
   }
 
   /**
@@ -60,10 +64,12 @@ class DocumentViewer extends EventHandler {
    * @property {string} BEFORE_SNAP_MODE_INITIALIZED - Core.DocumentViewer.beforeSnapModeInitialized
    * @property {string} EMBEDDED_POP_UP_MENU - Core.DocumentViewer.embeddedPopUpMenu
    */
-  static get Events() {}
+  static Events = documentViewerEvent
 
   /** Clears all search results from the viewer */
-  clearSearchResults() {}
+  clearSearchResults() {
+
+  }
 
   /** Clears any selected text on the all pages. */
   clearSelection() {}
@@ -390,3 +396,5 @@ class DocumentViewer extends EventHandler {
    */
   zoomUpdated() {}
 }
+
+export default DocumentViewer

+ 11 - 0
packages/webviewer-core/src/constant/displayMode.js

@@ -0,0 +1,11 @@
+const displayMode = {
+  FACING: "Facing",
+  FACINGCONTINUOUS: "FacingContinuous",
+  COVER: "Cover",
+  COVERFACING: "CoverFacing",
+  SINGLE: "Single",
+  CONTINUOUS: "Continuous",
+  CUSTOM: "Custom",
+}
+
+export default displayMode

+ 45 - 0
packages/webviewer-core/src/constant/documentViewerEvent.js

@@ -0,0 +1,45 @@
+const documentViewerEvent = {
+  ACTIVE_SEARCH_RESULT_CHANGED: "activeSearchResultChanged",
+  SEARCH_RESULTS_CHANGED: "searchResultsChanged",
+  MOUSE_LEFT_UP: "mouseLeftUp",
+  MOUSE_LEFT_DOWN: "mouseLeftDown",
+  CLICK: "click",
+  TAP: "tap",
+  LONG_TAP: "longTap",
+  DBL_CLICK: "dblClick",
+  KEY_DOWN: "keyDown",
+  KEY_UP: "keyUp",
+  MOUSE_ENTER: "mouseEnter",
+  MOUSE_MOVE: "mouseMove",
+  MOUSE_LEAVE: "mouseLeave",
+  MOUSE_RIGHT_DOWN: "mouseRightDown",
+  MOUSE_RIGHT_UP: "mouseRightUp",
+  DOCUMENT_UNLOADED: "documentUnloaded",
+  ANNOTATIONS_LOADED: "annotationsLoaded",
+  BEFORE_DOCUMENT_LOADED: "beforeDocumentLoaded",
+  DOCUMENT_LOADED: "documentLoaded",
+  DISPLAY_PAGE_LOCATION: "displayPageLocation",
+  NOTIFY: "notify",
+  SEARCH_IN_PROGRESS: "searchInProgress",
+  TEXT_SELECTED: "textSelected",
+  TOOL_MODE_UPDATED: "toolModeUpdated",
+  FIT_MODE_UPDATED: "fitModeUpdated",
+  ROTATION_UPDATED: "rotationUpdated",
+  ZOOM_UPDATED: "zoomUpdated",
+  PAGE_NUMBER_UPDATED: "pageNumberUpdated",
+  PAGES_UPDATED: "pagesUpdated",
+  PAGE_COMPLETE: "pageComplete",
+  DISPLAY_MODE_UPDATED: "displayModeUpdated",
+  BEGIN_RENDERING: "beginRendering",
+  FINISHED_RENDERING: "finishedRendering",
+  CLIENT_SIDE_DOCUMENT_LOADED: "clientSideDocumentLoaded",
+  TOOL_UPDATED: "toolUpdated",
+  EMBEDDED_THUMBNAIL_COMPLETE: "embeddedThumbnailComplete",
+  READ_ONLY_MODE_CHANGED: "readOnlyModeChanged",
+  EMBEDDED_POP_UP_MENU: "embeddedPopUpMenu",
+  COMPARE_ANNOTATIONS_LOADED: "compareAnnotationsLoaded",
+  SNAP_MODE_INITIALIZED: "snapModeInitialized",
+  BEFORE_SNAP_MODE_INITIALIZED: "beforeSnapModeInitialized",
+}
+
+export default documentViewerEvent

+ 7 - 0
packages/webviewer-core/src/constant/index.js

@@ -0,0 +1,7 @@
+import displayMode from "./displayMode"
+import documentViewerEvent from './documentViewerEvent'
+
+export {
+  displayMode,
+  documentViewerEvent,
+}