pdf-tsx 0.1.6 → 0.3.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 +296 -212
- 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/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/PDFSearch.module.cjs +1 -1
- package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
- package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
- package/dist/cjs/components/features/PDFThumbnails.module.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/context/ThemeContext.cjs +1 -1
- package/dist/cjs/hooks/useTextLayer.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/PDFViewer.d.ts +7 -0
- package/dist/components/features/PDFAnnotations.d.ts +4 -0
- package/dist/components/features/PDFSignatures.d.ts +4 -0
- package/dist/context/ThemeContext.d.ts +8 -2
- package/dist/es/components/PDFSidebar.module.js +7 -7
- package/dist/es/components/PDFViewer.js +188 -175
- package/dist/es/components/PDFViewer.module.js +15 -12
- 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/PDFOutline.module.js +5 -5
- package/dist/es/components/features/PDFPageFit.js +24 -34
- package/dist/es/components/features/PDFPrintButton.js +2 -2
- package/dist/es/components/features/PDFSearch.module.js +4 -4
- package/dist/es/components/features/PDFSignatures.js +20 -12
- package/dist/es/components/features/PDFSignatures.module.js +16 -14
- package/dist/es/components/features/PDFThumbnails.module.js +7 -7
- package/dist/es/components/features/PDFZoomControls.module.js +1 -1
- package/dist/es/components/ui/ToolbarButton.module.js +2 -2
- package/dist/es/context/ThemeContext.js +31 -24
- package/dist/es/hooks/useTextLayer.js +0 -1
- package/dist/es/index.js +17 -16
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/es/utils/pdfFit.js +13 -0
- package/dist/index.d.ts +4 -2
- package/dist/utils/pdfFit.d.ts +2 -0
- package/package.json +61 -61
- package/dist/pdf-tsx.cjs.js +0 -5
- package/dist/pdf-tsx.css +0 -2
- package/dist/pdf-tsx.es.js +0 -2637
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=60,t=10;async function n(n,r,i,a){let o=(await r.getPage(1)).getViewport({scale:1,rotation:a}),s=i.clientWidth-e;if(n===`width`)return s/o.width;let c=i.clientHeight-t*2;return Math.min(s/o.width,c/o.height)}exports.computeFit=n;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Theme } from '../theme';
|
|
2
3
|
interface PDFViewerProps {
|
|
3
4
|
file: File;
|
|
4
5
|
workerSrc: string;
|
|
5
6
|
sidebar?: React.ReactNode;
|
|
6
7
|
toolbar?: React.ReactNode;
|
|
7
8
|
onChangeFile?: (file: File) => void;
|
|
9
|
+
themeOverrides?: {
|
|
10
|
+
light?: Partial<Theme>;
|
|
11
|
+
dark?: Partial<Theme>;
|
|
12
|
+
};
|
|
13
|
+
defaultTheme?: "light" | "dark";
|
|
14
|
+
defaultFit?: "width" | "page";
|
|
8
15
|
}
|
|
9
16
|
declare const PDFViewer: React.FC<PDFViewerProps>;
|
|
10
17
|
export default PDFViewer;
|
|
@@ -5,8 +5,14 @@ interface ThemeContextValue {
|
|
|
5
5
|
toggleTheme: () => void;
|
|
6
6
|
theme: Theme;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
interface ThemeProviderProps {
|
|
9
9
|
children: ReactNode;
|
|
10
|
-
|
|
10
|
+
themeOverrides?: {
|
|
11
|
+
light?: Partial<Theme>;
|
|
12
|
+
dark?: Partial<Theme>;
|
|
13
|
+
};
|
|
14
|
+
defaultTheme?: "light" | "dark";
|
|
15
|
+
}
|
|
16
|
+
export declare function ThemeProvider({ children, themeOverrides, defaultTheme }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
17
|
export declare function useTheme(): ThemeContextValue;
|
|
12
18
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
wrapper: "
|
|
3
|
-
buttonBar: "
|
|
4
|
-
panelButton: "
|
|
5
|
-
panelButtonActive: "
|
|
6
|
-
contentPanel: "
|
|
7
|
-
panelHeader: "
|
|
8
|
-
panelBody: "
|
|
2
|
+
wrapper: "_wrapper_184n8_1",
|
|
3
|
+
buttonBar: "_buttonBar_184n8_13",
|
|
4
|
+
panelButton: "_panelButton_184n8_33",
|
|
5
|
+
panelButtonActive: "_panelButtonActive_184n8_73",
|
|
6
|
+
contentPanel: "_contentPanel_184n8_91",
|
|
7
|
+
panelHeader: "_panelHeader_184n8_107",
|
|
8
|
+
panelBody: "_panelBody_184n8_131"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
11
|
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 }) => {
|
|
15
|
+
l(() => {
|
|
16
|
+
f.GlobalWorkerOptions.workerSrc = g;
|
|
17
|
+
}, [g]);
|
|
18
|
+
let [C, w] = d(null), [T, E] = d(0), [D, O] = d(1), [k, A] = d(0), [j, M] = d(null), [N, P] = d(null), [F, I] = d([]), [L, R] = d(/* @__PURE__ */ new Set()), [z, B] = d([]), V = u(null), H = u([]), U = u([]), W = u(k);
|
|
19
|
+
l(() => {
|
|
20
|
+
W.current = k;
|
|
21
|
+
}, [k]), l(() => {
|
|
22
|
+
if (!C || !S || !V.current) return;
|
|
23
|
+
let e = V.current;
|
|
24
|
+
o(S, C, e, W.current).then(O);
|
|
25
|
+
}, [C, S]);
|
|
26
|
+
let { currentPage: G, goToPage: K } = t({
|
|
27
|
+
pdf: C,
|
|
28
|
+
numPages: T,
|
|
29
|
+
zoom: D,
|
|
30
|
+
rotation: k,
|
|
31
|
+
containerRef: V,
|
|
32
|
+
canvasRefs: H
|
|
24
33
|
});
|
|
25
34
|
n({
|
|
26
|
-
pdf:
|
|
27
|
-
currentPage:
|
|
28
|
-
numPages:
|
|
29
|
-
goToPage:
|
|
30
|
-
setZoom:
|
|
31
|
-
setRotation:
|
|
35
|
+
pdf: C,
|
|
36
|
+
currentPage: G,
|
|
37
|
+
numPages: T,
|
|
38
|
+
goToPage: K,
|
|
39
|
+
setZoom: O,
|
|
40
|
+
setRotation: A
|
|
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 q = r({
|
|
43
|
+
pdf: C,
|
|
44
|
+
zoom: D,
|
|
45
|
+
rotation: k,
|
|
46
|
+
numPages: T,
|
|
47
|
+
canvasRefs: H
|
|
48
|
+
}), J = a({
|
|
49
|
+
pdf: C,
|
|
50
|
+
zoom: D,
|
|
51
|
+
rotation: k,
|
|
52
|
+
numPages: T,
|
|
53
|
+
goToPage: K
|
|
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
|
+
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);
|
|
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 (!C) return;
|
|
70
|
+
R(/* @__PURE__ */ new Set());
|
|
62
71
|
let e = !1;
|
|
63
72
|
return (async () => {
|
|
64
|
-
let t =
|
|
65
|
-
if (await Promise.all(t),
|
|
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;
|
|
66
75
|
let n = [];
|
|
67
|
-
for (let e = 1; e <=
|
|
68
|
-
let t = (await
|
|
69
|
-
scale:
|
|
70
|
-
rotation:
|
|
76
|
+
for (let e = 1; e <= C.numPages; e++) {
|
|
77
|
+
let t = (await C.getPage(e)).getViewport({
|
|
78
|
+
scale: D,
|
|
79
|
+
rotation: k
|
|
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 }) =>
|
|
|
75
84
|
});
|
|
76
85
|
}
|
|
77
86
|
if (!e) {
|
|
78
|
-
|
|
79
|
-
for (let t = 1; t <=
|
|
87
|
+
B(n);
|
|
88
|
+
for (let t = 1; t <= C.numPages; t++) {
|
|
80
89
|
if (e) return;
|
|
81
|
-
let n = await
|
|
82
|
-
scale:
|
|
83
|
-
rotation:
|
|
84
|
-
}), i =
|
|
90
|
+
let n = await C.getPage(t), r = n.getViewport({
|
|
91
|
+
scale: D,
|
|
92
|
+
rotation: k
|
|
93
|
+
}), i = H.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 }) =>
|
|
|
91
100
|
viewport: r,
|
|
92
101
|
canvas: i
|
|
93
102
|
});
|
|
94
|
-
|
|
103
|
+
U.current[t - 1] = o;
|
|
95
104
|
try {
|
|
96
|
-
await o.promise, e ||
|
|
105
|
+
await o.promise, e || R((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 }) =>
|
|
|
102
111
|
}
|
|
103
112
|
}
|
|
104
113
|
})(), () => {
|
|
105
|
-
e = !0,
|
|
114
|
+
e = !0, U.current.forEach((e) => e?.cancel());
|
|
106
115
|
};
|
|
107
116
|
}, [
|
|
108
|
-
y,
|
|
109
117
|
C,
|
|
110
|
-
|
|
118
|
+
D,
|
|
119
|
+
k
|
|
111
120
|
]);
|
|
112
|
-
let [
|
|
113
|
-
return
|
|
114
|
-
if (!
|
|
115
|
-
|
|
121
|
+
let [Y, X] = d([]);
|
|
122
|
+
return l(() => {
|
|
123
|
+
if (!C || F.length === 0) {
|
|
124
|
+
X([]);
|
|
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 F) {
|
|
122
131
|
if (e) break;
|
|
123
|
-
let [r, i, a, o] = (await
|
|
124
|
-
scale:
|
|
125
|
-
rotation:
|
|
132
|
+
let [r, i, a, o] = (await C.getPage(n.page)).getViewport({
|
|
133
|
+
scale: D,
|
|
134
|
+
rotation: k
|
|
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 }) =>
|
|
|
132
141
|
height: Math.abs(o - i)
|
|
133
142
|
});
|
|
134
143
|
}
|
|
135
|
-
e ||
|
|
144
|
+
e || X(t);
|
|
136
145
|
})(), () => {
|
|
137
146
|
e = !0;
|
|
138
147
|
};
|
|
139
148
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
]),
|
|
145
|
-
if (!
|
|
149
|
+
F,
|
|
150
|
+
D,
|
|
151
|
+
k,
|
|
152
|
+
C
|
|
153
|
+
]), l(() => {
|
|
154
|
+
if (!j || !C) 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 C.getPage(j.page)).getViewport({
|
|
158
|
+
scale: D,
|
|
159
|
+
rotation: k
|
|
160
|
+
}).convertToViewportRectangle(j.pdfRect);
|
|
161
|
+
e || P({
|
|
162
|
+
page: j.page,
|
|
154
163
|
x: Math.min(t, r),
|
|
155
164
|
y: Math.min(n, i),
|
|
156
165
|
width: Math.abs(r - t),
|
|
@@ -160,104 +169,108 @@ var m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v }) =>
|
|
|
160
169
|
e = !0;
|
|
161
170
|
};
|
|
162
171
|
}, [
|
|
172
|
+
j,
|
|
163
173
|
D,
|
|
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
|
-
children:
|
|
189
|
-
className:
|
|
190
|
-
children: [_
|
|
191
|
-
className:
|
|
192
|
-
children:
|
|
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
|
-
|
|
174
|
+
k,
|
|
175
|
+
C
|
|
176
|
+
]), /* @__PURE__ */ p(s, {
|
|
177
|
+
themeOverrides: b,
|
|
178
|
+
defaultTheme: x,
|
|
179
|
+
children: /* @__PURE__ */ p(e.Provider, {
|
|
180
|
+
value: {
|
|
181
|
+
pdf: C,
|
|
182
|
+
numPages: T,
|
|
183
|
+
zoom: D,
|
|
184
|
+
setZoom: O,
|
|
185
|
+
rotation: k,
|
|
186
|
+
setRotation: A,
|
|
187
|
+
currentPage: G,
|
|
188
|
+
goToPage: K,
|
|
189
|
+
containerRef: V,
|
|
190
|
+
canvasRefs: H,
|
|
191
|
+
file: h,
|
|
192
|
+
highlight: j,
|
|
193
|
+
setHighlight: M,
|
|
194
|
+
searchMatches: F,
|
|
195
|
+
setSearchMatches: I,
|
|
196
|
+
onChangeFile: y
|
|
197
|
+
},
|
|
198
|
+
children: /* @__PURE__ */ m("div", {
|
|
199
|
+
className: c.appLayout,
|
|
200
|
+
children: [_, /* @__PURE__ */ m("div", {
|
|
201
|
+
className: c.mainContent,
|
|
202
|
+
children: [v && /* @__PURE__ */ p("div", {
|
|
203
|
+
className: c.toolbar,
|
|
204
|
+
children: v
|
|
205
|
+
}), /* @__PURE__ */ p("div", {
|
|
206
|
+
className: c.scrollContainer,
|
|
207
|
+
ref: V,
|
|
208
|
+
children: Array.from({ length: T }, (e, t) => {
|
|
209
|
+
let n = L.has(t + 1), r = z[t];
|
|
210
|
+
return /* @__PURE__ */ m("div", {
|
|
211
|
+
className: c.pageWrapper,
|
|
212
|
+
children: [
|
|
213
|
+
!n && r && /* @__PURE__ */ p("div", {
|
|
214
|
+
className: c.pageSkeleton,
|
|
215
|
+
style: {
|
|
216
|
+
width: r.width,
|
|
217
|
+
height: r.height
|
|
218
|
+
}
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ p("canvas", {
|
|
221
|
+
className: c.pageCanvas,
|
|
222
|
+
ref: (e) => {
|
|
223
|
+
H.current[t] = e;
|
|
224
|
+
},
|
|
225
|
+
style: { display: n ? "block" : "none" }
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ p("div", {
|
|
228
|
+
className: `textLayer ${c.textLayer}`,
|
|
229
|
+
ref: (e) => {
|
|
230
|
+
q.current[t] = e;
|
|
231
|
+
}
|
|
232
|
+
}),
|
|
233
|
+
J.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("a", {
|
|
234
|
+
className: c.linkOverlay,
|
|
235
|
+
href: e.url && i(e.url) ? e.url : "#",
|
|
236
|
+
target: "_blank",
|
|
237
|
+
rel: "noopener noreferrer",
|
|
238
|
+
style: {
|
|
239
|
+
left: e.x,
|
|
240
|
+
top: e.y,
|
|
241
|
+
width: e.width,
|
|
242
|
+
height: e.height
|
|
243
|
+
},
|
|
244
|
+
onClick: (t) => {
|
|
245
|
+
(!e.url || !i(e.url)) && (t.preventDefault(), e.url || e._handleClick());
|
|
246
|
+
}
|
|
247
|
+
}, t)),
|
|
248
|
+
Y.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("div", {
|
|
249
|
+
className: c.searchMatchOverlay,
|
|
250
|
+
style: {
|
|
251
|
+
left: e.x,
|
|
252
|
+
top: e.y,
|
|
253
|
+
width: e.width,
|
|
254
|
+
height: e.height
|
|
255
|
+
}
|
|
256
|
+
}, t)),
|
|
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
|
+
})]
|
|
257
270
|
})]
|
|
258
|
-
})
|
|
271
|
+
})
|
|
259
272
|
})
|
|
260
|
-
})
|
|
273
|
+
});
|
|
261
274
|
};
|
|
262
275
|
//#endregion
|
|
263
|
-
export {
|
|
276
|
+
export { h as default };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
appLayout: "
|
|
3
|
-
mainContent: "
|
|
4
|
-
toolbar: "
|
|
5
|
-
scrollContainer: "
|
|
6
|
-
pageWrapper: "
|
|
7
|
-
pageCanvas: "
|
|
8
|
-
textLayer: "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
appLayout: "_appLayout_nel8e_1",
|
|
3
|
+
mainContent: "_mainContent_nel8e_15",
|
|
4
|
+
toolbar: "_toolbar_nel8e_29",
|
|
5
|
+
scrollContainer: "_scrollContainer_nel8e_53",
|
|
6
|
+
pageWrapper: "_pageWrapper_nel8e_73",
|
|
7
|
+
pageCanvas: "_pageCanvas_nel8e_83",
|
|
8
|
+
textLayer: "_textLayer_nel8e_97",
|
|
9
|
+
markedContent: "_markedContent_nel8e_149",
|
|
10
|
+
endOfContent: "_endOfContent_nel8e_177",
|
|
11
|
+
selecting: "_selecting_nel8e_195",
|
|
12
|
+
pageSkeleton: "_pageSkeleton_nel8e_235",
|
|
13
|
+
shimmer: "_shimmer_nel8e_1",
|
|
14
|
+
highlightOverlay: "_highlightOverlay_nel8e_267",
|
|
15
|
+
linkOverlay: "_linkOverlay_nel8e_283",
|
|
16
|
+
searchMatchOverlay: "_searchMatchOverlay_nel8e_295"
|
|
14
17
|
};
|
|
15
18
|
//#endregion
|
|
16
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_6ysgx_1",
|
|
3
|
+
pageInput: "_pageInput_6ysgx_15",
|
|
4
|
+
pageTotal: "_pageTotal_6ysgx_71"
|
|
5
5
|
};
|
|
6
6
|
//#endregion
|
|
7
7
|
export { e as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
emptyState: "
|
|
3
|
-
tree: "
|
|
4
|
-
row: "
|
|
5
|
-
chevronBtn: "
|
|
6
|
-
title: "
|
|
2
|
+
emptyState: "_emptyState_1w4ic_1",
|
|
3
|
+
tree: "_tree_1w4ic_13",
|
|
4
|
+
row: "_row_1w4ic_25",
|
|
5
|
+
chevronBtn: "_chevronBtn_1w4ic_61",
|
|
6
|
+
title: "_title_1w4ic_91"
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
9
|
export { e as default };
|