pdf-tsx 0.3.0 → 0.5.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/LICENSE +21 -21
- package/README.md +350 -296
- package/dist/cjs/components/PDFSidebar.cjs +1 -1
- package/dist/cjs/components/PDFSidebar.module.cjs +1 -1
- package/dist/cjs/components/PDFViewer.cjs +1 -1
- package/dist/cjs/components/PDFViewer.module.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
- package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
- package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
- package/dist/cjs/components/features/PDFOutline.cjs +1 -1
- package/dist/cjs/components/features/PDFOutline.module.cjs +1 -1
- package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
- package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
- package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
- package/dist/cjs/components/features/PDFSearch.cjs +1 -1
- package/dist/cjs/components/features/PDFSearch.module.cjs +1 -1
- package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -0
- package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
- package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
- package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
- package/dist/cjs/components/features/PDFThumbnails.cjs +1 -1
- package/dist/cjs/components/features/PDFThumbnails.module.cjs +1 -1
- package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
- package/dist/cjs/components/features/PDFZoomControls.module.cjs +1 -1
- package/dist/cjs/components/ui/ToolbarButton.module.cjs +1 -1
- package/dist/cjs/components/ui/icons.cjs +1 -1
- package/dist/cjs/context/ThemeContext.cjs +1 -1
- package/dist/cjs/context/themeContextValue.cjs +1 -0
- package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
- package/dist/cjs/hooks/useAnnotations.cjs +1 -1
- package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
- package/dist/cjs/hooks/useOutline.cjs +1 -1
- package/dist/cjs/hooks/useOverlayRects.cjs +1 -0
- package/dist/cjs/hooks/usePDFLoader.cjs +1 -0
- package/dist/cjs/hooks/usePDFRenderer.cjs +1 -0
- package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
- package/dist/cjs/hooks/useTextLayer.cjs +1 -1
- package/dist/cjs/hooks/useTextSearch.cjs +1 -1
- package/dist/cjs/hooks/useTheme.cjs +1 -0
- package/dist/cjs/hooks/useThumbnails.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pdf-tsx.css +1 -1
- package/dist/components/PDFSidebar.d.ts +1 -1
- package/dist/components/PDFViewer.d.ts +2 -0
- package/dist/components/features/PDFSidebarToggle.d.ts +7 -0
- package/dist/components/ui/icons.d.ts +0 -14
- package/dist/context/PDFViewerContext.d.ts +2 -0
- package/dist/context/ThemeContext.d.ts +0 -6
- package/dist/context/themeContextValue.d.ts +7 -0
- package/dist/es/components/PDFSidebar.js +39 -36
- package/dist/es/components/PDFSidebar.module.js +9 -7
- package/dist/es/components/PDFViewer.js +240 -266
- package/dist/es/components/PDFViewer.module.js +15 -15
- package/dist/es/components/features/PDFAnnotations.js +57 -64
- package/dist/es/components/features/PDFAnnotations.module.js +12 -12
- package/dist/es/components/features/PDFChangeFile.js +3 -3
- package/dist/es/components/features/PDFDownloadButton.js +2 -2
- package/dist/es/components/features/PDFNavigation.js +3 -3
- package/dist/es/components/features/PDFNavigation.module.js +3 -3
- package/dist/es/components/features/PDFOutline.js +7 -7
- package/dist/es/components/features/PDFOutline.module.js +5 -5
- package/dist/es/components/features/PDFPageFit.js +1 -1
- package/dist/es/components/features/PDFPrintButton.js +5 -4
- package/dist/es/components/features/PDFRotationControl.js +1 -1
- package/dist/es/components/features/PDFSearch.js +19 -14
- package/dist/es/components/features/PDFSearch.module.js +5 -4
- package/dist/es/components/features/PDFSidebarToggle.js +21 -0
- package/dist/es/components/features/PDFSignatures.js +158 -116
- package/dist/es/components/features/PDFSignatures.module.js +16 -16
- package/dist/es/components/features/PDFThemeToggle.js +5 -5
- package/dist/es/components/features/PDFThumbnails.js +54 -30
- package/dist/es/components/features/PDFThumbnails.module.js +9 -7
- package/dist/es/components/features/PDFZoomControls.js +1 -1
- package/dist/es/components/features/PDFZoomControls.module.js +1 -1
- package/dist/es/components/ui/ToolbarButton.module.js +2 -2
- package/dist/es/components/ui/icons.js +1 -1
- package/dist/es/context/ThemeContext.js +20 -25
- package/dist/es/context/themeContextValue.js +5 -0
- package/dist/es/hooks/useAnnotationLayer.js +11 -11
- package/dist/es/hooks/useAnnotations.js +0 -1
- package/dist/es/hooks/useKeyboardShortcuts.js +12 -15
- package/dist/es/hooks/useOutline.js +31 -12
- package/dist/es/hooks/useOverlayRects.js +72 -0
- package/dist/es/hooks/usePDFLoader.js +26 -0
- package/dist/es/hooks/usePDFRenderer.js +83 -0
- package/dist/es/hooks/useScrollTracking.js +21 -20
- package/dist/es/hooks/useTextLayer.js +13 -12
- package/dist/es/hooks/useTextSearch.js +30 -18
- package/dist/es/hooks/useTheme.js +10 -0
- package/dist/es/hooks/useThumbnails.js +86 -24
- package/dist/es/index.js +2 -1
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/hooks/useAnnotationLayer.d.ts +2 -2
- package/dist/hooks/useAnnotations.d.ts +0 -5
- package/dist/hooks/useKeyboardShortcuts.d.ts +1 -2
- package/dist/hooks/useOverlayRects.d.ts +21 -0
- package/dist/hooks/usePDFLoader.d.ts +4 -0
- package/dist/hooks/usePDFRenderer.d.ts +16 -0
- package/dist/hooks/useScrollTracking.d.ts +2 -1
- package/dist/hooks/useTextLayer.d.ts +2 -2
- package/dist/hooks/useTheme.d.ts +2 -0
- package/dist/hooks/useThumbnails.d.ts +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/pdf-tsx.cjs.js +5 -0
- package/dist/pdf-tsx.css +2 -0
- package/dist/pdf-tsx.es.js +2637 -0
- package/dist/vite.svg +1 -0
- package/package.json +61 -61
|
@@ -20,6 +20,8 @@ export interface PDFViewerContextValue {
|
|
|
20
20
|
searchMatches: HighlightRect[];
|
|
21
21
|
setSearchMatches: (matches: HighlightRect[]) => void;
|
|
22
22
|
onChangeFile?: (file: File) => void;
|
|
23
|
+
sidebarCollapsed: boolean;
|
|
24
|
+
setSidebarCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
23
25
|
}
|
|
24
26
|
export declare const PDFViewerContext: import('react').Context<PDFViewerContextValue | null>;
|
|
25
27
|
export declare function usePDFViewer(): PDFViewerContextValue;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Theme } from '../theme';
|
|
3
|
-
interface ThemeContextValue {
|
|
4
|
-
isDark: boolean;
|
|
5
|
-
toggleTheme: () => void;
|
|
6
|
-
theme: Theme;
|
|
7
|
-
}
|
|
8
3
|
interface ThemeProviderProps {
|
|
9
4
|
children: ReactNode;
|
|
10
5
|
themeOverrides?: {
|
|
@@ -14,5 +9,4 @@ interface ThemeProviderProps {
|
|
|
14
9
|
defaultTheme?: "light" | "dark";
|
|
15
10
|
}
|
|
16
11
|
export declare function ThemeProvider({ children, themeOverrides, defaultTheme }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function useTheme(): ThemeContextValue;
|
|
18
12
|
export {};
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { usePDFViewer as e } from "../context/PDFViewerContext.js";
|
|
2
|
+
import t from "./PDFSidebar.module.js";
|
|
3
3
|
import { c as n } from "react/compiler-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/PDFSidebar.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
if (
|
|
11
|
-
let t;
|
|
12
|
-
o[4] === c ? t = o[5] : (t = (t, n) => /* @__PURE__ */ r("button", {
|
|
13
|
-
className: `${e.panelButton} ${c === n ? e.panelButtonActive : ""}`,
|
|
14
|
-
onClick: () => d(n),
|
|
15
|
-
title: t.label,
|
|
16
|
-
children: t.icon
|
|
17
|
-
}, n), o[4] = c, o[5] = t), f = s.map(t), o[1] = c, o[2] = s, o[3] = f;
|
|
18
|
-
} else f = o[3];
|
|
19
|
-
let p;
|
|
20
|
-
o[6] === f ? p = o[7] : (p = /* @__PURE__ */ r("div", {
|
|
21
|
-
className: e.buttonBar,
|
|
22
|
-
children: f
|
|
23
|
-
}), o[6] = f, o[7] = p);
|
|
7
|
+
function o(o) {
|
|
8
|
+
let s = n(14), { panels: c } = o, { sidebarCollapsed: l } = e(), [u, d] = r(null), f;
|
|
9
|
+
s[0] === Symbol.for("react.memo_cache_sentinel") ? (f = (e) => d((t) => t === e ? null : e), s[0] = f) : f = s[0];
|
|
10
|
+
let p = f;
|
|
11
|
+
if (l) return null;
|
|
24
12
|
let m;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}), o[8] = c, o[9] = s, o[10] = m) : m = o[10];
|
|
13
|
+
if (s[1] !== u || s[2] !== c) {
|
|
14
|
+
let e;
|
|
15
|
+
s[4] === u ? e = s[5] : (e = (e, n) => /* @__PURE__ */ i("button", {
|
|
16
|
+
className: `${t.panelButton} ${u === n ? t.panelButtonActive : ""}`,
|
|
17
|
+
onClick: () => p(n),
|
|
18
|
+
title: e.label,
|
|
19
|
+
children: e.icon
|
|
20
|
+
}, n), s[4] = u, s[5] = e), m = c.map(e), s[1] = u, s[2] = c, s[3] = m;
|
|
21
|
+
} else m = s[3];
|
|
35
22
|
let h;
|
|
36
|
-
|
|
37
|
-
className:
|
|
38
|
-
children:
|
|
39
|
-
}),
|
|
23
|
+
s[6] === m ? h = s[7] : (h = /* @__PURE__ */ i("div", {
|
|
24
|
+
className: t.buttonBar,
|
|
25
|
+
children: m
|
|
26
|
+
}), s[6] = m, s[7] = h);
|
|
27
|
+
let g;
|
|
28
|
+
s[8] !== u || s[9] !== c ? (g = u !== null && /* @__PURE__ */ a("div", {
|
|
29
|
+
className: t.contentPanel,
|
|
30
|
+
children: [/* @__PURE__ */ i("div", {
|
|
31
|
+
className: t.panelHeader,
|
|
32
|
+
children: c[u].label
|
|
33
|
+
}), /* @__PURE__ */ i("div", {
|
|
34
|
+
className: t.panelBody,
|
|
35
|
+
children: c[u].content
|
|
36
|
+
})]
|
|
37
|
+
}), s[8] = u, s[9] = c, s[10] = g) : g = s[10];
|
|
38
|
+
let _;
|
|
39
|
+
return s[11] !== h || s[12] !== g ? (_ = /* @__PURE__ */ a("div", {
|
|
40
|
+
className: t.wrapper,
|
|
41
|
+
children: [h, g]
|
|
42
|
+
}), s[11] = h, s[12] = g, s[13] = _) : _ = s[13], _;
|
|
40
43
|
}
|
|
41
44
|
//#endregion
|
|
42
|
-
export {
|
|
45
|
+
export { o as PDFSidebar };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
wrapper: "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
wrapper: "_wrapper_a1iar_1",
|
|
3
|
+
wrapperCollapsed: "_wrapperCollapsed_a1iar_7",
|
|
4
|
+
buttonBar: "_buttonBar_a1iar_16",
|
|
5
|
+
toggleButton: "_toggleButton_a1iar_26",
|
|
6
|
+
panelButton: "_panelButton_a1iar_35",
|
|
7
|
+
panelButtonActive: "_panelButtonActive_a1iar_55",
|
|
8
|
+
contentPanel: "_contentPanel_a1iar_64",
|
|
9
|
+
panelHeader: "_panelHeader_a1iar_72",
|
|
10
|
+
panelBody: "_panelBody_a1iar_84"
|
|
9
11
|
};
|
|
10
12
|
//#endregion
|
|
11
13
|
export { e as default };
|
|
@@ -3,274 +3,248 @@ import { useScrollTracking as t } from "../hooks/useScrollTracking.js";
|
|
|
3
3
|
import { useKeyboardShortcuts as n } from "../hooks/useKeyboardShortcuts.js";
|
|
4
4
|
import { useTextLayer as r } from "../hooks/useTextLayer.js";
|
|
5
5
|
import { isSafeUrl as i } from "../utils/url.js";
|
|
6
|
-
import { useAnnotationLayer as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
6
|
+
import { useAnnotationLayer as ee } from "../hooks/useAnnotationLayer.js";
|
|
7
|
+
import { usePDFLoader as te } from "../hooks/usePDFLoader.js";
|
|
8
|
+
import { usePDFRenderer as ne } from "../hooks/usePDFRenderer.js";
|
|
9
|
+
import { useOverlayRects as re } from "../hooks/useOverlayRects.js";
|
|
10
|
+
import { computeFit as ie } from "../utils/pdfFit.js";
|
|
11
|
+
import { ThemeProvider as ae } from "../context/ThemeContext.js";
|
|
12
|
+
import a from "./PDFViewer.module.js";
|
|
13
|
+
import { c as oe } from "react/compiler-runtime";
|
|
14
|
+
import { useEffect as o, useRef as s, useState as c } from "react";
|
|
15
|
+
import * as se from "pdfjs-dist";
|
|
16
|
+
import { Fragment as ce, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
13
17
|
//#region src/components/PDFViewer.tsx
|
|
14
|
-
var
|
|
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
|
-
canvasRefs:
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
l(() => {
|
|
56
|
-
(async () => {
|
|
57
|
-
let e = new FileReader();
|
|
58
|
-
e.onload = async (e) => {
|
|
59
|
-
let t = new Uint8Array(e.target?.result);
|
|
60
|
-
try {
|
|
61
|
-
let e = await f.getDocument(t).promise;
|
|
62
|
-
w(e), E(e.numPages), M(null), P(null), R(/* @__PURE__ */ new Set()), B([]), H.current = Array(e.numPages).fill(null), U.current = Array(e.numPages).fill(null);
|
|
63
|
-
} catch (e) {
|
|
64
|
-
console.error("Errore caricamento:", e);
|
|
65
|
-
}
|
|
66
|
-
}, e.readAsArrayBuffer(h);
|
|
67
|
-
})();
|
|
68
|
-
}, [h]), l(() => {
|
|
69
|
-
if (!C) return;
|
|
70
|
-
R(/* @__PURE__ */ new Set());
|
|
71
|
-
let e = !1;
|
|
72
|
-
return (async () => {
|
|
73
|
-
let t = U.current.map((e) => e ? (e.cancel(), e.promise.catch(() => {})) : Promise.resolve());
|
|
74
|
-
if (await Promise.all(t), U.current = Array(C.numPages).fill(null), e) return;
|
|
75
|
-
let n = [];
|
|
76
|
-
for (let e = 1; e <= C.numPages; e++) {
|
|
77
|
-
let t = (await C.getPage(e)).getViewport({
|
|
78
|
-
scale: D,
|
|
79
|
-
rotation: k
|
|
80
|
-
});
|
|
81
|
-
n.push({
|
|
82
|
-
width: t.width,
|
|
83
|
-
height: t.height
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (!e) {
|
|
87
|
-
B(n);
|
|
88
|
-
for (let t = 1; t <= C.numPages; t++) {
|
|
89
|
-
if (e) return;
|
|
90
|
-
let n = await C.getPage(t), r = n.getViewport({
|
|
91
|
-
scale: D,
|
|
92
|
-
rotation: k
|
|
93
|
-
}), i = H.current[t - 1];
|
|
94
|
-
if (i) {
|
|
95
|
-
let a = i.getContext("2d");
|
|
96
|
-
if (a) {
|
|
97
|
-
i.height = r.height, i.width = r.width;
|
|
98
|
-
let o = n.render({
|
|
99
|
-
canvasContext: a,
|
|
100
|
-
viewport: r,
|
|
101
|
-
canvas: i
|
|
102
|
-
});
|
|
103
|
-
U.current[t - 1] = o;
|
|
104
|
-
try {
|
|
105
|
-
await o.promise, e || R((e) => new Set(e).add(t));
|
|
106
|
-
} catch (e) {
|
|
107
|
-
e && typeof e == "object" && "name" in e && e.name !== "RenderingCancelledException" && console.error("Render error:", e);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
})(), () => {
|
|
114
|
-
e = !0, U.current.forEach((e) => e?.cancel());
|
|
115
|
-
};
|
|
116
|
-
}, [
|
|
117
|
-
C,
|
|
118
|
-
D,
|
|
119
|
-
k
|
|
120
|
-
]);
|
|
121
|
-
let [Y, X] = d([]);
|
|
122
|
-
return l(() => {
|
|
123
|
-
if (!C || F.length === 0) {
|
|
124
|
-
X([]);
|
|
125
|
-
return;
|
|
18
|
+
var le = 2, d = (i) => {
|
|
19
|
+
let d = oe(96), { file: f, workerSrc: p, sidebar: me, toolbar: m, onChangeFile: he, themeOverrides: ge, defaultTheme: _e, defaultFit: h, className: ve, style: ye } = i, g, _;
|
|
20
|
+
d[0] === p ? (g = d[1], _ = d[2]) : (g = () => {
|
|
21
|
+
se.GlobalWorkerOptions.workerSrc = p;
|
|
22
|
+
}, _ = [p], d[0] = p, d[1] = g, d[2] = _), o(g, _);
|
|
23
|
+
let [v, be] = c(1), [y, xe] = c(0), [b, Se] = c(null), x;
|
|
24
|
+
d[3] === Symbol.for("react.memo_cache_sentinel") ? (x = [], d[3] = x) : x = d[3];
|
|
25
|
+
let [S, Ce] = c(x), [we, Te] = c(!1), C = s(null), w;
|
|
26
|
+
d[4] === Symbol.for("react.memo_cache_sentinel") ? (w = [], d[4] = w) : w = d[4];
|
|
27
|
+
let Ee = s(w), T;
|
|
28
|
+
d[5] === Symbol.for("react.memo_cache_sentinel") ? (T = [], d[5] = T) : T = d[5];
|
|
29
|
+
let E = s(T), De = s(y), D, O;
|
|
30
|
+
d[6] === y ? (D = d[7], O = d[8]) : (D = () => {
|
|
31
|
+
De.current = y;
|
|
32
|
+
}, O = [y], d[6] = y, d[7] = D, d[8] = O), o(D, O);
|
|
33
|
+
let [Oe, ke] = c(null);
|
|
34
|
+
Oe !== f && (ke(f), Se(null));
|
|
35
|
+
let { pdf: k, numPages: A } = te(f), j, M;
|
|
36
|
+
d[9] === k ? (j = d[10], M = d[11]) : (j = () => {
|
|
37
|
+
k && (Ee.current = Array(k.numPages).fill(null), E.current = Array(k.numPages).fill(null));
|
|
38
|
+
}, M = [k], d[9] = k, d[10] = j, d[11] = M), o(j, M);
|
|
39
|
+
let N, P;
|
|
40
|
+
d[12] !== h || d[13] !== k ? (N = () => {
|
|
41
|
+
!k || !h || !C.current || ie(h, k, C.current, De.current).then(be);
|
|
42
|
+
}, P = [k, h], d[12] = h, d[13] = k, d[14] = N, d[15] = P) : (N = d[14], P = d[15]), o(N, P);
|
|
43
|
+
let F;
|
|
44
|
+
d[16] !== A || d[17] !== k || d[18] !== y || d[19] !== v ? (F = {
|
|
45
|
+
pdf: k,
|
|
46
|
+
numPages: A,
|
|
47
|
+
zoom: v,
|
|
48
|
+
rotation: y,
|
|
49
|
+
containerRef: C,
|
|
50
|
+
pageRefs: Ee,
|
|
51
|
+
canvasRefs: E
|
|
52
|
+
}, d[16] = A, d[17] = k, d[18] = y, d[19] = v, d[20] = F) : F = d[20];
|
|
53
|
+
let { currentPage: I, goToPage: L } = t(F), Ae;
|
|
54
|
+
bb0: {
|
|
55
|
+
if (A === 0) {
|
|
56
|
+
let e;
|
|
57
|
+
d[21] === Symbol.for("react.memo_cache_sentinel") ? (e = [], d[21] = e) : e = d[21], Ae = e;
|
|
58
|
+
break bb0;
|
|
126
59
|
}
|
|
127
|
-
let e
|
|
128
|
-
|
|
129
|
-
let t =
|
|
130
|
-
for (let n
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
]
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
j && N?.page === t + 1 && /* @__PURE__ */ p("div", {
|
|
258
|
-
className: c.highlightOverlay,
|
|
259
|
-
style: {
|
|
260
|
-
left: N.x,
|
|
261
|
-
top: N.y,
|
|
262
|
-
width: N.width,
|
|
263
|
-
height: N.height
|
|
264
|
-
}
|
|
265
|
-
})
|
|
266
|
-
]
|
|
267
|
-
}, `${t}-${k}`);
|
|
268
|
-
})
|
|
269
|
-
})]
|
|
270
|
-
})]
|
|
271
|
-
})
|
|
60
|
+
let e;
|
|
61
|
+
if (d[22] !== I || d[23] !== b || d[24] !== A || d[25] !== S) {
|
|
62
|
+
let t = /* @__PURE__ */ new Set(), n = Math.max(I - le, 1), r = Math.min(I + le, A);
|
|
63
|
+
for (let e = n; e <= r; e++) t.add(e);
|
|
64
|
+
b && t.add(b.page);
|
|
65
|
+
for (let e of S) t.add(e.page);
|
|
66
|
+
e = Array.from(t).sort(ue), d[22] = I, d[23] = b, d[24] = A, d[25] = S, d[26] = e;
|
|
67
|
+
} else e = d[26];
|
|
68
|
+
Ae = e;
|
|
69
|
+
}
|
|
70
|
+
let R = Ae, z;
|
|
71
|
+
d[27] !== k || d[28] !== y || d[29] !== R || d[30] !== v ? (z = {
|
|
72
|
+
pdf: k,
|
|
73
|
+
zoom: v,
|
|
74
|
+
rotation: y,
|
|
75
|
+
visiblePages: R,
|
|
76
|
+
canvasRefs: E
|
|
77
|
+
}, d[27] = k, d[28] = y, d[29] = R, d[30] = v, d[31] = z) : z = d[31];
|
|
78
|
+
let { pageSizes: je, renderedPages: B } = ne(z), V;
|
|
79
|
+
if (d[32] !== B || d[33] !== R) {
|
|
80
|
+
let e = new Set(R);
|
|
81
|
+
for (let t of B) e.add(t);
|
|
82
|
+
V = Array.from(e).sort(de), d[32] = B, d[33] = R, d[34] = V;
|
|
83
|
+
} else V = d[34];
|
|
84
|
+
let H = V, U;
|
|
85
|
+
d[35] !== I || d[36] !== L || d[37] !== k ? (U = {
|
|
86
|
+
pdf: k,
|
|
87
|
+
currentPage: I,
|
|
88
|
+
goToPage: L,
|
|
89
|
+
setZoom: be,
|
|
90
|
+
setRotation: xe
|
|
91
|
+
}, d[35] = I, d[36] = L, d[37] = k, d[38] = U) : U = d[38], n(U);
|
|
92
|
+
let W;
|
|
93
|
+
d[39] !== H || d[40] !== k || d[41] !== y || d[42] !== v ? (W = {
|
|
94
|
+
pdf: k,
|
|
95
|
+
zoom: v,
|
|
96
|
+
rotation: y,
|
|
97
|
+
mountedPages: H,
|
|
98
|
+
canvasRefs: E
|
|
99
|
+
}, d[39] = H, d[40] = k, d[41] = y, d[42] = v, d[43] = W) : W = d[43];
|
|
100
|
+
let Me = r(W), G;
|
|
101
|
+
d[44] !== L || d[45] !== H || d[46] !== k || d[47] !== y || d[48] !== v ? (G = {
|
|
102
|
+
pdf: k,
|
|
103
|
+
zoom: v,
|
|
104
|
+
rotation: y,
|
|
105
|
+
mountedPages: H,
|
|
106
|
+
goToPage: L
|
|
107
|
+
}, d[44] = L, d[45] = H, d[46] = k, d[47] = y, d[48] = v, d[49] = G) : G = d[49];
|
|
108
|
+
let Ne = ee(G), K;
|
|
109
|
+
d[50] !== b || d[51] !== k || d[52] !== y || d[53] !== S || d[54] !== v ? (K = {
|
|
110
|
+
pdf: k,
|
|
111
|
+
highlight: b,
|
|
112
|
+
searchMatches: S,
|
|
113
|
+
zoom: v,
|
|
114
|
+
rotation: y
|
|
115
|
+
}, d[50] = b, d[51] = k, d[52] = y, d[53] = S, d[54] = v, d[55] = K) : K = d[55];
|
|
116
|
+
let { overlayRect: q, searchOverlays: Pe } = re(K), J;
|
|
117
|
+
d[56] !== I || d[57] !== f || d[58] !== L || d[59] !== b || d[60] !== A || d[61] !== he || d[62] !== k || d[63] !== y || d[64] !== S || d[65] !== we || d[66] !== v ? (J = {
|
|
118
|
+
pdf: k,
|
|
119
|
+
numPages: A,
|
|
120
|
+
zoom: v,
|
|
121
|
+
setZoom: be,
|
|
122
|
+
rotation: y,
|
|
123
|
+
setRotation: xe,
|
|
124
|
+
currentPage: I,
|
|
125
|
+
goToPage: L,
|
|
126
|
+
containerRef: C,
|
|
127
|
+
canvasRefs: E,
|
|
128
|
+
file: f,
|
|
129
|
+
highlight: b,
|
|
130
|
+
setHighlight: Se,
|
|
131
|
+
searchMatches: S,
|
|
132
|
+
setSearchMatches: Ce,
|
|
133
|
+
onChangeFile: he,
|
|
134
|
+
sidebarCollapsed: we,
|
|
135
|
+
setSidebarCollapsed: Te
|
|
136
|
+
}, d[56] = I, d[57] = f, d[58] = L, d[59] = b, d[60] = A, d[61] = he, d[62] = k, d[63] = y, d[64] = S, d[65] = we, d[66] = v, d[67] = J) : J = d[67];
|
|
137
|
+
let Fe = `${a.appLayout}${ve ? ` ${ve}` : ""}`, Y;
|
|
138
|
+
d[68] === m ? Y = d[69] : (Y = m && /* @__PURE__ */ l("div", {
|
|
139
|
+
className: a.toolbar,
|
|
140
|
+
children: m
|
|
141
|
+
}), d[68] = m, d[69] = Y);
|
|
142
|
+
let X;
|
|
143
|
+
d[70] !== b || d[71] !== Ne || d[72] !== H || d[73] !== A || d[74] !== q || d[75] !== je || d[76] !== B || d[77] !== y || d[78] !== Pe || d[79] !== Me ? (X = /* @__PURE__ */ l("div", {
|
|
144
|
+
className: a.scrollContainer,
|
|
145
|
+
ref: C,
|
|
146
|
+
children: Array.from({ length: A }, (e, t) => {
|
|
147
|
+
let n = B.has(t + 1), r = je[t], i = H.includes(t + 1);
|
|
148
|
+
return /* @__PURE__ */ u("div", {
|
|
149
|
+
className: a.pageWrapper,
|
|
150
|
+
ref: (e) => {
|
|
151
|
+
Ee.current[t] = e;
|
|
152
|
+
},
|
|
153
|
+
style: r ? {
|
|
154
|
+
width: r.width,
|
|
155
|
+
height: r.height
|
|
156
|
+
} : void 0,
|
|
157
|
+
children: [
|
|
158
|
+
r && !n && /* @__PURE__ */ l("div", {
|
|
159
|
+
className: a.pageSkeleton,
|
|
160
|
+
style: {
|
|
161
|
+
width: r.width,
|
|
162
|
+
height: r.height
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
i && /* @__PURE__ */ u(ce, { children: [/* @__PURE__ */ l("canvas", {
|
|
166
|
+
className: a.pageCanvas,
|
|
167
|
+
ref: (e) => {
|
|
168
|
+
E.current[t] = e;
|
|
169
|
+
},
|
|
170
|
+
style: { display: n ? "block" : "none" }
|
|
171
|
+
}), /* @__PURE__ */ l("div", {
|
|
172
|
+
className: `textLayer ${a.textLayer}`,
|
|
173
|
+
ref: (e) => {
|
|
174
|
+
Me.current[t] = e;
|
|
175
|
+
}
|
|
176
|
+
})] }),
|
|
177
|
+
Ne.filter((e) => e.page === t + 1).map(fe),
|
|
178
|
+
Pe.filter((e) => e.page === t + 1).map(pe),
|
|
179
|
+
b && q?.page === t + 1 && /* @__PURE__ */ l("div", {
|
|
180
|
+
className: a.highlightOverlay,
|
|
181
|
+
style: {
|
|
182
|
+
left: q.x,
|
|
183
|
+
top: q.y,
|
|
184
|
+
width: q.width,
|
|
185
|
+
height: q.height
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
}, `${t}-${y}`);
|
|
272
190
|
})
|
|
273
|
-
});
|
|
191
|
+
}), d[70] = b, d[71] = Ne, d[72] = H, d[73] = A, d[74] = q, d[75] = je, d[76] = B, d[77] = y, d[78] = Pe, d[79] = Me, d[80] = X) : X = d[80];
|
|
192
|
+
let Z;
|
|
193
|
+
d[81] !== me || d[82] !== X ? (Z = /* @__PURE__ */ u("div", {
|
|
194
|
+
className: a.body,
|
|
195
|
+
children: [me, X]
|
|
196
|
+
}), d[81] = me, d[82] = X, d[83] = Z) : Z = d[83];
|
|
197
|
+
let Q;
|
|
198
|
+
d[84] !== ye || d[85] !== Fe || d[86] !== Y || d[87] !== Z ? (Q = /* @__PURE__ */ u("div", {
|
|
199
|
+
className: Fe,
|
|
200
|
+
style: ye,
|
|
201
|
+
children: [Y, Z]
|
|
202
|
+
}), d[84] = ye, d[85] = Fe, d[86] = Y, d[87] = Z, d[88] = Q) : Q = d[88];
|
|
203
|
+
let $;
|
|
204
|
+
d[89] !== J || d[90] !== Q ? ($ = /* @__PURE__ */ l(e.Provider, {
|
|
205
|
+
value: J,
|
|
206
|
+
children: Q
|
|
207
|
+
}), d[89] = J, d[90] = Q, d[91] = $) : $ = d[91];
|
|
208
|
+
let Ie;
|
|
209
|
+
return d[92] !== _e || d[93] !== $ || d[94] !== ge ? (Ie = /* @__PURE__ */ l(ae, {
|
|
210
|
+
themeOverrides: ge,
|
|
211
|
+
defaultTheme: _e,
|
|
212
|
+
children: $
|
|
213
|
+
}), d[92] = _e, d[93] = $, d[94] = ge, d[95] = Ie) : Ie = d[95], Ie;
|
|
274
214
|
};
|
|
215
|
+
function ue(e, t) {
|
|
216
|
+
return e - t;
|
|
217
|
+
}
|
|
218
|
+
function de(e, t) {
|
|
219
|
+
return e - t;
|
|
220
|
+
}
|
|
221
|
+
function fe(e, t) {
|
|
222
|
+
return /* @__PURE__ */ l("a", {
|
|
223
|
+
className: a.linkOverlay,
|
|
224
|
+
href: e.url && i(e.url) ? e.url : "#",
|
|
225
|
+
target: "_blank",
|
|
226
|
+
rel: "noopener noreferrer",
|
|
227
|
+
style: {
|
|
228
|
+
left: e.x,
|
|
229
|
+
top: e.y,
|
|
230
|
+
width: e.width,
|
|
231
|
+
height: e.height
|
|
232
|
+
},
|
|
233
|
+
onClick: (t) => {
|
|
234
|
+
(!e.url || !i(e.url)) && (t.preventDefault(), e.url || e._handleClick());
|
|
235
|
+
}
|
|
236
|
+
}, t);
|
|
237
|
+
}
|
|
238
|
+
function pe(e, t) {
|
|
239
|
+
return /* @__PURE__ */ l("div", {
|
|
240
|
+
className: a.searchMatchOverlay,
|
|
241
|
+
style: {
|
|
242
|
+
left: e.x,
|
|
243
|
+
top: e.y,
|
|
244
|
+
width: e.width,
|
|
245
|
+
height: e.height
|
|
246
|
+
}
|
|
247
|
+
}, t);
|
|
248
|
+
}
|
|
275
249
|
//#endregion
|
|
276
|
-
export {
|
|
250
|
+
export { d as default };
|