@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,108 @@
|
|
|
1
|
+
export as namespace hyperapp
|
|
2
|
+
|
|
3
|
+
/** @namespace [VDOM] */
|
|
4
|
+
|
|
5
|
+
/** The VDOM representation of an Element.
|
|
6
|
+
*
|
|
7
|
+
* @memberOf [VDOM]
|
|
8
|
+
*/
|
|
9
|
+
export interface VNode<Attributes = {}> {
|
|
10
|
+
nodeName: string
|
|
11
|
+
attributes?: Attributes
|
|
12
|
+
children: Array<VNode | string>
|
|
13
|
+
key: string | number | null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** A Component is a function that returns a custom VNode or View.
|
|
17
|
+
*
|
|
18
|
+
* @memberOf [VDOM]
|
|
19
|
+
*/
|
|
20
|
+
export interface Component<Attributes = {}> {
|
|
21
|
+
(attributes: Attributes, children: Array<VNode | string>): VNode<Attributes>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** A Component is a function that returns a custom VNode or View.
|
|
25
|
+
*
|
|
26
|
+
* @memberOf [VDOM]
|
|
27
|
+
*/
|
|
28
|
+
export interface ViewComponent<Attributes = {}, State = {}, Actions = {}> {
|
|
29
|
+
(attributes: Attributes, children: Array<VNode | string>): any
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Possibles children types
|
|
34
|
+
*/
|
|
35
|
+
export type Children = VNode | string | number | null
|
|
36
|
+
|
|
37
|
+
/** The soft way to create a VNode.
|
|
38
|
+
* @param name An element name or a Component function
|
|
39
|
+
* @param attributes Any valid HTML atributes, events, styles, and meta data
|
|
40
|
+
* @param children The children of the VNode
|
|
41
|
+
* @returns A VNode tree.
|
|
42
|
+
*
|
|
43
|
+
* @memberOf [VDOM]
|
|
44
|
+
*/
|
|
45
|
+
export function h<Attributes>(
|
|
46
|
+
nodeName: Component<Attributes> | string,
|
|
47
|
+
attributes?: Attributes,
|
|
48
|
+
...children: Array<Children | Children[]>
|
|
49
|
+
): VNode<Attributes>
|
|
50
|
+
|
|
51
|
+
/** @namespace [App] */
|
|
52
|
+
|
|
53
|
+
/** The result of an action.
|
|
54
|
+
*
|
|
55
|
+
* @memberOf [App]
|
|
56
|
+
*/
|
|
57
|
+
export type ActionResult<State> = Partial<State> | Promise<any> | null | void
|
|
58
|
+
|
|
59
|
+
/** The interface for a single action implementation.
|
|
60
|
+
*
|
|
61
|
+
* @memberOf [App]
|
|
62
|
+
*/
|
|
63
|
+
export type ActionType<Data, State, Actions> = (
|
|
64
|
+
data?: Data
|
|
65
|
+
) => ((state: State, actions: Actions) => ActionResult<State>) | ActionResult<State>
|
|
66
|
+
|
|
67
|
+
/** The interface for the actions tree implementation.
|
|
68
|
+
*
|
|
69
|
+
* @memberOf [App]
|
|
70
|
+
*/
|
|
71
|
+
export type ActionsType<State, Actions> = {
|
|
72
|
+
[P in keyof Actions]: ActionType<any, State, Actions> | ActionsType<any, Actions[P]>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The view function describes the application UI as a tree of VNodes.
|
|
76
|
+
* @returns A VNode tree.
|
|
77
|
+
* @memberOf [App]
|
|
78
|
+
*/
|
|
79
|
+
export interface View<State, Actions> {
|
|
80
|
+
(state: State, actions: Actions): VNode<object> | null
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The app() call creates and renders a new application.
|
|
84
|
+
*
|
|
85
|
+
* @param state The state object.
|
|
86
|
+
* @param actions The actions object implementation.
|
|
87
|
+
* @param view The view function.
|
|
88
|
+
* @param container The DOM element where the app will be rendered to.
|
|
89
|
+
* @returns The actions wired to the application.
|
|
90
|
+
* @memberOf [App]
|
|
91
|
+
*/
|
|
92
|
+
export function app<State, Actions>(
|
|
93
|
+
state: State,
|
|
94
|
+
actions: ActionsType<State, Actions>,
|
|
95
|
+
view: View<State, Actions>,
|
|
96
|
+
container: Element | null
|
|
97
|
+
): Actions
|
|
98
|
+
|
|
99
|
+
/** @namespace [JSX] */
|
|
100
|
+
|
|
101
|
+
declare global {
|
|
102
|
+
namespace JSX {
|
|
103
|
+
interface Element extends VNode<any> {}
|
|
104
|
+
interface IntrinsicElements {
|
|
105
|
+
[elemName: string]: any
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
export function h(name, attributes) {
|
|
2
|
+
var rest = [];
|
|
3
|
+
var children = [];
|
|
4
|
+
var length = arguments.length;
|
|
5
|
+
while (length-- > 2)
|
|
6
|
+
rest.push(arguments[length]);
|
|
7
|
+
while (rest.length) {
|
|
8
|
+
var node = rest.pop();
|
|
9
|
+
if (node && node.pop) {
|
|
10
|
+
for (length = node.length; length--;) {
|
|
11
|
+
rest.push(node[length]);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
else if (node != null && node !== true && node !== false) {
|
|
15
|
+
children.push(node);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return typeof name === "function"
|
|
19
|
+
? name(attributes || {}, children)
|
|
20
|
+
: {
|
|
21
|
+
nodeName: name,
|
|
22
|
+
attributes: attributes || {},
|
|
23
|
+
children: children,
|
|
24
|
+
key: attributes && attributes.key
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function app(state, actions, view, container) {
|
|
28
|
+
var map = [].map;
|
|
29
|
+
var rootElement = (container && container.children[0]) || null;
|
|
30
|
+
var oldNode = rootElement && recycleElement(rootElement);
|
|
31
|
+
var lifecycle = [];
|
|
32
|
+
var skipRender;
|
|
33
|
+
var isRecycling = true;
|
|
34
|
+
var globalState = clone(state);
|
|
35
|
+
var wiredActions = wireStateToActions([], globalState, clone(actions));
|
|
36
|
+
scheduleRender();
|
|
37
|
+
return wiredActions;
|
|
38
|
+
function recycleElement(element) {
|
|
39
|
+
return {
|
|
40
|
+
nodeName: element.nodeName.toLowerCase(),
|
|
41
|
+
attributes: {},
|
|
42
|
+
children: map.call(element.childNodes, function (element) {
|
|
43
|
+
return element.nodeType === 3 // Node.TEXT_NODE
|
|
44
|
+
? element.nodeValue
|
|
45
|
+
: recycleElement(element);
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function resolveNode(node) {
|
|
50
|
+
return typeof node === "function"
|
|
51
|
+
? resolveNode(node(globalState, wiredActions))
|
|
52
|
+
: node != null
|
|
53
|
+
? node
|
|
54
|
+
: "";
|
|
55
|
+
}
|
|
56
|
+
function render() {
|
|
57
|
+
skipRender = !skipRender;
|
|
58
|
+
var node = resolveNode(view);
|
|
59
|
+
if (container && !skipRender) {
|
|
60
|
+
rootElement = patch(container, rootElement, oldNode, (oldNode = node));
|
|
61
|
+
}
|
|
62
|
+
isRecycling = false;
|
|
63
|
+
while (lifecycle.length)
|
|
64
|
+
lifecycle.pop()();
|
|
65
|
+
}
|
|
66
|
+
function scheduleRender() {
|
|
67
|
+
if (!skipRender) {
|
|
68
|
+
skipRender = true;
|
|
69
|
+
setTimeout(render);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function clone(target, source) {
|
|
73
|
+
var out = {};
|
|
74
|
+
for (var i in target)
|
|
75
|
+
out[i] = target[i];
|
|
76
|
+
for (var i in source)
|
|
77
|
+
out[i] = source[i];
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
function setPartialState(path, value, source) {
|
|
81
|
+
var target = {};
|
|
82
|
+
if (path.length) {
|
|
83
|
+
target[path[0]] =
|
|
84
|
+
path.length > 1
|
|
85
|
+
? setPartialState(path.slice(1), value, source[path[0]])
|
|
86
|
+
: value;
|
|
87
|
+
return clone(source, target);
|
|
88
|
+
}
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
function getPartialState(path, source) {
|
|
92
|
+
var i = 0;
|
|
93
|
+
while (i < path.length) {
|
|
94
|
+
source = source[path[i++]];
|
|
95
|
+
}
|
|
96
|
+
return source;
|
|
97
|
+
}
|
|
98
|
+
function wireStateToActions(path, state, actions) {
|
|
99
|
+
for (var key in actions) {
|
|
100
|
+
typeof actions[key] === "function"
|
|
101
|
+
? (function (key, action) {
|
|
102
|
+
actions[key] = function (data) {
|
|
103
|
+
var result = action(data);
|
|
104
|
+
if (typeof result === "function") {
|
|
105
|
+
result = result(getPartialState(path, globalState), actions);
|
|
106
|
+
}
|
|
107
|
+
if (result &&
|
|
108
|
+
result !== (state = getPartialState(path, globalState)) &&
|
|
109
|
+
!result.then // !isPromise
|
|
110
|
+
) {
|
|
111
|
+
scheduleRender((globalState = setPartialState(path, clone(state, result), globalState)));
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
};
|
|
115
|
+
})(key, actions[key])
|
|
116
|
+
: wireStateToActions(path.concat(key), (state[key] = clone(state[key])), (actions[key] = clone(actions[key])));
|
|
117
|
+
}
|
|
118
|
+
return actions;
|
|
119
|
+
}
|
|
120
|
+
function getKey(node) {
|
|
121
|
+
return node ? node.key : null;
|
|
122
|
+
}
|
|
123
|
+
function eventListener(event) {
|
|
124
|
+
return event.currentTarget.events[event.type](event);
|
|
125
|
+
}
|
|
126
|
+
function updateAttribute(element, name, value, oldValue, isSvg) {
|
|
127
|
+
if (name === "key") {
|
|
128
|
+
}
|
|
129
|
+
else if (name === "style") {
|
|
130
|
+
if (typeof value === "string") {
|
|
131
|
+
element.style.cssText = value;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
if (typeof oldValue === "string")
|
|
135
|
+
oldValue = element.style.cssText = "";
|
|
136
|
+
for (var i in clone(oldValue, value)) {
|
|
137
|
+
var style = value == null || value[i] == null ? "" : value[i];
|
|
138
|
+
if (i[0] === "-") {
|
|
139
|
+
element.style.setProperty(i, style);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
element.style[i] = style;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (name[0] === "o" && name[1] === "n") {
|
|
149
|
+
name = name.slice(2);
|
|
150
|
+
if (element.events) {
|
|
151
|
+
if (!oldValue)
|
|
152
|
+
oldValue = element.events[name];
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
element.events = {};
|
|
156
|
+
}
|
|
157
|
+
element.events[name] = value;
|
|
158
|
+
if (value) {
|
|
159
|
+
if (!oldValue) {
|
|
160
|
+
element.addEventListener(name, eventListener);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
element.removeEventListener(name, eventListener);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else if (name in element &&
|
|
168
|
+
name !== "list" &&
|
|
169
|
+
name !== "type" &&
|
|
170
|
+
name !== "draggable" &&
|
|
171
|
+
name !== "spellcheck" &&
|
|
172
|
+
name !== "translate" &&
|
|
173
|
+
!isSvg) {
|
|
174
|
+
element[name] = value == null ? "" : value;
|
|
175
|
+
}
|
|
176
|
+
else if (value != null && value !== false) {
|
|
177
|
+
element.setAttribute(name, value);
|
|
178
|
+
}
|
|
179
|
+
if (value == null || value === false) {
|
|
180
|
+
element.removeAttribute(name);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function createElement(node, isSvg) {
|
|
185
|
+
var element = typeof node === "string" || typeof node === "number"
|
|
186
|
+
? document.createTextNode(node)
|
|
187
|
+
: (isSvg = isSvg || node.nodeName === "svg")
|
|
188
|
+
? document.createElementNS("http://www.w3.org/2000/svg", node.nodeName)
|
|
189
|
+
: document.createElement(node.nodeName);
|
|
190
|
+
var attributes = node.attributes;
|
|
191
|
+
if (attributes) {
|
|
192
|
+
if (attributes.oncreate) {
|
|
193
|
+
lifecycle.push(function () {
|
|
194
|
+
attributes.oncreate(element);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
for (var i = 0; i < node.children.length; i++) {
|
|
198
|
+
element.appendChild(createElement((node.children[i] = resolveNode(node.children[i])), isSvg));
|
|
199
|
+
}
|
|
200
|
+
for (var name in attributes) {
|
|
201
|
+
updateAttribute(element, name, attributes[name], null, isSvg);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return element;
|
|
205
|
+
}
|
|
206
|
+
function updateElement(element, oldAttributes, attributes, isSvg) {
|
|
207
|
+
for (var name in clone(oldAttributes, attributes)) {
|
|
208
|
+
if (attributes[name] !==
|
|
209
|
+
(name === "value" || name === "checked"
|
|
210
|
+
? element[name]
|
|
211
|
+
: oldAttributes[name])) {
|
|
212
|
+
updateAttribute(element, name, attributes[name], oldAttributes[name], isSvg);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
var cb = isRecycling ? attributes.oncreate : attributes.onupdate;
|
|
216
|
+
if (cb) {
|
|
217
|
+
lifecycle.push(function () {
|
|
218
|
+
cb(element, oldAttributes);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function removeChildren(element, node) {
|
|
223
|
+
var attributes = node.attributes;
|
|
224
|
+
if (attributes) {
|
|
225
|
+
for (var i = 0; i < node.children.length; i++) {
|
|
226
|
+
removeChildren(element.childNodes[i], node.children[i]);
|
|
227
|
+
}
|
|
228
|
+
if (attributes.ondestroy) {
|
|
229
|
+
attributes.ondestroy(element);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return element;
|
|
233
|
+
}
|
|
234
|
+
function removeElement(parent, element, node) {
|
|
235
|
+
function done() {
|
|
236
|
+
parent.removeChild(removeChildren(element, node));
|
|
237
|
+
}
|
|
238
|
+
var cb = node.attributes && node.attributes.onremove;
|
|
239
|
+
if (cb) {
|
|
240
|
+
cb(element, done);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
done();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function patch(parent, element, oldNode, node, isSvg) {
|
|
247
|
+
if (node === oldNode) {
|
|
248
|
+
}
|
|
249
|
+
else if (oldNode == null || oldNode.nodeName !== node.nodeName) {
|
|
250
|
+
var newElement = createElement(node, isSvg);
|
|
251
|
+
parent.insertBefore(newElement, element);
|
|
252
|
+
if (oldNode != null) {
|
|
253
|
+
removeElement(parent, element, oldNode);
|
|
254
|
+
}
|
|
255
|
+
element = newElement;
|
|
256
|
+
}
|
|
257
|
+
else if (oldNode.nodeName == null) {
|
|
258
|
+
element.nodeValue = node;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
updateElement(element, oldNode.attributes, node.attributes, (isSvg = isSvg || node.nodeName === "svg"));
|
|
262
|
+
var oldKeyed = {};
|
|
263
|
+
var newKeyed = {};
|
|
264
|
+
var oldElements = [];
|
|
265
|
+
var oldChildren = oldNode.children;
|
|
266
|
+
var children = node.children;
|
|
267
|
+
for (var i = 0; i < oldChildren.length; i++) {
|
|
268
|
+
oldElements[i] = element.childNodes[i];
|
|
269
|
+
var oldKey = getKey(oldChildren[i]);
|
|
270
|
+
if (oldKey != null) {
|
|
271
|
+
oldKeyed[oldKey] = [oldElements[i], oldChildren[i]];
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
var i = 0;
|
|
275
|
+
var k = 0;
|
|
276
|
+
while (k < children.length) {
|
|
277
|
+
var oldKey = getKey(oldChildren[i]);
|
|
278
|
+
var newKey = getKey((children[k] = resolveNode(children[k])));
|
|
279
|
+
if (newKeyed[oldKey]) {
|
|
280
|
+
i++;
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
if (newKey != null && newKey === getKey(oldChildren[i + 1])) {
|
|
284
|
+
if (oldKey == null) {
|
|
285
|
+
removeElement(element, oldElements[i], oldChildren[i]);
|
|
286
|
+
}
|
|
287
|
+
i++;
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
if (newKey == null || isRecycling) {
|
|
291
|
+
if (oldKey == null) {
|
|
292
|
+
patch(element, oldElements[i], oldChildren[i], children[k], isSvg);
|
|
293
|
+
k++;
|
|
294
|
+
}
|
|
295
|
+
i++;
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
var keyedNode = oldKeyed[newKey] || [];
|
|
299
|
+
if (oldKey === newKey) {
|
|
300
|
+
patch(element, keyedNode[0], keyedNode[1], children[k], isSvg);
|
|
301
|
+
i++;
|
|
302
|
+
}
|
|
303
|
+
else if (keyedNode[0]) {
|
|
304
|
+
patch(element, element.insertBefore(keyedNode[0], oldElements[i]), keyedNode[1], children[k], isSvg);
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
patch(element, oldElements[i], null, children[k], isSvg);
|
|
308
|
+
}
|
|
309
|
+
newKeyed[newKey] = children[k];
|
|
310
|
+
k++;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
while (i < oldChildren.length) {
|
|
314
|
+
if (getKey(oldChildren[i]) == null) {
|
|
315
|
+
removeElement(element, oldElements[i], oldChildren[i]);
|
|
316
|
+
}
|
|
317
|
+
i++;
|
|
318
|
+
}
|
|
319
|
+
for (var i in oldKeyed) {
|
|
320
|
+
if (!newKeyed[i]) {
|
|
321
|
+
removeElement(element, oldKeyed[i][0], oldKeyed[i][1]);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return element;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ViewerCanvasState, ViewerCanvasStore } from '../pdf-viewer-canvas/state/store';
|
|
2
|
+
import { PdfViewerApi } from '../pdf-viewer-api';
|
|
3
|
+
import { Annotation, PdfItem } from '../pdf-viewer-api/types';
|
|
4
|
+
import { WebViewerOptions } from '../pdf-web-viewer/WebViewerOptions';
|
|
5
|
+
import { PdfViewerCanvas } from '../pdf-viewer-canvas/PdfViewerCanvas';
|
|
6
|
+
import { CanvasModule } from './CanvasModule';
|
|
7
|
+
export interface CanvasLayerClass {
|
|
8
|
+
new (module: CanvasModule, name: string, containerElement: HTMLElement, store: ViewerCanvasStore, pdfApi: PdfViewerApi, pdfViewerCanvas: PdfViewerCanvas, options: WebViewerOptions): CanvasLayer;
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class CanvasLayer {
|
|
11
|
+
protected containerElement: HTMLElement;
|
|
12
|
+
protected store: ViewerCanvasStore;
|
|
13
|
+
protected pdfApi: PdfViewerApi;
|
|
14
|
+
protected pdfViewerCanvas: PdfViewerCanvas;
|
|
15
|
+
protected options: WebViewerOptions;
|
|
16
|
+
protected module: CanvasModule;
|
|
17
|
+
private canvasContexts;
|
|
18
|
+
private htmlLayers;
|
|
19
|
+
private name;
|
|
20
|
+
constructor(module: CanvasModule, name: string, containerElement: HTMLElement, store: ViewerCanvasStore, pdfApi: PdfViewerApi, pdfViewerCanvas: PdfViewerCanvas, options: WebViewerOptions);
|
|
21
|
+
abstract onCreate(args?: any): void;
|
|
22
|
+
abstract onRemove(): void;
|
|
23
|
+
abstract render(timestamp: number, state: ViewerCanvasState): void;
|
|
24
|
+
abstract onSave(): Promise<void>;
|
|
25
|
+
resize(width: number, height: number): void;
|
|
26
|
+
protected remove(): void;
|
|
27
|
+
protected createHtmlLayer(): HTMLDivElement;
|
|
28
|
+
protected createCanvas(): CanvasRenderingContext2D;
|
|
29
|
+
protected removeHtmlElements(): void;
|
|
30
|
+
protected removeCanvasElements(): void;
|
|
31
|
+
protected onAnnotationCreated(annotation: Annotation): Promise<PdfItem>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { addHistoryEntry } from '../custom/history';
|
|
2
|
+
export class CanvasLayer {
|
|
3
|
+
constructor(module, name, containerElement, store, pdfApi, pdfViewerCanvas, options) {
|
|
4
|
+
this.canvasContexts = [];
|
|
5
|
+
this.htmlLayers = [];
|
|
6
|
+
this.containerElement = containerElement;
|
|
7
|
+
this.store = store;
|
|
8
|
+
this.pdfApi = pdfApi;
|
|
9
|
+
this.pdfViewerCanvas = pdfViewerCanvas;
|
|
10
|
+
this.options = options;
|
|
11
|
+
this.module = module;
|
|
12
|
+
this.name = name;
|
|
13
|
+
this.remove = this.remove.bind(this);
|
|
14
|
+
this.onAnnotationCreated = this.onAnnotationCreated.bind(this);
|
|
15
|
+
}
|
|
16
|
+
resize(width, height) {
|
|
17
|
+
const tempCanvas = document.createElement('canvas');
|
|
18
|
+
tempCanvas.width = width * devicePixelRatio;
|
|
19
|
+
tempCanvas.height = height * devicePixelRatio;
|
|
20
|
+
const tempContext = tempCanvas.getContext('2d');
|
|
21
|
+
this.canvasContexts.forEach((ctx) => {
|
|
22
|
+
tempContext.drawImage(ctx.canvas, 0, 0);
|
|
23
|
+
ctx.canvas.style.width = width + 'px';
|
|
24
|
+
ctx.canvas.style.height = height + 'px';
|
|
25
|
+
ctx.canvas.width = width * devicePixelRatio;
|
|
26
|
+
ctx.canvas.height = height * devicePixelRatio;
|
|
27
|
+
ctx.drawImage(tempContext.canvas, 0, 0);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
remove() {
|
|
31
|
+
this.module.removeCanvasLayer(this.name);
|
|
32
|
+
}
|
|
33
|
+
createHtmlLayer() {
|
|
34
|
+
const element = document.createElement('div');
|
|
35
|
+
this.htmlLayers.push(element);
|
|
36
|
+
if (this.containerElement) {
|
|
37
|
+
this.containerElement.appendChild(element);
|
|
38
|
+
}
|
|
39
|
+
return element;
|
|
40
|
+
}
|
|
41
|
+
createCanvas() {
|
|
42
|
+
const element = document.createElement('canvas');
|
|
43
|
+
element.style.position = 'absolute';
|
|
44
|
+
element.style.top = '0';
|
|
45
|
+
element.style.left = '0';
|
|
46
|
+
element.style.right = '0';
|
|
47
|
+
element.style.bottom = '0';
|
|
48
|
+
const context = element.getContext('2d');
|
|
49
|
+
this.canvasContexts.push(context);
|
|
50
|
+
if (this.containerElement) {
|
|
51
|
+
this.containerElement.appendChild(element);
|
|
52
|
+
const rect = this.containerElement.getBoundingClientRect();
|
|
53
|
+
context.canvas.width = rect.width * devicePixelRatio;
|
|
54
|
+
context.canvas.height = rect.height * devicePixelRatio;
|
|
55
|
+
context.canvas.style.width = rect.width + 'px';
|
|
56
|
+
context.canvas.style.height = rect.height + 'px';
|
|
57
|
+
}
|
|
58
|
+
return context;
|
|
59
|
+
}
|
|
60
|
+
removeHtmlElements() {
|
|
61
|
+
if (this.containerElement) {
|
|
62
|
+
for (let i = 0; i < this.htmlLayers.length; i++) {
|
|
63
|
+
this.containerElement.removeChild(this.htmlLayers[i]);
|
|
64
|
+
}
|
|
65
|
+
this.htmlLayers = [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
removeCanvasElements() {
|
|
69
|
+
if (this.containerElement) {
|
|
70
|
+
for (let i = 0; i < this.canvasContexts.length; i++) {
|
|
71
|
+
this.containerElement.removeChild(this.canvasContexts[i].canvas);
|
|
72
|
+
}
|
|
73
|
+
this.canvasContexts = [];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
onAnnotationCreated(annotation) {
|
|
77
|
+
if (this.options.annotation.trackHistory) {
|
|
78
|
+
addHistoryEntry(annotation, 'create', this.options.viewer.general.user);
|
|
79
|
+
return this.pdfApi.updateItem(annotation);
|
|
80
|
+
}
|
|
81
|
+
return new Promise((resolve) => resolve(annotation));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ViewerCanvasStore, ViewerCanvasState } from '../pdf-viewer-canvas/state/store';
|
|
2
|
+
import { PdfViewerApi, PdfItemType } from '../pdf-viewer-api';
|
|
3
|
+
import { PdfViewerCanvas } from '../pdf-viewer-canvas/PdfViewerCanvas';
|
|
4
|
+
import { CanvasLayer, CanvasLayerClass } from './CanvasLayer';
|
|
5
|
+
import { WebViewerOptions } from '../pdf-web-viewer/WebViewerOptions';
|
|
6
|
+
import { IconDefinition } from '../common/Icon';
|
|
7
|
+
export declare enum CanvasModuleType {
|
|
8
|
+
Tool = 0,
|
|
9
|
+
Layer = 1
|
|
10
|
+
}
|
|
11
|
+
export interface CanvasModuleRegistration {
|
|
12
|
+
toolbar?: HTMLElement;
|
|
13
|
+
contextbar?: {
|
|
14
|
+
itemTypes: PdfItemType[];
|
|
15
|
+
icon: IconDefinition;
|
|
16
|
+
onCmd(args?: any): void;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface CanvasModuleInfo {
|
|
20
|
+
name: string;
|
|
21
|
+
moduleType: CanvasModuleType;
|
|
22
|
+
requiredFeatures: {
|
|
23
|
+
annotate: boolean;
|
|
24
|
+
fillFormFields: boolean;
|
|
25
|
+
};
|
|
26
|
+
translationKey?: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CanvasModuleClass {
|
|
30
|
+
new (): CanvasModule;
|
|
31
|
+
moduleInfo: CanvasModuleInfo;
|
|
32
|
+
}
|
|
33
|
+
export interface CanvasLayerList {
|
|
34
|
+
[name: string]: CanvasLayer;
|
|
35
|
+
}
|
|
36
|
+
export declare abstract class CanvasModule {
|
|
37
|
+
protected canvasLayers: CanvasLayerList;
|
|
38
|
+
protected store: ViewerCanvasStore | null;
|
|
39
|
+
protected pdfApi: PdfViewerApi | null;
|
|
40
|
+
protected pdfViewerCanvas: PdfViewerCanvas | null;
|
|
41
|
+
protected options: WebViewerOptions | null;
|
|
42
|
+
name: string | null;
|
|
43
|
+
private containerElement;
|
|
44
|
+
protected static moduleInfo: CanvasModuleInfo;
|
|
45
|
+
constructor();
|
|
46
|
+
register(containerElement: HTMLElement, store: ViewerCanvasStore, pdfApi: PdfViewerApi, pdfViewerCanvas: PdfViewerCanvas, options: WebViewerOptions): CanvasModuleRegistration;
|
|
47
|
+
abstract onRegister(): CanvasModuleRegistration;
|
|
48
|
+
abstract activate(args?: any): void;
|
|
49
|
+
render(timestamp: number, state: ViewerCanvasState): void;
|
|
50
|
+
deactivate(): void;
|
|
51
|
+
resize(width: number, height: number): void;
|
|
52
|
+
getCanvasSize(): {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
onSave(): Promise<void>;
|
|
57
|
+
createCanvasLayer(name: string, canvasLayer: CanvasLayerClass, args?: any): void;
|
|
58
|
+
removeCanvasLayer(name: string): void;
|
|
59
|
+
}
|