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.
Files changed (47) hide show
  1. package/README.md +107 -33
  2. package/dist/cjs/components/PDFSidebar.cjs +1 -1
  3. package/dist/cjs/components/PDFSidebar.module.cjs +1 -1
  4. package/dist/cjs/components/PDFViewer.cjs +1 -1
  5. package/dist/cjs/components/PDFViewer.module.cjs +1 -1
  6. package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
  7. package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
  8. package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
  9. package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
  10. package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
  11. package/dist/cjs/components/features/PDFSearch.cjs +1 -1
  12. package/dist/cjs/components/features/PDFSearch.module.cjs +1 -1
  13. package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -0
  14. package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
  15. package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
  16. package/dist/cjs/context/ThemeContext.cjs +1 -1
  17. package/dist/cjs/index.cjs +1 -1
  18. package/dist/cjs/pdf-tsx.css +1 -1
  19. package/dist/cjs/utils/pdfFit.cjs +1 -0
  20. package/dist/components/PDFSidebar.d.ts +2 -1
  21. package/dist/components/PDFViewer.d.ts +4 -0
  22. package/dist/components/features/PDFAnnotations.d.ts +4 -0
  23. package/dist/components/features/PDFSidebarToggle.d.ts +7 -0
  24. package/dist/components/features/PDFSignatures.d.ts +4 -0
  25. package/dist/context/PDFViewerContext.d.ts +2 -0
  26. package/dist/context/ThemeContext.d.ts +2 -1
  27. package/dist/es/components/PDFSidebar.js +48 -38
  28. package/dist/es/components/PDFSidebar.module.js +9 -7
  29. package/dist/es/components/PDFViewer.js +150 -137
  30. package/dist/es/components/PDFViewer.module.js +15 -15
  31. package/dist/es/components/features/PDFAnnotations.js +16 -2
  32. package/dist/es/components/features/PDFAnnotations.module.js +12 -10
  33. package/dist/es/components/features/PDFNavigation.module.js +3 -3
  34. package/dist/es/components/features/PDFPageFit.js +24 -34
  35. package/dist/es/components/features/PDFPrintButton.js +2 -2
  36. package/dist/es/components/features/PDFSearch.js +16 -11
  37. package/dist/es/components/features/PDFSearch.module.js +5 -4
  38. package/dist/es/components/features/PDFSidebarToggle.js +20 -0
  39. package/dist/es/components/features/PDFSignatures.js +20 -12
  40. package/dist/es/components/features/PDFSignatures.module.js +16 -14
  41. package/dist/es/context/ThemeContext.js +24 -24
  42. package/dist/es/index.js +15 -14
  43. package/dist/es/pdf-tsx.css +1 -1
  44. package/dist/es/utils/pdfFit.js +13 -0
  45. package/dist/index.d.ts +3 -2
  46. package/dist/utils/pdfFit.d.ts +2 -0
  47. package/package.json +1 -1
