pdf-tsx 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/cjs/components/PDFSidebar.cjs +1 -1
- package/dist/cjs/components/PDFSidebar.module.cjs +1 -1
- package/dist/cjs/components/PDFViewer.cjs +1 -1
- package/dist/cjs/components/PDFViewer.module.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
- package/dist/cjs/components/features/PDFAttachments.cjs +1 -1
- package/dist/cjs/components/features/PDFAttachments.module.cjs +1 -1
- package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
- package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
- package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
- package/dist/cjs/components/features/PDFOutline.cjs +1 -1
- package/dist/cjs/components/features/PDFOutline.module.cjs +1 -1
- package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
- package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
- package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
- package/dist/cjs/components/features/PDFSearch.cjs +1 -1
- package/dist/cjs/components/features/PDFSearch.module.cjs +1 -1
- package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -1
- package/dist/cjs/components/features/PDFSignatures.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/features/PDFZoomControls.module.cjs +1 -1
- package/dist/cjs/components/ui/PDFToolbar.cjs +1 -1
- package/dist/cjs/components/ui/PDFToolbar.module.cjs +1 -1
- package/dist/cjs/components/ui/PDFToolbarItem.cjs +1 -1
- package/dist/cjs/components/ui/PDFToolbarSeparator.cjs +1 -0
- package/dist/cjs/components/ui/PDFToolbarSeparator.module.cjs +1 -0
- package/dist/cjs/components/ui/ToolbarButton.cjs +1 -1
- package/dist/cjs/components/ui/ToolbarButton.module.cjs +1 -1
- package/dist/cjs/components/ui/icons.cjs +1 -1
- package/dist/cjs/context/ThemeContext.cjs +1 -1
- package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
- package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
- package/dist/cjs/hooks/useOutline.cjs +1 -1
- package/dist/cjs/hooks/useOverlayRects.cjs +1 -1
- package/dist/cjs/hooks/usePDFLoader.cjs +1 -1
- 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/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/features/PDFSearch.d.ts +1 -1
- package/dist/components/features/PDFSidebarToggle.d.ts +1 -1
- package/dist/components/features/PDFZoomControls.d.ts +1 -1
- package/dist/components/ui/PDFToolbarSeparator.d.ts +1 -0
- package/dist/context/ThemeContext.d.ts +1 -1
- package/dist/es/components/PDFSidebar.js +25 -39
- package/dist/es/components/PDFSidebar.module.js +9 -9
- package/dist/es/components/PDFViewer.js +213 -253
- package/dist/es/components/PDFViewer.module.js +16 -15
- package/dist/es/components/features/PDFAnnotations.js +54 -62
- package/dist/es/components/features/PDFAnnotations.module.js +12 -12
- package/dist/es/components/features/PDFAttachments.js +52 -70
- package/dist/es/components/features/PDFAttachments.module.js +8 -8
- package/dist/es/components/features/PDFChangeFile.js +13 -24
- package/dist/es/components/features/PDFDownloadButton.js +10 -13
- package/dist/es/components/features/PDFNavigation.js +38 -59
- package/dist/es/components/features/PDFNavigation.module.js +3 -3
- package/dist/es/components/features/PDFOutline.js +66 -83
- package/dist/es/components/features/PDFOutline.module.js +5 -5
- package/dist/es/components/features/PDFPageFit.js +18 -23
- package/dist/es/components/features/PDFPrintButton.js +14 -17
- package/dist/es/components/features/PDFRotationControl.js +7 -13
- package/dist/es/components/features/PDFSearch.js +60 -69
- package/dist/es/components/features/PDFSearch.module.js +5 -5
- package/dist/es/components/features/PDFSidebarToggle.js +8 -13
- package/dist/es/components/features/PDFSignatures.js +116 -139
- package/dist/es/components/features/PDFSignatures.module.js +16 -16
- package/dist/es/components/features/PDFThemeToggle.js +10 -11
- package/dist/es/components/features/PDFThumbnails.js +25 -34
- package/dist/es/components/features/PDFThumbnails.module.js +9 -9
- package/dist/es/components/features/PDFZoomControls.js +21 -36
- package/dist/es/components/features/PDFZoomControls.module.js +1 -1
- package/dist/es/components/ui/PDFToolbar.js +53 -83
- package/dist/es/components/ui/PDFToolbar.module.js +9 -9
- package/dist/es/components/ui/PDFToolbarItem.js +10 -19
- package/dist/es/components/ui/PDFToolbarSeparator.js +13 -0
- package/dist/es/components/ui/PDFToolbarSeparator.module.js +3 -0
- package/dist/es/components/ui/ToolbarButton.js +8 -11
- package/dist/es/components/ui/ToolbarButton.module.js +2 -2
- package/dist/es/components/ui/icons.js +5 -16
- package/dist/es/context/ThemeContext.js +28 -38
- package/dist/es/hooks/useAnnotationLayer.js +33 -42
- package/dist/es/hooks/useKeyboardShortcuts.js +25 -34
- package/dist/es/hooks/useOutline.js +18 -23
- package/dist/es/hooks/useOverlayRects.js +42 -51
- package/dist/es/hooks/usePDFLoader.js +17 -16
- package/dist/es/hooks/useScrollTracking.js +24 -25
- package/dist/es/hooks/useTextLayer.js +34 -43
- package/dist/es/hooks/useTextSearch.js +31 -38
- package/dist/es/hooks/useThumbnails.js +33 -44
- package/dist/es/index.js +2 -1
- package/dist/es/pdf-tsx.css +1 -1
- package/dist/es/theme.js +6 -3
- package/dist/hooks/useAttachments.d.ts +1 -1
- package/dist/hooks/useOutline.d.ts +1 -1
- package/dist/hooks/useOverlayRects.d.ts +1 -1
- package/dist/hooks/usePDFLoader.d.ts +1 -0
- package/dist/hooks/usePDFRenderer.d.ts +1 -1
- package/dist/hooks/useSignatures.d.ts +1 -1
- package/dist/hooks/useThumbnails.d.ts +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/theme.d.ts +1 -0
- package/package.json +3 -3
|
@@ -2,10 +2,10 @@ import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
|
2
2
|
import { computeFit as t } from "../../utils/pdfFit.js";
|
|
3
3
|
import { useAnnotations as n } from "../../hooks/useAnnotations.js";
|
|
4
4
|
import r from "./PDFAnnotations.module.js";
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
5
|
+
import { memo as i, useCallback as a, useMemo as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/features/PDFAnnotations.tsx
|
|
8
|
-
var
|
|
8
|
+
var l = {
|
|
9
9
|
Text: "Nota",
|
|
10
10
|
Highlight: "Evidenziazione",
|
|
11
11
|
Underline: "Sottolineatura",
|
|
@@ -17,85 +17,77 @@ var s = {
|
|
|
17
17
|
Line: "Linea",
|
|
18
18
|
Stamp: "Timbro",
|
|
19
19
|
FileAttachment: "Allegato"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children: l
|
|
26
|
-
}), t[0] = l, t[1] = d);
|
|
27
|
-
let f;
|
|
28
|
-
t[2] === n.page ? f = t[3] : (f = /* @__PURE__ */ o("span", {
|
|
29
|
-
className: r.cardPage,
|
|
30
|
-
children: ["p.", n.page]
|
|
31
|
-
}), t[2] = n.page, t[3] = f);
|
|
32
|
-
let p;
|
|
33
|
-
t[4] !== d || t[5] !== f ? (p = /* @__PURE__ */ o("div", {
|
|
34
|
-
className: r.cardHeader,
|
|
35
|
-
children: [d, f]
|
|
36
|
-
}), t[4] = d, t[5] = f, t[6] = p) : p = t[6];
|
|
37
|
-
let m;
|
|
38
|
-
t[7] === n.title ? m = t[8] : (m = n.title && /* @__PURE__ */ a("div", {
|
|
39
|
-
className: r.cardAuthor,
|
|
40
|
-
children: n.title
|
|
41
|
-
}), t[7] = n.title, t[8] = m);
|
|
42
|
-
let h;
|
|
43
|
-
t[9] === n.contents ? h = t[10] : (h = n.contents && /* @__PURE__ */ a("div", {
|
|
44
|
-
className: r.cardContent,
|
|
45
|
-
children: n.contents
|
|
46
|
-
}), t[9] = n.contents, t[10] = h);
|
|
47
|
-
let g;
|
|
48
|
-
return t[11] !== c || t[12] !== u || t[13] !== p || t[14] !== m || t[15] !== h ? (g = /* @__PURE__ */ o("div", {
|
|
49
|
-
className: u,
|
|
50
|
-
onClick: c,
|
|
20
|
+
}, u = i(function({ ann: e, onNavigate: t }) {
|
|
21
|
+
let n = l[e.subtype] ?? e.subtype, i = a(() => t(e), [t, e]);
|
|
22
|
+
return /* @__PURE__ */ c("div", {
|
|
23
|
+
className: `${r.card} ${e.rect ? r.cardClickable : ""}`,
|
|
24
|
+
onClick: i,
|
|
51
25
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
26
|
+
/* @__PURE__ */ c("div", {
|
|
27
|
+
className: r.cardHeader,
|
|
28
|
+
children: [/* @__PURE__ */ s("span", {
|
|
29
|
+
className: r.cardLabel,
|
|
30
|
+
children: n
|
|
31
|
+
}), /* @__PURE__ */ c("span", {
|
|
32
|
+
className: r.cardPage,
|
|
33
|
+
children: ["p.", e.page]
|
|
34
|
+
})]
|
|
35
|
+
}),
|
|
36
|
+
e.title && /* @__PURE__ */ s("div", {
|
|
37
|
+
className: r.cardAuthor,
|
|
38
|
+
children: e.title
|
|
39
|
+
}),
|
|
40
|
+
e.contents && /* @__PURE__ */ s("div", {
|
|
41
|
+
className: r.cardContent,
|
|
42
|
+
children: e.contents
|
|
43
|
+
})
|
|
55
44
|
]
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
function
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
let { annotations: d, loading: f } = n(u), p = d.length, m;
|
|
62
|
-
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ a("span", {
|
|
63
|
-
className: r.badge,
|
|
64
|
-
children: p > 99 ? "99+" : p
|
|
65
|
-
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
66
|
-
let h;
|
|
67
|
-
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ o("span", {
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
function d({ icon: t }) {
|
|
48
|
+
let { pdf: i } = e(), { annotations: a, loading: o } = n({ pdf: i }), l = a.length;
|
|
49
|
+
return /* @__PURE__ */ c("span", {
|
|
68
50
|
className: r.iconWrapper,
|
|
69
|
-
children: [
|
|
70
|
-
|
|
51
|
+
children: [t, !o && l > 0 && /* @__PURE__ */ s("span", {
|
|
52
|
+
className: r.badge,
|
|
53
|
+
children: l > 99 ? "99+" : l
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
71
56
|
}
|
|
72
|
-
function
|
|
73
|
-
let { pdf: i, goToPage:
|
|
74
|
-
i &&
|
|
57
|
+
function f() {
|
|
58
|
+
let { pdf: i, goToPage: l, setHighlight: d, setZoom: f, rotation: p, containerRef: m } = e(), { annotations: h, loading: g } = n({ pdf: i }), _ = a(async (e) => {
|
|
59
|
+
i && m.current && f(await t("page", i, m.current, p)), l(e.page), e.rect && d({
|
|
75
60
|
page: e.page,
|
|
76
61
|
pdfRect: e.rect
|
|
77
62
|
});
|
|
78
|
-
},
|
|
79
|
-
|
|
63
|
+
}, [
|
|
64
|
+
i,
|
|
65
|
+
m,
|
|
66
|
+
p,
|
|
67
|
+
l,
|
|
68
|
+
f,
|
|
69
|
+
d
|
|
70
|
+
]), v = o(() => h.reduce((e, t) => ((e[t.page] ??= []).push(t), e), {}), [h]);
|
|
71
|
+
return /* @__PURE__ */ c("div", {
|
|
80
72
|
className: r.list,
|
|
81
73
|
children: [
|
|
82
|
-
|
|
74
|
+
g && /* @__PURE__ */ s("div", {
|
|
83
75
|
className: r.emptyState,
|
|
84
76
|
children: "Caricamento..."
|
|
85
77
|
}),
|
|
86
|
-
!
|
|
78
|
+
!g && h.length === 0 && /* @__PURE__ */ s("div", {
|
|
87
79
|
className: r.emptyState,
|
|
88
80
|
children: "Nessuna annotazione rilevata."
|
|
89
81
|
}),
|
|
90
|
-
!
|
|
82
|
+
!g && Object.entries(v).map(([e, t]) => /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("div", {
|
|
91
83
|
className: r.pageHeader,
|
|
92
84
|
children: ["Pagina ", e]
|
|
93
|
-
}), t.map((e) => /* @__PURE__ */
|
|
85
|
+
}), t.map((e) => /* @__PURE__ */ s(u, {
|
|
94
86
|
ann: e,
|
|
95
|
-
|
|
87
|
+
onNavigate: _
|
|
96
88
|
}, e.id))] }, e))
|
|
97
89
|
]
|
|
98
90
|
});
|
|
99
91
|
}
|
|
100
92
|
//#endregion
|
|
101
|
-
export {
|
|
93
|
+
export { f as PDFAnnotations, d as PDFAnnotationsIcon };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
list: "
|
|
3
|
-
emptyState: "
|
|
4
|
-
pageHeader: "
|
|
5
|
-
card: "
|
|
6
|
-
cardClickable: "
|
|
7
|
-
cardHeader: "
|
|
8
|
-
cardLabel: "
|
|
9
|
-
cardPage: "
|
|
10
|
-
cardAuthor: "
|
|
11
|
-
cardContent: "
|
|
12
|
-
iconWrapper: "
|
|
13
|
-
badge: "
|
|
2
|
+
list: "_list_113xr_1",
|
|
3
|
+
emptyState: "_emptyState_113xr_6",
|
|
4
|
+
pageHeader: "_pageHeader_113xr_12",
|
|
5
|
+
card: "_card_113xr_23",
|
|
6
|
+
cardClickable: "_cardClickable_113xr_33",
|
|
7
|
+
cardHeader: "_cardHeader_113xr_41",
|
|
8
|
+
cardLabel: "_cardLabel_113xr_48",
|
|
9
|
+
cardPage: "_cardPage_113xr_54",
|
|
10
|
+
cardAuthor: "_cardAuthor_113xr_59",
|
|
11
|
+
cardContent: "_cardContent_113xr_65",
|
|
12
|
+
iconWrapper: "_iconWrapper_113xr_71",
|
|
13
|
+
badge: "_badge_113xr_78"
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
export { e as default };
|
|
@@ -1,117 +1,99 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { useAttachments as t } from "../../hooks/useAttachments.js";
|
|
3
3
|
import n from "./PDFAttachments.module.js";
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/features/PDFAttachments.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
6
|
+
function a() {
|
|
7
|
+
return /* @__PURE__ */ i("svg", {
|
|
10
8
|
width: "13",
|
|
11
9
|
height: "13",
|
|
12
10
|
viewBox: "0 0 13 13",
|
|
13
11
|
fill: "none",
|
|
14
12
|
"aria-hidden": !0,
|
|
15
|
-
children: [/* @__PURE__ */
|
|
13
|
+
children: [/* @__PURE__ */ r("path", {
|
|
16
14
|
d: "M6.5 1.5v7M3.5 6l3 3 3-3",
|
|
17
15
|
stroke: "currentColor",
|
|
18
16
|
strokeWidth: "1.5",
|
|
19
17
|
strokeLinecap: "round",
|
|
20
18
|
strokeLinejoin: "round"
|
|
21
|
-
}), /* @__PURE__ */
|
|
19
|
+
}), /* @__PURE__ */ r("path", {
|
|
22
20
|
d: "M1.5 10.5h10",
|
|
23
21
|
stroke: "currentColor",
|
|
24
22
|
strokeWidth: "1.5",
|
|
25
23
|
strokeLinecap: "round"
|
|
26
24
|
})]
|
|
27
|
-
})
|
|
25
|
+
});
|
|
28
26
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
27
|
+
function o() {
|
|
28
|
+
return /* @__PURE__ */ i("svg", {
|
|
32
29
|
width: "14",
|
|
33
30
|
height: "14",
|
|
34
31
|
viewBox: "0 0 14 14",
|
|
35
32
|
fill: "none",
|
|
36
33
|
"aria-hidden": !0,
|
|
37
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ r("path", {
|
|
38
35
|
d: "M3 1.5h5.5L11 4v8.5H3V1.5z",
|
|
39
36
|
stroke: "currentColor",
|
|
40
37
|
strokeWidth: "1.2",
|
|
41
38
|
strokeLinejoin: "round"
|
|
42
|
-
}), /* @__PURE__ */
|
|
39
|
+
}), /* @__PURE__ */ r("path", {
|
|
43
40
|
d: "M8.5 1.5V4H11",
|
|
44
41
|
stroke: "currentColor",
|
|
45
42
|
strokeWidth: "1.2",
|
|
46
43
|
strokeLinejoin: "round"
|
|
47
44
|
})]
|
|
48
|
-
})
|
|
45
|
+
});
|
|
49
46
|
}
|
|
50
|
-
function
|
|
47
|
+
function s(e) {
|
|
51
48
|
let t = new Blob([new Uint8Array(e.content)]), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
52
49
|
r.href = n, r.download = e.filename, r.click(), URL.revokeObjectURL(n);
|
|
53
50
|
}
|
|
54
|
-
function
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
let { attachments: d, loading: f } = t(u), p = d.length, m;
|
|
58
|
-
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ i("span", {
|
|
59
|
-
className: n.badge,
|
|
60
|
-
children: p > 99 ? "99+" : p
|
|
61
|
-
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
62
|
-
let h;
|
|
63
|
-
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ a("span", {
|
|
51
|
+
function c({ icon: a }) {
|
|
52
|
+
let { pdf: o } = e(), { attachments: s, loading: c } = t({ pdf: o }), l = s.length;
|
|
53
|
+
return /* @__PURE__ */ i("span", {
|
|
64
54
|
className: n.iconWrapper,
|
|
65
|
-
children: [c,
|
|
66
|
-
|
|
55
|
+
children: [a, !c && l > 0 && /* @__PURE__ */ r("span", {
|
|
56
|
+
className: n.badge,
|
|
57
|
+
children: l > 99 ? "99+" : l
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
67
60
|
}
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
let { attachments: l, loading: u } = t(c), f;
|
|
72
|
-
o[2] === u ? f = o[3] : (f = u && /* @__PURE__ */ i("div", {
|
|
73
|
-
className: n.emptyState,
|
|
74
|
-
children: "Caricamento..."
|
|
75
|
-
}), o[2] = u, o[3] = f);
|
|
76
|
-
let p;
|
|
77
|
-
o[4] !== l || o[5] !== u ? (p = !u && l.length === 0 && /* @__PURE__ */ i("div", {
|
|
78
|
-
className: n.emptyState,
|
|
79
|
-
children: "Nessun allegato rilevato."
|
|
80
|
-
}), o[4] = l, o[5] = u, o[6] = p) : p = o[6];
|
|
81
|
-
let m;
|
|
82
|
-
o[7] !== l || o[8] !== u ? (m = !u && l.map(d), o[7] = l, o[8] = u, o[9] = m) : m = o[9];
|
|
83
|
-
let h;
|
|
84
|
-
return o[10] !== f || o[11] !== p || o[12] !== m ? (h = /* @__PURE__ */ a("div", {
|
|
61
|
+
function l() {
|
|
62
|
+
let { pdf: c } = e(), { attachments: l, loading: u } = t({ pdf: c });
|
|
63
|
+
return /* @__PURE__ */ i("div", {
|
|
85
64
|
className: n.list,
|
|
86
65
|
children: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
]
|
|
91
|
-
}), o[10] = f, o[11] = p, o[12] = m, o[13] = h) : h = o[13], h;
|
|
92
|
-
}
|
|
93
|
-
function d(e, t) {
|
|
94
|
-
return /* @__PURE__ */ a("div", {
|
|
95
|
-
className: n.card,
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ i("span", {
|
|
98
|
-
className: n.fileIcon,
|
|
99
|
-
children: /* @__PURE__ */ i(s, {})
|
|
66
|
+
u && /* @__PURE__ */ r("div", {
|
|
67
|
+
className: n.emptyState,
|
|
68
|
+
children: "Caricamento..."
|
|
100
69
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
className: n.
|
|
103
|
-
|
|
104
|
-
children: e.filename
|
|
70
|
+
!u && l.length === 0 && /* @__PURE__ */ r("div", {
|
|
71
|
+
className: n.emptyState,
|
|
72
|
+
children: "Nessun allegato rilevato."
|
|
105
73
|
}),
|
|
106
|
-
/* @__PURE__ */ i("
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
74
|
+
!u && l.map((e, t) => /* @__PURE__ */ i("div", {
|
|
75
|
+
className: n.card,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ r("span", {
|
|
78
|
+
className: n.fileIcon,
|
|
79
|
+
children: /* @__PURE__ */ r(o, {})
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ r("span", {
|
|
82
|
+
className: n.filename,
|
|
83
|
+
title: e.filename,
|
|
84
|
+
children: e.filename
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ r("button", {
|
|
87
|
+
type: "button",
|
|
88
|
+
className: n.downloadBtn,
|
|
89
|
+
title: `Scarica ${e.filename}`,
|
|
90
|
+
onClick: () => s(e),
|
|
91
|
+
children: /* @__PURE__ */ r(a, {})
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}, t))
|
|
113
95
|
]
|
|
114
|
-
}
|
|
96
|
+
});
|
|
115
97
|
}
|
|
116
98
|
//#endregion
|
|
117
|
-
export {
|
|
99
|
+
export { l as PDFAttachments, c as PDFAttachmentsIcon };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
list: "
|
|
3
|
-
emptyState: "
|
|
4
|
-
card: "
|
|
5
|
-
fileIcon: "
|
|
6
|
-
filename: "
|
|
7
|
-
downloadBtn: "
|
|
8
|
-
iconWrapper: "
|
|
9
|
-
badge: "
|
|
2
|
+
list: "_list_12ybz_1",
|
|
3
|
+
emptyState: "_emptyState_12ybz_8",
|
|
4
|
+
card: "_card_12ybz_15",
|
|
5
|
+
fileIcon: "_fileIcon_12ybz_33",
|
|
6
|
+
filename: "_filename_12ybz_40",
|
|
7
|
+
downloadBtn: "_downloadBtn_12ybz_51",
|
|
8
|
+
iconWrapper: "_iconWrapper_12ybz_77",
|
|
9
|
+
badge: "_badge_12ybz_84"
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
12
|
export { e as default };
|
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as r } from "react";
|
|
3
|
+
import { useCallback as n, useRef as r } from "react";
|
|
5
4
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/features/PDFChangeFile.tsx
|
|
7
|
-
function s(s) {
|
|
8
|
-
let
|
|
9
|
-
c[0] === u ? f = c[1] : (f = (e) => {
|
|
6
|
+
function s({ icon: s }) {
|
|
7
|
+
let { onChangeFile: c } = e(), l = r(null), u = n((e) => {
|
|
10
8
|
let t = e.target.files?.[0];
|
|
11
|
-
t &&
|
|
12
|
-
}, c
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let h;
|
|
16
|
-
c[3] === p ? h = c[4] : (h = /* @__PURE__ */ a("input", {
|
|
17
|
-
ref: d,
|
|
9
|
+
t && c?.(t), e.target.value = "";
|
|
10
|
+
}, [c]), d = n(() => l.current?.click(), []);
|
|
11
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("input", {
|
|
12
|
+
ref: l,
|
|
18
13
|
type: "file",
|
|
19
14
|
accept: ".pdf",
|
|
20
|
-
style:
|
|
21
|
-
onChange:
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
c[5] === Symbol.for("react.memo_cache_sentinel") ? (g = () => d.current?.click(), c[5] = g) : g = c[5];
|
|
25
|
-
let _;
|
|
26
|
-
c[6] === l ? _ = c[7] : (_ = /* @__PURE__ */ a(t, {
|
|
27
|
-
onClick: g,
|
|
15
|
+
style: { display: "none" },
|
|
16
|
+
onChange: u
|
|
17
|
+
}), /* @__PURE__ */ a(t, {
|
|
18
|
+
onClick: d,
|
|
28
19
|
title: "Apri altro file",
|
|
29
|
-
children:
|
|
30
|
-
})
|
|
31
|
-
let v;
|
|
32
|
-
return c[8] !== h || c[9] !== _ ? (v = /* @__PURE__ */ o(i, { children: [h, _] }), c[8] = h, c[9] = _, c[10] = v) : v = c[10], v;
|
|
20
|
+
children: s
|
|
21
|
+
})] });
|
|
33
22
|
}
|
|
34
23
|
s.toolbarLabel = "Apri file";
|
|
35
24
|
//#endregion
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import "react";
|
|
3
|
+
import { useCallback as n } from "react";
|
|
5
4
|
import { jsxs as r } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/features/PDFDownloadButton.tsx
|
|
7
|
-
function i(i) {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let e = URL.createObjectURL(s), t = document.createElement("a");
|
|
11
|
-
t.href = e, t.download = s.name || "documento.pdf", t.click(), setTimeout(() => URL.revokeObjectURL(e), 0);
|
|
12
|
-
}, a[0] = s, a[1] = c);
|
|
13
|
-
let l = c, u;
|
|
14
|
-
return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(t, {
|
|
6
|
+
function i({ icon: i }) {
|
|
7
|
+
let { file: a } = e();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
15
9
|
$primary: !0,
|
|
16
|
-
onClick:
|
|
10
|
+
onClick: n(() => {
|
|
11
|
+
let e = URL.createObjectURL(a), t = document.createElement("a");
|
|
12
|
+
t.href = e, t.download = a.name || "documento.pdf", t.click(), setTimeout(() => URL.revokeObjectURL(e), 0);
|
|
13
|
+
}, [a]),
|
|
17
14
|
title: "Scarica PDF",
|
|
18
|
-
children: [
|
|
19
|
-
})
|
|
15
|
+
children: [i, "Scarica"]
|
|
16
|
+
});
|
|
20
17
|
}
|
|
21
18
|
i.toolbarLabel = "Scarica";
|
|
22
19
|
//#endregion
|
|
@@ -1,70 +1,49 @@
|
|
|
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 "./PDFNavigation.module.js";
|
|
4
|
-
import {
|
|
5
|
-
import { useState as i } from "react";
|
|
4
|
+
import { useCallback as r, useState as i } from "react";
|
|
6
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/features/PDFNavigation.tsx
|
|
8
|
-
function s(s) {
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onClick: b,
|
|
19
|
-
disabled: x,
|
|
20
|
-
title: "Pagina precedente (←)",
|
|
21
|
-
children: l
|
|
22
|
-
}), c[6] = l, c[7] = b, c[8] = x, c[9] = S) : S = c[9];
|
|
23
|
-
let C = m ? g : d, w;
|
|
24
|
-
c[10] === d ? w = c[11] : (w = () => {
|
|
25
|
-
h(!0), _(String(d));
|
|
26
|
-
}, c[10] = d, c[11] = w);
|
|
27
|
-
let T;
|
|
28
|
-
c[12] === Symbol.for("react.memo_cache_sentinel") ? (T = (e) => _(e.target.value), c[12] = T) : T = c[12];
|
|
29
|
-
let E;
|
|
30
|
-
c[13] === y ? E = c[14] : (E = (e) => {
|
|
31
|
-
e.key === "Enter" && y(), e.key === "Escape" && h(!1);
|
|
32
|
-
}, c[13] = y, c[14] = E);
|
|
33
|
-
let D;
|
|
34
|
-
c[15] !== y || c[16] !== C || c[17] !== w || c[18] !== E ? (D = /* @__PURE__ */ a("input", {
|
|
35
|
-
className: n.pageInput,
|
|
36
|
-
type: "number",
|
|
37
|
-
value: C,
|
|
38
|
-
onFocus: w,
|
|
39
|
-
onBlur: y,
|
|
40
|
-
onChange: T,
|
|
41
|
-
onKeyDown: E,
|
|
42
|
-
title: "Vai alla pagina"
|
|
43
|
-
}), c[15] = y, c[16] = C, c[17] = w, c[18] = E, c[19] = D) : D = c[19];
|
|
44
|
-
let O;
|
|
45
|
-
c[20] === f ? O = c[21] : (O = /* @__PURE__ */ o("span", {
|
|
46
|
-
className: n.pageTotal,
|
|
47
|
-
children: ["/ ", f]
|
|
48
|
-
}), c[20] = f, c[21] = O);
|
|
49
|
-
let k;
|
|
50
|
-
c[22] !== d || c[23] !== p ? (k = () => p(d + 1), c[22] = d, c[23] = p, c[24] = k) : k = c[24];
|
|
51
|
-
let A = d === f, j;
|
|
52
|
-
c[25] !== u || c[26] !== k || c[27] !== A ? (j = /* @__PURE__ */ a(t, {
|
|
53
|
-
onClick: k,
|
|
54
|
-
disabled: A,
|
|
55
|
-
title: "Pagina successiva (→)",
|
|
56
|
-
children: u
|
|
57
|
-
}), c[25] = u, c[26] = k, c[27] = A, c[28] = j) : j = c[28];
|
|
58
|
-
let M;
|
|
59
|
-
return c[29] !== O || c[30] !== j || c[31] !== S || c[32] !== D ? (M = /* @__PURE__ */ o("div", {
|
|
7
|
+
function s({ prevIcon: s, nextIcon: c }) {
|
|
8
|
+
let { currentPage: l, numPages: u, goToPage: d } = e(), [f, p] = i(!1), [m, h] = i(""), g = r(() => {
|
|
9
|
+
let e = parseInt(m, 10);
|
|
10
|
+
isNaN(e) || d(e), p(!1);
|
|
11
|
+
}, [m, d]), _ = r(() => {
|
|
12
|
+
p(!0), h(String(l));
|
|
13
|
+
}, [l]), v = r((e) => h(e.target.value), []), y = r((e) => {
|
|
14
|
+
e.key === "Enter" && g(), e.key === "Escape" && p(!1);
|
|
15
|
+
}, [g]), b = r(() => d(l - 1), [d, l]), x = r(() => d(l + 1), [d, l]);
|
|
16
|
+
return /* @__PURE__ */ o("div", {
|
|
60
17
|
className: n.navWrapper,
|
|
61
18
|
children: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
19
|
+
/* @__PURE__ */ a(t, {
|
|
20
|
+
onClick: b,
|
|
21
|
+
disabled: l === 1,
|
|
22
|
+
title: "Pagina precedente (←)",
|
|
23
|
+
children: s
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ a("input", {
|
|
26
|
+
className: n.pageInput,
|
|
27
|
+
type: "number",
|
|
28
|
+
value: f ? m : l,
|
|
29
|
+
onFocus: _,
|
|
30
|
+
onBlur: g,
|
|
31
|
+
onChange: v,
|
|
32
|
+
onKeyDown: y,
|
|
33
|
+
title: "Vai alla pagina"
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ o("span", {
|
|
36
|
+
className: n.pageTotal,
|
|
37
|
+
children: ["/ ", u]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ a(t, {
|
|
40
|
+
onClick: x,
|
|
41
|
+
disabled: l === u,
|
|
42
|
+
title: "Pagina successiva (→)",
|
|
43
|
+
children: c
|
|
44
|
+
})
|
|
66
45
|
]
|
|
67
|
-
})
|
|
46
|
+
});
|
|
68
47
|
}
|
|
69
48
|
s.toolbarLabel = "Pagina";
|
|
70
49
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
navWrapper: "
|
|
3
|
-
pageInput: "
|
|
4
|
-
pageTotal: "
|
|
2
|
+
navWrapper: "_navWrapper_14eo9_1",
|
|
3
|
+
pageInput: "_pageInput_14eo9_7",
|
|
4
|
+
pageTotal: "_pageTotal_14eo9_34"
|
|
5
5
|
};
|
|
6
6
|
//#endregion
|
|
7
7
|
export { e as default };
|