pdf-tsx 0.9.0 → 0.11.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 (112) hide show
  1. package/README.md +10 -2
  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/PDFAttachments.cjs +1 -1
  9. package/dist/cjs/components/features/PDFAttachments.module.cjs +1 -1
  10. package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
  11. package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
  12. package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
  13. package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
  14. package/dist/cjs/components/features/PDFOutline.cjs +1 -1
  15. package/dist/cjs/components/features/PDFOutline.module.cjs +1 -1
  16. package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
  17. package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
  18. package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
  19. package/dist/cjs/components/features/PDFSearch.cjs +1 -1
  20. package/dist/cjs/components/features/PDFSearch.module.cjs +1 -1
  21. package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -1
  22. package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
  23. package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
  24. package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
  25. package/dist/cjs/components/features/PDFThumbnails.cjs +1 -1
  26. package/dist/cjs/components/features/PDFThumbnails.module.cjs +1 -1
  27. package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
  28. package/dist/cjs/components/features/PDFZoomControls.module.cjs +1 -1
  29. package/dist/cjs/components/ui/PDFToolbar.cjs +1 -1
  30. package/dist/cjs/components/ui/PDFToolbar.module.cjs +1 -1
  31. package/dist/cjs/components/ui/PDFToolbarItem.cjs +1 -1
  32. package/dist/cjs/components/ui/PDFToolbarSeparator.cjs +1 -0
  33. package/dist/cjs/components/ui/PDFToolbarSeparator.module.cjs +1 -0
  34. package/dist/cjs/components/ui/ToolbarButton.cjs +1 -1
  35. package/dist/cjs/components/ui/ToolbarButton.module.cjs +1 -1
  36. package/dist/cjs/components/ui/icons.cjs +1 -1
  37. package/dist/cjs/context/ThemeContext.cjs +1 -1
  38. package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
  39. package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
  40. package/dist/cjs/hooks/useOutline.cjs +1 -1
  41. package/dist/cjs/hooks/useOverlayRects.cjs +1 -1
  42. package/dist/cjs/hooks/usePDFLoader.cjs +1 -1
  43. package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
  44. package/dist/cjs/hooks/useTextLayer.cjs +1 -1
  45. package/dist/cjs/hooks/useTextSearch.cjs +1 -1
  46. package/dist/cjs/hooks/useThumbnails.cjs +1 -1
  47. package/dist/cjs/index.cjs +1 -1
  48. package/dist/cjs/pdf-tsx.css +1 -1
  49. package/dist/cjs/theme.cjs +1 -1
  50. package/dist/components/features/PDFSearch.d.ts +1 -1
  51. package/dist/components/features/PDFSidebarToggle.d.ts +1 -1
  52. package/dist/components/features/PDFZoomControls.d.ts +1 -1
  53. package/dist/components/ui/PDFToolbarSeparator.d.ts +1 -0
  54. package/dist/context/ThemeContext.d.ts +1 -1
  55. package/dist/es/components/PDFSidebar.js +25 -39
  56. package/dist/es/components/PDFSidebar.module.js +9 -9
  57. package/dist/es/components/PDFViewer.js +213 -253
  58. package/dist/es/components/PDFViewer.module.js +16 -15
  59. package/dist/es/components/features/PDFAnnotations.js +54 -62
  60. package/dist/es/components/features/PDFAnnotations.module.js +12 -12
  61. package/dist/es/components/features/PDFAttachments.js +52 -70
  62. package/dist/es/components/features/PDFAttachments.module.js +8 -8
  63. package/dist/es/components/features/PDFChangeFile.js +13 -24
  64. package/dist/es/components/features/PDFDownloadButton.js +10 -13
  65. package/dist/es/components/features/PDFNavigation.js +38 -59
  66. package/dist/es/components/features/PDFNavigation.module.js +3 -3
  67. package/dist/es/components/features/PDFOutline.js +66 -83
  68. package/dist/es/components/features/PDFOutline.module.js +5 -5
  69. package/dist/es/components/features/PDFPageFit.js +18 -23
  70. package/dist/es/components/features/PDFPrintButton.js +14 -17
  71. package/dist/es/components/features/PDFRotationControl.js +7 -13
  72. package/dist/es/components/features/PDFSearch.js +60 -69
  73. package/dist/es/components/features/PDFSearch.module.js +5 -5
  74. package/dist/es/components/features/PDFSidebarToggle.js +8 -13
  75. package/dist/es/components/features/PDFSignatures.js +116 -139
  76. package/dist/es/components/features/PDFSignatures.module.js +16 -16
  77. package/dist/es/components/features/PDFThemeToggle.js +10 -11
  78. package/dist/es/components/features/PDFThumbnails.js +25 -34
  79. package/dist/es/components/features/PDFThumbnails.module.js +9 -9
  80. package/dist/es/components/features/PDFZoomControls.js +21 -36
  81. package/dist/es/components/features/PDFZoomControls.module.js +1 -1
  82. package/dist/es/components/ui/PDFToolbar.js +53 -83
  83. package/dist/es/components/ui/PDFToolbar.module.js +9 -9
  84. package/dist/es/components/ui/PDFToolbarItem.js +10 -19
  85. package/dist/es/components/ui/PDFToolbarSeparator.js +13 -0
  86. package/dist/es/components/ui/PDFToolbarSeparator.module.js +3 -0
  87. package/dist/es/components/ui/ToolbarButton.js +8 -11
  88. package/dist/es/components/ui/ToolbarButton.module.js +2 -2
  89. package/dist/es/components/ui/icons.js +5 -16
  90. package/dist/es/context/ThemeContext.js +28 -38
  91. package/dist/es/hooks/useAnnotationLayer.js +33 -42
  92. package/dist/es/hooks/useKeyboardShortcuts.js +25 -34
  93. package/dist/es/hooks/useOutline.js +18 -23
  94. package/dist/es/hooks/useOverlayRects.js +42 -51
  95. package/dist/es/hooks/usePDFLoader.js +17 -16
  96. package/dist/es/hooks/useScrollTracking.js +24 -25
  97. package/dist/es/hooks/useTextLayer.js +34 -43
  98. package/dist/es/hooks/useTextSearch.js +31 -38
  99. package/dist/es/hooks/useThumbnails.js +33 -44
  100. package/dist/es/index.js +2 -1
  101. package/dist/es/pdf-tsx.css +1 -1
  102. package/dist/es/theme.js +6 -3
  103. package/dist/hooks/useAttachments.d.ts +1 -1
  104. package/dist/hooks/useOutline.d.ts +1 -1
  105. package/dist/hooks/useOverlayRects.d.ts +1 -1
  106. package/dist/hooks/usePDFLoader.d.ts +1 -0
  107. package/dist/hooks/usePDFRenderer.d.ts +1 -1
  108. package/dist/hooks/useSignatures.d.ts +1 -1
  109. package/dist/hooks/useThumbnails.d.ts +1 -1
  110. package/dist/index.d.ts +4 -3
  111. package/dist/theme.d.ts +1 -0
  112. package/package.json +3 -3
