@pdftools/four-heights-pdf-web-viewer 4.3.6
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/LICENSE.md +446 -0
- package/README.md +145 -0
- package/css/pdf-web-viewer.css +2407 -0
- package/doc/PdfWebViewer.pdf +0 -0
- package/es6/common/Checkbox.d.ts +9 -0
- package/es6/common/Checkbox.js +8 -0
- package/es6/common/Color.d.ts +23 -0
- package/es6/common/Color.js +118 -0
- package/es6/common/ColorPicker.d.ts +15 -0
- package/es6/common/ColorPicker.js +46 -0
- package/es6/common/Contextbar.d.ts +6 -0
- package/es6/common/Contextbar.js +19 -0
- package/es6/common/DragMoveHandler.d.ts +51 -0
- package/es6/common/DragMoveHandler.js +175 -0
- package/es6/common/Dropdown.d.ts +36 -0
- package/es6/common/Dropdown.js +76 -0
- package/es6/common/DropdownMenu.d.ts +9 -0
- package/es6/common/DropdownMenu.js +10 -0
- package/es6/common/DropdownSeparator.d.ts +3 -0
- package/es6/common/DropdownSeparator.js +6 -0
- package/es6/common/Icon.d.ts +13 -0
- package/es6/common/Icon.js +8 -0
- package/es6/common/Loader.d.ts +3 -0
- package/es6/common/Loader.js +6 -0
- package/es6/common/RangeSlider.d.ts +17 -0
- package/es6/common/RangeSlider.js +42 -0
- package/es6/common/StrokeStylePicker.d.ts +11 -0
- package/es6/common/StrokeStylePicker.js +20 -0
- package/es6/common/StrokeWidthPicker.d.ts +11 -0
- package/es6/common/StrokeWidthPicker.js +20 -0
- package/es6/common/Toolbar.d.ts +10 -0
- package/es6/common/Toolbar.js +6 -0
- package/es6/common/ToolbarButton.d.ts +14 -0
- package/es6/common/ToolbarButton.js +21 -0
- package/es6/common/ToolbarFileButton.d.ts +15 -0
- package/es6/common/ToolbarFileButton.js +27 -0
- package/es6/common/ToolbarItemGroup.d.ts +8 -0
- package/es6/common/ToolbarItemGroup.js +12 -0
- package/es6/common/ToolbarSeparator.d.ts +3 -0
- package/es6/common/ToolbarSeparator.js +6 -0
- package/es6/common/Tools.d.ts +10 -0
- package/es6/common/Tools.js +89 -0
- package/es6/common/TooltipManager.d.ts +12 -0
- package/es6/common/TooltipManager.js +54 -0
- package/es6/common/TranslationManager.d.ts +11 -0
- package/es6/common/TranslationManager.js +61 -0
- package/es6/common/classNames.d.ts +2 -0
- package/es6/common/classNames.js +18 -0
- package/es6/common/formatDate.d.ts +1 -0
- package/es6/common/formatDate.js +1 -0
- package/es6/common/icons.d.ts +13 -0
- package/es6/common/icons.js +412 -0
- package/es6/common/utils.d.ts +2 -0
- package/es6/common/utils.js +19 -0
- package/es6/custom/history.d.ts +2 -0
- package/es6/custom/history.js +59 -0
- package/es6/index.d.ts +5 -0
- package/es6/index.js +5 -0
- package/es6/lib/hyperapp/index.d.ts +108 -0
- package/es6/lib/hyperapp/index.js +327 -0
- package/es6/modules/CanvasLayer.d.ts +32 -0
- package/es6/modules/CanvasLayer.js +83 -0
- package/es6/modules/CanvasModule.d.ts +59 -0
- package/es6/modules/CanvasModule.js +98 -0
- package/es6/modules/eraser/EraserLayer.d.ts +13 -0
- package/es6/modules/eraser/EraserLayer.js +141 -0
- package/es6/modules/eraser/EraserModule.d.ts +19 -0
- package/es6/modules/eraser/EraserModule.js +34 -0
- package/es6/modules/eraser/EraserToolbar.d.ts +10 -0
- package/es6/modules/eraser/EraserToolbar.js +30 -0
- package/es6/modules/form-fields/CheckBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/CheckBoxWidget.js +45 -0
- package/es6/modules/form-fields/ComboBoxWidget.d.ts +22 -0
- package/es6/modules/form-fields/ComboBoxWidget.js +152 -0
- package/es6/modules/form-fields/EditFormFieldLayer.d.ts +17 -0
- package/es6/modules/form-fields/EditFormFieldLayer.js +238 -0
- package/es6/modules/form-fields/FormFieldModule.d.ts +15 -0
- package/es6/modules/form-fields/FormFieldModule.js +27 -0
- package/es6/modules/form-fields/ListBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/ListBoxWidget.js +73 -0
- package/es6/modules/form-fields/RadioButtonWidget.d.ts +9 -0
- package/es6/modules/form-fields/RadioButtonWidget.js +45 -0
- package/es6/modules/form-fields/SelectListWidget.d.ts +9 -0
- package/es6/modules/form-fields/SelectListWidget.js +45 -0
- package/es6/modules/form-fields/TextBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/TextBoxWidget.js +53 -0
- package/es6/modules/form-fields/WidgetBase.d.ts +23 -0
- package/es6/modules/form-fields/WidgetBase.js +29 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.d.ts +19 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.js +181 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.d.ts +21 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.js +37 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.d.ts +20 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.js +211 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.d.ts +50 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.js +118 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.d.ts +28 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.js +58 -0
- package/es6/modules/freetext-annotation/RichTextEditor.d.ts +31 -0
- package/es6/modules/freetext-annotation/RichTextEditor.js +223 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.d.ts +31 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.js +289 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.d.ts +20 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.js +52 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.js +104 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.js +28 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.d.ts +27 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.js +54 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.d.ts +23 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.js +169 -0
- package/es6/modules/index.d.ts +13 -0
- package/es6/modules/index.js +13 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.d.ts +40 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.js +503 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.d.ts +30 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.js +53 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.d.ts +20 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.js +137 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.d.ts +25 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.js +47 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.d.ts +27 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.js +50 -0
- package/es6/modules/popup/Popup.d.ts +64 -0
- package/es6/modules/popup/Popup.js +360 -0
- package/es6/modules/popup/PopupLayer.d.ts +31 -0
- package/es6/modules/popup/PopupLayer.js +509 -0
- package/es6/modules/popup/PopupModule.d.ts +16 -0
- package/es6/modules/popup/PopupModule.js +25 -0
- package/es6/modules/print-service/PrintServiceDialog.d.ts +30 -0
- package/es6/modules/print-service/PrintServiceDialog.js +134 -0
- package/es6/modules/print-service/PrintServiceLayer.d.ts +24 -0
- package/es6/modules/print-service/PrintServiceLayer.js +310 -0
- package/es6/modules/print-service/PrintServiceModule.d.ts +18 -0
- package/es6/modules/print-service/PrintServiceModule.js +30 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.d.ts +24 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.js +210 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.d.ts +26 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.js +69 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.d.ts +19 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.js +148 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.d.ts +24 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.js +57 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.d.ts +28 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.js +50 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.d.ts +19 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.js +257 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.d.ts +17 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.js +68 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.d.ts +20 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.js +35 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.d.ts +14 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.js +132 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.d.ts +15 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.js +27 -0
- package/es6/modules/text-annotation/TextAnnotationModule.d.ts +19 -0
- package/es6/modules/text-annotation/TextAnnotationModule.js +34 -0
- package/es6/pdf-viewer-api/ImageContainer.d.ts +10 -0
- package/es6/pdf-viewer-api/ImageContainer.js +43 -0
- package/es6/pdf-viewer-api/PdfViewerApi.d.ts +463 -0
- package/es6/pdf-viewer-api/PdfViewerApi.js +732 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.d.ts +178 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.js +2037 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.d.ts +3 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.js +30 -0
- package/es6/pdf-viewer-api/enums.d.ts +100 -0
- package/es6/pdf-viewer-api/enums.js +113 -0
- package/es6/pdf-viewer-api/index.d.ts +3 -0
- package/es6/pdf-viewer-api/index.js +3 -0
- package/es6/pdf-viewer-api/types.d.ts +284 -0
- package/es6/pdf-viewer-api/types.js +6 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.d.ts +76 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.js +345 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.d.ts +175 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.js +1226 -0
- package/es6/pdf-viewer-canvas/state/annotations.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/annotations.js +157 -0
- package/es6/pdf-viewer-canvas/state/appState.d.ts +10 -0
- package/es6/pdf-viewer-canvas/state/appState.js +60 -0
- package/es6/pdf-viewer-canvas/state/canvas.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/canvas.js +41 -0
- package/es6/pdf-viewer-canvas/state/document.d.ts +50 -0
- package/es6/pdf-viewer-canvas/state/document.js +99 -0
- package/es6/pdf-viewer-canvas/state/pointer.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/pointer.js +31 -0
- package/es6/pdf-viewer-canvas/state/scroll.d.ts +22 -0
- package/es6/pdf-viewer-canvas/state/scroll.js +25 -0
- package/es6/pdf-viewer-canvas/state/search.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/search.js +27 -0
- package/es6/pdf-viewer-canvas/state/store.d.ts +39 -0
- package/es6/pdf-viewer-canvas/state/store.js +52 -0
- package/es6/pdf-viewer-canvas/state/viewer.d.ts +91 -0
- package/es6/pdf-viewer-canvas/state/viewer.js +175 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.d.ts +28 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.js +452 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.d.ts +9 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.js +25 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.d.ts +10 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.d.ts +48 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.js +308 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.d.ts +19 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.js +289 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.d.ts +31 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.js +106 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.d.ts +11 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.d.ts +3 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.js +10 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.d.ts +52 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.js +377 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.d.ts +47 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.js +102 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.d.ts +14 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.js +36 -0
- package/es6/pdf-viewing/PdfViewing.d.ts +4865 -0
- package/es6/pdf-viewing/PdfViewing.js +9611 -0
- package/es6/pdf-web-viewer/PdfWebViewer.d.ts +372 -0
- package/es6/pdf-web-viewer/PdfWebViewer.js +1386 -0
- package/es6/pdf-web-viewer/UserSettings.d.ts +8 -0
- package/es6/pdf-web-viewer/UserSettings.js +40 -0
- package/es6/pdf-web-viewer/WebViewerOptions.d.ts +387 -0
- package/es6/pdf-web-viewer/WebViewerOptions.js +582 -0
- package/es6/pdf-web-viewer/state/index.d.ts +80 -0
- package/es6/pdf-web-viewer/state/index.js +98 -0
- package/es6/pdf-web-viewer/state/layout.d.ts +24 -0
- package/es6/pdf-web-viewer/state/layout.js +21 -0
- package/es6/pdf-web-viewer/state/mobile.d.ts +16 -0
- package/es6/pdf-web-viewer/state/mobile.js +11 -0
- package/es6/pdf-web-viewer/state/navigationPanel.d.ts +61 -0
- package/es6/pdf-web-viewer/state/navigationPanel.js +84 -0
- package/es6/pdf-web-viewer/state/passwordForm.d.ts +18 -0
- package/es6/pdf-web-viewer/state/passwordForm.js +21 -0
- package/es6/pdf-web-viewer/state/pdfDocument.d.ts +31 -0
- package/es6/pdf-web-viewer/state/pdfDocument.js +41 -0
- package/es6/pdf-web-viewer/state/search.d.ts +29 -0
- package/es6/pdf-web-viewer/state/search.js +23 -0
- package/es6/pdf-web-viewer/views/App.d.ts +4 -0
- package/es6/pdf-web-viewer/views/App.js +19 -0
- package/es6/pdf-web-viewer/views/CustomButtons.d.ts +9 -0
- package/es6/pdf-web-viewer/views/CustomButtons.js +18 -0
- package/es6/pdf-web-viewer/views/DropZone.d.ts +9 -0
- package/es6/pdf-web-viewer/views/DropZone.js +53 -0
- package/es6/pdf-web-viewer/views/Layout.d.ts +4 -0
- package/es6/pdf-web-viewer/views/Layout.js +22 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.js +21 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.js +35 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.js +22 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.js +26 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.js +36 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.js +80 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.js +74 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.js +83 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.d.ts +10 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.js +55 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.js +52 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.js +18 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.js +25 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.js +6 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/Modal.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/Modal.js +39 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.js +30 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.js +13 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.js +54 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.js +32 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.js +26 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.js +158 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.js +11 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.js +50 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.d.ts +12 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.js +19 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.js +10 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.d.ts +16 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.js +32 -0
- package/package.json +24 -0
- package/pdfwebviewer/PdfViewing.data +0 -0
- package/pdfwebviewer/PdfViewing_Main.js +1 -0
- package/pdfwebviewer/PdfViewing_Main.wasm +0 -0
- package/pdfwebviewer/PdfViewing_Worker.js +1 -0
- package/pdfwebviewer/PdfViewing_Worker.wasm +0 -0
- package/pdfwebviewer/pdf-web-viewer.css +2407 -0
- package/pdfwebviewer/pdf-web-viewer.development.js +25955 -0
- package/pdfwebviewer/pdf-web-viewer.min.js +1 -0
- package/pdfwebviewer/translations.de.json +151 -0
- package/pdfwebviewer/translations.en.json +151 -0
- package/pdfwebviewer/translations.fr.json +151 -0
- package/pdfwebviewer/translations.it.json +151 -0
- package/scss/common/_breakpoints.scss +44 -0
- package/scss/common/_buttons.scss +42 -0
- package/scss/common/_colorpicker.scss +89 -0
- package/scss/common/_common.scss +21 -0
- package/scss/common/_contextbar.scss +44 -0
- package/scss/common/_dropdown.scss +176 -0
- package/scss/common/_icon.scss +9 -0
- package/scss/common/_index.scss +19 -0
- package/scss/common/_loader.scss +30 -0
- package/scss/common/_rangeslider.scss +24 -0
- package/scss/common/_scrollbars.scss +64 -0
- package/scss/common/_stroke-style-picker.scss +64 -0
- package/scss/common/_stroke-width-picker.scss +23 -0
- package/scss/common/_toolbar.scss +117 -0
- package/scss/common/_tooltip.scss +39 -0
- package/scss/modules/_eraser.scss +28 -0
- package/scss/modules/_forms.scss +56 -0
- package/scss/modules/_highlightannotation.scss +12 -0
- package/scss/modules/_index.scss +5 -0
- package/scss/modules/_inkannotation.scss +41 -0
- package/scss/modules/_stampannotation.scss +19 -0
- package/scss/pdf-viewer-canvas/_annotationborder.scss +107 -0
- package/scss/pdf-viewer-canvas/_busy-loader.scss +53 -0
- package/scss/pdf-viewer-canvas/_freetexteditor.scss +28 -0
- package/scss/pdf-viewer-canvas/_index.scss +7 -0
- package/scss/pdf-viewer-canvas/_layout.scss +52 -0
- package/scss/pdf-viewer-canvas/_popup.scss +217 -0
- package/scss/pdf-viewer-canvas/_printservice.scss +171 -0
- package/scss/pdf-viewer-canvas/_textselection.scss +17 -0
- package/scss/pdf-web-viewer/_annotationbar.scss +47 -0
- package/scss/pdf-web-viewer/_index.scss +8 -0
- package/scss/pdf-web-viewer/_layout.scss +63 -0
- package/scss/pdf-web-viewer/_modal.scss +186 -0
- package/scss/pdf-web-viewer/_navigationpanel.scss +398 -0
- package/scss/pdf-web-viewer/_searchbar.scss +47 -0
- package/scss/pdf-web-viewer/_toolbar.scss +134 -0
- package/scss/pdf-web-viewer/_viewer.scss +54 -0
- package/scss/pdf-web-viewer.scss +1 -0
- package/scss/themes/default/_light.scss +32 -0
- package/scss/themes/default/_mixins.scss +129 -0
- package/scss/themes/default/_theme.scss +161 -0
- package/scss/themes/pdf-web-viewer.scss +1 -0
- package/umd/pdf-web-viewer.development.js +25955 -0
- package/umd/pdf-web-viewer.development.js.map +1 -0
- package/umd/pdf-web-viewer.min.js +1 -0
- package/wasm/PdfViewing.data +0 -0
- package/wasm/PdfViewing_Main.js +1 -0
- package/wasm/PdfViewing_Main.wasm +0 -0
- package/wasm/PdfViewing_Worker.js +1 -0
- package/wasm/PdfViewing_Worker.wasm +0 -0
- package/wasm/translations.de.json +151 -0
- package/wasm/translations.en.json +151 -0
- package/wasm/translations.fr.json +151 -0
- package/wasm/translations.it.json +151 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as Layout from './layout';
|
|
2
|
+
import * as PasswordForm from './passwordForm';
|
|
3
|
+
import * as NavigationPanel from './navigationPanel';
|
|
4
|
+
import * as PdfDocument from './pdfDocument';
|
|
5
|
+
import * as Search from './search';
|
|
6
|
+
import { defaultWebViewerOptions } from '../WebViewerOptions';
|
|
7
|
+
const defaultState = {
|
|
8
|
+
licenseFeatures: {
|
|
9
|
+
annotate: false,
|
|
10
|
+
fillFormFields: false,
|
|
11
|
+
pageRotation: false,
|
|
12
|
+
},
|
|
13
|
+
scriptsLoaded: false,
|
|
14
|
+
appInitialized: false,
|
|
15
|
+
fileDropEnabled: false,
|
|
16
|
+
hasDocument: false,
|
|
17
|
+
showPasswordForm: false,
|
|
18
|
+
passwordDialogTempPdfFile: null,
|
|
19
|
+
passwordDialogTempFdfFile: null,
|
|
20
|
+
showOpenFileErrorDialog: false,
|
|
21
|
+
showUnsavedChangesDialog: false,
|
|
22
|
+
fileOpenArgs: null,
|
|
23
|
+
unsavedChangesDialogDontSave: false,
|
|
24
|
+
showLoadingIndicator: false,
|
|
25
|
+
showSaveIndicator: false,
|
|
26
|
+
hasError: false,
|
|
27
|
+
errorMessage: '',
|
|
28
|
+
layout: Layout.state,
|
|
29
|
+
passwordForm: PasswordForm.state,
|
|
30
|
+
navigationPanel: NavigationPanel.state,
|
|
31
|
+
pdfDocument: PdfDocument.state,
|
|
32
|
+
search: Search.state,
|
|
33
|
+
options: defaultWebViewerOptions,
|
|
34
|
+
canvasModules: [],
|
|
35
|
+
closeCallback: undefined,
|
|
36
|
+
};
|
|
37
|
+
/** internal */
|
|
38
|
+
export const createState = (options) => {
|
|
39
|
+
const state = Object.assign(Object.assign({}, JSON.parse(JSON.stringify(defaultState))), { options });
|
|
40
|
+
const { sidebar } = options.viewer;
|
|
41
|
+
if (sidebar.selectedNavigation) {
|
|
42
|
+
state.navigationPanel.selectedNavigation = sidebar.selectedNavigation;
|
|
43
|
+
state.navigationPanel.showNavigation = true;
|
|
44
|
+
}
|
|
45
|
+
else if (!sidebar.thumbnailNavigation) {
|
|
46
|
+
state.navigationPanel.selectedNavigation = sidebar.outlineNavigation ? 'outline' : 'annotation';
|
|
47
|
+
}
|
|
48
|
+
return state;
|
|
49
|
+
};
|
|
50
|
+
/** internal */
|
|
51
|
+
export const actions = {
|
|
52
|
+
layout: Layout.actions,
|
|
53
|
+
passwordForm: PasswordForm.actions,
|
|
54
|
+
navigationPanel: NavigationPanel.actions,
|
|
55
|
+
pdfDocument: PdfDocument.actions,
|
|
56
|
+
search: Search.actions,
|
|
57
|
+
loadScriptsCompleted: () => ($state) => (Object.assign(Object.assign({}, $state), { scriptsLoaded: true })),
|
|
58
|
+
initializeAppFulfilled: (settings) => ($state) => (Object.assign(Object.assign({}, $state), { licenseFeatures: settings.licenseFeatures, appInitialized: true, fileDropEnabled: true })),
|
|
59
|
+
initializeAppRejected: (error) => ($state) => (Object.assign(Object.assign({}, $state), { hasError: true, errorMessage: error, appInitialized: true })),
|
|
60
|
+
setCanvasModules: (canvasModules) => ($state) => (Object.assign(Object.assign({}, $state), { canvasModules: canvasModules })),
|
|
61
|
+
loadDocumentBegin: () => ($state) => {
|
|
62
|
+
return Object.assign(Object.assign({}, $state), { fileDropEnabled: false, showLoadingIndicator: true, unsavedChangesDialogDontSave: false });
|
|
63
|
+
},
|
|
64
|
+
loadDocumentFulfilled: () => ($state) => {
|
|
65
|
+
return Object.assign(Object.assign({}, $state), { hasDocument: true, fileDropEnabled: true, showPasswordForm: false, passwordDialogTempPdfFile: null, showLoadingIndicator: false });
|
|
66
|
+
},
|
|
67
|
+
loadDocumentCancel: () => ($state) => (Object.assign(Object.assign({}, $state), { hasDocument: false, fileDropEnabled: true, showPasswordForm: false, passwordDialogTempPdfFile: null, showLoadingIndicator: false })),
|
|
68
|
+
loadDocumentRejected: (error) => ($state) => (Object.assign(Object.assign({}, $state), { fileDropEnabled: false, passwordDialogTempPdfFile: null, showPasswordForm: false, showLoadingIndicator: false, showOpenFileErrorDialog: true })),
|
|
69
|
+
loadDocumentConfirmRejected: () => ($state) => (Object.assign(Object.assign({}, $state), { fileDropEnabled: true, showOpenFileErrorDialog: false })),
|
|
70
|
+
loadDocumentPasswordForm: (fileOpenArgs) => ($state) => {
|
|
71
|
+
$state.passwordForm.invalidPasswordError =
|
|
72
|
+
!!fileOpenArgs.password && fileOpenArgs.password.length > 0;
|
|
73
|
+
return Object.assign(Object.assign({}, $state), { fileOpenArgs, showPasswordForm: true, showLoadingIndicator: false });
|
|
74
|
+
},
|
|
75
|
+
closeDocument: () => ($state) => (Object.assign(Object.assign({}, JSON.parse(JSON.stringify(defaultState))), { appInitialized: true, scriptsLoaded: true, fileDropEnabled: true, options: $state.options, licenseFeatures: $state.licenseFeatures })),
|
|
76
|
+
// tslint:disable-next-line: max-line-length
|
|
77
|
+
showConfirmUnsavedChangesDialog: (fileOpenArgs, closeCallback) => ($state) => {
|
|
78
|
+
return Object.assign(Object.assign({}, $state), { fileOpenArgs,
|
|
79
|
+
closeCallback, showUnsavedChangesDialog: true });
|
|
80
|
+
},
|
|
81
|
+
unsavedChangesDialogCancel: () => ($state) => {
|
|
82
|
+
return Object.assign(Object.assign({}, $state), { showUnsavedChangesDialog: false, showLoadingIndicator: false, hasDocument: true, closeCallback: undefined });
|
|
83
|
+
},
|
|
84
|
+
unsavedChangesDialogFileSaved: () => ($state) => {
|
|
85
|
+
return Object.assign(Object.assign({}, $state), { unsavedChangesDialogTempPdfFile: null, unsavedChangesDialogTempFdfFile: null, showUnsavedChangesDialog: false, closeCallback: undefined });
|
|
86
|
+
},
|
|
87
|
+
unsavedChangesDialogDontSave: () => ($state) => {
|
|
88
|
+
return Object.assign(Object.assign({}, $state), { unsavedChangesDialogDontSave: false, showUnsavedChangesDialog: false, hasDocument: false });
|
|
89
|
+
},
|
|
90
|
+
saveDocumentBegin: (error) => ($state) => (Object.assign(Object.assign({}, $state), { showSaveIndicator: true })),
|
|
91
|
+
saveDocumentFulfilled: (error) => ($state) => (Object.assign(Object.assign({}, $state), { showSaveIndicator: false })),
|
|
92
|
+
saveDocumentRejected: (error) => ($state) => (Object.assign(Object.assign({}, $state), { hasError: true, errorMessage: error, appInitialized: true, showSaveIndicator: false })),
|
|
93
|
+
setError: (error) => ($state) => (Object.assign(Object.assign({}, $state), { hasError: true, errorMessage: error })),
|
|
94
|
+
getState: () => ($state) => {
|
|
95
|
+
return Object.assign({}, $state);
|
|
96
|
+
},
|
|
97
|
+
open: (file) => ($state) => (Object.assign({}, $state)),
|
|
98
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActionsType } from '../../lib/hyperapp';
|
|
2
|
+
export declare enum DeviceType {
|
|
3
|
+
Mobile = 0,
|
|
4
|
+
Desktop = 1
|
|
5
|
+
}
|
|
6
|
+
export declare enum ScreenSize {
|
|
7
|
+
Small = 600,
|
|
8
|
+
Medium = 900,
|
|
9
|
+
Large = 1200
|
|
10
|
+
}
|
|
11
|
+
/** internal */
|
|
12
|
+
export interface LayoutState {
|
|
13
|
+
screenSize: ScreenSize;
|
|
14
|
+
deviceType: DeviceType;
|
|
15
|
+
}
|
|
16
|
+
/** internal */
|
|
17
|
+
export declare const state: LayoutState;
|
|
18
|
+
/** internal */
|
|
19
|
+
export interface LayoutActions {
|
|
20
|
+
setScreenSize(screenSize: ScreenSize): LayoutState;
|
|
21
|
+
setDeviceType(deviceType: DeviceType): LayoutState;
|
|
22
|
+
}
|
|
23
|
+
/** internal */
|
|
24
|
+
export declare const actions: ActionsType<LayoutState, LayoutActions>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var DeviceType;
|
|
2
|
+
(function (DeviceType) {
|
|
3
|
+
DeviceType[DeviceType["Mobile"] = 0] = "Mobile";
|
|
4
|
+
DeviceType[DeviceType["Desktop"] = 1] = "Desktop";
|
|
5
|
+
})(DeviceType || (DeviceType = {}));
|
|
6
|
+
export var ScreenSize;
|
|
7
|
+
(function (ScreenSize) {
|
|
8
|
+
ScreenSize[ScreenSize["Small"] = 600] = "Small";
|
|
9
|
+
ScreenSize[ScreenSize["Medium"] = 900] = "Medium";
|
|
10
|
+
ScreenSize[ScreenSize["Large"] = 1200] = "Large";
|
|
11
|
+
})(ScreenSize || (ScreenSize = {}));
|
|
12
|
+
/** internal */
|
|
13
|
+
export const state = {
|
|
14
|
+
screenSize: ScreenSize.Medium,
|
|
15
|
+
deviceType: DeviceType.Desktop,
|
|
16
|
+
};
|
|
17
|
+
/** internal */
|
|
18
|
+
export const actions = {
|
|
19
|
+
setScreenSize: (screenSize) => ($state) => (Object.assign(Object.assign({}, $state), { screenSize })),
|
|
20
|
+
setDeviceType: (deviceType) => ($state) => (Object.assign(Object.assign({}, $state), { deviceType })),
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionsType } from '../../lib/hyperapp';
|
|
2
|
+
/** internal */
|
|
3
|
+
export interface MobileState {
|
|
4
|
+
showToolbar: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** internal */
|
|
7
|
+
export declare const state: MobileState;
|
|
8
|
+
/** internal */
|
|
9
|
+
export interface MobileActions {
|
|
10
|
+
showToolbar(): MobileState;
|
|
11
|
+
hideToolbar(): MobileState;
|
|
12
|
+
showAnnotationbar(): MobileState;
|
|
13
|
+
hideAnnotationbar(): MobileState;
|
|
14
|
+
}
|
|
15
|
+
/** internal */
|
|
16
|
+
export declare const actions: ActionsType<MobileState, MobileActions>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
showToolbar: true,
|
|
4
|
+
};
|
|
5
|
+
/** internal */
|
|
6
|
+
export const actions = {
|
|
7
|
+
showToolbar: () => ($state) => (Object.assign(Object.assign({}, $state), { showToolbar: true })),
|
|
8
|
+
hideToolbar: () => ($state) => (Object.assign(Object.assign({}, $state), { showToolbar: false })),
|
|
9
|
+
showAnnotationbar: () => ($state) => (Object.assign(Object.assign({}, $state), { showToolbar: false })),
|
|
10
|
+
hideAnnotationbar: () => ($state) => (Object.assign(Object.assign({}, $state), { showToolbar: true })),
|
|
11
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ActionsType } from '../../lib/hyperapp';
|
|
2
|
+
import { OutlineItem, Annotation, PdfItemsOnPage, DeletedItem } from '../../pdf-viewer-api';
|
|
3
|
+
type NavigationType = 'thumbnail' | 'outline' | 'annotation';
|
|
4
|
+
/** internal */
|
|
5
|
+
export interface PageNavigationItem {
|
|
6
|
+
thumbnail: string | null;
|
|
7
|
+
pageNumber: number;
|
|
8
|
+
loading?: boolean | null;
|
|
9
|
+
}
|
|
10
|
+
/** internal */
|
|
11
|
+
export interface OutlineNavigationItem extends OutlineItem {
|
|
12
|
+
open: boolean;
|
|
13
|
+
hasDescendants: boolean;
|
|
14
|
+
descendants: OutlineNavigationItem[];
|
|
15
|
+
}
|
|
16
|
+
export interface AnnotationItemState {
|
|
17
|
+
[annotationId: number]: Annotation;
|
|
18
|
+
}
|
|
19
|
+
export interface AnnotationsState {
|
|
20
|
+
[page: number]: AnnotationItemState;
|
|
21
|
+
}
|
|
22
|
+
export interface AnnotationSelection {
|
|
23
|
+
page: number;
|
|
24
|
+
annotationId: number;
|
|
25
|
+
}
|
|
26
|
+
/** internal */
|
|
27
|
+
export interface NavigationPanelState {
|
|
28
|
+
showNavigation: boolean;
|
|
29
|
+
selectedNavigation: NavigationType;
|
|
30
|
+
outlineItemsLoaded: boolean;
|
|
31
|
+
annotationsLoaded: boolean;
|
|
32
|
+
pages: PageNavigationItem[];
|
|
33
|
+
outlines: OutlineNavigationItem[];
|
|
34
|
+
annotations: AnnotationsState;
|
|
35
|
+
selectedAnnotation?: AnnotationSelection;
|
|
36
|
+
}
|
|
37
|
+
/** internal */
|
|
38
|
+
export declare const state: NavigationPanelState;
|
|
39
|
+
/** internal */
|
|
40
|
+
export interface NavigationPanelActions {
|
|
41
|
+
clear(): NavigationPanelState;
|
|
42
|
+
setThumbnailPlaceholders(pageCount: number): NavigationPanelState;
|
|
43
|
+
updateThumbnail(pageThumbnail: PageNavigationItem): NavigationPanelState;
|
|
44
|
+
setOutlines(outline: OutlineNavigationItem[]): NavigationPanelState;
|
|
45
|
+
selectNavigation(navigation: NavigationType): NavigationPanelState;
|
|
46
|
+
toggleNavigationPanel(): NavigationPanelState;
|
|
47
|
+
showNavigationPanel(): NavigationPanelState;
|
|
48
|
+
hideNavigationPanel(): NavigationPanelState;
|
|
49
|
+
toggleOutlineItem(path: string[]): NavigationPanelState;
|
|
50
|
+
clearAnnotations(): NavigationPanelState;
|
|
51
|
+
setAnnotationLoaded(): NavigationPanelState;
|
|
52
|
+
initAnnotations(pageCount: number): NavigationPanelState;
|
|
53
|
+
setPageAnnotations(itemsOnPage: PdfItemsOnPage): NavigationPanelState;
|
|
54
|
+
updateAnnotation(annotation: Annotation): NavigationPanelState;
|
|
55
|
+
deleteAnnotation(deletedItem: DeletedItem): NavigationPanelState;
|
|
56
|
+
selectAnnotation(annotation: Annotation): NavigationPanelState;
|
|
57
|
+
deselectAnnotation(): NavigationPanelState;
|
|
58
|
+
}
|
|
59
|
+
/** internal */
|
|
60
|
+
export declare const actions: ActionsType<NavigationPanelState, NavigationPanelActions>;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
showNavigation: false,
|
|
4
|
+
selectedNavigation: 'thumbnail',
|
|
5
|
+
outlineItemsLoaded: false,
|
|
6
|
+
annotationsLoaded: false,
|
|
7
|
+
pages: [],
|
|
8
|
+
outlines: [],
|
|
9
|
+
annotations: {},
|
|
10
|
+
};
|
|
11
|
+
/** internal */
|
|
12
|
+
export const actions = {
|
|
13
|
+
clear: () => ($state) => (Object.assign(Object.assign({}, $state), { outlineItemsLoaded: false, pages: [], outlines: [], annotations: [] })),
|
|
14
|
+
setThumbnailPlaceholders: (pageCount) => ($state) => {
|
|
15
|
+
const pages = [];
|
|
16
|
+
for (let i = 0; i < pageCount; i++) {
|
|
17
|
+
pages.push({
|
|
18
|
+
thumbnail: null,
|
|
19
|
+
loading: null,
|
|
20
|
+
pageNumber: i + 1,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return Object.assign(Object.assign({}, $state), { pages });
|
|
24
|
+
},
|
|
25
|
+
updateThumbnail: (newThumbnail) => ($state) => (Object.assign(Object.assign({}, $state), { pages: $state.pages.map((p) => (p.pageNumber === newThumbnail.pageNumber ? newThumbnail : p)) })),
|
|
26
|
+
setOutlines: (outlines) => ($state) => (Object.assign(Object.assign({}, $state), { outlineItemsLoaded: true, outlines })),
|
|
27
|
+
toggleNavigationPanel: () => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: !$state.showNavigation })),
|
|
28
|
+
showNavigationPanel: () => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: true })),
|
|
29
|
+
hideNavigationPanel: () => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: false })),
|
|
30
|
+
selectNavigation: (navigation) => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: true, selectedNavigation: navigation })),
|
|
31
|
+
toggleOutlineItem: (path) => ($state) => {
|
|
32
|
+
const newState = Object.assign({}, $state);
|
|
33
|
+
let currentItem = { descendants: newState.outlines, open: false };
|
|
34
|
+
path.forEach((id) => {
|
|
35
|
+
const nextItem = currentItem.descendants.find((item) => item.id.toString() === id);
|
|
36
|
+
if (nextItem) {
|
|
37
|
+
currentItem = nextItem;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
currentItem.open = !currentItem.open;
|
|
41
|
+
return newState;
|
|
42
|
+
},
|
|
43
|
+
clearAnnotations: () => ($state) => (Object.assign(Object.assign({}, $state), { annotations: {}, selectedAnnotation: undefined, annotationsLoaded: false })),
|
|
44
|
+
setAnnotationLoaded: () => ($state) => (Object.assign(Object.assign({}, $state), { annotationsLoaded: true })),
|
|
45
|
+
initAnnotations: (pageCount) => ($state) => {
|
|
46
|
+
const annotations = {};
|
|
47
|
+
for (let i = 1; i <= pageCount; i++) {
|
|
48
|
+
annotations[i] = {};
|
|
49
|
+
}
|
|
50
|
+
return Object.assign(Object.assign({}, $state), { annotations });
|
|
51
|
+
},
|
|
52
|
+
setPageAnnotations: (itemsOnPage) => ($state) => {
|
|
53
|
+
const itemState = {};
|
|
54
|
+
itemsOnPage.items.forEach((an) => {
|
|
55
|
+
const annotation = an;
|
|
56
|
+
itemState[annotation.id] = annotation;
|
|
57
|
+
});
|
|
58
|
+
return Object.assign(Object.assign({}, $state), { annotations: Object.assign(Object.assign({}, $state.annotations), { [itemsOnPage.page]: itemState }) });
|
|
59
|
+
},
|
|
60
|
+
updateAnnotation: (annotation) => ($state) => {
|
|
61
|
+
const page = annotation.pdfRect.page;
|
|
62
|
+
const id = annotation.id;
|
|
63
|
+
const itemsOnPage = $state.annotations[page] ? Object.assign({}, $state.annotations[page]) : {};
|
|
64
|
+
itemsOnPage[id] = annotation;
|
|
65
|
+
return Object.assign(Object.assign({}, $state), { annotations: Object.assign(Object.assign({}, $state.annotations), { [page]: itemsOnPage }) });
|
|
66
|
+
},
|
|
67
|
+
deleteAnnotation: (deletedItem) => ($state) => {
|
|
68
|
+
const page = deletedItem.page;
|
|
69
|
+
const id = deletedItem.id;
|
|
70
|
+
const itemsOnPage = $state.annotations[page];
|
|
71
|
+
if (!itemsOnPage) {
|
|
72
|
+
return Object.assign({}, $state);
|
|
73
|
+
}
|
|
74
|
+
delete itemsOnPage[id];
|
|
75
|
+
return Object.assign(Object.assign({}, $state), { annotations: Object.assign(Object.assign({}, $state.annotations), { [page]: itemsOnPage }) });
|
|
76
|
+
},
|
|
77
|
+
selectAnnotation: (annotation) => ($state) => {
|
|
78
|
+
return Object.assign(Object.assign({}, $state), { selectedAnnotation: {
|
|
79
|
+
page: annotation.pdfRect.page,
|
|
80
|
+
annotationId: annotation.id,
|
|
81
|
+
} });
|
|
82
|
+
},
|
|
83
|
+
deselectAnnotation: () => ($state) => (Object.assign(Object.assign({}, $state), { selectedAnnotation: undefined })),
|
|
84
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionsType } from '../../lib/hyperapp';
|
|
2
|
+
/** internal */
|
|
3
|
+
export interface PasswordFormState {
|
|
4
|
+
password: string;
|
|
5
|
+
passwordRequiredError: boolean;
|
|
6
|
+
invalidPasswordError: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** internal */
|
|
9
|
+
export declare const state: PasswordFormState;
|
|
10
|
+
/** internal */
|
|
11
|
+
export interface PasswordFormActions {
|
|
12
|
+
clear(): PasswordFormState;
|
|
13
|
+
updatePassword(breakPoint: string): PasswordFormState;
|
|
14
|
+
validateForm(): PasswordFormState;
|
|
15
|
+
setInvalidPasswordError(): PasswordFormState;
|
|
16
|
+
}
|
|
17
|
+
/** internal */
|
|
18
|
+
export declare const actions: ActionsType<PasswordFormState, PasswordFormActions>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
password: '',
|
|
4
|
+
passwordRequiredError: false,
|
|
5
|
+
invalidPasswordError: false,
|
|
6
|
+
};
|
|
7
|
+
/** internal */
|
|
8
|
+
export const actions = {
|
|
9
|
+
clear: () => ($state) => ({
|
|
10
|
+
password: '',
|
|
11
|
+
passwordRequiredError: false,
|
|
12
|
+
invalidPasswordError: false,
|
|
13
|
+
}),
|
|
14
|
+
updatePassword: (password) => ($state) => {
|
|
15
|
+
return Object.assign(Object.assign({}, $state), { password });
|
|
16
|
+
},
|
|
17
|
+
validateForm: () => ($state) => {
|
|
18
|
+
return Object.assign(Object.assign({}, $state), { invalidPasswordError: false, passwordRequiredError: $state.password === '' });
|
|
19
|
+
},
|
|
20
|
+
setInvalidPasswordError: () => ($state) => (Object.assign(Object.assign({}, $state), { invalidPasswordError: true })),
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ActionsType } from '../../lib/hyperapp';
|
|
2
|
+
import { InputFile, InputUri } from '../../pdf-viewer-api';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface PdfDocumentState {
|
|
5
|
+
filename: string;
|
|
6
|
+
mimetype: string;
|
|
7
|
+
hasChanges: boolean;
|
|
8
|
+
zoom: number;
|
|
9
|
+
fitMode: number;
|
|
10
|
+
pageLayoutMode: number;
|
|
11
|
+
pageCount: number;
|
|
12
|
+
firstVisiblePage: number;
|
|
13
|
+
lastVisiblePage: number;
|
|
14
|
+
pageNumber: number;
|
|
15
|
+
}
|
|
16
|
+
/** internal */
|
|
17
|
+
export declare const state: PdfDocumentState;
|
|
18
|
+
/** internal */
|
|
19
|
+
export interface PdfDocumentActions {
|
|
20
|
+
setZoom(zoom: number): PdfDocumentState;
|
|
21
|
+
setHasChanges(hasChanges: boolean): PdfDocumentState;
|
|
22
|
+
setFitMode(fitMode: number): PdfDocumentState;
|
|
23
|
+
setPageLayoutMode(fitMode: number): PdfDocumentState;
|
|
24
|
+
setPageCount(page: number): PdfDocumentState;
|
|
25
|
+
setFirstVisiblePage(page: number): PdfDocumentState;
|
|
26
|
+
setLastVisiblePage(page: number): PdfDocumentState;
|
|
27
|
+
setPageNumber(page: number): PdfDocumentState;
|
|
28
|
+
setFileInfo(inputDocument: InputFile | InputUri): PdfDocumentState;
|
|
29
|
+
}
|
|
30
|
+
/** internal */
|
|
31
|
+
export declare const actions: ActionsType<PdfDocumentState, PdfDocumentActions>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PdfFitMode, PdfPageLayoutMode, } from '../../pdf-viewer-api';
|
|
2
|
+
/** internal */
|
|
3
|
+
export const state = {
|
|
4
|
+
filename: '',
|
|
5
|
+
mimetype: '',
|
|
6
|
+
hasChanges: false,
|
|
7
|
+
zoom: 100,
|
|
8
|
+
fitMode: PdfFitMode.NONE,
|
|
9
|
+
pageLayoutMode: PdfPageLayoutMode.ONE_COLUMN,
|
|
10
|
+
firstVisiblePage: 0,
|
|
11
|
+
lastVisiblePage: 0,
|
|
12
|
+
pageNumber: 0,
|
|
13
|
+
pageCount: 0,
|
|
14
|
+
};
|
|
15
|
+
/** internal */
|
|
16
|
+
export const actions = {
|
|
17
|
+
setZoom: (zoom) => ($state) => (Object.assign(Object.assign({}, $state), { zoom })),
|
|
18
|
+
setFitMode: (fitMode) => ($state) => (Object.assign(Object.assign({}, $state), { fitMode })),
|
|
19
|
+
setPageLayoutMode: (pageLayoutMode) => ($state) => (Object.assign(Object.assign({}, $state), { pageLayoutMode })),
|
|
20
|
+
setHasChanges: (hasChanges) => ($state) => (Object.assign(Object.assign({}, $state), { hasChanges })),
|
|
21
|
+
setFirstVisiblePage: (page) => ($state) => {
|
|
22
|
+
const firstVisiblePage = page <= 1 ? 1 : page < $state.pageCount ? page : $state.pageCount;
|
|
23
|
+
return Object.assign(Object.assign({}, $state), { firstVisiblePage });
|
|
24
|
+
},
|
|
25
|
+
setLastVisiblePage: (page) => ($state) => {
|
|
26
|
+
const lastVisiblePage = page <= 1 ? 1 : page < $state.pageCount ? page : $state.pageCount;
|
|
27
|
+
return Object.assign(Object.assign({}, $state), { lastVisiblePage });
|
|
28
|
+
},
|
|
29
|
+
setPageNumber: (page) => ($state) => {
|
|
30
|
+
let pageNumber;
|
|
31
|
+
if ($state.pageCount === 0)
|
|
32
|
+
pageNumber = page;
|
|
33
|
+
else
|
|
34
|
+
pageNumber = page = page <= 1 ? 1 : page < $state.pageCount ? page : $state.pageCount;
|
|
35
|
+
return Object.assign(Object.assign({}, $state), { pageNumber });
|
|
36
|
+
},
|
|
37
|
+
setPageCount: (pageCount) => ($state) => {
|
|
38
|
+
return Object.assign(Object.assign({}, $state), { pageCount });
|
|
39
|
+
},
|
|
40
|
+
setFileInfo: (inputDocument) => ($state) => (Object.assign(Object.assign({}, $state), { filename: inputDocument.sourceTag, mimetype: 'application/pdf' })),
|
|
41
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ActionsType } from '../../lib/hyperapp';
|
|
2
|
+
import { QuadrilateralOnPage } from '../../pdf-viewer-api';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface SearchState {
|
|
5
|
+
showSearch: boolean;
|
|
6
|
+
searchString: '';
|
|
7
|
+
caseSensitive: boolean;
|
|
8
|
+
wrapSearch: boolean;
|
|
9
|
+
useRegex: boolean;
|
|
10
|
+
page: number;
|
|
11
|
+
match: QuadrilateralOnPage[] | null;
|
|
12
|
+
painted: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** internal */
|
|
15
|
+
export declare const state: SearchState;
|
|
16
|
+
/** internal */
|
|
17
|
+
export interface SearchActions {
|
|
18
|
+
updateToSearch(searchString: string): SearchState;
|
|
19
|
+
openSearch(): SearchState;
|
|
20
|
+
closeSearch(): SearchState;
|
|
21
|
+
toggleCaseSensitive(): SearchState;
|
|
22
|
+
toggleWrappingSearch(): SearchState;
|
|
23
|
+
toggleRegex(): SearchState;
|
|
24
|
+
setCaseSensitive(enabled: boolean): SearchState;
|
|
25
|
+
setWrappingSearch(enabled: boolean): SearchState;
|
|
26
|
+
setRegex(enabled: boolean): SearchState;
|
|
27
|
+
}
|
|
28
|
+
/** internal */
|
|
29
|
+
export declare const actions: ActionsType<SearchState, SearchActions>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
showSearch: false,
|
|
4
|
+
searchString: '',
|
|
5
|
+
caseSensitive: false,
|
|
6
|
+
wrapSearch: false,
|
|
7
|
+
useRegex: false,
|
|
8
|
+
page: 1,
|
|
9
|
+
match: null,
|
|
10
|
+
painted: false,
|
|
11
|
+
};
|
|
12
|
+
/** internal */
|
|
13
|
+
export const actions = {
|
|
14
|
+
updateToSearch: (searchString) => ($state) => (Object.assign(Object.assign({}, $state), { searchString })),
|
|
15
|
+
openSearch: () => ($state) => (Object.assign(Object.assign({}, $state), { showSearch: true })),
|
|
16
|
+
closeSearch: () => ($state) => (Object.assign(Object.assign({}, $state), { searchString: '', showSearch: false })),
|
|
17
|
+
toggleCaseSensitive: () => ($state) => (Object.assign(Object.assign({}, $state), { caseSensitive: !$state.caseSensitive })),
|
|
18
|
+
toggleWrappingSearch: () => ($state) => (Object.assign(Object.assign({}, $state), { wrapSearch: !$state.wrapSearch })),
|
|
19
|
+
toggleRegex: () => ($state) => (Object.assign(Object.assign({}, $state), { useRegex: !$state.useRegex })),
|
|
20
|
+
setCaseSensitive: (enabled) => ($state) => (Object.assign(Object.assign({}, $state), { caseSensitive: enabled })),
|
|
21
|
+
setWrappingSearch: (enabled) => ($state) => (Object.assign(Object.assign({}, $state), { wrapSearch: enabled })),
|
|
22
|
+
setRegex: (enabled) => ($state) => (Object.assign(Object.assign({}, $state), { useRegex: enabled })),
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { h } from '../../lib/hyperapp';
|
|
2
|
+
import { classNames } from '../../common/classNames';
|
|
3
|
+
import { ScreenSize } from '../state/layout';
|
|
4
|
+
import { Layout } from './Layout';
|
|
5
|
+
import { DropZone } from './DropZone';
|
|
6
|
+
import { Modal } from './modal/Modal';
|
|
7
|
+
/** internal */
|
|
8
|
+
export const App = () => (state, actions) => {
|
|
9
|
+
const sizeCssClassName = state.layout.screenSize === ScreenSize.Small
|
|
10
|
+
? 'sm'
|
|
11
|
+
: state.layout.screenSize === ScreenSize.Medium
|
|
12
|
+
? 'md'
|
|
13
|
+
: 'lg';
|
|
14
|
+
return (h(DropZone, { className: classNames('pwv-WebViewer', `pwv-WebViewer--${sizeCssClassName}`), enabled: state.options.viewer.permissions.allowFileDrop &&
|
|
15
|
+
state.fileDropEnabled &&
|
|
16
|
+
state.options.viewer.permissions.allowOpenFile, onFileSelected: (file) => actions.api.open({ pdfFile: { data: file, sourceTag: file.name } }) },
|
|
17
|
+
state.scriptsLoaded && h(Layout, null),
|
|
18
|
+
h(Modal, null)));
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ViewComponent } from '../../lib/hyperapp';
|
|
2
|
+
import { PdfWebViewerState, PdfWebViewerActions } from '../PdfWebViewer';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface CustomButtonsProps {
|
|
5
|
+
location: string;
|
|
6
|
+
style: 'button' | 'listItem';
|
|
7
|
+
}
|
|
8
|
+
/** internal */
|
|
9
|
+
export declare const CustomButtons: ViewComponent<CustomButtonsProps, PdfWebViewerState, PdfWebViewerActions>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { h } from '../../lib/hyperapp';
|
|
2
|
+
import { tooltipManager } from '../../common/TooltipManager';
|
|
3
|
+
/** internal */
|
|
4
|
+
export const CustomButtons = ({ location, style }) => (state, actions) => {
|
|
5
|
+
const { customButtons } = state.options.viewer;
|
|
6
|
+
if (!customButtons ||
|
|
7
|
+
!customButtons.hasOwnProperty(location) ||
|
|
8
|
+
!customButtons[location].length) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const buttons = customButtons[location];
|
|
12
|
+
return style === 'button' ? (h("div", { class: "pwv-CustomButtons" }, buttons.map((ca) => (h("button", Object.assign({ oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(ca.text), { class: "pwv-ToolbarButton", onclick: ca.onClick }),
|
|
13
|
+
h("span", { class: "pwv-icon" },
|
|
14
|
+
h("img", { src: ca.icon }))))))) : (h("div", null, buttons.map((ca) => (h("button", { class: "pwv-DropdownItem", onclick: ca.onClick },
|
|
15
|
+
h("span", { class: "pwv-icon" },
|
|
16
|
+
h("img", { src: ca.icon })),
|
|
17
|
+
ca.text)))));
|
|
18
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { h } from '../../lib/hyperapp';
|
|
2
|
+
import { classNames } from '../../common/classNames';
|
|
3
|
+
let allowDropTimer = 0;
|
|
4
|
+
/** internal */
|
|
5
|
+
export const DropZone = ({ className, enabled, onFileSelected }, children) => {
|
|
6
|
+
const handleDragOver = (e) => {
|
|
7
|
+
e.preventDefault();
|
|
8
|
+
if (!enabled) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (e.dataTransfer) {
|
|
12
|
+
const dropContainer = e.currentTarget;
|
|
13
|
+
const items = e.dataTransfer.items;
|
|
14
|
+
if (items && items.length === 1 && items[0].type === 'application/pdf') {
|
|
15
|
+
dropContainer.classList.add('pwv-dropzone-dragover');
|
|
16
|
+
clearTimeout(allowDropTimer);
|
|
17
|
+
allowDropTimer = window.setTimeout(() => {
|
|
18
|
+
dropContainer.classList.remove('pwv-dropzone-dragover');
|
|
19
|
+
}, 150);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const handleDrop = (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if (e.dataTransfer) {
|
|
26
|
+
let pdfFile = null;
|
|
27
|
+
if (e.dataTransfer.items) {
|
|
28
|
+
/* tslint:disable-next-line */
|
|
29
|
+
for (let i = 0; i < e.dataTransfer.items.length; i++) {
|
|
30
|
+
const item = e.dataTransfer.items[i];
|
|
31
|
+
if (item.kind === 'file' && item.type === 'application/pdf') {
|
|
32
|
+
pdfFile = item.getAsFile();
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
/* tslint:disable-next-line */
|
|
39
|
+
for (let i = 0; i < e.dataTransfer.files.length; i++) {
|
|
40
|
+
const file = e.dataTransfer.files[i];
|
|
41
|
+
if (file.type === 'application/pdf') {
|
|
42
|
+
pdfFile = file;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (enabled && pdfFile !== null) {
|
|
48
|
+
onFileSelected(pdfFile);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return (h("div", { class: classNames(className, 'pwv-dropzone'), ondragover: handleDragOver, ondrop: handleDrop }, children));
|
|
53
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { h } from '../../lib/hyperapp';
|
|
2
|
+
import { classNames } from '../../common/classNames';
|
|
3
|
+
import { AppBar } from './appbar/AppBar';
|
|
4
|
+
import { Annotationbar } from './annotationbar/Annotationbar';
|
|
5
|
+
import { NavigationPanel } from './navigation/NavigationPanel';
|
|
6
|
+
/** internal */
|
|
7
|
+
export const Layout = ({}) => (state, actions) => {
|
|
8
|
+
const { disableAnnotationToolbar, annotationBarPosition } = state.options.viewer.general;
|
|
9
|
+
return (h("div", { class: classNames('pwv-Viewer', {
|
|
10
|
+
'pwv-Viewer--loadFile': state.showLoadingIndicator,
|
|
11
|
+
'pwv-Viewer--saveFile': state.showSaveIndicator,
|
|
12
|
+
}) },
|
|
13
|
+
h(AppBar, null),
|
|
14
|
+
h("div", { class: "pwv-ViewerContent" },
|
|
15
|
+
h("div", { class: classNames('pwv-document-view', `pwv-annotationbar-${annotationBarPosition}`) },
|
|
16
|
+
h("div", { oncreate: (element) => {
|
|
17
|
+
const a = actions;
|
|
18
|
+
a.createCanvasView(element);
|
|
19
|
+
} }),
|
|
20
|
+
!disableAnnotationToolbar && h(Annotationbar, null)),
|
|
21
|
+
h(NavigationPanel, null))));
|
|
22
|
+
};
|