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,10 +1,11 @@
|
|
|
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 { useAnnotations as n } from "../../hooks/useAnnotations.js";
|
|
4
|
+
import r from "./PDFAnnotations.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/PDFAnnotations.tsx
|
|
7
|
-
var
|
|
8
|
+
var s = {
|
|
8
9
|
Text: "Nota",
|
|
9
10
|
Highlight: "Evidenziazione",
|
|
10
11
|
Underline: "Sottolineatura",
|
|
@@ -17,89 +18,81 @@ var o = {
|
|
|
17
18
|
Stamp: "Timbro",
|
|
18
19
|
FileAttachment: "Allegato"
|
|
19
20
|
};
|
|
20
|
-
function s(e) {
|
|
21
|
-
return e ? `rgb(${e.r}, ${e.g}, ${e.b})` : "#d4d4d8";
|
|
22
|
-
}
|
|
23
21
|
function c(e) {
|
|
24
|
-
let t =
|
|
25
|
-
t[0] ===
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
let t = i(17), { ann: n, onClick: c } = e, l = s[n.subtype] ?? n.subtype, u = `${r.card} ${n.rect ? r.cardClickable : ""}`, d;
|
|
23
|
+
t[0] === l ? d = t[1] : (d = /* @__PURE__ */ a("span", {
|
|
24
|
+
className: r.cardLabel,
|
|
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);
|
|
28
42
|
let h;
|
|
29
|
-
t[
|
|
30
|
-
className:
|
|
31
|
-
children:
|
|
32
|
-
}), t[
|
|
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);
|
|
33
47
|
let g;
|
|
34
|
-
t[
|
|
35
|
-
className:
|
|
36
|
-
|
|
37
|
-
}), t[6] = c.page, t[7] = g);
|
|
38
|
-
let _;
|
|
39
|
-
t[8] !== h || t[9] !== g ? (_ = /* @__PURE__ */ a("div", {
|
|
40
|
-
className: n.cardHeader,
|
|
41
|
-
children: [h, g]
|
|
42
|
-
}), t[8] = h, t[9] = g, t[10] = _) : _ = t[10];
|
|
43
|
-
let v;
|
|
44
|
-
t[11] === c.title ? v = t[12] : (v = c.title && /* @__PURE__ */ i("div", {
|
|
45
|
-
className: n.cardAuthor,
|
|
46
|
-
children: c.title
|
|
47
|
-
}), t[11] = c.title, t[12] = v);
|
|
48
|
-
let y;
|
|
49
|
-
t[13] === c.contents ? y = t[14] : (y = c.contents && /* @__PURE__ */ i("div", {
|
|
50
|
-
className: n.cardContent,
|
|
51
|
-
children: c.contents
|
|
52
|
-
}), t[13] = c.contents, t[14] = y);
|
|
53
|
-
let b;
|
|
54
|
-
return t[15] !== l || t[16] !== d || t[17] !== m || t[18] !== _ || t[19] !== v || t[20] !== y ? (b = /* @__PURE__ */ a("div", {
|
|
55
|
-
className: d,
|
|
56
|
-
style: m,
|
|
57
|
-
onClick: l,
|
|
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,
|
|
58
51
|
children: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
p,
|
|
53
|
+
m,
|
|
54
|
+
h
|
|
62
55
|
]
|
|
63
|
-
}), t[
|
|
56
|
+
}), t[11] = c, t[12] = u, t[13] = p, t[14] = m, t[15] = h, t[16] = g) : g = t[16], g;
|
|
64
57
|
}
|
|
65
|
-
function l(
|
|
66
|
-
let s =
|
|
58
|
+
function l(t) {
|
|
59
|
+
let s = i(8), { icon: c } = t, { pdf: l } = e(), u;
|
|
67
60
|
s[0] === l ? u = s[1] : (u = { pdf: l }, s[0] = l, s[1] = u);
|
|
68
|
-
let { annotations: d, loading: f } =
|
|
69
|
-
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */
|
|
70
|
-
className:
|
|
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,
|
|
71
64
|
children: p > 99 ? "99+" : p
|
|
72
65
|
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
73
66
|
let h;
|
|
74
|
-
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */
|
|
75
|
-
className:
|
|
67
|
+
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ o("span", {
|
|
68
|
+
className: r.iconWrapper,
|
|
76
69
|
children: [c, m]
|
|
77
70
|
}), s[5] = c, s[6] = m, s[7] = h) : h = s[7], h;
|
|
78
71
|
}
|
|
79
72
|
function u() {
|
|
80
|
-
let { pdf:
|
|
81
|
-
|
|
73
|
+
let { pdf: i, goToPage: s, setHighlight: l, setZoom: u, rotation: d, containerRef: f } = e(), { annotations: p, loading: m } = n({ pdf: i }), h = async (e) => {
|
|
74
|
+
i && f.current && u(await t("page", i, f.current, d)), s(e.page), e.rect && l({
|
|
82
75
|
page: e.page,
|
|
83
76
|
pdfRect: e.rect
|
|
84
77
|
});
|
|
85
|
-
},
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
className:
|
|
78
|
+
}, g = p.reduce((e, t) => ((e[t.page] ??= []).push(t), e), {});
|
|
79
|
+
return /* @__PURE__ */ o("div", {
|
|
80
|
+
className: r.list,
|
|
88
81
|
children: [
|
|
89
|
-
|
|
90
|
-
className:
|
|
82
|
+
m && /* @__PURE__ */ a("div", {
|
|
83
|
+
className: r.emptyState,
|
|
91
84
|
children: "Caricamento..."
|
|
92
85
|
}),
|
|
93
|
-
!
|
|
94
|
-
className:
|
|
86
|
+
!m && p.length === 0 && /* @__PURE__ */ a("div", {
|
|
87
|
+
className: r.emptyState,
|
|
95
88
|
children: "Nessuna annotazione rilevata."
|
|
96
89
|
}),
|
|
97
|
-
!
|
|
98
|
-
className:
|
|
90
|
+
!m && Object.entries(g).map(([e, t]) => /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ o("div", {
|
|
91
|
+
className: r.pageHeader,
|
|
99
92
|
children: ["Pagina ", e]
|
|
100
|
-
}), t.map((e) => /* @__PURE__ */
|
|
93
|
+
}), t.map((e) => /* @__PURE__ */ a(c, {
|
|
101
94
|
ann: e,
|
|
102
|
-
onClick: () =>
|
|
95
|
+
onClick: () => h(e)
|
|
103
96
|
}, e.id))] }, e))
|
|
104
97
|
]
|
|
105
98
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
list: "
|
|
3
|
-
emptyState: "
|
|
4
|
-
pageHeader: "
|
|
5
|
-
card: "
|
|
6
|
-
cardClickable: "
|
|
7
|
-
cardHeader: "
|
|
8
|
-
cardLabel: "
|
|
9
|
-
cardPage: "
|
|
10
|
-
cardAuthor: "
|
|
11
|
-
cardContent: "
|
|
12
|
-
iconWrapper: "
|
|
13
|
-
badge: "
|
|
2
|
+
list: "_list_185ig_1",
|
|
3
|
+
emptyState: "_emptyState_185ig_11",
|
|
4
|
+
pageHeader: "_pageHeader_185ig_23",
|
|
5
|
+
card: "_card_185ig_45",
|
|
6
|
+
cardClickable: "_cardClickable_185ig_65",
|
|
7
|
+
cardHeader: "_cardHeader_185ig_81",
|
|
8
|
+
cardLabel: "_cardLabel_185ig_95",
|
|
9
|
+
cardPage: "_cardPage_185ig_107",
|
|
10
|
+
cardAuthor: "_cardAuthor_185ig_117",
|
|
11
|
+
cardContent: "_cardContent_185ig_129",
|
|
12
|
+
iconWrapper: "_iconWrapper_185ig_141",
|
|
13
|
+
badge: "_badge_185ig_155"
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
export { e as default };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
|
+
import { useAttachments as t } from "../../hooks/useAttachments.js";
|
|
3
|
+
import n from "./PDFAttachments.module.js";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/features/PDFAttachments.tsx
|
|
7
|
+
function o() {
|
|
8
|
+
let e = r(1), t;
|
|
9
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
10
|
+
width: "13",
|
|
11
|
+
height: "13",
|
|
12
|
+
viewBox: "0 0 13 13",
|
|
13
|
+
fill: "none",
|
|
14
|
+
"aria-hidden": !0,
|
|
15
|
+
children: [/* @__PURE__ */ i("path", {
|
|
16
|
+
d: "M6.5 1.5v7M3.5 6l3 3 3-3",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeWidth: "1.5",
|
|
19
|
+
strokeLinecap: "round",
|
|
20
|
+
strokeLinejoin: "round"
|
|
21
|
+
}), /* @__PURE__ */ i("path", {
|
|
22
|
+
d: "M1.5 10.5h10",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "1.5",
|
|
25
|
+
strokeLinecap: "round"
|
|
26
|
+
})]
|
|
27
|
+
}), e[0] = t) : t = e[0], t;
|
|
28
|
+
}
|
|
29
|
+
function s() {
|
|
30
|
+
let e = r(1), t;
|
|
31
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ a("svg", {
|
|
32
|
+
width: "14",
|
|
33
|
+
height: "14",
|
|
34
|
+
viewBox: "0 0 14 14",
|
|
35
|
+
fill: "none",
|
|
36
|
+
"aria-hidden": !0,
|
|
37
|
+
children: [/* @__PURE__ */ i("path", {
|
|
38
|
+
d: "M3 1.5h5.5L11 4v8.5H3V1.5z",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "1.2",
|
|
41
|
+
strokeLinejoin: "round"
|
|
42
|
+
}), /* @__PURE__ */ i("path", {
|
|
43
|
+
d: "M8.5 1.5V4H11",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "1.2",
|
|
46
|
+
strokeLinejoin: "round"
|
|
47
|
+
})]
|
|
48
|
+
}), e[0] = t) : t = e[0], t;
|
|
49
|
+
}
|
|
50
|
+
function c(e) {
|
|
51
|
+
let t = new Blob([new Uint8Array(e.content)]), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
52
|
+
r.href = n, r.download = e.filename, r.click(), URL.revokeObjectURL(n);
|
|
53
|
+
}
|
|
54
|
+
function l(o) {
|
|
55
|
+
let s = r(8), { icon: c } = o, { pdf: l } = e(), u;
|
|
56
|
+
s[0] === l ? u = s[1] : (u = { pdf: l }, s[0] = l, s[1] = u);
|
|
57
|
+
let { attachments: d, loading: f } = t(u), p = d.length, m;
|
|
58
|
+
s[2] !== p || s[3] !== f ? (m = !f && p > 0 && /* @__PURE__ */ i("span", {
|
|
59
|
+
className: n.badge,
|
|
60
|
+
children: p > 99 ? "99+" : p
|
|
61
|
+
}), s[2] = p, s[3] = f, s[4] = m) : m = s[4];
|
|
62
|
+
let h;
|
|
63
|
+
return s[5] !== c || s[6] !== m ? (h = /* @__PURE__ */ a("span", {
|
|
64
|
+
className: n.iconWrapper,
|
|
65
|
+
children: [c, m]
|
|
66
|
+
}), s[5] = c, s[6] = m, s[7] = h) : h = s[7], h;
|
|
67
|
+
}
|
|
68
|
+
function u() {
|
|
69
|
+
let o = r(14), { pdf: s } = e(), c;
|
|
70
|
+
o[0] === s ? c = o[1] : (c = { pdf: s }, o[0] = s, o[1] = c);
|
|
71
|
+
let { attachments: l, loading: u } = t(c), f;
|
|
72
|
+
o[2] === u ? f = o[3] : (f = u && /* @__PURE__ */ i("div", {
|
|
73
|
+
className: n.emptyState,
|
|
74
|
+
children: "Caricamento..."
|
|
75
|
+
}), o[2] = u, o[3] = f);
|
|
76
|
+
let p;
|
|
77
|
+
o[4] !== l || o[5] !== u ? (p = !u && l.length === 0 && /* @__PURE__ */ i("div", {
|
|
78
|
+
className: n.emptyState,
|
|
79
|
+
children: "Nessun allegato rilevato."
|
|
80
|
+
}), o[4] = l, o[5] = u, o[6] = p) : p = o[6];
|
|
81
|
+
let m;
|
|
82
|
+
o[7] !== l || o[8] !== u ? (m = !u && l.map(d), o[7] = l, o[8] = u, o[9] = m) : m = o[9];
|
|
83
|
+
let h;
|
|
84
|
+
return o[10] !== f || o[11] !== p || o[12] !== m ? (h = /* @__PURE__ */ a("div", {
|
|
85
|
+
className: n.list,
|
|
86
|
+
children: [
|
|
87
|
+
f,
|
|
88
|
+
p,
|
|
89
|
+
m
|
|
90
|
+
]
|
|
91
|
+
}), o[10] = f, o[11] = p, o[12] = m, o[13] = h) : h = o[13], h;
|
|
92
|
+
}
|
|
93
|
+
function d(e, t) {
|
|
94
|
+
return /* @__PURE__ */ a("div", {
|
|
95
|
+
className: n.card,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ i("span", {
|
|
98
|
+
className: n.fileIcon,
|
|
99
|
+
children: /* @__PURE__ */ i(s, {})
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ i("span", {
|
|
102
|
+
className: n.filename,
|
|
103
|
+
title: e.filename,
|
|
104
|
+
children: e.filename
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ i("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
className: n.downloadBtn,
|
|
109
|
+
title: `Scarica ${e.filename}`,
|
|
110
|
+
onClick: () => c(e),
|
|
111
|
+
children: /* @__PURE__ */ i(o, {})
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}, t);
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { u as PDFAttachments, l as PDFAttachmentsIcon };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
list: "_list_8oiyp_1",
|
|
3
|
+
emptyState: "_emptyState_8oiyp_15",
|
|
4
|
+
card: "_card_8oiyp_29",
|
|
5
|
+
fileIcon: "_fileIcon_8oiyp_65",
|
|
6
|
+
filename: "_filename_8oiyp_79",
|
|
7
|
+
downloadBtn: "_downloadBtn_8oiyp_101",
|
|
8
|
+
iconWrapper: "_iconWrapper_8oiyp_153",
|
|
9
|
+
badge: "_badge_8oiyp_167"
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
|
+
import { useRef as r } from "react";
|
|
5
5
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/features/PDFChangeFile.tsx
|
|
7
7
|
function s(s) {
|
|
8
|
-
let c =
|
|
8
|
+
let c = n(11), { icon: l } = s, { onChangeFile: u } = e(), d = r(null), f;
|
|
9
9
|
c[0] === u ? f = c[1] : (f = (e) => {
|
|
10
10
|
let t = e.target.files?.[0];
|
|
11
11
|
t && u?.(t), e.target.value = "";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
-
import "react";
|
|
4
3
|
import { c as n } from "react/compiler-runtime";
|
|
4
|
+
import "react";
|
|
5
5
|
import { jsxs as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/features/PDFDownloadButton.tsx
|
|
7
7
|
function i(i) {
|
|
8
8
|
let a = n(5), { icon: o } = i, { file: s } = e(), c;
|
|
9
9
|
a[0] === s ? c = a[1] : (c = () => {
|
|
10
10
|
let e = URL.createObjectURL(s), t = document.createElement("a");
|
|
11
|
-
t.href = e, t.download = s.name || "documento.pdf", t.click(), URL.revokeObjectURL(e);
|
|
11
|
+
t.href = e, t.download = s.name || "documento.pdf", t.click(), setTimeout(() => URL.revokeObjectURL(e), 0);
|
|
12
12
|
}, a[0] = s, a[1] = c);
|
|
13
13
|
let l = c, u;
|
|
14
14
|
return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(t, {
|
|
@@ -1,12 +1,12 @@
|
|
|
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 {
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { useState as i } from "react";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/features/PDFNavigation.tsx
|
|
8
8
|
function s(s) {
|
|
9
|
-
let c =
|
|
9
|
+
let c = r(34), { prevIcon: l, nextIcon: u } = s, { currentPage: d, numPages: f, goToPage: p } = e(), [m, h] = i(!1), [g, _] = i(""), v;
|
|
10
10
|
c[0] !== p || c[1] !== g ? (v = () => {
|
|
11
11
|
let e = parseInt(g, 10);
|
|
12
12
|
isNaN(e) || p(e), h(!1);
|
|
@@ -2,8 +2,8 @@ import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
|
2
2
|
import { useOutline as t } from "../../hooks/useOutline.js";
|
|
3
3
|
import { IconChevronDown as n, IconChevronRight as r } from "../ui/icons.js";
|
|
4
4
|
import i from "./PDFOutline.module.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { c as a } from "react/compiler-runtime";
|
|
6
|
+
import { useState as o } from "react";
|
|
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
9
|
async function u(e, t) {
|
|
@@ -18,7 +18,7 @@ async function u(e, t) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function d(e) {
|
|
21
|
-
let t =
|
|
21
|
+
let t = a(25), { node: u, depth: p, onNavigate: m } = e, [h, g] = o(p === 0), _ = u.items.length > 0, v = 12 + p * 14, y = u.bold ? 600 : 400, b = u.italic ? "italic" : "normal", x;
|
|
22
22
|
t[0] !== v || t[1] !== y || t[2] !== b ? (x = {
|
|
23
23
|
paddingLeft: v,
|
|
24
24
|
fontWeight: y,
|
|
@@ -63,13 +63,13 @@ function f(e) {
|
|
|
63
63
|
return !e;
|
|
64
64
|
}
|
|
65
65
|
function p() {
|
|
66
|
-
let n =
|
|
66
|
+
let n = a(18), { pdf: r, goToPage: o } = e(), s;
|
|
67
67
|
n[0] === r ? s = n[1] : (s = { pdf: r }, n[0] = r, n[1] = s);
|
|
68
68
|
let { outline: f, loading: p } = t(s), m;
|
|
69
|
-
n[2] !==
|
|
69
|
+
n[2] !== o || n[3] !== r ? (m = async (e) => {
|
|
70
70
|
let t = await u(r, e);
|
|
71
|
-
t !== null &&
|
|
72
|
-
}, n[2] =
|
|
71
|
+
t !== null && o(t);
|
|
72
|
+
}, n[2] = o, n[3] = r, n[4] = m) : m = n[4];
|
|
73
73
|
let h = m, g;
|
|
74
74
|
n[5] === p ? g = n[6] : (g = p && /* @__PURE__ */ c("div", {
|
|
75
75
|
className: i.emptyState,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { computeFit as t } from "../../utils/pdfFit.js";
|
|
3
3
|
import { ToolbarButton as n } from "../ui/ToolbarButton.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/PDFPageFit.tsx
|
|
8
8
|
function s(s) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
-
import "react";
|
|
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/PDFPrintButton.tsx
|
|
7
7
|
function i(i) {
|
|
@@ -9,9 +9,10 @@ function i(i) {
|
|
|
9
9
|
a[0] === s ? c = a[1] : (c = () => {
|
|
10
10
|
let e = URL.createObjectURL(s), t = document.createElement("iframe");
|
|
11
11
|
t.style.display = "none", t.src = e, document.body.appendChild(t), t.onload = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
let n = !1, r = () => {
|
|
13
|
+
n || (n = !0, t.remove(), URL.revokeObjectURL(e));
|
|
14
|
+
};
|
|
15
|
+
t.contentWindow?.addEventListener("afterprint", r, { once: !0 }), setTimeout(r, 6e4), t.contentWindow?.print();
|
|
15
16
|
};
|
|
16
17
|
}, a[0] = s, a[1] = c);
|
|
17
18
|
let l = c, u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
-
import "react";
|
|
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/PDFRotationControl.tsx
|
|
7
7
|
function i(i) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import { useTextSearch as t } from "../../hooks/useTextSearch.js";
|
|
3
3
|
import n from "./PDFSearch.module.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { useEffect as i, useState as a } from "react";
|
|
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
8
|
function l(l) {
|
|
9
|
-
let u =
|
|
9
|
+
let u = r(35), { searchIcon: d, prevIcon: f, nextIcon: p, clearIcon: m } = l, { pdf: h, goToPage: g, setHighlight: _, setSearchMatches: v } = e(), [y, b] = a(""), [x, S] = a(0), C;
|
|
10
10
|
u[0] !== h || u[1] !== y ? (C = {
|
|
11
11
|
pdf: h,
|
|
12
12
|
query: y
|
|
13
13
|
}, u[0] = h, u[1] = y, u[2] = C) : C = u[2];
|
|
14
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]),
|
|
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]), i(D, O);
|
|
16
16
|
let k;
|
|
17
17
|
u[7] !== g || u[8] !== w || u[9] !== _ || u[10] !== E ? (k = (e) => {
|
|
18
18
|
let t = (e + E) % E;
|
|
@@ -4,17 +4,18 @@ import { c as n } from "react/compiler-runtime";
|
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/features/PDFSidebarToggle.tsx
|
|
6
6
|
function i(i) {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
let d = s ?? o, f;
|
|
12
|
-
return a[2] !== u || a[3] !== d ? (f = /* @__PURE__ */ r("button", {
|
|
7
|
+
let o = n(6), { collapseIcon: s, expandIcon: c } = i, { sidebarCollapsed: l, setSidebarCollapsed: u } = e(), d = l ? c ?? s : s, f = l ? "Espandi sidebar" : "Comprimi sidebar", p;
|
|
8
|
+
o[0] === u ? p = o[1] : (p = () => u(a), o[0] = u, o[1] = p);
|
|
9
|
+
let m;
|
|
10
|
+
return o[2] !== d || o[3] !== p || o[4] !== f ? (m = /* @__PURE__ */ r("button", {
|
|
13
11
|
className: t.btn,
|
|
14
|
-
onClick:
|
|
15
|
-
title:
|
|
12
|
+
onClick: p,
|
|
13
|
+
title: f,
|
|
16
14
|
children: d
|
|
17
|
-
}),
|
|
15
|
+
}), o[2] = d, o[3] = p, o[4] = f, o[5] = m) : m = o[5], m;
|
|
16
|
+
}
|
|
17
|
+
function a(e) {
|
|
18
|
+
return !e;
|
|
18
19
|
}
|
|
19
20
|
//#endregion
|
|
20
21
|
export { i as PDFSidebarToggle };
|