@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,39 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import * as Document from './document';
|
|
3
|
+
import * as Annotations from './annotations';
|
|
4
|
+
import * as Canvas from './canvas';
|
|
5
|
+
import * as Scroll from './scroll';
|
|
6
|
+
import * as Pointer from './pointer';
|
|
7
|
+
import * as Search from './search';
|
|
8
|
+
import * as Viewer from './viewer';
|
|
9
|
+
/** internal */
|
|
10
|
+
export interface ViewerCanvasState {
|
|
11
|
+
document: Document.DocumentState;
|
|
12
|
+
annotations: Annotations.AnnotationsState;
|
|
13
|
+
canvas: Canvas.CanvasState;
|
|
14
|
+
scroll: Scroll.ScrollState;
|
|
15
|
+
pointer: Pointer.PointerState;
|
|
16
|
+
startPointer: Pointer.PointerState;
|
|
17
|
+
search: Search.SearchState;
|
|
18
|
+
viewer: Viewer.ViewerState;
|
|
19
|
+
}
|
|
20
|
+
/** internal */
|
|
21
|
+
export interface ViewerCanvasStore {
|
|
22
|
+
document: Document.DocumentActions;
|
|
23
|
+
annotations: Annotations.AnnotationsActions;
|
|
24
|
+
canvas: Canvas.CanvasActions;
|
|
25
|
+
scroll: Scroll.ScrollActions;
|
|
26
|
+
pointer: Pointer.PointerActions;
|
|
27
|
+
startPointer: Pointer.PointerActions;
|
|
28
|
+
search: Search.SearchActions;
|
|
29
|
+
viewer: Viewer.ViewerActions;
|
|
30
|
+
getState(): ViewerCanvasState;
|
|
31
|
+
loadDefaultState(): ViewerCanvasState;
|
|
32
|
+
resetChangedState(): ViewerCanvasState;
|
|
33
|
+
}
|
|
34
|
+
/** internal */
|
|
35
|
+
export declare const defaultState: ViewerCanvasState;
|
|
36
|
+
/** internal */
|
|
37
|
+
export declare const actions: ActionsType<ViewerCanvasState, ViewerCanvasStore>;
|
|
38
|
+
/** internal */
|
|
39
|
+
export declare const createStore: () => ViewerCanvasStore;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { appState } from './appState';
|
|
2
|
+
import * as Document from './document';
|
|
3
|
+
import * as Annotations from './annotations';
|
|
4
|
+
import * as Canvas from './canvas';
|
|
5
|
+
import * as Scroll from './scroll';
|
|
6
|
+
import * as Pointer from './pointer';
|
|
7
|
+
import * as Search from './search';
|
|
8
|
+
import * as Viewer from './viewer';
|
|
9
|
+
/** internal */
|
|
10
|
+
export const defaultState = {
|
|
11
|
+
document: Document.state,
|
|
12
|
+
annotations: Annotations.state,
|
|
13
|
+
canvas: Canvas.state,
|
|
14
|
+
scroll: Scroll.state,
|
|
15
|
+
pointer: Pointer.state,
|
|
16
|
+
startPointer: Pointer.state,
|
|
17
|
+
search: Search.state,
|
|
18
|
+
viewer: Viewer.state,
|
|
19
|
+
};
|
|
20
|
+
/** internal */
|
|
21
|
+
const deepClone = (state) => {
|
|
22
|
+
return JSON.parse(JSON.stringify(state));
|
|
23
|
+
};
|
|
24
|
+
/** internal */
|
|
25
|
+
const resetSearchResults = (searchState) => {
|
|
26
|
+
searchState.page = 1;
|
|
27
|
+
searchState.match = null;
|
|
28
|
+
return searchState;
|
|
29
|
+
};
|
|
30
|
+
/** internal */
|
|
31
|
+
export const actions = {
|
|
32
|
+
document: Document.actions,
|
|
33
|
+
annotations: Annotations.actions,
|
|
34
|
+
canvas: Canvas.actions,
|
|
35
|
+
scroll: Scroll.actions,
|
|
36
|
+
search: Search.actions,
|
|
37
|
+
pointer: Pointer.actions,
|
|
38
|
+
startPointer: Pointer.actions,
|
|
39
|
+
viewer: Viewer.actions,
|
|
40
|
+
getState: () => ($state) => $state,
|
|
41
|
+
loadDefaultState: () => ($state) => {
|
|
42
|
+
const newState = deepClone(defaultState);
|
|
43
|
+
newState.viewer.contextBarItems = $state.viewer.contextBarItems;
|
|
44
|
+
newState.search = resetSearchResults($state.search);
|
|
45
|
+
return newState;
|
|
46
|
+
},
|
|
47
|
+
resetChangedState: () => ($state) => (Object.assign(Object.assign({}, $state), { changed: false, viewer: Object.assign(Object.assign({}, $state.viewer), { modeChanged: false, cursorStyleChanged: false, selectedAnnotationChanged: false, textSelectionChanged: false, selectedPopupChanged: false, command: null }), annotations: Object.assign(Object.assign({}, $state.annotations), { annotationsChanged: false, openPopupChanged: false }), document: Object.assign(Object.assign({}, $state.document), { busyStateChanged: false, heightChanged: false, widthChanged: false, firstVisiblePageChanged: false, lastVisiblePageChanged: false, rotationChanged: false, zoomChanged: false }), canvas: Object.assign(Object.assign({}, $state.canvas), { canvasInvalidated: false, heightChanged: false, widthChanged: false }), scroll: Object.assign(Object.assign({}, $state.scroll), { leftPositionChanged: false, topPositionChanged: false }), pointer: Object.assign(Object.assign({}, $state.pointer), { positionChanged: false, stateChanged: false, action: null }) })),
|
|
48
|
+
};
|
|
49
|
+
/** internal */
|
|
50
|
+
export const createStore = () => {
|
|
51
|
+
return appState(deepClone(defaultState), actions);
|
|
52
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import { PdfRect, Annotation, PdfItemType, TextSelection, AnnotationBehaviors } from '../../pdf-viewer-api';
|
|
3
|
+
import { IconDefinition } from '../../common/Icon';
|
|
4
|
+
/** internal */
|
|
5
|
+
export type TextSelectionType = 'normal' | 'rectangular';
|
|
6
|
+
/** internal */
|
|
7
|
+
export type TextSelectionState = 'selecting' | 'textSelected';
|
|
8
|
+
/** internal */
|
|
9
|
+
export declare enum ViewerMode {
|
|
10
|
+
DEFAULT = 0,
|
|
11
|
+
ANNOTATION_SELECTED = 1,
|
|
12
|
+
TEXT_SELECTED = 2,
|
|
13
|
+
POPUP_SELECTED = 3,
|
|
14
|
+
MODULE_SELECTED = 4
|
|
15
|
+
}
|
|
16
|
+
/** internal */
|
|
17
|
+
export declare enum CursorStyle {
|
|
18
|
+
DEFAULT = "default",
|
|
19
|
+
TEXT = "text",
|
|
20
|
+
NONE = "none",
|
|
21
|
+
POINTER = "pointer",
|
|
22
|
+
CROSSHAIR = "crosshair",
|
|
23
|
+
NOT_ALLOWED = "not-allowed",
|
|
24
|
+
WAIT = "wait",
|
|
25
|
+
MOVE = "move",
|
|
26
|
+
GRAB = "grab",
|
|
27
|
+
GRABBING = "grabbing",
|
|
28
|
+
COL_RESIZE = "col-resize",
|
|
29
|
+
ROW_RESIZE = "row-resize",
|
|
30
|
+
NS_RESIZE = "ns-resize",
|
|
31
|
+
EW_RESIZE = "ew-resize",
|
|
32
|
+
NESW_RESIZE = "nesw-resize",
|
|
33
|
+
NWSE_RESIZE = "nwse-resize",
|
|
34
|
+
ERASE = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADwQAAA8EB0Z6ZfgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAM+SURBVEiJtZRbSBRRGMe/WTd3dmfmzOyZdcaVQlCsl3yK8lIqRAgFIbrubGa6D1IURQ8RhWgPQZC0RRQ99agPQXSDNCPEy67FCqZb6boma7Vq1w0zytvO7PTS0qZ7M+wPw8D3/+b/O+fMzEcEg0HV5/NBtPx+/2273W6D9ZDL5VIBIAwAi1HXkXUJBwDt7/sbAMhdr9BoaVJtbK6sPLwrP9/4XwBX7XbH6YqKG+erqjxHy8uFtQC0c3NzPQBwK17DzWPHzlsKCk5u0Gq1hXl5GwmCGJyX5aLW7u6ZVABEItNRV9dkLys7R5Hkhuj64OTkh3tOZ/G1rq5AMkBaPON6Q8OJ2pKSCzRJpq/0soxGRsC4xsRx9/vHxmbXDGiprT1uKy6+zOr1q8IjElmWZvX6GoamHw6Mj39NGXClvv7QwdLS60aK0iVaGQBAJsdRPEXZkF7f4Z6YCCYFNErSPntJSSumaTJZeBTEICJky+D5jn6v98tK/6/PVKeqwW/z80qq4RHlmM28YtrcZ7UeyV/p/bWDXq93RkSoLwOhap5hkh4RAMCyLMPVVx8VcaeN4hB7QKBRz+jY0PuYgN+QKTPLuniEqk1JIEuhEDhezISFAksaEAToWIE0Yl7KNtIuz8jQVExABCJynDMDIYuJYWK+j5CiQMvzd4pQZE0jNH9OOp0x6QwsL2VnsG7Py8G3cf8Dp9c7bca4Q0RIwgxjiPZkRYFLQ+8UoUhK02hWTxsdY0o3MNiSbebdcQEAAL2jo59Zmn6CaVoSWVYfCXcMTyl8YXXM8GgICcT+hAAAgKc+3ycBoUeYpiWeYQyXhwNhXJA4HABAXvyhwrSnPSkAAMDl832mSbL92XeN1bSzhtZoEj8mLy2oCyOPO5odjdUpAQAA3BMTQQpvahcwL5HGTCpenyovq6Hx7r6mljN7ARIMu1jy+0eCyIAeYA7ZSFZcBVEVWZ0dfDBw7tLZskgt4biOp117LDm7d1ucOHebOVILhxX4+aJzuPniqe0EQaiR+pp2EFFgcmxWWVq+I/LYasBZSFVV+OnpfLll0r1jqySFo3v/CQAAEAi8ngsvh+6KHFMZmvJMi7Pj2+1tbfLKvl/ycBilf3EZ0gAAAABJRU5ErkJggg=='), auto"
|
|
35
|
+
}
|
|
36
|
+
/** internal */
|
|
37
|
+
export interface ContextBarItem {
|
|
38
|
+
itemTypes: PdfItemType[];
|
|
39
|
+
icon: IconDefinition;
|
|
40
|
+
onCmd(args?: any): void;
|
|
41
|
+
}
|
|
42
|
+
/** internal */
|
|
43
|
+
export interface ViewerState {
|
|
44
|
+
modeChanged: boolean;
|
|
45
|
+
mode: ViewerMode;
|
|
46
|
+
selectedAnnotationId: number | null;
|
|
47
|
+
selectedAnnotationBehaviors: AnnotationBehaviors | null;
|
|
48
|
+
selectedAnnotationChanged: boolean;
|
|
49
|
+
textSelectionChanged: boolean;
|
|
50
|
+
textSelection: TextSelection | null;
|
|
51
|
+
textSelectionType: TextSelectionType | null;
|
|
52
|
+
textSelectionState: TextSelectionState | null;
|
|
53
|
+
textSelectionRects: {
|
|
54
|
+
[key: string]: PdfRect;
|
|
55
|
+
} | null;
|
|
56
|
+
selectedPopupId: number | null;
|
|
57
|
+
selectedPopupChanged: boolean | null;
|
|
58
|
+
popupFocus: number | null;
|
|
59
|
+
selectedModuleName: string | null;
|
|
60
|
+
cursorStyle: CursorStyle;
|
|
61
|
+
cursorStyleChanged: boolean;
|
|
62
|
+
contextBarItems: ContextBarItem[][];
|
|
63
|
+
}
|
|
64
|
+
/** internal */
|
|
65
|
+
export declare const state: ViewerState;
|
|
66
|
+
/** internal */
|
|
67
|
+
export interface ViewerActions {
|
|
68
|
+
setDefaultMode(): ViewerState;
|
|
69
|
+
setCursorStyle(cursorStyle: CursorStyle): ViewerState;
|
|
70
|
+
beginModule(moduleName: string): ViewerState;
|
|
71
|
+
endModule(moduleName: string): ViewerState;
|
|
72
|
+
addContextBarItem(contextBarItem: ContextBarItem): ViewerState;
|
|
73
|
+
clearContextBarItems(): ViewerState;
|
|
74
|
+
selectAnnotation(annotation: Annotation): ViewerState;
|
|
75
|
+
deselectAnnotation(): ViewerState;
|
|
76
|
+
setTextSelection(args: {
|
|
77
|
+
selection: TextSelection | null;
|
|
78
|
+
type: TextSelectionType | null;
|
|
79
|
+
}): ViewerState;
|
|
80
|
+
setTextSelectionState(textSelectionState: TextSelectionState | null): ViewerState;
|
|
81
|
+
selectPopup(args: {
|
|
82
|
+
id: number | null;
|
|
83
|
+
focus: boolean;
|
|
84
|
+
}): ViewerState;
|
|
85
|
+
clearPopupFocus(): ViewerState;
|
|
86
|
+
deselectPopup(): ViewerState;
|
|
87
|
+
}
|
|
88
|
+
/** internal */
|
|
89
|
+
export declare const actions: ActionsType<ViewerState, ViewerActions>;
|
|
90
|
+
/** internal */
|
|
91
|
+
export declare const copyTextToClipboard: (text: string) => Promise<void>;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
/** internal */
|
|
11
|
+
export var ViewerMode;
|
|
12
|
+
(function (ViewerMode) {
|
|
13
|
+
ViewerMode[ViewerMode["DEFAULT"] = 0] = "DEFAULT";
|
|
14
|
+
ViewerMode[ViewerMode["ANNOTATION_SELECTED"] = 1] = "ANNOTATION_SELECTED";
|
|
15
|
+
ViewerMode[ViewerMode["TEXT_SELECTED"] = 2] = "TEXT_SELECTED";
|
|
16
|
+
ViewerMode[ViewerMode["POPUP_SELECTED"] = 3] = "POPUP_SELECTED";
|
|
17
|
+
ViewerMode[ViewerMode["MODULE_SELECTED"] = 4] = "MODULE_SELECTED";
|
|
18
|
+
})(ViewerMode || (ViewerMode = {}));
|
|
19
|
+
/** internal */
|
|
20
|
+
export var CursorStyle;
|
|
21
|
+
(function (CursorStyle) {
|
|
22
|
+
CursorStyle["DEFAULT"] = "default";
|
|
23
|
+
CursorStyle["TEXT"] = "text";
|
|
24
|
+
CursorStyle["NONE"] = "none";
|
|
25
|
+
CursorStyle["POINTER"] = "pointer";
|
|
26
|
+
CursorStyle["CROSSHAIR"] = "crosshair";
|
|
27
|
+
CursorStyle["NOT_ALLOWED"] = "not-allowed";
|
|
28
|
+
CursorStyle["WAIT"] = "wait";
|
|
29
|
+
CursorStyle["MOVE"] = "move";
|
|
30
|
+
CursorStyle["GRAB"] = "grab";
|
|
31
|
+
CursorStyle["GRABBING"] = "grabbing";
|
|
32
|
+
CursorStyle["COL_RESIZE"] = "col-resize";
|
|
33
|
+
CursorStyle["ROW_RESIZE"] = "row-resize";
|
|
34
|
+
CursorStyle["NS_RESIZE"] = "ns-resize";
|
|
35
|
+
CursorStyle["EW_RESIZE"] = "ew-resize";
|
|
36
|
+
CursorStyle["NESW_RESIZE"] = "nesw-resize";
|
|
37
|
+
CursorStyle["NWSE_RESIZE"] = "nwse-resize";
|
|
38
|
+
CursorStyle["ERASE"] = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADwQAAA8EB0Z6ZfgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAM+SURBVEiJtZRbSBRRGMe/WTd3dmfmzOyZdcaVQlCsl3yK8lIqRAgFIbrubGa6D1IURQ8RhWgPQZC0RRQ99agPQXSDNCPEy67FCqZb6boma7Vq1w0zytvO7PTS0qZ7M+wPw8D3/+b/O+fMzEcEg0HV5/NBtPx+/2273W6D9ZDL5VIBIAwAi1HXkXUJBwDt7/sbAMhdr9BoaVJtbK6sPLwrP9/4XwBX7XbH6YqKG+erqjxHy8uFtQC0c3NzPQBwK17DzWPHzlsKCk5u0Gq1hXl5GwmCGJyX5aLW7u6ZVABEItNRV9dkLys7R5Hkhuj64OTkh3tOZ/G1rq5AMkBaPON6Q8OJ2pKSCzRJpq/0soxGRsC4xsRx9/vHxmbXDGiprT1uKy6+zOr1q8IjElmWZvX6GoamHw6Mj39NGXClvv7QwdLS60aK0iVaGQBAJsdRPEXZkF7f4Z6YCCYFNErSPntJSSumaTJZeBTEICJky+D5jn6v98tK/6/PVKeqwW/z80qq4RHlmM28YtrcZ7UeyV/p/bWDXq93RkSoLwOhap5hkh4RAMCyLMPVVx8VcaeN4hB7QKBRz+jY0PuYgN+QKTPLuniEqk1JIEuhEDhezISFAksaEAToWIE0Yl7KNtIuz8jQVExABCJynDMDIYuJYWK+j5CiQMvzd4pQZE0jNH9OOp0x6QwsL2VnsG7Py8G3cf8Dp9c7bca4Q0RIwgxjiPZkRYFLQ+8UoUhK02hWTxsdY0o3MNiSbebdcQEAAL2jo59Zmn6CaVoSWVYfCXcMTyl8YXXM8GgICcT+hAAAgKc+3ycBoUeYpiWeYQyXhwNhXJA4HABAXvyhwrSnPSkAAMDl832mSbL92XeN1bSzhtZoEj8mLy2oCyOPO5odjdUpAQAA3BMTQQpvahcwL5HGTCpenyovq6Hx7r6mljN7ARIMu1jy+0eCyIAeYA7ZSFZcBVEVWZ0dfDBw7tLZskgt4biOp117LDm7d1ucOHebOVILhxX4+aJzuPniqe0EQaiR+pp2EFFgcmxWWVq+I/LYasBZSFVV+OnpfLll0r1jqySFo3v/CQAAEAi8ngsvh+6KHFMZmvJMi7Pj2+1tbfLKvl/ycBilf3EZ0gAAAABJRU5ErkJggg=='), auto";
|
|
39
|
+
})(CursorStyle || (CursorStyle = {}));
|
|
40
|
+
/** internal */
|
|
41
|
+
export const state = {
|
|
42
|
+
modeChanged: true,
|
|
43
|
+
mode: ViewerMode.DEFAULT,
|
|
44
|
+
selectedAnnotationId: null,
|
|
45
|
+
selectedAnnotationBehaviors: null,
|
|
46
|
+
selectedAnnotationChanged: true,
|
|
47
|
+
textSelectionChanged: true,
|
|
48
|
+
textSelection: null,
|
|
49
|
+
textSelectionType: null,
|
|
50
|
+
textSelectionState: null,
|
|
51
|
+
textSelectionRects: null,
|
|
52
|
+
selectedPopupId: null,
|
|
53
|
+
selectedPopupChanged: true,
|
|
54
|
+
popupFocus: null,
|
|
55
|
+
selectedModuleName: null,
|
|
56
|
+
cursorStyle: CursorStyle.DEFAULT,
|
|
57
|
+
cursorStyleChanged: true,
|
|
58
|
+
contextBarItems: [],
|
|
59
|
+
};
|
|
60
|
+
/** internal */
|
|
61
|
+
export const actions = {
|
|
62
|
+
setDefaultMode: () => ($state) => ({
|
|
63
|
+
modeChanged: true,
|
|
64
|
+
mode: ViewerMode.DEFAULT,
|
|
65
|
+
selectedAnnotationId: null,
|
|
66
|
+
selectedAnnotationBehaviors: null,
|
|
67
|
+
selectedAnnotationChanged: true,
|
|
68
|
+
textSelectionChanged: true,
|
|
69
|
+
textSelection: null,
|
|
70
|
+
selectedPopupId: null,
|
|
71
|
+
selectedPopupChanged: true,
|
|
72
|
+
selectedModuleName: null,
|
|
73
|
+
cursorStyle: CursorStyle.DEFAULT,
|
|
74
|
+
cursorStyleChanged: true,
|
|
75
|
+
}),
|
|
76
|
+
addContextBarItem: (contextBarItem) => ($state) => {
|
|
77
|
+
const contextBarItems = $state.contextBarItems;
|
|
78
|
+
contextBarItem.itemTypes.forEach((itemType) => {
|
|
79
|
+
if (!contextBarItems[itemType]) {
|
|
80
|
+
contextBarItems[itemType] = [];
|
|
81
|
+
}
|
|
82
|
+
contextBarItems[itemType].push(contextBarItem);
|
|
83
|
+
});
|
|
84
|
+
return Object.assign(Object.assign({}, $state), { contextBarItems });
|
|
85
|
+
},
|
|
86
|
+
clearContextBarItems: () => ($state) => (Object.assign(Object.assign({}, $state), { contextBarItems: [] })),
|
|
87
|
+
setCursorStyle: (cursorStyle) => ($state) => (Object.assign(Object.assign({}, $state), { cursorStyle, cursorStyleChanged: $state.cursorStyle !== cursorStyle })),
|
|
88
|
+
selectAnnotation: (annotation) => ($state) => (Object.assign(Object.assign({}, $state), { selectedAnnotationId: annotation.id, selectedAnnotationBehaviors: annotation.behaviors, selectedAnnotationChanged: true, selectedModuleName: null, selectedPopupId: null, modeChanged: true, mode: ViewerMode.ANNOTATION_SELECTED })),
|
|
89
|
+
deselectAnnotation: () => ($state) => {
|
|
90
|
+
const modeChanged = $state.mode === ViewerMode.ANNOTATION_SELECTED;
|
|
91
|
+
return Object.assign(Object.assign({}, $state), { selectedAnnotationId: null, selectedAnnotationBehaviors: null, selectedModuleName: null, selectedAnnotationChanged: true, modeChanged, mode: modeChanged ? ViewerMode.DEFAULT : $state.mode });
|
|
92
|
+
},
|
|
93
|
+
beginModule: (moduleName) => ($state) => {
|
|
94
|
+
return Object.assign(Object.assign({}, $state), { modeChanged: true, mode: ViewerMode.MODULE_SELECTED, selectedAnnotationId: null, selectedAnnotationBehaviors: null, selectedAnnotationChanged: true, textSelectionChanged: true, textSelection: null, selectedModuleName: moduleName, selectedPopupId: null, selectedPopupChanged: true });
|
|
95
|
+
},
|
|
96
|
+
endModule: (moduleName) => ($state) => {
|
|
97
|
+
const selectedModuleName = $state.selectedModuleName === moduleName ? null : $state.selectedModuleName;
|
|
98
|
+
const mode = selectedModuleName !== null ? ViewerMode.MODULE_SELECTED : ViewerMode.DEFAULT;
|
|
99
|
+
return Object.assign(Object.assign({}, $state), { modeChanged: true, selectedModuleName,
|
|
100
|
+
mode });
|
|
101
|
+
},
|
|
102
|
+
setTextSelectionState: (textSelectionState) => ($state) => {
|
|
103
|
+
return Object.assign(Object.assign({}, $state), { textSelectionState });
|
|
104
|
+
},
|
|
105
|
+
setTextSelection: (args) => ($state) => {
|
|
106
|
+
const { selection, type } = args;
|
|
107
|
+
const mode = selection ? ViewerMode.TEXT_SELECTED : ViewerMode.DEFAULT;
|
|
108
|
+
const modeChanged = $state.mode !== mode;
|
|
109
|
+
const textSelectionRects = selection ? {} : null;
|
|
110
|
+
if (selection && textSelectionRects) {
|
|
111
|
+
const pageRects = {};
|
|
112
|
+
selection.quadrilaterals.forEach((q) => {
|
|
113
|
+
const { bottomLeft, bottomRight, topRight, topLeft, pageNumber } = q;
|
|
114
|
+
if (!pageRects[pageNumber]) {
|
|
115
|
+
pageRects[pageNumber] = {
|
|
116
|
+
x1: Number.MAX_SAFE_INTEGER,
|
|
117
|
+
y1: Number.MAX_SAFE_INTEGER,
|
|
118
|
+
x2: Number.MIN_SAFE_INTEGER,
|
|
119
|
+
y2: Number.MIN_SAFE_INTEGER,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
pageRects[pageNumber] = {
|
|
123
|
+
x1: Math.min(pageRects[pageNumber].x1, bottomLeft.x, bottomRight.x, topRight.x, topLeft.x),
|
|
124
|
+
y1: Math.min(pageRects[pageNumber].y1, bottomLeft.y, bottomRight.y, topRight.y, topLeft.y),
|
|
125
|
+
x2: Math.max(pageRects[pageNumber].x2, bottomLeft.x, bottomRight.x, topRight.x, topLeft.x),
|
|
126
|
+
y2: Math.max(pageRects[pageNumber].y2, bottomLeft.y, bottomRight.y, topRight.y, topLeft.y),
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
Object.keys(pageRects).forEach((pageNumber) => {
|
|
130
|
+
textSelectionRects[pageNumber] = {
|
|
131
|
+
pdfX: pageRects[pageNumber].x1,
|
|
132
|
+
pdfY: pageRects[pageNumber].y1,
|
|
133
|
+
pdfW: pageRects[pageNumber].x2 - pageRects[pageNumber].x1,
|
|
134
|
+
pdfH: pageRects[pageNumber].y2 - pageRects[pageNumber].y1,
|
|
135
|
+
page: parseInt(pageNumber),
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return Object.assign(Object.assign({}, $state), { mode,
|
|
140
|
+
modeChanged, textSelectionChanged: true, textSelection: selection, textSelectionType: type, textSelectionRects });
|
|
141
|
+
},
|
|
142
|
+
selectPopup: (args) => ($state) => {
|
|
143
|
+
const mode = args.id !== null ? ViewerMode.POPUP_SELECTED : ViewerMode.DEFAULT;
|
|
144
|
+
const modeChanged = $state.mode !== mode;
|
|
145
|
+
return Object.assign(Object.assign({}, $state), { mode,
|
|
146
|
+
modeChanged, selectedPopupChanged: args.id !== $state.selectedPopupId, selectedPopupId: args.id, popupFocus: args.focus ? args.id : null });
|
|
147
|
+
},
|
|
148
|
+
clearPopupFocus: () => ($state) => {
|
|
149
|
+
return Object.assign(Object.assign({}, $state), { popupFocus: null });
|
|
150
|
+
},
|
|
151
|
+
deselectPopup: () => ($state) => {
|
|
152
|
+
const mode = ViewerMode.DEFAULT;
|
|
153
|
+
const modeChanged = mode !== $state.mode;
|
|
154
|
+
return Object.assign(Object.assign({}, $state), { mode,
|
|
155
|
+
modeChanged });
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
/** internal */
|
|
159
|
+
export const copyTextToClipboard = (text) => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
|
+
try {
|
|
161
|
+
yield navigator.clipboard.writeText(text);
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
var textArea = document.createElement('textarea');
|
|
165
|
+
textArea.value = text;
|
|
166
|
+
textArea.style.top = '0';
|
|
167
|
+
textArea.style.left = '0';
|
|
168
|
+
textArea.style.position = 'fixed';
|
|
169
|
+
document.body.appendChild(textArea);
|
|
170
|
+
textArea.focus();
|
|
171
|
+
textArea.select();
|
|
172
|
+
document.execCommand('copy');
|
|
173
|
+
document.body.removeChild(textArea);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ViewLayerBase } from './ViewLayerBase';
|
|
2
|
+
import { ViewerCanvasState } from '../state/store';
|
|
3
|
+
/** internal */
|
|
4
|
+
export declare class AnnotationSelectionLayer extends ViewLayerBase {
|
|
5
|
+
context: CanvasRenderingContext2D | null;
|
|
6
|
+
private selectedAnnotation;
|
|
7
|
+
private selectionElement;
|
|
8
|
+
private barAtTop;
|
|
9
|
+
private contextBar;
|
|
10
|
+
private annotationBorder;
|
|
11
|
+
constructor();
|
|
12
|
+
create(): void;
|
|
13
|
+
render(timestamp: number, state: ViewerCanvasState): false | undefined;
|
|
14
|
+
private updateSelectionElementPosition;
|
|
15
|
+
private selectAnnotation;
|
|
16
|
+
private deselectAnnotation;
|
|
17
|
+
private rotateAnnotation;
|
|
18
|
+
private moveAnnotation;
|
|
19
|
+
private resizeAnnotation;
|
|
20
|
+
private copyAnnotationText;
|
|
21
|
+
private toggleLock;
|
|
22
|
+
private deleteAnnotation;
|
|
23
|
+
private deletePopup;
|
|
24
|
+
private createPopup;
|
|
25
|
+
private openPopup;
|
|
26
|
+
private onItemDblClick;
|
|
27
|
+
private onItemSelected;
|
|
28
|
+
}
|