@react-pdf-kit/viewer 2.6.0-beta.2 → 2.6.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 -1115
- 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 -35
- 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 -100
- 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,21 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//#region lib/utils/calculatePage.ts
|
|
2
|
+
var e = (e, t, n, r = !1) => r ? e === 0 ? t === 0 ? 1 : -1 : 1 + (e - 1) * n + t + 1 : e * n + t + 1, t = (e, t, n = !1) => {
|
|
3
|
+
if (n) {
|
|
4
|
+
if (e === 1) return {
|
|
5
|
+
rowIndex: 0,
|
|
6
|
+
columnIndex: 0
|
|
7
|
+
};
|
|
8
|
+
let n = e - 1 - 1;
|
|
9
|
+
return {
|
|
10
|
+
rowIndex: Math.floor(n / t) + 1,
|
|
11
|
+
columnIndex: n % t
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
let r = e - 1, i = Math.floor(r / t);
|
|
15
|
+
return {
|
|
16
|
+
rowIndex: i,
|
|
17
|
+
columnIndex: (r - i * t) % t
|
|
18
|
+
};
|
|
19
|
+
}, n = (e, n, r = !1) => {
|
|
20
|
+
let i = [], a = [];
|
|
21
|
+
return e.heights.forEach((o, s) => {
|
|
22
|
+
let c = t(s + 1, n, r), l = e.widths[s];
|
|
23
|
+
i[c.rowIndex] = Math.max(i[c.rowIndex] || 0, o), a[c.columnIndex] = Math.max(a[c.columnIndex] || 0, l);
|
|
24
|
+
}), {
|
|
25
|
+
rowsHeight: i,
|
|
26
|
+
columnsWidth: a
|
|
27
|
+
};
|
|
21
28
|
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { n as getGridDimension, e as getPageFromPosition, t as getPositionFromPage };
|
package/dist/utils/charators.js
CHANGED
|
@@ -1,48 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
function e
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
function g(n) {
|
|
42
|
-
return i(n) ? t(n) ? f(n) ? 0 : u(n) || r(n) || n === /* UNDERSCORE = */
|
|
43
|
-
95 ? 1 : 2 : A(n) ? 7 : n === /* NBSP = */
|
|
44
|
-
160 ? 0 : 1 : s(n) ? 3 : e(n) ? 4 : l(n) ? 5 : p(n) ? 6 : 1;
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
g as getCharacterType
|
|
48
|
-
};
|
|
1
|
+
//#region lib/utils/charators.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e[e.SPACE = 0] = "SPACE", e[e.ALPHA_LETTER = 1] = "ALPHA_LETTER", e[e.PUNCTUATION = 2] = "PUNCTUATION", e[e.HAN_LETTER = 3] = "HAN_LETTER", e[e.KATAKANA_LETTER = 4] = "KATAKANA_LETTER", e[e.HIRAGANA_LETTER = 5] = "HIRAGANA_LETTER", e[e.HALF_WIDTH_KATAKANA_LETTER = 6] = "HALF_WIDTH_KATAKANA_LETTER", e[e.THAI_LETTER = 7] = "THAI_LETTER", e;
|
|
4
|
+
}(e || {});
|
|
5
|
+
function t(e) {
|
|
6
|
+
return e < 11904;
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
return (e & 65408) == 0;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
13
|
+
}
|
|
14
|
+
function i(e) {
|
|
15
|
+
return e >= 48 && e <= 57;
|
|
16
|
+
}
|
|
17
|
+
function a(e) {
|
|
18
|
+
return e === 32 || e === 9 || e === 13 || e === 10;
|
|
19
|
+
}
|
|
20
|
+
function o(e) {
|
|
21
|
+
return e >= 13312 && e <= 40959 || e >= 63744 && e <= 64255;
|
|
22
|
+
}
|
|
23
|
+
function s(e) {
|
|
24
|
+
return e >= 12448 && e <= 12543;
|
|
25
|
+
}
|
|
26
|
+
function c(e) {
|
|
27
|
+
return e >= 12352 && e <= 12447;
|
|
28
|
+
}
|
|
29
|
+
function l(e) {
|
|
30
|
+
return e >= 65376 && e <= 65439;
|
|
31
|
+
}
|
|
32
|
+
function u(e) {
|
|
33
|
+
return (e & 65408) == 3584;
|
|
34
|
+
}
|
|
35
|
+
function d(d) {
|
|
36
|
+
return t(d) ? n(d) ? a(d) ? e.SPACE : r(d) || i(d) || d === 95 ? e.ALPHA_LETTER : e.PUNCTUATION : u(d) ? e.THAI_LETTER : d === 160 ? e.SPACE : e.ALPHA_LETTER : o(d) ? e.HAN_LETTER : s(d) ? e.KATAKANA_LETTER : c(d) ? e.HIRAGANA_LETTER : l(d) ? e.HALF_WIDTH_KATAKANA_LETTER : e.ALPHA_LETTER;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { d as getCharacterType };
|
package/dist/utils/const.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
o as INVALID_OR_CORRUPTED_PDF_MESSAGE,
|
|
10
|
-
E as ORGANIZATION_ALLOWED_FEATURES_MESSAGE
|
|
11
|
-
};
|
|
1
|
+
//#region lib/utils/const.ts
|
|
2
|
+
var e = {
|
|
3
|
+
keyword: "",
|
|
4
|
+
regExp: /* @__PURE__ */ RegExp(" "),
|
|
5
|
+
wholeWords: !1
|
|
6
|
+
}, t = "This feature is only available for the Organization license", n = "Invalid or corrupted PDF file.", r = "React PDF Kit is unable to render on this browser.";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { r as BROWSER_NOT_SUPPORTED_MESSAGE, e as EMPTY_KEYWORD_REGEXP, n as INVALID_OR_CORRUPTED_PDF_MESSAGE, t as ORGANIZATION_ALLOWED_FEATURES_MESSAGE };
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_ as PAGE_PADDING,
|
|
6
|
-
o as SCROLL_BAR_WIDTH,
|
|
7
|
-
A as THUMBNAIL_MIN_WIDTH
|
|
8
|
-
};
|
|
1
|
+
//#region lib/utils/constants.ts
|
|
2
|
+
var e = 4, t = 200, n = 20, r = 25, i = 1e3;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { i as MAX_ZOOM_SCALE, r as MIN_ZOOM_SCALE, e as PAGE_PADDING, n as SCROLL_BAR_WIDTH, t as THUMBNAIL_MIN_WIDTH };
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
return new Date(Date.UTC(o, c, n, r, a, i));
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
f as convertPDFDate
|
|
1
|
+
//#region lib/utils/convertPdfDate.ts
|
|
2
|
+
var e = /* @__PURE__ */ RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"), t = (e, t, n, r) => {
|
|
3
|
+
let i = parseInt(e, 10);
|
|
4
|
+
return i >= t && i <= n ? i : r;
|
|
5
|
+
}, n = (n) => {
|
|
6
|
+
let r = e.exec(n);
|
|
7
|
+
if (!r) return null;
|
|
8
|
+
let i = parseInt(r[1], 10), a = t(r[2], 1, 12, 1) - 1, o = t(r[3], 1, 31, 1), s = t(r[4], 0, 23, 0), c = t(r[5], 0, 59, 0), l = t(r[6], 0, 59, 0), u = r[7] || "Z", d = t(r[8], 0, 23, 0), f = t(r[9], 0, 59, 0);
|
|
9
|
+
switch (u) {
|
|
10
|
+
case "-":
|
|
11
|
+
s += d, c += f;
|
|
12
|
+
break;
|
|
13
|
+
case "+":
|
|
14
|
+
s -= d, c -= f;
|
|
15
|
+
break;
|
|
16
|
+
default: break;
|
|
17
|
+
}
|
|
18
|
+
return new Date(Date.UTC(i, a, o, s, c, l));
|
|
25
19
|
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { n as convertPDFDate };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
1
|
+
//#region lib/utils/dateFormatter.ts
|
|
2
|
+
var e = new Intl.DateTimeFormat("en-US", {
|
|
3
|
+
dateStyle: "short",
|
|
4
|
+
timeStyle: "medium"
|
|
5
|
+
}).format, t = (t) => e(new Date(t));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as dateFormatter };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region lib/utils/elementPagePosition.ts
|
|
2
|
+
var e = ({ width: e, height: t, top: n, left: r, bottom: i, right: a }) => ({
|
|
3
|
+
left: `calc(${r} * var(--scale-factor))`,
|
|
4
|
+
top: `calc(${n} * var(--scale-factor))`,
|
|
5
|
+
width: `calc(${e} * var(--scale-factor))`,
|
|
6
|
+
height: `calc(${t} * var(--scale-factor))`,
|
|
7
|
+
bottom: `calc(${i} * var(--scale-factor))`,
|
|
8
|
+
right: `calc(${a} * var(--scale-factor))`
|
|
8
9
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as elementPagePosition };
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region lib/utils/formatFileSize.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (e == 0) return "0 Bytes";
|
|
4
|
+
var n = 1e3, r = t || 2, i = [
|
|
5
|
+
"Bytes",
|
|
6
|
+
"KB",
|
|
7
|
+
"MB",
|
|
8
|
+
"GB",
|
|
9
|
+
"TB",
|
|
10
|
+
"PB",
|
|
11
|
+
"EB",
|
|
12
|
+
"ZB",
|
|
13
|
+
"YB"
|
|
14
|
+
], a = Math.floor(Math.log(e) / Math.log(n));
|
|
15
|
+
return parseFloat((e / n ** +a).toFixed(r)) + " " + i[a];
|
|
6
16
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as formatFileSize };
|
|
@@ -1,84 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"top",
|
|
9
|
-
"right",
|
|
10
|
-
"bottom",
|
|
11
|
-
"left",
|
|
12
|
-
"margin",
|
|
13
|
-
"margin-top",
|
|
14
|
-
"margin-right",
|
|
15
|
-
"margin-bottom",
|
|
16
|
-
"margin-left",
|
|
17
|
-
"padding",
|
|
18
|
-
"padding-top",
|
|
19
|
-
"padding-right",
|
|
20
|
-
"padding-bottom",
|
|
21
|
-
"padding-left",
|
|
22
|
-
"border-width",
|
|
23
|
-
"border-top-width",
|
|
24
|
-
"border-right-width",
|
|
25
|
-
"border-bottom-width",
|
|
26
|
-
"border-left-width",
|
|
27
|
-
"font-size",
|
|
28
|
-
"line-height",
|
|
29
|
-
"letter-spacing",
|
|
30
|
-
"word-spacing",
|
|
31
|
-
"min-width",
|
|
32
|
-
"min-height",
|
|
33
|
-
"max-width",
|
|
34
|
-
"max-height",
|
|
35
|
-
"flex-basis",
|
|
36
|
-
"grid-gap",
|
|
37
|
-
"grid-row-gap",
|
|
38
|
-
"grid-column-gap"
|
|
39
|
-
];
|
|
40
|
-
let t;
|
|
41
|
-
typeof i == "number" && i !== 0 ? t = n.includes(s) ? `${i}px` : String(i) : t = String(i), o.style.setProperty(s, t);
|
|
42
|
-
});
|
|
1
|
+
//#region lib/utils/getElementPositionInPage.tsx
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
!e || typeof e != "object" || Object.entries(e).forEach(([e, n]) => {
|
|
4
|
+
if (n == null) return;
|
|
5
|
+
let r = e.replace(/([A-Z])/g, "-$1").toLowerCase(), i = /* @__PURE__ */ "width.height.top.right.bottom.left.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.font-size.line-height.letter-spacing.word-spacing.min-width.min-height.max-width.max-height.flex-basis.grid-gap.grid-row-gap.grid-column-gap".split("."), a;
|
|
6
|
+
a = typeof n == "number" && n !== 0 && i.includes(r) ? `${n}px` : String(n), t.style.setProperty(r, a);
|
|
7
|
+
});
|
|
43
8
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
height: h.height
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
f as getElementPagePosition
|
|
9
|
+
var t = (t, n, r, i, a) => {
|
|
10
|
+
let o = "center";
|
|
11
|
+
switch (i) {
|
|
12
|
+
case 90:
|
|
13
|
+
o = `${t.width / 2}px ${t.width / 2}px`;
|
|
14
|
+
break;
|
|
15
|
+
case -90:
|
|
16
|
+
case 270:
|
|
17
|
+
o = `${t.height / 2}px ${t.height / 2}px`;
|
|
18
|
+
break;
|
|
19
|
+
default: o = "center";
|
|
20
|
+
}
|
|
21
|
+
let s = document.createElement("div");
|
|
22
|
+
s.id = "parent-element", s.style.width = `${t.width}px`, s.style.height = `${t.height}px`, s.style.setProperty("--scale-factor", a.toString()), s.style.setProperty("--rotation", i.toString()), s.style.setProperty("--transform-origin", o), s.style.left = "-99999px", s.style.visibility = "hidden", s.style.position = "absolute";
|
|
23
|
+
let c = document.createElement("div");
|
|
24
|
+
c.style.position = "relative", c.style.width = "100%", c.style.height = "100%", s.appendChild(c);
|
|
25
|
+
let l;
|
|
26
|
+
if (r instanceof HTMLElement) l = r.cloneNode(!0), c.appendChild(l);
|
|
27
|
+
else {
|
|
28
|
+
let t = r.props;
|
|
29
|
+
l = document.createElement("div"), t.style && e(t.style, l), t.className && (l.className = t.className), c.appendChild(l);
|
|
30
|
+
}
|
|
31
|
+
n.appendChild(s);
|
|
32
|
+
let u = s.getBoundingClientRect(), d = l.getBoundingClientRect();
|
|
33
|
+
n.removeChild(s);
|
|
34
|
+
let f = {
|
|
35
|
+
top: n.clientHeight / 2,
|
|
36
|
+
left: n.clientWidth / 2
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
left: d.left - u.left - f.left,
|
|
40
|
+
top: d.top - u.top - f.top,
|
|
41
|
+
width: d.width,
|
|
42
|
+
height: d.height
|
|
43
|
+
};
|
|
84
44
|
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { t as getElementPagePosition };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
//#region lib/utils/getScrollDistance.ts
|
|
2
|
+
var e = (e, t) => e.slice(0, t).reduce((e, t) => e + t, 0);
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as getScrollDistance };
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
//#region lib/utils/getThumbnailViewport.ts
|
|
2
|
+
var e = 100, t = (t, n = 0) => {
|
|
3
|
+
let r = e / t.getViewport({ scale: 1 }).width;
|
|
4
|
+
return {
|
|
5
|
+
scale: r,
|
|
6
|
+
thumbnailViewport: t.getViewport({
|
|
7
|
+
scale: r,
|
|
8
|
+
rotation: n
|
|
9
|
+
})
|
|
10
|
+
};
|
|
7
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as getThumbnailViewport };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
a as getWordPositionInPage
|
|
1
|
+
//#region lib/utils/getWordPositionInPage.ts
|
|
2
|
+
var e = (e, t, n, r, i) => {
|
|
3
|
+
let a = n.height * r, o = n.width * r, s = n.bottom * r, c = n.left * r, l = {
|
|
4
|
+
width: i % 180 == 90 ? e.height : e.width,
|
|
5
|
+
height: i % 180 == 90 ? e.width : e.height
|
|
6
|
+
}, u = {
|
|
7
|
+
width: i % 180 == 90 ? a : o,
|
|
8
|
+
height: i % 180 == 90 ? o : a
|
|
9
|
+
}, d = document.createElement("div");
|
|
10
|
+
d.style.width = `${l.width}px`, d.style.height = `${l.height}px`, d.style.position = "absolute", d.style.transform = `rotate(${i}deg)`, d.style.transformOrigin = "center center", d.style.visibility = "hidden", d.style.left = "-99999px";
|
|
11
|
+
let f = document.createElement("div");
|
|
12
|
+
f.style.position = "absolute", f.style.width = `${o}px`, f.style.height = `${a}px`, f.style.position = "absolute", f.style.bottom = `${s}px`, f.style.left = `${c}px`, d.appendChild(f), t.appendChild(d);
|
|
13
|
+
let p = d.getBoundingClientRect(), m = f.getBoundingClientRect();
|
|
14
|
+
t.removeChild(d);
|
|
15
|
+
let h = {
|
|
16
|
+
top: t.clientHeight / 2,
|
|
17
|
+
left: t.clientWidth / 2
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
leftInPage: m.left - p.left - h.left + u.width / 2,
|
|
21
|
+
topInPage: m.top - p.top - h.top + u.height / 2
|
|
22
|
+
};
|
|
25
23
|
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { e as getWordPositionInPage };
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
case r.PAGE_WIDTH:
|
|
16
|
-
return Math.floor((t - a) / n * 100);
|
|
17
|
-
case r.ACTUAL:
|
|
18
|
-
default:
|
|
19
|
-
return 100;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
E as getZoomLevel
|
|
1
|
+
import { ViewMode as e, ZoomLevel as t } from "./types.js";
|
|
2
|
+
import "./constants.js";
|
|
3
|
+
//#region lib/utils/getZoomLevel.ts
|
|
4
|
+
var n = (n, r, i, a, o, s) => {
|
|
5
|
+
if (typeof n == "number") return n;
|
|
6
|
+
let c = s === e.DUAL_PAGE || s === e.DUAL_PAGE_WITH_COVER ? 2 * a : a;
|
|
7
|
+
switch (n) {
|
|
8
|
+
case t.PAGE_FIT:
|
|
9
|
+
let e = Math.min((r - 20) / c, (i - 4) / o);
|
|
10
|
+
return Math.floor(e * 100);
|
|
11
|
+
case t.PAGE_WIDTH: return Math.floor((r - 20) / c * 100);
|
|
12
|
+
case t.ACTUAL:
|
|
13
|
+
default: return 100;
|
|
14
|
+
}
|
|
24
15
|
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as getZoomLevel };
|