@react-pdf-kit/viewer 2.6.0-beta.2 → 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 -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,131 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
import "../../contexts/ElementPageContext.js";
|
|
66
|
-
import "../../contexts/LicenseContext.js";
|
|
67
|
-
import "../../utils/hooks/useLicense.js";
|
|
68
|
-
import "../../utils/getElementPositionInPage.js";
|
|
69
|
-
import "../../utils/withRef.js";
|
|
70
|
-
const Et = b(({ widths: o, heights: a }) => {
|
|
71
|
-
const { focusedPage: l, totalPages: m } = y(), i = f(() => {
|
|
72
|
-
const t = [];
|
|
73
|
-
if (l === 1)
|
|
74
|
-
return t.push(1), t;
|
|
75
|
-
const r = l - 1, e = Math.ceil(r / 2) * 2;
|
|
76
|
-
return t.push(e), e + 1 <= m && t.push(e + 1), t;
|
|
77
|
-
}, [l, m]), W = f(() => {
|
|
78
|
-
if (i.length === 1) {
|
|
79
|
-
const P = i[0] - 1, p = o(P);
|
|
80
|
-
let n = p * 2;
|
|
81
|
-
if (m >= 3) {
|
|
82
|
-
const s = o(1), d = o(2);
|
|
83
|
-
n = s + d;
|
|
84
|
-
} else if (m >= 2) {
|
|
85
|
-
const s = o(1);
|
|
86
|
-
n = p + s;
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
width: n,
|
|
90
|
-
position: "relative",
|
|
91
|
-
display: "flex",
|
|
92
|
-
justifyContent: "center",
|
|
93
|
-
alignItems: "flex-start"
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
const r = i[0] - 1, g = o(r), e = i.length > 1 ? o(r + 1) : 0;
|
|
97
|
-
return {
|
|
98
|
-
width: g + e,
|
|
99
|
-
position: "relative"
|
|
100
|
-
};
|
|
101
|
-
}, [o, i, m]), x = f(() => {
|
|
102
|
-
if (i.length === 1) {
|
|
103
|
-
const p = i[0], n = p - 1, s = a(p === 1 ? 0 : Math.floor((p - 2) / 2) + 1);
|
|
104
|
-
return [{
|
|
105
|
-
width: o(n),
|
|
106
|
-
height: s,
|
|
107
|
-
position: "relative"
|
|
108
|
-
// Use relative for flexbox centering
|
|
109
|
-
}];
|
|
110
|
-
}
|
|
111
|
-
const t = i[0], r = t - 1, g = Math.floor((t - 2) / 2) + 1, e = a(g), c = o(r), u = o(r + 1);
|
|
112
|
-
return [
|
|
113
|
-
{
|
|
114
|
-
position: "absolute",
|
|
115
|
-
left: 0,
|
|
116
|
-
width: c,
|
|
117
|
-
height: e
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
position: "absolute",
|
|
121
|
-
left: c,
|
|
122
|
-
width: u,
|
|
123
|
-
height: e
|
|
124
|
-
}
|
|
125
|
-
];
|
|
126
|
-
}, [o, a, i]);
|
|
127
|
-
return /* @__PURE__ */ h("div", { style: W, children: i.map((t, r) => /* @__PURE__ */ h(I, { style: x[r], pageNumber: t }, t)) });
|
|
1
|
+
import { r as e } from "../../PaginationContext--n91mIJ4.js";
|
|
2
|
+
import { t } from "../../RPPage-BuSGUFzw.js";
|
|
3
|
+
import { memo as n, useMemo as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region lib/components/page/DualPageWithCover.tsx
|
|
6
|
+
var a = n(({ widths: n, heights: a }) => {
|
|
7
|
+
let { focusedPage: o, totalPages: s } = e(), c = r(() => {
|
|
8
|
+
let e = [];
|
|
9
|
+
if (o === 1) return e.push(1), e;
|
|
10
|
+
let t = o - 1, n = Math.ceil(t / 2) * 2;
|
|
11
|
+
return e.push(n), n + 1 <= s && e.push(n + 1), e;
|
|
12
|
+
}, [o, s]), l = r(() => {
|
|
13
|
+
if (c.length === 1) {
|
|
14
|
+
let e = n(c[0] - 1), t = e * 2;
|
|
15
|
+
return s >= 3 ? t = n(1) + n(2) : s >= 2 && (t = e + n(1)), {
|
|
16
|
+
width: t,
|
|
17
|
+
position: "relative",
|
|
18
|
+
display: "flex",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
alignItems: "flex-start"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
let e = c[0] - 1;
|
|
24
|
+
return {
|
|
25
|
+
width: n(e) + (c.length > 1 ? n(e + 1) : 0),
|
|
26
|
+
position: "relative"
|
|
27
|
+
};
|
|
28
|
+
}, [
|
|
29
|
+
n,
|
|
30
|
+
c,
|
|
31
|
+
s
|
|
32
|
+
]), u = r(() => {
|
|
33
|
+
if (c.length === 1) {
|
|
34
|
+
let e = c[0], t = e - 1, r = a(e === 1 ? 0 : Math.floor((e - 2) / 2) + 1);
|
|
35
|
+
return [{
|
|
36
|
+
width: n(t),
|
|
37
|
+
height: r,
|
|
38
|
+
position: "relative"
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
let e = c[0], t = e - 1, r = a(Math.floor((e - 2) / 2) + 1), i = n(t), o = n(t + 1);
|
|
42
|
+
return [{
|
|
43
|
+
position: "absolute",
|
|
44
|
+
left: 0,
|
|
45
|
+
width: i,
|
|
46
|
+
height: r
|
|
47
|
+
}, {
|
|
48
|
+
position: "absolute",
|
|
49
|
+
left: i,
|
|
50
|
+
width: o,
|
|
51
|
+
height: r
|
|
52
|
+
}];
|
|
53
|
+
}, [
|
|
54
|
+
n,
|
|
55
|
+
a,
|
|
56
|
+
c
|
|
57
|
+
]);
|
|
58
|
+
return /* @__PURE__ */ i("div", {
|
|
59
|
+
style: l,
|
|
60
|
+
children: c.map((e, n) => /* @__PURE__ */ i(t, {
|
|
61
|
+
style: u[n],
|
|
62
|
+
pageNumber: e
|
|
63
|
+
}, e))
|
|
64
|
+
});
|
|
128
65
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { a as DualPageWithCover };
|
|
@@ -1,143 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useDocumentContext as b } from "../../contexts/RPDocumentContext.js";
|
|
4
|
-
import { CanvasLayer as j } from "./CanvasLayer.js";
|
|
5
|
-
import { TextLayer as E } from "./TextLayer.js";
|
|
6
|
-
import { AnnotationLayer as H } from "./AnnotationLayer.js";
|
|
7
|
-
import { useLayerContext as I } from "../../contexts/LayerContext.js";
|
|
8
|
-
import { useZoomContext as T } from "../../contexts/ZoomContext.js";
|
|
9
|
-
import { useLoaderContext as Z } from "../../contexts/LoaderContext.js";
|
|
10
|
-
import { TextHighlightLayer as A } from "./TextHighlightLayer.js";
|
|
11
|
-
import { usePagesRotateContext as D } from "../../contexts/PagesRotateContext.js";
|
|
12
|
-
import { CustomElement as M } from "./CustomElement.js";
|
|
13
|
-
import { withRef as O } from "../../utils/withRef.js";
|
|
14
|
-
import "../../utils/hooks/useLoadPdf.js";
|
|
15
|
-
import "pdfjs-dist";
|
|
16
|
-
import "../../utils/types.js";
|
|
17
|
-
import "../../de_DE-8145915f.js";
|
|
18
|
-
import "../../utils/getThumbnailViewport.js";
|
|
19
|
-
import "../../contexts/ConfigContext.js";
|
|
20
|
-
import "../../contexts/DocumentPasswordContext.js";
|
|
21
|
-
import "../../utils/appConsole.js";
|
|
22
|
-
import "../../utils/const.js";
|
|
23
|
-
import "../../utils/hooks/usePdfProperties.js";
|
|
24
|
-
import "../../utils/convertPdfDate.js";
|
|
25
|
-
import "../../utils/formatFileSize.js";
|
|
26
|
-
import "../../contexts/RenderQueueProvider.js";
|
|
27
|
-
import "../../utils/Queue.js";
|
|
28
|
-
import "../../utils/renderPage.js";
|
|
29
|
-
import "../../PaginationContext-87f832f2.js";
|
|
30
|
-
import "../../contexts/ScrollModeContext.js";
|
|
31
|
-
import "../../contexts/InitialStateContext.js";
|
|
32
|
-
import "../../contexts/GlobalCurrentPage.js";
|
|
33
|
-
import "../../contexts/EventCallbackContext.js";
|
|
34
|
-
import "../../contexts/ViewModeContext.js";
|
|
35
|
-
import "../../contexts/VirtualScrollContext.js";
|
|
36
|
-
import "../../contexts/VirtualGridContext.js";
|
|
37
|
-
import "../../utils/smoothScrollTo.js";
|
|
38
|
-
import "../../contexts/DimensionPagesContext.js";
|
|
39
|
-
import "../../utils/constants.js";
|
|
40
|
-
import "../../utils/getZoomLevel.js";
|
|
41
|
-
import "../../contexts/LayoutContainerContext.js";
|
|
42
|
-
import "../../contexts/RotationContext.js";
|
|
43
|
-
import "../../utils/hooks/useDebounce.js";
|
|
44
|
-
import "../../contexts/SmoothScrollContext.js";
|
|
45
|
-
import "../../utils/getScrollDistance.js";
|
|
46
|
-
import "../../utils/calculatePage.js";
|
|
47
|
-
import "../../utils/highlight.js";
|
|
48
|
-
import "../../utils/charators.js";
|
|
49
|
-
import "../../contexts/SearchContext.js";
|
|
50
|
-
import "../../utils/hooks/useSearch.js";
|
|
51
|
-
import "../../utils/getWordPositionInPage.js";
|
|
52
|
-
import "../../contexts/PrintContext.js";
|
|
53
|
-
import "../../utils/hooks/usePrint.js";
|
|
54
|
-
import "../../utils/link_service.js";
|
|
55
|
-
import "../../utils/annotations.js";
|
|
56
|
-
import "../../utils/sanitizeExternalUrl.js";
|
|
57
|
-
import "../../utils/dateFormatter.js";
|
|
58
|
-
import "../../utils/hooks/useFileDownload.js";
|
|
59
|
-
import "../../contexts/DownloadContext.js";
|
|
60
|
-
import "../icons/LoaderIcon.js";
|
|
61
|
-
import "../../clsx-0c6e471a.js";
|
|
62
|
-
import "../../contexts/HighlightContext.js";
|
|
63
|
-
import "../../utils/hooks/useHighlight.js";
|
|
64
|
-
import "./searchHighlight.js";
|
|
65
|
-
import "../../contexts/ElementPageContext.js";
|
|
66
|
-
import "../../contexts/LicenseContext.js";
|
|
67
|
-
import "../../utils/hooks/useLicense.js";
|
|
68
|
-
import "../../utils/getElementPositionInPage.js";
|
|
69
|
-
const a = {
|
|
70
|
-
"rp-page-wrapper": "_rp-page-wrapper_krysr_1",
|
|
71
|
-
"rp-page": "_rp-page_krysr_1",
|
|
72
|
-
"rp-loader-wrapper": "_rp-loader-wrapper_krysr_17"
|
|
73
|
-
}, tt = O((h, w) => {
|
|
74
|
-
const { pageNumber: r, style: x, ...L } = h, { pages: p } = b(), { pageRotate: s } = D(), { textLayer: y } = I(), { currentZoom: m } = T(), { LoaderImageComponent: n } = Z(), i = u(p.get(r)), [$, c] = l(!1), g = u(null), [t, v] = l({
|
|
75
|
-
width: 0,
|
|
76
|
-
height: 0
|
|
77
|
-
});
|
|
78
|
-
P(w, () => g.current);
|
|
79
|
-
const e = d(() => i.current ? s[r] : 0, [r, s]);
|
|
80
|
-
V(() => {
|
|
81
|
-
if (p && (i.current = p.get(r), i.current)) {
|
|
82
|
-
const k = i.current.page.getViewport({
|
|
83
|
-
scale: m,
|
|
84
|
-
rotation: e
|
|
85
|
-
});
|
|
86
|
-
v(k);
|
|
87
|
-
}
|
|
88
|
-
}, [p, r, e, m]);
|
|
89
|
-
const C = d(() => {
|
|
90
|
-
switch (e) {
|
|
91
|
-
case 90:
|
|
92
|
-
return `${t.width / 2}px ${t.width / 2}px`;
|
|
93
|
-
case -90:
|
|
94
|
-
case 270:
|
|
95
|
-
return `${t.height / 2}px ${t.height / 2}px`;
|
|
96
|
-
default:
|
|
97
|
-
return "center";
|
|
98
|
-
}
|
|
99
|
-
}, [e, t]), _ = f(() => {
|
|
100
|
-
c(!0);
|
|
101
|
-
}, []), R = f(() => {
|
|
102
|
-
c(!1);
|
|
103
|
-
}, []);
|
|
104
|
-
return /* @__PURE__ */ o(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
ref: g,
|
|
108
|
-
id: `page-${r}`,
|
|
109
|
-
"data-rp": `page-${r}`,
|
|
110
|
-
...L,
|
|
111
|
-
style: {
|
|
112
|
-
...x,
|
|
113
|
-
"--rp-rotate": `${e}deg`,
|
|
114
|
-
"--rp-page-rotate-translate": `${C}`,
|
|
115
|
-
"--user-unit": t.userUnit || 1,
|
|
116
|
-
"--scale-factor": m,
|
|
117
|
-
"--total-scale-factor": "calc(var(--scale-factor) * var(--user-unit))"
|
|
118
|
-
},
|
|
119
|
-
className: a["rp-page-wrapper"],
|
|
120
|
-
children: /* @__PURE__ */ N(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
style: {
|
|
124
|
-
width: `${t.width}px`,
|
|
125
|
-
height: `${t.height}px`
|
|
126
|
-
},
|
|
127
|
-
className: a["rp-page"],
|
|
128
|
-
children: [
|
|
129
|
-
/* @__PURE__ */ o(j, { onLoading: _, onLoaded: R, pageNumber: r }),
|
|
130
|
-
$ && n && /* @__PURE__ */ o("div", { className: a["rp-loader-wrapper"], children: /* @__PURE__ */ o(n, {}) }),
|
|
131
|
-
/* @__PURE__ */ o(M, { pageNumber: r }),
|
|
132
|
-
y && /* @__PURE__ */ o(E, { pageNumber: r }),
|
|
133
|
-
/* @__PURE__ */ o(A, { pageNumber: r, viewport: t }),
|
|
134
|
-
/* @__PURE__ */ o(H, { pageNumber: r })
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
});
|
|
141
|
-
export {
|
|
142
|
-
tt as RPPage
|
|
143
|
-
};
|
|
1
|
+
import { t as e } from "../../RPPage-BuSGUFzw.js";
|
|
2
|
+
export { e as RPPage };
|
|
@@ -1,89 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import "../../contexts/DimensionPagesContext.js";
|
|
27
|
-
import "../../contexts/ZoomContext.js";
|
|
28
|
-
import "../../utils/constants.js";
|
|
29
|
-
import "../../utils/getZoomLevel.js";
|
|
30
|
-
import "../../contexts/LayoutContainerContext.js";
|
|
31
|
-
import "../../contexts/RotationContext.js";
|
|
32
|
-
import "../../utils/hooks/useDebounce.js";
|
|
33
|
-
import "../../contexts/PagesRotateContext.js";
|
|
34
|
-
import "../../contexts/SmoothScrollContext.js";
|
|
35
|
-
import "../../utils/getScrollDistance.js";
|
|
36
|
-
import "../../utils/calculatePage.js";
|
|
37
|
-
import "./CanvasLayer.js";
|
|
38
|
-
import "../../contexts/RenderQueueProvider.js";
|
|
39
|
-
import "../../utils/Queue.js";
|
|
40
|
-
import "../../utils/renderPage.js";
|
|
41
|
-
import "./TextLayer.js";
|
|
42
|
-
import "../../utils/highlight.js";
|
|
43
|
-
import "../../utils/charators.js";
|
|
44
|
-
import "../../contexts/SearchContext.js";
|
|
45
|
-
import "../../utils/hooks/useSearch.js";
|
|
46
|
-
import "../../utils/getWordPositionInPage.js";
|
|
47
|
-
import "./AnnotationLayer.js";
|
|
48
|
-
import "../../contexts/PrintContext.js";
|
|
49
|
-
import "../../utils/hooks/usePrint.js";
|
|
50
|
-
import "../../utils/link_service.js";
|
|
51
|
-
import "../../utils/annotations.js";
|
|
52
|
-
import "../../utils/sanitizeExternalUrl.js";
|
|
53
|
-
import "../../utils/dateFormatter.js";
|
|
54
|
-
import "../../utils/hooks/useFileDownload.js";
|
|
55
|
-
import "../../contexts/DownloadContext.js";
|
|
56
|
-
import "../../contexts/LayerContext.js";
|
|
57
|
-
import "../../contexts/LoaderContext.js";
|
|
58
|
-
import "../icons/LoaderIcon.js";
|
|
59
|
-
import "../../clsx-0c6e471a.js";
|
|
60
|
-
import "./TextHighlightLayer.js";
|
|
61
|
-
import "../../contexts/HighlightContext.js";
|
|
62
|
-
import "../../utils/hooks/useHighlight.js";
|
|
63
|
-
import "./searchHighlight.js";
|
|
64
|
-
import "./CustomElement.js";
|
|
65
|
-
import "../../contexts/ElementPageContext.js";
|
|
66
|
-
import "../../contexts/LicenseContext.js";
|
|
67
|
-
import "../../utils/hooks/useLicense.js";
|
|
68
|
-
import "../../utils/getElementPositionInPage.js";
|
|
69
|
-
import "../../utils/withRef.js";
|
|
70
|
-
const Ro = ({ widths: t, heights: r }) => {
|
|
71
|
-
const { focusedPage: o } = n(), p = m(() => ({
|
|
72
|
-
position: "absolute",
|
|
73
|
-
width: t(o - 1),
|
|
74
|
-
height: r(o - 1)
|
|
75
|
-
}), [t, r, o]), e = m(() => t(o - 1), [t]);
|
|
76
|
-
return /* @__PURE__ */ i(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
style: {
|
|
80
|
-
width: e,
|
|
81
|
-
position: "relative"
|
|
82
|
-
},
|
|
83
|
-
children: /* @__PURE__ */ i(s, { style: p, pageNumber: o }, o)
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
export {
|
|
88
|
-
Ro as SinglePage
|
|
1
|
+
import { r as e } from "../../PaginationContext--n91mIJ4.js";
|
|
2
|
+
import { t } from "../../RPPage-BuSGUFzw.js";
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region lib/components/page/SinglePage.tsx
|
|
6
|
+
var i = ({ widths: i, heights: a }) => {
|
|
7
|
+
let { focusedPage: o } = e(), s = n(() => ({
|
|
8
|
+
position: "absolute",
|
|
9
|
+
width: i(o - 1),
|
|
10
|
+
height: a(o - 1)
|
|
11
|
+
}), [
|
|
12
|
+
i,
|
|
13
|
+
a,
|
|
14
|
+
o
|
|
15
|
+
]);
|
|
16
|
+
return /* @__PURE__ */ r("div", {
|
|
17
|
+
style: {
|
|
18
|
+
width: n(() => i(o - 1), [i]),
|
|
19
|
+
position: "relative"
|
|
20
|
+
},
|
|
21
|
+
children: /* @__PURE__ */ r(t, {
|
|
22
|
+
style: s,
|
|
23
|
+
pageNumber: o
|
|
24
|
+
}, o)
|
|
25
|
+
});
|
|
89
26
|
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { i as SinglePage };
|
|
@@ -1,198 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useDocumentContext as U } from "../../contexts/RPDocumentContext.js";
|
|
4
|
-
import { useHighlightContext as V } from "../../contexts/HighlightContext.js";
|
|
5
|
-
import { normalizeSingleKeyword as Y, sortHighlightPosition as Z, unwrap as tt } from "./searchHighlight.js";
|
|
6
|
-
import { isMatchEntireWord as et } from "../../utils/highlight.js";
|
|
7
|
-
import "../../utils/hooks/useLoadPdf.js";
|
|
8
|
-
import "pdfjs-dist";
|
|
9
|
-
import "../../utils/types.js";
|
|
10
|
-
import "../../de_DE-8145915f.js";
|
|
11
|
-
import "../../utils/getThumbnailViewport.js";
|
|
12
|
-
import "../../contexts/ConfigContext.js";
|
|
13
|
-
import "../../contexts/DocumentPasswordContext.js";
|
|
14
|
-
import "../../utils/appConsole.js";
|
|
15
|
-
import "../../utils/const.js";
|
|
16
|
-
import "../../utils/hooks/usePdfProperties.js";
|
|
17
|
-
import "../../utils/convertPdfDate.js";
|
|
18
|
-
import "../../utils/formatFileSize.js";
|
|
19
|
-
import "../../utils/hooks/useHighlight.js";
|
|
20
|
-
import "../../utils/charators.js";
|
|
21
|
-
const nt = {
|
|
22
|
-
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
23
|
-
}, Tt = ({ pageNumber: w, viewport: O }) => {
|
|
24
|
-
const [$, v] = A(), { pages: R } = U(), { highlightKeywords: d } = V(), M = !0, C = N(null), [P, q] = A(null), [_, b] = A([]);
|
|
25
|
-
H(() => {
|
|
26
|
-
C.current && q(C.current.parentElement);
|
|
27
|
-
}, [C]), H(() => {
|
|
28
|
-
(async () => {
|
|
29
|
-
const e = R.get(w);
|
|
30
|
-
if (!e || !C.current)
|
|
31
|
-
return;
|
|
32
|
-
const n = await e.page.getTextContent();
|
|
33
|
-
v(n);
|
|
34
|
-
})();
|
|
35
|
-
}, [R, w]);
|
|
36
|
-
const j = Q(() => d ? d.map((t) => {
|
|
37
|
-
var e, n;
|
|
38
|
-
return {
|
|
39
|
-
...Y(t.keyword, (e = t.options) == null ? void 0 : e.matchCase, (n = t.options) == null ? void 0 : n.wholeWords),
|
|
40
|
-
color: t.highlightColor
|
|
41
|
-
};
|
|
42
|
-
}) : [], [d]);
|
|
43
|
-
function D(t, e) {
|
|
44
|
-
if (!t)
|
|
45
|
-
return;
|
|
46
|
-
const n = `[data-rp="page-${e}-textLayer"]`;
|
|
47
|
-
return new Promise((r) => {
|
|
48
|
-
const s = t.querySelector(n);
|
|
49
|
-
if (s) {
|
|
50
|
-
r(s);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
new MutationObserver((i, c) => {
|
|
54
|
-
const l = t.querySelector(n);
|
|
55
|
-
l && (r(l), c.disconnect());
|
|
56
|
-
}).observe(t, { childList: !0, subtree: !0 });
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function K(t) {
|
|
60
|
-
return new Promise((e) => {
|
|
61
|
-
const n = t.querySelectorAll(
|
|
62
|
-
'[data-rp="rp-text-layer-text"]'
|
|
63
|
-
);
|
|
64
|
-
if (n.length) {
|
|
65
|
-
e(Array.from(n));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
new MutationObserver((s, o) => {
|
|
69
|
-
const i = t.querySelectorAll(
|
|
70
|
-
".rp-text-layer-text"
|
|
71
|
-
);
|
|
72
|
-
i.length && (e(Array.from(i)), o.disconnect());
|
|
73
|
-
}).observe(t, { childList: !0, subtree: !0 });
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
const W = (t, e, n, r) => {
|
|
77
|
-
var I;
|
|
78
|
-
const s = document.createRange(), o = n.firstChild;
|
|
79
|
-
if (!o || o.nodeType !== Node.TEXT_NODE)
|
|
80
|
-
return null;
|
|
81
|
-
const i = ((I = o.textContent) == null ? void 0 : I.length) ?? 0, c = r[0].charIdxInSpan, l = r.length === 1 ? c : r[r.length - 1].charIdxInSpan;
|
|
82
|
-
if (c > i || l + 1 > i)
|
|
83
|
-
return null;
|
|
84
|
-
s.setStart(o, c), s.setEnd(o, l + 1);
|
|
85
|
-
const h = document.createElement("span");
|
|
86
|
-
h.style.width = "auto", s.surroundContents(h);
|
|
87
|
-
const a = h.getBoundingClientRect(), f = t.getBoundingClientRect(), m = f.height, p = f.width, x = 100 * (a.left - f.left) / p, E = 100 * (a.top - f.top) / m, S = 100 * a.height / m, g = 100 * a.width / p;
|
|
88
|
-
return tt(h), {
|
|
89
|
-
keywordStr: e,
|
|
90
|
-
left: x,
|
|
91
|
-
top: E,
|
|
92
|
-
height: S,
|
|
93
|
-
width: g,
|
|
94
|
-
pageHeight: m,
|
|
95
|
-
pageWidth: p
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
async function z(t, e) {
|
|
99
|
-
const n = await D(P, t);
|
|
100
|
-
if (!n)
|
|
101
|
-
return;
|
|
102
|
-
const r = await K(n);
|
|
103
|
-
if (r.length) {
|
|
104
|
-
const s = r.map((i) => i.tagName === "BR" ? " " : i.textContent).reduce(
|
|
105
|
-
(i, c, l) => i.concat(
|
|
106
|
-
c.split("").map((h, a) => ({
|
|
107
|
-
char: h,
|
|
108
|
-
charIdxInSpan: a,
|
|
109
|
-
spanIdx: l
|
|
110
|
-
}))
|
|
111
|
-
),
|
|
112
|
-
[
|
|
113
|
-
{
|
|
114
|
-
char: "",
|
|
115
|
-
charIdxInSpan: 0,
|
|
116
|
-
spanIdx: 0
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
).slice(1), o = B(n, e, r, s);
|
|
120
|
-
b(o);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const B = (t, e, n, r) => {
|
|
124
|
-
const s = e.length;
|
|
125
|
-
if (!r.length || !s)
|
|
126
|
-
return [];
|
|
127
|
-
const o = [], i = r.map((c) => c.char).join("");
|
|
128
|
-
return j.forEach((c) => {
|
|
129
|
-
const { keyword: l, regExp: h, wholeWords: a, color: f } = c, m = l;
|
|
130
|
-
if (!m.trim())
|
|
131
|
-
return;
|
|
132
|
-
const p = h.flags.indexOf("g") === -1 ? new RegExp(h, `${h.flags}g`) : h;
|
|
133
|
-
let x;
|
|
134
|
-
const E = [];
|
|
135
|
-
for (; (x = p.exec(i)) !== null; )
|
|
136
|
-
a && !et(i, x.index, x[0].length) || E.push({
|
|
137
|
-
keyword: p,
|
|
138
|
-
startIndex: x.index,
|
|
139
|
-
endIndex: p.lastIndex
|
|
140
|
-
});
|
|
141
|
-
const S = E.map((g) => ({
|
|
142
|
-
keyword: g.keyword,
|
|
143
|
-
indexes: r.slice(g.startIndex, g.endIndex),
|
|
144
|
-
color: f
|
|
145
|
-
}));
|
|
146
|
-
for (const g of S) {
|
|
147
|
-
const I = g.indexes.reduce(
|
|
148
|
-
(u, y) => (u[y.spanIdx] = (u[y.spanIdx] || []).concat([y]), u),
|
|
149
|
-
{}
|
|
150
|
-
);
|
|
151
|
-
for (const u of Object.values(I))
|
|
152
|
-
if (u.length !== 1 || u[0].char.trim() !== "") {
|
|
153
|
-
const y = u, F = n[y[0].spanIdx], T = W(
|
|
154
|
-
t,
|
|
155
|
-
m,
|
|
156
|
-
F,
|
|
157
|
-
y
|
|
158
|
-
);
|
|
159
|
-
if (T) {
|
|
160
|
-
const { left: X, top: G } = T;
|
|
161
|
-
if (o.find((L) => L.left === X && L.top === G))
|
|
162
|
-
continue;
|
|
163
|
-
o.push({ ...T, highlightColor: g.color });
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}), o.sort(Z), o;
|
|
168
|
-
};
|
|
169
|
-
return H(() => {
|
|
170
|
-
(async () => {
|
|
171
|
-
if (!d || d.length === 0) {
|
|
172
|
-
b([]);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
try {
|
|
176
|
-
await z(w, d);
|
|
177
|
-
} catch (e) {
|
|
178
|
-
console.error(e);
|
|
179
|
-
}
|
|
180
|
-
})();
|
|
181
|
-
}, [M, d, w, $, O]), /* @__PURE__ */ k(J, { children: /* @__PURE__ */ k("div", { ref: C, "data-rp": `page-${w}-textHighlightLayer`, children: _.map((t, e) => /* @__PURE__ */ k(
|
|
182
|
-
"div",
|
|
183
|
-
{
|
|
184
|
-
className: nt["rp-text-highlight"],
|
|
185
|
-
style: {
|
|
186
|
-
top: `${t.top}%`,
|
|
187
|
-
left: `${t.left}%`,
|
|
188
|
-
width: `${t.width}%`,
|
|
189
|
-
height: `${t.height}%`,
|
|
190
|
-
backgroundColor: t.highlightColor
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
e
|
|
194
|
-
)) }) });
|
|
195
|
-
};
|
|
196
|
-
export {
|
|
197
|
-
Tt as TextHighlightLayer
|
|
198
|
-
};
|
|
1
|
+
import { t as e } from "../../TextHighlightLayer-BSVgBxR3.js";
|
|
2
|
+
export { e as TextHighlightLayer };
|