@@ -1,261 +1,221 @@
1
1
  import { PDFViewerContext as e } from "../context/PDFViewerContext.js";
2
2
  import { useScrollTracking as t } from "../hooks/useScrollTracking.js";
3
- import { useKeyboardShortcuts as ee } from "../hooks/useKeyboardShortcuts.js";
4
- import { useTextLayer as n } from "../hooks/useTextLayer.js";
5
- import { isSafeUrl as r } from "../utils/url.js";
6
- import { useAnnotationLayer as te } from "../hooks/useAnnotationLayer.js";
7
- import { usePDFLoader as ne } from "../hooks/usePDFLoader.js";
8
- import { usePDFRenderer as re } from "../hooks/usePDFRenderer.js";
9
- import { useOverlayRects as ie } from "../hooks/useOverlayRects.js";
10
- import { computeFit as ae } from "../utils/pdfFit.js";
11
- import { ThemeProvider as oe } from "../context/ThemeContext.js";
12
- import i from "./PDFViewer.module.js";
13
- import { c as se } from "react/compiler-runtime";
14
- import { useEffect as a, useRef as o, useState as s } from "react";
15
- import * as ce from "pdfjs-dist";
16
- import { Fragment as le, jsx as c, jsxs as l } from "react/jsx-runtime";
3
+ import { useKeyboardShortcuts as n } from "../hooks/useKeyboardShortcuts.js";
4
+ import { useTextLayer as r } from "../hooks/useTextLayer.js";
5
+ import { isSafeUrl as i } from "../utils/url.js";
6
+ import { useAnnotationLayer as a } from "../hooks/useAnnotationLayer.js";
7
+ import { usePDFLoader as ee } from "../hooks/usePDFLoader.js";
8
+ import { usePDFRenderer as te } from "../hooks/usePDFRenderer.js";
9
+ import { useOverlayRects as o } from "../hooks/useOverlayRects.js";
10
+ import { computeFit as s } from "../utils/pdfFit.js";
11
+ import { ThemeProvider as c } from "../context/ThemeContext.js";
12
+ import l from "./PDFViewer.module.js";
13
+ import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
14
+ import * as h from "pdfjs-dist";
15
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
17
16
  //#region src/components/PDFViewer.tsx
