@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,17 @@
|
|
|
1
|
+
import { Component } from '../lib/hyperapp';
|
|
2
|
+
import { IconDefinition } from './Icon';
|
|
3
|
+
export interface RangeSliderProps {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step: number;
|
|
7
|
+
value: number;
|
|
8
|
+
text?: string;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
icon?: IconDefinition;
|
|
11
|
+
label?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
onChange(value: number): void;
|
|
15
|
+
}
|
|
16
|
+
/** internal */
|
|
17
|
+
export declare const RangeSlider: Component<RangeSliderProps>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { DropdownComponent } from './Dropdown';
|
|
3
|
+
import { Icon, icons } from './Icon';
|
|
4
|
+
import { classNames } from './classNames';
|
|
5
|
+
import { tooltipManager } from './TooltipManager';
|
|
6
|
+
/** internal */
|
|
7
|
+
export const RangeSlider = ({ min, max, value, icon, className, text, tooltip, label, disabled, onChange, }) => {
|
|
8
|
+
const elmProps = {
|
|
9
|
+
title: tooltip,
|
|
10
|
+
};
|
|
11
|
+
if (disabled) {
|
|
12
|
+
return (h("div", Object.assign({}, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-RangeSlider', 'pwv-ToolbarItem', 'pwv-Dropdown', 'pwv-disabled', className) }),
|
|
13
|
+
label ||
|
|
14
|
+
(icon && (h("span", { class: "pwv-Dropdown-label" },
|
|
15
|
+
label,
|
|
16
|
+
icon && h(Icon, { icon: icon })))),
|
|
17
|
+
h("span", { class: "pwv-Dropdown-text" }, text),
|
|
18
|
+
h("span", { class: "pwv-Dropdown-caret" },
|
|
19
|
+
h(Icon, { icon: icons.dropdownCaret }))));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return (h("div", { class: classNames('pwv-RangeSlider', 'pwv-commandbar-item', 'pwv-Dropdown', className) },
|
|
23
|
+
h("button", Object.assign({}, tooltipManager.createTooltip(tooltip), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove }),
|
|
24
|
+
label ||
|
|
25
|
+
(icon && (h("span", { class: "pwv-Dropdown-label" },
|
|
26
|
+
label,
|
|
27
|
+
icon && h(Icon, { icon: icon })))),
|
|
28
|
+
h("span", { class: "pwv-Dropdown-text" }, text),
|
|
29
|
+
h("span", { class: "pwv-Dropdown-caret" },
|
|
30
|
+
h(Icon, { icon: icons.dropdownCaret }))),
|
|
31
|
+
h("div", { class: "pwv-DropdownPanel" },
|
|
32
|
+
h("input", { type: "range", min: min, max: max, value: value, oninput: (e) => {
|
|
33
|
+
const input = e.currentTarget;
|
|
34
|
+
const intVal = parseInt(input.value, undefined);
|
|
35
|
+
onChange(intVal);
|
|
36
|
+
}, onchange: (e) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
const input = e.currentTarget;
|
|
39
|
+
window.dispatchEvent(new Event('click'));
|
|
40
|
+
} }))));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '../lib/hyperapp';
|
|
2
|
+
import { AnnotationBorderStyle } from '../pdf-viewer-api';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface StrokeStylePickerProps {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
value: AnnotationBorderStyle;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
shapeType: 'line' | 'rectangle' | 'circle';
|
|
9
|
+
onChange?(strokeWidth: number): void;
|
|
10
|
+
}
|
|
11
|
+
export declare const StrokeStylePicker: Component<StrokeStylePickerProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { AnnotationBorderStyle } from '../pdf-viewer-api';
|
|
3
|
+
import { Dropdown } from './Dropdown';
|
|
4
|
+
const StrokeItem = ({ value }) => {
|
|
5
|
+
const strokeStyle = value === AnnotationBorderStyle.DASHED ? 'dashed' : 'solid';
|
|
6
|
+
return (h("div", { class: `pwv-stroke-style-picker-item pwv-stroke-style-${strokeStyle}` },
|
|
7
|
+
h("span", null)));
|
|
8
|
+
};
|
|
9
|
+
const StrokeButton = ({ value }) => {
|
|
10
|
+
const strokeStyle = value === AnnotationBorderStyle.DASHED ? 'dashed' : 'solid';
|
|
11
|
+
return (h("div", { class: `pwv-stroke-style-picker-button pwv-stroke-style-${strokeStyle}` },
|
|
12
|
+
h("span", null)));
|
|
13
|
+
};
|
|
14
|
+
export const StrokeStylePicker = ({ disabled, value, tooltip, shapeType, onChange, }) => {
|
|
15
|
+
const items = [AnnotationBorderStyle.SOLID, AnnotationBorderStyle.DASHED].map((item) => ({
|
|
16
|
+
value: item,
|
|
17
|
+
renderItem: (i) => h(StrokeItem, { value: item }),
|
|
18
|
+
}));
|
|
19
|
+
return (h(Dropdown, { className: `pwv-stroke-style-picker pwv-stroke-style-picker-${shapeType}`, align: "right", disabled: disabled, tooltip: tooltip, items: items, value: value, renderButton: (value) => h(StrokeButton, { value: value }), onChange: onChange }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '../lib/hyperapp';
|
|
2
|
+
/** internal */
|
|
3
|
+
export interface StrokeWidthPickerProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
strokeWidths: number[];
|
|
6
|
+
value: number;
|
|
7
|
+
noneStrokeText: string;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
onChange?(strokeWidth: number): void;
|
|
10
|
+
}
|
|
11
|
+
export declare const StrokeWidthPicker: Component<StrokeWidthPickerProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { Dropdown } from './Dropdown';
|
|
3
|
+
const StrokeItem = ({ value, noneStrokeText }) => {
|
|
4
|
+
if (value === 0) {
|
|
5
|
+
return (h("div", { class: "pwv-stroke-width-picker-item" },
|
|
6
|
+
h("span", null, noneStrokeText)));
|
|
7
|
+
}
|
|
8
|
+
return (h("div", { class: "pwv-stroke-width-picker-item" },
|
|
9
|
+
h("span", null,
|
|
10
|
+
value,
|
|
11
|
+
"pt"),
|
|
12
|
+
h("span", { class: "pwv-stroke-width", style: { height: `${value}px` } })));
|
|
13
|
+
};
|
|
14
|
+
export const StrokeWidthPicker = ({ disabled, noneStrokeText, strokeWidths, value, tooltip, onChange, }) => {
|
|
15
|
+
const items = strokeWidths.map((item) => ({
|
|
16
|
+
value: item,
|
|
17
|
+
renderItem: (i) => h(StrokeItem, { value: i.value, noneStrokeText: noneStrokeText }),
|
|
18
|
+
}));
|
|
19
|
+
return (h(Dropdown, { className: "pwv-stroke-width-picker", align: "right", tooltip: tooltip, disabled: disabled, items: items, value: value, renderButton: (value) => h(StrokeItem, { value: value, noneStrokeText: noneStrokeText }), onChange: onChange }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component } from '../lib/hyperapp';
|
|
2
|
+
/** internal */
|
|
3
|
+
export interface ToolbarProps {
|
|
4
|
+
alignCenter?: boolean;
|
|
5
|
+
allowWrap?: boolean;
|
|
6
|
+
dense?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/** internal */
|
|
10
|
+
export declare const Toolbar: Component<ToolbarProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { classNames } from './classNames';
|
|
3
|
+
/** internal */
|
|
4
|
+
export const Toolbar = ({ className, dense, allowWrap, alignCenter }, children) => {
|
|
5
|
+
return (h("div", { class: classNames('pwv-Toolbar', { 'pwv-Toolbar--center': alignCenter }, { 'pwv-Toolbar--dense': dense }, { 'pwv-Toolbar--wrap': allowWrap }, className) }, children));
|
|
6
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from '../lib/hyperapp';
|
|
2
|
+
import { IconDefinition } from './Icon';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface ToolbarButtonProps {
|
|
5
|
+
icon?: IconDefinition;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
onClick?(e: MouseEvent): void;
|
|
12
|
+
}
|
|
13
|
+
/** internal */
|
|
14
|
+
export declare const ToolbarButton: Component<ToolbarButtonProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { Icon } from './Icon';
|
|
3
|
+
import { classNames } from './classNames';
|
|
4
|
+
import { tooltipManager } from './TooltipManager';
|
|
5
|
+
/** internal */
|
|
6
|
+
export const ToolbarButton = ({ icon, disabled, active, name, onClick, tooltip, className }, children) => {
|
|
7
|
+
if (disabled) {
|
|
8
|
+
return (h("button", Object.assign({ name: name, disabled: disabled, oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', 'pwv-ToolbarButton--disabled', className) }),
|
|
9
|
+
icon && h(Icon, { icon: icon }),
|
|
10
|
+
children.length > 0 && h("span", { class: "pwv-ToolbarButton__Text" }, children)));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return (h("button", Object.assign({ name: name, oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', className, {
|
|
14
|
+
'pwv-ToolbarButton--selected': active,
|
|
15
|
+
}), onclick: (e) => {
|
|
16
|
+
onClick && onClick(e);
|
|
17
|
+
} }),
|
|
18
|
+
icon && h(Icon, { icon: icon }),
|
|
19
|
+
children.length > 0 && h("span", { class: "pwv-ToolbarButton__Text" }, children)));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component } from '../lib/hyperapp';
|
|
2
|
+
import { IconDefinition } from './Icon';
|
|
3
|
+
/** internal */
|
|
4
|
+
export interface ToolbarFileButtonProps {
|
|
5
|
+
icon: IconDefinition;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
accept?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
onFileSelected?(file: File): void;
|
|
13
|
+
}
|
|
14
|
+
/** internal */
|
|
15
|
+
export declare const ToolbarFileButton: Component<ToolbarFileButtonProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { Icon } from './Icon';
|
|
3
|
+
import { classNames } from './classNames';
|
|
4
|
+
import { tooltipManager } from './TooltipManager';
|
|
5
|
+
/** internal */
|
|
6
|
+
export const ToolbarFileButton = ({ icon, accept, className, tooltip, disabled, name, onFileSelected, }) => {
|
|
7
|
+
if (disabled) {
|
|
8
|
+
return (h("div", Object.assign({ oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', 'pwv-ToolbarButton--disabled', className) }),
|
|
9
|
+
h(Icon, { icon: icon })));
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return (h("label", Object.assign({ name: name, tabindex: "auto", oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', className) }),
|
|
13
|
+
h(Icon, { icon: icon }),
|
|
14
|
+
h("input", { style: { display: 'none' }, type: "file", accept: accept, onchange: (e) => {
|
|
15
|
+
if (onFileSelected && e.currentTarget.files && e.currentTarget.files.length) {
|
|
16
|
+
const file = e.currentTarget.files[0];
|
|
17
|
+
onFileSelected(file);
|
|
18
|
+
e.currentTarget.value = '';
|
|
19
|
+
}
|
|
20
|
+
}, oncreate: (input) => {
|
|
21
|
+
const id = 'fi_' + performance.now();
|
|
22
|
+
input.id = id;
|
|
23
|
+
const label = input.parentElement;
|
|
24
|
+
label.setAttribute('for', id);
|
|
25
|
+
} })));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { h } from '../lib/hyperapp';
|
|
2
|
+
import { classNames } from './classNames';
|
|
3
|
+
/** internal */
|
|
4
|
+
export const ToolbarItemGroup = ({ className, pushRight }, children) => {
|
|
5
|
+
return (h("div", { class: classNames('pwv-ToolbarItemGroup', className, {
|
|
6
|
+
'pwv-ToolbarItemGroup--pushRight': pushRight,
|
|
7
|
+
}), oncreate: (element) => {
|
|
8
|
+
if (pushRight) {
|
|
9
|
+
element.parentNode.classList.add('pwv-Toolbar--paddingRight');
|
|
10
|
+
}
|
|
11
|
+
} }, children));
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WebViewerOptions } from '../pdf-web-viewer/WebViewerOptions';
|
|
2
|
+
import { PdfItemType } from '../pdf-viewer-api/enums';
|
|
3
|
+
export declare function convertPdfToCssPixel(pdfPixel: string): string;
|
|
4
|
+
export declare function convertCssToPdfPixel(cssPixel: string): string;
|
|
5
|
+
export declare function roundToTwo(num: number): number;
|
|
6
|
+
export declare function getColorPalette(type: PdfItemType, options: WebViewerOptions): string[];
|
|
7
|
+
export declare function createPdfTime(): string;
|
|
8
|
+
export declare const formatDate: (dateStr: string) => string;
|
|
9
|
+
export declare function padString(s: string, paddingSize: number, fill: string): string;
|
|
10
|
+
export declare function imageDataUrlToUint8Array(dataUrl: string): Uint8Array;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { PdfItemType } from '../pdf-viewer-api/enums';
|
|
2
|
+
export function convertPdfToCssPixel(pdfPixel) {
|
|
3
|
+
const regex = /(\d*\.?\d+)/.exec(pdfPixel);
|
|
4
|
+
const size = regex && regex.length > 1 ? parseFloat(regex[1]) : 12;
|
|
5
|
+
return roundToTwo((size / 72) * 96) + 'px';
|
|
6
|
+
}
|
|
7
|
+
export function convertCssToPdfPixel(cssPixel) {
|
|
8
|
+
const regex = /(\d*\.?\d+)/.exec(cssPixel);
|
|
9
|
+
const size = regex && regex.length > 1 ? parseFloat(regex[1]) : 12;
|
|
10
|
+
return roundToTwo((size / 96) * 72) + 'pt';
|
|
11
|
+
}
|
|
12
|
+
export function roundToTwo(num) {
|
|
13
|
+
return Math.round(num * 100) / 100;
|
|
14
|
+
}
|
|
15
|
+
export function getColorPalette(type, options) {
|
|
16
|
+
if (type === PdfItemType.INK) {
|
|
17
|
+
return options.annotation.colors.foregroundColors;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return options.annotation.colors.highlightColors;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function createPdfTime() {
|
|
24
|
+
const time = new Date();
|
|
25
|
+
const year = time.getFullYear();
|
|
26
|
+
let month = `${time.getMonth() + 1}`;
|
|
27
|
+
month = padString(month, 2, '0');
|
|
28
|
+
let day = `${time.getDate()}`;
|
|
29
|
+
day = padString(day, 2, '0');
|
|
30
|
+
let hour = `${time.getHours()}`;
|
|
31
|
+
hour = padString(hour, 2, '0');
|
|
32
|
+
let minutes = `${time.getMinutes()}`;
|
|
33
|
+
minutes = padString(minutes, 2, '0');
|
|
34
|
+
let seconds = `${time.getSeconds()}`;
|
|
35
|
+
seconds = padString(seconds, 2, '0');
|
|
36
|
+
let offsetString = time.getTimezoneOffset() < 0 ? '+' : '';
|
|
37
|
+
const hourOffset = -1 * Math.floor(time.getTimezoneOffset() / 60);
|
|
38
|
+
offsetString += padString(hourOffset.toString(), 2, '0') + `'`;
|
|
39
|
+
const minuteOffset = -1 * Math.floor(time.getTimezoneOffset() % 60);
|
|
40
|
+
offsetString += padString(minuteOffset.toString(), 2, '0') + `'`;
|
|
41
|
+
const dateString = `(D:${year}${month}${day}${hour}${minutes}${seconds}${offsetString})`;
|
|
42
|
+
return dateString;
|
|
43
|
+
}
|
|
44
|
+
export const formatDate = (dateStr) => {
|
|
45
|
+
if (dateStr.indexOf('(D:') === 0) {
|
|
46
|
+
// todo: convert to local time
|
|
47
|
+
return `${dateStr.substring(9, 11)}.${dateStr.substring(7, 11)}.${dateStr.substring(3, 7)} ${dateStr.substring(11, 13)}:${dateStr.substring(13, 15)}`;
|
|
48
|
+
}
|
|
49
|
+
return `${dateStr.substring(8, 10)}.${dateStr.substring(6, 8)}.${dateStr.substring(2, 6)} ${dateStr.substring(10, 12)}:${dateStr.substring(12, 14)}`;
|
|
50
|
+
};
|
|
51
|
+
export function padString(s, paddingSize, fill) {
|
|
52
|
+
if (s.length < paddingSize) {
|
|
53
|
+
s = `${fill.repeat(paddingSize - s.length)}${s}`;
|
|
54
|
+
}
|
|
55
|
+
return s;
|
|
56
|
+
}
|
|
57
|
+
export function imageDataUrlToUint8Array(dataUrl) {
|
|
58
|
+
const base64 = dataUrl.replace(/^data:[a-z]+\/[a-z]+;base64,/i, '');
|
|
59
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
60
|
+
const lookup = new Uint8Array(256);
|
|
61
|
+
for (let i = 0; i < chars.length; i++) {
|
|
62
|
+
lookup[chars.charCodeAt(i)] = i;
|
|
63
|
+
}
|
|
64
|
+
let bufferLength = base64.length * 0.75;
|
|
65
|
+
if (base64[base64.length - 1] === '=') {
|
|
66
|
+
bufferLength--;
|
|
67
|
+
if (base64[base64.length - 2] === '=') {
|
|
68
|
+
bufferLength--;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const arraybuffer = new ArrayBuffer(bufferLength);
|
|
72
|
+
const bytes = new Uint8Array(arraybuffer);
|
|
73
|
+
let p = 0;
|
|
74
|
+
let encoded1 = 0;
|
|
75
|
+
let encoded2 = 0;
|
|
76
|
+
let encoded3 = 0;
|
|
77
|
+
let encoded4 = 0;
|
|
78
|
+
for (let i = 0; i < base64.length; i += 4) {
|
|
79
|
+
encoded1 = lookup[base64.charCodeAt(i)];
|
|
80
|
+
encoded2 = lookup[base64.charCodeAt(i + 1)];
|
|
81
|
+
encoded3 = lookup[base64.charCodeAt(i + 2)];
|
|
82
|
+
encoded4 = lookup[base64.charCodeAt(i + 3)];
|
|
83
|
+
// tslint:disable: no-bitwise
|
|
84
|
+
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
|
|
85
|
+
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
|
|
86
|
+
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
|
|
87
|
+
}
|
|
88
|
+
return bytes;
|
|
89
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export declare const tooltipManager: {
|
|
3
|
+
setType: (type: 'none' | 'title' | 'css') => void;
|
|
4
|
+
bindCssTooltip: (element: HTMLElement, text?: string) => void;
|
|
5
|
+
createTooltip: (text?: string) => {
|
|
6
|
+
title: string;
|
|
7
|
+
'data-pwv-tooltip'?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
'data-pwv-tooltip': string;
|
|
10
|
+
title?: undefined;
|
|
11
|
+
} | undefined;
|
|
12
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
let tooltipType;
|
|
2
|
+
/** internal */
|
|
3
|
+
export const tooltipManager = {
|
|
4
|
+
setType: (type) => {
|
|
5
|
+
tooltipType = type;
|
|
6
|
+
},
|
|
7
|
+
bindCssTooltip: (element, text) => {
|
|
8
|
+
if (tooltipType !== 'css') {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
element.onmouseover = (e) => {
|
|
12
|
+
const elm = e.currentTarget;
|
|
13
|
+
let viewerElm = elm.closest('.pwv-ViewerCanvas');
|
|
14
|
+
if (!viewerElm) {
|
|
15
|
+
viewerElm = elm.closest('.pwv-WebViewer');
|
|
16
|
+
}
|
|
17
|
+
if (viewerElm) {
|
|
18
|
+
elm.classList.remove('pwv-tooltip-top', 'pwv-tooltip-left', 'pwv-tooltip-right', 'pwv-tooltip-bottom');
|
|
19
|
+
const elmRect = elm.getBoundingClientRect();
|
|
20
|
+
const viewerRect = viewerElm.getBoundingClientRect();
|
|
21
|
+
const top = elmRect.top - viewerRect.top;
|
|
22
|
+
const left = elmRect.left - viewerRect.left;
|
|
23
|
+
const right = viewerRect.right - elmRect.right;
|
|
24
|
+
const bottom = viewerRect.bottom - elmRect.bottom;
|
|
25
|
+
top < 45
|
|
26
|
+
? element.classList.add('pwv-tooltip-bottom')
|
|
27
|
+
: element.classList.add('pwv-tooltip-top');
|
|
28
|
+
if (left < 45) {
|
|
29
|
+
element.classList.add('pwv-tooltip-right');
|
|
30
|
+
}
|
|
31
|
+
else if (right < 45) {
|
|
32
|
+
element.classList.add('pwv-tooltip-left');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
createTooltip: (text) => {
|
|
38
|
+
if (!text) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
switch (tooltipType) {
|
|
42
|
+
case 'title':
|
|
43
|
+
return {
|
|
44
|
+
title: text,
|
|
45
|
+
};
|
|
46
|
+
case 'css':
|
|
47
|
+
return {
|
|
48
|
+
'data-pwv-tooltip': text,
|
|
49
|
+
};
|
|
50
|
+
default:
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export interface TextResources {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
/** internal */
|
|
6
|
+
export declare const translationManager: {
|
|
7
|
+
language: string;
|
|
8
|
+
addTranslations: (res: TextResources) => void;
|
|
9
|
+
getText: (key: string) => string;
|
|
10
|
+
loadTranslations: (language: string) => Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
let translations = {};
|
|
11
|
+
let translationRequested = false;
|
|
12
|
+
/** internal */
|
|
13
|
+
export const translationManager = {
|
|
14
|
+
language: '',
|
|
15
|
+
addTranslations: (res) => {
|
|
16
|
+
translations = Object.assign(Object.assign({}, translations), res);
|
|
17
|
+
},
|
|
18
|
+
getText: (key) => {
|
|
19
|
+
const res = translations[key];
|
|
20
|
+
if (!res) {
|
|
21
|
+
switch (key) {
|
|
22
|
+
case 'applicationError.title':
|
|
23
|
+
return 'Error';
|
|
24
|
+
case 'applicationError.defaultMessage':
|
|
25
|
+
return 'Configuration Error';
|
|
26
|
+
case 'applicationError.reload':
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
console.warn(`key not found ${key}`);
|
|
30
|
+
return key;
|
|
31
|
+
}
|
|
32
|
+
return res;
|
|
33
|
+
},
|
|
34
|
+
loadTranslations: (language) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
if (language !== translationManager.language ||
|
|
36
|
+
(!translationRequested && Object.keys(translations).length === 0)) {
|
|
37
|
+
translationManager.language = language;
|
|
38
|
+
translationRequested = true;
|
|
39
|
+
const translationFileUrl = window.Module.locateFile(`translations.${language}.json`);
|
|
40
|
+
try {
|
|
41
|
+
const res = yield fetch(translationFileUrl);
|
|
42
|
+
if (res.ok) {
|
|
43
|
+
translations = yield res.json();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
throw new Error(`failed to load translation file '${translationFileUrl}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
// console.error(err)
|
|
51
|
+
console.error(`**************************************
|
|
52
|
+
Failed to load translations.${language}.js
|
|
53
|
+
|
|
54
|
+
%cThe PDF Web Viewer failed to load a required script resource. Either the "Base URL" (PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL) is not configured correctly or the static assets have not been copied to the configured location. For more information please consult the documentation.
|
|
55
|
+
|
|
56
|
+
%cwindow.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL=${window.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL}
|
|
57
|
+
%c**************************************`, 'color: orange', 'color: gray', 'color: red');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export const classNames = (...args) => {
|
|
3
|
+
const classes = [];
|
|
4
|
+
args.forEach((arg) => {
|
|
5
|
+
if (typeof arg === 'string') {
|
|
6
|
+
classes.push(arg);
|
|
7
|
+
}
|
|
8
|
+
else if (typeof arg === 'object') {
|
|
9
|
+
const keys = Object.keys(arg);
|
|
10
|
+
keys.forEach((k) => {
|
|
11
|
+
if (arg[k]) {
|
|
12
|
+
classes.push(k);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return classes.join(' ');
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatDate: (dateStr: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const formatDate = (dateStr) => `${dateStr.substring(8, 10)}.${dateStr.substring(6, 8)}.${dateStr.substring(2, 6)} ${dateStr.substring(10, 12)}:${dateStr.substring(12, 14)}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** internal */
|
|
2
|
+
export interface IconDefinition {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
path: string;
|
|
6
|
+
bg?: string;
|
|
7
|
+
}
|
|
8
|
+
/** internal */
|
|
9
|
+
export interface Icons {
|
|
10
|
+
[key: string]: IconDefinition;
|
|
11
|
+
}
|
|
12
|
+
/** internal */
|
|
13
|
+
export declare const icons: Icons;
|