pdf-tsx 0.4.0 → 0.5.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 (106) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +350 -337
  3. package/dist/cjs/components/PDFSidebar.cjs +1 -1
  4. package/dist/cjs/components/PDFSidebar.module.cjs +1 -1
  5. package/dist/cjs/components/PDFViewer.cjs +1 -1
  6. package/dist/cjs/components/PDFViewer.module.cjs +1 -1
  7. package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
  8. package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
  9. package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
  10. package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
  11. package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
  12. package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
  13. package/dist/cjs/components/features/PDFOutline.cjs +1 -1
  14. package/dist/cjs/components/features/PDFOutline.module.cjs +1 -1
  15. package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
  16. package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
  17. package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
  18. package/dist/cjs/components/features/PDFSearch.cjs +1 -1
  19. package/dist/cjs/components/features/PDFSearch.module.cjs +1 -1
  20. package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -1
  21. package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
  22. package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
  23. package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
  24. package/dist/cjs/components/features/PDFThumbnails.cjs +1 -1
  25. package/dist/cjs/components/features/PDFThumbnails.module.cjs +1 -1
  26. package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
  27. package/dist/cjs/components/features/PDFZoomControls.module.cjs +1 -1
  28. package/dist/cjs/components/ui/ToolbarButton.module.cjs +1 -1
  29. package/dist/cjs/components/ui/icons.cjs +1 -1
  30. package/dist/cjs/context/ThemeContext.cjs +1 -1
  31. package/dist/cjs/context/themeContextValue.cjs +1 -0
  32. package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
  33. package/dist/cjs/hooks/useAnnotations.cjs +1 -1
  34. package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
  35. package/dist/cjs/hooks/useOutline.cjs +1 -1
  36. package/dist/cjs/hooks/useOverlayRects.cjs +1 -0
  37. package/dist/cjs/hooks/usePDFLoader.cjs +1 -0
  38. package/dist/cjs/hooks/usePDFRenderer.cjs +1 -0
  39. package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
  40. package/dist/cjs/hooks/useTextLayer.cjs +1 -1
  41. package/dist/cjs/hooks/useTextSearch.cjs +1 -1
  42. package/dist/cjs/hooks/useTheme.cjs +1 -0
  43. package/dist/cjs/hooks/useThumbnails.cjs +1 -1
  44. package/dist/cjs/pdf-tsx.css +1 -1
  45. package/dist/components/PDFSidebar.d.ts +1 -2
  46. package/dist/components/features/PDFSidebarToggle.d.ts +1 -1
  47. package/dist/components/ui/icons.d.ts +0 -14
  48. package/dist/context/ThemeContext.d.ts +0 -6
  49. package/dist/context/themeContextValue.d.ts +7 -0
  50. package/dist/es/components/PDFSidebar.js +26 -33
  51. package/dist/es/components/PDFSidebar.module.js +9 -9
  52. package/dist/es/components/PDFViewer.js +240 -269
  53. package/dist/es/components/PDFViewer.module.js +15 -15
  54. package/dist/es/components/features/PDFAnnotations.js +57 -64
  55. package/dist/es/components/features/PDFAnnotations.module.js +12 -12
  56. package/dist/es/components/features/PDFChangeFile.js +3 -3
  57. package/dist/es/components/features/PDFDownloadButton.js +2 -2
  58. package/dist/es/components/features/PDFNavigation.js +3 -3
  59. package/dist/es/components/features/PDFNavigation.module.js +3 -3
  60. package/dist/es/components/features/PDFOutline.js +7 -7
  61. package/dist/es/components/features/PDFOutline.module.js +5 -5
  62. package/dist/es/components/features/PDFPageFit.js +1 -1
  63. package/dist/es/components/features/PDFPrintButton.js +5 -4
  64. package/dist/es/components/features/PDFRotationControl.js +1 -1
  65. package/dist/es/components/features/PDFSearch.js +4 -4
  66. package/dist/es/components/features/PDFSearch.module.js +5 -5
  67. package/dist/es/components/features/PDFSidebarToggle.js +11 -10
  68. package/dist/es/components/features/PDFSignatures.js +158 -116
  69. package/dist/es/components/features/PDFSignatures.module.js +16 -16
  70. package/dist/es/components/features/PDFThemeToggle.js +5 -5
  71. package/dist/es/components/features/PDFThumbnails.js +54 -30
  72. package/dist/es/components/features/PDFThumbnails.module.js +9 -7
  73. package/dist/es/components/features/PDFZoomControls.js +1 -1
  74. package/dist/es/components/features/PDFZoomControls.module.js +1 -1
  75. package/dist/es/components/ui/ToolbarButton.module.js +2 -2
  76. package/dist/es/components/ui/icons.js +1 -1
  77. package/dist/es/context/ThemeContext.js +20 -25
  78. package/dist/es/context/themeContextValue.js +5 -0
  79. package/dist/es/hooks/useAnnotationLayer.js +11 -11
  80. package/dist/es/hooks/useAnnotations.js +0 -1
  81. package/dist/es/hooks/useKeyboardShortcuts.js +12 -15
  82. package/dist/es/hooks/useOutline.js +31 -12
  83. package/dist/es/hooks/useOverlayRects.js +72 -0
  84. package/dist/es/hooks/usePDFLoader.js +26 -0
  85. package/dist/es/hooks/usePDFRenderer.js +83 -0
  86. package/dist/es/hooks/useScrollTracking.js +21 -20
  87. package/dist/es/hooks/useTextLayer.js +13 -12
  88. package/dist/es/hooks/useTextSearch.js +30 -18
  89. package/dist/es/hooks/useTheme.js +10 -0
  90. package/dist/es/hooks/useThumbnails.js +86 -24
  91. package/dist/es/pdf-tsx.css +1 -1
  92. package/dist/hooks/useAnnotationLayer.d.ts +2 -2
  93. package/dist/hooks/useAnnotations.d.ts +0 -5
  94. package/dist/hooks/useKeyboardShortcuts.d.ts +1 -2
  95. package/dist/hooks/useOverlayRects.d.ts +21 -0
  96. package/dist/hooks/usePDFLoader.d.ts +4 -0
  97. package/dist/hooks/usePDFRenderer.d.ts +16 -0
  98. package/dist/hooks/useScrollTracking.d.ts +2 -1
  99. package/dist/hooks/useTextLayer.d.ts +2 -2
  100. package/dist/hooks/useTheme.d.ts +2 -0
  101. package/dist/hooks/useThumbnails.d.ts +3 -2
  102. package/dist/pdf-tsx.cjs.js +5 -0
  103. package/dist/pdf-tsx.css +2 -0
  104. package/dist/pdf-tsx.es.js +2637 -0
  105. package/dist/vite.svg +1 -0
  106. package/package.json +61 -61
