@pdf-viewer/react 1.9.0-beta.1 → 1.9.0-beta.2
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/{Popover-48c8394c.js → Popover-1faa77f6.js} +2 -2
- package/dist/RPLayout-81cd4970.js +3393 -0
- package/dist/{component-2aa6e53b.js → component-1da194e8.js} +1 -1
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPDropFileZone.js +27 -26
- package/dist/components/RPPages.js +9 -3
- package/dist/components/layout/LayoutContainer.js +9 -3
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +9 -4
- package/dist/components/layout/WrapperLayout.js +8 -7
- package/dist/components/layout/sidebar/RPSidebar.js +3 -2
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +20 -18
- package/dist/components/layout/toolbar/DocumentDialog.js +7 -4
- package/dist/components/layout/toolbar/DocumentProperties.js +19 -17
- package/dist/components/layout/toolbar/FileDownloadTool.js +4 -2
- package/dist/components/layout/toolbar/FileUploadTool.js +21 -19
- package/dist/components/layout/toolbar/FullScreenTool.js +45 -36
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +10 -4
- package/dist/components/layout/toolbar/OtherTool.js +4 -3
- package/dist/components/layout/toolbar/Paginate.js +4 -2
- package/dist/components/layout/toolbar/PrintTool.js +4 -2
- package/dist/components/layout/toolbar/RPToolbar.js +3 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +27 -25
- package/dist/components/layout/toolbar/ScrollModeTool.js +43 -41
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +10 -4
- package/dist/components/layout/toolbar/SelectionModeTool.js +32 -30
- package/dist/components/layout/toolbar/ThumbnailTool.js +17 -0
- package/dist/components/layout/toolbar/ToolbarCustom.js +9 -3
- package/dist/components/layout/toolbar/ViewModeTool.js +33 -24
- package/dist/components/layout/toolbar/ZoomTool.js +5 -3
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +9 -13
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +10 -14
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +13 -17
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +10 -4
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +8 -12
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +55 -56
- package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +16 -0
- package/dist/components/layout/toolbar/tools/defaults/TopbarDefaultTools.js +59 -0
- package/dist/components/page/AnnotationLayer.js +9 -3
- package/dist/components/page/CanvasLayer.js +9 -3
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +9 -3
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +9 -3
- package/dist/components/page/TextLayer.js +9 -3
- package/dist/components/ui/Checkbox.js +116 -228
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +207 -207
- package/dist/contexts/DropFileZoneContext.js +28 -29
- package/dist/contexts/IconToolContext.js +13 -0
- package/dist/contexts/PaginationContext.js +3 -3
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ToolComponentContext.js +52 -0
- package/dist/contexts/ToolbarComponentContext.js +6 -3
- package/dist/{floating-ui.react-dom-4b1e2e46.js → floating-ui.react-dom-15b9b819.js} +380 -394
- package/dist/index-1cb41342.js +307 -0
- package/dist/{index-951f0f1f.js → index-7279fb4e.js} +456 -464
- package/dist/index-aa2d3884.js +140 -0
- package/dist/main.js +23 -19
- package/dist/types/components/layout/toolbar/ThumbnailTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +3 -0
- package/dist/types/contexts/IconToolContext.d.ts +9 -0
- package/dist/types/contexts/ToolComponentContext.d.ts +12 -0
- package/dist/types/main.d.ts +3 -1
- package/dist/types/utils/types.d.ts +60 -42
- package/dist/utils/hooks/useFileDownload.js +9 -3
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +9 -3
- package/dist/utils/hooks/usePresentPage.js +9 -3
- package/dist/utils/hooks/usePrint.js +9 -3
- package/dist/utils/hooks/useScrollToPage.js +9 -3
- package/dist/utils/hooks/useSearch.js +9 -3
- package/dist/utils/hooks/useThumbnail.js +9 -3
- package/dist/utils/hooks/useVirtualReactWindow.js +9 -3
- package/package.json +1 -1
- package/dist/RPLayout-3042ec91.js +0 -3349
- package/dist/index-6e0e48fa.js +0 -332
- package/dist/index-e3a67935.js +0 -150
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as x, useContext as
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as x, useContext as P, useState as F, useCallback as r } from "react";
|
|
3
3
|
import { useDocumentContext as h } from "./RPDocumentContext.js";
|
|
4
|
-
import { useToolbarComponentContext as
|
|
4
|
+
import { useToolbarComponentContext as T } from "./ToolbarComponentContext.js";
|
|
5
5
|
import { useDocumentPasswordContext as v } from "./DocumentPasswordContext.js";
|
|
6
|
-
|
|
6
|
+
import { useToolComponentContext as L } from "./ToolComponentContext.js";
|
|
7
|
+
const i = x({
|
|
7
8
|
dragging: !1,
|
|
8
9
|
handleDragLeave: () => {
|
|
9
10
|
},
|
|
@@ -11,43 +12,41 @@ const p = x({
|
|
|
11
12
|
},
|
|
12
13
|
handleDrop: () => {
|
|
13
14
|
}
|
|
14
|
-
}),
|
|
15
|
-
const [
|
|
16
|
-
setPassword: f
|
|
17
|
-
} = v(), u = r(
|
|
15
|
+
}), R = () => P(i), S = ({ children: c }) => {
|
|
16
|
+
const [f, t] = F(!1), { setFilename: n, setPdfSrc: a } = h(), { openFileTool: s } = T(), { openFileTool: l } = L(), { setPassword: u } = v(), m = r(
|
|
18
17
|
(e) => {
|
|
19
|
-
var
|
|
20
|
-
e.preventDefault(), e.stopPropagation(),
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
18
|
+
var p;
|
|
19
|
+
e.preventDefault(), e.stopPropagation(), t(!1);
|
|
20
|
+
const o = (p = e.dataTransfer) == null ? void 0 : p.files[0];
|
|
21
|
+
if (!o || o.type !== "application/pdf")
|
|
23
22
|
return;
|
|
24
|
-
const
|
|
25
|
-
n(
|
|
23
|
+
const D = URL.createObjectURL(o);
|
|
24
|
+
n(o.name), a(D), u("");
|
|
26
25
|
},
|
|
27
26
|
[n, a]
|
|
28
|
-
),
|
|
27
|
+
), d = r(
|
|
29
28
|
(e) => {
|
|
30
|
-
e.preventDefault(), e.stopPropagation(), s &&
|
|
29
|
+
e.preventDefault(), e.stopPropagation(), !(!s || !l) && t(!0);
|
|
31
30
|
},
|
|
32
|
-
[s]
|
|
33
|
-
),
|
|
34
|
-
e.preventDefault(), e.stopPropagation(),
|
|
31
|
+
[s, l]
|
|
32
|
+
), g = r((e) => {
|
|
33
|
+
e.preventDefault(), e.stopPropagation(), t(!1);
|
|
35
34
|
}, []);
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
35
|
+
return /* @__PURE__ */ C(
|
|
36
|
+
i.Provider,
|
|
38
37
|
{
|
|
39
38
|
value: {
|
|
40
|
-
dragging:
|
|
41
|
-
handleDragLeave:
|
|
42
|
-
handleDragEnter:
|
|
43
|
-
handleDrop:
|
|
39
|
+
dragging: f,
|
|
40
|
+
handleDragLeave: g,
|
|
41
|
+
handleDragEnter: d,
|
|
42
|
+
handleDrop: m
|
|
44
43
|
},
|
|
45
|
-
children:
|
|
44
|
+
children: c
|
|
46
45
|
}
|
|
47
46
|
);
|
|
48
47
|
};
|
|
49
48
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
i as DropFileZoneContext,
|
|
50
|
+
S as DropFileZoneProvider,
|
|
51
|
+
R as useDropFileZoneContext
|
|
53
52
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as s, useContext as c, useState as i } from "react";
|
|
3
|
+
const u = () => {
|
|
4
|
+
throw new Error("setIcons is not initialized yet");
|
|
5
|
+
}, o = s({ setIcons: u }), x = () => c(o), a = ({ children: t }) => {
|
|
6
|
+
const [e, n] = i({});
|
|
7
|
+
return /* @__PURE__ */ r(o.Provider, { value: { ...e, setIcons: n }, children: t });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
o as IconToolContext,
|
|
11
|
+
a as IconToolProvider,
|
|
12
|
+
x as useIconToolContext
|
|
13
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { p, P as e, u as m } from "../RPLayout-81cd4970.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
p as PaginationContext,
|
|
8
8
|
e as PaginationProvider,
|
|
9
|
-
|
|
9
|
+
m as usePaginationContext
|
|
10
10
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as u, useContext as n, useState as s } from "react";
|
|
3
|
+
const i = () => {
|
|
4
|
+
throw new Error("setSlots is not initialized yet");
|
|
5
|
+
}, o = u({
|
|
6
|
+
themeSwitcher: !0,
|
|
7
|
+
documentProperties: !0,
|
|
8
|
+
rotateTool: !0,
|
|
9
|
+
fullscreenTool: !0,
|
|
10
|
+
openFileTool: !0,
|
|
11
|
+
dropFileZone: !0,
|
|
12
|
+
downloadTool: !0,
|
|
13
|
+
viewModeTool: !0,
|
|
14
|
+
scrollModeTool: !0,
|
|
15
|
+
printTool: !0,
|
|
16
|
+
thumbnailTool: !0,
|
|
17
|
+
showPrintProgress: !0,
|
|
18
|
+
selectionModeTool: !0,
|
|
19
|
+
jumpNavigationTool: !0,
|
|
20
|
+
sidebarEnable: !0,
|
|
21
|
+
pageNavigationTool: !0,
|
|
22
|
+
searchTool: !0,
|
|
23
|
+
zoomTool: !0,
|
|
24
|
+
setSlots: i
|
|
25
|
+
}), c = () => n(o), T = {
|
|
26
|
+
themeSwitcher: !0,
|
|
27
|
+
documentProperties: !0,
|
|
28
|
+
rotateTool: !0,
|
|
29
|
+
fullscreenTool: !0,
|
|
30
|
+
openFileTool: !0,
|
|
31
|
+
dropFileZone: !0,
|
|
32
|
+
downloadTool: !0,
|
|
33
|
+
viewModeTool: !0,
|
|
34
|
+
scrollModeTool: !0,
|
|
35
|
+
printTool: !0,
|
|
36
|
+
thumbnailTool: !0,
|
|
37
|
+
showPrintProgress: !0,
|
|
38
|
+
selectionModeTool: !0,
|
|
39
|
+
jumpNavigationTool: !0,
|
|
40
|
+
sidebarEnable: !0,
|
|
41
|
+
pageNavigationTool: !0,
|
|
42
|
+
searchTool: !0,
|
|
43
|
+
zoomTool: !0
|
|
44
|
+
}, p = ({ children: e }) => {
|
|
45
|
+
const [t, r] = s(T);
|
|
46
|
+
return /* @__PURE__ */ l(o.Provider, { value: { ...t, setSlots: r }, children: e });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
o as ToolComponentContext,
|
|
50
|
+
p as ToolComponentProvider,
|
|
51
|
+
c as useToolComponentContext
|
|
52
|
+
};
|
|
@@ -15,7 +15,7 @@ const e = l({
|
|
|
15
15
|
selectionModeTool: !0,
|
|
16
16
|
jumpNavigationTool: !0,
|
|
17
17
|
sidebarEnable: !0
|
|
18
|
-
}), d = () => n(e),
|
|
18
|
+
}), d = () => n(e), T = {
|
|
19
19
|
themeSwitcher: !0,
|
|
20
20
|
documentProperties: !0,
|
|
21
21
|
rotateTool: !0,
|
|
@@ -30,10 +30,13 @@ const e = l({
|
|
|
30
30
|
showPrintProgress: !0,
|
|
31
31
|
selectionModeTool: !0,
|
|
32
32
|
jumpNavigationTool: !0,
|
|
33
|
-
sidebarEnable: !0
|
|
33
|
+
sidebarEnable: !0,
|
|
34
|
+
pageNavigationTool: !0,
|
|
35
|
+
searchTool: !0,
|
|
36
|
+
zoomTool: !0
|
|
34
37
|
}, c = ({ children: r, slots: o }) => {
|
|
35
38
|
const t = i(() => ({
|
|
36
|
-
...
|
|
39
|
+
...T,
|
|
37
40
|
...o
|
|
38
41
|
}), [o]);
|
|
39
42
|
return /* @__PURE__ */ u(e.Provider, { value: t, children: r });
|