pdf-tsx 0.12.0 → 0.13.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 +486 -459
- package/dist/cjs/components/PDFViewer.cjs +1 -1
- package/dist/cjs/components/PDFViewer.module.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
- package/dist/cjs/labels.cjs +1 -1
- package/dist/cjs/pdf-tsx.css +1 -1
- package/dist/components/PDFViewer.d.ts +2 -0
- package/dist/context/PDFViewerContext.d.ts +1 -0
- package/dist/es/components/PDFViewer.js +330 -276
- package/dist/es/components/PDFViewer.module.js +23 -21
- package/dist/es/components/features/PDFNavigation.js +19 -18
- package/dist/es/labels.js +6 -2
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/labels.d.ts +2 -0
- package/package.json +1 -1
|
@@ -10,325 +10,379 @@ import { useOverlayRects as ne } from "../hooks/useOverlayRects.js";
|
|
|
10
10
|
import { computeFit as o } from "../utils/pdfFit.js";
|
|
11
11
|
import { ThemeProvider as re } from "../context/ThemeContext.js";
|
|
12
12
|
import { LabelsProvider as ie } from "../context/LabelsContext.js";
|
|
13
|
-
import s from "
|
|
14
|
-
import
|
|
13
|
+
import { useLabels as s } from "../hooks/useLabels.js";
|
|
14
|
+
import c from "./PDFViewer.module.js";
|
|
15
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
15
16
|
import * as ae from "pdfjs-dist";
|
|
16
|
-
import { Fragment as oe, jsx as
|
|
17
|
+
import { Fragment as oe, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
17
18
|
//#region src/components/PDFViewer.tsx
|
|
18
|
-
var
|
|
19
|
-
|
|
19
|
+
var g = 2;
|
|
20
|
+
function se({ hasRead: e }) {
|
|
21
|
+
let t = s();
|
|
22
|
+
return /* @__PURE__ */ h("div", {
|
|
23
|
+
className: `${c.requireReadBanner} ${e ? c.requireReadDone : ""}`,
|
|
24
|
+
children: [e ? /* @__PURE__ */ m("svg", {
|
|
25
|
+
width: "16",
|
|
26
|
+
height: "16",
|
|
27
|
+
viewBox: "0 0 16 16",
|
|
28
|
+
fill: "none",
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
children: /* @__PURE__ */ m("path", {
|
|
31
|
+
d: "M3 8l3.5 3.5L13 4.5",
|
|
32
|
+
stroke: "currentColor",
|
|
33
|
+
strokeWidth: "2",
|
|
34
|
+
strokeLinecap: "round",
|
|
35
|
+
strokeLinejoin: "round"
|
|
36
|
+
})
|
|
37
|
+
}) : /* @__PURE__ */ m("svg", {
|
|
38
|
+
width: "16",
|
|
39
|
+
height: "16",
|
|
40
|
+
viewBox: "0 0 16 16",
|
|
41
|
+
fill: "none",
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
children: /* @__PURE__ */ m("path", {
|
|
44
|
+
d: "M8 3v10M4 9l4 4 4-4",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "2",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round"
|
|
49
|
+
})
|
|
50
|
+
}), /* @__PURE__ */ m("span", { children: e ? t.requireReadDone : t.requireReadPending })]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
var _ = ({ file: s, workerSrc: _, sidebar: ce, toolbar: v, onChangeFile: y, themeOverrides: le, defaultTheme: ue, defaultFit: b, language: de, className: x, style: fe, requireRead: S, onDocumentRead: C }) => {
|
|
54
|
+
u(() => {
|
|
20
55
|
ae.GlobalWorkerOptions.workerSrc = _;
|
|
21
56
|
}, [_]);
|
|
22
|
-
let [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
let [
|
|
27
|
-
|
|
28
|
-
let { pdf:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
let [w, T] = p(1), [E, D] = p(0), [O, k] = p(null), [A, pe] = p([]), [j, me] = p(!1), [M, N] = p(b ?? null), [P, F] = p(null), [I, L] = p(!1), R = f(!1), z = f(null), B = f([]), V = f([]), H = f(E);
|
|
58
|
+
u(() => {
|
|
59
|
+
H.current = E;
|
|
60
|
+
}, [E]);
|
|
61
|
+
let [he, ge] = p(null);
|
|
62
|
+
he !== s && (ge(s), k(null), L(!1), R.current = !1);
|
|
63
|
+
let { pdf: U, numPages: W, loading: _e } = ee(s);
|
|
64
|
+
u(() => {
|
|
65
|
+
L(!1), R.current = !1;
|
|
66
|
+
}, [S]), u(() => {
|
|
67
|
+
U && (B.current = Array(U.numPages).fill(null), V.current = Array(U.numPages).fill(null));
|
|
68
|
+
}, [U]), u(() => {
|
|
69
|
+
!U || !b || !z.current || o(b, U, z.current, H.current).then(T);
|
|
70
|
+
}, [U, b]);
|
|
71
|
+
let G = f(M);
|
|
72
|
+
u(() => {
|
|
73
|
+
G.current = M;
|
|
74
|
+
}, [M]), u(() => {
|
|
75
|
+
if (!U || !z.current) return;
|
|
76
|
+
let e = z.current, t = new ResizeObserver(() => {
|
|
77
|
+
G.current && o(G.current, U, e, H.current).then(T);
|
|
41
78
|
});
|
|
42
79
|
return t.observe(e), () => t.disconnect();
|
|
43
|
-
}, [
|
|
44
|
-
let { currentPage:
|
|
45
|
-
numPages:
|
|
46
|
-
containerRef:
|
|
47
|
-
pageRefs:
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
80
|
+
}, [U]);
|
|
81
|
+
let { currentPage: K, goToPage: q } = t({
|
|
82
|
+
numPages: W,
|
|
83
|
+
containerRef: z,
|
|
84
|
+
pageRefs: B
|
|
85
|
+
});
|
|
86
|
+
u(() => {
|
|
87
|
+
!S || I || W === 0 || K >= W && (L(!0), R.current || (R.current = !0, C?.()));
|
|
88
|
+
}, [
|
|
89
|
+
K,
|
|
90
|
+
W,
|
|
91
|
+
S,
|
|
92
|
+
I,
|
|
93
|
+
C
|
|
94
|
+
]);
|
|
95
|
+
let J = d(() => {
|
|
96
|
+
if (W === 0) return [];
|
|
97
|
+
let e = /* @__PURE__ */ new Set(), t = Math.max(K - g, 1), n = Math.min(K + g, W);
|
|
51
98
|
for (let r = t; r <= n; r++) e.add(r);
|
|
52
|
-
|
|
53
|
-
for (let t of
|
|
99
|
+
O && e.add(O.page);
|
|
100
|
+
for (let t of A) e.add(t.page);
|
|
54
101
|
return Array.from(e).sort((e, t) => e - t);
|
|
55
102
|
}, [
|
|
103
|
+
K,
|
|
56
104
|
W,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
for (let t of q) e.add(t);
|
|
105
|
+
O,
|
|
106
|
+
A
|
|
107
|
+
]), { pageSizes: ve, renderedPages: Y } = te({
|
|
108
|
+
pdf: U,
|
|
109
|
+
zoom: w,
|
|
110
|
+
rotation: E,
|
|
111
|
+
visiblePages: J,
|
|
112
|
+
canvasRefs: V
|
|
113
|
+
}), X = d(() => {
|
|
114
|
+
let e = new Set(J);
|
|
115
|
+
for (let t of Y) e.add(t);
|
|
69
116
|
return Array.from(e).sort((e, t) => e - t);
|
|
70
|
-
}, [
|
|
117
|
+
}, [J, Y]);
|
|
71
118
|
n({
|
|
72
|
-
pdf:
|
|
73
|
-
currentPage:
|
|
74
|
-
goToPage:
|
|
75
|
-
setZoom:
|
|
76
|
-
setRotation:
|
|
77
|
-
setFitMode:
|
|
119
|
+
pdf: U,
|
|
120
|
+
currentPage: K,
|
|
121
|
+
goToPage: q,
|
|
122
|
+
setZoom: T,
|
|
123
|
+
setRotation: D,
|
|
124
|
+
setFitMode: N
|
|
78
125
|
});
|
|
79
|
-
let
|
|
80
|
-
pdf:
|
|
81
|
-
zoom:
|
|
82
|
-
rotation:
|
|
83
|
-
mountedPages:
|
|
84
|
-
canvasRefs:
|
|
85
|
-
}), { linkOverlays:
|
|
86
|
-
pdf:
|
|
87
|
-
zoom:
|
|
88
|
-
rotation:
|
|
89
|
-
mountedPages:
|
|
90
|
-
goToPage:
|
|
126
|
+
let ye = r({
|
|
127
|
+
pdf: U,
|
|
128
|
+
zoom: w,
|
|
129
|
+
rotation: E,
|
|
130
|
+
mountedPages: X,
|
|
131
|
+
canvasRefs: V
|
|
132
|
+
}), { linkOverlays: be, noteOverlays: xe } = a({
|
|
133
|
+
pdf: U,
|
|
134
|
+
zoom: w,
|
|
135
|
+
rotation: E,
|
|
136
|
+
mountedPages: X,
|
|
137
|
+
goToPage: q
|
|
91
138
|
});
|
|
92
|
-
|
|
93
|
-
if (!
|
|
94
|
-
let e = () =>
|
|
95
|
-
e.key === "Escape" &&
|
|
139
|
+
u(() => {
|
|
140
|
+
if (!P) return;
|
|
141
|
+
let e = () => F(null), t = (e) => {
|
|
142
|
+
e.key === "Escape" && F(null);
|
|
96
143
|
};
|
|
97
144
|
return document.addEventListener("click", e), document.addEventListener("keydown", t), () => {
|
|
98
145
|
document.removeEventListener("click", e), document.removeEventListener("keydown", t);
|
|
99
146
|
};
|
|
100
|
-
}, [
|
|
101
|
-
let { overlayRect:
|
|
102
|
-
pdf:
|
|
103
|
-
highlight:
|
|
104
|
-
searchMatches:
|
|
105
|
-
zoom:
|
|
106
|
-
rotation:
|
|
107
|
-
}),
|
|
147
|
+
}, [P]);
|
|
148
|
+
let { overlayRect: Z, searchOverlays: Se } = ne({
|
|
149
|
+
pdf: U,
|
|
150
|
+
highlight: O,
|
|
151
|
+
searchMatches: A,
|
|
152
|
+
zoom: w,
|
|
153
|
+
rotation: E
|
|
154
|
+
}), Ce = l((e, t) => {
|
|
108
155
|
(!e.url || !i(e.url)) && (t.preventDefault(), e.url || e._handleClick());
|
|
109
|
-
}, []),
|
|
110
|
-
|
|
156
|
+
}, []), Q = f(null), we = l((e, t) => {
|
|
157
|
+
Q.current && clearTimeout(Q.current);
|
|
111
158
|
let n = t.clientY > window.innerHeight * .6;
|
|
112
|
-
|
|
159
|
+
F({
|
|
113
160
|
x: Math.min(t.clientX, window.innerWidth - 304),
|
|
114
161
|
y: n ? window.innerHeight - t.clientY + 8 : t.clientY + 12,
|
|
115
162
|
above: n,
|
|
116
163
|
contents: e.contents,
|
|
117
164
|
title: e.title
|
|
118
165
|
});
|
|
119
|
-
}, []),
|
|
120
|
-
|
|
121
|
-
}, []),
|
|
122
|
-
|
|
166
|
+
}, []), $ = l(() => {
|
|
167
|
+
Q.current = setTimeout(() => F(null), 200);
|
|
168
|
+
}, []), Te = l((e) => {
|
|
169
|
+
k({
|
|
123
170
|
page: e.page,
|
|
124
171
|
pdfRect: e.pdfRect
|
|
125
|
-
}),
|
|
126
|
-
}, [
|
|
127
|
-
pdf:
|
|
128
|
-
numPages:
|
|
129
|
-
zoom:
|
|
130
|
-
setZoom:
|
|
131
|
-
rotation:
|
|
132
|
-
setRotation:
|
|
133
|
-
currentPage:
|
|
134
|
-
goToPage:
|
|
135
|
-
containerRef:
|
|
136
|
-
canvasRefs:
|
|
137
|
-
file:
|
|
138
|
-
highlight:
|
|
139
|
-
setHighlight:
|
|
140
|
-
searchMatches:
|
|
141
|
-
setSearchMatches:
|
|
172
|
+
}), q(e.page);
|
|
173
|
+
}, [k, q]), Ee = d(() => ({
|
|
174
|
+
pdf: U,
|
|
175
|
+
numPages: W,
|
|
176
|
+
zoom: w,
|
|
177
|
+
setZoom: T,
|
|
178
|
+
rotation: E,
|
|
179
|
+
setRotation: D,
|
|
180
|
+
currentPage: K,
|
|
181
|
+
goToPage: q,
|
|
182
|
+
containerRef: z,
|
|
183
|
+
canvasRefs: V,
|
|
184
|
+
file: s,
|
|
185
|
+
highlight: O,
|
|
186
|
+
setHighlight: k,
|
|
187
|
+
searchMatches: A,
|
|
188
|
+
setSearchMatches: pe,
|
|
142
189
|
onChangeFile: y,
|
|
143
|
-
sidebarCollapsed:
|
|
144
|
-
setSidebarCollapsed:
|
|
145
|
-
fitMode:
|
|
146
|
-
setFitMode:
|
|
190
|
+
sidebarCollapsed: j,
|
|
191
|
+
setSidebarCollapsed: me,
|
|
192
|
+
fitMode: M,
|
|
193
|
+
setFitMode: N,
|
|
194
|
+
navigationLocked: !!S && !I
|
|
147
195
|
}), [
|
|
148
|
-
|
|
149
|
-
H,
|
|
150
|
-
S,
|
|
151
|
-
w,
|
|
196
|
+
U,
|
|
152
197
|
W,
|
|
153
|
-
|
|
154
|
-
g,
|
|
198
|
+
w,
|
|
155
199
|
E,
|
|
200
|
+
K,
|
|
201
|
+
q,
|
|
202
|
+
s,
|
|
156
203
|
O,
|
|
157
|
-
y,
|
|
158
204
|
A,
|
|
159
|
-
|
|
205
|
+
y,
|
|
206
|
+
j,
|
|
207
|
+
M,
|
|
208
|
+
S,
|
|
209
|
+
I
|
|
160
210
|
]);
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
themeOverrides:
|
|
163
|
-
defaultTheme:
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
-
language:
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
-
value:
|
|
168
|
-
children: [/* @__PURE__ */
|
|
169
|
-
className: `${
|
|
170
|
-
style:
|
|
171
|
-
children: [v && /* @__PURE__ */
|
|
172
|
-
className:
|
|
211
|
+
return /* @__PURE__ */ m(re, {
|
|
212
|
+
themeOverrides: le,
|
|
213
|
+
defaultTheme: ue,
|
|
214
|
+
children: /* @__PURE__ */ m(ie, {
|
|
215
|
+
language: de,
|
|
216
|
+
children: /* @__PURE__ */ h(e.Provider, {
|
|
217
|
+
value: Ee,
|
|
218
|
+
children: [/* @__PURE__ */ h("div", {
|
|
219
|
+
className: `${c.appLayout}${x ? ` ${x}` : ""}`,
|
|
220
|
+
style: fe,
|
|
221
|
+
children: [v && /* @__PURE__ */ m("div", {
|
|
222
|
+
className: c.toolbar,
|
|
173
223
|
children: v
|
|
174
|
-
}), /* @__PURE__ */
|
|
175
|
-
className:
|
|
176
|
-
children: [
|
|
177
|
-
className:
|
|
178
|
-
ref:
|
|
179
|
-
children: [
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
224
|
+
}), /* @__PURE__ */ h("div", {
|
|
225
|
+
className: c.body,
|
|
226
|
+
children: [ce, /* @__PURE__ */ h("div", {
|
|
227
|
+
className: c.scrollContainer,
|
|
228
|
+
ref: z,
|
|
229
|
+
children: [
|
|
230
|
+
_e && /* @__PURE__ */ m("div", { className: c.documentLoading }),
|
|
231
|
+
Array.from({ length: W }, (e, t) => {
|
|
232
|
+
let n = Y.has(t + 1), r = ve[t], a = X.includes(t + 1);
|
|
233
|
+
return /* @__PURE__ */ h("div", {
|
|
234
|
+
className: c.pageWrapper,
|
|
235
|
+
ref: (e) => {
|
|
236
|
+
B.current[t] = e;
|
|
237
|
+
},
|
|
238
|
+
style: r ? {
|
|
239
|
+
width: r.width,
|
|
240
|
+
height: r.height
|
|
241
|
+
} : void 0,
|
|
242
|
+
children: [
|
|
243
|
+
r && !n && /* @__PURE__ */ m("div", {
|
|
244
|
+
className: c.pageSkeleton,
|
|
245
|
+
style: {
|
|
246
|
+
width: r.width,
|
|
247
|
+
height: r.height
|
|
248
|
+
}
|
|
249
|
+
}),
|
|
250
|
+
a && /* @__PURE__ */ h(oe, { children: [/* @__PURE__ */ m("canvas", {
|
|
251
|
+
className: c.pageCanvas,
|
|
252
|
+
ref: (e) => {
|
|
253
|
+
V.current[t] = e;
|
|
254
|
+
},
|
|
255
|
+
style: { display: n ? "block" : "none" }
|
|
256
|
+
}), /* @__PURE__ */ m("div", {
|
|
257
|
+
className: `textLayer ${c.textLayer}`,
|
|
258
|
+
ref: (e) => {
|
|
259
|
+
ye.current[t] = e;
|
|
260
|
+
}
|
|
261
|
+
})] }),
|
|
262
|
+
be.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ m("a", {
|
|
263
|
+
className: c.linkOverlay,
|
|
264
|
+
href: e.url && i(e.url) ? e.url : "#",
|
|
265
|
+
target: "_blank",
|
|
266
|
+
rel: "noopener noreferrer",
|
|
267
|
+
style: {
|
|
268
|
+
left: e.x,
|
|
269
|
+
top: e.y,
|
|
270
|
+
width: e.width,
|
|
271
|
+
height: e.height
|
|
272
|
+
},
|
|
273
|
+
onClick: (t) => Ce(e, t)
|
|
274
|
+
}, t)),
|
|
275
|
+
xe.filter((e) => e.page === t + 1).map((e, t) => e.subtype === "Text" ? /* @__PURE__ */ m("div", {
|
|
276
|
+
className: c.noteIconOverlay,
|
|
277
|
+
style: {
|
|
278
|
+
left: e.x,
|
|
279
|
+
top: e.y,
|
|
280
|
+
width: Math.max(e.width, 26),
|
|
281
|
+
height: Math.max(e.height, 26)
|
|
282
|
+
},
|
|
283
|
+
onMouseEnter: (t) => we(e, t),
|
|
284
|
+
onMouseLeave: $,
|
|
285
|
+
onClick: () => Te(e),
|
|
286
|
+
children: /* @__PURE__ */ h("svg", {
|
|
287
|
+
width: "22",
|
|
288
|
+
height: "22",
|
|
289
|
+
viewBox: "0 0 12 12",
|
|
290
|
+
fill: "none",
|
|
291
|
+
"aria-hidden": "true",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ m("rect", {
|
|
294
|
+
x: "0.5",
|
|
295
|
+
y: "0.5",
|
|
296
|
+
width: "9",
|
|
297
|
+
height: "8",
|
|
298
|
+
rx: "1",
|
|
299
|
+
fill: "rgba(255,210,0,0.9)",
|
|
300
|
+
stroke: "rgba(160,120,0,0.7)",
|
|
301
|
+
strokeWidth: "1"
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ m("path", {
|
|
304
|
+
d: "M9.5 5.5v3l2.5-3z",
|
|
305
|
+
fill: "rgba(255,210,0,0.9)",
|
|
306
|
+
stroke: "rgba(160,120,0,0.7)",
|
|
307
|
+
strokeWidth: "1"
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ m("line", {
|
|
310
|
+
x1: "2",
|
|
311
|
+
y1: "3",
|
|
312
|
+
x2: "8",
|
|
313
|
+
y2: "3",
|
|
314
|
+
stroke: "rgba(90,60,0,0.8)",
|
|
315
|
+
strokeWidth: "1",
|
|
316
|
+
strokeLinecap: "round"
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ m("line", {
|
|
319
|
+
x1: "2",
|
|
320
|
+
y1: "5.5",
|
|
321
|
+
x2: "7",
|
|
322
|
+
y2: "5.5",
|
|
323
|
+
stroke: "rgba(90,60,0,0.8)",
|
|
324
|
+
strokeWidth: "1",
|
|
325
|
+
strokeLinecap: "round"
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
})
|
|
329
|
+
}, t) : /* @__PURE__ */ m("div", {
|
|
330
|
+
className: c.noteOverlay,
|
|
331
|
+
style: {
|
|
332
|
+
left: e.x,
|
|
333
|
+
top: e.y,
|
|
334
|
+
width: e.width,
|
|
335
|
+
height: e.height
|
|
336
|
+
},
|
|
337
|
+
onMouseEnter: (t) => we(e, t),
|
|
338
|
+
onMouseLeave: $,
|
|
339
|
+
onClick: () => Te(e)
|
|
340
|
+
}, t)),
|
|
341
|
+
Se.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ m("div", {
|
|
342
|
+
className: c.searchMatchOverlay,
|
|
343
|
+
style: {
|
|
344
|
+
left: e.x,
|
|
345
|
+
top: e.y,
|
|
346
|
+
width: e.width,
|
|
347
|
+
height: e.height
|
|
348
|
+
}
|
|
349
|
+
}, t)),
|
|
350
|
+
O && Z?.page === t + 1 && /* @__PURE__ */ m("div", {
|
|
351
|
+
className: c.highlightOverlay,
|
|
352
|
+
style: {
|
|
353
|
+
left: Z.x,
|
|
354
|
+
top: Z.y,
|
|
355
|
+
width: Z.width,
|
|
356
|
+
height: Z.height
|
|
357
|
+
}
|
|
276
358
|
})
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
width: e.width,
|
|
283
|
-
height: e.height
|
|
284
|
-
},
|
|
285
|
-
onMouseEnter: (t) => Z(e, t),
|
|
286
|
-
onMouseLeave: Q,
|
|
287
|
-
onClick: () => $(e)
|
|
288
|
-
}, t)),
|
|
289
|
-
ve.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("div", {
|
|
290
|
-
className: s.searchMatchOverlay,
|
|
291
|
-
style: {
|
|
292
|
-
left: e.x,
|
|
293
|
-
top: e.y,
|
|
294
|
-
width: e.width,
|
|
295
|
-
height: e.height
|
|
296
|
-
}
|
|
297
|
-
}, t)),
|
|
298
|
-
E && Y?.page === t + 1 && /* @__PURE__ */ p("div", {
|
|
299
|
-
className: s.highlightOverlay,
|
|
300
|
-
style: {
|
|
301
|
-
left: Y.x,
|
|
302
|
-
top: Y.y,
|
|
303
|
-
width: Y.width,
|
|
304
|
-
height: Y.height
|
|
305
|
-
}
|
|
306
|
-
})
|
|
307
|
-
]
|
|
308
|
-
}, `${t}-${w}`);
|
|
309
|
-
})]
|
|
359
|
+
]
|
|
360
|
+
}, `${t}-${E}`);
|
|
361
|
+
}),
|
|
362
|
+
S && /* @__PURE__ */ m(se, { hasRead: I })
|
|
363
|
+
]
|
|
310
364
|
})]
|
|
311
365
|
})]
|
|
312
|
-
}),
|
|
313
|
-
className:
|
|
314
|
-
style:
|
|
315
|
-
left:
|
|
316
|
-
bottom:
|
|
366
|
+
}), P && /* @__PURE__ */ h("div", {
|
|
367
|
+
className: c.notePopover,
|
|
368
|
+
style: P.above ? {
|
|
369
|
+
left: P.x,
|
|
370
|
+
bottom: P.y
|
|
317
371
|
} : {
|
|
318
|
-
left:
|
|
319
|
-
top:
|
|
372
|
+
left: P.x,
|
|
373
|
+
top: P.y
|
|
320
374
|
},
|
|
321
375
|
onMouseEnter: () => {
|
|
322
|
-
|
|
376
|
+
Q.current && clearTimeout(Q.current);
|
|
323
377
|
},
|
|
324
|
-
onMouseLeave:
|
|
378
|
+
onMouseLeave: $,
|
|
325
379
|
onClick: (e) => e.stopPropagation(),
|
|
326
|
-
children: [
|
|
327
|
-
className:
|
|
328
|
-
children:
|
|
329
|
-
}), /* @__PURE__ */
|
|
330
|
-
className:
|
|
331
|
-
children:
|
|
380
|
+
children: [P.title && /* @__PURE__ */ m("div", {
|
|
381
|
+
className: c.notePopoverTitle,
|
|
382
|
+
children: P.title
|
|
383
|
+
}), /* @__PURE__ */ m("p", {
|
|
384
|
+
className: c.notePopoverContent,
|
|
385
|
+
children: P.contents
|
|
332
386
|
})]
|
|
333
387
|
})]
|
|
334
388
|
})
|
|
@@ -336,4 +390,4 @@ var h = 2, g = ({ file: g, workerSrc: _, sidebar: se, toolbar: v, onChangeFile:
|
|
|
336
390
|
});
|
|
337
391
|
};
|
|
338
392
|
//#endregion
|
|
339
|
-
export {
|
|
393
|
+
export { _ as default };
|