@pdf-viewer/react 0.4.0-beta.1
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/README.md +3 -0
- package/dist/Container.module-cb7b45b9.js +14 -0
- package/dist/RPSplitter.module-13d612c4.js +7 -0
- package/dist/RPTheme.module-f756e5cd.js +7 -0
- package/dist/Thumbnails-06fa1aa5.js +2657 -0
- package/dist/WrapperLayout.module-147bc943.js +6 -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/DropDown.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/LoaderIcon.css +1 -0
- package/dist/assets/MenuItem.css +1 -0
- package/dist/assets/MenuSeparator.css +1 -0
- package/dist/assets/PropertyItem.css +1 -0
- package/dist/assets/RPSplitter.css +1 -0
- package/dist/assets/RPTheme.css +1 -0
- package/dist/assets/RotateTool.css +1 -0
- package/dist/assets/Thumbnails.css +1 -0
- package/dist/assets/WrapperLayout.css +1 -0
- package/dist/clsx-0c6e471a.js +22 -0
- package/dist/components/RPConfig.js +1347 -0
- package/dist/components/RPController.js +49 -0
- package/dist/components/RPDocument.js +9 -0
- package/dist/components/RPDropFileZone.js +33 -0
- package/dist/components/RPTheme.js +21 -0
- package/dist/components/RPViewer.js +37 -0
- package/dist/components/icons/CheckIcon.js +22 -0
- package/dist/components/icons/ChevronUpIcon.js +22 -0
- package/dist/components/icons/ClearIcon.js +25 -0
- package/dist/components/icons/ClockwiseIcon.js +22 -0
- package/dist/components/icons/CloseIcon.js +22 -0
- package/dist/components/icons/DarkPdfIcon.js +15 -0
- package/dist/components/icons/DualPageIcon.js +22 -0
- package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
- package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
- package/dist/components/icons/FullScreenIcon.js +22 -0
- package/dist/components/icons/GoToDownIcon.js +22 -0
- package/dist/components/icons/HandModeDefaultIcon.js +22 -0
- package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
- package/dist/components/icons/InfoIcon.js +22 -0
- package/dist/components/icons/LightPdfIcon.js +15 -0
- package/dist/components/icons/LoaderIcon.js +17 -0
- package/dist/components/icons/MoonIcon.js +22 -0
- package/dist/components/icons/PageScrollingIcon.js +24 -0
- package/dist/components/icons/PrintDefaultIcon.js +23 -0
- package/dist/components/icons/SearchIcon.js +22 -0
- package/dist/components/icons/SinglePageIcon.js +22 -0
- package/dist/components/icons/SunIcon.js +25 -0
- package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
- package/dist/components/icons/ThreeDotIcon.js +22 -0
- package/dist/components/icons/Thumbnail.js +54 -0
- package/dist/components/icons/VerticalScrollingIcon.js +24 -0
- package/dist/components/icons/WrappedScrollingIcon.js +24 -0
- package/dist/components/icons/ZoomInIcon.js +22 -0
- package/dist/components/icons/ZoomOutIcon.js +22 -0
- package/dist/components/layout/Container.js +28 -0
- package/dist/components/layout/RPLayout.js +59 -0
- package/dist/components/layout/WrapperLayout.js +11 -0
- package/dist/components/layout/sidebar/RPSidebar.js +34 -0
- package/dist/components/layout/sidebar/RPSplitter.js +10 -0
- package/dist/components/layout/sidebar/Thumbnail.js +8 -0
- package/dist/components/layout/sidebar/Thumbnails.js +7 -0
- package/dist/components/layout/toolbar/DarkModeTool.js +23 -0
- package/dist/components/layout/toolbar/DocumentDialog.js +36 -0
- package/dist/components/layout/toolbar/DocumentProperties.js +19 -0
- package/dist/components/layout/toolbar/FileDownloadTool.js +11 -0
- package/dist/components/layout/toolbar/FileUploadTool.js +21 -0
- package/dist/components/layout/toolbar/FullScreenTool.js +46 -0
- package/dist/components/layout/toolbar/MenuItem.js +12 -0
- package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
- package/dist/components/layout/toolbar/MostPageTool.js +36 -0
- package/dist/components/layout/toolbar/OtherTool.js +21 -0
- package/dist/components/layout/toolbar/Paginate.js +12 -0
- package/dist/components/layout/toolbar/PrintTool.js +11 -0
- package/dist/components/layout/toolbar/PropertyItem.js +12 -0
- package/dist/components/layout/toolbar/RPToolbar.js +8 -0
- package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
- package/dist/components/layout/toolbar/RotateTool.js +33 -0
- package/dist/components/layout/toolbar/ScrollModeTool.js +54 -0
- package/dist/components/layout/toolbar/SearchTool.js +40 -0
- package/dist/components/layout/toolbar/SelectionModeTool.js +36 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +31 -0
- package/dist/components/layout/toolbar/ZoomTool.js +41 -0
- package/dist/components/page/AnnotationLayer.js +37 -0
- package/dist/components/page/CanvasLayer.js +33 -0
- package/dist/components/page/DualPage.js +6 -0
- package/dist/components/page/RPPage.js +33 -0
- package/dist/components/page/SinglePage.js +6 -0
- package/dist/components/page/TextLayer.js +34 -0
- package/dist/components/ui/Button.js +22 -0
- package/dist/components/ui/Checkbox.js +301 -0
- package/dist/components/ui/DropDown.js +29 -0
- package/dist/components/ui/Input.js +26 -0
- package/dist/components/ui/LoadingIndicator.js +6 -0
- package/dist/contexts/ConfigContext.js +13 -0
- package/dist/contexts/DarkModeContext.js +28 -0
- package/dist/contexts/DropFileZoneContext.js +50 -0
- package/dist/contexts/FileInputContext.js +38 -0
- package/dist/contexts/FullScreenContext.js +18 -0
- package/dist/contexts/IconContext.js +11 -0
- package/dist/contexts/InitialStateContext.js +11 -0
- package/dist/contexts/LayerContext.js +8 -0
- package/dist/contexts/LayoutContainerContext.js +10 -0
- package/dist/contexts/LicenseContext.js +15 -0
- package/dist/contexts/OtherToolContext.js +18 -0
- package/dist/contexts/PageViewportContext.js +8 -0
- package/dist/contexts/PaginateContext.js +11 -0
- package/dist/contexts/PrintContext.js +8 -0
- package/dist/contexts/RPDocumentContext.js +49 -0
- package/dist/contexts/RenderedPagesCache.js +14 -0
- package/dist/contexts/RotateContext.js +23 -0
- package/dist/contexts/ScrollModeContext.js +21 -0
- package/dist/contexts/ScrollStateContext.js +13 -0
- package/dist/contexts/SearchContext.js +8 -0
- package/dist/contexts/SelectionModeContext.js +23 -0
- package/dist/contexts/ThemeContext.js +7 -0
- package/dist/contexts/ThumbnailsContext.js +8 -0
- package/dist/contexts/ToolbarComponentContext.js +41 -0
- package/dist/contexts/ViewModeContext.js +28 -0
- package/dist/contexts/ViewportContext.js +62 -0
- package/dist/contexts/VirtualGridContext.js +15 -0
- package/dist/contexts/VirtualScrollContext.js +53 -0
- package/dist/contexts/ZoomContext.js +46 -0
- package/dist/index-3459164c.js +3609 -0
- package/dist/index-743c36f0.js +139 -0
- package/dist/main.js +37 -0
- package/dist/types/components/RPConfig.d.ts +3 -0
- package/dist/types/components/RPController.d.ts +3 -0
- package/dist/types/components/RPDocument.d.ts +3 -0
- package/dist/types/components/RPDropFileZone.d.ts +2 -0
- package/dist/types/components/RPTheme.d.ts +3 -0
- package/dist/types/components/RPViewer.d.ts +2 -0
- package/dist/types/components/icons/CheckIcon.d.ts +2 -0
- package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
- package/dist/types/components/icons/ClearIcon.d.ts +2 -0
- package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
- package/dist/types/components/icons/CloseIcon.d.ts +2 -0
- package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
- package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
- package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
- package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
- package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/InfoIcon.d.ts +2 -0
- package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
- package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
- package/dist/types/components/icons/MoonIcon.d.ts +2 -0
- package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/SearchIcon.d.ts +2 -0
- package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
- package/dist/types/components/icons/SunIcon.d.ts +2 -0
- package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
- package/dist/types/components/icons/Thumbnail.d.ts +2 -0
- package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
- package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
- package/dist/types/components/layout/Container.d.ts +9 -0
- package/dist/types/components/layout/RPLayout.d.ts +3 -0
- package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
- package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
- package/dist/types/components/layout/sidebar/RPSplitter.d.ts +7 -0
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +5 -0
- package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
- package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
- package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
- package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
- package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
- package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -0
- package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
- package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/SearchTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
- package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
- package/dist/types/components/page/CanvasLayer.d.ts +8 -0
- package/dist/types/components/page/DualPage.d.ts +5 -0
- package/dist/types/components/page/RPPage.d.ts +6 -0
- package/dist/types/components/page/SinglePage.d.ts +5 -0
- package/dist/types/components/page/TextLayer.d.ts +6 -0
- package/dist/types/components/ui/Button.d.ts +6 -0
- package/dist/types/components/ui/Checkbox.d.ts +8 -0
- package/dist/types/components/ui/DropDown.d.ts +9 -0
- package/dist/types/components/ui/Input.d.ts +6 -0
- package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
- package/dist/types/contexts/ConfigContext.d.ts +5 -0
- package/dist/types/contexts/DarkModeContext.d.ts +5 -0
- package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
- package/dist/types/contexts/FileInputContext.d.ts +7 -0
- package/dist/types/contexts/FullScreenContext.d.ts +7 -0
- package/dist/types/contexts/IconContext.d.ts +7 -0
- package/dist/types/contexts/InitialStateContext.d.ts +5 -0
- package/dist/types/contexts/LayerContext.d.ts +5 -0
- package/dist/types/contexts/LayoutContainerContext.d.ts +8 -0
- package/dist/types/contexts/LicenseContext.d.ts +7 -0
- package/dist/types/contexts/OtherToolContext.d.ts +9 -0
- package/dist/types/contexts/PageViewportContext.d.ts +4 -0
- package/dist/types/contexts/PaginateContext.d.ts +5 -0
- package/dist/types/contexts/PrintContext.d.ts +7 -0
- package/dist/types/contexts/RPDocumentContext.d.ts +10 -0
- package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
- package/dist/types/contexts/RotateContext.d.ts +5 -0
- package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
- package/dist/types/contexts/ScrollStateContext.d.ts +8 -0
- package/dist/types/contexts/SearchContext.d.ts +7 -0
- package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
- package/dist/types/contexts/ThemeContext.d.ts +4 -0
- package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
- package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
- package/dist/types/contexts/ViewModeContext.d.ts +5 -0
- package/dist/types/contexts/ViewportContext.d.ts +28 -0
- package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
- package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
- package/dist/types/contexts/ZoomContext.d.ts +5 -0
- package/dist/types/main.d.ts +20 -0
- package/dist/types/utils/appConsole.d.ts +24 -0
- package/dist/types/utils/charators.d.ts +12 -0
- package/dist/types/utils/constants.d.ts +2 -0
- package/dist/types/utils/convertPdfDate.d.ts +1 -0
- package/dist/types/utils/dateFormatter.d.ts +1 -0
- package/dist/types/utils/formatFileSize.d.ts +1 -0
- package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
- package/dist/types/utils/getZoomLevel.d.ts +2 -0
- package/dist/types/utils/highlight.d.ts +8 -0
- package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
- package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
- package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
- package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
- package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
- package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
- package/dist/types/utils/hooks/useGrabScroll.d.ts +10 -0
- package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
- package/dist/types/utils/hooks/useLicense.d.ts +2 -0
- package/dist/types/utils/hooks/useLoadPdf.d.ts +7 -0
- package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
- package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
- package/dist/types/utils/hooks/usePageDimension.d.ts +4 -0
- package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
- package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
- package/dist/types/utils/hooks/usePrint.d.ts +11 -0
- package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
- package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
- package/dist/types/utils/hooks/useRotate.d.ts +4 -0
- package/dist/types/utils/hooks/useScrollToPage.d.ts +4 -0
- package/dist/types/utils/hooks/useSearch.d.ts +14 -0
- package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +12 -0
- package/dist/types/utils/hooks/useWatermark.d.ts +4 -0
- package/dist/types/utils/link_service.d.ts +71 -0
- package/dist/types/utils/renderPage.d.ts +2 -0
- package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
- package/dist/types/utils/types.d.ts +562 -0
- package/dist/utils/appConsole.js +42 -0
- package/dist/utils/charators.js +48 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/convertPdfDate.js +25 -0
- package/dist/utils/dateFormatter.js +7 -0
- package/dist/utils/formatFileSize.js +9 -0
- package/dist/utils/getThumbnailViewport.js +7 -0
- package/dist/utils/getZoomLevel.js +18 -0
- package/dist/utils/highlight.js +145 -0
- package/dist/utils/hooks/useDarkMode.js +11 -0
- package/dist/utils/hooks/useDarkModeProps.js +12 -0
- package/dist/utils/hooks/useDebounce.js +15 -0
- package/dist/utils/hooks/useElementSize.js +21 -0
- package/dist/utils/hooks/useFileDownload.js +32 -0
- package/dist/utils/hooks/useFullScreen.js +29 -0
- package/dist/utils/hooks/useGrabScroll.js +45 -0
- package/dist/utils/hooks/useInfiniteScroll.js +19 -0
- package/dist/utils/hooks/useLicense.js +102 -0
- package/dist/utils/hooks/useLoadPdf.js +50 -0
- package/dist/utils/hooks/useLoadWorker.js +13 -0
- package/dist/utils/hooks/useMousePressed.js +20 -0
- package/dist/utils/hooks/usePageDimension.js +24 -0
- package/dist/utils/hooks/usePaginate.js +33 -0
- package/dist/utils/hooks/usePdfProperties.js +40 -0
- package/dist/utils/hooks/usePrint.js +33 -0
- package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
- package/dist/utils/hooks/useResizeObserver.js +22 -0
- package/dist/utils/hooks/useRotate.js +13 -0
- package/dist/utils/hooks/useScrollToPage.js +34 -0
- package/dist/utils/hooks/useSearch.js +33 -0
- package/dist/utils/hooks/useThumbnail.js +34 -0
- package/dist/utils/hooks/useVirtualReactWindow.js +34 -0
- package/dist/utils/hooks/useWatermark.js +62 -0
- package/dist/utils/link_service.js +98 -0
- package/dist/utils/renderPage.js +15 -0
- package/dist/utils/sanitizeExternalUrl.js +16 -0
- package/dist/utils/types.js +10 -0
- package/package.json +90 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
3
|
+
function m(e, n) {
|
|
4
|
+
const t = i.createContext(n), r = (s) => {
|
|
5
|
+
const { children: o, ...c } = s, a = i.useMemo(() => c, Object.values(c));
|
|
6
|
+
return /* @__PURE__ */ C(t.Provider, { value: a, children: o });
|
|
7
|
+
};
|
|
8
|
+
r.displayName = e + "Provider";
|
|
9
|
+
function u(s) {
|
|
10
|
+
const o = i.useContext(t);
|
|
11
|
+
if (o)
|
|
12
|
+
return o;
|
|
13
|
+
if (n !== void 0)
|
|
14
|
+
return n;
|
|
15
|
+
throw new Error(`\`${s}\` must be used within \`${e}\``);
|
|
16
|
+
}
|
|
17
|
+
return [r, u];
|
|
18
|
+
}
|
|
19
|
+
function E(e, n = []) {
|
|
20
|
+
let t = [];
|
|
21
|
+
function r(s, o) {
|
|
22
|
+
const c = i.createContext(o), a = t.length;
|
|
23
|
+
t = [...t, o];
|
|
24
|
+
const f = (d) => {
|
|
25
|
+
var b;
|
|
26
|
+
const { scope: l, children: S, ...v } = d, h = ((b = l == null ? void 0 : l[e]) == null ? void 0 : b[a]) || c, z = i.useMemo(() => v, Object.values(v));
|
|
27
|
+
return /* @__PURE__ */ C(h.Provider, { value: z, children: S });
|
|
28
|
+
};
|
|
29
|
+
f.displayName = s + "Provider";
|
|
30
|
+
function x(d, l) {
|
|
31
|
+
var h;
|
|
32
|
+
const S = ((h = l == null ? void 0 : l[e]) == null ? void 0 : h[a]) || c, v = i.useContext(S);
|
|
33
|
+
if (v)
|
|
34
|
+
return v;
|
|
35
|
+
if (o !== void 0)
|
|
36
|
+
return o;
|
|
37
|
+
throw new Error(`\`${d}\` must be used within \`${s}\``);
|
|
38
|
+
}
|
|
39
|
+
return [f, x];
|
|
40
|
+
}
|
|
41
|
+
const u = () => {
|
|
42
|
+
const s = t.map((o) => i.createContext(o));
|
|
43
|
+
return function(c) {
|
|
44
|
+
const a = (c == null ? void 0 : c[e]) || s;
|
|
45
|
+
return i.useMemo(
|
|
46
|
+
() => ({ [`__scope${e}`]: { ...c, [e]: a } }),
|
|
47
|
+
[c, a]
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return u.scopeName = e, [r, P(u, ...n)];
|
|
52
|
+
}
|
|
53
|
+
function P(...e) {
|
|
54
|
+
const n = e[0];
|
|
55
|
+
if (e.length === 1)
|
|
56
|
+
return n;
|
|
57
|
+
const t = () => {
|
|
58
|
+
const r = e.map((u) => ({
|
|
59
|
+
useScope: u(),
|
|
60
|
+
scopeName: u.scopeName
|
|
61
|
+
}));
|
|
62
|
+
return function(s) {
|
|
63
|
+
const o = r.reduce((c, { useScope: a, scopeName: f }) => {
|
|
64
|
+
const d = a(s)[`__scope${f}`];
|
|
65
|
+
return { ...c, ...d };
|
|
66
|
+
}, {});
|
|
67
|
+
return i.useMemo(() => ({ [`__scope${n.scopeName}`]: o }), [o]);
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
return t.scopeName = n.scopeName, t;
|
|
71
|
+
}
|
|
72
|
+
function y(e) {
|
|
73
|
+
const n = i.useRef(e);
|
|
74
|
+
return i.useEffect(() => {
|
|
75
|
+
n.current = e;
|
|
76
|
+
}), i.useMemo(() => (...t) => {
|
|
77
|
+
var r;
|
|
78
|
+
return (r = n.current) == null ? void 0 : r.call(n, ...t);
|
|
79
|
+
}, []);
|
|
80
|
+
}
|
|
81
|
+
function $({
|
|
82
|
+
prop: e,
|
|
83
|
+
defaultProp: n,
|
|
84
|
+
onChange: t = () => {
|
|
85
|
+
}
|
|
86
|
+
}) {
|
|
87
|
+
const [r, u] = g({ defaultProp: n, onChange: t }), s = e !== void 0, o = s ? e : r, c = y(t), a = i.useCallback(
|
|
88
|
+
(f) => {
|
|
89
|
+
if (s) {
|
|
90
|
+
const d = typeof f == "function" ? f(e) : f;
|
|
91
|
+
d !== e && c(d);
|
|
92
|
+
} else
|
|
93
|
+
u(f);
|
|
94
|
+
},
|
|
95
|
+
[s, e, u, c]
|
|
96
|
+
);
|
|
97
|
+
return [o, a];
|
|
98
|
+
}
|
|
99
|
+
function g({
|
|
100
|
+
defaultProp: e,
|
|
101
|
+
onChange: n
|
|
102
|
+
}) {
|
|
103
|
+
const t = i.useState(e), [r] = t, u = i.useRef(r), s = y(n);
|
|
104
|
+
return i.useEffect(() => {
|
|
105
|
+
u.current !== r && (s(r), u.current = r);
|
|
106
|
+
}, [r, u, s]), t;
|
|
107
|
+
}
|
|
108
|
+
var p = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
|
|
109
|
+
};
|
|
110
|
+
function _(e) {
|
|
111
|
+
const [n, t] = i.useState(void 0);
|
|
112
|
+
return p(() => {
|
|
113
|
+
if (e) {
|
|
114
|
+
t({ width: e.offsetWidth, height: e.offsetHeight });
|
|
115
|
+
const r = new ResizeObserver((u) => {
|
|
116
|
+
if (!Array.isArray(u) || !u.length)
|
|
117
|
+
return;
|
|
118
|
+
const s = u[0];
|
|
119
|
+
let o, c;
|
|
120
|
+
if ("borderBoxSize" in s) {
|
|
121
|
+
const a = s.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
|
|
122
|
+
o = f.inlineSize, c = f.blockSize;
|
|
123
|
+
} else
|
|
124
|
+
o = e.offsetWidth, c = e.offsetHeight;
|
|
125
|
+
t({ width: o, height: c });
|
|
126
|
+
});
|
|
127
|
+
return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
|
|
128
|
+
} else
|
|
129
|
+
t(void 0);
|
|
130
|
+
}, [e]), n;
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
$ as a,
|
|
134
|
+
_ as b,
|
|
135
|
+
E as c,
|
|
136
|
+
y as d,
|
|
137
|
+
m as e,
|
|
138
|
+
p as u
|
|
139
|
+
};
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RPDocument as t } from "./components/RPDocument.js";
|
|
2
|
+
import { R as x, a as m, u as n, b as p, c as s } from "./Thumbnails-06fa1aa5.js";
|
|
3
|
+
import { RPConfig as u } from "./components/RPConfig.js";
|
|
4
|
+
import { RPLayout as C } from "./components/layout/RPLayout.js";
|
|
5
|
+
import { RPTheme as P } from "./components/RPTheme.js";
|
|
6
|
+
import { RPDropFileZone as l } from "./components/RPDropFileZone.js";
|
|
7
|
+
import { useDarkModeContext as d } from "./contexts/DarkModeContext.js";
|
|
8
|
+
import { useDocumentContext as M } from "./contexts/RPDocumentContext.js";
|
|
9
|
+
import { useRotateContext as F } from "./contexts/RotateContext.js";
|
|
10
|
+
import { useDarkModeProps as Z } from "./utils/hooks/useDarkModeProps.js";
|
|
11
|
+
import { useViewModeContext as h } from "./contexts/ViewModeContext.js";
|
|
12
|
+
import { useDropFileZoneContext as S } from "./contexts/DropFileZoneContext.js";
|
|
13
|
+
import { useOpenFileContext as y } from "./contexts/FileInputContext.js";
|
|
14
|
+
import { useZoomContext as O } from "./contexts/ZoomContext.js";
|
|
15
|
+
import { ScrollMode as j, ViewMode as q } from "./utils/types.js";
|
|
16
|
+
export {
|
|
17
|
+
u as RPConfig,
|
|
18
|
+
t as RPDocument,
|
|
19
|
+
l as RPDropFileZone,
|
|
20
|
+
C as RPLayout,
|
|
21
|
+
P as RPTheme,
|
|
22
|
+
x as RPViewer,
|
|
23
|
+
j as ScrollMode,
|
|
24
|
+
q as ViewMode,
|
|
25
|
+
d as useDarkModeContext,
|
|
26
|
+
Z as useDarkModeProps,
|
|
27
|
+
M as useDocumentContext,
|
|
28
|
+
S as useDropFileZoneContext,
|
|
29
|
+
m as useFileDownload,
|
|
30
|
+
y as useOpenFileContext,
|
|
31
|
+
n as usePaginateContext,
|
|
32
|
+
p as usePrintContext,
|
|
33
|
+
F as useRotateContext,
|
|
34
|
+
s as useSearchContext,
|
|
35
|
+
h as useViewModeContext,
|
|
36
|
+
O as useZoomContext
|
|
37
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
interface Props extends PropsWithChildren {
|
|
3
|
+
getContainerRef?: (element: HTMLDivElement) => void;
|
|
4
|
+
toolbarRef: HTMLDivElement | null;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Container: FC<Props>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RPSidebar: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { PageViewport } from 'pdfjs-dist/types/web/interfaces';
|
|
3
|
+
interface Props {
|
|
4
|
+
thumbnailSrc?: string;
|
|
5
|
+
pageNumber?: number;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
isFocused: boolean;
|
|
8
|
+
viewport: PageViewport;
|
|
9
|
+
}
|
|
10
|
+
export declare const Thumbnail: FC<Props>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DarkModeTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DocumentProperties: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FullScreenTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MenuSeparator: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MostPageTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OtherTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Paginate: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PrintTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RPToolbar: import('react').ForwardRefExoticComponent<import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RPToolbarEnd: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RotateTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ScrollModeTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SelectionModeTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ViewModeTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ZoomTool: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
pageNumber: number;
|
|
3
|
+
onIntersectRatioChange?: (page: number, ratio: number) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const RPPage: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
interface Props extends PropsWithChildren, ButtonHTMLAttributes<{}> {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const UIButton: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import { FC, PropsWithChildren } from 'react';
|
|
3
|
+
interface Props extends PropsWithChildren, DropdownMenuContentProps {
|
|
4
|
+
triggerComponent: React.ReactElement;
|
|
5
|
+
container: HTMLDivElement | null;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const UIDropDown: FC<Props>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
interface Props extends InputHTMLAttributes<HTMLInputElement>, PropsWithChildren {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const UIInput: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ConfigContextType } from '../utils/types';
|
|
3
|
+
export declare const ConfigContext: import('react').Context<ConfigContextType>;
|
|
4
|
+
export declare const useConfigContext: () => ConfigContextType;
|
|
5
|
+
export declare const ConfigContextProvider: FC<PropsWithChildren & ConfigContextType>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DarkMode, DarkModeProviderProps } from '../utils/types';
|
|
3
|
+
export declare const DarkModeContext: React.Context<DarkMode>;
|
|
4
|
+
export declare const useDarkModeContext: () => DarkMode;
|
|
5
|
+
export declare const DarkModeProvider: FC<DarkModeProviderProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { FileDragDropControl } from '../utils/types';
|
|
3
|
+
export declare const DropFileZoneContext: React.Context<FileDragDropControl>;
|
|
4
|
+
export declare const useDropFileZoneContext: () => FileDragDropControl;
|
|
5
|
+
export declare const DropFileZoneProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
+
interface FileInputContextValue {
|
|
3
|
+
onFileChange: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const FileInputProvider: React.FC<PropsWithChildren>;
|
|
6
|
+
export declare const useOpenFileContext: () => FileInputContextValue;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FullScreenToolProps } from '../utils/types';
|
|
3
|
+
export declare const FullScreenProvider: FC<{
|
|
4
|
+
elementRef: HTMLElement | null;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const useFullScreenContext: () => FullScreenToolProps;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { RPIcons } from '../utils/types';
|
|
3
|
+
export declare const IconContext: import('react').Context<RPIcons>;
|
|
4
|
+
export declare const useIconContext: () => RPIcons;
|
|
5
|
+
export declare const IconProvider: FC<PropsWithChildren<{
|
|
6
|
+
icons?: RPIcons;
|
|
7
|
+
}>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { InitialStateContextType } from '../utils/types';
|
|
3
|
+
export declare const InitialStateContext: import('react').Context<InitialStateContextType>;
|
|
4
|
+
export declare const InitialStateProvider: FC<PropsWithChildren<InitialStateContextType>>;
|
|
5
|
+
export declare const useInitialStateContext: () => InitialStateContextType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { LayerProviderProps } from '../utils/types';
|
|
3
|
+
export declare const LayerContext: import('react').Context<Omit<LayerProviderProps, "children">>;
|
|
4
|
+
export declare const useLayerContext: () => Omit<LayerProviderProps, "children">;
|
|
5
|
+
export declare const LayerProvider: FC<LayerProviderProps>;
|