pdf-tsx 0.1.0 → 0.1.2

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 (58) hide show
  1. package/README.md +19 -7
  2. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -1
  3. package/dist/cjs/components/PDFSidebar.cjs +1 -1
  4. package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
  5. package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
  6. package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
  7. package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
  8. package/dist/cjs/components/features/PDFOutline.cjs +1 -1
  9. package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
  10. package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
  11. package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
  12. package/dist/cjs/components/features/PDFSearch.cjs +1 -1
  13. package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
  14. package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
  15. package/dist/cjs/components/features/PDFThumbnails.cjs +1 -1
  16. package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
  17. package/dist/cjs/components/ui/ToolbarButton.cjs +1 -1
  18. package/dist/cjs/components/ui/icons.cjs +1 -1
  19. package/dist/cjs/context/ThemeContext.cjs +1 -1
  20. package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
  21. package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
  22. package/dist/cjs/hooks/useOutline.cjs +1 -1
  23. package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
  24. package/dist/cjs/hooks/useTextLayer.cjs +1 -1
  25. package/dist/cjs/hooks/useTextSearch.cjs +1 -1
  26. package/dist/cjs/hooks/useThumbnails.cjs +1 -1
  27. package/dist/es/components/PDFSidebar.js +17 -18
  28. package/dist/es/components/features/PDFAnnotations.js +32 -32
  29. package/dist/es/components/features/PDFChangeFile.js +7 -8
  30. package/dist/es/components/features/PDFDownloadButton.js +6 -7
  31. package/dist/es/components/features/PDFNavigation.js +12 -13
  32. package/dist/es/components/features/PDFOutline.js +42 -43
  33. package/dist/es/components/features/PDFPageFit.js +10 -10
  34. package/dist/es/components/features/PDFPrintButton.js +6 -7
  35. package/dist/es/components/features/PDFRotationControl.js +9 -10
  36. package/dist/es/components/features/PDFSearch.js +15 -16
  37. package/dist/es/components/features/PDFSignatures.js +55 -56
  38. package/dist/es/components/features/PDFThemeToggle.js +7 -8
  39. package/dist/es/components/features/PDFThumbnails.js +20 -21
  40. package/dist/es/components/features/PDFZoomControls.js +20 -21
  41. package/dist/es/components/ui/ToolbarButton.js +7 -8
  42. package/dist/es/components/ui/icons.js +9 -9
  43. package/dist/es/context/ThemeContext.js +19 -19
  44. package/dist/es/hooks/useAnnotationLayer.js +16 -17
  45. package/dist/es/hooks/useKeyboardShortcuts.js +15 -16
  46. package/dist/es/hooks/useOutline.js +7 -8
  47. package/dist/es/hooks/useScrollTracking.js +11 -11
  48. package/dist/es/hooks/useTextLayer.js +13 -14
  49. package/dist/es/hooks/useTextSearch.js +7 -8
  50. package/dist/es/hooks/useThumbnails.js +7 -8
  51. package/package.json +1 -1
  52. package/dist/cjs/node_modules/react/cjs/react-compiler-runtime.development.cjs +0 -5
  53. package/dist/cjs/node_modules/react/cjs/react-compiler-runtime.production.cjs +0 -1
  54. package/dist/cjs/node_modules/react/compiler-runtime.cjs +0 -1
  55. package/dist/es/_virtual/_rolldown/runtime.js +0 -7
  56. package/dist/es/node_modules/react/cjs/react-compiler-runtime.development.js +0 -14
  57. package/dist/es/node_modules/react/cjs/react-compiler-runtime.production.js +0 -11
  58. package/dist/es/node_modules/react/compiler-runtime.js +0 -10
@@ -1,18 +1,17 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { ToolbarButton as n } from "../ui/ToolbarButton.js";
2
+ import { ToolbarButton as t } from "../ui/ToolbarButton.js";
4
3
  import "react";
4
+ import { c as n } from "react/compiler-runtime";
5
5
  import { jsxs as r } from "react/jsx-runtime";
6
6
  //#region src/components/features/PDFDownloadButton.tsx
