@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,509 @@
|
|
|
1
|
+
import { CanvasLayer } from '../CanvasLayer';
|
|
2
|
+
import { createPopupView } from './Popup';
|
|
3
|
+
import { getPopups, getOpenPopups } from '../../pdf-viewer-canvas/state/annotations';
|
|
4
|
+
import { PdfItemType, } from '../../pdf-viewer-api';
|
|
5
|
+
import { renderPopupMarker } from '../../pdf-viewer-canvas/view-layers/canvasShapes';
|
|
6
|
+
import { ViewerMode, CursorStyle } from '../../pdf-viewer-canvas/state/viewer';
|
|
7
|
+
import { Color } from '../../common/Color';
|
|
8
|
+
import { getColorPalette } from '../../common/Tools';
|
|
9
|
+
import { addHistoryEntry } from '../../custom/history';
|
|
10
|
+
export class PopupLayer extends CanvasLayer {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.popupView = null;
|
|
14
|
+
this.context = null;
|
|
15
|
+
this.maxPopupWidth = window.screen.availWidth < 570 ? 280 : 480;
|
|
16
|
+
this.maxPopupHeight = 320;
|
|
17
|
+
this.minPopupWidth = 260;
|
|
18
|
+
this.minPopupHeight = 200;
|
|
19
|
+
this.zoom = 0;
|
|
20
|
+
this.screenToPdfScale = 0;
|
|
21
|
+
}
|
|
22
|
+
onCreate() {
|
|
23
|
+
this.drawPopupRelation = this.drawPopupRelation.bind(this);
|
|
24
|
+
this.popupMoved = this.popupMoved.bind(this);
|
|
25
|
+
this.selectPopup = this.selectPopup.bind(this);
|
|
26
|
+
this.deselectPopup = this.deselectPopup.bind(this);
|
|
27
|
+
this.openPopup = this.openPopup.bind(this);
|
|
28
|
+
this.closePopup = this.closePopup.bind(this);
|
|
29
|
+
this.deletePopup = this.deletePopup.bind(this);
|
|
30
|
+
this.toggleAnnotationLock = this.toggleAnnotationLock.bind(this);
|
|
31
|
+
this.updateSelectedPopupContent = this.updateSelectedPopupContent.bind(this);
|
|
32
|
+
this.updatePopupPosition = this.updatePopupPosition.bind(this);
|
|
33
|
+
this.updatePopupSize = this.updatePopupSize.bind(this);
|
|
34
|
+
this.updatePopupColor = this.updatePopupColor.bind(this);
|
|
35
|
+
this.context = this.createCanvas();
|
|
36
|
+
this.createPopupView();
|
|
37
|
+
window.addEventListener('pdfwebviewer.PopupMoved', this.popupMoved, false);
|
|
38
|
+
}
|
|
39
|
+
onRemove() { }
|
|
40
|
+
onSave() {
|
|
41
|
+
const promise = new Promise((resolve, reject) => {
|
|
42
|
+
if (this.popupView) {
|
|
43
|
+
const state = this.popupView.getState();
|
|
44
|
+
if (state.stateChanged) {
|
|
45
|
+
this.updateSelectedPopupContent(true).then(() => {
|
|
46
|
+
resolve();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
resolve();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return promise;
|
|
55
|
+
}
|
|
56
|
+
render(timestamp, state) {
|
|
57
|
+
if (this.pdfApi && this.popupView && this.popupViewElement) {
|
|
58
|
+
if (state.document.zoomChanged && state.document.zoom !== this.zoom) {
|
|
59
|
+
this.zoom = state.document.zoom;
|
|
60
|
+
this.screenToPdfScale = this.pdfApi.transformPdfLengthToScreenLength(100) / 100 / this.zoom;
|
|
61
|
+
}
|
|
62
|
+
/* tslint:disable-next-line:max-line-length */
|
|
63
|
+
if (state.annotations.openPopupChanged ||
|
|
64
|
+
state.document.firstVisiblePageChanged ||
|
|
65
|
+
state.document.lastVisiblePageChanged ||
|
|
66
|
+
state.viewer.modeChanged) {
|
|
67
|
+
this.updateOpenPopupList(state);
|
|
68
|
+
}
|
|
69
|
+
if (state.viewer.popupFocus) {
|
|
70
|
+
this.popupView.setFocus(state.viewer.popupFocus);
|
|
71
|
+
}
|
|
72
|
+
if (this.popupView.getState().clearFocus) {
|
|
73
|
+
this.store.viewer.clearPopupFocus();
|
|
74
|
+
}
|
|
75
|
+
if (state.viewer.selectedPopupChanged) {
|
|
76
|
+
const selectedPopup = this.popupView.getState().selectedPopup;
|
|
77
|
+
if (state.viewer.selectedPopupId) {
|
|
78
|
+
if (selectedPopup !== state.viewer.selectedPopupId) {
|
|
79
|
+
this.popupView.selectPopup(state.viewer.selectedPopupId);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const viewerMode = state.viewer.mode;
|
|
84
|
+
if (viewerMode === ViewerMode.POPUP_SELECTED) {
|
|
85
|
+
this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);
|
|
86
|
+
}
|
|
87
|
+
const { openPopups, selectedPopup } = this.popupView.getState();
|
|
88
|
+
const popupsVisible = viewerMode === ViewerMode.DEFAULT || viewerMode === ViewerMode.POPUP_SELECTED;
|
|
89
|
+
if (state.viewer.modeChanged) {
|
|
90
|
+
if (popupsVisible) {
|
|
91
|
+
this.popupViewElement.style.display = 'block';
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.popupViewElement.style.display = 'none';
|
|
95
|
+
const ctx = this.context;
|
|
96
|
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
97
|
+
if (selectedPopup && state.pointer.action !== 'click') {
|
|
98
|
+
this.updateSelectedPopupContent(true);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (viewerMode === ViewerMode.POPUP_SELECTED && state.pointer.action === 'click') {
|
|
103
|
+
this.deselectPopup();
|
|
104
|
+
}
|
|
105
|
+
const updatePopupPosition = state.canvas.canvasInvalidated || openPopups.find((p) => !p.positionCalculated);
|
|
106
|
+
if (openPopups.length > 0 && updatePopupPosition) {
|
|
107
|
+
const popupElements = this.popupViewElement.querySelectorAll('.pwv-popup');
|
|
108
|
+
const canvasWidth = state.canvas.width.cssPixels;
|
|
109
|
+
const canvasHeight = state.canvas.height.cssPixels;
|
|
110
|
+
const zoom = state.document.zoom;
|
|
111
|
+
for (let i = 0; i < popupElements.length; i++) {
|
|
112
|
+
const popupElement = popupElements[i];
|
|
113
|
+
if (!popupElement.classList.contains('pwv-popup-moving')) {
|
|
114
|
+
const id = popupElement.dataset.id;
|
|
115
|
+
const popup = openPopups.find((p) => p.id.toString() === id);
|
|
116
|
+
if (popup) {
|
|
117
|
+
const screenRect = this.pdfApi.transformPdfPageRectToScreenRect(popup.pdfRect);
|
|
118
|
+
let x = screenRect.x / devicePixelRatio;
|
|
119
|
+
let y = screenRect.y / devicePixelRatio;
|
|
120
|
+
const w = parseInt(popupElement.style.width, undefined);
|
|
121
|
+
const h = parseInt(popupElement.style.height, undefined);
|
|
122
|
+
const padding = 8;
|
|
123
|
+
if (x < padding) {
|
|
124
|
+
x = padding;
|
|
125
|
+
}
|
|
126
|
+
else if (x + w + padding * 2 > canvasWidth) {
|
|
127
|
+
x = canvasWidth - (w + padding * 2);
|
|
128
|
+
}
|
|
129
|
+
if (y < padding) {
|
|
130
|
+
y = padding;
|
|
131
|
+
}
|
|
132
|
+
else if (y + h + padding * 2 > canvasHeight) {
|
|
133
|
+
y = canvasHeight - (h + padding * 2);
|
|
134
|
+
}
|
|
135
|
+
popupElement.style.top = `${y}px`;
|
|
136
|
+
popupElement.style.left = `${x}px`;
|
|
137
|
+
if (!popup.positionCalculated) {
|
|
138
|
+
this.popupView.setPositionCalculated(popup.id);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if ((state.viewer.mode === ViewerMode.POPUP_SELECTED ||
|
|
145
|
+
state.viewer.mode === ViewerMode.DEFAULT) &&
|
|
146
|
+
(state.viewer.selectedPopupChanged ||
|
|
147
|
+
state.canvas.canvasInvalidated ||
|
|
148
|
+
state.pointer.positionChanged ||
|
|
149
|
+
state.annotations.openPopupChanged)) {
|
|
150
|
+
const ctx = this.context;
|
|
151
|
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
152
|
+
const scale = state.canvas.pixelRatio * state.document.zoom;
|
|
153
|
+
if (viewerMode !== ViewerMode.POPUP_SELECTED) {
|
|
154
|
+
const popups = getPopups(state.annotations, state.document.firstVisiblePage, state.document.lastVisiblePage);
|
|
155
|
+
if (popups === null) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
for (let i = 0; i < popups.length; i++) {
|
|
159
|
+
const popup = popups[i];
|
|
160
|
+
if (popup.itemType !== PdfItemType.TEXT) {
|
|
161
|
+
let pos;
|
|
162
|
+
pos = this.pdfApi.transformPdfPageRectToScreenRect(popup.pdfRect);
|
|
163
|
+
ctx.lineWidth = 1;
|
|
164
|
+
ctx.beginPath();
|
|
165
|
+
const r = 12 * scale;
|
|
166
|
+
const posX = pos.x + r / 2;
|
|
167
|
+
const posY = pos.y - r;
|
|
168
|
+
ctx.arc(posX, posY, r, 0, 2 * Math.PI);
|
|
169
|
+
if (ctx.isPointInPath(state.pointer.x.devicePixels, state.pointer.y.devicePixels)) {
|
|
170
|
+
this.store.viewer.setCursorStyle(CursorStyle.POINTER);
|
|
171
|
+
ctx.globalAlpha = 0.15;
|
|
172
|
+
ctx.fillStyle = this.options.viewer.general.textSelectionColor;
|
|
173
|
+
ctx.fill();
|
|
174
|
+
ctx.globalAlpha = 1;
|
|
175
|
+
if (state.pointer.action === 'click') {
|
|
176
|
+
this.openPopup(popup.id);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
renderPopupMarker(ctx, scale, popup.color || this.options.annotation.colors.defaultHighlightColor, { x: posX, y: posY });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (openPopups.length > 0) {
|
|
184
|
+
const popupElements = this.popupViewElement.querySelectorAll('.pwv-popup:hover, .pwv-popup.pwv-popup-selected');
|
|
185
|
+
for (let i = 0; i < popupElements.length; i++) {
|
|
186
|
+
const popupElement = popupElements[i];
|
|
187
|
+
const id = popupElement.dataset.id ? parseInt(popupElement.dataset.id, undefined) : -1;
|
|
188
|
+
this.drawPopupRelation(ctx, id, {
|
|
189
|
+
x: popupElement.offsetLeft,
|
|
190
|
+
y: popupElement.offsetTop,
|
|
191
|
+
w: popupElement.offsetWidth,
|
|
192
|
+
h: popupElement.offsetHeight,
|
|
193
|
+
}, popupElement.style.backgroundColor, id === state.viewer.selectedPopupId);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
updateOpenPopupList(state) {
|
|
200
|
+
if (this.popupView) {
|
|
201
|
+
const openPopups = getOpenPopups(state.annotations, state.document.firstVisiblePage, state.document.lastVisiblePage);
|
|
202
|
+
const zoom = state.document.zoom;
|
|
203
|
+
const popups = openPopups.map((an) => {
|
|
204
|
+
const width = this.pdfApi.transformPdfLengthToScreenLength(an.popup.pdfRect.pdfW) / zoom;
|
|
205
|
+
const height = this.pdfApi.transformPdfLengthToScreenLength(an.popup.pdfRect.pdfH) / zoom;
|
|
206
|
+
// Take last modified date, author and color
|
|
207
|
+
// from parent annotation
|
|
208
|
+
return {
|
|
209
|
+
id: an.id,
|
|
210
|
+
colorPalette: getColorPalette(an.itemType, this.options),
|
|
211
|
+
content: an.content,
|
|
212
|
+
subject: an.subject ? an.subject : null,
|
|
213
|
+
modificationDate: an.modificationDate,
|
|
214
|
+
author: an.author,
|
|
215
|
+
color: an.color,
|
|
216
|
+
itemType: an.itemType,
|
|
217
|
+
isLocked: an.isLocked(),
|
|
218
|
+
selected: false,
|
|
219
|
+
positionCalculated: false,
|
|
220
|
+
pdfRect: an.popup.pdfRect,
|
|
221
|
+
cssWidth: width < this.maxPopupWidth ? width : this.maxPopupWidth,
|
|
222
|
+
cssHeight: height < this.maxPopupHeight ? height : this.maxPopupHeight,
|
|
223
|
+
behaviors: an.behaviors,
|
|
224
|
+
isReadOnly: an.isReadOnly,
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
this.popupView.updateOpenPopups(popups);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
drawPopupRelation(ctx, annotationId, popupRect, color, selected) {
|
|
231
|
+
const annotation = this.pdfApi.getItem(annotationId);
|
|
232
|
+
if (annotation) {
|
|
233
|
+
const annotationRect = this.pdfApi.transformPdfPageRectToScreenRect(annotation.pdfRect);
|
|
234
|
+
const popupX1 = popupRect.x * devicePixelRatio;
|
|
235
|
+
const popupX2 = popupX1 + popupRect.w * devicePixelRatio;
|
|
236
|
+
const popupXc = popupX1 + (popupRect.w / 2) * devicePixelRatio;
|
|
237
|
+
const popupY1 = popupRect.y * devicePixelRatio;
|
|
238
|
+
const popupY2 = popupY1 + popupRect.h * devicePixelRatio;
|
|
239
|
+
const popupYc = popupY1 + (popupRect.h / 2) * devicePixelRatio;
|
|
240
|
+
const annotationX1 = annotationRect.x;
|
|
241
|
+
const annotationX2 = annotationX1 + annotationRect.w;
|
|
242
|
+
const annotationY1 = annotationRect.y;
|
|
243
|
+
const annotationY2 = annotationY1 + annotationRect.h;
|
|
244
|
+
let popupRelX = popupX1;
|
|
245
|
+
let popupRelY = popupY1;
|
|
246
|
+
let annotationRelX = annotationX1;
|
|
247
|
+
let annotationRelY = annotationY1;
|
|
248
|
+
if (popupX2 <= annotationX1) {
|
|
249
|
+
popupRelX = popupX2;
|
|
250
|
+
annotationRelX = annotationX1;
|
|
251
|
+
}
|
|
252
|
+
if (popupX1 >= annotationX2) {
|
|
253
|
+
popupRelX = popupX1;
|
|
254
|
+
annotationRelX = annotationX2;
|
|
255
|
+
}
|
|
256
|
+
if (popupY2 <= annotationY1) {
|
|
257
|
+
popupRelY = popupY2;
|
|
258
|
+
annotationRelY = annotationY1;
|
|
259
|
+
}
|
|
260
|
+
if (popupY1 >= annotationY2) {
|
|
261
|
+
popupRelY = popupY1;
|
|
262
|
+
annotationRelY = annotationY2;
|
|
263
|
+
}
|
|
264
|
+
if (popupX2 >= annotationX1 && popupX1 <= annotationX2) {
|
|
265
|
+
const x = popupXc < annotationX1 ? annotationX1 : popupXc > annotationX2 ? annotationX2 : popupXc;
|
|
266
|
+
popupRelX = x;
|
|
267
|
+
annotationRelX = x;
|
|
268
|
+
}
|
|
269
|
+
if (popupY2 >= annotationY1 && popupY1 <= annotationY2) {
|
|
270
|
+
const y = popupYc < annotationY1 ? annotationY1 : popupYc > annotationY2 ? annotationY2 : popupYc;
|
|
271
|
+
popupRelY = y;
|
|
272
|
+
annotationRelY = y;
|
|
273
|
+
}
|
|
274
|
+
ctx.save();
|
|
275
|
+
if (!(popupRelX === 0 && popupRelY === 0)) {
|
|
276
|
+
if (color) {
|
|
277
|
+
const rgbColor = new Color(color);
|
|
278
|
+
rgbColor.darken(20);
|
|
279
|
+
if (!selected) {
|
|
280
|
+
rgbColor.setOpacity(0.8);
|
|
281
|
+
}
|
|
282
|
+
ctx.strokeStyle = rgbColor.toRgba();
|
|
283
|
+
ctx.fillStyle = rgbColor.toRgba();
|
|
284
|
+
}
|
|
285
|
+
ctx.lineWidth = 2 * window.devicePixelRatio;
|
|
286
|
+
if (!selected) {
|
|
287
|
+
ctx.setLineDash([ctx.lineWidth]);
|
|
288
|
+
}
|
|
289
|
+
ctx.beginPath();
|
|
290
|
+
ctx.moveTo(annotationRelX, annotationRelY);
|
|
291
|
+
ctx.lineTo(popupRelX, popupRelY);
|
|
292
|
+
ctx.stroke();
|
|
293
|
+
ctx.strokeRect(annotationX1, annotationY1, annotationRect.w, annotationRect.h);
|
|
294
|
+
ctx.restore();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
ctx.restore();
|
|
298
|
+
}
|
|
299
|
+
popupMoved(event) {
|
|
300
|
+
if (this.context !== null && event.detail) {
|
|
301
|
+
this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height);
|
|
302
|
+
this.drawPopupRelation(this.context, event.detail.annotationId, event.detail.popupRect, event.detail.color, true);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
createPopupView() {
|
|
306
|
+
if (this.containerElement) {
|
|
307
|
+
this.popupViewElement = this.createHtmlLayer();
|
|
308
|
+
this.popupView = createPopupView({
|
|
309
|
+
maxPopupWidth: this.maxPopupWidth,
|
|
310
|
+
maxPopupHeight: this.maxPopupHeight,
|
|
311
|
+
minPopupWidth: this.minPopupWidth,
|
|
312
|
+
minPopupHeight: this.minPopupHeight,
|
|
313
|
+
currentUser: this.options.viewer.general.user ? this.options.viewer.general.user : '',
|
|
314
|
+
hideSubject: this.options.annotation.hideAnnotationSubject || false,
|
|
315
|
+
allowLockAnnotations: this.options.viewer.permissions.allowLockAnnotations,
|
|
316
|
+
allowEditLockedAnnotations: this.options.viewer.permissions.allowEditLockedAnnotations,
|
|
317
|
+
onSelect: this.selectPopup,
|
|
318
|
+
onClose: this.closePopup,
|
|
319
|
+
onDelete: this.deletePopup,
|
|
320
|
+
onUpdatePosition: this.updatePopupPosition,
|
|
321
|
+
onUpdateSize: this.updatePopupSize,
|
|
322
|
+
onUpdateColor: this.updatePopupColor,
|
|
323
|
+
onLock: this.toggleAnnotationLock,
|
|
324
|
+
}, this.popupViewElement);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
selectPopup(id) {
|
|
328
|
+
if (this.popupView) {
|
|
329
|
+
if (this.popupView.getState().selectedPopup !== null) {
|
|
330
|
+
this.updateSelectedPopupContent(true);
|
|
331
|
+
}
|
|
332
|
+
this.popupView.selectPopup(id);
|
|
333
|
+
this.store.viewer.selectPopup({ id, focus: false });
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
deselectPopup() {
|
|
337
|
+
if (this.popupView) {
|
|
338
|
+
this.updateSelectedPopupContent(true);
|
|
339
|
+
this.popupView.deselectPopup();
|
|
340
|
+
this.store.viewer.selectPopup({ id: null, focus: false });
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
openPopup(id) {
|
|
344
|
+
if (this.pdfApi) {
|
|
345
|
+
const annotation = this.pdfApi.getItem(id);
|
|
346
|
+
if (annotation) {
|
|
347
|
+
annotation.popup.isOpen = true;
|
|
348
|
+
this.store.annotations.updateAnnotation(annotation);
|
|
349
|
+
if (this.pdfViewerCanvas.licenseFeatures.annotate) {
|
|
350
|
+
this.pdfApi.updateItem(annotation).then(() => {
|
|
351
|
+
this.selectPopup(annotation.id);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
this.selectPopup(annotation.id);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
closePopup() {
|
|
361
|
+
this.updateSelectedPopupContent(false).then((annot) => {
|
|
362
|
+
this.store.viewer.deselectPopup();
|
|
363
|
+
if (this.pdfApi) {
|
|
364
|
+
if (annot) {
|
|
365
|
+
annot.popup.isOpen = false;
|
|
366
|
+
this.store.annotations.updateAnnotation(annot);
|
|
367
|
+
if (this.pdfViewerCanvas.licenseFeatures.annotate) {
|
|
368
|
+
this.pdfApi.updateItem(annot);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
deletePopup(id) {
|
|
375
|
+
if (this.pdfApi) {
|
|
376
|
+
if (this.popupView) {
|
|
377
|
+
this.popupView.deselectPopup();
|
|
378
|
+
}
|
|
379
|
+
this.store.viewer.selectPopup({ id: null, focus: false });
|
|
380
|
+
const annotation = this.pdfApi.getItem(id);
|
|
381
|
+
if (annotation) {
|
|
382
|
+
annotation.content = '';
|
|
383
|
+
annotation.subject = '';
|
|
384
|
+
annotation.popup.isOpen = false;
|
|
385
|
+
this.store.annotations.updateAnnotation(annotation);
|
|
386
|
+
if (this.pdfViewerCanvas.licenseFeatures.annotate) {
|
|
387
|
+
this.pdfApi.updateItem(annotation);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
toggleAnnotationLock(id) {
|
|
393
|
+
if (this.pdfApi) {
|
|
394
|
+
this.updateSelectedPopupContent(false).then((annotation) => {
|
|
395
|
+
if (annotation) {
|
|
396
|
+
if (this.options.annotation.trackHistory) {
|
|
397
|
+
addHistoryEntry(annotation, 'lock', this.options.viewer.general.user);
|
|
398
|
+
}
|
|
399
|
+
annotation.setLock(!annotation.isLocked());
|
|
400
|
+
this.store.annotations.updateAnnotation(annotation);
|
|
401
|
+
if (this.pdfViewerCanvas.licenseFeatures.annotate) {
|
|
402
|
+
this.pdfApi.updateItem(annotation);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
updateSelectedPopupContent(syncronize, annotation) {
|
|
409
|
+
const promise = new Promise((resolve, reject) => {
|
|
410
|
+
var _a;
|
|
411
|
+
if (this.pdfApi) {
|
|
412
|
+
if (this.popupView) {
|
|
413
|
+
const state = this.popupView.getState();
|
|
414
|
+
const id = state.selectedPopup;
|
|
415
|
+
if (id) {
|
|
416
|
+
if (!annotation) {
|
|
417
|
+
annotation = this.pdfApi.getItem(id);
|
|
418
|
+
}
|
|
419
|
+
const content = state.activeContent;
|
|
420
|
+
const subject = state.activeSubject;
|
|
421
|
+
if (this.options.annotation.trackHistory) {
|
|
422
|
+
addHistoryEntry(annotation, 'edit', this.options.viewer.general.user, content, subject);
|
|
423
|
+
}
|
|
424
|
+
annotation.content = content !== null ? content : annotation.content;
|
|
425
|
+
annotation.subject = subject !== null ? subject : annotation.subject;
|
|
426
|
+
if (((_a = this.pdfViewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && syncronize) {
|
|
427
|
+
this.pdfApi
|
|
428
|
+
.updateItem(annotation)
|
|
429
|
+
.then(() => {
|
|
430
|
+
if (this.popupView) {
|
|
431
|
+
this.popupView.stateChanged(false);
|
|
432
|
+
}
|
|
433
|
+
resolve();
|
|
434
|
+
})
|
|
435
|
+
.catch(() => {
|
|
436
|
+
reject();
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
resolve(annotation);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
resolve(null);
|
|
446
|
+
});
|
|
447
|
+
return promise;
|
|
448
|
+
}
|
|
449
|
+
updatePopupPosition(id, x, y) {
|
|
450
|
+
if (this.pdfApi) {
|
|
451
|
+
const annotation = this.pdfApi.getItem(id);
|
|
452
|
+
if (annotation) {
|
|
453
|
+
const newPdfPos = this.pdfApi.transformScreenPointToPdfPoint({
|
|
454
|
+
x: x * window.devicePixelRatio,
|
|
455
|
+
y: y * window.devicePixelRatio,
|
|
456
|
+
}, annotation.pdfRect.page).pdfPoint;
|
|
457
|
+
if (annotation.popup.pdfRect.pdfX !== newPdfPos.pdfX ||
|
|
458
|
+
annotation.popup.pdfRect.pdfY !== newPdfPos.pdfY) {
|
|
459
|
+
annotation.popup.pdfRect.pdfX = newPdfPos.pdfX;
|
|
460
|
+
annotation.popup.pdfRect.pdfY = newPdfPos.pdfY - annotation.popup.pdfRect.pdfH;
|
|
461
|
+
this.store.annotations.updateAnnotation(annotation);
|
|
462
|
+
this.updateSelectedPopupContent(true, annotation);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
updatePopupSize(id, w, h) {
|
|
468
|
+
if (this.pdfApi) {
|
|
469
|
+
const annotation = this.pdfApi.getItem(id);
|
|
470
|
+
if (annotation) {
|
|
471
|
+
const newWidth = w / this.screenToPdfScale;
|
|
472
|
+
const newHeight = h / this.screenToPdfScale;
|
|
473
|
+
if (annotation.popup.pdfRect.pdfW !== newWidth ||
|
|
474
|
+
annotation.popup.pdfRect.pdfH !== newHeight) {
|
|
475
|
+
annotation.popup.pdfRect.pdfW = newWidth;
|
|
476
|
+
annotation.popup.pdfRect.pdfH = newHeight;
|
|
477
|
+
this.store.annotations.updateAnnotation(annotation);
|
|
478
|
+
this.updateSelectedPopupContent(true, annotation);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
updatePopupColor(id, color) {
|
|
484
|
+
if (this.pdfApi) {
|
|
485
|
+
const annotation = this.pdfApi.getItem(id);
|
|
486
|
+
if (annotation) {
|
|
487
|
+
if (annotation.itemType === PdfItemType.TEXT ||
|
|
488
|
+
annotation.itemType === PdfItemType.HIGHLIGHT ||
|
|
489
|
+
annotation.itemType === PdfItemType.SQUIGGLY ||
|
|
490
|
+
annotation.itemType === PdfItemType.UNDERLINE ||
|
|
491
|
+
annotation.itemType === PdfItemType.STRIKE_OUT) {
|
|
492
|
+
;
|
|
493
|
+
annotation.color = color;
|
|
494
|
+
}
|
|
495
|
+
else if (annotation.itemType === PdfItemType.INK ||
|
|
496
|
+
annotation.itemType === PdfItemType.SQUARE ||
|
|
497
|
+
annotation.itemType === PdfItemType.CIRCLE) {
|
|
498
|
+
const newColor = new Color(color);
|
|
499
|
+
const currentColor = new Color(annotation.color);
|
|
500
|
+
newColor.setOpacity(currentColor.a);
|
|
501
|
+
annotation.color = newColor.toRgba();
|
|
502
|
+
}
|
|
503
|
+
annotation.popup.color = color;
|
|
504
|
+
this.store.annotations.updateAnnotation(annotation);
|
|
505
|
+
this.updateSelectedPopupContent(true, annotation);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
export declare class PopupModule extends CanvasModule {
|
|
3
|
+
static moduleInfo: {
|
|
4
|
+
name: string;
|
|
5
|
+
moduleType: CanvasModuleType;
|
|
6
|
+
requiredFeatures: {
|
|
7
|
+
annotate: boolean;
|
|
8
|
+
fillFormFields: boolean;
|
|
9
|
+
};
|
|
10
|
+
translationKey: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
};
|
|
13
|
+
constructor();
|
|
14
|
+
onRegister(): {};
|
|
15
|
+
activate(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
import { PopupLayer } from './PopupLayer';
|
|
3
|
+
export class PopupModule extends CanvasModule {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.name = PopupModule.moduleInfo.name;
|
|
7
|
+
}
|
|
8
|
+
onRegister() {
|
|
9
|
+
this.createCanvasLayer('popup', PopupLayer);
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
activate() {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
PopupModule.moduleInfo = {
|
|
17
|
+
name: 'PopupModule',
|
|
18
|
+
moduleType: CanvasModuleType.Layer,
|
|
19
|
+
requiredFeatures: {
|
|
20
|
+
annotate: false,
|
|
21
|
+
fillFormFields: false,
|
|
22
|
+
},
|
|
23
|
+
translationKey: 'a',
|
|
24
|
+
icon: 'a',
|
|
25
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum PaperFormat {
|
|
2
|
+
A4 = 0,
|
|
3
|
+
LETTER = 1
|
|
4
|
+
}
|
|
5
|
+
export interface PrintServiceProps {
|
|
6
|
+
pageCount: number;
|
|
7
|
+
currentPage: number;
|
|
8
|
+
print({ pages, format, includeAnnotations, }: {
|
|
9
|
+
pages: number[];
|
|
10
|
+
format?: PaperFormat;
|
|
11
|
+
includeAnnotations: boolean;
|
|
12
|
+
}): void;
|
|
13
|
+
cancel(): void;
|
|
14
|
+
parseRange(range: string): number[];
|
|
15
|
+
validateRange(range: string): boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PrintDialogState {
|
|
18
|
+
printPending: boolean;
|
|
19
|
+
pages: number[];
|
|
20
|
+
radio_selection: 'all' | 'current_page' | 'range';
|
|
21
|
+
selectedFormat: PaperFormat;
|
|
22
|
+
includeAnnotations: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PrintDialogActions {
|
|
25
|
+
setPrintPending(printPending: boolean): void;
|
|
26
|
+
setFormat(format: number): PrintDialogState;
|
|
27
|
+
setRadioSelection(selection: string): PrintDialogState;
|
|
28
|
+
toggleIncludeAnnotations(includeAnnotations: string): PrintDialogState;
|
|
29
|
+
}
|
|
30
|
+
export declare const createPrintServiceDialog: (props: PrintServiceProps, element: HTMLElement) => PrintDialogActions;
|