@pdf-viewer/react 1.9.0-beta.5 → 1.9.0-beta.7
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/SearchCloseButton-cbf182aa.js +33 -0
- package/dist/ToolbarLayout.module-201969d2.js +3453 -0
- package/dist/assets/ToolbarLayout.css +1 -1
- package/dist/components/RPController.js +36 -36
- package/dist/components/RPDropFileZone.js +23 -21
- package/dist/components/RPPages.js +17 -18
- package/dist/components/RPProvider.js +14 -15
- package/dist/components/layout/Container.js +11 -10
- package/dist/components/layout/LayoutContainer.js +15 -16
- package/dist/components/layout/RPDefaultLayout.js +14 -76
- package/dist/components/layout/RPLayout.js +22 -22
- package/dist/components/layout/WrapperLayout.js +8 -7
- package/dist/components/layout/sidebar/RPSidebar.js +12 -51
- package/dist/components/layout/sidebar/RPSplitter.js +9 -7
- package/dist/components/layout/sidebar/Thumbnail.js +48 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +24 -305
- package/dist/components/layout/toolbar/FileDownloadTool.js +13 -23
- package/dist/components/layout/toolbar/MenuItem.js +7 -6
- package/dist/components/layout/toolbar/MenuSeparator.js +5 -4
- package/dist/components/layout/toolbar/MostPageTool.js +25 -50
- package/dist/components/layout/toolbar/OtherTool.js +22 -115
- package/dist/components/layout/toolbar/Paginate.js +17 -99
- package/dist/components/layout/toolbar/PrintTool.js +13 -43
- package/dist/components/layout/toolbar/PropertyItem.js +8 -5
- package/dist/components/layout/toolbar/RPToolbar.js +7 -28
- package/dist/components/layout/toolbar/RPToolbarEnd.js +7 -22
- package/dist/components/layout/toolbar/RotateTool.js +21 -20
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchCloseButton.js +7 -19
- package/dist/components/layout/toolbar/SearchResultNavigator.js +8 -42
- package/dist/components/layout/toolbar/SearchTool.js +30 -197
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
- package/dist/components/layout/toolbar/ToolbarCustom.js +22 -24
- package/dist/components/layout/toolbar/ToolbarDefault.js +20 -25
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +28 -140
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +17 -18
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +11 -11
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +20 -26
- package/dist/components/page/AnnotationLayer.js +16 -17
- package/dist/components/page/CanvasLayer.js +16 -18
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +16 -17
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +16 -17
- package/dist/components/page/TextLayer.js +16 -17
- package/dist/components/ui/Checkbox.js +51 -49
- package/dist/components/ui/DropDown.js +19 -13
- package/dist/components/ui/LoadingIndicator.js +5 -22
- package/dist/components/ui/RPTooltip.js +192 -405
- package/dist/contexts/ElementPageContext.js +37 -37
- package/dist/contexts/FileInputContext.js +18 -20
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +2 -2
- package/dist/contexts/RenderQueueProvider.js +10 -0
- package/dist/contexts/SearchContext.js +3 -3
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/index-18b0454c.js +1657 -0
- package/dist/{index-8547fbc6.js → index-5908484b.js} +9 -9
- package/dist/index-f4a9ae4d.js +1664 -0
- package/dist/main.js +48 -50
- package/dist/types/components/layout/RPDefaultLayout.d.ts +1 -2
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +0 -1
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -2
- package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
- package/dist/types/utils/Queue.d.ts +18 -0
- package/dist/types/utils/renderPage.d.ts +1 -6
- package/dist/types/utils/types.d.ts +5 -0
- package/dist/utils/Queue.js +47 -0
- package/dist/utils/hooks/useFileDownload.js +16 -17
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePageRotateContext.js +14 -14
- package/dist/utils/hooks/usePaginate.js +16 -17
- package/dist/utils/hooks/usePresentPage.js +16 -17
- package/dist/utils/hooks/usePrint.js +16 -17
- package/dist/utils/hooks/useScrollToPage.js +16 -17
- package/dist/utils/hooks/useSearch.js +16 -17
- package/dist/utils/hooks/useThumbnail.js +16 -18
- package/dist/utils/hooks/useVirtualReactWindow.js +16 -17
- package/package.json +1 -1
- package/dist/Checkbox.module-3edaacbb.js +0 -7
- package/dist/Combination-da8647d4.js +0 -693
- package/dist/Container.module-f8b5c306.js +0 -6
- package/dist/DropDown.module-a78567cb.js +0 -11
- package/dist/MenuItem.module-bc11d0d3.js +0 -6
- package/dist/MenuSeparator.module-89b2ff7f.js +0 -6
- package/dist/PropertyItem.module-db0150cc.js +0 -8
- package/dist/RPSplitter.module-13d612c4.js +0 -7
- package/dist/RPTheme.module-bd9038da.js +0 -8
- package/dist/RotateTool.module-03987eba.js +0 -6
- package/dist/SearchTool.module-016f3a8d.js +0 -16
- package/dist/ToolbarLayout.module-60c3d6e8.js +0 -2434
- package/dist/WrapperLayout.module-147bc943.js +0 -6
- package/dist/floating-ui.react-dom-f3f380e0.js +0 -1447
- package/dist/index-473557b1.js +0 -1191
- /package/dist/assets/{RPTheme.css → RPDropFileZone.css} +0 -0
- /package/dist/assets/{SearchTool.css → SearchCloseButton.css} +0 -0
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { LicenseType as
|
|
4
|
-
import { useDimensionPagesContext as
|
|
5
|
-
import { usePagesRotateContext as
|
|
6
|
-
import { useLicenseContext as
|
|
7
|
-
import { useZoomContext as
|
|
8
|
-
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as
|
|
9
|
-
const
|
|
10
|
-
const [
|
|
11
|
-
(e,
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as w, useState as P, useCallback as u, useContext as h, useRef as g, useMemo as A } from "react";
|
|
3
|
+
import { LicenseType as R } from "../utils/types.js";
|
|
4
|
+
import { useDimensionPagesContext as y } from "./DimensionPagesContext.js";
|
|
5
|
+
import { usePagesRotateContext as S } from "./PagesRotateContext.js";
|
|
6
|
+
import { useLicenseContext as T } from "./LicenseContext.js";
|
|
7
|
+
import { useZoomContext as _ } from "./ZoomContext.js";
|
|
8
|
+
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as E } from "../utils/const.js";
|
|
9
|
+
const d = w(void 0), z = ({ children: i }) => {
|
|
10
|
+
const [l, o] = P({}), { widths: t, heights: c } = y(), { pageRotate: m } = S(), { zoomLevel: f } = _(), x = u(
|
|
11
|
+
(e, r) => {
|
|
12
12
|
o((n) => {
|
|
13
|
-
const
|
|
13
|
+
const s = { width: t[e], height: c[e] };
|
|
14
14
|
return {
|
|
15
15
|
...n,
|
|
16
|
-
[e]:
|
|
16
|
+
[e]: r(n[e], s, m[e], f)
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
},
|
|
20
20
|
[t, c, f, m]
|
|
21
|
-
),
|
|
22
|
-
o((
|
|
23
|
-
const n = { ...
|
|
21
|
+
), p = u((e) => {
|
|
22
|
+
o((r) => {
|
|
23
|
+
const n = { ...r };
|
|
24
24
|
return delete n[e], n;
|
|
25
25
|
});
|
|
26
|
-
}, []),
|
|
26
|
+
}, []), v = u((e, r) => {
|
|
27
27
|
o((n) => {
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
const s = { ...n };
|
|
29
|
+
return s[e] = s[e].filter((D, C) => C !== r), s;
|
|
30
30
|
});
|
|
31
31
|
}, []);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
return /* @__PURE__ */ L(
|
|
33
|
+
d.Provider,
|
|
34
34
|
{
|
|
35
|
-
value: { updateElement:
|
|
36
|
-
children:
|
|
35
|
+
value: { updateElement: x, clearElements: p, removeElement: v, elementList: l },
|
|
36
|
+
children: i
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
|
-
},
|
|
39
|
+
}, a = () => {
|
|
40
40
|
}, U = () => {
|
|
41
|
-
const
|
|
41
|
+
const i = h(d), { type: l, validating: o } = T(), t = g(0), c = A(() => {
|
|
42
42
|
if (o !== !1)
|
|
43
43
|
return {
|
|
44
|
-
updateElement:
|
|
45
|
-
clearElements:
|
|
46
|
-
removeElement:
|
|
44
|
+
updateElement: a,
|
|
45
|
+
clearElements: a,
|
|
46
|
+
removeElement: a,
|
|
47
47
|
elementList: {}
|
|
48
48
|
};
|
|
49
|
-
if (!(
|
|
49
|
+
if (!(l !== R.Developer))
|
|
50
50
|
return {
|
|
51
51
|
updateElement: () => {
|
|
52
|
-
t.current === 0 && (console.error(
|
|
52
|
+
t.current === 0 && (console.error(E), t.current++);
|
|
53
53
|
},
|
|
54
54
|
clearElements: () => {
|
|
55
|
-
t.current === 0 && (console.error(
|
|
55
|
+
t.current === 0 && (console.error(E), t.current++);
|
|
56
56
|
},
|
|
57
57
|
removeElement: () => {
|
|
58
|
-
t.current === 0 && (console.error(
|
|
58
|
+
t.current === 0 && (console.error(E), t.current++);
|
|
59
59
|
},
|
|
60
60
|
elementList: {}
|
|
61
61
|
};
|
|
62
|
-
}, [
|
|
63
|
-
if (!
|
|
62
|
+
}, [l, o]);
|
|
63
|
+
if (!i)
|
|
64
64
|
throw new Error("useElementPageContext must be used within a ElementPageProvider");
|
|
65
|
-
return c ||
|
|
65
|
+
return c || i;
|
|
66
66
|
};
|
|
67
67
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
d as ElementPageContext,
|
|
69
|
+
z as ElementPageProvider,
|
|
70
70
|
U as useElementPageContext
|
|
71
71
|
};
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useDocumentContext as
|
|
4
|
-
import { useDocumentPasswordContext as
|
|
5
|
-
const
|
|
6
|
-
const { setFilename:
|
|
7
|
-
setPassword: l
|
|
8
|
-
} = h(), u = () => {
|
|
1
|
+
import { jsxs as m, jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as C, useRef as c, useContext as F } from "react";
|
|
3
|
+
import { useDocumentContext as h } from "./RPDocumentContext.js";
|
|
4
|
+
import { useDocumentPasswordContext as P } from "./DocumentPasswordContext.js";
|
|
5
|
+
const l = C(null), g = ({ children: t }) => {
|
|
6
|
+
const { setFilename: u, setPdfSrc: p } = h(), r = c(), o = c(null), { setPassword: a } = P(), f = () => {
|
|
9
7
|
var e;
|
|
10
8
|
(e = o.current) == null || e.click();
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
const n = (
|
|
9
|
+
}, d = (e) => {
|
|
10
|
+
var i;
|
|
11
|
+
const n = (i = e.target.files) == null ? void 0 : i[0];
|
|
14
12
|
if (!n || n.type !== "application/pdf")
|
|
15
13
|
return;
|
|
16
|
-
const
|
|
17
|
-
|
|
14
|
+
const s = URL.createObjectURL(n);
|
|
15
|
+
r.current && URL.revokeObjectURL(r.current), r.current = s, u(n.name), p(s), e.target.value = "", a("");
|
|
18
16
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ m(l.Provider, { value: { openFile: f }, children: [
|
|
20
18
|
t,
|
|
21
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ x(
|
|
22
20
|
"input",
|
|
23
21
|
{
|
|
24
22
|
accept: "application/pdf",
|
|
25
23
|
type: "file",
|
|
26
24
|
ref: o,
|
|
27
25
|
style: { display: "none" },
|
|
28
|
-
onChange:
|
|
26
|
+
onChange: d
|
|
29
27
|
}
|
|
30
28
|
)
|
|
31
29
|
] });
|
|
32
|
-
},
|
|
33
|
-
const t =
|
|
30
|
+
}, j = () => {
|
|
31
|
+
const t = F(l);
|
|
34
32
|
if (!t)
|
|
35
33
|
throw new Error("useOpenFileContext must be used within FileInputProvider");
|
|
36
34
|
return t;
|
|
37
35
|
};
|
|
38
36
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
g as FileInputProvider,
|
|
38
|
+
j as useOpenFileContext
|
|
41
39
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { t as e, P as m, u as p } from "../ToolbarLayout.module-201969d2.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { w as e, h as n, c as s } from "../ToolbarLayout.module-201969d2.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
e as PrintContext,
|
|
6
6
|
n as PrintProvider,
|
|
7
7
|
s as usePrintContext
|
|
8
8
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../utils/Queue.js";
|
|
4
|
+
import "../utils/renderPage.js";
|
|
5
|
+
import { B as m, g as p, C as d } from "../ToolbarLayout.module-201969d2.js";
|
|
6
|
+
export {
|
|
7
|
+
m as RenderQueueContext,
|
|
8
|
+
p as RenderQueueProvider,
|
|
9
|
+
d as useRenderQueue
|
|
10
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { A as a, f as s, d as c } from "../ToolbarLayout.module-201969d2.js";
|
|
4
4
|
export {
|
|
5
5
|
a as SearchContext,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
s as SearchProvider,
|
|
7
|
+
c as useSearchContext
|
|
8
8
|
};
|