pdf-tsx 0.4.0 → 0.6.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 +33 -6
- package/dist/cjs/components/PDFSidebar.cjs +1 -1
- package/dist/cjs/components/PDFViewer.cjs +1 -1
- package/dist/cjs/components/PDFViewer.module.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
- package/dist/cjs/components/features/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/PDFOutline.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/PDFSidebarToggle.cjs +1 -1
- package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
- package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
- package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
- package/dist/cjs/components/features/PDFThumbnails.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/ui/icons.cjs +1 -1
- package/dist/cjs/context/ThemeContext.cjs +1 -1
- package/dist/cjs/context/themeContextValue.cjs +1 -0
- package/dist/cjs/hooks/useAnnotationLayer.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/useOutline.cjs +1 -1
- package/dist/cjs/hooks/useOverlayRects.cjs +1 -0
- package/dist/cjs/hooks/usePDFLoader.cjs +1 -0
- package/dist/cjs/hooks/usePDFRenderer.cjs +1 -0
- package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
- package/dist/cjs/hooks/useTextLayer.cjs +1 -1
- package/dist/cjs/hooks/useTextSearch.cjs +1 -1
- package/dist/cjs/hooks/useTheme.cjs +1 -0
- package/dist/cjs/hooks/useThumbnails.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/PDFSidebar.d.ts +1 -2
- package/dist/components/features/PDFAttachments.d.ts +5 -0
- package/dist/components/features/PDFSidebarToggle.d.ts +1 -1
- package/dist/components/ui/icons.d.ts +0 -14
- package/dist/context/ThemeContext.d.ts +0 -6
- package/dist/context/themeContextValue.d.ts +7 -0
- package/dist/es/components/PDFSidebar.js +26 -33
- package/dist/es/components/PDFViewer.js +240 -269
- package/dist/es/components/PDFViewer.module.js +15 -15
- package/dist/es/components/features/PDFAnnotations.js +57 -64
- 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 +3 -3
- package/dist/es/components/features/PDFDownloadButton.js +2 -2
- package/dist/es/components/features/PDFNavigation.js +3 -3
- package/dist/es/components/features/PDFOutline.js +7 -7
- package/dist/es/components/features/PDFPageFit.js +1 -1
- package/dist/es/components/features/PDFPrintButton.js +5 -4
- package/dist/es/components/features/PDFRotationControl.js +1 -1
- package/dist/es/components/features/PDFSearch.js +4 -4
- package/dist/es/components/features/PDFSidebarToggle.js +10 -9
- package/dist/es/components/features/PDFSignatures.js +158 -116
- package/dist/es/components/features/PDFSignatures.module.js +16 -16
- package/dist/es/components/features/PDFThemeToggle.js +5 -5
- package/dist/es/components/features/PDFThumbnails.js +54 -30
- package/dist/es/components/features/PDFThumbnails.module.js +9 -7
- package/dist/es/components/features/PDFZoomControls.js +1 -1
- package/dist/es/components/ui/icons.js +1 -1
- package/dist/es/context/ThemeContext.js +20 -25
- package/dist/es/context/themeContextValue.js +5 -0
- package/dist/es/hooks/useAnnotationLayer.js +11 -11
- package/dist/es/hooks/useAnnotations.js +0 -1
- package/dist/es/hooks/useAttachments.js +31 -0
- package/dist/es/hooks/useKeyboardShortcuts.js +12 -15
- package/dist/es/hooks/useOutline.js +31 -12
- package/dist/es/hooks/useOverlayRects.js +72 -0
- package/dist/es/hooks/usePDFLoader.js +26 -0
- package/dist/es/hooks/usePDFRenderer.js +83 -0
- package/dist/es/hooks/useScrollTracking.js +21 -20
- package/dist/es/hooks/useTextLayer.js +13 -12
- package/dist/es/hooks/useTextSearch.js +30 -18
- package/dist/es/hooks/useTheme.js +10 -0
- package/dist/es/hooks/useThumbnails.js +86 -24
- package/dist/es/index.js +16 -15
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/es/theme.js +6 -3
- package/dist/hooks/useAnnotationLayer.d.ts +2 -2
- package/dist/hooks/useAnnotations.d.ts +0 -5
- package/dist/hooks/useAttachments.d.ts +11 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +1 -2
- package/dist/hooks/useOverlayRects.d.ts +21 -0
- package/dist/hooks/usePDFLoader.d.ts +4 -0
- package/dist/hooks/usePDFRenderer.d.ts +16 -0
- package/dist/hooks/useScrollTracking.d.ts +2 -1
- package/dist/hooks/useTextLayer.d.ts +2 -2
- package/dist/hooks/useTheme.d.ts +2 -0
- package/dist/hooks/useThumbnails.d.ts +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/theme.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,140 +1,182 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { computeFit as t } from "../../utils/pdfFit.js";
|
|
3
|
+
import { useSignatures as n } from "../../hooks/useSignatures.js";
|
|
4
|
+
import r from "./PDFSignatures.module.js";
|
|
5
|
+
import { c as i } from "react/compiler-runtime";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/features/PDFSignatures.tsx
|
|
7
|
-
function
|
|
8
|
+
function s(e) {
|
|
8
9
|
if (!e) return;
|
|
9
10
|
let t = e.match(/D:(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?/);
|
|
10
11
|
if (!t) return e;
|
|
11
12
|
let [, n, r, i, a = "00", o = "00"] = t;
|
|
12
13
|
return `${i}/${r}/${n} ${a}:${o}`;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
function c() {
|
|
16
|
+
let e = i(1), t;
|
|
17
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
18
|
+
width: "10",
|
|
19
|
+
height: "10",
|
|
20
|
+
viewBox: "0 0 10 10",
|
|
21
|
+
fill: "none",
|
|
22
|
+
"aria-hidden": !0,
|
|
23
|
+
children: /* @__PURE__ */ a("path", {
|
|
24
|
+
d: "M1.5 5L3.8 7.5L8.5 2.5",
|
|
25
|
+
stroke: "currentColor",
|
|
26
|
+
strokeWidth: "1.6",
|
|
27
|
+
strokeLinecap: "round",
|
|
28
|
+
strokeLinejoin: "round"
|
|
29
|
+
})
|
|
30
|
+
}), e[0] = t) : t = e[0], t;
|
|
31
|
+
}
|
|
32
|
+
function l() {
|
|
33
|
+
let e = i(1), t;
|
|
34
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
35
|
+
width: "10",
|
|
36
|
+
height: "10",
|
|
37
|
+
viewBox: "0 0 10 10",
|
|
38
|
+
fill: "none",
|
|
39
|
+
"aria-hidden": !0,
|
|
40
|
+
children: /* @__PURE__ */ a("circle", {
|
|
41
|
+
cx: "5",
|
|
42
|
+
cy: "5",
|
|
43
|
+
r: "3.7",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "1.3",
|
|
46
|
+
strokeDasharray: "2.2 1.4"
|
|
47
|
+
})
|
|
48
|
+
}), e[0] = t) : t = e[0], t;
|
|
49
|
+
}
|
|
50
|
+
function u(e) {
|
|
51
|
+
let t = i(26), { sig: n, onClick: u } = e, d = !!n.rect, f = `${r.card} ${n.signed ? r.cardSigned : ""} ${d ? r.cardClickable : ""}`, p;
|
|
52
|
+
t[0] === n.fieldName ? p = t[1] : (p = /* @__PURE__ */ a("span", {
|
|
53
|
+
className: r.fieldName,
|
|
54
|
+
children: n.fieldName
|
|
55
|
+
}), t[0] = n.fieldName, t[1] = p);
|
|
56
|
+
let m = `${r.statusChip} ${n.signed ? r.statusChipSigned : ""}`, h;
|
|
57
|
+
t[2] === n.signed ? h = t[3] : (h = n.signed ? /* @__PURE__ */ a(c, {}) : /* @__PURE__ */ a(l, {}), t[2] = n.signed, t[3] = h);
|
|
58
|
+
let g = n.signed ? "Firmato" : "Non firmato", _;
|
|
59
|
+
t[4] !== m || t[5] !== h || t[6] !== g ? (_ = /* @__PURE__ */ o("span", {
|
|
60
|
+
className: m,
|
|
61
|
+
children: [h, g]
|
|
62
|
+
}), t[4] = m, t[5] = h, t[6] = g, t[7] = _) : _ = t[7];
|
|
35
63
|
let v;
|
|
36
|
-
t[
|
|
37
|
-
className:
|
|
38
|
-
children: [
|
|
39
|
-
}), t[
|
|
64
|
+
t[8] !== p || t[9] !== _ ? (v = /* @__PURE__ */ o("div", {
|
|
65
|
+
className: r.cardHeader,
|
|
66
|
+
children: [p, _]
|
|
67
|
+
}), t[8] = p, t[9] = _, t[10] = v) : v = t[10];
|
|
40
68
|
let y;
|
|
41
|
-
t[
|
|
42
|
-
className:
|
|
43
|
-
children: [/* @__PURE__ */ i("span", {
|
|
44
|
-
className: n.fieldLabel,
|
|
45
|
-
children: "Firmatario: "
|
|
46
|
-
}), s.signerName]
|
|
47
|
-
}), t[12] = s.signerName, t[13] = y);
|
|
48
|
-
let b;
|
|
49
|
-
t[14] === s.signDate ? b = t[15] : (b = s.signDate && /* @__PURE__ */ a("div", {
|
|
50
|
-
className: n.fieldRow,
|
|
51
|
-
children: [/* @__PURE__ */ i("span", {
|
|
52
|
-
className: n.fieldLabel,
|
|
53
|
-
children: "Data: "
|
|
54
|
-
}), o(s.signDate)]
|
|
55
|
-
}), t[14] = s.signDate, t[15] = b);
|
|
56
|
-
let x;
|
|
57
|
-
t[16] === s.reason ? x = t[17] : (x = s.reason && /* @__PURE__ */ a("div", {
|
|
58
|
-
className: n.fieldRow,
|
|
59
|
-
children: [/* @__PURE__ */ i("span", {
|
|
60
|
-
className: n.fieldLabel,
|
|
61
|
-
children: "Motivo: "
|
|
62
|
-
}), s.reason]
|
|
63
|
-
}), t[16] = s.reason, t[17] = x);
|
|
64
|
-
let S;
|
|
65
|
-
t[18] === s.location ? S = t[19] : (S = s.location && /* @__PURE__ */ a("div", {
|
|
66
|
-
className: n.fieldRow,
|
|
67
|
-
children: [/* @__PURE__ */ i("span", {
|
|
68
|
-
className: n.fieldLabel,
|
|
69
|
-
children: "Luogo: "
|
|
70
|
-
}), s.location]
|
|
71
|
-
}), t[18] = s.location, t[19] = S);
|
|
72
|
-
let C;
|
|
73
|
-
t[20] !== v || t[21] !== y || t[22] !== b || t[23] !== x || t[24] !== S ? (C = /* @__PURE__ */ a("div", {
|
|
74
|
-
className: n.fieldList,
|
|
69
|
+
t[11] !== n.location || t[12] !== n.reason || t[13] !== n.signDate || t[14] !== n.signerName ? (y = (n.signerName || n.signDate || n.reason || n.location) && /* @__PURE__ */ o("div", {
|
|
70
|
+
className: r.fieldList,
|
|
75
71
|
children: [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
n.signerName && /* @__PURE__ */ o("div", {
|
|
73
|
+
className: r.fieldRow,
|
|
74
|
+
children: [/* @__PURE__ */ a("span", {
|
|
75
|
+
className: r.fieldLabel,
|
|
76
|
+
children: "Firmatario"
|
|
77
|
+
}), /* @__PURE__ */ a("span", {
|
|
78
|
+
className: r.fieldValue,
|
|
79
|
+
children: n.signerName
|
|
80
|
+
})]
|
|
81
|
+
}),
|
|
82
|
+
n.signDate && /* @__PURE__ */ o("div", {
|
|
83
|
+
className: r.fieldRow,
|
|
84
|
+
children: [/* @__PURE__ */ a("span", {
|
|
85
|
+
className: r.fieldLabel,
|
|
86
|
+
children: "Data"
|
|
87
|
+
}), /* @__PURE__ */ a("span", {
|
|
88
|
+
className: r.fieldValue,
|
|
89
|
+
children: s(n.signDate)
|
|
90
|
+
})]
|
|
91
|
+
}),
|
|
92
|
+
n.reason && /* @__PURE__ */ o("div", {
|
|
93
|
+
className: r.fieldRow,
|
|
94
|
+
children: [/* @__PURE__ */ a("span", {
|
|
95
|
+
className: r.fieldLabel,
|
|
96
|
+
children: "Motivo"
|
|
97
|
+
}), /* @__PURE__ */ a("span", {
|
|
98
|
+
className: r.fieldValue,
|
|
99
|
+
children: n.reason
|
|
100
|
+
})]
|
|
101
|
+
}),
|
|
102
|
+
n.location && /* @__PURE__ */ o("div", {
|
|
103
|
+
className: r.fieldRow,
|
|
104
|
+
children: [/* @__PURE__ */ a("span", {
|
|
105
|
+
className: r.fieldLabel,
|
|
106
|
+
children: "Luogo"
|
|
107
|
+
}), /* @__PURE__ */ a("span", {
|
|
108
|
+
className: r.fieldValue,
|
|
109
|
+
children: n.location
|
|
110
|
+
})]
|
|
111
|
+
})
|
|
81
112
|
]
|
|
82
|
-
}), t[
|
|
83
|
-
let
|
|
84
|
-
|
|
85
|
-
className:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
113
|
+
}), t[11] = n.location, t[12] = n.reason, t[13] = n.signDate, t[14] = n.signerName, t[15] = y) : y = t[15];
|
|
114
|
+
let b;
|
|
115
|
+
t[16] !== v || t[17] !== y ? (b = /* @__PURE__ */ o("div", {
|
|
116
|
+
className: r.cardBody,
|
|
117
|
+
children: [v, y]
|
|
118
|
+
}), t[16] = v, t[17] = y, t[18] = b) : b = t[18];
|
|
119
|
+
let x = b;
|
|
120
|
+
if (d) {
|
|
121
|
+
let e;
|
|
122
|
+
return t[19] !== x || t[20] !== f || t[21] !== u ? (e = /* @__PURE__ */ a("button", {
|
|
123
|
+
type: "button",
|
|
124
|
+
className: f,
|
|
125
|
+
onClick: u,
|
|
126
|
+
children: x
|
|
127
|
+
}), t[19] = x, t[20] = f, t[21] = u, t[22] = e) : e = t[22], e;
|
|
128
|
+
}
|
|
129
|
+
let S;
|
|
130
|
+
return t[23] !== x || t[24] !== f ? (S = /* @__PURE__ */ a("div", {
|
|
131
|
+
className: f,
|
|
132
|
+
children: x
|
|
133
|
+
}), t[23] = x, t[24] = f, t[25] = S) : S = t[25], S;
|
|
89
134
|
}
|
|
90
|
-
function
|
|
91
|
-
let s =
|
|
135
|
+
function d(t) {
|
|
136
|
+
let s = i(8), { icon: c } = t, { pdf: l } = e(), u;
|
|
92
137
|
s[0] === l ? u = s[1] : (u = { pdf: l }, s[0] = l, s[1] = u);
|
|
93
|
-
let { signatures: d, loading: f } =
|
|
94
|
-
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */
|
|
95
|
-
className:
|
|
138
|
+
let { signatures: d, loading: f } = n(u), p = d.length, m;
|
|
139
|
+
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ a("span", {
|
|
140
|
+
className: r.badge,
|
|
96
141
|
children: p > 99 ? "99+" : p
|
|
97
142
|
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
98
143
|
let h;
|
|
99
|
-
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */
|
|
100
|
-
className:
|
|
144
|
+
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ o("span", {
|
|
145
|
+
className: r.iconWrapper,
|
|
101
146
|
children: [c, m]
|
|
102
147
|
}), s[5] = c, s[6] = m, s[7] = h) : h = s[7], h;
|
|
103
148
|
}
|
|
104
|
-
function
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
let { signatures:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
page
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
let y;
|
|
130
|
-
return o[14] !== g || o[15] !== _ || o[16] !== v ? (y = /* @__PURE__ */ a("div", {
|
|
131
|
-
className: n.list,
|
|
149
|
+
function f() {
|
|
150
|
+
let s = i(24), { pdf: c, goToPage: l, setHighlight: d, setZoom: f, rotation: p, containerRef: m } = e(), h;
|
|
151
|
+
s[0] === c ? h = s[1] : (h = { pdf: c }, s[0] = c, s[1] = h);
|
|
152
|
+
let { signatures: g, loading: _ } = n(h), v, y, b, x;
|
|
153
|
+
if (s[2] !== m || s[3] !== l || s[4] !== _ || s[5] !== c || s[6] !== p || s[7] !== d || s[8] !== f || s[9] !== g) {
|
|
154
|
+
let e = async (e) => {
|
|
155
|
+
c && m.current && f(await t("page", c, m.current, p)), l(e.page), e.rect && d({
|
|
156
|
+
page: e.page,
|
|
157
|
+
pdfRect: e.rect
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
v = r.list, s[14] === _ ? y = s[15] : (y = _ && /* @__PURE__ */ a("div", {
|
|
161
|
+
className: r.emptyState,
|
|
162
|
+
children: "Caricamento..."
|
|
163
|
+
}), s[14] = _, s[15] = y), s[16] !== _ || s[17] !== g ? (b = !_ && g.length === 0 && /* @__PURE__ */ a("div", {
|
|
164
|
+
className: r.emptyState,
|
|
165
|
+
children: "Nessuna firma rilevata."
|
|
166
|
+
}), s[16] = _, s[17] = g, s[18] = b) : b = s[18], x = !_ && g.map((t, n) => /* @__PURE__ */ a(u, {
|
|
167
|
+
sig: t,
|
|
168
|
+
onClick: () => e(t)
|
|
169
|
+
}, n)), s[2] = m, s[3] = l, s[4] = _, s[5] = c, s[6] = p, s[7] = d, s[8] = f, s[9] = g, s[10] = v, s[11] = y, s[12] = b, s[13] = x;
|
|
170
|
+
} else v = s[10], y = s[11], b = s[12], x = s[13];
|
|
171
|
+
let S;
|
|
172
|
+
return s[19] !== v || s[20] !== y || s[21] !== b || s[22] !== x ? (S = /* @__PURE__ */ o("div", {
|
|
173
|
+
className: v,
|
|
132
174
|
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
175
|
+
y,
|
|
176
|
+
b,
|
|
177
|
+
x
|
|
136
178
|
]
|
|
137
|
-
}),
|
|
179
|
+
}), s[19] = v, s[20] = y, s[21] = b, s[22] = x, s[23] = S) : S = s[23], S;
|
|
138
180
|
}
|
|
139
181
|
//#endregion
|
|
140
|
-
export {
|
|
182
|
+
export { f as PDFSignatures, d as PDFSignaturesIcon };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
list: "
|
|
3
|
-
emptyState: "
|
|
4
|
-
card: "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fieldList: "
|
|
13
|
-
fieldRow: "
|
|
14
|
-
fieldLabel: "
|
|
15
|
-
|
|
16
|
-
iconWrapper: "
|
|
17
|
-
badge: "
|
|
2
|
+
list: "_list_irrdi_1",
|
|
3
|
+
emptyState: "_emptyState_irrdi_15",
|
|
4
|
+
card: "_card_irrdi_29",
|
|
5
|
+
cardSigned: "_cardSigned_irrdi_63",
|
|
6
|
+
cardClickable: "_cardClickable_irrdi_73",
|
|
7
|
+
cardBody: "_cardBody_irrdi_99",
|
|
8
|
+
cardHeader: "_cardHeader_irrdi_107",
|
|
9
|
+
fieldName: "_fieldName_irrdi_123",
|
|
10
|
+
statusChip: "_statusChip_irrdi_145",
|
|
11
|
+
statusChipSigned: "_statusChipSigned_irrdi_177",
|
|
12
|
+
fieldList: "_fieldList_irrdi_189",
|
|
13
|
+
fieldRow: "_fieldRow_irrdi_201",
|
|
14
|
+
fieldLabel: "_fieldLabel_irrdi_217",
|
|
15
|
+
fieldValue: "_fieldValue_irrdi_227",
|
|
16
|
+
iconWrapper: "_iconWrapper_irrdi_237",
|
|
17
|
+
badge: "_badge_irrdi_251"
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
20
|
export { e as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "react";
|
|
1
|
+
import { ToolbarButton as e } from "../ui/ToolbarButton.js";
|
|
2
|
+
import { useTheme as t } from "../../hooks/useTheme.js";
|
|
4
3
|
import { c as n } from "react/compiler-runtime";
|
|
4
|
+
import "react";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/features/PDFThemeToggle.tsx
|
|
7
7
|
function i(i) {
|
|
8
|
-
let a = n(4), { lightIcon: o, darkIcon: s } = i, { isDark: c, toggleTheme: l } =
|
|
9
|
-
return a[0] !== u || a[1] !== d || a[2] !== l ? (f = /* @__PURE__ */ r(
|
|
8
|
+
let a = n(4), { lightIcon: o, darkIcon: s } = i, { isDark: c, toggleTheme: l } = t(), u = c ? "Switch to light mode" : "Switch to dark mode", d = c ? o : s, f;
|
|
9
|
+
return a[0] !== u || a[1] !== d || a[2] !== l ? (f = /* @__PURE__ */ r(e, {
|
|
10
10
|
onClick: l,
|
|
11
11
|
title: u,
|
|
12
12
|
children: d
|
|
@@ -2,38 +2,62 @@ import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
|
2
2
|
import { useThumbnails as t } from "../../hooks/useThumbnails.js";
|
|
3
3
|
import n from "./PDFThumbnails.module.js";
|
|
4
4
|
import { c as r } from "react/compiler-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/features/PDFThumbnails.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
var l = 3;
|
|
9
|
+
function u(e, t, n) {
|
|
10
|
+
let r = new Set(t);
|
|
11
|
+
for (let t of e) {
|
|
12
|
+
if (!t.isIntersecting) continue;
|
|
13
|
+
let e = Number(t.target.dataset.page);
|
|
14
|
+
for (let t = Math.max(1, e - l); t <= Math.min(n, e + l); t++) r.add(t);
|
|
15
|
+
}
|
|
16
|
+
let i = Array.from(r).sort((e, t) => e - t);
|
|
17
|
+
return i.join(",") === t.join(",") ? t : i;
|
|
18
|
+
}
|
|
19
|
+
function d() {
|
|
20
|
+
let l = r(14), { pdf: d, rotation: f, currentPage: p, goToPage: m, numPages: h } = e(), g;
|
|
21
|
+
l[0] === Symbol.for("react.memo_cache_sentinel") ? (g = [], l[0] = g) : g = l[0];
|
|
22
|
+
let _ = a(g), v;
|
|
23
|
+
l[1] === Symbol.for("react.memo_cache_sentinel") ? (v = [], l[1] = v) : v = l[1];
|
|
24
|
+
let [y, b] = o(v), x;
|
|
25
|
+
l[2] !== d || l[3] !== f || l[4] !== y ? (x = {
|
|
26
|
+
pdf: d,
|
|
27
|
+
rotation: f,
|
|
28
|
+
visiblePages: y
|
|
29
|
+
}, l[2] = d, l[3] = f, l[4] = y, l[5] = x) : x = l[5];
|
|
30
|
+
let { thumbnails: S } = t(x), C, w;
|
|
31
|
+
l[6] === h ? (C = l[7], w = l[8]) : (C = () => {
|
|
32
|
+
if (h === 0) return;
|
|
33
|
+
let e = new IntersectionObserver((e) => b((t) => u(e, t, h)), { threshold: 0 });
|
|
34
|
+
return _.current.forEach((t) => {
|
|
35
|
+
t && e.observe(t);
|
|
36
|
+
}), () => e.disconnect();
|
|
37
|
+
}, w = [h], l[6] = h, l[7] = C, l[8] = w), i(C, w);
|
|
38
|
+
let T;
|
|
39
|
+
return l[9] !== p || l[10] !== m || l[11] !== h || l[12] !== S ? (T = /* @__PURE__ */ s("div", {
|
|
40
|
+
className: n.thumbnailList,
|
|
41
|
+
children: Array.from({ length: h }, (e, t) => {
|
|
42
|
+
let r = t + 1, i = S[t], a = p === r;
|
|
43
|
+
return /* @__PURE__ */ c("div", {
|
|
44
|
+
className: `${n.thumbnailItem} ${a ? n.thumbnailItemActive : ""}`,
|
|
45
|
+
onClick: () => m(r),
|
|
46
|
+
ref: (e) => {
|
|
47
|
+
_.current[t] = e;
|
|
48
|
+
},
|
|
49
|
+
"data-page": r,
|
|
50
|
+
children: [i ? /* @__PURE__ */ s("img", {
|
|
51
|
+
src: i,
|
|
52
|
+
className: `${n.thumbnailImg} ${a ? n.thumbnailImgActive : ""}`,
|
|
53
|
+
alt: `Anteprima pagina ${r}`
|
|
54
|
+
}) : /* @__PURE__ */ s("div", { className: n.thumbnailSkeleton }), /* @__PURE__ */ s("div", {
|
|
55
|
+
className: `${n.thumbnailLabel} ${a ? n.thumbnailLabelActive : ""}`,
|
|
56
|
+
children: r
|
|
28
57
|
})]
|
|
29
58
|
}, t);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
let m;
|
|
33
|
-
return o[10] === p ? m = o[11] : (m = /* @__PURE__ */ i("div", {
|
|
34
|
-
className: n.thumbnailList,
|
|
35
|
-
children: p
|
|
36
|
-
}), o[10] = p, o[11] = m), m;
|
|
59
|
+
})
|
|
60
|
+
}), l[9] = p, l[10] = m, l[11] = h, l[12] = S, l[13] = T) : T = l[13], T;
|
|
37
61
|
}
|
|
38
62
|
//#endregion
|
|
39
|
-
export {
|
|
63
|
+
export { d as PDFThumbnails };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
thumbnailList: "
|
|
3
|
-
thumbnailItem: "
|
|
4
|
-
thumbnailItemActive: "
|
|
5
|
-
thumbnailImg: "
|
|
6
|
-
thumbnailImgActive: "
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
thumbnailList: "_thumbnailList_vk7sw_1",
|
|
3
|
+
thumbnailItem: "_thumbnailItem_vk7sw_11",
|
|
4
|
+
thumbnailItemActive: "_thumbnailItemActive_vk7sw_37",
|
|
5
|
+
thumbnailImg: "_thumbnailImg_vk7sw_55",
|
|
6
|
+
thumbnailImgActive: "_thumbnailImgActive_vk7sw_67",
|
|
7
|
+
thumbnailSkeleton: "_thumbnailSkeleton_vk7sw_75",
|
|
8
|
+
shimmer: "_shimmer_vk7sw_1",
|
|
9
|
+
thumbnailLabel: "_thumbnailLabel_vk7sw_103",
|
|
10
|
+
thumbnailLabelActive: "_thumbnailLabelActive_vk7sw_117"
|
|
9
11
|
};
|
|
10
12
|
//#endregion
|
|
11
13
|
export { e as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
3
|
import n from "./PDFZoomControls.module.js";
|
|
4
|
-
import "react";
|
|
5
4
|
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import "react";
|
|
6
6
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/features/PDFZoomControls.tsx
|
|
8
8
|
function s(s) {
|
|
@@ -1,50 +1,45 @@
|
|
|
1
1
|
import { darkTheme as e, lightTheme as t, themeToCssVars as n } from "../theme.js";
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
2
|
+
import { ThemeContext as r } from "./themeContextValue.js";
|
|
3
|
+
import { c as i } from "react/compiler-runtime";
|
|
4
|
+
import { useState as a } from "react";
|
|
5
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
6
|
//#region src/context/ThemeContext.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
i[0] !== p || i[1] !== d?.dark || i[2] !== d?.light ? (g = p ? {
|
|
7
|
+
function s(s) {
|
|
8
|
+
let l = i(17), { children: u, themeOverrides: d, defaultTheme: f } = s, [p, m] = a((f === void 0 ? "light" : f) === "dark"), h, g;
|
|
9
|
+
l[0] !== p || l[1] !== d?.dark || l[2] !== d?.light ? (g = p ? {
|
|
10
10
|
...e,
|
|
11
11
|
...d?.dark
|
|
12
12
|
} : {
|
|
13
13
|
...t,
|
|
14
14
|
...d?.light
|
|
15
|
-
}, h = n(g),
|
|
15
|
+
}, h = n(g), l[0] = p, l[1] = d?.dark, l[2] = d?.light, l[3] = h, l[4] = g) : (h = l[3], g = l[4]);
|
|
16
16
|
let _ = h, v;
|
|
17
|
-
|
|
17
|
+
l[5] === Symbol.for("react.memo_cache_sentinel") ? (v = () => m(c), l[5] = v) : v = l[5];
|
|
18
18
|
let y;
|
|
19
|
-
|
|
19
|
+
l[6] !== p || l[7] !== g ? (y = {
|
|
20
20
|
isDark: p,
|
|
21
21
|
toggleTheme: v,
|
|
22
22
|
theme: g
|
|
23
|
-
},
|
|
23
|
+
}, l[6] = p, l[7] = g, l[8] = y) : y = l[8];
|
|
24
24
|
let b = _, x;
|
|
25
|
-
|
|
25
|
+
l[9] === b ? x = l[10] : (x = {
|
|
26
26
|
...b,
|
|
27
27
|
height: "100%",
|
|
28
28
|
width: "100%"
|
|
29
|
-
},
|
|
29
|
+
}, l[9] = b, l[10] = x);
|
|
30
30
|
let S;
|
|
31
|
-
|
|
31
|
+
l[11] !== u || l[12] !== x ? (S = /* @__PURE__ */ o("div", {
|
|
32
32
|
style: x,
|
|
33
|
-
children:
|
|
34
|
-
}),
|
|
33
|
+
children: u
|
|
34
|
+
}), l[11] = u, l[12] = x, l[13] = S) : S = l[13];
|
|
35
35
|
let C;
|
|
36
|
-
return
|
|
36
|
+
return l[14] !== y || l[15] !== S ? (C = /* @__PURE__ */ o(r.Provider, {
|
|
37
37
|
value: y,
|
|
38
38
|
children: S
|
|
39
|
-
}),
|
|
39
|
+
}), l[14] = y, l[15] = S, l[16] = C) : C = l[16], C;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function c(e) {
|
|
42
42
|
return !e;
|
|
43
43
|
}
|
|
44
|
-
function d() {
|
|
45
|
-
let e = i(c);
|
|
46
|
-
if (!e) throw Error("useTheme must be used inside <ThemeProvider>");
|
|
47
|
-
return e;
|
|
48
|
-
}
|
|
49
44
|
//#endregion
|
|
50
|
-
export {
|
|
45
|
+
export { s as ThemeProvider };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { isSafeUrl as e } from "../utils/url.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as t } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect as n, useState as r } from "react";
|
|
3
4
|
import "pdfjs-dist";
|
|
4
|
-
import { c as r } from "react/compiler-runtime";
|
|
5
5
|
//#region src/hooks/useAnnotationLayer.ts
|
|
6
6
|
function i(i) {
|
|
7
|
-
let a =
|
|
7
|
+
let a = t(15), { pdf: o, zoom: s, rotation: c, mountedPages: l, goToPage: u } = i, d;
|
|
8
8
|
a[0] === Symbol.for("react.memo_cache_sentinel") ? (d = [], a[0] = d) : d = a[0];
|
|
9
|
-
let [f, p] =
|
|
9
|
+
let [f, p] = r(d), m, h;
|
|
10
10
|
a[1] !== l || a[2] !== o || a[3] !== c || a[4] !== s ? (m = () => {
|
|
11
11
|
if (!o) return;
|
|
12
12
|
let e = !1;
|
|
13
13
|
return (async () => {
|
|
14
|
-
p([]);
|
|
15
14
|
let t = [];
|
|
16
|
-
for (let n
|
|
17
|
-
|
|
15
|
+
for (let n of l) {
|
|
16
|
+
if (e) break;
|
|
17
|
+
let r = await o.getPage(n), i = r.getViewport({
|
|
18
18
|
scale: s,
|
|
19
19
|
rotation: c
|
|
20
|
-
}),
|
|
21
|
-
for (let e of
|
|
20
|
+
}), a = await r.getAnnotations();
|
|
21
|
+
for (let e of a) {
|
|
22
22
|
if (e.subtype !== "Link" || !e.rect) continue;
|
|
23
|
-
let
|
|
23
|
+
let r = e.rect, [a, o, s, c] = i.convertToViewportRectangle(r);
|
|
24
24
|
t.push({
|
|
25
25
|
page: n,
|
|
26
26
|
x: Math.min(a, s),
|
|
@@ -42,7 +42,7 @@ function i(i) {
|
|
|
42
42
|
s,
|
|
43
43
|
c,
|
|
44
44
|
l
|
|
45
|
-
], a[1] = l, a[2] = o, a[3] = c, a[4] = s, a[5] = m, a[6] = h) : (m = a[5], h = a[6]),
|
|
45
|
+
], a[1] = l, a[2] = o, a[3] = c, a[4] = s, a[5] = m, a[6] = h) : (m = a[5], h = a[6]), n(m, h);
|
|
46
46
|
let g;
|
|
47
47
|
a[7] !== u || a[8] !== o ? (g = async (t) => {
|
|
48
48
|
if (t.url) {
|