pdf-tsx 0.9.0 → 0.10.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 +2 -0
- 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/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/pdf-tsx.css +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/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 +15 -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/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 +13 -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/pdf-tsx.css +1 -1
- 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/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 +3 -3
- package/package.json +3 -3
|
@@ -2,11 +2,10 @@ 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 {
|
|
7
|
-
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { memo as a, useCallback as o, useMemo as s, useState as c } from "react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
7
|
//#region src/components/features/PDFOutline.tsx
|
|
9
|
-
async function
|
|
8
|
+
async function f(e, t) {
|
|
10
9
|
if (!e || !t) return null;
|
|
11
10
|
try {
|
|
12
11
|
let n = typeof t == "string" ? await e.getDestination(t) : t;
|
|
@@ -20,94 +19,78 @@ async function u(e, t) {
|
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
e.stopPropagation(), g(f);
|
|
37
|
-
},
|
|
38
|
-
children: c(h ? n : r, { size: 12 })
|
|
39
|
-
}) : /* @__PURE__ */ c("span", { style: {
|
|
40
|
-
width: 16,
|
|
41
|
-
flexShrink: 0
|
|
42
|
-
} }), t[7] = _, t[8] = h, t[9] = C) : C = t[9];
|
|
43
|
-
let w;
|
|
44
|
-
t[10] === u.title ? w = t[11] : (w = /* @__PURE__ */ c("span", {
|
|
45
|
-
className: i.title,
|
|
46
|
-
title: u.title,
|
|
47
|
-
children: u.title
|
|
48
|
-
}), t[10] = u.title, t[11] = w);
|
|
49
|
-
let T;
|
|
50
|
-
t[12] !== x || t[13] !== S || t[14] !== C || t[15] !== w ? (T = /* @__PURE__ */ l("div", {
|
|
22
|
+
var p = a(function e({ node: t, depth: a, onNavigate: f }) {
|
|
23
|
+
let [p, m] = c(a === 0), h = t.items.length > 0, g = o((e) => {
|
|
24
|
+
e.stopPropagation(), m((e) => !e);
|
|
25
|
+
}, []), _ = o(() => f(t.dest), [f, t.dest]), v = s(() => ({
|
|
26
|
+
paddingLeft: 12 + a * 14,
|
|
27
|
+
fontWeight: t.bold ? 600 : 400,
|
|
28
|
+
fontStyle: t.italic ? "italic" : "normal"
|
|
29
|
+
}), [
|
|
30
|
+
a,
|
|
31
|
+
t.bold,
|
|
32
|
+
t.italic
|
|
33
|
+
]);
|
|
34
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
51
35
|
className: i.row,
|
|
52
|
-
style:
|
|
53
|
-
onClick:
|
|
54
|
-
children: [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
36
|
+
style: v,
|
|
37
|
+
onClick: _,
|
|
38
|
+
children: [h ? /* @__PURE__ */ u("button", {
|
|
39
|
+
className: i.chevronBtn,
|
|
40
|
+
onClick: g,
|
|
41
|
+
children: u(p ? n : r, { size: 12 })
|
|
42
|
+
}) : /* @__PURE__ */ u("span", { style: {
|
|
43
|
+
width: 16,
|
|
44
|
+
flexShrink: 0
|
|
45
|
+
} }), /* @__PURE__ */ u("span", {
|
|
46
|
+
className: i.title,
|
|
47
|
+
title: t.title,
|
|
48
|
+
children: t.title
|
|
49
|
+
})]
|
|
50
|
+
}), p && t.items.map((t, n) => /* @__PURE__ */ u(e, {
|
|
51
|
+
node: t,
|
|
52
|
+
depth: a + 1,
|
|
53
|
+
onNavigate: f
|
|
54
|
+
}, n))] });
|
|
55
|
+
});
|
|
56
|
+
function m() {
|
|
57
|
+
let { pdf: n, zoom: r, rotation: a, goToPage: s } = e(), { outline: c, loading: l } = t({ pdf: n }), m = o(async (e) => {
|
|
58
|
+
let t = await f(n, e);
|
|
74
59
|
if (t) {
|
|
75
60
|
if (t.pdfTop !== null) try {
|
|
76
|
-
let [, e] = (await
|
|
77
|
-
scale:
|
|
78
|
-
rotation:
|
|
61
|
+
let [, e] = (await n.getPage(t.page)).getViewport({
|
|
62
|
+
scale: r,
|
|
63
|
+
rotation: a
|
|
79
64
|
}).convertToViewportPoint(0, t.pdfTop);
|
|
80
|
-
|
|
65
|
+
s(t.page, e);
|
|
81
66
|
return;
|
|
82
67
|
} catch {}
|
|
83
|
-
|
|
68
|
+
s(t.page);
|
|
84
69
|
}
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
n[9] !== h || n[10] !== m ? (y = !h && m.length === 0 && /* @__PURE__ */ c("div", {
|
|
93
|
-
className: i.emptyState,
|
|
94
|
-
children: "Nessun segnalibro disponibile."
|
|
95
|
-
}), n[9] = h, n[10] = m, n[11] = y) : y = n[11];
|
|
96
|
-
let b;
|
|
97
|
-
n[12] !== _ || n[13] !== h || n[14] !== m ? (b = !h && m.map((e, t) => /* @__PURE__ */ c(d, {
|
|
98
|
-
node: e,
|
|
99
|
-
depth: 0,
|
|
100
|
-
onNavigate: _
|
|
101
|
-
}, t)), n[12] = _, n[13] = h, n[14] = m, n[15] = b) : b = n[15];
|
|
102
|
-
let x;
|
|
103
|
-
return n[16] !== v || n[17] !== y || n[18] !== b ? (x = /* @__PURE__ */ l("div", {
|
|
70
|
+
}, [
|
|
71
|
+
n,
|
|
72
|
+
r,
|
|
73
|
+
a,
|
|
74
|
+
s
|
|
75
|
+
]);
|
|
76
|
+
return /* @__PURE__ */ d("div", {
|
|
104
77
|
className: i.tree,
|
|
105
78
|
children: [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
79
|
+
l && /* @__PURE__ */ u("div", {
|
|
80
|
+
className: i.emptyState,
|
|
81
|
+
children: "Caricamento..."
|
|
82
|
+
}),
|
|
83
|
+
!l && c.length === 0 && /* @__PURE__ */ u("div", {
|
|
84
|
+
className: i.emptyState,
|
|
85
|
+
children: "Nessun segnalibro disponibile."
|
|
86
|
+
}),
|
|
87
|
+
!l && c.map((e, t) => /* @__PURE__ */ u(p, {
|
|
88
|
+
node: e,
|
|
89
|
+
depth: 0,
|
|
90
|
+
onNavigate: m
|
|
91
|
+
}, t))
|
|
109
92
|
]
|
|
110
|
-
})
|
|
93
|
+
});
|
|
111
94
|
}
|
|
112
95
|
//#endregion
|
|
113
|
-
export {
|
|
96
|
+
export { m as PDFOutline };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
emptyState: "
|
|
3
|
-
tree: "
|
|
4
|
-
row: "
|
|
5
|
-
chevronBtn: "
|
|
6
|
-
title: "
|
|
2
|
+
emptyState: "_emptyState_hqvdn_1",
|
|
3
|
+
tree: "_tree_hqvdn_7",
|
|
4
|
+
row: "_row_hqvdn_13",
|
|
5
|
+
chevronBtn: "_chevronBtn_hqvdn_31",
|
|
6
|
+
title: "_title_hqvdn_46"
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
9
|
export { e as default };
|
|
@@ -1,33 +1,28 @@
|
|
|
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 {
|
|
5
|
-
import "react";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
6
5
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/features/PDFPageFit.tsx
|
|
8
|
-
function s(s) {
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
function s({ fitWidthIcon: s, fitPageIcon: c }) {
|
|
8
|
+
let { pdf: l, rotation: u, setZoom: d, setFitMode: f, containerRef: p } = e(), m = r(async (e) => {
|
|
9
|
+
!l || !p.current || (f(e), d(await t(e, l, p.current, u)));
|
|
10
|
+
}, [
|
|
11
|
+
l,
|
|
12
|
+
u,
|
|
13
|
+
d,
|
|
14
|
+
f,
|
|
15
|
+
p
|
|
16
|
+
]), h = r(() => m("width"), [m]), g = r(() => m("page"), [m]);
|
|
17
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, {
|
|
18
|
+
onClick: h,
|
|
18
19
|
title: "Adatta alla larghezza",
|
|
19
|
-
children:
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
c[11] === _ ? b = c[12] : (b = () => _("page"), c[11] = _, c[12] = b);
|
|
23
|
-
let x;
|
|
24
|
-
c[13] !== u || c[14] !== b ? (x = /* @__PURE__ */ a(n, {
|
|
25
|
-
onClick: b,
|
|
20
|
+
children: s
|
|
21
|
+
}), /* @__PURE__ */ a(n, {
|
|
22
|
+
onClick: g,
|
|
26
23
|
title: "Adatta pagina intera",
|
|
27
|
-
children:
|
|
28
|
-
})
|
|
29
|
-
let S;
|
|
30
|
-
return c[16] !== y || c[17] !== x ? (S = /* @__PURE__ */ o(i, { children: [y, x] }), c[16] = y, c[17] = x, c[18] = S) : S = c[18], S;
|
|
24
|
+
children: c
|
|
25
|
+
})] });
|
|
31
26
|
}
|
|
32
27
|
s.toolbarLabel = "Adatta";
|
|
33
28
|
//#endregion
|
|
@@ -1,26 +1,23 @@
|
|
|
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 { jsx as r } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/features/PDFPrintButton.tsx
|
|
7
|
-
function i(i) {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
function i({ icon: i }) {
|
|
7
|
+
let { file: a } = e();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
9
|
+
onClick: n(() => {
|
|
10
|
+
let e = URL.createObjectURL(a), t = document.createElement("iframe");
|
|
11
|
+
t.style.display = "none", t.src = e, document.body.appendChild(t), t.onload = () => {
|
|
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();
|
|
14
16
|
};
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}, a[0] = s, a[1] = c);
|
|
18
|
-
let l = c, u;
|
|
19
|
-
return a[2] !== l || a[3] !== o ? (u = /* @__PURE__ */ r(t, {
|
|
20
|
-
onClick: l,
|
|
17
|
+
}, [a]),
|
|
21
18
|
title: "Stampa PDF",
|
|
22
|
-
children:
|
|
23
|
-
})
|
|
19
|
+
children: i
|
|
20
|
+
});
|
|
24
21
|
}
|
|
25
22
|
i.toolbarLabel = "Stampa";
|
|
26
23
|
//#endregion
|
|
@@ -1,21 +1,15 @@
|
|
|
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 { jsx as r } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/features/PDFRotationControl.tsx
|
|
7
|
-
function i(i) {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return o[2] !== s || o[3] !== l ? (u = /* @__PURE__ */ r(t, {
|
|
12
|
-
onClick: l,
|
|
6
|
+
function i({ icon: i }) {
|
|
7
|
+
let { setRotation: a } = e();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
9
|
+
onClick: n(() => a((e) => (e + 90) % 360), [a]),
|
|
13
10
|
title: "Ruota documento",
|
|
14
|
-
children:
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
function a(e) {
|
|
18
|
-
return (e + 90) % 360;
|
|
11
|
+
children: i
|
|
12
|
+
});
|
|
19
13
|
}
|
|
20
14
|
i.toolbarLabel = "Ruota";
|
|
21
15
|
//#endregion
|
|
@@ -1,82 +1,73 @@
|
|
|
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 { useEffect as i, useState as a } from "react";
|
|
4
|
+
import { useCallback as r, useEffect as i, useState as a } from "react";
|
|
6
5
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/features/PDFSearch.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
pdf:
|
|
12
|
-
query:
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
let n = w[t];
|
|
21
|
-
g(n.page), _({
|
|
7
|
+
var l = [];
|
|
8
|
+
function u({ searchIcon: u, prevIcon: d, nextIcon: f, clearIcon: p }) {
|
|
9
|
+
let { pdf: m, goToPage: h, setHighlight: g, setSearchMatches: _ } = e(), [v, y] = a(""), [b, x] = a(0), { matches: S, searching: C } = t({
|
|
10
|
+
pdf: m,
|
|
11
|
+
query: v
|
|
12
|
+
}), w = S.length;
|
|
13
|
+
i(() => (_(S), () => _(l)), [S, _]);
|
|
14
|
+
let T = r((e) => {
|
|
15
|
+
let t = (e + w) % w;
|
|
16
|
+
x(t);
|
|
17
|
+
let n = S[t];
|
|
18
|
+
h(n.page), g({
|
|
22
19
|
page: n.page,
|
|
23
20
|
pdfRect: n.pdfRect
|
|
24
21
|
});
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
className: n.searchIconWrapper,
|
|
37
|
-
children: d
|
|
38
|
-
}), u[16] = d, u[17] = F);
|
|
39
|
-
let I;
|
|
40
|
-
u[18] !== M || u[19] !== y ? (I = /* @__PURE__ */ s("input", {
|
|
41
|
-
className: n.searchInput,
|
|
42
|
-
value: y,
|
|
43
|
-
onChange: M,
|
|
44
|
-
placeholder: "Cerca nel documento..."
|
|
45
|
-
}), u[18] = M, u[19] = y, u[20] = I) : I = u[20];
|
|
46
|
-
let L;
|
|
47
|
-
u[21] !== m || u[22] !== P || u[23] !== x || u[24] !== A || u[25] !== p || u[26] !== f || u[27] !== y || u[28] !== T || u[29] !== E ? (L = y && /* @__PURE__ */ c(o, { children: [
|
|
48
|
-
/* @__PURE__ */ s("span", {
|
|
49
|
-
className: n.counter,
|
|
50
|
-
children: T ? "…" : E === 0 ? "0" : `${x + 1}/${E}`
|
|
51
|
-
}),
|
|
52
|
-
/* @__PURE__ */ s("button", {
|
|
53
|
-
className: n.navButton,
|
|
54
|
-
onClick: () => A(x - 1),
|
|
55
|
-
disabled: E === 0,
|
|
56
|
-
children: f
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ s("button", {
|
|
59
|
-
className: n.navButton,
|
|
60
|
-
onClick: () => A(x + 1),
|
|
61
|
-
disabled: E === 0,
|
|
62
|
-
children: p
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ s("button", {
|
|
65
|
-
className: n.navButton,
|
|
66
|
-
onClick: P,
|
|
67
|
-
children: m
|
|
68
|
-
})
|
|
69
|
-
] }), u[21] = m, u[22] = P, u[23] = x, u[24] = A, u[25] = p, u[26] = f, u[27] = y, u[28] = T, u[29] = E, u[30] = L) : L = u[30];
|
|
70
|
-
let R;
|
|
71
|
-
return u[31] !== F || u[32] !== I || u[33] !== L ? (R = /* @__PURE__ */ c("div", {
|
|
22
|
+
}, [
|
|
23
|
+
w,
|
|
24
|
+
S,
|
|
25
|
+
h,
|
|
26
|
+
g
|
|
27
|
+
]), E = r((e) => {
|
|
28
|
+
y(e.target.value), x(0), g(null);
|
|
29
|
+
}, [g]), D = r(() => {
|
|
30
|
+
y(""), x(0), g(null);
|
|
31
|
+
}, [g]);
|
|
32
|
+
return /* @__PURE__ */ c("div", {
|
|
72
33
|
className: n.wrapper,
|
|
73
34
|
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
35
|
+
/* @__PURE__ */ s("span", {
|
|
36
|
+
className: n.searchIconWrapper,
|
|
37
|
+
children: u
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ s("input", {
|
|
40
|
+
className: n.searchInput,
|
|
41
|
+
value: v,
|
|
42
|
+
onChange: E,
|
|
43
|
+
placeholder: "Cerca nel documento..."
|
|
44
|
+
}),
|
|
45
|
+
v && /* @__PURE__ */ c(o, { children: [
|
|
46
|
+
/* @__PURE__ */ s("span", {
|
|
47
|
+
className: n.counter,
|
|
48
|
+
children: C ? "…" : w === 0 ? "0" : `${b + 1}/${w}`
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ s("button", {
|
|
51
|
+
className: n.navButton,
|
|
52
|
+
onClick: () => T(b - 1),
|
|
53
|
+
disabled: w === 0,
|
|
54
|
+
children: d
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ s("button", {
|
|
57
|
+
className: n.navButton,
|
|
58
|
+
onClick: () => T(b + 1),
|
|
59
|
+
disabled: w === 0,
|
|
60
|
+
children: f
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ s("button", {
|
|
63
|
+
className: n.navButton,
|
|
64
|
+
onClick: D,
|
|
65
|
+
children: p
|
|
66
|
+
})
|
|
67
|
+
] })
|
|
77
68
|
]
|
|
78
|
-
})
|
|
69
|
+
});
|
|
79
70
|
}
|
|
80
|
-
|
|
71
|
+
u.toolbarLabel = "Cerca";
|
|
81
72
|
//#endregion
|
|
82
|
-
export {
|
|
73
|
+
export { u as PDFSearch };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
wrapper: "
|
|
3
|
-
searchIconWrapper: "
|
|
4
|
-
searchInput: "
|
|
5
|
-
navButton: "
|
|
6
|
-
counter: "
|
|
2
|
+
wrapper: "_wrapper_18kvs_1",
|
|
3
|
+
searchIconWrapper: "_searchIconWrapper_18kvs_7",
|
|
4
|
+
searchInput: "_searchInput_18kvs_13",
|
|
5
|
+
navButton: "_navButton_18kvs_33",
|
|
6
|
+
counter: "_counter_18kvs_54"
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
9
|
export { e as default };
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
2
|
import t from "../ui/ToolbarButton.module.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback as n } from "react";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/features/PDFSidebarToggle.tsx
|
|
6
|
-
function i(i) {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
let m;
|
|
10
|
-
return o[2] !== d || o[3] !== p || o[4] !== f ? (m = /* @__PURE__ */ r("button", {
|
|
6
|
+
function i({ collapseIcon: i, expandIcon: a }) {
|
|
7
|
+
let { sidebarCollapsed: o, setSidebarCollapsed: s } = e(), c = o ? a ?? i : i, l = o ? "Espandi sidebar" : "Comprimi sidebar", u = n(() => s((e) => !e), [s]);
|
|
8
|
+
return /* @__PURE__ */ r("button", {
|
|
11
9
|
className: t.btn,
|
|
12
|
-
onClick:
|
|
13
|
-
title:
|
|
14
|
-
children:
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
function a(e) {
|
|
18
|
-
return !e;
|
|
10
|
+
onClick: u,
|
|
11
|
+
title: l,
|
|
12
|
+
children: c
|
|
13
|
+
});
|
|
19
14
|
}
|
|
20
15
|
i.toolbarLabel = "Sidebar";
|
|
21
16
|
//#endregion
|