pdf-tsx 0.2.0 → 0.4.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/README.md +107 -33
- 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/PDFNavigation.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/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/context/ThemeContext.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pdf-tsx.css +1 -1
- package/dist/cjs/utils/pdfFit.cjs +1 -0
- package/dist/components/PDFSidebar.d.ts +2 -1
- package/dist/components/PDFViewer.d.ts +4 -0
- package/dist/components/features/PDFAnnotations.d.ts +4 -0
- package/dist/components/features/PDFSidebarToggle.d.ts +7 -0
- package/dist/components/features/PDFSignatures.d.ts +4 -0
- package/dist/context/PDFViewerContext.d.ts +2 -0
- package/dist/context/ThemeContext.d.ts +2 -1
- package/dist/es/components/PDFSidebar.js +48 -38
- package/dist/es/components/PDFSidebar.module.js +9 -7
- package/dist/es/components/PDFViewer.js +150 -137
- package/dist/es/components/PDFViewer.module.js +15 -15
- package/dist/es/components/features/PDFAnnotations.js +16 -2
- package/dist/es/components/features/PDFAnnotations.module.js +12 -10
- package/dist/es/components/features/PDFNavigation.module.js +3 -3
- package/dist/es/components/features/PDFPageFit.js +24 -34
- package/dist/es/components/features/PDFPrintButton.js +2 -2
- package/dist/es/components/features/PDFSearch.js +16 -11
- package/dist/es/components/features/PDFSearch.module.js +5 -4
- package/dist/es/components/features/PDFSidebarToggle.js +20 -0
- package/dist/es/components/features/PDFSignatures.js +20 -12
- package/dist/es/components/features/PDFSignatures.module.js +16 -14
- package/dist/es/context/ThemeContext.js +24 -24
- package/dist/es/index.js +15 -14
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/es/utils/pdfFit.js +13 -0
- package/dist/index.d.ts +3 -2
- package/dist/utils/pdfFit.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,42 +1,52 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { usePDFViewer as e } from "../context/PDFViewerContext.js";
|
|
2
|
+
import t from "./PDFSidebar.module.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
function o(o) {
|
|
8
|
+
let s = r(18), { panels: c, collapseIcon: l } = o, { sidebarCollapsed: u, setSidebarCollapsed: d } = e(), [f, p] = n(null), m;
|
|
9
|
+
s[0] === Symbol.for("react.memo_cache_sentinel") ? (m = (e) => p((t) => t === e ? null : e), s[0] = m) : m = s[0];
|
|
10
|
+
let h = m;
|
|
11
|
+
if (u) return null;
|
|
12
|
+
let g;
|
|
13
|
+
s[1] !== l || s[2] !== d ? (g = l != null && /* @__PURE__ */ i("button", {
|
|
14
|
+
className: `${t.panelButton} ${t.toggleButton}`,
|
|
15
|
+
onClick: () => d(!0),
|
|
16
|
+
title: "Comprimi sidebar",
|
|
17
|
+
children: l
|
|
18
|
+
}), s[1] = l, s[2] = d, s[3] = g) : g = s[3];
|
|
19
|
+
let _;
|
|
20
|
+
if (s[4] !== f || s[5] !== c) {
|
|
21
|
+
let e;
|
|
22
|
+
s[7] === f ? e = s[8] : (e = (e, n) => /* @__PURE__ */ i("button", {
|
|
23
|
+
className: `${t.panelButton} ${f === n ? t.panelButtonActive : ""}`,
|
|
24
|
+
onClick: () => h(n),
|
|
25
|
+
title: e.label,
|
|
26
|
+
children: e.icon
|
|
27
|
+
}, n), s[7] = f, s[8] = e), _ = c.map(e), s[4] = f, s[5] = c, s[6] = _;
|
|
28
|
+
} else _ = s[6];
|
|
29
|
+
let v;
|
|
30
|
+
s[9] !== g || s[10] !== _ ? (v = /* @__PURE__ */ a("div", {
|
|
31
|
+
className: t.buttonBar,
|
|
32
|
+
children: [g, _]
|
|
33
|
+
}), s[9] = g, s[10] = _, s[11] = v) : v = s[11];
|
|
34
|
+
let y;
|
|
35
|
+
s[12] !== f || s[13] !== c ? (y = f !== null && /* @__PURE__ */ a("div", {
|
|
36
|
+
className: t.contentPanel,
|
|
37
|
+
children: [/* @__PURE__ */ i("div", {
|
|
38
|
+
className: t.panelHeader,
|
|
39
|
+
children: c[f].label
|
|
40
|
+
}), /* @__PURE__ */ i("div", {
|
|
41
|
+
className: t.panelBody,
|
|
42
|
+
children: c[f].content
|
|
33
43
|
})]
|
|
34
|
-
}),
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
className:
|
|
38
|
-
children: [
|
|
39
|
-
}),
|
|
44
|
+
}), s[12] = f, s[13] = c, s[14] = y) : y = s[14];
|
|
45
|
+
let b;
|
|
46
|
+
return s[15] !== v || s[16] !== y ? (b = /* @__PURE__ */ a("div", {
|
|
47
|
+
className: t.wrapper,
|
|
48
|
+
children: [v, y]
|
|
49
|
+
}), s[15] = v, s[16] = y, s[17] = b) : b = s[17], b;
|
|
40
50
|
}
|
|
41
51
|
//#endregion
|
|
42
|
-
export {
|
|
52
|
+
export { o as PDFSidebar };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
wrapper: "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
wrapper: "_wrapper_1xud4_1",
|
|
3
|
+
wrapperCollapsed: "_wrapperCollapsed_1xud4_13",
|
|
4
|
+
buttonBar: "_buttonBar_1xud4_31",
|
|
5
|
+
toggleButton: "_toggleButton_1xud4_51",
|
|
6
|
+
panelButton: "_panelButton_1xud4_69",
|
|
7
|
+
panelButtonActive: "_panelButtonActive_1xud4_109",
|
|
8
|
+
contentPanel: "_contentPanel_1xud4_127",
|
|
9
|
+
panelHeader: "_panelHeader_1xud4_143",
|
|
10
|
+
panelBody: "_panelBody_1xud4_167"
|
|
9
11
|
};
|
|
10
12
|
//#endregion
|
|
11
13
|
export { e as default };
|
|
@@ -4,70 +4,79 @@ 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
6
|
import { useAnnotationLayer as a } from "../hooks/useAnnotationLayer.js";
|
|
7
|
-
import {
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
7
|
+
import { computeFit as o } from "../utils/pdfFit.js";
|
|
8
|
+
import { ThemeProvider as s } from "../context/ThemeContext.js";
|
|
9
|
+
import c from "./PDFViewer.module.js";
|
|
10
|
+
import { useEffect as l, useRef as u, useState as d } from "react";
|
|
11
|
+
import * as f from "pdfjs-dist";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/PDFViewer.tsx
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
let [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
var h = ({ file: h, workerSrc: g, sidebar: _, toolbar: v, onChangeFile: y, themeOverrides: b, defaultTheme: x, defaultFit: S, className: C, style: w }) => {
|
|
15
|
+
l(() => {
|
|
16
|
+
f.GlobalWorkerOptions.workerSrc = g;
|
|
17
|
+
}, [g]);
|
|
18
|
+
let [T, E] = d(null), [D, O] = d(0), [k, A] = d(1), [j, M] = d(0), [N, P] = d(null), [F, I] = d(null), [L, R] = d([]), [z, B] = d(!1), [V, H] = d(/* @__PURE__ */ new Set()), [U, W] = d([]), G = u(null), K = u([]), q = u([]), J = u(j);
|
|
19
|
+
l(() => {
|
|
20
|
+
J.current = j;
|
|
21
|
+
}, [j]), l(() => {
|
|
22
|
+
if (!T || !S || !G.current) return;
|
|
23
|
+
let e = G.current;
|
|
24
|
+
o(S, T, e, J.current).then(A);
|
|
25
|
+
}, [T, S]);
|
|
26
|
+
let { currentPage: Y, goToPage: X } = t({
|
|
27
|
+
pdf: T,
|
|
28
|
+
numPages: D,
|
|
29
|
+
zoom: k,
|
|
30
|
+
rotation: j,
|
|
31
|
+
containerRef: G,
|
|
32
|
+
canvasRefs: K
|
|
24
33
|
});
|
|
25
34
|
n({
|
|
26
|
-
pdf:
|
|
27
|
-
currentPage:
|
|
28
|
-
numPages:
|
|
29
|
-
goToPage:
|
|
30
|
-
setZoom:
|
|
31
|
-
setRotation:
|
|
35
|
+
pdf: T,
|
|
36
|
+
currentPage: Y,
|
|
37
|
+
numPages: D,
|
|
38
|
+
goToPage: X,
|
|
39
|
+
setZoom: A,
|
|
40
|
+
setRotation: M
|
|
32
41
|
});
|
|
33
|
-
let
|
|
34
|
-
pdf:
|
|
35
|
-
zoom:
|
|
36
|
-
rotation:
|
|
37
|
-
numPages:
|
|
38
|
-
canvasRefs:
|
|
39
|
-
}),
|
|
40
|
-
pdf:
|
|
41
|
-
zoom:
|
|
42
|
-
rotation:
|
|
43
|
-
numPages:
|
|
44
|
-
goToPage:
|
|
42
|
+
let Z = r({
|
|
43
|
+
pdf: T,
|
|
44
|
+
zoom: k,
|
|
45
|
+
rotation: j,
|
|
46
|
+
numPages: D,
|
|
47
|
+
canvasRefs: K
|
|
48
|
+
}), Q = a({
|
|
49
|
+
pdf: T,
|
|
50
|
+
zoom: k,
|
|
51
|
+
rotation: j,
|
|
52
|
+
numPages: D,
|
|
53
|
+
goToPage: X
|
|
45
54
|
});
|
|
46
|
-
|
|
55
|
+
l(() => {
|
|
47
56
|
(async () => {
|
|
48
57
|
let e = new FileReader();
|
|
49
58
|
e.onload = async (e) => {
|
|
50
59
|
let t = new Uint8Array(e.target?.result);
|
|
51
60
|
try {
|
|
52
|
-
let e = await
|
|
53
|
-
|
|
61
|
+
let e = await f.getDocument(t).promise;
|
|
62
|
+
E(e), O(e.numPages), P(null), I(null), H(/* @__PURE__ */ new Set()), W([]), K.current = Array(e.numPages).fill(null), q.current = Array(e.numPages).fill(null);
|
|
54
63
|
} catch (e) {
|
|
55
64
|
console.error("Errore caricamento:", e);
|
|
56
65
|
}
|
|
57
|
-
}, e.readAsArrayBuffer(
|
|
66
|
+
}, e.readAsArrayBuffer(h);
|
|
58
67
|
})();
|
|
59
|
-
}, [
|
|
60
|
-
if (!
|
|
61
|
-
|
|
68
|
+
}, [h]), l(() => {
|
|
69
|
+
if (!T) return;
|
|
70
|
+
H(/* @__PURE__ */ new Set());
|
|
62
71
|
let e = !1;
|
|
63
72
|
return (async () => {
|
|
64
|
-
let t =
|
|
65
|
-
if (await Promise.all(t),
|
|
73
|
+
let t = q.current.map((e) => e ? (e.cancel(), e.promise.catch(() => {})) : Promise.resolve());
|
|
74
|
+
if (await Promise.all(t), q.current = Array(T.numPages).fill(null), e) return;
|
|
66
75
|
let n = [];
|
|
67
|
-
for (let e = 1; e <=
|
|
68
|
-
let t = (await
|
|
69
|
-
scale:
|
|
70
|
-
rotation:
|
|
76
|
+
for (let e = 1; e <= T.numPages; e++) {
|
|
77
|
+
let t = (await T.getPage(e)).getViewport({
|
|
78
|
+
scale: k,
|
|
79
|
+
rotation: j
|
|
71
80
|
});
|
|
72
81
|
n.push({
|
|
73
82
|
width: t.width,
|
|
@@ -75,13 +84,13 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
75
84
|
});
|
|
76
85
|
}
|
|
77
86
|
if (!e) {
|
|
78
|
-
|
|
79
|
-
for (let t = 1; t <=
|
|
87
|
+
W(n);
|
|
88
|
+
for (let t = 1; t <= T.numPages; t++) {
|
|
80
89
|
if (e) return;
|
|
81
|
-
let n = await
|
|
82
|
-
scale:
|
|
83
|
-
rotation:
|
|
84
|
-
}), i =
|
|
90
|
+
let n = await T.getPage(t), r = n.getViewport({
|
|
91
|
+
scale: k,
|
|
92
|
+
rotation: j
|
|
93
|
+
}), i = K.current[t - 1];
|
|
85
94
|
if (i) {
|
|
86
95
|
let a = i.getContext("2d");
|
|
87
96
|
if (a) {
|
|
@@ -91,9 +100,9 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
91
100
|
viewport: r,
|
|
92
101
|
canvas: i
|
|
93
102
|
});
|
|
94
|
-
|
|
103
|
+
q.current[t - 1] = o;
|
|
95
104
|
try {
|
|
96
|
-
await o.promise, e ||
|
|
105
|
+
await o.promise, e || H((e) => new Set(e).add(t));
|
|
97
106
|
} catch (e) {
|
|
98
107
|
e && typeof e == "object" && "name" in e && e.name !== "RenderingCancelledException" && console.error("Render error:", e);
|
|
99
108
|
}
|
|
@@ -102,27 +111,27 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
102
111
|
}
|
|
103
112
|
}
|
|
104
113
|
})(), () => {
|
|
105
|
-
e = !0,
|
|
114
|
+
e = !0, q.current.forEach((e) => e?.cancel());
|
|
106
115
|
};
|
|
107
116
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
T,
|
|
118
|
+
k,
|
|
119
|
+
j
|
|
111
120
|
]);
|
|
112
|
-
let [
|
|
113
|
-
return
|
|
114
|
-
if (!
|
|
115
|
-
|
|
121
|
+
let [ee, $] = d([]);
|
|
122
|
+
return l(() => {
|
|
123
|
+
if (!T || L.length === 0) {
|
|
124
|
+
$([]);
|
|
116
125
|
return;
|
|
117
126
|
}
|
|
118
127
|
let e = !1;
|
|
119
128
|
return (async () => {
|
|
120
129
|
let t = [];
|
|
121
|
-
for (let n of
|
|
130
|
+
for (let n of L) {
|
|
122
131
|
if (e) break;
|
|
123
|
-
let [r, i, a, o] = (await
|
|
124
|
-
scale:
|
|
125
|
-
rotation:
|
|
132
|
+
let [r, i, a, o] = (await T.getPage(n.page)).getViewport({
|
|
133
|
+
scale: k,
|
|
134
|
+
rotation: j
|
|
126
135
|
}).convertToViewportRectangle(n.pdfRect);
|
|
127
136
|
t.push({
|
|
128
137
|
page: n.page,
|
|
@@ -132,25 +141,25 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
132
141
|
height: Math.abs(o - i)
|
|
133
142
|
});
|
|
134
143
|
}
|
|
135
|
-
e ||
|
|
144
|
+
e || $(t);
|
|
136
145
|
})(), () => {
|
|
137
146
|
e = !0;
|
|
138
147
|
};
|
|
139
148
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
]),
|
|
145
|
-
if (!
|
|
149
|
+
L,
|
|
150
|
+
k,
|
|
151
|
+
j,
|
|
152
|
+
T
|
|
153
|
+
]), l(() => {
|
|
154
|
+
if (!N || !T) return;
|
|
146
155
|
let e = !1;
|
|
147
156
|
return (async () => {
|
|
148
|
-
let [t, n, r, i] = (await
|
|
149
|
-
scale:
|
|
150
|
-
rotation:
|
|
151
|
-
}).convertToViewportRectangle(
|
|
152
|
-
e ||
|
|
153
|
-
page:
|
|
157
|
+
let [t, n, r, i] = (await T.getPage(N.page)).getViewport({
|
|
158
|
+
scale: k,
|
|
159
|
+
rotation: j
|
|
160
|
+
}).convertToViewportRectangle(N.pdfRect);
|
|
161
|
+
e || I({
|
|
162
|
+
page: N.page,
|
|
154
163
|
x: Math.min(t, r),
|
|
155
164
|
y: Math.min(n, i),
|
|
156
165
|
width: Math.abs(r - t),
|
|
@@ -160,68 +169,72 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
160
169
|
e = !0;
|
|
161
170
|
};
|
|
162
171
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
]), /* @__PURE__ */
|
|
168
|
-
themeOverrides:
|
|
169
|
-
|
|
172
|
+
N,
|
|
173
|
+
k,
|
|
174
|
+
j,
|
|
175
|
+
T
|
|
176
|
+
]), /* @__PURE__ */ p(s, {
|
|
177
|
+
themeOverrides: b,
|
|
178
|
+
defaultTheme: x,
|
|
179
|
+
children: /* @__PURE__ */ p(e.Provider, {
|
|
170
180
|
value: {
|
|
171
|
-
pdf:
|
|
172
|
-
numPages:
|
|
173
|
-
zoom:
|
|
174
|
-
setZoom:
|
|
175
|
-
rotation:
|
|
176
|
-
setRotation:
|
|
177
|
-
currentPage:
|
|
178
|
-
goToPage:
|
|
179
|
-
containerRef:
|
|
180
|
-
canvasRefs:
|
|
181
|
-
file:
|
|
182
|
-
highlight:
|
|
183
|
-
setHighlight:
|
|
184
|
-
searchMatches:
|
|
185
|
-
setSearchMatches:
|
|
186
|
-
onChangeFile:
|
|
181
|
+
pdf: T,
|
|
182
|
+
numPages: D,
|
|
183
|
+
zoom: k,
|
|
184
|
+
setZoom: A,
|
|
185
|
+
rotation: j,
|
|
186
|
+
setRotation: M,
|
|
187
|
+
currentPage: Y,
|
|
188
|
+
goToPage: X,
|
|
189
|
+
containerRef: G,
|
|
190
|
+
canvasRefs: K,
|
|
191
|
+
file: h,
|
|
192
|
+
highlight: N,
|
|
193
|
+
setHighlight: P,
|
|
194
|
+
searchMatches: L,
|
|
195
|
+
setSearchMatches: R,
|
|
196
|
+
onChangeFile: y,
|
|
197
|
+
sidebarCollapsed: z,
|
|
198
|
+
setSidebarCollapsed: B
|
|
187
199
|
},
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
-
className:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
children: /* @__PURE__ */ m("div", {
|
|
201
|
+
className: `${c.appLayout}${C ? ` ${C}` : ""}`,
|
|
202
|
+
style: w,
|
|
203
|
+
children: [_, /* @__PURE__ */ m("div", {
|
|
204
|
+
className: c.mainContent,
|
|
205
|
+
children: [v && /* @__PURE__ */ p("div", {
|
|
206
|
+
className: c.toolbar,
|
|
207
|
+
children: v
|
|
208
|
+
}), /* @__PURE__ */ p("div", {
|
|
209
|
+
className: c.scrollContainer,
|
|
210
|
+
ref: G,
|
|
211
|
+
children: Array.from({ length: D }, (e, t) => {
|
|
212
|
+
let n = V.has(t + 1), r = U[t];
|
|
213
|
+
return /* @__PURE__ */ m("div", {
|
|
214
|
+
className: c.pageWrapper,
|
|
202
215
|
children: [
|
|
203
|
-
!n && r && /* @__PURE__ */
|
|
204
|
-
className:
|
|
216
|
+
!n && r && /* @__PURE__ */ p("div", {
|
|
217
|
+
className: c.pageSkeleton,
|
|
205
218
|
style: {
|
|
206
219
|
width: r.width,
|
|
207
220
|
height: r.height
|
|
208
221
|
}
|
|
209
222
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
className:
|
|
223
|
+
/* @__PURE__ */ p("canvas", {
|
|
224
|
+
className: c.pageCanvas,
|
|
212
225
|
ref: (e) => {
|
|
213
|
-
|
|
226
|
+
K.current[t] = e;
|
|
214
227
|
},
|
|
215
228
|
style: { display: n ? "block" : "none" }
|
|
216
229
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
className: `textLayer ${
|
|
230
|
+
/* @__PURE__ */ p("div", {
|
|
231
|
+
className: `textLayer ${c.textLayer}`,
|
|
219
232
|
ref: (e) => {
|
|
220
|
-
|
|
233
|
+
Z.current[t] = e;
|
|
221
234
|
}
|
|
222
235
|
}),
|
|
223
|
-
|
|
224
|
-
className:
|
|
236
|
+
Q.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("a", {
|
|
237
|
+
className: c.linkOverlay,
|
|
225
238
|
href: e.url && i(e.url) ? e.url : "#",
|
|
226
239
|
target: "_blank",
|
|
227
240
|
rel: "noopener noreferrer",
|
|
@@ -235,8 +248,8 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
235
248
|
(!e.url || !i(e.url)) && (t.preventDefault(), e.url || e._handleClick());
|
|
236
249
|
}
|
|
237
250
|
}, t)),
|
|
238
|
-
|
|
239
|
-
className:
|
|
251
|
+
ee.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("div", {
|
|
252
|
+
className: c.searchMatchOverlay,
|
|
240
253
|
style: {
|
|
241
254
|
left: e.x,
|
|
242
255
|
top: e.y,
|
|
@@ -244,17 +257,17 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
244
257
|
height: e.height
|
|
245
258
|
}
|
|
246
259
|
}, t)),
|
|
247
|
-
|
|
248
|
-
className:
|
|
260
|
+
N && F?.page === t + 1 && /* @__PURE__ */ p("div", {
|
|
261
|
+
className: c.highlightOverlay,
|
|
249
262
|
style: {
|
|
250
|
-
left:
|
|
251
|
-
top:
|
|
252
|
-
width:
|
|
253
|
-
height:
|
|
263
|
+
left: F.x,
|
|
264
|
+
top: F.y,
|
|
265
|
+
width: F.width,
|
|
266
|
+
height: F.height
|
|
254
267
|
}
|
|
255
268
|
})
|
|
256
269
|
]
|
|
257
|
-
}, `${t}-${
|
|
270
|
+
}, `${t}-${j}`);
|
|
258
271
|
})
|
|
259
272
|
})]
|
|
260
273
|
})]
|
|
@@ -263,4 +276,4 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, theme
|
|
|
263
276
|
});
|
|
264
277
|
};
|
|
265
278
|
//#endregion
|
|
266
|
-
export {
|
|
279
|
+
export { h as default };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
appLayout: "
|
|
3
|
-
mainContent: "
|
|
4
|
-
toolbar: "
|
|
5
|
-
scrollContainer: "
|
|
6
|
-
pageWrapper: "
|
|
7
|
-
pageCanvas: "
|
|
8
|
-
textLayer: "
|
|
9
|
-
markedContent: "
|
|
10
|
-
endOfContent: "
|
|
11
|
-
selecting: "
|
|
12
|
-
pageSkeleton: "
|
|
13
|
-
shimmer: "
|
|
14
|
-
highlightOverlay: "
|
|
15
|
-
linkOverlay: "
|
|
16
|
-
searchMatchOverlay: "
|
|
2
|
+
appLayout: "_appLayout_8il7s_1",
|
|
3
|
+
mainContent: "_mainContent_8il7s_15",
|
|
4
|
+
toolbar: "_toolbar_8il7s_29",
|
|
5
|
+
scrollContainer: "_scrollContainer_8il7s_53",
|
|
6
|
+
pageWrapper: "_pageWrapper_8il7s_73",
|
|
7
|
+
pageCanvas: "_pageCanvas_8il7s_83",
|
|
8
|
+
textLayer: "_textLayer_8il7s_97",
|
|
9
|
+
markedContent: "_markedContent_8il7s_149",
|
|
10
|
+
endOfContent: "_endOfContent_8il7s_179",
|
|
11
|
+
selecting: "_selecting_8il7s_197",
|
|
12
|
+
pageSkeleton: "_pageSkeleton_8il7s_237",
|
|
13
|
+
shimmer: "_shimmer_8il7s_1",
|
|
14
|
+
highlightOverlay: "_highlightOverlay_8il7s_269",
|
|
15
|
+
linkOverlay: "_linkOverlay_8il7s_285",
|
|
16
|
+
searchMatchOverlay: "_searchMatchOverlay_8il7s_297"
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
export { e as default };
|
|
@@ -62,7 +62,21 @@ function c(e) {
|
|
|
62
62
|
]
|
|
63
63
|
}), t[15] = l, t[16] = d, t[17] = m, t[18] = _, t[19] = v, t[20] = y, t[21] = b) : b = t[21], b;
|
|
64
64
|
}
|
|
65
|
-
function l() {
|
|
65
|
+
function l(o) {
|
|
66
|
+
let s = r(8), { icon: c } = o, { pdf: l } = e(), u;
|
|
67
|
+
s[0] === l ? u = s[1] : (u = { pdf: l }, s[0] = l, s[1] = u);
|
|
68
|
+
let { annotations: d, loading: f } = t(u), p = d.length, m;
|
|
69
|
+
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ i("span", {
|
|
70
|
+
className: n.badge,
|
|
71
|
+
children: p > 99 ? "99+" : p
|
|
72
|
+
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
73
|
+
let h;
|
|
74
|
+
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ a("span", {
|
|
75
|
+
className: n.iconWrapper,
|
|
76
|
+
children: [c, m]
|
|
77
|
+
}), s[5] = c, s[6] = m, s[7] = h) : h = s[7], h;
|
|
78
|
+
}
|
|
79
|
+
function u() {
|
|
66
80
|
let { pdf: r, goToPage: o, setHighlight: s } = e(), { annotations: l, loading: u } = t({ pdf: r }), d = (e) => {
|
|
67
81
|
o(e.page), e.rect && s({
|
|
68
82
|
page: e.page,
|
|
@@ -91,4 +105,4 @@ function l() {
|
|
|
91
105
|
});
|
|
92
106
|
}
|
|
93
107
|
//#endregion
|
|
94
|
-
export {
|
|
108
|
+
export { u as PDFAnnotations, l as PDFAnnotationsIcon };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
list: "
|
|
3
|
-
emptyState: "
|
|
4
|
-
pageHeader: "
|
|
5
|
-
card: "
|
|
6
|
-
cardClickable: "
|
|
7
|
-
cardHeader: "
|
|
8
|
-
cardLabel: "
|
|
9
|
-
cardPage: "
|
|
10
|
-
cardAuthor: "
|
|
11
|
-
cardContent: "
|
|
2
|
+
list: "_list_10scn_1",
|
|
3
|
+
emptyState: "_emptyState_10scn_11",
|
|
4
|
+
pageHeader: "_pageHeader_10scn_23",
|
|
5
|
+
card: "_card_10scn_45",
|
|
6
|
+
cardClickable: "_cardClickable_10scn_65",
|
|
7
|
+
cardHeader: "_cardHeader_10scn_81",
|
|
8
|
+
cardLabel: "_cardLabel_10scn_95",
|
|
9
|
+
cardPage: "_cardPage_10scn_107",
|
|
10
|
+
cardAuthor: "_cardAuthor_10scn_117",
|
|
11
|
+
cardContent: "_cardContent_10scn_129",
|
|
12
|
+
iconWrapper: "_iconWrapper_10scn_141",
|
|
13
|
+
badge: "_badge_10scn_155"
|
|
12
14
|
};
|
|
13
15
|
//#endregion
|
|
14
16
|
export { e as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
navWrapper: "
|
|
3
|
-
pageInput: "
|
|
4
|
-
pageTotal: "
|
|
2
|
+
navWrapper: "_navWrapper_1s04k_1",
|
|
3
|
+
pageInput: "_pageInput_1s04k_13",
|
|
4
|
+
pageTotal: "_pageTotal_1s04k_69"
|
|
5
5
|
};
|
|
6
6
|
//#endregion
|
|
7
7
|
export { e as default };
|