@react-pdf-kit/viewer 2.6.0-beta.1 → 2.6.0-rc.0
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/dist/AnnotationLayer-D6BfL976.js +113 -0
- package/dist/Button-jStpvb3T.js +21 -0
- package/dist/Checkbox-Brta-YKG.js +195 -0
- package/dist/Combination-DqNkTtir.js +695 -0
- package/dist/Container-DTWaZzc7.js +16 -0
- package/dist/CustomThumbnailElement-C2quEICO.js +19 -0
- package/dist/DarkPdfIcon-B5ehd9CV.js +9 -0
- package/dist/DocumentDialog-DHAWcYIz.js +324 -0
- package/dist/DropDown-DikL-krI.js +33 -0
- package/dist/Input-Bb_-ljl1.js +31 -0
- package/dist/LightPdfIcon-DL8MYtWQ.js +9 -0
- package/dist/LoaderIcon-D9YjinGf.js +14 -0
- package/dist/LoadingIndicator-MWrbKa6X.js +45 -0
- package/dist/MenuItem-BJDWfzAw.js +15 -0
- package/dist/MenuSeparator-D1H5l8Ej.js +6 -0
- package/dist/MostPageTool.module-BRVv-sGz.js +4 -0
- package/dist/OtherTool.module-BQY9Nfqz.js +4 -0
- package/dist/Paginate.module-B0GMw-MB.js +8 -0
- package/dist/PaginationContext--n91mIJ4.js +232 -0
- package/dist/PasswordModal-BDHdSpxf.js +76 -0
- package/dist/PropertyItem-evJWWmWZ.js +18 -0
- package/dist/RPDropFileZone-BunRfzst.js +35 -0
- package/dist/RPLayout.module-Vc3h4xxS.js +14 -0
- package/dist/RPPage-BuSGUFzw.js +91 -0
- package/dist/RPPages-V5CNUXFD.js +1007 -0
- package/dist/RPSplitter-C63X9M8w.js +121 -0
- package/dist/RPToolbar.module-BwqWLviy.js +10 -0
- package/dist/RPTooltip-ZZoFqP7C.js +381 -0
- package/dist/RotateTool.module-DH5yWbvM.js +4 -0
- package/dist/SearchTool.module-DUkVXfOn.js +16 -0
- package/dist/SkipLink-Bvbn3miT.js +18 -0
- package/dist/TextHighlightLayer-BSVgBxR3.js +157 -0
- package/dist/TextLayer-DWGFN9SF.js +125 -0
- package/dist/Thumbnail-Dwo2-4Ki.js +97 -0
- package/dist/Thumbnails-ComClyJJ.js +52 -0
- package/dist/ToolbarLayout.module-Zo715dbb.js +12 -0
- package/dist/WrapperLayout-Dcd9l9xH.js +13 -0
- package/dist/ZoomTool.module-BrIPy8pO.js +11 -0
- package/dist/assets/AnnotationLayer.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Container.css +1 -0
- package/dist/assets/CustomThumbnailElement.css +1 -0
- package/dist/assets/DocumentDialog.css +1 -0
- package/dist/assets/DropDown.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/LoaderIcon.css +1 -0
- package/dist/assets/LoadingIndicator.css +1 -0
- package/dist/assets/MenuItem.css +1 -0
- package/dist/assets/MenuSeparator.css +1 -0
- package/dist/assets/MostPageTool.css +1 -0
- package/dist/assets/OtherTool.css +1 -0
- package/dist/assets/Paginate.css +1 -0
- package/dist/assets/PasswordModal.css +1 -0
- package/dist/assets/PropertyItem.css +1 -0
- package/dist/assets/RPDropFileZone.css +1 -0
- package/dist/assets/RPLayout.css +1 -0
- package/dist/assets/RPPage.css +1 -0
- package/dist/assets/RPPages.css +1 -0
- package/dist/assets/RPSplitter.css +1 -0
- package/dist/assets/RPToolbar.css +1 -0
- package/dist/assets/RPTooltip.css +1 -0
- package/dist/assets/RotateTool.css +1 -0
- package/dist/assets/SearchTool.css +1 -0
- package/dist/assets/SkipLink.css +1 -0
- package/dist/assets/TextHighlightLayer.css +1 -0
- package/dist/assets/TextLayer.css +1 -0
- package/dist/assets/Thumbnail.css +1 -0
- package/dist/assets/Thumbnails.css +1 -0
- package/dist/assets/ToolbarLayout.css +1 -0
- package/dist/assets/WrapperLayout.css +1 -0
- package/dist/assets/ZoomTool.css +1 -0
- package/dist/assets/style.js +2 -77
- package/dist/chunk-C_CI6nMA.js +13 -0
- package/dist/clsx-B7LyVm5O.js +16 -0
- package/dist/components/RPConfig.js +24 -26
- package/dist/components/RPController.js +85 -135
- package/dist/components/RPDropFileZone.js +3 -61
- package/dist/components/RPPages.js +3 -1082
- package/dist/components/RPProvider.js +50 -131
- package/dist/components/RPTheme.js +20 -21
- package/dist/components/icons/CheckIcon.js +16 -22
- package/dist/components/icons/ChevronDownIcon.js +17 -23
- package/dist/components/icons/ChevronUpIcon.js +16 -22
- package/dist/components/icons/ClearIcon.js +26 -25
- package/dist/components/icons/ClockwiseIcon.js +16 -22
- package/dist/components/icons/CloseIcon.js +16 -22
- package/dist/components/icons/DarkPdfIcon.js +2 -15
- package/dist/components/icons/DualPageIcon.js +16 -22
- package/dist/components/icons/DualPageWithCoverIcon.js +16 -22
- package/dist/components/icons/FileDownloadDefaultIcon.js +20 -23
- package/dist/components/icons/FileUploadDefaultIcon.js +20 -23
- package/dist/components/icons/FullScreenIcon.js +16 -22
- package/dist/components/icons/GoToDownIcon.js +16 -22
- package/dist/components/icons/HandModeDefaultIcon.js +16 -22
- package/dist/components/icons/HorizontalScrollingIcon.js +18 -24
- package/dist/components/icons/InfoIcon.js +16 -22
- package/dist/components/icons/LightPdfIcon.js +2 -15
- package/dist/components/icons/LoaderIcon.js +2 -17
- package/dist/components/icons/MoonIcon.js +16 -22
- package/dist/components/icons/PageScrollingIcon.js +18 -24
- package/dist/components/icons/PrintDefaultIcon.js +20 -23
- package/dist/components/icons/SearchIcon.js +16 -22
- package/dist/components/icons/SinglePageIcon.js +15 -21
- package/dist/components/icons/SunIcon.js +26 -25
- package/dist/components/icons/TextSelectionDefaultIcon.js +20 -23
- package/dist/components/icons/ThreeDotIcon.js +16 -22
- package/dist/components/icons/Thumbnail.js +39 -54
- package/dist/components/icons/VerticalScrollingIcon.js +18 -24
- package/dist/components/icons/WrappedScrollingIcon.js +18 -24
- package/dist/components/icons/ZoomInIcon.js +16 -22
- package/dist/components/icons/ZoomOutIcon.js +16 -22
- package/dist/components/layout/Container.js +2 -21
- package/dist/components/layout/LayoutContainer.js +23 -34
- package/dist/components/layout/LayoutWrapper.js +14 -10
- package/dist/components/layout/RPDefaultLayout.js +99 -244
- package/dist/components/layout/RPLayout.js +70 -220
- package/dist/components/layout/SkipLink.js +3 -29
- package/dist/components/layout/WrapperLayout.js +2 -27
- package/dist/components/layout/sidebar/CustomThumbnailElement.js +2 -68
- package/dist/components/layout/sidebar/RPSidebar.js +61 -112
- package/dist/components/layout/sidebar/RPSplitter.js +2 -9
- package/dist/components/layout/sidebar/Thumbnail.js +3 -155
- package/dist/components/layout/sidebar/Thumbnails.js +2 -82
- package/dist/components/layout/toolbar/DarkModeTool.js +44 -36
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -322
- package/dist/components/layout/toolbar/DocumentProperties.js +30 -39
- package/dist/components/layout/toolbar/FileDownloadTool.js +54 -50
- package/dist/components/layout/toolbar/FileUploadTool.js +54 -49
- package/dist/components/layout/toolbar/FullScreenTool.js +62 -72
- package/dist/components/layout/toolbar/MenuItem.js +2 -19
- package/dist/components/layout/toolbar/MenuSeparator.js +2 -15
- package/dist/components/layout/toolbar/MostPageTool.js +62 -81
- package/dist/components/layout/toolbar/OtherTool.js +97 -198
- package/dist/components/layout/toolbar/Paginate.js +111 -145
- package/dist/components/layout/toolbar/PrintTool.js +70 -72
- package/dist/components/layout/toolbar/PropertyItem.js +2 -12
- package/dist/components/layout/toolbar/RPMenuItem.js +22 -31
- package/dist/components/layout/toolbar/RPMoreOptions.js +140 -220
- package/dist/components/layout/toolbar/RPToolbar.js +45 -151
- package/dist/components/layout/toolbar/RPToolbarEnd.js +23 -121
- package/dist/components/layout/toolbar/RotateTool.js +49 -60
- package/dist/components/layout/toolbar/ScrollModeTool.js +79 -67
- package/dist/components/layout/toolbar/SearchCloseButton.js +23 -31
- package/dist/components/layout/toolbar/SearchResultNavigator.js +39 -100
- package/dist/components/layout/toolbar/SearchTool.js +226 -267
- package/dist/components/layout/toolbar/SelectionModeTool.js +59 -51
- package/dist/components/layout/toolbar/ThumbnailTool.js +30 -39
- package/dist/components/layout/toolbar/ToolbarCustom.js +56 -113
- package/dist/components/layout/toolbar/ToolbarDefault.js +58 -196
- package/dist/components/layout/toolbar/ToolbarLayout.js +12 -158
- package/dist/components/layout/toolbar/ViewModeTool.js +82 -62
- package/dist/components/layout/toolbar/ZoomTool.js +139 -150
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +24 -54
- package/dist/components/layout/toolbar/tools/DualPageTool.js +23 -25
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -206
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +23 -35
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +23 -34
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -201
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -33
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +24 -36
- package/dist/components/layout/toolbar/tools/InputPageTool.js +51 -92
- package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -201
- package/dist/components/layout/toolbar/tools/NextPageTool.js +32 -61
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +24 -36
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -62
- package/dist/components/layout/toolbar/tools/PrintTool.js +23 -35
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +23 -47
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +26 -47
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +29 -38
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +22 -24
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +24 -35
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +24 -46
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +24 -36
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +29 -58
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +26 -26
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +94 -133
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +29 -58
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +60 -148
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +31 -42
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +23 -28
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +25 -52
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -51
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +26 -42
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +57 -87
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +25 -52
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +44 -64
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +80 -71
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +59 -57
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +79 -66
- package/dist/components/page/AnnotationLayer.js +2 -146
- package/dist/components/page/CanvasLayer.js +47 -71
- package/dist/components/page/CustomElement.js +18 -53
- package/dist/components/page/DualPage.js +43 -98
- package/dist/components/page/DualPageWithCover.js +66 -130
- package/dist/components/page/RPPage.js +2 -143
- package/dist/components/page/SinglePage.js +27 -88
- package/dist/components/page/TextHighlightLayer.js +2 -198
- package/dist/components/page/TextLayer.js +2 -202
- package/dist/components/page/searchHighlight.js +32 -37
- package/dist/components/ui/Button.js +2 -25
- package/dist/components/ui/Checkbox.js +2 -273
- package/dist/components/ui/DropDown.js +2 -36
- package/dist/components/ui/Input.js +2 -28
- package/dist/components/ui/LoadingIndicator.js +2 -59
- package/dist/components/ui/PasswordModal.js +2 -75
- package/dist/components/ui/RPTooltip.js +2 -357
- package/dist/contexts/ConfigContext.js +13 -12
- package/dist/contexts/DarkModeContext.js +26 -27
- package/dist/contexts/DimensionPagesContext.js +49 -60
- package/dist/contexts/DocumentPasswordContext.js +37 -39
- package/dist/contexts/DownloadContext.js +13 -21
- package/dist/contexts/DropFileZoneContext.js +35 -62
- package/dist/contexts/ElementPageContext.js +114 -139
- package/dist/contexts/ElementThumbnailContext.js +132 -195
- package/dist/contexts/EventCallbackContext.js +19 -34
- package/dist/contexts/FileInputContext.js +30 -49
- package/dist/contexts/FullScreenContext.js +31 -24
- package/dist/contexts/GlobalCurrentPage.js +21 -18
- package/dist/contexts/HighlightContext.js +22 -31
- package/dist/contexts/IconContext.js +9 -11
- package/dist/contexts/IconToolContext.js +14 -11
- package/dist/contexts/InitialStateContext.js +9 -11
- package/dist/contexts/LayerContext.js +9 -8
- package/dist/contexts/LayoutContainerContext.js +12 -16
- package/dist/contexts/LayoutDropFileZoneContext.js +8 -11
- package/dist/contexts/LicenseContext.js +12 -17
- package/dist/contexts/LoaderContext.js +14 -27
- package/dist/contexts/LocalizationContext.js +22 -33
- package/dist/contexts/OtherToolContext.js +17 -17
- package/dist/contexts/PageViewportContext.js +9 -8
- package/dist/contexts/PagesRotateContext.js +42 -43
- package/dist/contexts/PaginationContext.js +2 -40
- package/dist/contexts/PrintContext.js +67 -78
- package/dist/contexts/RPDocumentContext.js +60 -73
- package/dist/contexts/RenderQueueProvider.js +43 -72
- package/dist/contexts/RenderedPagesCache.js +17 -13
- package/dist/contexts/RotationContext.js +27 -38
- package/dist/contexts/ScrollModeContext.js +22 -20
- package/dist/contexts/SearchContext.js +39 -97
- package/dist/contexts/SelectionModeContext.js +22 -23
- package/dist/contexts/SmoothScrollContext.js +18 -16
- package/dist/contexts/ThemeContext.js +5 -7
- package/dist/contexts/ThumbnailsContext.js +26 -43
- package/dist/contexts/ToolComponentContext.js +54 -51
- package/dist/contexts/ToolbarComponentContext.js +48 -47
- package/dist/contexts/ViewModeContext.js +34 -31
- package/dist/contexts/ViewportContext.js +91 -85
- package/dist/contexts/VirtualGridContext.js +17 -14
- package/dist/contexts/VirtualScrollContext.js +42 -52
- package/dist/contexts/ZoomContext.js +95 -107
- package/dist/de_DE--0LF-SJR.js +483 -0
- package/dist/dist-7FA4Do6I.js +1286 -0
- package/dist/dist-BRVqFn7R.js +144 -0
- package/dist/dist-C3WNMuW2.js +29 -0
- package/dist/dist-CKteKPPA.js +947 -0
- package/dist/dist-bK-AHWLF.js +314 -0
- package/dist/lib-BiapEtK1.js +10261 -0
- package/dist/libInjectCss.js +7 -8
- package/dist/main-CHO5p1qM.js +60 -0
- package/dist/main.js +53 -296
- package/dist/style-9n_QpMZt.js +5 -0
- package/dist/useWatermark-CvAAf66v.js +67 -0
- package/dist/utils/Queue.js +40 -46
- package/dist/utils/annotations.js +227 -261
- package/dist/utils/appConsole.js +24 -42
- package/dist/utils/approximateFragtion.js +16 -21
- package/dist/utils/calculatePage.js +29 -20
- package/dist/utils/charators.js +39 -48
- package/dist/utils/const.js +8 -11
- package/dist/utils/constants.js +4 -8
- package/dist/utils/convertPdfDate.js +20 -24
- package/dist/utils/dateFormatter.js +7 -7
- package/dist/utils/elementPagePosition.js +10 -10
- package/dist/utils/formatFileSize.js +17 -8
- package/dist/utils/getElementPositionInPage.js +44 -82
- package/dist/utils/getScrollDistance.js +4 -4
- package/dist/utils/getThumbnailViewport.js +12 -6
- package/dist/utils/getWordPositionInPage.js +24 -24
- package/dist/utils/getZoomLevel.js +16 -23
- package/dist/utils/highlight.js +195 -212
- package/dist/utils/hooks/useCopyText.js +23 -33
- package/dist/utils/hooks/useDarkMode.js +10 -10
- package/dist/utils/hooks/useDarkModeProps.js +9 -10
- package/dist/utils/hooks/useDebounce.js +22 -18
- package/dist/utils/hooks/useDropFileZone.js +13 -11
- package/dist/utils/hooks/useElementSize.js +24 -20
- package/dist/utils/hooks/useFileDownload.js +16 -33
- package/dist/utils/hooks/useFlickerSelectText.js +19 -24
- package/dist/utils/hooks/useFullScreen.js +31 -28
- package/dist/utils/hooks/useGrabScroll.js +52 -51
- package/dist/utils/hooks/useHighlight.js +92 -92
- package/dist/utils/hooks/useInfiniteScroll.js +17 -18
- package/dist/utils/hooks/useLicense.js +113 -135
- package/dist/utils/hooks/useLoadPdf.js +107 -96
- package/dist/utils/hooks/useLoadWorker.js +13 -15
- package/dist/utils/hooks/useLocalization.js +25 -25
- package/dist/utils/hooks/useMousePressed.js +25 -19
- package/dist/utils/hooks/usePageRotateContext.js +25 -41
- package/dist/utils/hooks/usePaginate.js +2 -38
- package/dist/utils/hooks/usePdfProperties.js +38 -36
- package/dist/utils/hooks/usePinch.js +65 -100
- package/dist/utils/hooks/usePresentPage.js +69 -92
- package/dist/utils/hooks/usePrint.js +167 -178
- package/dist/utils/hooks/useRequestAnimationFrame.js +16 -16
- package/dist/utils/hooks/useResizeObserver.js +18 -21
- package/dist/utils/hooks/useRotate.js +15 -27
- package/dist/utils/hooks/useScrollToPage.js +2 -38
- package/dist/utils/hooks/useSearch.js +125 -163
- package/dist/utils/hooks/useTextSelection.js +69 -75
- package/dist/utils/hooks/useThumbnail.js +42 -59
- package/dist/utils/hooks/useVirtualReactWindow.js +85 -96
- package/dist/utils/hooks/useWatermark.js +2 -78
- package/dist/utils/injectPrintCSS.js +6 -21
- package/dist/utils/link_service.js +59 -137
- package/dist/utils/renderPage.js +20 -19
- package/dist/utils/sanitizeExternalUrl.js +12 -15
- package/dist/utils/smoothScrollTo.js +8 -5
- package/dist/utils/types.js +29 -21
- package/dist/utils/withRef.js +7 -7
- package/dist/utils/zoom.js +5 -6
- package/package.json +7 -7
- package/dist/Combination-17ab8af1.js +0 -698
- package/dist/MostPageTool.module-13578ad6.js +0 -6
- package/dist/OtherTool.module-a4be5f1f.js +0 -6
- package/dist/Paginate.module-4eef00aa.js +0 -8
- package/dist/PaginationContext-87f832f2.js +0 -233
- package/dist/RPLayout.module-92fa19f7.js +0 -14
- package/dist/RPSplitter-b62772f9.js +0 -122
- package/dist/RPToolbar.module-27d7fe77.js +0 -10
- package/dist/RotateTool.module-67946714.js +0 -6
- package/dist/SearchTool.module-99f60dc7.js +0 -16
- package/dist/ToolbarLayout.module-6e339802.js +0 -12
- package/dist/ZoomTool.module-7082af8c.js +0 -12
- package/dist/assets/style.css +0 -1
- package/dist/clsx-0c6e471a.js +0 -22
- package/dist/de_DE-8145915f.js +0 -489
- package/dist/index-113053cf.js +0 -309
- package/dist/index-11f3cd64.js +0 -983
- package/dist/index-23911b43.js +0 -150
- package/dist/index-ada501c4.js +0 -27
- package/dist/index-d0f0aa9a.js +0 -1542
- package/dist/index-e04c91b1.js +0 -11671
|
@@ -1,277 +1,243 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { dateFormatter as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { AnnotationType as e } from "./types.js";
|
|
2
|
+
import { sanitizeExternalUrl as t } from "./sanitizeExternalUrl.js";
|
|
3
|
+
import { dateFormatter as n } from "./dateFormatter.js";
|
|
4
|
+
//#region lib/utils/annotations.ts
|
|
5
|
+
var r = [
|
|
6
|
+
"click",
|
|
7
|
+
"dblclick",
|
|
8
|
+
"input",
|
|
9
|
+
"change",
|
|
10
|
+
"mouseover"
|
|
11
|
+
], i = /* @__PURE__ */ new Map(), a = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
12
|
+
function o(e, t) {
|
|
13
|
+
let n = a(e, t);
|
|
14
|
+
return i.has(n) ? i.get(n) ?? null : null;
|
|
9
15
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
e && (() => {
|
|
47
|
-
const t = e == null ? void 0 : e.querySelectorAll(
|
|
48
|
-
'[data-l10n-id="pdfjs-annotation-date-time-string"]'
|
|
49
|
-
);
|
|
50
|
-
t == null || t.forEach((n) => {
|
|
51
|
-
const { date: o, time: a, dateObj: i } = JSON.parse(n.dataset.l10nArgs ?? "{}");
|
|
52
|
-
o && a ? n.textContent = `${o}, ${a}` : i && (n.textContent = T(i));
|
|
53
|
-
});
|
|
54
|
-
})();
|
|
16
|
+
var s = (e, t, n) => {
|
|
17
|
+
i.set(a(e, t), n);
|
|
18
|
+
}, c = (e, t) => {
|
|
19
|
+
switch (t[1].name) {
|
|
20
|
+
case "XYZ": return {
|
|
21
|
+
bottomOffset: (e, n) => t[3] === null ? n : t[3],
|
|
22
|
+
leftOffset: (e, n) => t[2] === null ? 0 : t[2],
|
|
23
|
+
pageIndex: e,
|
|
24
|
+
scaleTo: t[4]
|
|
25
|
+
};
|
|
26
|
+
case "Fit":
|
|
27
|
+
case "FitB": return {
|
|
28
|
+
bottomOffset: 0,
|
|
29
|
+
leftOffset: 0,
|
|
30
|
+
pageIndex: e,
|
|
31
|
+
scaleTo: 1
|
|
32
|
+
};
|
|
33
|
+
case "FitH":
|
|
34
|
+
case "FitBH": return {
|
|
35
|
+
bottomOffset: t[2],
|
|
36
|
+
leftOffset: 0,
|
|
37
|
+
pageIndex: e,
|
|
38
|
+
scaleTo: 1
|
|
39
|
+
};
|
|
40
|
+
default: return {
|
|
41
|
+
bottomOffset: 0,
|
|
42
|
+
leftOffset: 0,
|
|
43
|
+
pageIndex: e,
|
|
44
|
+
scaleTo: 1
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, l = (e) => {
|
|
48
|
+
e && (e?.querySelectorAll("[data-l10n-id=\"pdfjs-annotation-date-time-string\"]"))?.forEach((e) => {
|
|
49
|
+
let { date: t, time: r, dateObj: i } = JSON.parse(e.dataset.l10nArgs ?? "{}");
|
|
50
|
+
t && r ? e.textContent = `${t}, ${r}` : i && (e.textContent = n(i));
|
|
51
|
+
});
|
|
55
52
|
};
|
|
56
|
-
async function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return O(e, n, a), await N(e, t);
|
|
63
|
-
} else
|
|
64
|
-
return g(o, t);
|
|
65
|
-
} else
|
|
66
|
-
return g(t[0], t);
|
|
53
|
+
async function u(e, t) {
|
|
54
|
+
let n;
|
|
55
|
+
if (n = typeof t == "string" ? await e.getDestination(t) : t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
56
|
+
let t = n[0], r = o(e, t);
|
|
57
|
+
return r === null ? (s(e, t, await e.getPageIndex(t)), await u(e, n)) : c(r, n);
|
|
58
|
+
} else return c(n[0], n);
|
|
67
59
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
e.addEventListener(t, s);
|
|
60
|
+
function d(e, t) {
|
|
61
|
+
for (let n of r) e.addEventListener(n, t);
|
|
71
62
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
e.removeEventListener(t, s);
|
|
63
|
+
function f(e, t) {
|
|
64
|
+
for (let n of r) e.removeEventListener(n, t);
|
|
75
65
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
66
|
+
function p(e) {
|
|
67
|
+
let { id: n, url: r, unsafeUrl: i } = e;
|
|
68
|
+
new MutationObserver((e, a) => {
|
|
69
|
+
let o = document.querySelector(`[data-annotation-id="${n}"]`);
|
|
70
|
+
if (o) {
|
|
71
|
+
let e = o.querySelector("a"), n = t((r || i) ?? "", "");
|
|
72
|
+
e && (e?.setAttribute("target", "_blank"), e?.setAttribute("href", n), e?.setAttribute("rel", "noopener noreferrer")), a.disconnect();
|
|
73
|
+
}
|
|
74
|
+
}).observe(document.body, {
|
|
75
|
+
childList: !0,
|
|
76
|
+
subtree: !0
|
|
77
|
+
});
|
|
85
78
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
function m(e, t, n) {
|
|
80
|
+
let { rotation: r, scale: i } = t, a = r % 180 == 0;
|
|
81
|
+
if (e.fieldType === "Btn" && e.pushButton) {
|
|
82
|
+
let t = e.rect[2] - e.rect[0], r = e.rect[3] - e.rect[1], o = document.createElement("canvas");
|
|
83
|
+
o.setAttribute("width", ((a ? t : r) * i).toString()), o.setAttribute("height", ((a ? r : t) * i).toString()), n.set(e.id, o);
|
|
84
|
+
}
|
|
92
85
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
function h(e) {
|
|
87
|
+
e.querySelectorAll("[tabindex]").forEach((e) => {
|
|
88
|
+
let t = e.getAttribute("tabindex");
|
|
89
|
+
t && parseInt(t, 10) > 0 && (e.tagName === "A" || e.tagName === "BUTTON" || e.getAttribute("role") === "button" || e.getAttribute("role") === "link" || e.classList.contains("linkAnnotation") ? e.setAttribute("tabindex", "0") : e.removeAttribute("tabindex"));
|
|
90
|
+
});
|
|
98
91
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
t.setAttribute("aria-label", i);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
92
|
+
function g(e) {
|
|
93
|
+
e.querySelectorAll("a").forEach((e) => {
|
|
94
|
+
let t = e.textContent && e.textContent.trim().length > 0, n = e.getAttribute("aria-label");
|
|
95
|
+
if (!t && !n) {
|
|
96
|
+
let t = e.getAttribute("href") || "", n;
|
|
97
|
+
if (!t || t.startsWith("#") || t.startsWith("javascript:")) n = "Link to page in document";
|
|
98
|
+
else try {
|
|
99
|
+
n = `External link to ${new URL(t, window.location.href).hostname.replace("www.", "")}`;
|
|
100
|
+
} catch {
|
|
101
|
+
n = "External link";
|
|
102
|
+
}
|
|
103
|
+
e.setAttribute("aria-label", n);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
116
106
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
o[e] === s && n.push(o);
|
|
122
|
-
return n;
|
|
107
|
+
function _(e, t, n) {
|
|
108
|
+
let r = [];
|
|
109
|
+
if (n) for (let i of n) i[e] === t && r.push(i);
|
|
110
|
+
return r;
|
|
123
111
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
112
|
+
function v(e, t) {
|
|
113
|
+
return {
|
|
114
|
+
type: e,
|
|
115
|
+
data: t
|
|
116
|
+
};
|
|
126
117
|
}
|
|
127
|
-
async function
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
unsafeUrl: e.unsafeUrl
|
|
149
|
-
});
|
|
118
|
+
async function y(t, n) {
|
|
119
|
+
if (t.dest) if (typeof t.dest == "string") {
|
|
120
|
+
let r = await u(n, t.dest);
|
|
121
|
+
return v(e.INTERNAL_LINK, {
|
|
122
|
+
referencedPage: r.pageIndex,
|
|
123
|
+
offset: null
|
|
124
|
+
});
|
|
125
|
+
} else {
|
|
126
|
+
let r = await n.getPageIndex(t.dest[0]);
|
|
127
|
+
return v(e.INTERNAL_LINK, {
|
|
128
|
+
referencedPage: r,
|
|
129
|
+
offset: {
|
|
130
|
+
left: t.dest[2],
|
|
131
|
+
bottom: t.dest[3]
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else if (t.url || t.unsafeUrl) return v(e.LINK, {
|
|
136
|
+
url: t.url ?? t.unsafeUrl,
|
|
137
|
+
unsafeUrl: t.unsafeUrl
|
|
138
|
+
});
|
|
150
139
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
t = t.replace(`{{${o}}}`, n[o]);
|
|
158
|
-
s.textContent = t;
|
|
159
|
-
}
|
|
140
|
+
function b(e) {
|
|
141
|
+
for (let t of e.getElementsByTagName("span")) {
|
|
142
|
+
let e = t.textContent, n = JSON.parse(t.dataset.l10nArgs ?? "{}");
|
|
143
|
+
if (e) for (let t in n) e = e.replace(`{{${t}}}`, n[t]);
|
|
144
|
+
t.textContent = e;
|
|
145
|
+
}
|
|
160
146
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
147
|
+
function x(t) {
|
|
148
|
+
return v(e.FILE_ATTACHMENT, t.file);
|
|
163
149
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
case "button":
|
|
202
|
-
return u(l.FORM_BUTTON, {
|
|
203
|
-
fieldName: e.name,
|
|
204
|
-
...s
|
|
205
|
-
});
|
|
206
|
-
}
|
|
150
|
+
function S(t, n) {
|
|
151
|
+
switch (t.type) {
|
|
152
|
+
case "textarea":
|
|
153
|
+
case "text": return v(e.FORM_TEXT, {
|
|
154
|
+
fieldName: t.name,
|
|
155
|
+
value: t.value
|
|
156
|
+
});
|
|
157
|
+
case "select-one":
|
|
158
|
+
case "select-multiple":
|
|
159
|
+
let r = [];
|
|
160
|
+
for (let e of t.options) r.push({
|
|
161
|
+
value: e.value,
|
|
162
|
+
label: e.label
|
|
163
|
+
});
|
|
164
|
+
let i = [];
|
|
165
|
+
for (let e of t.selectedOptions) i.push({
|
|
166
|
+
value: e.value,
|
|
167
|
+
label: e.label
|
|
168
|
+
});
|
|
169
|
+
return v(e.FORM_SELECT, {
|
|
170
|
+
fieldName: t.name,
|
|
171
|
+
value: i,
|
|
172
|
+
options: r
|
|
173
|
+
});
|
|
174
|
+
case "checkbox": return v(e.FORM_CHECKBOX, {
|
|
175
|
+
fieldName: t.name,
|
|
176
|
+
checked: t.checked
|
|
177
|
+
});
|
|
178
|
+
case "radio": return v(e.FORM_RADIO, {
|
|
179
|
+
fieldName: t.name,
|
|
180
|
+
...n
|
|
181
|
+
});
|
|
182
|
+
case "button": return v(e.FORM_BUTTON, {
|
|
183
|
+
fieldName: t.name,
|
|
184
|
+
...n
|
|
185
|
+
});
|
|
186
|
+
}
|
|
207
187
|
}
|
|
208
|
-
async function
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
{ name: i.fieldName, type: "button" },
|
|
262
|
-
{ actions: i.actions, reset: !1 }
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
188
|
+
async function C(t, n, r) {
|
|
189
|
+
let i = t.target.parentNode;
|
|
190
|
+
if (i.tagName === "DIV" && (i = i.firstChild), typeof i.className != "object") {
|
|
191
|
+
if (i.className === "linkAnnotation" && t.type === "click") {
|
|
192
|
+
let e = i.dataset?.annotationId;
|
|
193
|
+
if (e) {
|
|
194
|
+
let t = _("id", e, r);
|
|
195
|
+
if (t.length) return await y(t[0], n);
|
|
196
|
+
}
|
|
197
|
+
} else if (i.className.includes("textAnnotation")) b(i);
|
|
198
|
+
else if (i.className.includes("fileAttachmentAnnotation")) {
|
|
199
|
+
b(i);
|
|
200
|
+
let e = i.dataset.annotationId;
|
|
201
|
+
if (e && t.type === "dblclick") return x(_("id", e, r)[0]);
|
|
202
|
+
} else if (i.className.includes("textWidgetAnnotation") && t.type === "input") {
|
|
203
|
+
let e = i.getElementsByTagName("input")[0];
|
|
204
|
+
return e ||= i.getElementsByTagName("textarea")[0], S(e);
|
|
205
|
+
} else if (i.className.includes("choiceWidgetAnnotation") && t.type === "input") return S(i.getElementsByTagName("select")[0]);
|
|
206
|
+
else if (i.className.includes("buttonWidgetAnnotation checkBox") && t.type === "change") return S(i.getElementsByTagName("input")[0]);
|
|
207
|
+
else if (i.className.includes("buttonWidgetAnnotation radioButton") && t.type === "change") {
|
|
208
|
+
let e = i.dataset.annotationId;
|
|
209
|
+
if (e) {
|
|
210
|
+
let t = _("id", e, r)[0], n = [];
|
|
211
|
+
for (let e of _("fieldName", t.fieldName, r)) e.buttonValue && n.push(e.buttonValue);
|
|
212
|
+
return S(i.getElementsByTagName("input")[0], {
|
|
213
|
+
value: t.buttonValue,
|
|
214
|
+
defaultValue: t.fieldValue,
|
|
215
|
+
options: n
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
} else if (i.className.includes("buttonWidgetAnnotation pushButton") && t.type === "click") {
|
|
219
|
+
let t = i.dataset.annotationId;
|
|
220
|
+
if (t) {
|
|
221
|
+
let n = _("id", t, r)[0], { action: i } = n;
|
|
222
|
+
return i && ["Print", "SaveAs"].includes(i) ? {
|
|
223
|
+
type: e.BUTTON,
|
|
224
|
+
data: n
|
|
225
|
+
} : n.resetForm ? S({
|
|
226
|
+
name: n.fieldName,
|
|
227
|
+
type: "button"
|
|
228
|
+
}, {
|
|
229
|
+
actions: n.actions,
|
|
230
|
+
reset: !0
|
|
231
|
+
}) : S({
|
|
232
|
+
name: n.fieldName,
|
|
233
|
+
type: "button"
|
|
234
|
+
}, {
|
|
235
|
+
actions: n.actions,
|
|
236
|
+
reset: !1
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
267
241
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
L as bindLayerEvents,
|
|
271
|
-
U as enhanceLinkAccessibility,
|
|
272
|
-
S as fixTabIndexAccessibility,
|
|
273
|
-
R as handleAnnotationLink,
|
|
274
|
-
F as handleAnnotationWidget,
|
|
275
|
-
E as insertDateText,
|
|
276
|
-
C as unbindLayerEvents
|
|
277
|
-
};
|
|
242
|
+
//#endregion
|
|
243
|
+
export { C as annotationEventsHandler, d as bindLayerEvents, g as enhanceLinkAccessibility, h as fixTabIndexAccessibility, p as handleAnnotationLink, m as handleAnnotationWidget, l as insertDateText, f as unbindLayerEvents };
|
package/dist/utils/appConsole.js
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* Warning level logging - kept in production
|
|
26
|
-
*/
|
|
27
|
-
warn(...n) {
|
|
28
|
-
console.warn("[React PDF Warning]:", ...n);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Error level logging - kept in production
|
|
32
|
-
*/
|
|
33
|
-
error(...n) {
|
|
34
|
-
console.error("[React PDF Error]:", ...n);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
o(t, "instance");
|
|
38
|
-
let r = t;
|
|
39
|
-
const u = r.getInstance();
|
|
40
|
-
export {
|
|
41
|
-
u as appConsole
|
|
42
|
-
};
|
|
1
|
+
var e = class e {
|
|
2
|
+
static instance;
|
|
3
|
+
isProduction;
|
|
4
|
+
constructor() {
|
|
5
|
+
this.isProduction = !0;
|
|
6
|
+
}
|
|
7
|
+
static getInstance() {
|
|
8
|
+
return e.instance ||= new e(), e.instance;
|
|
9
|
+
}
|
|
10
|
+
debug(...e) {
|
|
11
|
+
this.isProduction || console.debug("[React PDF Debug]:", ...e);
|
|
12
|
+
}
|
|
13
|
+
info(...e) {
|
|
14
|
+
console.info("[React PDF Info]:", ...e);
|
|
15
|
+
}
|
|
16
|
+
warn(...e) {
|
|
17
|
+
console.warn("[React PDF Warning]:", ...e);
|
|
18
|
+
}
|
|
19
|
+
error(...e) {
|
|
20
|
+
console.error("[React PDF Error]:", ...e);
|
|
21
|
+
}
|
|
22
|
+
}.getInstance();
|
|
23
|
+
//#endregion
|
|
24
|
+
export { e as appConsole };
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
r <= c / f ? (o = c, l = f) : (i = c, n = f);
|
|
16
|
-
}
|
|
17
|
-
let a;
|
|
18
|
-
return r - i / n < o / l - r ? a = r === t ? [i, n] : [n, i] : a = r === t ? [o, l] : [l, o], a;
|
|
1
|
+
//#region lib/utils/approximateFragtion.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (Math.floor(e) === e) return [e, 1];
|
|
4
|
+
let t = 1 / e;
|
|
5
|
+
if (t > 8) return [1, 8];
|
|
6
|
+
if (Math.floor(t) === t) return [1, t];
|
|
7
|
+
let n = e > 1 ? t : e, r = 0, i = 1, a = 1, o = 1;
|
|
8
|
+
for (;;) {
|
|
9
|
+
let e = r + a, t = i + o;
|
|
10
|
+
if (t > 8) break;
|
|
11
|
+
n <= e / t ? (a = e, o = t) : (r = e, i = t);
|
|
12
|
+
}
|
|
13
|
+
let s;
|
|
14
|
+
return s = n - r / i < a / o - n ? n === e ? [r, i] : [i, r] : n === e ? [a, o] : [o, a], s;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as approximateFraction };
|