18
- var ue = 2, u = (r) => {
19
- let u = se(100), { file: d, workerSrc: he, sidebar: ge, toolbar: _e, onChangeFile: ve, themeOverrides: ye, defaultTheme: be, defaultFit: f, className: xe, style: Se } = r, p, m;
20
- u[0] === he ? (p = u[1], m = u[2]) : (p = () => {
21
- ce.GlobalWorkerOptions.workerSrc = he;
22
- }, m = [he], u[0] = he, u[1] = p, u[2] = m), a(p, m);
23
- let [h, g] = s(1), [_, Ce] = s(0), [v, we] = s(null), y;
24
- u[3] === Symbol.for("react.memo_cache_sentinel") ? (y = [], u[3] = y) : y = u[3];
25
- let [b, Te] = s(y), [Ee, De] = s(!1), [x, Oe] = s(f ?? null), S = o(null), C;
26
- u[4] === Symbol.for("react.memo_cache_sentinel") ? (C = [], u[4] = C) : C = u[4];
27
- let ke = o(C), w;
28
- u[5] === Symbol.for("react.memo_cache_sentinel") ? (w = [], u[5] = w) : w = u[5];
29
- let T = o(w), Ae = o(_), E, D;
30
- u[6] === _ ? (E = u[7], D = u[8]) : (E = () => {
31
- Ae.current = _;
32
- }, D = [_], u[6] = _, u[7] = E, u[8] = D), a(E, D);
33
- let [je, Me] = s(null);
34
- je !== d && (Me(d), we(null));
35
- let { pdf: O, numPages: k } = ne(d), A, j;
36
- u[9] === O ? (A = u[10], j = u[11]) : (A = () => {
37
- O && (ke.current = Array(O.numPages).fill(null), T.current = Array(O.numPages).fill(null));
38
- }, j = [O], u[9] = O, u[10] = A, u[11] = j), a(A, j);
39
- let M, N;
40
- u[12] !== f || u[13] !== O ? (M = () => {
41
- !O || !f || !S.current || ae(f, O, S.current, Ae.current).then(g);
42
- }, N = [O, f], u[12] = f, u[13] = O, u[14] = M, u[15] = N) : (M = u[14], N = u[15]), a(M, N);
43
- let Ne = o(x), P, F;
44
- u[16] === x ? (P = u[17], F = u[18]) : (P = () => {
45
- Ne.current = x;
46
- }, F = [x], u[16] = x, u[17] = P, u[18] = F), a(P, F);
47
- let I, L;
48
- u[19] === O ? (I = u[20], L = u[21]) : (I = () => {
49
- if (!O || !S.current) return;
50
- let e = S.current, t = new ResizeObserver(() => {
51
- Ne.current && ae(Ne.current, O, e, Ae.current).then(g);
17
+ var y = 2, b = ({ file: b, workerSrc: x, sidebar: S, toolbar: C, onChangeFile: w, themeOverrides: ne, defaultTheme: re, defaultFit: T, className: E, style: ie }) => {
18
+ d(() => {
19
+ h.GlobalWorkerOptions.workerSrc = x;
20
+ }, [x]);
21
+ let [D, O] = m(1), [k, A] = m(0), [j, M] = m(null), [N, ae] = m([]), [P, F] = m(!1), [I, L] = m(T ?? null), R = p(null), z = p([]), B = p([]), V = p(k);
22
+ d(() => {
23
+ V.current = k;
24
+ }, [k]);
25
+ let [H, U] = m(null);
26
+ H !== b && (U(b), M(null));
27
+ let { pdf: W, numPages: G, loading: K } = ee(b);
28
+ d(() => {
29
+ W && (z.current = Array(W.numPages).fill(null), B.current = Array(W.numPages).fill(null));
30
+ }, [W]), d(() => {
31
+ !W || !T || !R.current || s(T, W, R.current, V.current).then(O);
32
+ }, [W, T]);
33
+ let q = p(I);
34
+ d(() => {
35
+ q.current = I;
36
+ }, [I]), d(() => {
37
+ if (!W || !R.current) return;
38
+ let e = R.current, t = new ResizeObserver(() => {
39
+ q.current && s(q.current, W, e, V.current).then(O);
52
40
  });
53
41
  return t.observe(e), () => t.disconnect();
54
- }, L = [O], u[19] = O, u[20] = I, u[21] = L), a(I, L);
55
- let R;
56
- u[22] === k ? R = u[23] : (R = {
57
- numPages: k,
58
- containerRef: S,
59
- pageRefs: ke
60
- }, u[22] = k, u[23] = R);
61
- let { currentPage: z, goToPage: B } = t(R), Pe;
62
- bb0: {
63
- if (k === 0) {
64
- let e;
65
- u[24] === Symbol.for("react.memo_cache_sentinel") ? (e = [], u[24] = e) : e = u[24], Pe = e;
66
- break bb0;
67
- }
68
- let e;
69
- if (u[25] !== z || u[26] !== v || u[27] !== k || u[28] !== b) {
70
- let t = /* @__PURE__ */ new Set(), ee = Math.max(z - ue, 1), n = Math.min(z + ue, k);
71
- for (let e = ee; e <= n; e++) t.add(e);
72
- v && t.add(v.page);
73
- for (let e of b) t.add(e.page);
74
- e = Array.from(t).sort(de), u[25] = z, u[26] = v, u[27] = k, u[28] = b, u[29] = e;
75
- } else e = u[29];
76
- Pe = e;
77
- }
78
- let V = Pe, H;
79
- u[30] !== O || u[31] !== _ || u[32] !== V || u[33] !== h ? (H = {
80
- pdf: O,
81
- zoom: h,
82
- rotation: _,
83
- visiblePages: V,
84
- canvasRefs: T
85
- }, u[30] = O, u[31] = _, u[32] = V, u[33] = h, u[34] = H) : H = u[34];
86
- let { pageSizes: Fe, renderedPages: U } = re(H), W;
87
- if (u[35] !== U || u[36] !== V) {
88
- let e = new Set(V);
89
- for (let t of U) e.add(t);
90
- W = Array.from(e).sort(fe), u[35] = U, u[36] = V, u[37] = W;
91
- } else W = u[37];
92
- let G = W, Ie;
93
- u[38] !== z || u[39] !== B || u[40] !== O ? (Ie = {
94
- pdf: O,
95
- currentPage: z,
96
- goToPage: B,
97
- setZoom: g,
98
- setRotation: Ce,
99
- setFitMode: Oe
100
- }, u[38] = z, u[39] = B, u[40] = O, u[41] = Ie) : Ie = u[41], ee(Ie);
101
- let Le;
102
- u[42] !== G || u[43] !== O || u[44] !== _ || u[45] !== h ? (Le = {
103
- pdf: O,
104
- zoom: h,
105
- rotation: _,
106
- mountedPages: G,
107
- canvasRefs: T
108
- }, u[42] = G, u[43] = O, u[44] = _, u[45] = h, u[46] = Le) : Le = u[46];
109
- let Re = n(Le), ze;
110
- u[47] !== B || u[48] !== G || u[49] !== O || u[50] !== _ || u[51] !== h ? (ze = {
111
- pdf: O,
112
- zoom: h,
113
- rotation: _,
114
- mountedPages: G,
115
- goToPage: B
116
- }, u[47] = B, u[48] = G, u[49] = O, u[50] = _, u[51] = h, u[52] = ze) : ze = u[52];
117
- let Be = te(ze), Ve;
118
- u[53] !== v || u[54] !== O || u[55] !== _ || u[56] !== b || u[57] !== h ? (Ve = {
119
- pdf: O,
120
- highlight: v,
121
- searchMatches: b,
122
- zoom: h,
123
- rotation: _
124
- }, u[53] = v, u[54] = O, u[55] = _, u[56] = b, u[57] = h, u[58] = Ve) : Ve = u[58];
125
- let { overlayRect: K, searchOverlays: He } = ie(Ve), q;
126
- u[59] !== z || u[60] !== d || u[61] !== x || u[62] !== B || u[63] !== v || u[64] !== k || u[65] !== ve || u[66] !== O || u[67] !== _ || u[68] !== b || u[69] !== Ee || u[70] !== h ? (q = {
127
- pdf: O,
128
- numPages: k,
129
- zoom: h,
130
- setZoom: g,
131
- rotation: _,
132
- setRotation: Ce,
133
- currentPage: z,
134
- goToPage: B,
135
- containerRef: S,
136
- canvasRefs: T,
137
- file: d,
138
- highlight: v,
139
- setHighlight: we,
140
- searchMatches: b,
141
- setSearchMatches: Te,
142
- onChangeFile: ve,
143
- sidebarCollapsed: Ee,
144
- setSidebarCollapsed: De,
145
- fitMode: x,
146
- setFitMode: Oe
147
- }, u[59] = z, u[60] = d, u[61] = x, u[62] = B, u[63] = v, u[64] = k, u[65] = ve, u[66] = O, u[67] = _, u[68] = b, u[69] = Ee, u[70] = h, u[71] = q) : q = u[71];
148
- let Ue = `${i.appLayout}${xe ? ` ${xe}` : ""}`, J;
149
- u[72] === _e ? J = u[73] : (J = _e && /* @__PURE__ */ c("div", {
150
- className: i.toolbar,
151
- children: _e
152
- }), u[72] = _e, u[73] = J);
153
- let Y;
154
- u[74] !== v || u[75] !== Be || u[76] !== G || u[77] !== k || u[78] !== K || u[79] !== Fe || u[80] !== U || u[81] !== _ || u[82] !== He || u[83] !== Re ? (Y = /* @__PURE__ */ c("div", {
155
- className: i.scrollContainer,
156
- ref: S,
157
- children: Array.from({ length: k }, (e, t) => {
158
- let ee = U.has(t + 1), n = Fe[t], r = G.includes(t + 1);
159
- return /* @__PURE__ */ l("div", {
160
- className: i.pageWrapper,
161
- ref: (e) => {
162
- ke.current[t] = e;
163
- },
164
- style: n ? {
165
- width: n.width,
166
- height: n.height
167
- } : void 0,
168
- children: [
169
- n && !ee && /* @__PURE__ */ c("div", {
170
- className: i.pageSkeleton,
171
- style: {
172
- width: n.width,
173
- height: n.height
174
- }
175
- }),
176
- r && /* @__PURE__ */ l(le, { children: [/* @__PURE__ */ c("canvas", {
177
- className: i.pageCanvas,
178
- ref: (e) => {
179
- T.current[t] = e;
180
- },
181
- style: { display: ee ? "block" : "none" }
182
- }), /* @__PURE__ */ c("div", {
183
- className: `textLayer ${i.textLayer}`,
184
- ref: (e) => {
185
- Re.current[t] = e;
186
- }
187
- })] }),
188
- Be.filter((e) => e.page === t + 1).map(pe),
189
- He.filter((e) => e.page === t + 1).map(me),
190
- v && K?.page === t + 1 && /* @__PURE__ */ c("div", {
191
- className: i.highlightOverlay,
192
- style: {
193
- left: K.x,
194
- top: K.y,
195
- width: K.width,
196
- height: K.height
197
- }
198
- })
199
- ]
200
- }, `${t}-${_}`);
42
+ }, [W]);
43
+ let { currentPage: J, goToPage: Y } = t({
44
+ numPages: G,
45
+ containerRef: R,
46
+ pageRefs: z
47
+ }), X = f(() => {
48
+ if (G === 0) return [];
49
+ let e = /* @__PURE__ */ new Set(), t = Math.max(J - y, 1), n = Math.min(J + y, G);
50
+ for (let r = t; r <= n; r++) e.add(r);
51
+ j && e.add(j.page);
52
+ for (let t of N) e.add(t.page);
53
+ return Array.from(e).sort((e, t) => e - t);
54
+ }, [
55
+ J,
56
+ G,
57
+ j,
58
+ N
59
+ ]), { pageSizes: oe, renderedPages: Z } = te({
60
+ pdf: W,
61
+ zoom: D,
62
+ rotation: k,
63
+ visiblePages: X,
64
+ canvasRefs: B
65
+ }), Q = f(() => {
66
+ let e = new Set(X);
67
+ for (let t of Z) e.add(t);
68
+ return Array.from(e).sort((e, t) => e - t);
69
+ }, [X, Z]);
70
+ n({
71
+ pdf: W,
72
+ currentPage: J,
73
+ goToPage: Y,
74
+ setZoom: O,
75
+ setRotation: A,
76
+ setFitMode: L
77
+ });
78
+ let se = r({
79
+ pdf: W,
80
+ zoom: D,
81
+ rotation: k,
82
+ mountedPages: Q,
83
+ canvasRefs: B
84
+ }), ce = a({
85
+ pdf: W,
86
+ zoom: D,
87
+ rotation: k,
88
+ mountedPages: Q,
89
+ goToPage: Y
90
+ }), { overlayRect: $, searchOverlays: le } = o({
91
+ pdf: W,
92
+ highlight: j,
93
+ searchMatches: N,
94
+ zoom: D,
95
+ rotation: k
96
+ }), ue = u((e, t) => {
97
+ (!e.url || !i(e.url)) && (t.preventDefault(), e.url || e._handleClick());
98
+ }, []), de = f(() => ({
99
+ pdf: W,
100
+ numPages: G,
101
+ zoom: D,
102
+ setZoom: O,
103
+ rotation: k,
104
+ setRotation: A,
105
+ currentPage: J,
106
+ goToPage: Y,
107
+ containerRef: R,
108
+ canvasRefs: B,
109
+ file: b,
110
+ highlight: j,
111
+ setHighlight: M,
112
+ searchMatches: N,
113
+ setSearchMatches: ae,
114
+ onChangeFile: w,
115
+ sidebarCollapsed: P,
116
+ setSidebarCollapsed: F,
117
+ fitMode: I,
118
+ setFitMode: L
119
+ }), [
120
+ W,
121
+ G,
122
+ D,
123
+ k,
124
+ J,
125
+ Y,
126
+ b,
127
+ j,
128
+ N,
129
+ w,
130
+ P,
131
+ I
132
+ ]);
133
+ return /* @__PURE__ */ _(c, {
134
+ themeOverrides: ne,
135
+ defaultTheme: re,
136
+ children: /* @__PURE__ */ _(e.Provider, {
137
+ value: de,
138
+ children: /* @__PURE__ */ v("div", {
139
+ className: `${l.appLayout}${E ? ` ${E}` : ""}`,
140
+ style: ie,
141
+ children: [C && /* @__PURE__ */ _("div", {
142
+ className: l.toolbar,
143
+ children: C
144
+ }), /* @__PURE__ */ v("div", {
145
+ className: l.body,
146
+ children: [S, /* @__PURE__ */ v("div", {
147
+ className: l.scrollContainer,
148
+ ref: R,
149
+ children: [K && /* @__PURE__ */ _("div", { className: l.documentLoading }), Array.from({ length: G }, (e, t) => {
150
+ let n = Z.has(t + 1), r = oe[t], a = Q.includes(t + 1);
151
+ return /* @__PURE__ */ v("div", {
152
+ className: l.pageWrapper,
153
+ ref: (e) => {
154
+ z.current[t] = e;
155
+ },
156
+ style: r ? {
157
+ width: r.width,
158
+ height: r.height
159
+ } : void 0,
160
+ children: [
161
+ r && !n && /* @__PURE__ */ _("div", {
162
+ className: l.pageSkeleton,
163
+ style: {
164
+ width: r.width,
165
+ height: r.height
166
+ }
167
+ }),
168
+ a && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("canvas", {
169
+ className: l.pageCanvas,
170
+ ref: (e) => {
171
+ B.current[t] = e;
172
+ },
173
+ style: { display: n ? "block" : "none" }
174
+ }), /* @__PURE__ */ _("div", {
175
+ className: `textLayer ${l.textLayer}`,
176
+ ref: (e) => {
177
+ se.current[t] = e;
178
+ }
179
+ })] }),
180
+ ce.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ _("a", {
181
+ className: l.linkOverlay,
182
+ href: e.url && i(e.url) ? e.url : "#",
183
+ target: "_blank",
184
+ rel: "noopener noreferrer",
185
+ style: {
186
+ left: e.x,
187
+ top: e.y,
188
+ width: e.width,
189
+ height: e.height
190
+ },
191
+ onClick: (t) => ue(e, t)
192
+ }, t)),
193
+ le.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ _("div", {
194
+ className: l.searchMatchOverlay,
195
+ style: {
196
+ left: e.x,
197
+ top: e.y,
198
+ width: e.width,
199
+ height: e.height
200
+ }
201
+ }, t)),
202
+ j && $?.page === t + 1 && /* @__PURE__ */ _("div", {
203
+ className: l.highlightOverlay,
204
+ style: {
205
+ left: $.x,
206
+ top: $.y,
207
+ width: $.width,
208
+ height: $.height
209
+ }
210
+ })
211
+ ]
212
+ }, `${t}-${k}`);
213
+ })]
214
+ })]
215
+ })]
216
+ })
201
217
  })
202
- }), u[74] = v, u[75] = Be, u[76] = G, u[77] = k, u[78] = K, u[79] = Fe, u[80] = U, u[81] = _, u[82] = He, u[83] = Re, u[84] = Y) : Y = u[84];
203
- let X;
204
- u[85] !== ge || u[86] !== Y ? (X = /* @__PURE__ */ l("div", {
205
- className: i.body,
206
- children: [ge, Y]
207
- }), u[85] = ge, u[86] = Y, u[87] = X) : X = u[87];
208
- let Z;
209
- u[88] !== Se || u[89] !== Ue || u[90] !== J || u[91] !== X ? (Z = /* @__PURE__ */ l("div", {
210
- className: Ue,
211
- style: Se,
212
- children: [J, X]
213
- }), u[88] = Se, u[89] = Ue, u[90] = J, u[91] = X, u[92] = Z) : Z = u[92];
214
- let Q;
215
- u[93] !== q || u[94] !== Z ? (Q = /* @__PURE__ */ c(e.Provider, {
216
- value: q,
217
- children: Z
218
- }), u[93] = q, u[94] = Z, u[95] = Q) : Q = u[95];
219
- let $;
220
- return u[96] !== be || u[97] !== Q || u[98] !== ye ? ($ = /* @__PURE__ */ c(oe, {
221
- themeOverrides: ye,
222
- defaultTheme: be,
223
- children: Q
224
- }), u[96] = be, u[97] = Q, u[98] = ye, u[99] = $) : $ = u[99], $;
218
+ });
225
219
  };
