@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,36 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import { Annotation, PdfItemsOnPage } from '../../pdf-viewer-api';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface AnnotationsState {
|
|
5
|
+
openPopupChanged: boolean;
|
|
6
|
+
annotationsChanged: boolean;
|
|
7
|
+
all: {
|
|
8
|
+
[id: number]: Annotation;
|
|
9
|
+
};
|
|
10
|
+
byPage: {
|
|
11
|
+
[page: number]: number[];
|
|
12
|
+
};
|
|
13
|
+
popupsByPage: {
|
|
14
|
+
[page: number]: number[];
|
|
15
|
+
};
|
|
16
|
+
openPopupsByPage: {
|
|
17
|
+
[page: number]: number[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** internal */
|
|
21
|
+
export declare const state: AnnotationsState;
|
|
22
|
+
/** internal */
|
|
23
|
+
export interface AnnotationsActions {
|
|
24
|
+
setPageAnnotations(annotationsOnPage: PdfItemsOnPage): AnnotationsState;
|
|
25
|
+
addAnnotation(annotation: Annotation): AnnotationsState;
|
|
26
|
+
updateAnnotation(annotation: Annotation): AnnotationsState;
|
|
27
|
+
deleteAnnotation(id: number): AnnotationsState;
|
|
28
|
+
}
|
|
29
|
+
/** internal */
|
|
30
|
+
export declare const annotationHasPopup: (annotation: Annotation) => boolean;
|
|
31
|
+
/** internal */
|
|
32
|
+
export declare const actions: ActionsType<AnnotationsState, AnnotationsActions>;
|
|
33
|
+
/** internal */
|
|
34
|
+
export declare const getPopups: ($state: AnnotationsState, startPage: number, endPage: number) => Annotation[];
|
|
35
|
+
/** internal */
|
|
36
|
+
export declare const getOpenPopups: ($state: AnnotationsState, startPage: number, endPage: number) => Annotation[];
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { PdfItemType, } from '../../pdf-viewer-api';
|
|
2
|
+
/** internal */
|
|
3
|
+
export const state = {
|
|
4
|
+
annotationsChanged: false,
|
|
5
|
+
openPopupChanged: false,
|
|
6
|
+
all: [],
|
|
7
|
+
byPage: [],
|
|
8
|
+
popupsByPage: [],
|
|
9
|
+
openPopupsByPage: [],
|
|
10
|
+
};
|
|
11
|
+
/** internal */
|
|
12
|
+
export const annotationHasPopup = (annotation) => {
|
|
13
|
+
if (annotation.itemType === PdfItemType.TEXT) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
if (annotation.itemType === PdfItemType.FREE_TEXT) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (!annotation.behaviors) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return (annotation.behaviors.canHavePopup &&
|
|
23
|
+
(annotation.popup.isOpen === true ||
|
|
24
|
+
(typeof annotation.content === 'string' && annotation.content !== '') ||
|
|
25
|
+
(typeof annotation.subject === 'string' && annotation.subject !== '')));
|
|
26
|
+
};
|
|
27
|
+
/** internal */
|
|
28
|
+
export const actions = {
|
|
29
|
+
setPageAnnotations: (annotationsOnPage) => ($state) => {
|
|
30
|
+
const newState = Object.assign({}, $state);
|
|
31
|
+
const pageNumber = annotationsOnPage.page;
|
|
32
|
+
newState.byPage[pageNumber] = [];
|
|
33
|
+
annotationsOnPage.items.forEach((item) => {
|
|
34
|
+
const annotation = item;
|
|
35
|
+
newState.all[annotation.id] = annotation;
|
|
36
|
+
newState.byPage[pageNumber].push(annotation.id);
|
|
37
|
+
if (annotationHasPopup(annotation)) {
|
|
38
|
+
if (!newState.popupsByPage[pageNumber]) {
|
|
39
|
+
newState.popupsByPage[pageNumber] = [];
|
|
40
|
+
}
|
|
41
|
+
newState.popupsByPage[pageNumber].push(annotation.id);
|
|
42
|
+
if (annotation.popup.isOpen) {
|
|
43
|
+
if (!newState.openPopupsByPage[pageNumber]) {
|
|
44
|
+
newState.openPopupsByPage[pageNumber] = [];
|
|
45
|
+
}
|
|
46
|
+
if (!newState.openPopupsByPage[pageNumber].find((id) => id === annotation.id)) {
|
|
47
|
+
newState.openPopupsByPage[pageNumber].push(annotation.id);
|
|
48
|
+
newState.openPopupChanged = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
newState.annotationsChanged = true;
|
|
54
|
+
return newState;
|
|
55
|
+
},
|
|
56
|
+
deleteAnnotation: (id) => ($state) => {
|
|
57
|
+
const newState = Object.assign({}, $state);
|
|
58
|
+
const annotation = $state.all[id];
|
|
59
|
+
const pageNumber = annotation.pdfRect.page;
|
|
60
|
+
delete newState.all[id];
|
|
61
|
+
newState.byPage[pageNumber] = newState.byPage[pageNumber].filter((i) => i !== id);
|
|
62
|
+
if (newState.popupsByPage[pageNumber]) {
|
|
63
|
+
newState.popupsByPage[pageNumber] = newState.popupsByPage[pageNumber].filter((i) => i !== id);
|
|
64
|
+
}
|
|
65
|
+
if (newState.openPopupsByPage[pageNumber]) {
|
|
66
|
+
newState.openPopupChanged = newState.openPopupsByPage[pageNumber].indexOf(id) > -1;
|
|
67
|
+
newState.openPopupsByPage[pageNumber] = newState.openPopupsByPage[pageNumber].filter((i) => i !== id);
|
|
68
|
+
}
|
|
69
|
+
newState.annotationsChanged = true;
|
|
70
|
+
return newState;
|
|
71
|
+
},
|
|
72
|
+
updateAnnotation: (annotation) => ($state) => {
|
|
73
|
+
const newState = Object.assign({}, $state);
|
|
74
|
+
const { behaviors } = annotation;
|
|
75
|
+
const id = annotation.id;
|
|
76
|
+
const pageNumber = annotation.pdfRect.page;
|
|
77
|
+
if (behaviors.canHavePopup) {
|
|
78
|
+
if (annotationHasPopup(annotation)) {
|
|
79
|
+
if (!newState.popupsByPage[pageNumber]) {
|
|
80
|
+
newState.popupsByPage[pageNumber] = [];
|
|
81
|
+
}
|
|
82
|
+
const popupIndex = newState.popupsByPage[pageNumber].indexOf(id);
|
|
83
|
+
if (popupIndex < 0) {
|
|
84
|
+
newState.popupsByPage[pageNumber].push(annotation.id);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
if (newState.popupsByPage[pageNumber]) {
|
|
89
|
+
newState.popupsByPage[pageNumber] = newState.popupsByPage[pageNumber].filter((i) => i !== id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (annotation.popup.isOpen) {
|
|
93
|
+
if (!newState.openPopupsByPage[pageNumber]) {
|
|
94
|
+
newState.openPopupsByPage[pageNumber] = [];
|
|
95
|
+
}
|
|
96
|
+
if (newState.openPopupsByPage[pageNumber].indexOf(id) < 0) {
|
|
97
|
+
newState.openPopupsByPage[pageNumber].push(id);
|
|
98
|
+
}
|
|
99
|
+
newState.openPopupChanged = true;
|
|
100
|
+
}
|
|
101
|
+
else if (newState.openPopupsByPage[pageNumber]) {
|
|
102
|
+
newState.openPopupsByPage[pageNumber] = newState.openPopupsByPage[pageNumber].filter((i) => i !== id);
|
|
103
|
+
newState.openPopupChanged = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
newState.all[annotation.id] = annotation;
|
|
107
|
+
newState.annotationsChanged = true;
|
|
108
|
+
return newState;
|
|
109
|
+
},
|
|
110
|
+
addAnnotation: (annotation) => ($state) => {
|
|
111
|
+
const newState = Object.assign({}, $state);
|
|
112
|
+
const pageNumber = annotation.pdfRect.page;
|
|
113
|
+
const id = annotation.id;
|
|
114
|
+
newState.all[id] = annotation;
|
|
115
|
+
if (!newState.byPage[pageNumber]) {
|
|
116
|
+
newState.byPage[pageNumber] = [];
|
|
117
|
+
}
|
|
118
|
+
newState.byPage[pageNumber].push(id);
|
|
119
|
+
if (annotationHasPopup(annotation)) {
|
|
120
|
+
if (!newState.popupsByPage[pageNumber]) {
|
|
121
|
+
newState.popupsByPage[pageNumber] = [];
|
|
122
|
+
}
|
|
123
|
+
newState.popupsByPage[pageNumber].push(id);
|
|
124
|
+
if (annotation.popup.isOpen) {
|
|
125
|
+
if (!newState.openPopupsByPage[pageNumber]) {
|
|
126
|
+
newState.openPopupsByPage[pageNumber] = [];
|
|
127
|
+
}
|
|
128
|
+
newState.openPopupsByPage[pageNumber].push(id);
|
|
129
|
+
newState.openPopupChanged = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
newState.annotationsChanged = true;
|
|
133
|
+
return newState;
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
/** internal */
|
|
137
|
+
export const getPopups = ($state, startPage, endPage) => {
|
|
138
|
+
let popups = [];
|
|
139
|
+
for (let page = startPage; page <= endPage; page++) {
|
|
140
|
+
if ($state.popupsByPage[page]) {
|
|
141
|
+
popups = popups
|
|
142
|
+
.concat($state.popupsByPage[page].map((id) => $state.all[id]))
|
|
143
|
+
.filter((annot) => !annot.isHidden());
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return popups;
|
|
147
|
+
};
|
|
148
|
+
/** internal */
|
|
149
|
+
export const getOpenPopups = ($state, startPage, endPage) => {
|
|
150
|
+
let openPopups = [];
|
|
151
|
+
for (let page = startPage; page <= endPage; page++) {
|
|
152
|
+
if ($state.openPopupsByPage[page]) {
|
|
153
|
+
openPopups = openPopups.concat($state.openPopupsByPage[page].map((id) => $state.all[id]));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return openPopups;
|
|
157
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export type ActionResult<State> = Partial<State> | Promise<any> | null | void;
|
|
3
|
+
/** internal */
|
|
4
|
+
export type ActionType<State, Actions> = (data?: any) => ((state: State, actions: Actions) => ActionResult<State>) | ActionResult<State>;
|
|
5
|
+
/** internal */
|
|
6
|
+
export type ActionsType<State, Actions> = {
|
|
7
|
+
[P in keyof Actions]: ActionType<State, Actions> | ActionsType<any, Actions[P]>;
|
|
8
|
+
};
|
|
9
|
+
/** internal */
|
|
10
|
+
export declare const appState: <S, A>(state: S, actions: ActionsType<S, A>) => A;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const appState = (state, actions) => {
|
|
3
|
+
const clone = (target, source) => {
|
|
4
|
+
const out = {};
|
|
5
|
+
for (const field of Object.keys(target)) {
|
|
6
|
+
out[field] = target[field];
|
|
7
|
+
}
|
|
8
|
+
if (source) {
|
|
9
|
+
for (const field of Object.keys(source)) {
|
|
10
|
+
out[field] = source[field];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return out;
|
|
14
|
+
};
|
|
15
|
+
const getPartialState = (path, source) => {
|
|
16
|
+
let i = 0;
|
|
17
|
+
while (i < path.length) {
|
|
18
|
+
source = source[path[i++]];
|
|
19
|
+
}
|
|
20
|
+
return source;
|
|
21
|
+
};
|
|
22
|
+
function setPartialState(path, value, source) {
|
|
23
|
+
const target = {};
|
|
24
|
+
if (path.length) {
|
|
25
|
+
target[path[0]] =
|
|
26
|
+
path.length > 1 ? setPartialState(path.slice(1), value, source[path[0]]) : value;
|
|
27
|
+
return clone(source, target);
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
const wireStateToActions = (path, wState, wActions) => {
|
|
32
|
+
for (const field of Object.keys(wActions)) {
|
|
33
|
+
if (typeof wActions[field] === 'function') {
|
|
34
|
+
;
|
|
35
|
+
((key, action) => {
|
|
36
|
+
wActions[key] = (data) => {
|
|
37
|
+
let result = action(data);
|
|
38
|
+
if (typeof result === 'function') {
|
|
39
|
+
result = result(getPartialState(path, globalState), wActions);
|
|
40
|
+
}
|
|
41
|
+
/* tslint:disable-next-line */
|
|
42
|
+
if (result &&
|
|
43
|
+
result !== (wState = getPartialState(path, globalState)) &&
|
|
44
|
+
!result.then) {
|
|
45
|
+
globalState = setPartialState(path, clone(wState, result), globalState);
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
})(field, wActions[field]);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
wireStateToActions(path.concat(field), (wState[field] = clone(wState[field])), (wActions[field] = clone(wActions[field])));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return wActions;
|
|
56
|
+
};
|
|
57
|
+
let globalState = clone(state);
|
|
58
|
+
const wiredActions = wireStateToActions([], globalState, clone(actions));
|
|
59
|
+
return wiredActions;
|
|
60
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
/** internal */
|
|
3
|
+
export interface CanvasPixels {
|
|
4
|
+
devicePixels: number;
|
|
5
|
+
cssPixels: number;
|
|
6
|
+
}
|
|
7
|
+
/** internal */
|
|
8
|
+
export interface CanvasState {
|
|
9
|
+
widthChanged: boolean;
|
|
10
|
+
heightChanged: boolean;
|
|
11
|
+
pixelRatioChanged: boolean;
|
|
12
|
+
canvasInvalidated: boolean;
|
|
13
|
+
width: CanvasPixels;
|
|
14
|
+
height: CanvasPixels;
|
|
15
|
+
pixelRatio: number;
|
|
16
|
+
}
|
|
17
|
+
/** internal */
|
|
18
|
+
export declare const state: CanvasState;
|
|
19
|
+
/** internal */
|
|
20
|
+
export interface CanvasResizePayload {
|
|
21
|
+
cssWidth: number;
|
|
22
|
+
cssHeight: number;
|
|
23
|
+
}
|
|
24
|
+
/** internal */
|
|
25
|
+
export interface CanvasActions {
|
|
26
|
+
resize(payload: CanvasResizePayload): CanvasState;
|
|
27
|
+
setPixelRatio(pixelRatio: number): CanvasState;
|
|
28
|
+
setCanvasInvalidated(canvasInvalidated: boolean): CanvasState;
|
|
29
|
+
}
|
|
30
|
+
/** internal */
|
|
31
|
+
export declare const actions: ActionsType<CanvasState, CanvasActions>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
widthChanged: true,
|
|
4
|
+
heightChanged: true,
|
|
5
|
+
pixelRatioChanged: true,
|
|
6
|
+
canvasInvalidated: true,
|
|
7
|
+
width: { devicePixels: 0, cssPixels: 0 },
|
|
8
|
+
height: { devicePixels: 0, cssPixels: 0 },
|
|
9
|
+
pixelRatio: 1,
|
|
10
|
+
};
|
|
11
|
+
/** internal */
|
|
12
|
+
export const actions = {
|
|
13
|
+
resize: (payload) => ($state) => {
|
|
14
|
+
const pixelRatio = window.devicePixelRatio;
|
|
15
|
+
const newState = Object.assign({}, $state);
|
|
16
|
+
if ($state.pixelRatio !== pixelRatio) {
|
|
17
|
+
newState.pixelRatio = pixelRatio;
|
|
18
|
+
newState.pixelRatioChanged = true;
|
|
19
|
+
}
|
|
20
|
+
if ($state.width.cssPixels !== payload.cssWidth) {
|
|
21
|
+
newState.width.cssPixels = payload.cssWidth;
|
|
22
|
+
newState.width.devicePixels = payload.cssWidth * pixelRatio;
|
|
23
|
+
newState.widthChanged = true;
|
|
24
|
+
}
|
|
25
|
+
if ($state.height.cssPixels !== payload.cssHeight) {
|
|
26
|
+
newState.height.cssPixels = payload.cssHeight;
|
|
27
|
+
newState.height.devicePixels = payload.cssHeight * pixelRatio;
|
|
28
|
+
newState.heightChanged = true;
|
|
29
|
+
}
|
|
30
|
+
return newState;
|
|
31
|
+
},
|
|
32
|
+
setPixelRatio: (pixelRatio) => ($state) => {
|
|
33
|
+
const newState = Object.assign({}, $state);
|
|
34
|
+
if ($state.pixelRatio !== pixelRatio) {
|
|
35
|
+
newState.pixelRatio = pixelRatio;
|
|
36
|
+
newState.pixelRatioChanged = true;
|
|
37
|
+
}
|
|
38
|
+
return newState;
|
|
39
|
+
},
|
|
40
|
+
setCanvasInvalidated: (canvasInvalidated) => ($state) => (Object.assign(Object.assign({}, $state), { canvasInvalidated })),
|
|
41
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import { CanvasPixels } from './canvas';
|
|
3
|
+
import { Rect, Point, PdfFitMode, PdfPageLayoutMode } from '../../pdf-viewer-api';
|
|
4
|
+
/** internal */
|
|
5
|
+
export interface DocumentState {
|
|
6
|
+
busyStateChanged: boolean;
|
|
7
|
+
heightChanged: boolean;
|
|
8
|
+
widthChanged: boolean;
|
|
9
|
+
zoomChanged: boolean;
|
|
10
|
+
rotationChanged: boolean;
|
|
11
|
+
busyState: boolean;
|
|
12
|
+
firstVisiblePageChanged: boolean;
|
|
13
|
+
lastVisiblePageChanged: boolean;
|
|
14
|
+
firstVisiblePage: number;
|
|
15
|
+
lastVisiblePage: number;
|
|
16
|
+
pageRects: {
|
|
17
|
+
[key: number]: Rect;
|
|
18
|
+
};
|
|
19
|
+
zoom: number;
|
|
20
|
+
fitMode: PdfFitMode;
|
|
21
|
+
pageLayoutMode: PdfPageLayoutMode;
|
|
22
|
+
rotation: number;
|
|
23
|
+
width: CanvasPixels;
|
|
24
|
+
height: CanvasPixels;
|
|
25
|
+
}
|
|
26
|
+
/** internal */
|
|
27
|
+
export declare const state: DocumentState;
|
|
28
|
+
/** internal */
|
|
29
|
+
export interface DocumentResizedPayload {
|
|
30
|
+
zoom: number;
|
|
31
|
+
devicePixelsWidth: number;
|
|
32
|
+
devicePixelsHeight: number;
|
|
33
|
+
}
|
|
34
|
+
/** internal */
|
|
35
|
+
export interface DocumentActions {
|
|
36
|
+
fistVisiblePageChanged(pageNumber: number): DocumentState;
|
|
37
|
+
lastVisiblePageChanged(pageNumber: number): DocumentState;
|
|
38
|
+
busyStateChanged(busyState: boolean): DocumentState;
|
|
39
|
+
resize(payload: DocumentResizedPayload): DocumentState;
|
|
40
|
+
rotationChanged(rotation: number): DocumentState;
|
|
41
|
+
updatePageRects(pageRects: {
|
|
42
|
+
[key: number]: Rect;
|
|
43
|
+
}): DocumentState;
|
|
44
|
+
fitModeChanged(fitMode: PdfFitMode): DocumentState;
|
|
45
|
+
pageLayoutModeChanged(pageLayoutMode: PdfPageLayoutMode): DocumentState;
|
|
46
|
+
}
|
|
47
|
+
/** internal */
|
|
48
|
+
export declare const actions: ActionsType<DocumentState, DocumentActions>;
|
|
49
|
+
/** internal */
|
|
50
|
+
export declare const getRectFromSelection: ($state: DocumentState, startPoint: Point, endPoint: Point, page?: number, padding?: number) => Rect | null;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { PdfFitMode, PdfPageLayoutMode } from '../../pdf-viewer-api';
|
|
2
|
+
/** internal */
|
|
3
|
+
export const state = {
|
|
4
|
+
busyStateChanged: true,
|
|
5
|
+
heightChanged: true,
|
|
6
|
+
widthChanged: true,
|
|
7
|
+
zoomChanged: true,
|
|
8
|
+
rotationChanged: true,
|
|
9
|
+
firstVisiblePageChanged: true,
|
|
10
|
+
lastVisiblePageChanged: true,
|
|
11
|
+
busyState: false,
|
|
12
|
+
firstVisiblePage: 0,
|
|
13
|
+
lastVisiblePage: 0,
|
|
14
|
+
pageRects: [],
|
|
15
|
+
zoom: 1,
|
|
16
|
+
fitMode: PdfFitMode.NONE,
|
|
17
|
+
pageLayoutMode: PdfPageLayoutMode.SINGLE_PAGE,
|
|
18
|
+
rotation: 0,
|
|
19
|
+
width: { devicePixels: 0, cssPixels: 0 },
|
|
20
|
+
height: { devicePixels: 0, cssPixels: 0 },
|
|
21
|
+
};
|
|
22
|
+
/** internal */
|
|
23
|
+
export const actions = {
|
|
24
|
+
fistVisiblePageChanged: (pageNumber) => ($state) => (Object.assign(Object.assign({}, $state), { firstVisiblePage: pageNumber, firstVisiblePageChanged: true })),
|
|
25
|
+
lastVisiblePageChanged: (pageNumber) => ($state) => (Object.assign(Object.assign({}, $state), { lastVisiblePage: pageNumber, lastVisiblePageChanged: true })),
|
|
26
|
+
resize: (payload) => ($state) => {
|
|
27
|
+
const newState = Object.assign({}, $state);
|
|
28
|
+
const pixelRatio = window.devicePixelRatio;
|
|
29
|
+
if (newState.width.devicePixels !== payload.devicePixelsWidth) {
|
|
30
|
+
newState.width.cssPixels = payload.devicePixelsWidth / pixelRatio;
|
|
31
|
+
newState.width.devicePixels = payload.devicePixelsWidth;
|
|
32
|
+
newState.widthChanged = true;
|
|
33
|
+
}
|
|
34
|
+
if (newState.height.devicePixels !== payload.devicePixelsHeight) {
|
|
35
|
+
newState.height.cssPixels = payload.devicePixelsHeight / pixelRatio;
|
|
36
|
+
newState.height.devicePixels = payload.devicePixelsHeight;
|
|
37
|
+
newState.heightChanged = true;
|
|
38
|
+
}
|
|
39
|
+
if (newState.zoom !== payload.zoom) {
|
|
40
|
+
newState.zoom = payload.zoom;
|
|
41
|
+
newState.zoomChanged = true;
|
|
42
|
+
}
|
|
43
|
+
return newState;
|
|
44
|
+
},
|
|
45
|
+
rotationChanged: (rotation) => ($state) => (Object.assign(Object.assign({}, $state), { rotation, rotationChanged: true })),
|
|
46
|
+
updatePageRects: (pageRects) => ($state) => (Object.assign(Object.assign({}, $state), { pageRects })),
|
|
47
|
+
busyStateChanged: (busyState) => ($state) => (Object.assign(Object.assign({}, $state), { busyState, busyStateChanged: true })),
|
|
48
|
+
fitModeChanged: (fitMode) => ($state) => (Object.assign(Object.assign({}, $state), { fitMode })),
|
|
49
|
+
pageLayoutModeChanged: (pageLayoutMode) => ($state) => (Object.assign(Object.assign({}, $state), { pageLayoutMode })),
|
|
50
|
+
};
|
|
51
|
+
/** internal */
|
|
52
|
+
const getSelectionRectFromPage = ($state, startPoint, endPoint, page, padding = 1) => {
|
|
53
|
+
let rect = null;
|
|
54
|
+
const pageRect = $state.pageRects[page];
|
|
55
|
+
const pX1 = pageRect.x + padding;
|
|
56
|
+
const pX2 = pageRect.x + (pageRect.w - 2 * padding);
|
|
57
|
+
const pY1 = pageRect.y + padding;
|
|
58
|
+
const pY2 = pageRect.y + (pageRect.h - 2 * padding);
|
|
59
|
+
if (startPoint.x >= pX1 && startPoint.x <= pX2 && startPoint.y >= pY1 && startPoint.y <= pY2) {
|
|
60
|
+
endPoint.x = endPoint.x < pX1 ? pX1 : endPoint.x > pX2 ? pX2 : endPoint.x;
|
|
61
|
+
endPoint.y = endPoint.y < pY1 ? pY1 : endPoint.y > pY2 ? pY2 : endPoint.y;
|
|
62
|
+
rect = { x: 0, y: 0, w: 0, h: 0 };
|
|
63
|
+
if (startPoint.x < endPoint.x) {
|
|
64
|
+
rect.x = startPoint.x;
|
|
65
|
+
rect.w = endPoint.x - startPoint.x;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
rect.x = endPoint.x;
|
|
69
|
+
rect.w = startPoint.x - endPoint.x;
|
|
70
|
+
}
|
|
71
|
+
if (startPoint.y < endPoint.y) {
|
|
72
|
+
rect.y = startPoint.y;
|
|
73
|
+
rect.h = endPoint.y - startPoint.y;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
rect.y = endPoint.y;
|
|
77
|
+
rect.h = startPoint.y - endPoint.y;
|
|
78
|
+
}
|
|
79
|
+
return rect;
|
|
80
|
+
}
|
|
81
|
+
return rect;
|
|
82
|
+
};
|
|
83
|
+
/** internal */
|
|
84
|
+
export const getRectFromSelection = ($state, startPoint, endPoint, page, padding = 1) => {
|
|
85
|
+
if (page) {
|
|
86
|
+
return getSelectionRectFromPage($state, startPoint, endPoint, page);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
for (const pNr in $state.pageRects) {
|
|
90
|
+
if ($state.pageRects) {
|
|
91
|
+
const rect = getSelectionRectFromPage($state, startPoint, endPoint, parseInt(pNr, 10), padding);
|
|
92
|
+
if (rect) {
|
|
93
|
+
return rect;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import { CanvasPixels } from './canvas';
|
|
3
|
+
/** internal */
|
|
4
|
+
export type PointerAction = 'click' | 'dblclick' | 'longpress' | 'startdrag' | 'enddrag' | null;
|
|
5
|
+
export type PointerType = 'mouse' | 'touch';
|
|
6
|
+
/** internal */
|
|
7
|
+
export interface PointerState {
|
|
8
|
+
positionChanged: boolean;
|
|
9
|
+
stateChanged: boolean;
|
|
10
|
+
isDown: boolean;
|
|
11
|
+
type: PointerType;
|
|
12
|
+
action: PointerAction;
|
|
13
|
+
x: CanvasPixels;
|
|
14
|
+
y: CanvasPixels;
|
|
15
|
+
}
|
|
16
|
+
/** internal */
|
|
17
|
+
export declare const state: PointerState;
|
|
18
|
+
/** internal */
|
|
19
|
+
export interface UpdatePointerPayload {
|
|
20
|
+
cssX: number;
|
|
21
|
+
cssY: number;
|
|
22
|
+
isDown: boolean;
|
|
23
|
+
type: PointerType;
|
|
24
|
+
}
|
|
25
|
+
/** internal */
|
|
26
|
+
export interface PointerActions {
|
|
27
|
+
update(payload: UpdatePointerPayload): PointerState;
|
|
28
|
+
setAction(action: PointerAction): PointerState;
|
|
29
|
+
}
|
|
30
|
+
/** internal */
|
|
31
|
+
export declare const actions: ActionsType<PointerState, PointerActions>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
positionChanged: true,
|
|
4
|
+
stateChanged: true,
|
|
5
|
+
isDown: false,
|
|
6
|
+
type: 'ontouchstart' in window ? 'touch' : 'mouse',
|
|
7
|
+
action: null,
|
|
8
|
+
x: { devicePixels: 0, cssPixels: 0 },
|
|
9
|
+
y: { devicePixels: 0, cssPixels: 0 },
|
|
10
|
+
};
|
|
11
|
+
/** internal */
|
|
12
|
+
export const actions = {
|
|
13
|
+
setAction: (action) => ($state) => (Object.assign(Object.assign({}, $state), { action })),
|
|
14
|
+
update: (payload) => ($state) => {
|
|
15
|
+
const pixelRatio = window.devicePixelRatio;
|
|
16
|
+
const newState = Object.assign({}, $state);
|
|
17
|
+
newState.type = payload.type;
|
|
18
|
+
if ($state.x.cssPixels !== payload.cssY || $state.x.cssPixels !== payload.cssX) {
|
|
19
|
+
newState.x.cssPixels = payload.cssX;
|
|
20
|
+
newState.x.devicePixels = payload.cssX * pixelRatio;
|
|
21
|
+
newState.y.cssPixels = payload.cssY;
|
|
22
|
+
newState.y.devicePixels = payload.cssY * pixelRatio;
|
|
23
|
+
newState.positionChanged = true;
|
|
24
|
+
}
|
|
25
|
+
if ($state.isDown !== payload.isDown) {
|
|
26
|
+
newState.isDown = payload.isDown;
|
|
27
|
+
newState.stateChanged = true;
|
|
28
|
+
}
|
|
29
|
+
return newState;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import { CanvasPixels } from './canvas';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface ScrollState {
|
|
5
|
+
topPositionChanged: boolean;
|
|
6
|
+
leftPositionChanged: boolean;
|
|
7
|
+
top: CanvasPixels;
|
|
8
|
+
left: CanvasPixels;
|
|
9
|
+
}
|
|
10
|
+
/** internal */
|
|
11
|
+
export declare const state: ScrollState;
|
|
12
|
+
/** internal */
|
|
13
|
+
export interface ScrollChangedPayload {
|
|
14
|
+
cssTop: number;
|
|
15
|
+
cssLeft: number;
|
|
16
|
+
}
|
|
17
|
+
/** internal */
|
|
18
|
+
export interface ScrollActions {
|
|
19
|
+
scrollChanged(payload: ScrollChangedPayload): ScrollState;
|
|
20
|
+
}
|
|
21
|
+
/** internal */
|
|
22
|
+
export declare const actions: ActionsType<ScrollState, ScrollActions>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
topPositionChanged: false,
|
|
4
|
+
leftPositionChanged: false,
|
|
5
|
+
top: { devicePixels: 0, cssPixels: 0 },
|
|
6
|
+
left: { devicePixels: 0, cssPixels: 0 },
|
|
7
|
+
};
|
|
8
|
+
/** internal */
|
|
9
|
+
export const actions = {
|
|
10
|
+
scrollChanged: (payload) => ($state) => {
|
|
11
|
+
const newState = Object.assign({}, $state);
|
|
12
|
+
const pixelRatio = window.devicePixelRatio;
|
|
13
|
+
if ($state.top.devicePixels !== payload.cssTop) {
|
|
14
|
+
newState.top.cssPixels = payload.cssTop / pixelRatio;
|
|
15
|
+
newState.top.devicePixels = payload.cssTop;
|
|
16
|
+
newState.topPositionChanged = true;
|
|
17
|
+
}
|
|
18
|
+
if ($state.left.devicePixels !== payload.cssLeft) {
|
|
19
|
+
newState.left.cssPixels = payload.cssLeft / pixelRatio;
|
|
20
|
+
newState.left.devicePixels = payload.cssLeft;
|
|
21
|
+
newState.leftPositionChanged = true;
|
|
22
|
+
}
|
|
23
|
+
return newState;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ActionsType } from './appState';
|
|
2
|
+
import { QuadrilateralOnPage } from '../../pdf-viewer-api';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface SearchState {
|
|
5
|
+
searchString: string;
|
|
6
|
+
caseSensitive: boolean;
|
|
7
|
+
wrapSearch: boolean;
|
|
8
|
+
useRegex: boolean;
|
|
9
|
+
page: number;
|
|
10
|
+
match: QuadrilateralOnPage[] | null;
|
|
11
|
+
painted: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** internal */
|
|
14
|
+
export declare const state: SearchState;
|
|
15
|
+
/** internal */
|
|
16
|
+
export interface StartSearchPayload {
|
|
17
|
+
searchString: string;
|
|
18
|
+
reverse: boolean;
|
|
19
|
+
caseSensitive: boolean;
|
|
20
|
+
wrapSearch: boolean;
|
|
21
|
+
useRegex: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** internal */
|
|
24
|
+
export interface UpdateSearchMatchPayload {
|
|
25
|
+
page: number;
|
|
26
|
+
match: QuadrilateralOnPage[];
|
|
27
|
+
}
|
|
28
|
+
/** internal */
|
|
29
|
+
export interface SearchActions {
|
|
30
|
+
start(payload: StartSearchPayload): SearchState;
|
|
31
|
+
updateMatch(payload: UpdateSearchMatchPayload): SearchState;
|
|
32
|
+
matchPainted(): SearchState;
|
|
33
|
+
clear(): SearchState;
|
|
34
|
+
}
|
|
35
|
+
/** internal */
|
|
36
|
+
export declare const actions: ActionsType<SearchState, SearchActions>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const state = {
|
|
3
|
+
searchString: '',
|
|
4
|
+
caseSensitive: false,
|
|
5
|
+
wrapSearch: false,
|
|
6
|
+
useRegex: false,
|
|
7
|
+
page: 1,
|
|
8
|
+
match: null,
|
|
9
|
+
painted: false,
|
|
10
|
+
};
|
|
11
|
+
/** internal */
|
|
12
|
+
export const actions = {
|
|
13
|
+
start: (payload) => ($state) => (Object.assign(Object.assign(Object.assign({}, $state), payload), { match: null, page: 1 })),
|
|
14
|
+
updateMatch: (payload) => ($state) => (Object.assign(Object.assign(Object.assign({}, $state), payload), { painted: false })),
|
|
15
|
+
matchPainted: () => ($state) => {
|
|
16
|
+
return Object.assign(Object.assign({}, $state), { painted: true });
|
|
17
|
+
},
|
|
18
|
+
clear: () => ($state) => ({
|
|
19
|
+
searchString: '',
|
|
20
|
+
caseSensitive: false,
|
|
21
|
+
wrapSearch: false,
|
|
22
|
+
useRegex: false,
|
|
23
|
+
page: 1,
|
|
24
|
+
match: null,
|
|
25
|
+
painted: false,
|
|
26
|
+
}),
|
|
27
|
+
};
|