7
- var i = t();
8
- function a(t) {
9
- let a = (0, i.c)(5), { icon: o } = t, { file: s } = e(), c;
7
+ function i(i) {
8
+ let a = n(5), { icon: o } = i, { file: s } = e(), c;
10
9
  a[0] === s ? c = a[1] : (c = () => {
11
10
  let e = URL.createObjectURL(s), t = document.createElement("a");
12
11
  t.href = e, t.download = s.name || "documento.pdf", t.click(), URL.revokeObjectURL(e);
13
12
  }, a[0] = s, a[1] = c);
14
13
  let l = c, u;
15
- return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(n, {
14
+ return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(t, {
16
15
  $primary: !0,
17
16
  onClick: l,
18
17
  title: "Scarica PDF",
@@ -20,4 +19,4 @@ function a(t) {
20
19
  }), a[2] = l, a[3] = o, a[4] = u) : u = a[4], u;
21
20
  }
22
21
  //#endregion
23
- export { a as PDFDownloadButton };
22
+ export { i as PDFDownloadButton };
@@ -1,13 +1,12 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { ToolbarButton as n } from "../ui/ToolbarButton.js";
4
- import r from "./PDFNavigation.module.js";
5
- import { useState as i } from "react";
2
+ import { ToolbarButton as t } from "../ui/ToolbarButton.js";
3
+ import n from "./PDFNavigation.module.js";
4
+ import { useState as r } from "react";
5
+ import { c as i } from "react/compiler-runtime";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  //#region src/components/features/PDFNavigation.tsx
8
- var s = t();
9
- function c(t) {
10
- let c = (0, s.c)(34), { prevIcon: l, nextIcon: u } = t, { currentPage: d, numPages: f, goToPage: p } = e(), [m, h] = i(!1), [g, _] = i(""), v;
8
+ function s(s) {
9
+ let c = i(34), { prevIcon: l, nextIcon: u } = s, { currentPage: d, numPages: f, goToPage: p } = e(), [m, h] = r(!1), [g, _] = r(""), v;
11
10
  c[0] !== p || c[1] !== g ? (v = () => {
12
11
  let e = parseInt(g, 10);
13
12
  isNaN(e) || p(e), h(!1);
@@ -15,7 +14,7 @@ function c(t) {
15
14
  let y = v, b;
16
15
  c[3] !== d || c[4] !== p ? (b = () => p(d - 1), c[3] = d, c[4] = p, c[5] = b) : b = c[5];
17
16
  let x = d === 1, S;
18
- c[6] !== l || c[7] !== b || c[8] !== x ? (S = /* @__PURE__ */ a(n, {
17
+ c[6] !== l || c[7] !== b || c[8] !== x ? (S = /* @__PURE__ */ a(t, {
19
18
  onClick: b,
20
19
  disabled: x,
21
20
  title: "Pagina precedente (←)",
@@ -33,7 +32,7 @@ function c(t) {
33
32
  }, c[13] = y, c[14] = E);
34
33
  let D;
35
34
  c[15] !== y || c[16] !== C || c[17] !== w || c[18] !== E ? (D = /* @__PURE__ */ a("input", {
36
- className: r.pageInput,
35
+ className: n.pageInput,
37
36
  type: "number",
38
37
  value: C,
39
38
  onFocus: w,
@@ -44,13 +43,13 @@ function c(t) {
44
43
  }), c[15] = y, c[16] = C, c[17] = w, c[18] = E, c[19] = D) : D = c[19];
45
44
  let O;
46
45
  c[20] === f ? O = c[21] : (O = /* @__PURE__ */ o("span", {
47
- className: r.pageTotal,
46
+ className: n.pageTotal,
48
47
  children: ["/ ", f]
49
48
  }), c[20] = f, c[21] = O);
50
49
  let k;
51
50
  c[22] !== d || c[23] !== p ? (k = () => p(d + 1), c[22] = d, c[23] = p, c[24] = k) : k = c[24];
52
51
  let A = d === f, j;
53
- c[25] !== u || c[26] !== k || c[27] !== A ? (j = /* @__PURE__ */ a(n, {
52
+ c[25] !== u || c[26] !== k || c[27] !== A ? (j = /* @__PURE__ */ a(t, {
54
53
  onClick: k,
55
54
  disabled: A,
56
55
  title: "Pagina successiva (→)",
@@ -58,7 +57,7 @@ function c(t) {
58
57
  }), c[25] = u, c[26] = k, c[27] = A, c[28] = j) : j = c[28];
59
58
  let M;
60
59
  return c[29] !== O || c[30] !== j || c[31] !== S || c[32] !== D ? (M = /* @__PURE__ */ o("div", {
61
- className: r.navWrapper,
60
+ className: n.navWrapper,
62
61
  children: [
63
62
  S,
64
63
  D,
@@ -68,4 +67,4 @@ function c(t) {
68
67
  }), c[29] = O, c[30] = j, c[31] = S, c[32] = D, c[33] = M) : M = c[33], M;
69
68
  }
70
69
  //#endregion
71
- export { c as PDFNavigation };
70
+ export { s as PDFNavigation };
@@ -1,13 +1,12 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { useOutline as n } from "../../hooks/useOutline.js";
4
- import { IconChevronDown as r, IconChevronRight as i } from "../ui/icons.js";
5
- import a from "./PDFOutline.module.js";
6
- import { useState as o } from "react";
2
+ import { useOutline as t } from "../../hooks/useOutline.js";
3
+ import { IconChevronDown as n, IconChevronRight as r } from "../ui/icons.js";
4
+ import i from "./PDFOutline.module.js";
5
+ import { useState as a } from "react";
6
+ import { c as o } from "react/compiler-runtime";
7
7
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region src/components/features/PDFOutline.tsx
9
- var u = t();
10
- async function d(e, t) {
9
+ async function u(e, t) {
11
10
  if (!e || !t) return null;
12
11
  try {
13
12
  let n = typeof t == "string" ? await e.getDestination(t) : t;
@@ -18,84 +17,84 @@ async function d(e, t) {
18
17
  return null;
19
18
  }
20
19
  }
21
- function f(e) {
22
- let t = (0, u.c)(25), { node: n, depth: d, onNavigate: m } = e, [h, g] = o(d === 0), _ = n.items.length > 0, v = 12 + d * 14, y = n.bold ? 600 : 400, b = n.italic ? "italic" : "normal", x;
20
+ function d(e) {
21
+ let t = o(25), { node: u, depth: p, onNavigate: m } = e, [h, g] = a(p === 0), _ = u.items.length > 0, v = 12 + p * 14, y = u.bold ? 600 : 400, b = u.italic ? "italic" : "normal", x;
23
22
  t[0] !== v || t[1] !== y || t[2] !== b ? (x = {
24
23
  paddingLeft: v,
25
24
  fontWeight: y,
26
25
  fontStyle: b
27
26
  }, t[0] = v, t[1] = y, t[2] = b, t[3] = x) : x = t[3];
28
27
  let S;
29
- t[4] !== n.dest || t[5] !== m ? (S = () => m(n.dest), t[4] = n.dest, t[5] = m, t[6] = S) : S = t[6];
28
+ t[4] !== u.dest || t[5] !== m ? (S = () => m(u.dest), t[4] = u.dest, t[5] = m, t[6] = S) : S = t[6];
30
29
  let C;
31
30
  t[7] !== _ || t[8] !== h ? (C = _ ? /* @__PURE__ */ c("button", {
32
- className: a.chevronBtn,
31
+ className: i.chevronBtn,
33
32
  onClick: (e) => {
34
- e.stopPropagation(), g(p);
33
+ e.stopPropagation(), g(f);
35
34
  },
36
- children: c(h ? r : i, { size: 12 })
35
+ children: c(h ? n : r, { size: 12 })
37
36
  }) : /* @__PURE__ */ c("span", { style: {
38
37
  width: 16,
39
38
  flexShrink: 0
40
39
  } }), t[7] = _, t[8] = h, t[9] = C) : C = t[9];
41
40
  let w;
42
- t[10] === n.title ? w = t[11] : (w = /* @__PURE__ */ c("span", {
43
- className: a.title,
44
- title: n.title,
45
- children: n.title
46
- }), t[10] = n.title, t[11] = w);
41
+ t[10] === u.title ? w = t[11] : (w = /* @__PURE__ */ c("span", {
42
+ className: i.title,
43
+ title: u.title,
44
+ children: u.title
45
+ }), t[10] = u.title, t[11] = w);
47
46
  let T;
48
47
  t[12] !== x || t[13] !== S || t[14] !== C || t[15] !== w ? (T = /* @__PURE__ */ l("div", {
49
- className: a.row,
48
+ className: i.row,
50
49
  style: x,
51
50
  onClick: S,
52
51
  children: [C, w]
53
52
  }), t[12] = x, t[13] = S, t[14] = C, t[15] = w, t[16] = T) : T = t[16];
54
53
  let E;
55
- t[17] !== d || t[18] !== n.items || t[19] !== m || t[20] !== h ? (E = h && n.items.map((e, t) => /* @__PURE__ */ c(f, {
54
+ t[17] !== p || t[18] !== u.items || t[19] !== m || t[20] !== h ? (E = h && u.items.map((e, t) => /* @__PURE__ */ c(d, {
56
55
  node: e,
57
- depth: d + 1,
56
+ depth: p + 1,
58
57
  onNavigate: m
59
- }, t)), t[17] = d, t[18] = n.items, t[19] = m, t[20] = h, t[21] = E) : E = t[21];
58
+ }, t)), t[17] = p, t[18] = u.items, t[19] = m, t[20] = h, t[21] = E) : E = t[21];
60
59
  let D;
61
60
  return t[22] !== T || t[23] !== E ? (D = /* @__PURE__ */ l(s, { children: [T, E] }), t[22] = T, t[23] = E, t[24] = D) : D = t[24], D;
62
61
  }
63
- function p(e) {
62
+ function f(e) {
64
63
  return !e;
65
64
  }
66
- function m() {
67
- let t = (0, u.c)(18), { pdf: r, goToPage: i } = e(), o;
68
- t[0] === r ? o = t[1] : (o = { pdf: r }, t[0] = r, t[1] = o);
69
- let { outline: s, loading: p } = n(o), m;
70
- t[2] !== i || t[3] !== r ? (m = async (e) => {
71
- let t = await d(r, e);
72
- t !== null && i(t);
73
- }, t[2] = i, t[3] = r, t[4] = m) : m = t[4];
65
+ function p() {
66
+ let n = o(18), { pdf: r, goToPage: a } = e(), s;
67
+ n[0] === r ? s = n[1] : (s = { pdf: r }, n[0] = r, n[1] = s);
68
+ let { outline: f, loading: p } = t(s), m;
69
+ n[2] !== a || n[3] !== r ? (m = async (e) => {
70
+ let t = await u(r, e);
71
+ t !== null && a(t);
72
+ }, n[2] = a, n[3] = r, n[4] = m) : m = n[4];
74
73
  let h = m, g;
75
- t[5] === p ? g = t[6] : (g = p && /* @__PURE__ */ c("div", {
76
- className: a.emptyState,
74
+ n[5] === p ? g = n[6] : (g = p && /* @__PURE__ */ c("div", {
75
+ className: i.emptyState,
77
76
  children: "Caricamento..."
78
- }), t[5] = p, t[6] = g);
77
+ }), n[5] = p, n[6] = g);
79
78
  let _;
80
- t[7] !== p || t[8] !== s ? (_ = !p && s.length === 0 && /* @__PURE__ */ c("div", {
81
- className: a.emptyState,
79
+ n[7] !== p || n[8] !== f ? (_ = !p && f.length === 0 && /* @__PURE__ */ c("div", {
80
+ className: i.emptyState,
82
81
  children: "Nessun segnalibro disponibile."
83
- }), t[7] = p, t[8] = s, t[9] = _) : _ = t[9];
82
+ }), n[7] = p, n[8] = f, n[9] = _) : _ = n[9];
84
83
  let v;
85
- t[10] !== h || t[11] !== p || t[12] !== s ? (v = !p && s.map((e, t) => /* @__PURE__ */ c(f, {
84
+ n[10] !== h || n[11] !== p || n[12] !== f ? (v = !p && f.map((e, t) => /* @__PURE__ */ c(d, {
86
85
  node: e,
87
86
  depth: 0,
88
87
  onNavigate: h
89
- }, t)), t[10] = h, t[11] = p, t[12] = s, t[13] = v) : v = t[13];
88
+ }, t)), n[10] = h, n[11] = p, n[12] = f, n[13] = v) : v = n[13];
90
89
  let y;
91
- return t[14] !== g || t[15] !== _ || t[16] !== v ? (y = /* @__PURE__ */ l("div", {
92
- className: a.tree,
90
+ return n[14] !== g || n[15] !== _ || n[16] !== v ? (y = /* @__PURE__ */ l("div", {
91
+ className: i.tree,
93
92
  children: [
94
93
  g,
95
94
  _,
96
95
  v
97
96
  ]
98
- }), t[14] = g, t[15] = _, t[16] = v, t[17] = y) : y = t[17], y;
97
+ }), n[14] = g, n[15] = _, n[16] = v, n[17] = y) : y = n[17], y;
99
98
  }
100
99
  //#endregion
101
- export { m as PDFOutline };
100
+ export { p as PDFOutline };
@@ -1,19 +1,19 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { ToolbarButton as n } from "../ui/ToolbarButton.js";
2
+ import { ToolbarButton as t } from "../ui/ToolbarButton.js";
4
3
  import "react";
4
+ import { c as n } from "react/compiler-runtime";
5
5
  import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  //#region src/components/features/PDFPageFit.tsx
7
- var o = t(), s = 60, c = 10;
8
- function l(t) {
9
- let l = (0, o.c)(19), { fitWidthIcon: u, fitPageIcon: d } = t, { pdf: f, rotation: p, setZoom: m, containerRef: h } = e(), g;
7
+ var o = 60, s = 10;
8
+ function c(c) {
9
+ let l = n(19), { fitWidthIcon: u, fitPageIcon: d } = c, { pdf: f, rotation: p, setZoom: m, containerRef: h } = e(), g;
10
10
  l[0] !== h || l[1] !== f || l[2] !== p || l[3] !== m ? (g = async () => {
11
11
  if (!f || !h.current) return;
12
12
  let e = (await f.getPage(1)).getViewport({
13
13
  scale: 1,
14
14
  rotation: p
15
15
  });
16
- m((h.current.clientWidth - s) / e.width);
16
+ m((h.current.clientWidth - o) / e.width);
17
17
  }, l[0] = h, l[1] = f, l[2] = p, l[3] = m, l[4] = g) : g = l[4];
18
18
  let _ = g, v;
19
19
  l[5] !== h || l[6] !== f || l[7] !== p || l[8] !== m ? (v = async () => {
@@ -21,17 +21,17 @@ function l(t) {
21
21
  let e = (await f.getPage(1)).getViewport({
22
22
  scale: 1,
23
23
  rotation: p
24
- }), t = h.current.clientWidth - s, n = h.current.clientHeight - c * 2;
24
+ }), t = h.current.clientWidth - o, n = h.current.clientHeight - s * 2;
25
25
  m(Math.min(t / e.width, n / e.height));
26
26
  }, l[5] = h, l[6] = f, l[7] = p, l[8] = m, l[9] = v) : v = l[9];
27
27
  let y = v, b;
28
- l[10] !== u || l[11] !== _ ? (b = /* @__PURE__ */ i(n, {
28
+ l[10] !== u || l[11] !== _ ? (b = /* @__PURE__ */ i(t, {
29
29
  onClick: _,
30
30
  title: "Adatta alla larghezza",
31
31
  children: u
32
32
  }), l[10] = u, l[11] = _, l[12] = b) : b = l[12];
33
33
  let x;
34
- l[13] !== d || l[14] !== y ? (x = /* @__PURE__ */ i(n, {
34
+ l[13] !== d || l[14] !== y ? (x = /* @__PURE__ */ i(t, {
35
35
  onClick: y,
36
36
  title: "Adatta pagina intera",
37
37
  children: d
@@ -40,4 +40,4 @@ function l(t) {
40
40
  return l[16] !== b || l[17] !== x ? (S = /* @__PURE__ */ a(r, { children: [b, x] }), l[16] = b, l[17] = x, l[18] = S) : S = l[18], S;
41
41
  }
42
42
  //#endregion
43
- export { l as PDFPageFit };
43
+ export { c as PDFPageFit };
@@ -1,12 +1,11 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { ToolbarButton as n } from "../ui/ToolbarButton.js";
2
+ import { ToolbarButton as t } from "../ui/ToolbarButton.js";
4
3
  import "react";
4
+ import { c as n } from "react/compiler-runtime";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/features/PDFPrintButton.tsx
7
- var i = t();
8
- function a(t) {
9
- let a = (0, i.c)(5), { icon: o } = t, { file: s } = e(), c;
7
+ function i(i) {
8
+ let a = n(5), { icon: o } = i, { file: s } = e(), c;
10
9
  a[0] === s ? c = a[1] : (c = () => {
11
10
  let e = URL.createObjectURL(s), t = document.createElement("iframe");
12
11
  t.style.display = "none", t.src = e, document.body.appendChild(t), t.onload = () => {
@@ -16,11 +15,11 @@ function a(t) {
16
15
  };
17
16
  }, a[0] = s, a[1] = c);
18
17
  let l = c, u;
19
- return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(n, {
18
+ return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(t, {
20
19
  onClick: l,
21
20
  title: "Stampa PDF",
22
21
  children: o
23
22
  }), a[2] = l, a[3] = o, a[4] = u) : u = a[4], u;
24
23
  }
25
24
  //#endregion
26
- export { a as PDFPrintButton };
25
+ export { i as PDFPrintButton };
@@ -1,22 +1,21 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { ToolbarButton as n } from "../ui/ToolbarButton.js";
2
+ import { ToolbarButton as t } from "../ui/ToolbarButton.js";
4
3
  import "react";
4
+ import { c as n } from "react/compiler-runtime";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/features/PDFRotationControl.tsx
7
- var i = t();
8
- function a(t) {
9
- let a = (0, i.c)(5), { icon: s } = t, { setRotation: c } = e(), l;
10
- a[0] === c ? l = a[1] : (l = () => c(o), a[0] = c, a[1] = l);
7
+ function i(i) {
8
+ let o = n(5), { icon: s } = i, { setRotation: c } = e(), l;
9
+ o[0] === c ? l = o[1] : (l = () => c(a), o[0] = c, o[1] = l);
11
10
  let u;
12
- return a[2] !== s || a[3] !== l ? (u = /* @__PURE__ */ r(n, {
11
+ return o[2] !== s || o[3] !== l ? (u = /* @__PURE__ */ r(t, {
13
12
  onClick: l,
14
13
  title: "Ruota documento",
15
14
  children: s
16
- }), a[2] = s, a[3] = l, a[4] = u) : u = a[4], u;
15
+ }), o[2] = s, o[3] = l, o[4] = u) : u = o[4], u;
17
16
  }
18
- function o(e) {
17
+ function a(e) {
19
18
  return (e + 90) % 360;
20
19
  }
21
20
  //#endregion
22
- export { a as PDFRotationControl };
21
+ export { i as PDFRotationControl };
@@ -1,19 +1,18 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { useTextSearch as n } from "../../hooks/useTextSearch.js";
4
- import r from "./PDFSearch.module.js";
5
- import { useEffect as i, useState as a } from "react";
2
+ import { useTextSearch as t } from "../../hooks/useTextSearch.js";
3
+ import n from "./PDFSearch.module.js";
4
+ import { useEffect as r, useState as i } from "react";
5
+ import { c as a } from "react/compiler-runtime";
6
6
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  //#region src/components/features/PDFSearch.tsx
8
- var l = t();
9
- function u(t) {
10
- let u = (0, l.c)(33), { searchIcon: d, prevIcon: f, nextIcon: p, clearIcon: m } = t, { pdf: h, goToPage: g, setHighlight: _, setSearchMatches: v } = e(), [y, b] = a(""), [x, S] = a(0), C;
8
+ function l(l) {
9
+ let u = a(33), { searchIcon: d, prevIcon: f, nextIcon: p, clearIcon: m } = l, { pdf: h, goToPage: g, setHighlight: _, setSearchMatches: v } = e(), [y, b] = i(""), [x, S] = i(0), C;
11
10
  u[0] !== h || u[1] !== y ? (C = {
12
11
  pdf: h,
13
12
  query: y
14
13
  }, u[0] = h, u[1] = y, u[2] = C) : C = u[2];
15
- let { matches: w, searching: T } = n(C), E = w.length, D, O;
16
- u[3] !== w || u[4] !== v ? (D = () => (v(w), () => v([])), O = [w, v], u[3] = w, u[4] = v, u[5] = D, u[6] = O) : (D = u[5], O = u[6]), i(D, O);
14
+ let { matches: w, searching: T } = t(C), E = w.length, D, O;
15
+ u[3] !== w || u[4] !== v ? (D = () => (v(w), () => v([])), O = [w, v], u[3] = w, u[4] = v, u[5] = D, u[6] = O) : (D = u[5], O = u[6]), r(D, O);
17
16
  let k;
18
17
  u[7] !== g || u[8] !== w || u[9] !== _ || u[10] !== E ? (k = (e) => {
19
18
  let t = (e + E) % E;
@@ -34,7 +33,7 @@ function u(t) {
34
33
  }, u[14] = _, u[15] = N);
35
34
  let P = N, F;
36
35
  u[16] !== M || u[17] !== y ? (F = /* @__PURE__ */ s("input", {
37
- className: r.searchInput,
36
+ className: n.searchInput,
38
37
  value: y,
39
38
  onChange: M,
40
39
  placeholder: "Cerca nel documento..."
@@ -42,30 +41,30 @@ function u(t) {
42
41
  let I;
43
42
  u[19] !== m || u[20] !== P || u[21] !== x || u[22] !== A || u[23] !== p || u[24] !== f || u[25] !== y || u[26] !== T || u[27] !== E ? (I = y && /* @__PURE__ */ c(o, { children: [
44
43
  /* @__PURE__ */ s("span", {
45
- className: r.counter,
44
+ className: n.counter,
46
45
  children: T ? "…" : E === 0 ? "0" : `${x + 1}/${E}`
47
46
  }),
48
47
  /* @__PURE__ */ s("button", {
49
- className: r.navButton,
48
+ className: n.navButton,
50
49
  onClick: () => A(x - 1),
51
50
  disabled: E === 0,
52
51
  children: f
53
52
  }),
54
53
  /* @__PURE__ */ s("button", {
55
- className: r.navButton,
54
+ className: n.navButton,
56
55
  onClick: () => A(x + 1),
57
56
  disabled: E === 0,
58
57
  children: p
59
58
  }),
60
59
  /* @__PURE__ */ s("button", {
61
- className: r.navButton,
60
+ className: n.navButton,
62
61
  onClick: P,
63
62
  children: m
64
63
  })
65
64
  ] }), u[19] = m, u[20] = P, u[21] = x, u[22] = A, u[23] = p, u[24] = f, u[25] = y, u[26] = T, u[27] = E, u[28] = I) : I = u[28];
66
65
  let L;
67
66
  return u[29] !== d || u[30] !== F || u[31] !== I ? (L = /* @__PURE__ */ c("div", {
68
- className: r.wrapper,
67
+ className: n.wrapper,
69
68
  children: [
70
69
  d,
71
70
  F,
@@ -74,4 +73,4 @@ function u(t) {
74
73
  }), u[29] = d, u[30] = F, u[31] = I, u[32] = L) : L = u[32], L;
75
74
  }
76
75
  //#endregion
77
- export { u as PDFSearch };
76
+ export { l as PDFSearch };
@@ -1,78 +1,77 @@
1
1
  import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
2
- import { require_compiler_runtime as t } from "../../node_modules/react/compiler-runtime.js";
3
- import { useSignatures as n } from "../../hooks/useSignatures.js";
4
- import r from "./PDFSignatures.module.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
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  //#region src/components/features/PDFSignatures.tsx
7
- var o = t();
8
- function s(e) {
7
+ function o(e) {
9
8
  if (!e) return;
10
9
  let t = e.match(/D:(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?/);
11
10
  if (!t) return e;
12
11
  let [, n, r, i, a = "00", o = "00"] = t;
13
12
  return `${i}/${r}/${n} ${a}:${o}`;
14
13
  }
15
- function c(e) {
16
- let t = (0, o.c)(31), { sig: n, onClick: c } = e, l = `${r.card} ${n.signed ? r.cardSigned : ""} ${n.rect ? r.cardClickable : ""}`, u = `${r.statusDot} ${n.signed ? r.statusDotSigned : ""}`, d = n.signed ? "✓" : "○", f;
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;
17
16
  t[0] !== u || t[1] !== d ? (f = /* @__PURE__ */ i("div", {
18
17
  className: u,
19
18
  children: d
20
19
  }), t[0] = u, t[1] = d, t[2] = f) : f = t[2];
21
- let p = `${r.statusLabel} ${n.signed ? r.statusLabelSigned : ""}`, m = n.signed ? "Firmato" : "Non firmato", h;
20
+ let p = `${n.statusLabel} ${s.signed ? n.statusLabelSigned : ""}`, m = s.signed ? "Firmato" : "Non firmato", h;
22
21
  t[3] !== p || t[4] !== m ? (h = /* @__PURE__ */ i("span", {
23
22
  className: p,
24
23
  children: m
25
24
  }), t[3] = p, t[4] = m, t[5] = h) : h = t[5];
26
25
  let g;
27
26
  t[6] !== f || t[7] !== h ? (g = /* @__PURE__ */ a("div", {
28
- className: r.cardHeader,
27
+ className: n.cardHeader,
29
28
  children: [f, h]
30
29
  }), t[6] = f, t[7] = h, t[8] = g) : g = t[8];
31
30
  let _;
32
31
  t[9] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ i("span", {
33
- className: r.fieldLabel,
32
+ className: n.fieldLabel,
34
33
  children: "Campo: "
35
34
  }), t[9] = _) : _ = t[9];
36
35
  let v;
37
- t[10] === n.fieldName ? v = t[11] : (v = /* @__PURE__ */ a("div", {
38
- className: r.fieldRow,
39
- children: [_, n.fieldName]
40
- }), t[10] = n.fieldName, t[11] = 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);
41
40
  let y;
42
- t[12] === n.signerName ? y = t[13] : (y = n.signerName && /* @__PURE__ */ a("div", {
43
- className: r.fieldRow,
41
+ t[12] === s.signerName ? y = t[13] : (y = s.signerName && /* @__PURE__ */ a("div", {
42
+ className: n.fieldRow,
44
43
  children: [/* @__PURE__ */ i("span", {
45
- className: r.fieldLabel,
44
+ className: n.fieldLabel,
46
45
  children: "Firmatario: "
47
- }), n.signerName]
48
- }), t[12] = n.signerName, t[13] = y);
46
+ }), s.signerName]
47
+ }), t[12] = s.signerName, t[13] = y);
49
48
  let b;
50
- t[14] === n.signDate ? b = t[15] : (b = n.signDate && /* @__PURE__ */ a("div", {
51
- className: r.fieldRow,
49
+ t[14] === s.signDate ? b = t[15] : (b = s.signDate && /* @__PURE__ */ a("div", {
50
+ className: n.fieldRow,
52
51
  children: [/* @__PURE__ */ i("span", {
53
- className: r.fieldLabel,
52
+ className: n.fieldLabel,
54
53
  children: "Data: "
55
- }), s(n.signDate)]
56
- }), t[14] = n.signDate, t[15] = b);
54
+ }), o(s.signDate)]
55
+ }), t[14] = s.signDate, t[15] = b);
57
56
  let x;
58
- t[16] === n.reason ? x = t[17] : (x = n.reason && /* @__PURE__ */ a("div", {
59
- className: r.fieldRow,
57
+ t[16] === s.reason ? x = t[17] : (x = s.reason && /* @__PURE__ */ a("div", {
58
+ className: n.fieldRow,
60
59
  children: [/* @__PURE__ */ i("span", {
61
- className: r.fieldLabel,
60
+ className: n.fieldLabel,
62
61
  children: "Motivo: "
63
- }), n.reason]
64
- }), t[16] = n.reason, t[17] = x);
62
+ }), s.reason]
63
+ }), t[16] = s.reason, t[17] = x);
65
64
  let S;
66
- t[18] === n.location ? S = t[19] : (S = n.location && /* @__PURE__ */ a("div", {
67
- className: r.fieldRow,
65
+ t[18] === s.location ? S = t[19] : (S = s.location && /* @__PURE__ */ a("div", {
66
+ className: n.fieldRow,
68
67
  children: [/* @__PURE__ */ i("span", {
69
- className: r.fieldLabel,
68
+ className: n.fieldLabel,
70
69
  children: "Luogo: "
71
- }), n.location]
72
- }), t[18] = n.location, t[19] = S);
70
+ }), s.location]
71
+ }), t[18] = s.location, t[19] = S);
73
72
  let C;
74
73
  t[20] !== v || t[21] !== y || t[22] !== b || t[23] !== x || t[24] !== S ? (C = /* @__PURE__ */ a("div", {
75
- className: r.fieldList,
74
+ className: n.fieldList,
76
75
  children: [
77
76
  v,
78
77
  y,
@@ -88,46 +87,46 @@ function c(e) {
88
87
  children: [g, C]
89
88
  }), t[26] = c, t[27] = l, t[28] = C, t[29] = g, t[30] = w) : w = t[30], w;
90
89
  }
91
- function l() {
92
- let t = (0, o.c)(22), { pdf: s, goToPage: l, setHighlight: u } = e(), d;
93
- t[0] === s ? d = t[1] : (d = { pdf: s }, t[0] = s, t[1] = d);
94
- let { signatures: f, loading: p } = n(d), m;
95
- t[2] !== l || t[3] !== u ? (m = (e) => {
90
+ function c() {
91
+ let o = r(22), { pdf: c, goToPage: l, setHighlight: u } = e(), d;
92
+ o[0] === c ? d = o[1] : (d = { pdf: c }, o[0] = c, o[1] = d);
93
+ let { signatures: f, loading: p } = t(d), m;
94
+ o[2] !== l || o[3] !== u ? (m = (e) => {
96
95
  l(e.page), e.rect && u({
97
96
  page: e.page,
98
97
  pdfRect: e.rect
99
98
  });
100
- }, t[2] = l, t[3] = u, t[4] = m) : m = t[4];
99
+ }, o[2] = l, o[3] = u, o[4] = m) : m = o[4];
101
100
  let h = m, g;
102
- t[5] === p ? g = t[6] : (g = p && /* @__PURE__ */ i("div", {
103
- className: r.emptyState,
101
+ o[5] === p ? g = o[6] : (g = p && /* @__PURE__ */ i("div", {
102
+ className: n.emptyState,
104
103
  children: "Caricamento..."
105
- }), t[5] = p, t[6] = g);
104
+ }), o[5] = p, o[6] = g);
106
105
  let _;
107
- t[7] !== p || t[8] !== f ? (_ = !p && f.length === 0 && /* @__PURE__ */ i("div", {
108
- className: r.emptyState,
106
+ o[7] !== p || o[8] !== f ? (_ = !p && f.length === 0 && /* @__PURE__ */ i("div", {
107
+ className: n.emptyState,
109
108
  children: "Nessuna firma rilevata."
110
- }), t[7] = p, t[8] = f, t[9] = _) : _ = t[9];
109
+ }), o[7] = p, o[8] = f, o[9] = _) : _ = o[9];
111
110
  let v;
112
- t[10] !== h || t[11] !== p || t[12] !== f ? (v = !p && f.map((e, t) => /* @__PURE__ */ i(c, {
111
+ o[10] !== h || o[11] !== p || o[12] !== f ? (v = !p && f.map((e, t) => /* @__PURE__ */ i(s, {
113
112
  sig: e,
114
113
  onClick: () => h(e)
115
- }, t)), t[10] = h, t[11] = p, t[12] = f, t[13] = v) : v = t[13];
114
+ }, t)), o[10] = h, o[11] = p, o[12] = f, o[13] = v) : v = o[13];
116
115
  let y;
117
- t[14] !== p || t[15] !== f ? (y = !p && f.length > 0 && /* @__PURE__ */ i("div", {
118
- className: r.disclaimer,
116
+ o[14] !== p || o[15] !== f ? (y = !p && f.length > 0 && /* @__PURE__ */ i("div", {
117
+ className: n.disclaimer,
119
118
  children: "La presenza del campo firma non garantisce la validità crittografica."
120
- }), t[14] = p, t[15] = f, t[16] = y) : y = t[16];
119
+ }), o[14] = p, o[15] = f, o[16] = y) : y = o[16];
121
120
  let b;
122
- return t[17] !== g || t[18] !== _ || t[19] !== v || t[20] !== y ? (b = /* @__PURE__ */ a("div", {
123
- className: r.list,
121
+ return o[17] !== g || o[18] !== _ || o[19] !== v || o[20] !== y ? (b = /* @__PURE__ */ a("div", {
122
+ className: n.list,
124
123
  children: [
125
124
  g,
126
125
  _,
127
126
  v,
128
127
  y
129
128
  ]
130
- }), t[17] = g, t[18] = _, t[19] = v, t[20] = y, t[21] = b) : b = t[21], b;
129
+ }), o[17] = g, o[18] = _, o[19] = v, o[20] = y, o[21] = b) : b = o[21], b;
131
130
  }
132
131
  //#endregion
133
- export { l as PDFSignatures };
132
+ export { c as PDFSignatures };
@@ -1,17 +1,16 @@
1
- import { require_compiler_runtime as e } from "../../node_modules/react/compiler-runtime.js";
2
- import { useTheme as t } from "../../context/ThemeContext.js";
3
- import { ToolbarButton as n } from "../ui/ToolbarButton.js";
1
+ import { useTheme as e } from "../../context/ThemeContext.js";
2
+ import { ToolbarButton as t } from "../ui/ToolbarButton.js";
4
3
  import "react";
4
+ import { c as n } from "react/compiler-runtime";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/features/PDFThemeToggle.tsx
7
- var i = e();
8
- function a(e) {
9
- let a = (0, i.c)(4), { lightIcon: o, darkIcon: s } = e, { isDark: c, toggleTheme: l } = t(), u = c ? "Switch to light mode" : "Switch to dark mode", d = c ? o : s, f;
10
- return a[0] !== u || a[1] !== d || a[2] !== l ? (f = /* @__PURE__ */ r(n, {
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, {
11
10
  onClick: l,
12
11
  title: u,
13
12
  children: d
14
13
  }), a[0] = u, a[1] = d, a[2] = l, a[3] = f) : f = a[3], f;
15
14
  }
16
15
  //#endregion
17
- export { a as PDFThemeToggle };
16
+ export { i as PDFThemeToggle };