@@ -1,140 +1,182 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { useSignatures as t } from "../../hooks/useSignatures.js";
3
- import n from "./PDFSignatures.module.js";
4
- import { c as r } from "react/compiler-runtime";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
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 o(e) {
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 s(e) {
15
- let t = r(31), { sig: s, onClick: c } = e, l = `${n.card} ${s.signed ? n.cardSigned : ""} ${s.rect ? n.cardClickable : ""}`, u = `${n.statusDot} ${s.signed ? n.statusDotSigned : ""}`, d = s.signed ? "✓" : "○", f;
16
- t[0] !== u || t[1] !== d ? (f = /* @__PURE__ */ i("div", {
17
- className: u,
18
- children: d
19
- }), t[0] = u, t[1] = d, t[2] = f) : f = t[2];
20
- let p = `${n.statusLabel} ${s.signed ? n.statusLabelSigned : ""}`, m = s.signed ? "Firmato" : "Non firmato", h;
21
- t[3] !== p || t[4] !== m ? (h = /* @__PURE__ */ i("span", {
22
- className: p,
23
- children: m
24
- }), t[3] = p, t[4] = m, t[5] = h) : h = t[5];
25
- let g;
26
- t[6] !== f || t[7] !== h ? (g = /* @__PURE__ */ a("div", {
27
- className: n.cardHeader,
28
- children: [f, h]
29
- }), t[6] = f, t[7] = h, t[8] = g) : g = t[8];
30
- let _;
31
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ i("span", {
32
- className: n.fieldLabel,
33
- children: "Campo: "
34
- }), t[9] = _) : _ = t[9];
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[10] === s.fieldName ? v = t[11] : (v = /* @__PURE__ */ a("div", {
37
- className: n.fieldRow,
38
- children: [_, s.fieldName]
39
- }), t[10] = s.fieldName, t[11] = v);
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[12] === s.signerName ? y = t[13] : (y = s.signerName && /* @__PURE__ */ a("div", {
42
- className: n.fieldRow,
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
- v,
77
- y,
78
- b,
79
- x,
80
- S
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[20] = v, t[21] = y, t[22] = b, t[23] = x, t[24] = S, t[25] = C) : C = t[25];
83
- let w;
84
- return t[26] !== c || t[27] !== l || t[28] !== C || t[29] !== g ? (w = /* @__PURE__ */ a("div", {
85
- className: l,
86
- onClick: c,
87
- children: [g, C]
88
- }), t[26] = c, t[27] = l, t[28] = C, t[29] = g, t[30] = w) : w = t[30], w;
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 c(o) {
91
- let s = r(8), { icon: c } = o, { pdf: l } = e(), u;
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 } = t(u), p = d.length, m;
94
- s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ i("span", {
95
- className: n.badge,
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__ */ a("span", {
100
- className: n.iconWrapper,
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 l() {
105
- let o = r(18), { pdf: c, goToPage: l, setHighlight: u } = e(), d;
106
- o[0] === c ? d = o[1] : (d = { pdf: c }, o[0] = c, o[1] = d);
107
- let { signatures: f, loading: p } = t(d), m;
108
- o[2] !== l || o[3] !== u ? (m = (e) => {
109
- l(e.page), e.rect && u({
110
- page: e.page,
111
- pdfRect: e.rect
112
- });
113
- }, o[2] = l, o[3] = u, o[4] = m) : m = o[4];
114
- let h = m, g;
115
- o[5] === p ? g = o[6] : (g = p && /* @__PURE__ */ i("div", {
116
- className: n.emptyState,
117
- children: "Caricamento..."
118
- }), o[5] = p, o[6] = g);
119
- let _;
120
- o[7] !== p || o[8] !== f ? (_ = !p && f.length === 0 && /* @__PURE__ */ i("div", {
121
- className: n.emptyState,
122
- children: "Nessuna firma rilevata."
123
- }), o[7] = p, o[8] = f, o[9] = _) : _ = o[9];
124
- let v;
125
- o[10] !== h || o[11] !== p || o[12] !== f ? (v = !p && f.map((e, t) => /* @__PURE__ */ i(s, {
126
- sig: e,
127
- onClick: () => h(e)
128
- }, t)), o[10] = h, o[11] = p, o[12] = f, o[13] = v) : v = o[13];
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
- g,
134
- _,
135
- v
175
+ y,
176
+ b,
177
+ x
136
178
  ]
137
- }), o[14] = g, o[15] = _, o[16] = v, o[17] = y) : y = o[17], y;
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 { l as PDFSignatures, c as PDFSignaturesIcon };
182
+ export { f as PDFSignatures, d as PDFSignaturesIcon };
@@ -1,20 +1,20 @@
1
1
  var e = {
2
- list: "_list_11831_1",
3
- emptyState: "_emptyState_11831_11",
4
- card: "_card_11831_23",
5
- cardClickable: "_cardClickable_11831_45",
6
- cardSigned: "_cardSigned_11831_61",
7
- cardHeader: "_cardHeader_11831_71",
8
- statusDot: "_statusDot_11831_85",
9
- statusDotSigned: "_statusDotSigned_11831_113",
10
- statusLabel: "_statusLabel_11831_121",
11
- statusLabelSigned: "_statusLabelSigned_11831_137",
12
- fieldList: "_fieldList_11831_145",
13
- fieldRow: "_fieldRow_11831_157",
14
- fieldLabel: "_fieldLabel_11831_167",
15
- disclaimer: "_disclaimer_11831_175",
16
- iconWrapper: "_iconWrapper_11831_197",
17
- badge: "_badge_11831_211"
2
+ list: "_list_1ii4b_1",
3
+ emptyState: "_emptyState_1ii4b_8",
4
+ card: "_card_1ii4b_15",
5
+ cardSigned: "_cardSigned_1ii4b_32",
6
+ cardClickable: "_cardClickable_1ii4b_37",
7
+ cardBody: "_cardBody_1ii4b_50",
8
+ cardHeader: "_cardHeader_1ii4b_54",
9
+ fieldName: "_fieldName_1ii4b_62",
10
+ statusChip: "_statusChip_1ii4b_73",
11
+ statusChipSigned: "_statusChipSigned_1ii4b_89",
12
+ fieldList: "_fieldList_1ii4b_95",
13
+ fieldRow: "_fieldRow_1ii4b_101",
14
+ fieldLabel: "_fieldLabel_1ii4b_109",
15
+ fieldValue: "_fieldValue_1ii4b_114",
16
+ iconWrapper: "_iconWrapper_1ii4b_119",
17
+ badge: "_badge_1ii4b_126"
18
18
  };
19
19
  //#endregion
20
20
  export { e as default };
@@ -1,12 +1,12 @@
1
- import { useTheme as e } from "../../context/ThemeContext.js";
2
- import { ToolbarButton as t } from "../ui/ToolbarButton.js";
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 } = e(), 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(t, {
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 { jsx as i, jsxs as a } from "react/jsx-runtime";
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
- function o() {
8
- let o = r(12), { pdf: s, rotation: c, currentPage: l, goToPage: u } = e(), d;
9
- o[0] !== s || o[1] !== c ? (d = {
10
- pdf: s,
11
- rotation: c
12
- }, o[0] = s, o[1] = c, o[2] = d) : d = o[2];
13
- let { thumbnails: f } = t(d), p;
14
- if (o[3] !== l || o[4] !== u || o[5] !== f) {
15
- let e;
16
- o[7] !== l || o[8] !== u ? (e = (e, t) => {
17
- let r = l === t + 1;
18
- return /* @__PURE__ */ a("div", {
19
- className: `${n.thumbnailItem} ${r ? n.thumbnailItemActive : ""}`,
20
- onClick: () => u(t + 1),
21
- children: [/* @__PURE__ */ i("img", {
22
- src: e,
23
- className: `${n.thumbnailImg} ${r ? n.thumbnailImgActive : ""}`,
24
- alt: `Anteprima pagina ${t + 1}`
25
- }), /* @__PURE__ */ i("div", {
26
- className: `${n.thumbnailLabel} ${r ? n.thumbnailLabelActive : ""}`,
27
- children: t + 1
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
- }, o[7] = l, o[8] = u, o[9] = e) : e = o[9], p = f.map(e), o[3] = l, o[4] = u, o[5] = f, o[6] = p;
31
- } else p = o[6];
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 { o as PDFThumbnails };
63
+ export { d as PDFThumbnails };
@@ -1,11 +1,13 @@
1
1
  var e = {
2
- thumbnailList: "_thumbnailList_116om_1",
3
- thumbnailItem: "_thumbnailItem_116om_11",
4
- thumbnailItemActive: "_thumbnailItemActive_116om_37",
5
- thumbnailImg: "_thumbnailImg_116om_55",
6
- thumbnailImgActive: "_thumbnailImgActive_116om_67",
7
- thumbnailLabel: "_thumbnailLabel_116om_75",
8
- thumbnailLabelActive: "_thumbnailLabelActive_116om_89"
2
+ thumbnailList: "_thumbnailList_qpgpt_1",
3
+ thumbnailItem: "_thumbnailItem_qpgpt_6",
4
+ thumbnailItemActive: "_thumbnailItemActive_qpgpt_19",
5
+ thumbnailImg: "_thumbnailImg_qpgpt_28",
6
+ thumbnailImgActive: "_thumbnailImgActive_qpgpt_34",
7
+ thumbnailSkeleton: "_thumbnailSkeleton_qpgpt_38",
8
+ shimmer: "_shimmer_qpgpt_1",
9
+ thumbnailLabel: "_thumbnailLabel_qpgpt_52",
10
+ thumbnailLabelActive: "_thumbnailLabelActive_qpgpt_59"
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,3 +1,3 @@
1
- var e = { zoomLabel: "_zoomLabel_1r6if_1" };
1
+ var e = { zoomLabel: "_zoomLabel_m8iv9_1" };
2
2
  //#endregion
3
3
  export { e as default };
@@ -1,6 +1,6 @@
1
1
  var e = {
2
- btn: "_btn_12ml0_1",
3
- primary: "_primary_12ml0_57"
2
+ btn: "_btn_1x6vc_1",
3
+ primary: "_primary_1x6vc_29"
4
4
  };
5
5
  //#endregion
6
6
  export { e as default };
@@ -1,5 +1,5 @@
1
- import "react";
2
1
  import { c as e } from "react/compiler-runtime";
2
+ import "react";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  //#region src/components/ui/icons.tsx
5
5
  var n = (e, n = 16) => /* @__PURE__ */ t("svg", {
@@ -1,50 +1,45 @@
1
1
  import { darkTheme as e, lightTheme as t, themeToCssVars as n } from "../theme.js";
2
- import { createContext as r, useContext as i, useState as a } from "react";
3
- import { c as o } from "react/compiler-runtime";
4
- import { jsx as s } from "react/jsx-runtime";
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
- var c = r(null);
7
- function l(r) {
8
- let i = o(17), { children: l, themeOverrides: d, defaultTheme: f } = r, [p, m] = a((f === void 0 ? "light" : f) === "dark"), h, g;
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), i[0] = p, i[1] = d?.dark, i[2] = d?.light, i[3] = h, i[4] = g) : (h = i[3], g = i[4]);
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
- i[5] === Symbol.for("react.memo_cache_sentinel") ? (v = () => m(u), i[5] = v) : v = i[5];
17
+ l[5] === Symbol.for("react.memo_cache_sentinel") ? (v = () => m(c), l[5] = v) : v = l[5];
18
18
  let y;
19
- i[6] !== p || i[7] !== g ? (y = {
19
+ l[6] !== p || l[7] !== g ? (y = {
20
20
  isDark: p,
21
21
  toggleTheme: v,
22
22
  theme: g
23
- }, i[6] = p, i[7] = g, i[8] = y) : y = i[8];
23
+ }, l[6] = p, l[7] = g, l[8] = y) : y = l[8];
24
24
  let b = _, x;
25
- i[9] === b ? x = i[10] : (x = {
25
+ l[9] === b ? x = l[10] : (x = {
26
26
  ...b,
27
27
  height: "100%",
28
28
  width: "100%"
29
- }, i[9] = b, i[10] = x);
29
+ }, l[9] = b, l[10] = x);
30
30
  let S;
31
- i[11] !== l || i[12] !== x ? (S = /* @__PURE__ */ s("div", {
31
+ l[11] !== u || l[12] !== x ? (S = /* @__PURE__ */ o("div", {
32
32
  style: x,
33
- children: l
34
- }), i[11] = l, i[12] = x, i[13] = S) : S = i[13];
33
+ children: u
34
+ }), l[11] = u, l[12] = x, l[13] = S) : S = l[13];
35
35
  let C;
36
- return i[14] !== y || i[15] !== S ? (C = /* @__PURE__ */ s(c.Provider, {
36
+ return l[14] !== y || l[15] !== S ? (C = /* @__PURE__ */ o(r.Provider, {
37
37
  value: y,
38
38
  children: S
39
- }), i[14] = y, i[15] = S, i[16] = C) : C = i[16], C;
39
+ }), l[14] = y, l[15] = S, l[16] = C) : C = l[16], C;
40
40
  }
41
- function u(e) {
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 { l as ThemeProvider, d as useTheme };
45
+ export { s as ThemeProvider };
@@ -0,0 +1,5 @@
1
+ import { createContext as e } from "react";
2
+ //#region src/context/themeContextValue.ts
3
+ var t = e(null);
4
+ //#endregion
5
+ export { t as ThemeContext };
@@ -1,26 +1,26 @@
1
1
  import { isSafeUrl as e } from "../utils/url.js";
2
- import { useEffect as t, useState as n } from "react";
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 = r(15), { pdf: o, zoom: s, rotation: c, numPages: l, goToPage: u } = i, d;
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] = n(d), m, h;
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 = 1; n <= l && !e; n++) {
17
- let e = await o.getPage(n), r = e.getViewport({
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
- }), i = await e.getAnnotations();
21
- for (let e of i) {
20
+ }), a = await r.getAnnotations();
21
+ for (let e of a) {
22
22
  if (e.subtype !== "Link" || !e.rect) continue;
23
- let i = e.rect, [a, o, s, c] = r.convertToViewportRectangle(i);
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]), t(m, h);
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) {