pdf-tsx 0.5.0 → 0.7.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 +411 -350
- 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.module.cjs +1 -1
- package/dist/cjs/components/features/PDFAttachments.cjs +1 -0
- package/dist/cjs/components/features/PDFAttachments.module.cjs +1 -0
- package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
- package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
- package/dist/cjs/components/features/PDFOutline.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/PDFRotationControl.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 -1
- package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
- package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
- package/dist/cjs/components/features/PDFThumbnails.module.cjs +1 -1
- package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
- package/dist/cjs/components/features/PDFZoomControls.module.cjs +1 -1
- package/dist/cjs/components/ui/PDFToolbar.cjs +1 -0
- package/dist/cjs/components/ui/PDFToolbar.module.cjs +1 -0
- package/dist/cjs/components/ui/PDFToolbarItem.cjs +1 -0
- package/dist/cjs/components/ui/ToolbarButton.module.cjs +1 -1
- package/dist/cjs/context/ThemeContext.cjs +1 -1
- package/dist/cjs/hooks/useAnnotations.cjs +1 -1
- package/dist/cjs/hooks/useAttachments.cjs +1 -0
- package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
- package/dist/cjs/hooks/usePDFRenderer.cjs +1 -1
- package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pdf-tsx.css +1 -1
- package/dist/cjs/theme.cjs +1 -1
- package/dist/components/features/PDFAttachments.d.ts +5 -0
- package/dist/components/features/PDFChangeFile.d.ts +3 -0
- package/dist/components/features/PDFDownloadButton.d.ts +3 -0
- package/dist/components/features/PDFNavigation.d.ts +3 -0
- package/dist/components/features/PDFPageFit.d.ts +3 -0
- package/dist/components/features/PDFPrintButton.d.ts +3 -0
- package/dist/components/features/PDFRotationControl.d.ts +3 -0
- package/dist/components/features/PDFSearch.d.ts +3 -0
- package/dist/components/features/PDFSidebarToggle.d.ts +3 -0
- package/dist/components/features/PDFThemeToggle.d.ts +3 -0
- package/dist/components/features/PDFZoomControls.d.ts +3 -0
- package/dist/components/ui/PDFToolbar.d.ts +8 -0
- package/dist/components/ui/PDFToolbarItem.d.ts +7 -0
- package/dist/context/PDFViewerContext.d.ts +3 -1
- package/dist/es/components/PDFSidebar.module.js +9 -9
- package/dist/es/components/PDFViewer.js +168 -173
- package/dist/es/components/PDFViewer.module.js +15 -15
- package/dist/es/components/features/PDFAnnotations.module.js +12 -12
- package/dist/es/components/features/PDFAttachments.js +117 -0
- package/dist/es/components/features/PDFAttachments.module.js +12 -0
- package/dist/es/components/features/PDFChangeFile.js +1 -0
- package/dist/es/components/features/PDFDownloadButton.js +1 -0
- package/dist/es/components/features/PDFNavigation.js +1 -0
- package/dist/es/components/features/PDFNavigation.module.js +3 -3
- package/dist/es/components/features/PDFOutline.js +37 -24
- package/dist/es/components/features/PDFOutline.module.js +5 -5
- package/dist/es/components/features/PDFPageFit.js +18 -17
- package/dist/es/components/features/PDFPrintButton.js +1 -0
- package/dist/es/components/features/PDFRotationControl.js +1 -0
- package/dist/es/components/features/PDFSearch.js +1 -0
- package/dist/es/components/features/PDFSearch.module.js +5 -5
- package/dist/es/components/features/PDFSidebarToggle.js +8 -7
- package/dist/es/components/features/PDFSignatures.module.js +16 -16
- package/dist/es/components/features/PDFThemeToggle.js +1 -0
- package/dist/es/components/features/PDFThumbnails.module.js +9 -9
- package/dist/es/components/features/PDFZoomControls.js +29 -30
- package/dist/es/components/features/PDFZoomControls.module.js +1 -1
- package/dist/es/components/ui/PDFToolbar.js +84 -0
- package/dist/es/components/ui/PDFToolbar.module.js +13 -0
- package/dist/es/components/ui/PDFToolbarItem.js +25 -0
- package/dist/es/components/ui/ToolbarButton.module.js +2 -2
- package/dist/es/context/ThemeContext.js +1 -0
- package/dist/es/hooks/useAnnotations.js +2 -6
- package/dist/es/hooks/useAttachments.js +31 -0
- package/dist/es/hooks/useKeyboardShortcuts.js +8 -7
- package/dist/es/hooks/usePDFRenderer.js +20 -10
- package/dist/es/hooks/useScrollTracking.js +20 -30
- package/dist/es/index.js +18 -15
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/es/theme.js +9 -3
- package/dist/hooks/useAnnotations.d.ts +1 -1
- package/dist/hooks/useAttachments.d.ts +11 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +2 -1
- package/dist/hooks/useScrollTracking.d.ts +2 -7
- package/dist/index.d.ts +3 -0
- package/dist/theme.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
|
@@ -16,201 +16,196 @@ import * as se from "pdfjs-dist";
|
|
|
16
16
|
import { Fragment as ce, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/PDFViewer.tsx
|
|
18
18
|
var le = 2, d = (i) => {
|
|
19
|
-
let d = oe(
|
|
20
|
-
d[0] === p ? (
|
|
19
|
+
let d = oe(75), { file: f, workerSrc: p, sidebar: me, toolbar: he, onChangeFile: ge, themeOverrides: _e, defaultTheme: ve, defaultFit: m, className: ye, style: be } = i, h, g;
|
|
20
|
+
d[0] === p ? (h = d[1], g = d[2]) : (h = () => {
|
|
21
21
|
se.GlobalWorkerOptions.workerSrc = p;
|
|
22
|
-
},
|
|
23
|
-
let [
|
|
22
|
+
}, g = [p], d[0] = p, d[1] = h, d[2] = g), o(h, g);
|
|
23
|
+
let [_, v] = c(1), [y, xe] = c(0), [b, Se] = c(null), x;
|
|
24
24
|
d[3] === Symbol.for("react.memo_cache_sentinel") ? (x = [], d[3] = x) : x = d[3];
|
|
25
|
-
let [S, Ce] = c(x), [we, Te] = c(!1), C = s(null),
|
|
26
|
-
d[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
27
|
-
let
|
|
28
|
-
d[5] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
29
|
-
let
|
|
30
|
-
d[6] === y ? (
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
let [
|
|
34
|
-
|
|
35
|
-
let { pdf:
|
|
36
|
-
d[9] ===
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
d[12] !==
|
|
41
|
-
!
|
|
42
|
-
},
|
|
43
|
-
let
|
|
44
|
-
d[16]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
let [S, Ce] = c(x), [we, Te] = c(!1), [C, Ee] = c(m ?? null), w = s(null), T;
|
|
26
|
+
d[4] === Symbol.for("react.memo_cache_sentinel") ? (T = [], d[4] = T) : T = d[4];
|
|
27
|
+
let De = s(T), E;
|
|
28
|
+
d[5] === Symbol.for("react.memo_cache_sentinel") ? (E = [], d[5] = E) : E = d[5];
|
|
29
|
+
let D = s(E), Oe = s(y), O, k;
|
|
30
|
+
d[6] === y ? (O = d[7], k = d[8]) : (O = () => {
|
|
31
|
+
Oe.current = y;
|
|
32
|
+
}, k = [y], d[6] = y, d[7] = O, d[8] = k), o(O, k);
|
|
33
|
+
let [ke, Ae] = c(null);
|
|
34
|
+
ke !== f && (Ae(f), Se(null));
|
|
35
|
+
let { pdf: A, numPages: j } = te(f), M, N;
|
|
36
|
+
d[9] === A ? (M = d[10], N = d[11]) : (M = () => {
|
|
37
|
+
A && (De.current = Array(A.numPages).fill(null), D.current = Array(A.numPages).fill(null));
|
|
38
|
+
}, N = [A], d[9] = A, d[10] = M, d[11] = N), o(M, N);
|
|
39
|
+
let P, F;
|
|
40
|
+
d[12] !== m || d[13] !== A ? (P = () => {
|
|
41
|
+
!A || !m || !w.current || ie(m, A, w.current, Oe.current).then(v);
|
|
42
|
+
}, F = [A, m], d[12] = m, d[13] = A, d[14] = P, d[15] = F) : (P = d[14], F = d[15]), o(P, F);
|
|
43
|
+
let je = s(C), I, L;
|
|
44
|
+
d[16] === C ? (I = d[17], L = d[18]) : (I = () => {
|
|
45
|
+
je.current = C;
|
|
46
|
+
}, L = [C], d[16] = C, d[17] = I, d[18] = L), o(I, L);
|
|
47
|
+
let R, z;
|
|
48
|
+
d[19] === A ? (R = d[20], z = d[21]) : (R = () => {
|
|
49
|
+
if (!A || !w.current) return;
|
|
50
|
+
let e = w.current, t = new ResizeObserver(() => {
|
|
51
|
+
je.current && ie(je.current, A, e, Oe.current).then(v);
|
|
52
|
+
});
|
|
53
|
+
return t.observe(e), () => t.disconnect();
|
|
54
|
+
}, z = [A], d[19] = A, d[20] = R, d[21] = z), o(R, z);
|
|
55
|
+
let B;
|
|
56
|
+
d[22] === j ? B = d[23] : (B = {
|
|
57
|
+
numPages: j,
|
|
58
|
+
containerRef: w,
|
|
59
|
+
pageRefs: De
|
|
60
|
+
}, d[22] = j, d[23] = B);
|
|
61
|
+
let { currentPage: V, goToPage: H } = t(B), U;
|
|
62
|
+
d[24] !== V || d[25] !== b || d[26] !== j || d[27] !== S ? (U = () => {
|
|
63
|
+
if (j === 0) return [];
|
|
64
|
+
let e = /* @__PURE__ */ new Set(), t = Math.max(V - le, 1), n = Math.min(V + le, j);
|
|
65
|
+
for (let r = t; r <= n; r++) e.add(r);
|
|
66
|
+
b && e.add(b.page);
|
|
67
|
+
for (let t of S) e.add(t.page);
|
|
68
|
+
return Array.from(e).sort(ue);
|
|
69
|
+
}, d[24] = V, d[25] = b, d[26] = j, d[27] = S, d[28] = U) : U = d[28];
|
|
70
|
+
let Me = U(), { pageSizes: Ne, renderedPages: Pe } = ne({
|
|
71
|
+
pdf: A,
|
|
72
|
+
zoom: _,
|
|
48
73
|
rotation: y,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} else e = d[26];
|
|
68
|
-
Ae = e;
|
|
69
|
-
}
|
|
70
|
-
let R = Ae, z;
|
|
71
|
-
d[27] !== k || d[28] !== y || d[29] !== R || d[30] !== v ? (z = {
|
|
72
|
-
pdf: k,
|
|
73
|
-
zoom: v,
|
|
74
|
-
rotation: y,
|
|
75
|
-
visiblePages: R,
|
|
76
|
-
canvasRefs: E
|
|
77
|
-
}, d[27] = k, d[28] = y, d[29] = R, d[30] = v, d[31] = z) : z = d[31];
|
|
78
|
-
let { pageSizes: je, renderedPages: B } = ne(z), V;
|
|
79
|
-
if (d[32] !== B || d[33] !== R) {
|
|
80
|
-
let e = new Set(R);
|
|
81
|
-
for (let t of B) e.add(t);
|
|
82
|
-
V = Array.from(e).sort(de), d[32] = B, d[33] = R, d[34] = V;
|
|
83
|
-
} else V = d[34];
|
|
84
|
-
let H = V, U;
|
|
85
|
-
d[35] !== I || d[36] !== L || d[37] !== k ? (U = {
|
|
86
|
-
pdf: k,
|
|
87
|
-
currentPage: I,
|
|
88
|
-
goToPage: L,
|
|
89
|
-
setZoom: be,
|
|
90
|
-
setRotation: xe
|
|
91
|
-
}, d[35] = I, d[36] = L, d[37] = k, d[38] = U) : U = d[38], n(U);
|
|
92
|
-
let W;
|
|
93
|
-
d[39] !== H || d[40] !== k || d[41] !== y || d[42] !== v ? (W = {
|
|
94
|
-
pdf: k,
|
|
95
|
-
zoom: v,
|
|
74
|
+
visiblePages: Me,
|
|
75
|
+
canvasRefs: D
|
|
76
|
+
}), Fe = (() => {
|
|
77
|
+
let e = new Set(Me);
|
|
78
|
+
for (let t of Pe) e.add(t);
|
|
79
|
+
return Array.from(e).sort(de);
|
|
80
|
+
})(), W;
|
|
81
|
+
d[29] !== V || d[30] !== H || d[31] !== A ? (W = {
|
|
82
|
+
pdf: A,
|
|
83
|
+
currentPage: V,
|
|
84
|
+
goToPage: H,
|
|
85
|
+
setZoom: v,
|
|
86
|
+
setRotation: xe,
|
|
87
|
+
setFitMode: Ee
|
|
88
|
+
}, d[29] = V, d[30] = H, d[31] = A, d[32] = W) : W = d[32], n(W);
|
|
89
|
+
let Ie = r({
|
|
90
|
+
pdf: A,
|
|
91
|
+
zoom: _,
|
|
96
92
|
rotation: y,
|
|
97
|
-
mountedPages:
|
|
98
|
-
canvasRefs:
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
pdf: k,
|
|
103
|
-
zoom: v,
|
|
93
|
+
mountedPages: Fe,
|
|
94
|
+
canvasRefs: D
|
|
95
|
+
}), Le = ee({
|
|
96
|
+
pdf: A,
|
|
97
|
+
zoom: _,
|
|
104
98
|
rotation: y,
|
|
105
|
-
mountedPages:
|
|
106
|
-
goToPage:
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
pdf: k,
|
|
99
|
+
mountedPages: Fe,
|
|
100
|
+
goToPage: H
|
|
101
|
+
}), G;
|
|
102
|
+
d[33] !== b || d[34] !== A || d[35] !== y || d[36] !== S || d[37] !== _ ? (G = {
|
|
103
|
+
pdf: A,
|
|
111
104
|
highlight: b,
|
|
112
105
|
searchMatches: S,
|
|
113
|
-
zoom:
|
|
106
|
+
zoom: _,
|
|
114
107
|
rotation: y
|
|
115
|
-
}, d[
|
|
116
|
-
let { overlayRect:
|
|
117
|
-
d[
|
|
118
|
-
pdf:
|
|
119
|
-
numPages:
|
|
120
|
-
zoom:
|
|
121
|
-
setZoom:
|
|
108
|
+
}, d[33] = b, d[34] = A, d[35] = y, d[36] = S, d[37] = _, d[38] = G) : G = d[38];
|
|
109
|
+
let { overlayRect: K, searchOverlays: Re } = re(G), ze = ae, Be = e, q;
|
|
110
|
+
d[39] !== V || d[40] !== f || d[41] !== C || d[42] !== H || d[43] !== b || d[44] !== j || d[45] !== ge || d[46] !== A || d[47] !== y || d[48] !== S || d[49] !== we || d[50] !== _ ? (q = {
|
|
111
|
+
pdf: A,
|
|
112
|
+
numPages: j,
|
|
113
|
+
zoom: _,
|
|
114
|
+
setZoom: v,
|
|
122
115
|
rotation: y,
|
|
123
116
|
setRotation: xe,
|
|
124
|
-
currentPage:
|
|
125
|
-
goToPage:
|
|
126
|
-
containerRef:
|
|
127
|
-
canvasRefs:
|
|
117
|
+
currentPage: V,
|
|
118
|
+
goToPage: H,
|
|
119
|
+
containerRef: w,
|
|
120
|
+
canvasRefs: D,
|
|
128
121
|
file: f,
|
|
129
122
|
highlight: b,
|
|
130
123
|
setHighlight: Se,
|
|
131
124
|
searchMatches: S,
|
|
132
125
|
setSearchMatches: Ce,
|
|
133
|
-
onChangeFile:
|
|
126
|
+
onChangeFile: ge,
|
|
134
127
|
sidebarCollapsed: we,
|
|
135
|
-
setSidebarCollapsed: Te
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
d[
|
|
128
|
+
setSidebarCollapsed: Te,
|
|
129
|
+
fitMode: C,
|
|
130
|
+
setFitMode: Ee
|
|
131
|
+
}, d[39] = V, d[40] = f, d[41] = C, d[42] = H, d[43] = b, d[44] = j, d[45] = ge, d[46] = A, d[47] = y, d[48] = S, d[49] = we, d[50] = _, d[51] = q) : q = d[51];
|
|
132
|
+
let Ve = `${a.appLayout}${ye ? ` ${ye}` : ""}`, J;
|
|
133
|
+
d[52] === he ? J = d[53] : (J = he && /* @__PURE__ */ l("div", {
|
|
139
134
|
className: a.toolbar,
|
|
140
|
-
children:
|
|
141
|
-
}), d[
|
|
135
|
+
children: he
|
|
136
|
+
}), d[52] = he, d[53] = J);
|
|
137
|
+
let He = a, Ue = a, We = Array.from({ length: j }, (e, t) => {
|
|
138
|
+
let n = Pe.has(t + 1), r = Ne[t], i = Fe.includes(t + 1);
|
|
139
|
+
return /* @__PURE__ */ u("div", {
|
|
140
|
+
className: a.pageWrapper,
|
|
141
|
+
ref: (e) => {
|
|
142
|
+
De.current[t] = e;
|
|
143
|
+
},
|
|
144
|
+
style: r ? {
|
|
145
|
+
width: r.width,
|
|
146
|
+
height: r.height
|
|
147
|
+
} : void 0,
|
|
148
|
+
children: [
|
|
149
|
+
r && !n && /* @__PURE__ */ l("div", {
|
|
150
|
+
className: a.pageSkeleton,
|
|
151
|
+
style: {
|
|
152
|
+
width: r.width,
|
|
153
|
+
height: r.height
|
|
154
|
+
}
|
|
155
|
+
}),
|
|
156
|
+
i && /* @__PURE__ */ u(ce, { children: [/* @__PURE__ */ l("canvas", {
|
|
157
|
+
className: a.pageCanvas,
|
|
158
|
+
ref: (e) => {
|
|
159
|
+
D.current[t] = e;
|
|
160
|
+
},
|
|
161
|
+
style: { display: n ? "block" : "none" }
|
|
162
|
+
}), /* @__PURE__ */ l("div", {
|
|
163
|
+
className: `textLayer ${a.textLayer}`,
|
|
164
|
+
ref: (e) => {
|
|
165
|
+
Ie.current[t] = e;
|
|
166
|
+
}
|
|
167
|
+
})] }),
|
|
168
|
+
Le.filter((e) => e.page === t + 1).map(fe),
|
|
169
|
+
Re.filter((e) => e.page === t + 1).map(pe),
|
|
170
|
+
b && K?.page === t + 1 && /* @__PURE__ */ l("div", {
|
|
171
|
+
className: a.highlightOverlay,
|
|
172
|
+
style: {
|
|
173
|
+
left: K.x,
|
|
174
|
+
top: K.y,
|
|
175
|
+
width: K.width,
|
|
176
|
+
height: K.height
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
}, `${t}-${y}`);
|
|
181
|
+
}), Y;
|
|
182
|
+
d[54] !== Ue.scrollContainer || d[55] !== We ? (Y = /* @__PURE__ */ l("div", {
|
|
183
|
+
className: Ue.scrollContainer,
|
|
184
|
+
ref: w,
|
|
185
|
+
children: We
|
|
186
|
+
}), d[54] = Ue.scrollContainer, d[55] = We, d[56] = Y) : Y = d[56];
|
|
142
187
|
let X;
|
|
143
|
-
d[
|
|
144
|
-
className:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
let n = B.has(t + 1), r = je[t], i = H.includes(t + 1);
|
|
148
|
-
return /* @__PURE__ */ u("div", {
|
|
149
|
-
className: a.pageWrapper,
|
|
150
|
-
ref: (e) => {
|
|
151
|
-
Ee.current[t] = e;
|
|
152
|
-
},
|
|
153
|
-
style: r ? {
|
|
154
|
-
width: r.width,
|
|
155
|
-
height: r.height
|
|
156
|
-
} : void 0,
|
|
157
|
-
children: [
|
|
158
|
-
r && !n && /* @__PURE__ */ l("div", {
|
|
159
|
-
className: a.pageSkeleton,
|
|
160
|
-
style: {
|
|
161
|
-
width: r.width,
|
|
162
|
-
height: r.height
|
|
163
|
-
}
|
|
164
|
-
}),
|
|
165
|
-
i && /* @__PURE__ */ u(ce, { children: [/* @__PURE__ */ l("canvas", {
|
|
166
|
-
className: a.pageCanvas,
|
|
167
|
-
ref: (e) => {
|
|
168
|
-
E.current[t] = e;
|
|
169
|
-
},
|
|
170
|
-
style: { display: n ? "block" : "none" }
|
|
171
|
-
}), /* @__PURE__ */ l("div", {
|
|
172
|
-
className: `textLayer ${a.textLayer}`,
|
|
173
|
-
ref: (e) => {
|
|
174
|
-
Me.current[t] = e;
|
|
175
|
-
}
|
|
176
|
-
})] }),
|
|
177
|
-
Ne.filter((e) => e.page === t + 1).map(fe),
|
|
178
|
-
Pe.filter((e) => e.page === t + 1).map(pe),
|
|
179
|
-
b && q?.page === t + 1 && /* @__PURE__ */ l("div", {
|
|
180
|
-
className: a.highlightOverlay,
|
|
181
|
-
style: {
|
|
182
|
-
left: q.x,
|
|
183
|
-
top: q.y,
|
|
184
|
-
width: q.width,
|
|
185
|
-
height: q.height
|
|
186
|
-
}
|
|
187
|
-
})
|
|
188
|
-
]
|
|
189
|
-
}, `${t}-${y}`);
|
|
190
|
-
})
|
|
191
|
-
}), d[70] = b, d[71] = Ne, d[72] = H, d[73] = A, d[74] = q, d[75] = je, d[76] = B, d[77] = y, d[78] = Pe, d[79] = Me, d[80] = X) : X = d[80];
|
|
188
|
+
d[57] !== me || d[58] !== He.body || d[59] !== Y ? (X = /* @__PURE__ */ u("div", {
|
|
189
|
+
className: He.body,
|
|
190
|
+
children: [me, Y]
|
|
191
|
+
}), d[57] = me, d[58] = He.body, d[59] = Y, d[60] = X) : X = d[60];
|
|
192
192
|
let Z;
|
|
193
|
-
d[
|
|
194
|
-
className:
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
d[61] !== be || d[62] !== Ve || d[63] !== J || d[64] !== X ? (Z = /* @__PURE__ */ u("div", {
|
|
194
|
+
className: Ve,
|
|
195
|
+
style: be,
|
|
196
|
+
children: [J, X]
|
|
197
|
+
}), d[61] = be, d[62] = Ve, d[63] = J, d[64] = X, d[65] = Z) : Z = d[65];
|
|
197
198
|
let Q;
|
|
198
|
-
d[
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}), d[84] = ye, d[85] = Fe, d[86] = Y, d[87] = Z, d[88] = Q) : Q = d[88];
|
|
199
|
+
d[66] !== Be.Provider || d[67] !== q || d[68] !== Z ? (Q = /* @__PURE__ */ l(Be.Provider, {
|
|
200
|
+
value: q,
|
|
201
|
+
children: Z
|
|
202
|
+
}), d[66] = Be.Provider, d[67] = q, d[68] = Z, d[69] = Q) : Q = d[69];
|
|
203
203
|
let $;
|
|
204
|
-
d[
|
|
205
|
-
|
|
204
|
+
return d[70] !== ze || d[71] !== ve || d[72] !== Q || d[73] !== _e ? ($ = /* @__PURE__ */ l(ze, {
|
|
205
|
+
themeOverrides: _e,
|
|
206
|
+
defaultTheme: ve,
|
|
206
207
|
children: Q
|
|
207
|
-
}), d[
|
|
208
|
-
let Ie;
|
|
209
|
-
return d[92] !== _e || d[93] !== $ || d[94] !== ge ? (Ie = /* @__PURE__ */ l(ae, {
|
|
210
|
-
themeOverrides: ge,
|
|
211
|
-
defaultTheme: _e,
|
|
212
|
-
children: $
|
|
213
|
-
}), d[92] = _e, d[93] = $, d[94] = ge, d[95] = Ie) : Ie = d[95], Ie;
|
|
208
|
+
}), d[70] = ze, d[71] = ve, d[72] = Q, d[73] = _e, d[74] = $) : $ = d[74], $;
|
|
214
209
|
};
|
|
215
210
|
function ue(e, t) {
|
|
216
211
|
return e - t;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
appLayout: "
|
|
3
|
-
body: "
|
|
4
|
-
toolbar: "
|
|
5
|
-
scrollContainer: "
|
|
6
|
-
pageWrapper: "
|
|
7
|
-
pageCanvas: "
|
|
8
|
-
textLayer: "
|
|
9
|
-
markedContent: "
|
|
10
|
-
endOfContent: "
|
|
11
|
-
selecting: "
|
|
12
|
-
pageSkeleton: "
|
|
13
|
-
|
|
14
|
-
highlightOverlay: "
|
|
15
|
-
linkOverlay: "
|
|
16
|
-
searchMatchOverlay: "
|
|
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"
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
export { e as default };
|
|
@@ -1,16 +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: "
|
|
12
|
-
iconWrapper: "
|
|
13
|
-
badge: "
|
|
2
|
+
list: "_list_185ig_1",
|
|
3
|
+
emptyState: "_emptyState_185ig_11",
|
|
4
|
+
pageHeader: "_pageHeader_185ig_23",
|
|
5
|
+
card: "_card_185ig_45",
|
|
6
|
+
cardClickable: "_cardClickable_185ig_65",
|
|
7
|
+
cardHeader: "_cardHeader_185ig_81",
|
|
8
|
+
cardLabel: "_cardLabel_185ig_95",
|
|
9
|
+
cardPage: "_cardPage_185ig_107",
|
|
10
|
+
cardAuthor: "_cardAuthor_185ig_117",
|
|
11
|
+
cardContent: "_cardContent_185ig_129",
|
|
12
|
+
iconWrapper: "_iconWrapper_185ig_141",
|
|
13
|
+
badge: "_badge_185ig_155"
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
export { e as default };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
|
+
import { useAttachments as t } from "../../hooks/useAttachments.js";
|
|
3
|
+
import n from "./PDFAttachments.module.js";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/features/PDFAttachments.tsx
|
|
7
|
+
function o() {
|
|
8
|
+
let e = r(1), t;
|
|
9
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
10
|
+
width: "13",
|
|
11
|
+
height: "13",
|
|
12
|
+
viewBox: "0 0 13 13",
|
|
13
|
+
fill: "none",
|
|
14
|
+
"aria-hidden": !0,
|
|
15
|
+
children: [/* @__PURE__ */ i("path", {
|
|
16
|
+
d: "M6.5 1.5v7M3.5 6l3 3 3-3",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeWidth: "1.5",
|
|
19
|
+
strokeLinecap: "round",
|
|
20
|
+
strokeLinejoin: "round"
|
|
21
|
+
}), /* @__PURE__ */ i("path", {
|
|
22
|
+
d: "M1.5 10.5h10",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "1.5",
|
|
25
|
+
strokeLinecap: "round"
|
|
26
|
+
})]
|
|
27
|
+
}), e[0] = t) : t = e[0], t;
|
|
28
|
+
}
|
|
29
|
+
function s() {
|
|
30
|
+
let e = r(1), t;
|
|
31
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
32
|
+
width: "14",
|
|
33
|
+
height: "14",
|
|
34
|
+
viewBox: "0 0 14 14",
|
|
35
|
+
fill: "none",
|
|
36
|
+
"aria-hidden": !0,
|
|
37
|
+
children: [/* @__PURE__ */ i("path", {
|
|
38
|
+
d: "M3 1.5h5.5L11 4v8.5H3V1.5z",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "1.2",
|
|
41
|
+
strokeLinejoin: "round"
|
|
42
|
+
}), /* @__PURE__ */ i("path", {
|
|
43
|
+
d: "M8.5 1.5V4H11",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "1.2",
|
|
46
|
+
strokeLinejoin: "round"
|
|
47
|
+
})]
|
|
48
|
+
}), e[0] = t) : t = e[0], t;
|
|
49
|
+
}
|
|
50
|
+
function c(e) {
|
|
51
|
+
let t = new Blob([new Uint8Array(e.content)]), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
52
|
+
r.href = n, r.download = e.filename, r.click(), URL.revokeObjectURL(n);
|
|
53
|
+
}
|
|
54
|
+
function l(o) {
|
|
55
|
+
let s = r(8), { icon: c } = o, { pdf: l } = e(), u;
|
|
56
|
+
s[0] === l ? u = s[1] : (u = { pdf: l }, s[0] = l, s[1] = u);
|
|
57
|
+
let { attachments: d, loading: f } = t(u), p = d.length, m;
|
|
58
|
+
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ i("span", {
|
|
59
|
+
className: n.badge,
|
|
60
|
+
children: p > 99 ? "99+" : p
|
|
61
|
+
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
62
|
+
let h;
|
|
63
|
+
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ a("span", {
|
|
64
|
+
className: n.iconWrapper,
|
|
65
|
+
children: [c, m]
|
|
66
|
+
}), s[5] = c, s[6] = m, s[7] = h) : h = s[7], h;
|
|
67
|
+
}
|
|
68
|
+
function u() {
|
|
69
|
+
let o = r(14), { pdf: s } = e(), c;
|
|
70
|
+
o[0] === s ? c = o[1] : (c = { pdf: s }, o[0] = s, o[1] = c);
|
|
71
|
+
let { attachments: l, loading: u } = t(c), f;
|
|
72
|
+
o[2] === u ? f = o[3] : (f = u && /* @__PURE__ */ i("div", {
|
|
73
|
+
className: n.emptyState,
|
|
74
|
+
children: "Caricamento..."
|
|
75
|
+
}), o[2] = u, o[3] = f);
|
|
76
|
+
let p;
|
|
77
|
+
o[4] !== l || o[5] !== u ? (p = !u && l.length === 0 && /* @__PURE__ */ i("div", {
|
|
78
|
+
className: n.emptyState,
|
|
79
|
+
children: "Nessun allegato rilevato."
|
|
80
|
+
}), o[4] = l, o[5] = u, o[6] = p) : p = o[6];
|
|
81
|
+
let m;
|
|
82
|
+
o[7] !== l || o[8] !== u ? (m = !u && l.map(d), o[7] = l, o[8] = u, o[9] = m) : m = o[9];
|
|
83
|
+
let h;
|
|
84
|
+
return o[10] !== f || o[11] !== p || o[12] !== m ? (h = /* @__PURE__ */ a("div", {
|
|
85
|
+
className: n.list,
|
|
86
|
+
children: [
|
|
87
|
+
f,
|
|
88
|
+
p,
|
|
89
|
+
m
|
|
90
|
+
]
|
|
91
|
+
}), o[10] = f, o[11] = p, o[12] = m, o[13] = h) : h = o[13], h;
|
|
92
|
+
}
|
|
93
|
+
function d(e, t) {
|
|
94
|
+
return /* @__PURE__ */ a("div", {
|
|
95
|
+
className: n.card,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ i("span", {
|
|
98
|
+
className: n.fileIcon,
|
|
99
|
+
children: /* @__PURE__ */ i(s, {})
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ i("span", {
|
|
102
|
+
className: n.filename,
|
|
103
|
+
title: e.filename,
|
|
104
|
+
children: e.filename
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ i("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
className: n.downloadBtn,
|
|
109
|
+
title: `Scarica ${e.filename}`,
|
|
110
|
+
onClick: () => c(e),
|
|
111
|
+
children: /* @__PURE__ */ i(o, {})
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}, t);
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { u as PDFAttachments, l as PDFAttachmentsIcon };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
list: "_list_8oiyp_1",
|
|
3
|
+
emptyState: "_emptyState_8oiyp_15",
|
|
4
|
+
card: "_card_8oiyp_29",
|
|
5
|
+
fileIcon: "_fileIcon_8oiyp_65",
|
|
6
|
+
filename: "_filename_8oiyp_79",
|
|
7
|
+
downloadBtn: "_downloadBtn_8oiyp_101",
|
|
8
|
+
iconWrapper: "_iconWrapper_8oiyp_153",
|
|
9
|
+
badge: "_badge_8oiyp_167"
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
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 };
|