226
- function de(e, t) {
227
- return e - t;
228
- }
229
- function fe(e, t) {
230
- return e - t;
231
- }
232
- function pe(e, t) {
233
- return /* @__PURE__ */ c("a", {
234
- className: i.linkOverlay,
235
- href: e.url && r(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 || !r(e.url)) && (t.preventDefault(), e.url || e._handleClick());
246
- }
247
- }, t);
248
- }
249
- function me(e, t) {
250
- return /* @__PURE__ */ c("div", {
251
- className: i.searchMatchOverlay,
252
- style: {
253
- left: e.x,
254
- top: e.y,
255
- width: e.width,
256
- height: e.height
257
- }
258
- }, t);
259
- }
260
220
  //#endregion
261
- export { u as default };
221
+ export { b as default };
@@ -1,19 +1,20 @@
1
1
  var e = {
2
- appLayout: "_appLayout_1t51x_1",
3
- body: "_body_1t51x_17",
4
- toolbar: "_toolbar_1t51x_33",
5
- scrollContainer: "_scrollContainer_1t51x_57",
6
- pageWrapper: "_pageWrapper_1t51x_77",
7
- pageCanvas: "_pageCanvas_1t51x_87",
8
- textLayer: "_textLayer_1t51x_105",
9
- markedContent: "_markedContent_1t51x_157",
10
- endOfContent: "_endOfContent_1t51x_187",
11
- selecting: "_selecting_1t51x_205",
12
- pageSkeleton: "_pageSkeleton_1t51x_245",
13
- spin: "_spin_1t51x_1",
14
- highlightOverlay: "_highlightOverlay_1t51x_299",
15
- linkOverlay: "_linkOverlay_1t51x_317",
16
- searchMatchOverlay: "_searchMatchOverlay_1t51x_331"
2
+ appLayout: "_appLayout_18euq_1",
3
+ body: "_body_18euq_9",
4
+ toolbar: "_toolbar_18euq_17",
5
+ scrollContainer: "_scrollContainer_18euq_29",
6
+ pageWrapper: "_pageWrapper_18euq_40",
7
+ pageCanvas: "_pageCanvas_18euq_45",
8
+ textLayer: "_textLayer_18euq_54",
9
+ markedContent: "_markedContent_18euq_80",
10
+ endOfContent: "_endOfContent_18euq_95",
11
+ selecting: "_selecting_18euq_104",
12
+ documentLoading: "_documentLoading_18euq_124",
13
+ spin: "_spin_18euq_1",
14
+ pageSkeleton: "_pageSkeleton_18euq_144",
15
+ highlightOverlay: "_highlightOverlay_18euq_173",
16
+ linkOverlay: "_linkOverlay_18euq_182",
17
+ searchMatchOverlay: "_searchMatchOverlay_18euq_189"
17
18
  };
18
19
  //#endregion
19
20
  export { e as default };