@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,10 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
3
|
+
import { Loader } from '../../../common/Loader';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const LoadFile = ({}) => (h("div", { class: "pwv-modal pwv-modal--loadFile" },
|
|
6
|
+
h("div", { class: "pwv-modal-dialog" },
|
|
7
|
+
h("div", { class: "pwv-modal-body" },
|
|
8
|
+
h("div", { class: "pwv-modal-message" },
|
|
9
|
+
h("h2", null, translationManager.getText('loadFile.title')),
|
|
10
|
+
h(Loader, null))))));
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { OpenFile } from './OpenFile';
|
|
3
|
+
import { OpenFileError } from './OpenFileError';
|
|
4
|
+
import { UnsavedChanges } from './UnsavedChanges';
|
|
5
|
+
import { PasswordForm } from './PasswordForm';
|
|
6
|
+
import { LoadApplication } from './LoadApplication';
|
|
7
|
+
import { ApplicationError } from './ApplicationError';
|
|
8
|
+
import { LoadFile } from './LoadFile';
|
|
9
|
+
import { SaveFile } from './SaveFile';
|
|
10
|
+
/** internal */
|
|
11
|
+
export const Modal = ({}) => (state, actions) => {
|
|
12
|
+
if (state.hasError) {
|
|
13
|
+
return h(ApplicationError, null);
|
|
14
|
+
}
|
|
15
|
+
else if (!state.scriptsLoaded && !state.appInitialized) {
|
|
16
|
+
return h(LoadApplication, null);
|
|
17
|
+
}
|
|
18
|
+
else if (state.showOpenFileErrorDialog) {
|
|
19
|
+
return h(OpenFileError, null);
|
|
20
|
+
}
|
|
21
|
+
else if (state.showPasswordForm) {
|
|
22
|
+
return h(PasswordForm, null);
|
|
23
|
+
}
|
|
24
|
+
else if (state.showUnsavedChangesDialog) {
|
|
25
|
+
return h(UnsavedChanges, null);
|
|
26
|
+
}
|
|
27
|
+
else if (state.showLoadingIndicator) {
|
|
28
|
+
return h(LoadFile, null);
|
|
29
|
+
}
|
|
30
|
+
else if (state.showSaveIndicator) {
|
|
31
|
+
return h(SaveFile, null);
|
|
32
|
+
}
|
|
33
|
+
else if (!state.hasDocument) {
|
|
34
|
+
return h(OpenFile, null);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { Icon, icons } from '../../../common/Icon';
|
|
3
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
4
|
+
import { DeviceType } from '../../state/layout';
|
|
5
|
+
/** internal */
|
|
6
|
+
export const OpenFile = ({}) => (state, actions) => {
|
|
7
|
+
const handleFileSelected = (e) => {
|
|
8
|
+
if (e.currentTarget.files &&
|
|
9
|
+
e.currentTarget.files.length &&
|
|
10
|
+
e.currentTarget.files.length > 0) {
|
|
11
|
+
const file = e.currentTarget.files[0];
|
|
12
|
+
if (file.type === 'application/pdf') {
|
|
13
|
+
actions.api.open({ pdfFile: { data: file, sourceTag: file.name } });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const { permissions, callbacks } = state.options.viewer;
|
|
18
|
+
const { deviceType } = state.layout;
|
|
19
|
+
return (h("div", { class: "pwv-modal pwv-openfile pwv-modal--openFile" },
|
|
20
|
+
h("div", { class: "pwv-modal-dialog" },
|
|
21
|
+
h("div", { class: "pwv-modal-header" },
|
|
22
|
+
h(Icon, { icon: icons.pdfFile })),
|
|
23
|
+
h("div", { class: "pwv-modal-body" },
|
|
24
|
+
h("div", { class: "pwv-modal-message" }, deviceType === DeviceType.Desktop &&
|
|
25
|
+
permissions.allowFileDrop &&
|
|
26
|
+
permissions.allowOpenFile ? (h("h2", null, translationManager.getText('openFile.dropFileHere'))) : permissions.allowOpenFile ? (h("h2", null, translationManager.getText('openFile.openDocument'))) : (h("h2", null, translationManager.getText('openFile.openFileDisabled')))),
|
|
27
|
+
h("div", { class: "pwv-btn-row" }, permissions.allowOpenFile ? (callbacks.onOpenFileButtonClicked ? (h("button", { class: "pwv-btn", onclick: callbacks.onOpenFileButtonClicked }, translationManager.getText('openFile.selectFile'))) : (h("label", { class: "pwv-btn" },
|
|
28
|
+
translationManager.getText('openFile.selectFile'),
|
|
29
|
+
h("input", { type: "file", onchange: handleFileSelected, style: { display: 'none' } })))) : (h("div", null)))))));
|
|
30
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { Icon, icons } from '../../../common/Icon';
|
|
3
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const OpenFileError = ({}) => (state, actions) => (h("div", { class: "pwv-modal pwv-modal--openFileError" },
|
|
6
|
+
h("div", { class: "pwv-modal-dialog" },
|
|
7
|
+
h("div", { class: "pwv-modal-header" },
|
|
8
|
+
h(Icon, { icon: icons.fileError })),
|
|
9
|
+
h("div", { class: "pwv-modal-body" },
|
|
10
|
+
h("div", { class: "pwv-modal-message" },
|
|
11
|
+
h("p", null, translationManager.getText('openFileError.description'))),
|
|
12
|
+
h("div", { class: "pwv-btn-row" },
|
|
13
|
+
h("button", { class: "pwv-btn", onclick: actions.loadDocumentConfirmRejected }, translationManager.getText('openFileError.ok')))))));
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { Icon, icons } from '../../../common/Icon';
|
|
3
|
+
import { classNames } from '../../../common/classNames';
|
|
4
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
5
|
+
/** internal */
|
|
6
|
+
export const PasswordForm = ({}) => (state, actions) => {
|
|
7
|
+
const formIsValid = !state.passwordForm.passwordRequiredError &&
|
|
8
|
+
!state.passwordForm.invalidPasswordError &&
|
|
9
|
+
state.passwordForm.password !== '';
|
|
10
|
+
const shouldShowCancelButton = !state.options.viewer.general.hidePasswordFormCancelButton;
|
|
11
|
+
return (h("div", { class: "pwv-modal pwv-modal--passwordForm" },
|
|
12
|
+
h("div", { class: "pwv-modal-dialog" },
|
|
13
|
+
h("div", { class: "pwv-modal-header" },
|
|
14
|
+
h(Icon, { icon: icons.unlock })),
|
|
15
|
+
h("div", { class: "pwv-modal-body" },
|
|
16
|
+
h("form", { onsubmit: (e) => {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
const data = new FormData(e.currentTarget);
|
|
19
|
+
const password = data.get('password');
|
|
20
|
+
if (password) {
|
|
21
|
+
if (!state.fileOpenArgs) {
|
|
22
|
+
actions.loadDocumentRejected('error');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (state.fileOpenArgs) {
|
|
26
|
+
actions.api.open(Object.assign(Object.assign({}, state.fileOpenArgs), { password }));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
} },
|
|
30
|
+
h("div", { class: "pwv-modal-message" },
|
|
31
|
+
h("p", null, translationManager.getText('passwordForm.description'))),
|
|
32
|
+
h("div", { class: "pwv-form-row" },
|
|
33
|
+
h("div", { class: "pwv-form-field pwv-form-has-error-x" },
|
|
34
|
+
h("input", { type: "password", class: "pwv-input", name: "password", onkeyup: (e) => {
|
|
35
|
+
const inputValue = e.currentTarget.value;
|
|
36
|
+
if (inputValue === state.passwordForm.password)
|
|
37
|
+
return;
|
|
38
|
+
actions.passwordForm.updatePassword(inputValue);
|
|
39
|
+
actions.passwordForm.validateForm();
|
|
40
|
+
}, oncreate: (element) => {
|
|
41
|
+
element.focus();
|
|
42
|
+
} }),
|
|
43
|
+
state.passwordForm.invalidPasswordError && (h("div", { class: "pwv-form-error" },
|
|
44
|
+
h(Icon, { icon: icons.warning }),
|
|
45
|
+
h("span", null, translationManager.getText('passwordForm.invalidPasswordError')))),
|
|
46
|
+
state.passwordForm.passwordRequiredError && (h("div", { class: "pwv-form-error" },
|
|
47
|
+
h(Icon, { icon: icons.warning }),
|
|
48
|
+
h("span", null, translationManager.getText('passwordForm.passwordRequiredError')))))),
|
|
49
|
+
h("div", { class: "pwv-btn-row" },
|
|
50
|
+
h("button", { class: classNames('pwv-btn', {
|
|
51
|
+
'pwv-disabled': !formIsValid,
|
|
52
|
+
}), type: "submit", disabled: !formIsValid }, translationManager.getText('passwordForm.ok')),
|
|
53
|
+
shouldShowCancelButton && (h("button", { class: "pwv-btn", type: "button", onclick: actions.loadDocumentCancel }, translationManager.getText('passwordForm.cancel')))))))));
|
|
54
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
3
|
+
import { Loader } from '../../../common/Loader';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const SaveFile = ({}) => (state, actions) => (h("div", { class: "pwv-modal pwv-modal--saveFile" },
|
|
6
|
+
h("div", { class: "pwv-modal-dialog" },
|
|
7
|
+
h("div", { class: "pwv-modal-body" },
|
|
8
|
+
h("div", { class: "pwv-modal-message" },
|
|
9
|
+
h("h2", null, translationManager.getText('saveFile.title')),
|
|
10
|
+
h(Loader, null))))));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { Icon, icons } from '../../../common/Icon';
|
|
3
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const UnsavedChanges = ({}) => ($state, $actions) => (h("div", { class: "pwv-modal pwv-modal--unsavedChanges" },
|
|
6
|
+
h("div", { class: "pwv-modal-dialog" },
|
|
7
|
+
h("div", { class: "pwv-modal-header" },
|
|
8
|
+
h(Icon, { icon: icons.warning })),
|
|
9
|
+
h("div", { class: "pwv-modal-body" },
|
|
10
|
+
h("div", { class: "pwv-modal-message" },
|
|
11
|
+
h("p", null, translationManager.getText('unsavedChanges.description'))),
|
|
12
|
+
h("div", { class: "pwv-btn-row" },
|
|
13
|
+
h("button", { class: "pwv-btn", onclick: () => {
|
|
14
|
+
$actions.api.downloadFile().then(() => {
|
|
15
|
+
if ($state.closeCallback) {
|
|
16
|
+
$state.closeCallback();
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
$actions.unsavedChangesDialogFileSaved();
|
|
20
|
+
}
|
|
21
|
+
if ($state.fileOpenArgs) {
|
|
22
|
+
$actions.api.open($state.fileOpenArgs);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
} }, translationManager.getText('unsavedChanges.save')),
|
|
26
|
+
h("button", { class: "pwv-btn", onclick: () => {
|
|
27
|
+
$actions.unsavedChangesDialogDontSave();
|
|
28
|
+
if ($state.fileOpenArgs) {
|
|
29
|
+
$actions.api.open($state.fileOpenArgs);
|
|
30
|
+
}
|
|
31
|
+
} }, translationManager.getText('unsavedChanges.dontSave')),
|
|
32
|
+
h("button", { class: "pwv-btn", onclick: $actions.unsavedChangesDialogCancel }, translationManager.getText('unsavedChanges.cancel')))))));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewComponent } from '../../../lib/hyperapp';
|
|
2
|
+
import { PdfWebViewerState, PdfWebViewerActions } from '../../PdfWebViewer';
|
|
3
|
+
interface AnnotationListProps {
|
|
4
|
+
pageNumber: number;
|
|
5
|
+
}
|
|
6
|
+
/** internal */
|
|
7
|
+
export declare const AnnotationList: ViewComponent<AnnotationListProps, PdfWebViewerState, PdfWebViewerActions>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PdfItemType } from '../../../pdf-viewer-api/enums';
|
|
2
|
+
import { h } from '../../../lib/hyperapp';
|
|
3
|
+
import { AnnotationListItem } from './AnnotationListItem';
|
|
4
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
5
|
+
/** internal */
|
|
6
|
+
export const AnnotationList = (props) => (state, actions) => {
|
|
7
|
+
const { pageNumber } = props;
|
|
8
|
+
const annotationsObj = state.navigationPanel.annotations[pageNumber];
|
|
9
|
+
const selectedAnnotation = state.navigationPanel.selectedAnnotation;
|
|
10
|
+
const annotations = Object.keys(annotationsObj).map((k) => annotationsObj[k]);
|
|
11
|
+
const showHiddenAnnotations = state.options.annotation.hideOnDelete && state.options.annotation.trackHistory;
|
|
12
|
+
const sortedAnnotations = annotations
|
|
13
|
+
.filter((a) => a.itemType !== PdfItemType.WIDGET && (showHiddenAnnotations || a.isHidden() === false))
|
|
14
|
+
.sort((f, s) => s.pdfRect.pdfY - f.pdfRect.pdfY);
|
|
15
|
+
if (sortedAnnotations.length < 1) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (h("div", null,
|
|
19
|
+
h("h4", null,
|
|
20
|
+
translationManager.getText('sideNavigation.annotation.page'),
|
|
21
|
+
" ",
|
|
22
|
+
pageNumber),
|
|
23
|
+
h("ul", null, sortedAnnotations.map((annotation) => (h(AnnotationListItem, { annotation: annotation, selected: selectedAnnotation !== undefined &&
|
|
24
|
+
selectedAnnotation.page === annotation.pdfRect.page &&
|
|
25
|
+
selectedAnnotation.annotationId === annotation.id }))))));
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewComponent } from '../../../lib/hyperapp';
|
|
2
|
+
import { PdfWebViewerState, PdfWebViewerActions } from '../../PdfWebViewer';
|
|
3
|
+
import { Annotation } from '../../../pdf-viewer-api/types';
|
|
4
|
+
/** internal */
|
|
5
|
+
export declare const AnnotationListItem: ViewComponent<{
|
|
6
|
+
annotation: Annotation;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
}, PdfWebViewerState, PdfWebViewerActions>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
3
|
+
import { PdfItemType } from '../../../pdf-viewer-api/enums';
|
|
4
|
+
import { Icon, icons } from '../../../common/Icon';
|
|
5
|
+
import { classNames } from '../../../common/classNames';
|
|
6
|
+
import { formatDate } from '../../../common/Tools';
|
|
7
|
+
const AnnotationIcon = ({ annotaion }) => (state, actions) => {
|
|
8
|
+
const { itemType, color } = annotaion;
|
|
9
|
+
const bg = color ? color : undefined;
|
|
10
|
+
switch (itemType) {
|
|
11
|
+
case PdfItemType.HIGHLIGHT:
|
|
12
|
+
case PdfItemType.SQUIGGLY:
|
|
13
|
+
case PdfItemType.UNDERLINE:
|
|
14
|
+
case PdfItemType.STRIKE_OUT:
|
|
15
|
+
return h(Icon, { icon: icons.highlighter, bg: bg });
|
|
16
|
+
case PdfItemType.STAMP:
|
|
17
|
+
return h(Icon, { icon: icons.stamp, bg: bg });
|
|
18
|
+
case PdfItemType.FREE_TEXT:
|
|
19
|
+
return h(Icon, { icon: icons.freeText, bg: bg });
|
|
20
|
+
case PdfItemType.POPUP:
|
|
21
|
+
case PdfItemType.TEXT:
|
|
22
|
+
return h(Icon, { icon: icons.stickyNote, bg: bg });
|
|
23
|
+
case PdfItemType.INK:
|
|
24
|
+
return h(Icon, { icon: icons.pencil, bg: bg });
|
|
25
|
+
case PdfItemType.SQUARE: {
|
|
26
|
+
const fill = annotaion.fillColor;
|
|
27
|
+
return h(Icon, { icon: icons.rectangle, bg: fill });
|
|
28
|
+
}
|
|
29
|
+
case PdfItemType.CIRCLE: {
|
|
30
|
+
const fill = annotaion.fillColor;
|
|
31
|
+
return h(Icon, { icon: icons.circle, bg: fill });
|
|
32
|
+
}
|
|
33
|
+
default:
|
|
34
|
+
return h(Icon, { icon: icons.annotation, bg: bg });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const HistoryItem = ({ item }) => (state, actions) => {
|
|
38
|
+
switch (item.Type) {
|
|
39
|
+
case '/Create':
|
|
40
|
+
return (h("li", null,
|
|
41
|
+
h("div", null,
|
|
42
|
+
h(Icon, { icon: icons.addLayer }),
|
|
43
|
+
item.T && h("span", { class: "pwv-author" }, item.T),
|
|
44
|
+
h("time", null, formatDate(item.D)))));
|
|
45
|
+
case '/Edit':
|
|
46
|
+
const params = {};
|
|
47
|
+
if (item.Parms) {
|
|
48
|
+
for (let i = 0; i < item.Parms.length; i += 2) {
|
|
49
|
+
const key = item.Parms[i];
|
|
50
|
+
let value = item.Parms[i + 1];
|
|
51
|
+
value = removeParentheses(value);
|
|
52
|
+
params[key] = value ? value : '';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return (h("li", null,
|
|
56
|
+
h("div", null,
|
|
57
|
+
h(Icon, { icon: icons.pen }),
|
|
58
|
+
item.T && h("span", { class: "pwv-author" }, item.T),
|
|
59
|
+
h("time", null, formatDate(item.D))),
|
|
60
|
+
h("div", { class: "pwv-ms-custom-history-content" },
|
|
61
|
+
params['/Subj'] && h("h5", null, params['/Subj']),
|
|
62
|
+
params['/Contents'] && h("p", null, params['/Contents']))));
|
|
63
|
+
case '/Lock':
|
|
64
|
+
return (h("li", null,
|
|
65
|
+
h("div", null,
|
|
66
|
+
h(Icon, { icon: icons.lock }),
|
|
67
|
+
item.T && h("span", { class: "pwv-author" }, item.T),
|
|
68
|
+
h("time", null, formatDate(item.D)))));
|
|
69
|
+
case '/Unlock':
|
|
70
|
+
return (h("li", null,
|
|
71
|
+
h("div", null,
|
|
72
|
+
h(Icon, { icon: icons.unlock }),
|
|
73
|
+
item.T && h("span", { class: "pwv-author" }, item.T),
|
|
74
|
+
h("time", null, formatDate(item.D)))));
|
|
75
|
+
case '/Delete':
|
|
76
|
+
return (h("li", null,
|
|
77
|
+
h("div", null,
|
|
78
|
+
h(Icon, { icon: icons.delete }),
|
|
79
|
+
item.T && h("span", { class: "pwv-author" }, item.T),
|
|
80
|
+
h("time", null, formatDate(item.D)))));
|
|
81
|
+
default:
|
|
82
|
+
return h("li", null, "...");
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const TextMarkupPreview = ({ annotaion }) => (state, actions) => {
|
|
86
|
+
const { markedText, itemType, color } = annotaion;
|
|
87
|
+
switch (itemType) {
|
|
88
|
+
case PdfItemType.HIGHLIGHT:
|
|
89
|
+
return h("span", { style: { backgroundColor: color } }, markedText);
|
|
90
|
+
case PdfItemType.SQUIGGLY:
|
|
91
|
+
return (h("span", { style: {
|
|
92
|
+
textDecoration: 'underline',
|
|
93
|
+
textDecorationStyle: 'wavy',
|
|
94
|
+
textDecorationColor: color,
|
|
95
|
+
} }, markedText));
|
|
96
|
+
case PdfItemType.UNDERLINE:
|
|
97
|
+
return (h("span", { style: {
|
|
98
|
+
textDecoration: 'underline',
|
|
99
|
+
textDecorationColor: color,
|
|
100
|
+
} }, markedText));
|
|
101
|
+
case PdfItemType.STRIKE_OUT:
|
|
102
|
+
return (h("span", { style: { textDecoration: 'line-through', textDecorationColor: color } }, markedText));
|
|
103
|
+
default:
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
let dblClickTimer;
|
|
108
|
+
/** internal */
|
|
109
|
+
export const AnnotationListItem = ({ annotation, selected }) => (state, actions) => {
|
|
110
|
+
var _a, _b, _c, _d, _e;
|
|
111
|
+
const isTextMarkupAnnotation = annotation.itemType === PdfItemType.HIGHLIGHT ||
|
|
112
|
+
annotation.itemType === PdfItemType.SQUIGGLY ||
|
|
113
|
+
annotation.itemType === PdfItemType.UNDERLINE ||
|
|
114
|
+
annotation.itemType === PdfItemType.STRIKE_OUT;
|
|
115
|
+
const { annotationNavigation } = state.options.viewer.sidebar;
|
|
116
|
+
const textMarkupPreview = typeof annotationNavigation === 'object' && ((_a = annotationNavigation.textMarkup) === null || _a === void 0 ? void 0 : _a.preview)
|
|
117
|
+
? annotationNavigation.textMarkup.preview
|
|
118
|
+
: 'none';
|
|
119
|
+
return (h("li", { class: classNames('pwv-annotation-navigation-item', {
|
|
120
|
+
'pwv-selected': selected,
|
|
121
|
+
'pwv-deleted': annotation.isHidden(),
|
|
122
|
+
}), id: `pwv-annotation-navigation-item-${annotation.id}`, onclick: () => {
|
|
123
|
+
if (dblClickTimer) {
|
|
124
|
+
window.clearTimeout(dblClickTimer);
|
|
125
|
+
dblClickTimer = undefined;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
dblClickTimer = window.setTimeout(() => {
|
|
129
|
+
// if (!annotation.isHidden()) {
|
|
130
|
+
// }
|
|
131
|
+
actions.api.goToAnnotation({ annotation, action: 'select' });
|
|
132
|
+
dblClickTimer = undefined;
|
|
133
|
+
}, 250);
|
|
134
|
+
}
|
|
135
|
+
}, ondblclick: () => {
|
|
136
|
+
actions.api.goToAnnotation({ annotation, action: 'edit' });
|
|
137
|
+
dblClickTimer = undefined;
|
|
138
|
+
} },
|
|
139
|
+
h("div", null,
|
|
140
|
+
h(AnnotationIcon, { annotaion: annotation }),
|
|
141
|
+
annotation.author && h("span", { class: "pwv-author" }, annotation.author),
|
|
142
|
+
h("time", null, (_b = annotation.modificationDate) === null || _b === void 0 ? void 0 : _b.toLocaleString())),
|
|
143
|
+
isTextMarkupAnnotation && textMarkupPreview === 'short' && (h("div", { class: "pwv-overflow-ellipsis" },
|
|
144
|
+
h(TextMarkupPreview, { annotaion: annotation }))),
|
|
145
|
+
h("div", null,
|
|
146
|
+
!state.options.annotation.hideAnnotationSubject && h("h5", null, annotation.subject),
|
|
147
|
+
annotation.content && h("p", null, annotation.content),
|
|
148
|
+
!!annotation.isLocked() && h(Icon, { icon: icons.lock, className: "pwv-locked-icon" })),
|
|
149
|
+
selected && annotation.privateData && annotation.privateData.length > 0 && (h("div", { class: "pwv-ms-custom-history-list" },
|
|
150
|
+
h("h5", null, translationManager.getText('sideNavigation.annotation.history')),
|
|
151
|
+
h("ul", null, (_e = (_d = (_c = JSON.parse(annotation.privateData)['PDF Tools AG']) === null || _c === void 0 ? void 0 : _c.Private) === null || _d === void 0 ? void 0 : _d.History) === null || _e === void 0 ? void 0 : _e.map((history) => (h(HistoryItem, { item: history }))))))));
|
|
152
|
+
};
|
|
153
|
+
function removeParentheses(value) {
|
|
154
|
+
if (value === null) {
|
|
155
|
+
return value;
|
|
156
|
+
}
|
|
157
|
+
return value.slice(1, value.length - 1);
|
|
158
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { AnnotationList } from './AnnotationList';
|
|
3
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const AnnotationNavigation = ({}) => (state, actions) => {
|
|
6
|
+
const { annotations, annotationsLoaded } = state.navigationPanel;
|
|
7
|
+
const pageNumbers = Object.keys(annotations).filter((pageNumber) => Object.keys(annotations[pageNumber]).length > 0);
|
|
8
|
+
return (h("div", { class: "pwv-annotation-navigation" },
|
|
9
|
+
pageNumbers.length > 0 ? (pageNumbers.map((pageNumber) => h(AnnotationList, { pageNumber: pageNumber }))) : annotationsLoaded ? (h("div", { class: "pwv-NavigationPanel__NoItems" }, translationManager.getText('sideNavigation.noAnnotations'))) : (''),
|
|
10
|
+
!annotationsLoaded && h("div", { class: "pwv-ItemLoader" })));
|
|
11
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { ScreenSize } from '../../state/layout';
|
|
3
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
4
|
+
import { classNames } from '../../../common/classNames';
|
|
5
|
+
import { icons } from '../../../common/Icon';
|
|
6
|
+
import { Toolbar } from '../../../common/Toolbar';
|
|
7
|
+
import { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';
|
|
8
|
+
import { ToolbarButton } from '../../../common/ToolbarButton';
|
|
9
|
+
import { ThumbnailNavigation } from './ThumbnailNavigation';
|
|
10
|
+
import { OutlineNavigation } from './OutlineNavigation';
|
|
11
|
+
import { AnnotationNavigation } from './AnnotationNavigation';
|
|
12
|
+
let scrollTimer = null;
|
|
13
|
+
/** internal */
|
|
14
|
+
export const NavigationPanel = ({}) => (state, actions) => {
|
|
15
|
+
const { thumbnailNavigation, outlineNavigation, annotationNavigation } = state.options.viewer.sidebar;
|
|
16
|
+
const tabCount = (thumbnailNavigation ? 1 : 0) + (outlineNavigation ? 1 : 0) + (annotationNavigation ? 1 : 0);
|
|
17
|
+
const allowRotatePages = state.options.viewer.permissions.allowRotatePages && state.licenseFeatures.pageRotation;
|
|
18
|
+
const { selectedNavigation, showNavigation } = state.navigationPanel;
|
|
19
|
+
const useMobileLayout = state.layout.screenSize === ScreenSize.Small;
|
|
20
|
+
return (h("div", { class: classNames('pwv-NavigationPanel', { 'pwv-NavigationPanel--open': showNavigation }) },
|
|
21
|
+
h("div", { class: "pwv-NavigationPanel__Box" },
|
|
22
|
+
tabCount > 1 && (h(Toolbar, null,
|
|
23
|
+
!useMobileLayout && (h(ToolbarItemGroup, null,
|
|
24
|
+
thumbnailNavigation && (h(ToolbarButton, { icon: icons.sidePaneThumbnails, tooltip: translationManager.getText('sideNavigation.thumbnails'), active: selectedNavigation === 'thumbnail', disabled: !showNavigation, onClick: () => actions.navigationPanel.selectNavigation('thumbnail') })),
|
|
25
|
+
outlineNavigation && (h(ToolbarButton, { icon: icons.sidePaneOutline, tooltip: translationManager.getText('sideNavigation.outline'), active: selectedNavigation === 'outline', disabled: !showNavigation, onClick: () => actions.navigationPanel.selectNavigation('outline') })),
|
|
26
|
+
annotationNavigation && (h(ToolbarButton, { icon: icons.sidePaneAnnotation, tooltip: translationManager.getText('sideNavigation.annotation'), active: selectedNavigation === 'annotation', disabled: !showNavigation, onClick: () => actions.navigationPanel.selectNavigation('annotation') })))),
|
|
27
|
+
h(ToolbarItemGroup, { pushRight: true },
|
|
28
|
+
h(ToolbarButton, { icon: icons.close, disabled: !showNavigation, onClick: actions.navigationPanel.toggleNavigationPanel })))),
|
|
29
|
+
h("div", { class: "pwv-NavigationPanel__Content", oncreate: (elm) => {
|
|
30
|
+
elm.addEventListener('scroll', () => {
|
|
31
|
+
if (scrollTimer) {
|
|
32
|
+
window.clearTimeout(scrollTimer);
|
|
33
|
+
}
|
|
34
|
+
scrollTimer = window.setTimeout(() => {
|
|
35
|
+
const fromPage = Math.floor(elm.scrollTop / 225) - 4;
|
|
36
|
+
const toPage = fromPage + Math.floor(elm.clientHeight / 225) + 8;
|
|
37
|
+
actions.api.addPageRangeToThumbnailsQueue({
|
|
38
|
+
from: fromPage,
|
|
39
|
+
to: toPage,
|
|
40
|
+
});
|
|
41
|
+
}, 100);
|
|
42
|
+
});
|
|
43
|
+
} },
|
|
44
|
+
selectedNavigation === 'thumbnail' && thumbnailNavigation && (h("div", null,
|
|
45
|
+
h(ThumbnailNavigation, { pages: state.navigationPanel.pages, selectedPage: state.pdfDocument.pageNumber, currentPage: state.pdfDocument.pageNumber, allowRotatePages: allowRotatePages, onPageSelected: actions.api.setPageNumber, onRotatePage: actions.api.rotatePage }))),
|
|
46
|
+
outlineNavigation && selectedNavigation === 'outline' && (h("div", null,
|
|
47
|
+
h(OutlineNavigation, null))),
|
|
48
|
+
annotationNavigation && selectedNavigation === 'annotation' && (h("div", null,
|
|
49
|
+
h(AnnotationNavigation, null)))))));
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component } from '../../../lib/hyperapp';
|
|
2
|
+
import { OutlineNavigationItem } from '../../state/navigationPanel';
|
|
3
|
+
import { PdfDestination } from '../../../pdf-viewer-api';
|
|
4
|
+
/** internal */
|
|
5
|
+
export interface OutlineListProps {
|
|
6
|
+
items: OutlineNavigationItem[];
|
|
7
|
+
path: string[];
|
|
8
|
+
onToggleItem(path: string[]): void;
|
|
9
|
+
onOutlineItemSelected(target: PdfDestination): void;
|
|
10
|
+
}
|
|
11
|
+
/** internal */
|
|
12
|
+
export declare const OutlineList: Component<OutlineListProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { classNames } from '../../../common/classNames';
|
|
3
|
+
import { Icon, icons } from '../../../common/Icon';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const OutlineList = ({ items, path, onToggleItem, onOutlineItemSelected, }) => (h("ul", null, items.map((item) => (h(OutlineListItem, { item: item, path: path, onToggleItem: onToggleItem, onOutlineItemSelected: onOutlineItemSelected })))));
|
|
6
|
+
const OutlineListItem = ({ item, path, onToggleItem, onOutlineItemSelected, }) => {
|
|
7
|
+
const childPath = path.filter((c) => true);
|
|
8
|
+
childPath.push(item.id.toString());
|
|
9
|
+
return (h("li", null,
|
|
10
|
+
h("div", null,
|
|
11
|
+
item.hasDescendants ? (h("span", { class: classNames({ 'pwv-outline-tree-btn-expand': !item.open }, { 'pwv-outline-tree-btn-collapse': item.open }), onclick: () => {
|
|
12
|
+
onToggleItem(childPath);
|
|
13
|
+
} },
|
|
14
|
+
h(Icon, { icon: item.open ? icons.outlineOpen : icons.outlineClosed }))) : (h("span", { class: "pwv-outline-tree-indent" })),
|
|
15
|
+
h("span", { onclick: () => {
|
|
16
|
+
onOutlineItemSelected(item.destination);
|
|
17
|
+
}, class: "pwv-outline-tree-lnk" }, item.title)),
|
|
18
|
+
item.open && item.descendants && (h(OutlineList, { items: item.descendants, path: childPath, onToggleItem: onToggleItem, onOutlineItemSelected: onOutlineItemSelected }))));
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { OutlineList } from './OutlineList';
|
|
3
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
4
|
+
/** internal */
|
|
5
|
+
export const OutlineNavigation = ({}) => (state, actions) => {
|
|
6
|
+
const { outlines, outlineItemsLoaded } = state.navigationPanel;
|
|
7
|
+
return (h("div", { class: "pwv-outline-navigation" },
|
|
8
|
+
outlines.length > 0 ? (h(OutlineList, { items: outlines, path: [], onToggleItem: actions.navigationPanel.toggleOutlineItem, onOutlineItemSelected: actions.api.goTo })) : outlineItemsLoaded ? (h("div", { class: "pwv-NavigationPanel__NoItems" }, translationManager.getText('sideNavigation.noOutline'))) : (''),
|
|
9
|
+
!outlineItemsLoaded && h("div", { class: "pwv-ItemLoader" })));
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from '../../../lib/hyperapp';
|
|
2
|
+
import { RotationDirection } from '../../../pdf-viewer-api/enums';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface ThumbnailNavigationProps {
|
|
5
|
+
pages: any[];
|
|
6
|
+
selectedPage: number;
|
|
7
|
+
currentPage: number;
|
|
8
|
+
allowRotatePages: boolean;
|
|
9
|
+
onPageSelected(pageNr: number): void;
|
|
10
|
+
onRotatePage(pageRotation: {
|
|
11
|
+
page: number;
|
|
12
|
+
direction: RotationDirection;
|
|
13
|
+
}): void;
|
|
14
|
+
}
|
|
15
|
+
/** internal */
|
|
16
|
+
export declare const ThumbnailNavigation: Component<ThumbnailNavigationProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { h } from '../../../lib/hyperapp';
|
|
2
|
+
import { classNames } from '../../../common/classNames';
|
|
3
|
+
import { icons } from '../../../common/Icon';
|
|
4
|
+
import { RotationDirection } from '../../../pdf-viewer-api/enums';
|
|
5
|
+
import { ToolbarButton } from '../../../common/ToolbarButton';
|
|
6
|
+
import { translationManager } from '../../../common/TranslationManager';
|
|
7
|
+
/** internal */
|
|
8
|
+
/* tslint:disable-next-line:max-line-length */
|
|
9
|
+
export const ThumbnailNavigation = ({ pages, currentPage, allowRotatePages, onPageSelected, onRotatePage }, children) => (h("div", { class: "pwv-thumbnail-navigation" },
|
|
10
|
+
h("ul", null, pages.map((page) => (h("li", { id: `pwv-thumbnail-navigation-page_${page.pageNumber}`, key: page.pageNumber, class: classNames('pwv-thumbnail-navigation-page', {
|
|
11
|
+
'pwv-selected': page.pageNumber === currentPage,
|
|
12
|
+
}) },
|
|
13
|
+
h("div", { class: "pwv-thumbnail-navigation-img-container" }, page.thumbnail !== null ? (h("img", { src: page.thumbnail, onclick: () => {
|
|
14
|
+
onPageSelected(page.pageNumber);
|
|
15
|
+
} })) : (h("div", { class: "pwv-page-placeholder", onclick: () => {
|
|
16
|
+
onPageSelected(page.pageNumber);
|
|
17
|
+
} }, page.loading === true && h("div", { class: "pwv-ItemLoader" })))),
|
|
18
|
+
h("div", { class: "pwv-page-nr" },
|
|
19
|
+
allowRotatePages && page.pageNumber === currentPage && (h("div", { class: "pwv-page-rotation pwv-ToolbarItemGroup" },
|
|
20
|
+
h(ToolbarButton, { icon: icons.rotateLeft, tooltip: translationManager.getText('rotatePage.counterclockwise'), onClick: () => {
|
|
21
|
+
onRotatePage({
|
|
22
|
+
page: page.pageNumber,
|
|
23
|
+
direction: RotationDirection.COUNTERCLOCKWISE,
|
|
24
|
+
});
|
|
25
|
+
} }),
|
|
26
|
+
h(ToolbarButton, { icon: icons.rotateRight, tooltip: translationManager.getText('rotatePage.clockwise'), onClick: () => {
|
|
27
|
+
onRotatePage({
|
|
28
|
+
page: page.pageNumber,
|
|
29
|
+
direction: RotationDirection.CLOCKWISE,
|
|
30
|
+
});
|
|
31
|
+
} }))),
|
|
32
|
+
h("span", null, page.pageNumber))))))));
|