@@ -1,42 +1,52 @@
1
- import e from "./PDFSidebar.module.js";
2
- import { useState as t } from "react";
3
- import { c as n } from "react/compiler-runtime";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
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 a(a) {
7
- let o = n(14), { panels: s } = a, [c, l] = t(null), u;
8
- o[0] === Symbol.for("react.memo_cache_sentinel") ? (u = (e) => l((t) => t === e ? null : e), o[0] = u) : u = o[0];
9
- let d = u, f;
10
- if (o[1] !== c || o[2] !== s) {
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);
24
- let m;
25
- o[8] !== c || o[9] !== s ? (m = c !== null && /* @__PURE__ */ i("div", {
26
- className: e.contentPanel,
27
- children: [/* @__PURE__ */ r("div", {
28
- className: e.panelHeader,
29
- children: s[c].label
30
- }), /* @__PURE__ */ r("div", {
31
- className: e.panelBody,
32
- children: s[c].content
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
- }), o[8] = c, o[9] = s, o[10] = m) : m = o[10];
35
- let h;
36
- return o[11] !== p || o[12] !== m ? (h = /* @__PURE__ */ i("div", {
37
- className: e.wrapper,
38
- children: [p, m]
39
- }), o[11] = p, o[12] = m, o[13] = h) : h = o[13], h;
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 { a as PDFSidebar };
52
+ export { o as PDFSidebar };
@@ -1,11 +1,13 @@
1
1
  var e = {
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"
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 { ThemeProvider as o } from "../context/ThemeContext.js";
8
- import s from "./PDFViewer.module.js";
9
- import { useEffect as c, useRef as l, useState as u } from "react";
10
- import * as d from "pdfjs-dist";
11
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
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 m = ({ file: m, workerSrc: h, sidebar: g, toolbar: _, onChangeFile: v, themeOverrides: y }) => {
14
- c(() => {
15
- d.GlobalWorkerOptions.workerSrc = h;
16
- }, [h]);
17
- let [b, x] = u(null), [S, C] = u(0), [w, T] = u(1), [E, D] = u(0), [O, k] = u(null), [A, j] = u(null), [M, N] = u([]), [P, F] = u(/* @__PURE__ */ new Set()), [I, L] = u([]), R = l(null), z = l([]), B = l([]), { currentPage: V, goToPage: H } = t({
18
- pdf: b,
19
- numPages: S,
20
- zoom: w,
21
- rotation: E,
22
- containerRef: R,
23
- canvasRefs: z
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: b,
27
- currentPage: V,
28
- numPages: S,
29
- goToPage: H,
30
- setZoom: T,
31
- setRotation: D
35
+ pdf: T,
36
+ currentPage: Y,
37
+ numPages: D,
38
+ goToPage: X,
39
+ setZoom: A,
40
+ setRotation: M
32
41
  });
33
- let U = r({
34
- pdf: b,
35
- zoom: w,
36
- rotation: E,
37
- numPages: S,
38
- canvasRefs: z
39
- }), W = a({
40
- pdf: b,
41
- zoom: w,
42
- rotation: E,
43
- numPages: S,
44
- goToPage: H
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
- c(() => {
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 d.getDocument(t).promise;
53
- x(e), C(e.numPages), k(null), j(null), F(/* @__PURE__ */ new Set()), L([]), z.current = Array(e.numPages).fill(null), B.current = Array(e.numPages).fill(null);
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(m);
66
+ }, e.readAsArrayBuffer(h);
58
67
  })();
59
- }, [m]), c(() => {
60
- if (!b) return;
61
- F(/* @__PURE__ */ new Set());
68
+ }, [h]), l(() => {
69
+ if (!T) return;
70
+ H(/* @__PURE__ */ new Set());
62
71
  let e = !1;
63
72
  return (async () => {
64
- let t = B.current.map((e) => e ? (e.cancel(), e.promise.catch(() => {})) : Promise.resolve());
65
- if (await Promise.all(t), B.current = Array(b.numPages).fill(null), e) return;
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 <= b.numPages; e++) {
68
- let t = (await b.getPage(e)).getViewport({
69
- scale: w,
70
- rotation: E
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
- L(n);
79
- for (let t = 1; t <= b.numPages; t++) {
87
+ W(n);
88
+ for (let t = 1; t <= T.numPages; t++) {
80
89
  if (e) return;
81
- let n = await b.getPage(t), r = n.getViewport({
82
- scale: w,
83
- rotation: E
84
- }), i = z.current[t - 1];
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
- B.current[t - 1] = o;
103
+ q.current[t - 1] = o;
95
104
  try {
96
- await o.promise, e || F((e) => new Set(e).add(t));
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, B.current.forEach((e) => e?.cancel());
114
+ e = !0, q.current.forEach((e) => e?.cancel());
106
115
  };
107
116
  }, [
108
- b,
109
- w,
110
- E
117
+ T,
118
+ k,
119
+ j
111
120
  ]);
112
- let [G, K] = u([]);
113
- return c(() => {
114
- if (!b || M.length === 0) {
115
- K([]);
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 M) {
130
+ for (let n of L) {
122
131
  if (e) break;
123
- let [r, i, a, o] = (await b.getPage(n.page)).getViewport({
124
- scale: w,
125
- rotation: E
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 || K(t);
144
+ e || $(t);
136
145
  })(), () => {
137
146
  e = !0;
138
147
  };
139
148
  }, [
140
- M,
141
- w,
142
- E,
143
- b
144
- ]), c(() => {
145
- if (!O || !b) return;
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 b.getPage(O.page)).getViewport({
149
- scale: w,
150
- rotation: E
151
- }).convertToViewportRectangle(O.pdfRect);
152
- e || j({
153
- page: O.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
- O,
164
- w,
165
- E,
166
- b
167
- ]), /* @__PURE__ */ f(o, {
168
- themeOverrides: y,
169
- children: /* @__PURE__ */ f(e.Provider, {
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: b,
172
- numPages: S,
173
- zoom: w,
174
- setZoom: T,
175
- rotation: E,
176
- setRotation: D,
177
- currentPage: V,
178
- goToPage: H,
179
- containerRef: R,
180
- canvasRefs: z,
181
- file: m,
182
- highlight: O,
183
- setHighlight: k,
184
- searchMatches: M,
185
- setSearchMatches: N,
186
- onChangeFile: v
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__ */ p("div", {
189
- className: s.appLayout,
190
- children: [g, /* @__PURE__ */ p("div", {
191
- className: s.mainContent,
192
- children: [_ && /* @__PURE__ */ f("div", {
193
- className: s.toolbar,
194
- children: _
195
- }), /* @__PURE__ */ f("div", {
196
- className: s.scrollContainer,
197
- ref: R,
198
- children: Array.from({ length: S }, (e, t) => {
199
- let n = P.has(t + 1), r = I[t];
200
- return /* @__PURE__ */ p("div", {
201
- className: s.pageWrapper,
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__ */ f("div", {
204
- className: s.pageSkeleton,
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__ */ f("canvas", {
211
- className: s.pageCanvas,
223
+ /* @__PURE__ */ p("canvas", {
224
+ className: c.pageCanvas,
212
225
  ref: (e) => {
213
- z.current[t] = e;
226
+ K.current[t] = e;
214
227
  },
215
228
  style: { display: n ? "block" : "none" }
216
229
  }),
217
- /* @__PURE__ */ f("div", {
218
- className: `textLayer ${s.textLayer}`,
230
+ /* @__PURE__ */ p("div", {
231
+ className: `textLayer ${c.textLayer}`,
219
232
  ref: (e) => {
220
- U.current[t] = e;
233
+ Z.current[t] = e;
221
234
  }
222
235
  }),
223
- W.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ f("a", {
224
- className: s.linkOverlay,
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
- G.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ f("div", {
239
- className: s.searchMatchOverlay,
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
- O && A?.page === t + 1 && /* @__PURE__ */ f("div", {
248
- className: s.highlightOverlay,
260
+ N && F?.page === t + 1 && /* @__PURE__ */ p("div", {
261
+ className: c.highlightOverlay,
249
262
  style: {
250
- left: A.x,
251
- top: A.y,
252
- width: A.width,
253
- height: A.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}-${E}`);
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 { m as default };
279
+ export { h as default };
@@ -1,19 +1,19 @@
1
1
  var e = {
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"
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 { l as PDFAnnotations };
108
+ export { u as PDFAnnotations, l as PDFAnnotationsIcon };
@@ -1,14 +1,16 @@
1
1
  var e = {
2
- list: "_list_173qc_1",
3
- emptyState: "_emptyState_173qc_11",
4
- pageHeader: "_pageHeader_173qc_23",
5
- card: "_card_173qc_45",
6
- cardClickable: "_cardClickable_173qc_65",
7
- cardHeader: "_cardHeader_173qc_81",
8
- cardLabel: "_cardLabel_173qc_95",
9
- cardPage: "_cardPage_173qc_107",
10
- cardAuthor: "_cardAuthor_173qc_117",
11
- cardContent: "_cardContent_173qc_129"
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: "_navWrapper_6ysgx_1",
3
- pageInput: "_pageInput_6ysgx_15",
4
- pageTotal: "_pageTotal_6ysgx_71"
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 };