pdf-tsx 0.1.1 → 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.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/cjs/components/PDFSidebar.cjs +1 -1
- package/dist/cjs/components/features/PDFAnnotations.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/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/PDFSignatures.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/PDFZoomControls.cjs +1 -1
- package/dist/cjs/components/ui/ToolbarButton.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/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/es/components/PDFSidebar.js +17 -18
- package/dist/es/components/features/PDFAnnotations.js +32 -32
- package/dist/es/components/features/PDFChangeFile.js +7 -8
- package/dist/es/components/features/PDFDownloadButton.js +6 -7
- package/dist/es/components/features/PDFNavigation.js +12 -13
- package/dist/es/components/features/PDFOutline.js +42 -43
- package/dist/es/components/features/PDFPageFit.js +10 -10
- package/dist/es/components/features/PDFPrintButton.js +6 -7
- package/dist/es/components/features/PDFRotationControl.js +9 -10
- package/dist/es/components/features/PDFSearch.js +15 -16
- package/dist/es/components/features/PDFSignatures.js +55 -56
- package/dist/es/components/features/PDFThemeToggle.js +7 -8
- package/dist/es/components/features/PDFThumbnails.js +20 -21
- package/dist/es/components/features/PDFZoomControls.js +20 -21
- package/dist/es/components/ui/ToolbarButton.js +7 -8
- package/dist/es/components/ui/icons.js +9 -9
- package/dist/es/context/ThemeContext.js +19 -19
- package/dist/es/hooks/useAnnotationLayer.js +16 -17
- package/dist/es/hooks/useKeyboardShortcuts.js +15 -16
- package/dist/es/hooks/useOutline.js +7 -8
- package/dist/es/hooks/useScrollTracking.js +11 -11
- package/dist/es/hooks/useTextLayer.js +13 -14
- package/dist/es/hooks/useTextSearch.js +7 -8
- package/dist/es/hooks/useThumbnails.js +7 -8
- package/package.json +1 -1
- package/dist/cjs/node_modules/react/cjs/react-compiler-runtime.development.cjs +0 -5
- package/dist/cjs/node_modules/react/cjs/react-compiler-runtime.production.cjs +0 -1
- package/dist/cjs/node_modules/react/compiler-runtime.cjs +0 -1
- package/dist/es/_virtual/_rolldown/runtime.js +0 -7
- package/dist/es/node_modules/react/cjs/react-compiler-runtime.development.js +0 -14
- package/dist/es/node_modules/react/cjs/react-compiler-runtime.production.js +0 -11
- package/dist/es/node_modules/react/compiler-runtime.js +0 -10
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
2
|
+
import { useThumbnails as t } from "../../hooks/useThumbnails.js";
|
|
3
|
+
import n from "./PDFThumbnails.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/PDFThumbnails.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
t[0] !== s || t[1] !== c ? (d = {
|
|
7
|
+
function o() {
|
|
8
|
+
let o = r(12), { pdf: s, rotation: c, currentPage: l, goToPage: u } = e(), d;
|
|
9
|
+
o[0] !== s || o[1] !== c ? (d = {
|
|
11
10
|
pdf: s,
|
|
12
11
|
rotation: c
|
|
13
|
-
},
|
|
14
|
-
let { thumbnails: f } =
|
|
15
|
-
if (
|
|
12
|
+
}, o[0] = s, o[1] = c, o[2] = d) : d = o[2];
|
|
13
|
+
let { thumbnails: f } = t(d), p;
|
|
14
|
+
if (o[3] !== l || o[4] !== u || o[5] !== f) {
|
|
16
15
|
let e;
|
|
17
|
-
|
|
18
|
-
let
|
|
16
|
+
o[7] !== l || o[8] !== u ? (e = (e, t) => {
|
|
17
|
+
let r = l === t + 1;
|
|
19
18
|
return /* @__PURE__ */ a("div", {
|
|
20
|
-
className: `${
|
|
19
|
+
className: `${n.thumbnailItem} ${r ? n.thumbnailItemActive : ""}`,
|
|
21
20
|
onClick: () => u(t + 1),
|
|
22
21
|
children: [/* @__PURE__ */ i("img", {
|
|
23
22
|
src: e,
|
|
24
|
-
className: `${
|
|
23
|
+
className: `${n.thumbnailImg} ${r ? n.thumbnailImgActive : ""}`,
|
|
25
24
|
alt: `Anteprima pagina ${t + 1}`
|
|
26
25
|
}), /* @__PURE__ */ i("div", {
|
|
27
|
-
className: `${
|
|
26
|
+
className: `${n.thumbnailLabel} ${r ? n.thumbnailLabelActive : ""}`,
|
|
28
27
|
children: t + 1
|
|
29
28
|
})]
|
|
30
29
|
}, t);
|
|
31
|
-
},
|
|
32
|
-
} else p =
|
|
30
|
+
}, o[7] = l, o[8] = u, o[9] = e) : e = o[9], p = f.map(e), o[3] = l, o[4] = u, o[5] = f, o[6] = p;
|
|
31
|
+
} else p = o[6];
|
|
33
32
|
let m;
|
|
34
|
-
return
|
|
35
|
-
className:
|
|
33
|
+
return o[10] === p ? m = o[11] : (m = /* @__PURE__ */ i("div", {
|
|
34
|
+
className: n.thumbnailList,
|
|
36
35
|
children: p
|
|
37
|
-
}),
|
|
36
|
+
}), o[10] = p, o[11] = m), m;
|
|
38
37
|
}
|
|
39
38
|
//#endregion
|
|
40
|
-
export {
|
|
39
|
+
export { o as PDFThumbnails };
|
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import { usePDFViewer as e } from "../../context/PDFViewerContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import r from "./PDFZoomControls.module.js";
|
|
2
|
+
import { ToolbarButton as t } from "../ui/ToolbarButton.js";
|
|
3
|
+
import n from "./PDFZoomControls.module.js";
|
|
5
4
|
import "react";
|
|
5
|
+
import { c as r } from "react/compiler-runtime";
|
|
6
6
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/features/PDFZoomControls.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
c[0] === m ? h = c[1] : (h = () => m(u), c[0] = m, c[1] = h);
|
|
8
|
+
function s(s) {
|
|
9
|
+
let u = r(18), { zoomOutIcon: d, zoomInIcon: f } = s, { zoom: p, setZoom: m } = e(), h;
|
|
10
|
+
u[0] === m ? h = u[1] : (h = () => m(l), u[0] = m, u[1] = h);
|
|
12
11
|
let g;
|
|
13
|
-
|
|
12
|
+
u[2] !== h || u[3] !== d ? (g = /* @__PURE__ */ a(t, {
|
|
14
13
|
onClick: h,
|
|
15
14
|
title: "Riduci zoom",
|
|
16
15
|
children: d
|
|
17
|
-
}),
|
|
16
|
+
}), u[2] = h, u[3] = d, u[4] = g) : g = u[4];
|
|
18
17
|
let _;
|
|
19
|
-
|
|
18
|
+
u[5] === p ? _ = u[6] : (_ = Math.round(p * 100), u[5] = p, u[6] = _);
|
|
20
19
|
let v;
|
|
21
|
-
|
|
22
|
-
className:
|
|
20
|
+
u[7] === _ ? v = u[8] : (v = /* @__PURE__ */ o("span", {
|
|
21
|
+
className: n.zoomLabel,
|
|
23
22
|
children: [_, "%"]
|
|
24
|
-
}),
|
|
23
|
+
}), u[7] = _, u[8] = v);
|
|
25
24
|
let y;
|
|
26
|
-
|
|
25
|
+
u[9] === m ? y = u[10] : (y = () => m(c), u[9] = m, u[10] = y);
|
|
27
26
|
let b;
|
|
28
|
-
|
|
27
|
+
u[11] !== y || u[12] !== f ? (b = /* @__PURE__ */ a(t, {
|
|
29
28
|
onClick: y,
|
|
30
29
|
title: "Aumenta zoom",
|
|
31
30
|
children: f
|
|
32
|
-
}),
|
|
31
|
+
}), u[11] = y, u[12] = f, u[13] = b) : b = u[13];
|
|
33
32
|
let x;
|
|
34
|
-
return
|
|
33
|
+
return u[14] !== g || u[15] !== v || u[16] !== b ? (x = /* @__PURE__ */ o(i, { children: [
|
|
35
34
|
g,
|
|
36
35
|
v,
|
|
37
36
|
b
|
|
38
|
-
] }),
|
|
37
|
+
] }), u[14] = g, u[15] = v, u[16] = b, u[17] = x) : x = u[17], x;
|
|
39
38
|
}
|
|
40
|
-
function
|
|
39
|
+
function c(e) {
|
|
41
40
|
return Math.min(e + .2, 3);
|
|
42
41
|
}
|
|
43
|
-
function
|
|
42
|
+
function l(e) {
|
|
44
43
|
return Math.max(e - .2, .2);
|
|
45
44
|
}
|
|
46
45
|
//#endregion
|
|
47
|
-
export {
|
|
46
|
+
export { s as PDFZoomControls };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
1
|
+
import e from "./ToolbarButton.module.js";
|
|
2
|
+
import { c as t } from "react/compiler-runtime";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/ui/ToolbarButton.tsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let c = a ? `${t.btn} ${t.primary}` : t.btn, l = o ? `${c} ${o}` : c, u;
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = t(7), a, o, s;
|
|
7
|
+
i[0] === r ? (a = i[1], o = i[2], s = i[3]) : ({$primary: a, className: o, ...s} = r, i[0] = r, i[1] = a, i[2] = o, i[3] = s);
|
|
8
|
+
let c = a ? `${e.btn} ${e.primary}` : e.btn, l = o ? `${c} ${o}` : c, u;
|
|
10
9
|
return i[4] !== s || i[5] !== l ? (u = /* @__PURE__ */ n("button", {
|
|
11
10
|
className: l,
|
|
12
11
|
...s
|
|
13
12
|
}), i[4] = s, i[5] = l, i[6] = u) : u = i[6], u;
|
|
14
13
|
}
|
|
15
14
|
//#endregion
|
|
16
|
-
export {
|
|
15
|
+
export { r as ToolbarButton };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { require_compiler_runtime as e } from "../../node_modules/react/compiler-runtime.js";
|
|
2
1
|
import "react";
|
|
2
|
+
import { c as e } from "react/compiler-runtime";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/ui/icons.tsx
|
|
5
|
-
var n =
|
|
5
|
+
var n = (e, n = 16) => /* @__PURE__ */ t("svg", {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: n,
|
|
8
8
|
height: n,
|
|
@@ -13,16 +13,16 @@ var n = e(), r = (e, n = 16) => /* @__PURE__ */ t("svg", {
|
|
|
13
13
|
strokeLinecap: "round",
|
|
14
14
|
strokeLinejoin: "round",
|
|
15
15
|
children: e
|
|
16
|
-
}),
|
|
17
|
-
let i = (
|
|
16
|
+
}), r = (r) => {
|
|
17
|
+
let i = e(3), { size: a } = r, o;
|
|
18
18
|
i[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ t("polyline", { points: "9 18 15 12 9 6" }), i[0] = o) : o = i[0];
|
|
19
19
|
let s;
|
|
20
|
-
return i[1] === a ? s = i[2] : (s =
|
|
21
|
-
},
|
|
22
|
-
let i = (
|
|
20
|
+
return i[1] === a ? s = i[2] : (s = n(o, a), i[1] = a, i[2] = s), s;
|
|
21
|
+
}, i = (r) => {
|
|
22
|
+
let i = e(3), { size: a } = r, o;
|
|
23
23
|
i[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ t("polyline", { points: "6 9 12 15 18 9" }), i[0] = o) : o = i[0];
|
|
24
24
|
let s;
|
|
25
|
-
return i[1] === a ? s = i[2] : (s =
|
|
25
|
+
return i[1] === a ? s = i[2] : (s = n(o, a), i[1] = a, i[2] = s), s;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
|
-
export {
|
|
28
|
+
export { i as IconChevronDown, r as IconChevronRight };
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { darkTheme as e, lightTheme as t, themeToCssVars as n } from "../theme.js";
|
|
2
|
+
import { createContext as r, useContext as i, useState as a } from "react";
|
|
3
|
+
import { c as o } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as s } from "react/jsx-runtime";
|
|
5
5
|
//#region src/context/ThemeContext.tsx
|
|
6
|
-
var c =
|
|
7
|
-
function
|
|
8
|
-
let i = (
|
|
9
|
-
i[0] === p ? m = i[1] : (m =
|
|
6
|
+
var c = r(null);
|
|
7
|
+
function l(r) {
|
|
8
|
+
let i = o(14), { children: l } = r, [d, f] = a(!0), p = d ? e : t, m;
|
|
9
|
+
i[0] === p ? m = i[1] : (m = n(p), i[0] = p, i[1] = m);
|
|
10
10
|
let h = m, g;
|
|
11
|
-
i[2] === Symbol.for("react.memo_cache_sentinel") ? (g = () => f(
|
|
11
|
+
i[2] === Symbol.for("react.memo_cache_sentinel") ? (g = () => f(u), i[2] = g) : g = i[2];
|
|
12
12
|
let _;
|
|
13
|
-
i[3] !==
|
|
14
|
-
isDark:
|
|
13
|
+
i[3] !== d || i[4] !== p ? (_ = {
|
|
14
|
+
isDark: d,
|
|
15
15
|
toggleTheme: g,
|
|
16
16
|
theme: p
|
|
17
|
-
}, i[3] =
|
|
17
|
+
}, i[3] = d, i[4] = p, i[5] = _) : _ = i[5];
|
|
18
18
|
let v = h, y;
|
|
19
19
|
i[6] === v ? y = i[7] : (y = {
|
|
20
20
|
...v,
|
|
21
21
|
display: "contents"
|
|
22
22
|
}, i[6] = v, i[7] = y);
|
|
23
23
|
let b;
|
|
24
|
-
i[8] !==
|
|
24
|
+
i[8] !== l || i[9] !== y ? (b = /* @__PURE__ */ s("div", {
|
|
25
25
|
style: y,
|
|
26
|
-
children:
|
|
27
|
-
}), i[8] =
|
|
26
|
+
children: l
|
|
27
|
+
}), i[8] = l, i[9] = y, i[10] = b) : b = i[10];
|
|
28
28
|
let x;
|
|
29
|
-
return i[11] !== _ || i[12] !== b ? (x = /* @__PURE__ */ s(
|
|
29
|
+
return i[11] !== _ || i[12] !== b ? (x = /* @__PURE__ */ s(c.Provider, {
|
|
30
30
|
value: _,
|
|
31
31
|
children: b
|
|
32
32
|
}), i[11] = _, i[12] = b, i[13] = x) : x = i[13], x;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function u(e) {
|
|
35
35
|
return !e;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let e =
|
|
37
|
+
function d() {
|
|
38
|
+
let e = i(c);
|
|
39
39
|
if (!e) throw Error("useTheme must be used inside <ThemeProvider>");
|
|
40
40
|
return e;
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
-
export {
|
|
43
|
+
export { l as ThemeProvider, d as useTheme };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect as n, useState as r } from "react";
|
|
1
|
+
import { isSafeUrl as e } from "../utils/url.js";
|
|
2
|
+
import { useEffect as t, useState as n } from "react";
|
|
4
3
|
import "pdfjs-dist";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
5
|
//#region src/hooks/useAnnotationLayer.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let a = (0, i.c)(15), { pdf: o, zoom: s, rotation: c, numPages: l, goToPage: u } = e, d;
|
|
6
|
+
function i(i) {
|
|
7
|
+
let a = r(15), { pdf: o, zoom: s, rotation: c, numPages: l, goToPage: u } = i, d;
|
|
9
8
|
a[0] === Symbol.for("react.memo_cache_sentinel") ? (d = [], a[0] = d) : d = a[0];
|
|
10
|
-
let [f, p] =
|
|
9
|
+
let [f, p] = n(d), m, h;
|
|
11
10
|
a[1] !== l || a[2] !== o || a[3] !== c || a[4] !== s ? (m = () => {
|
|
12
11
|
if (!o) return;
|
|
13
12
|
let e = !1;
|
|
@@ -43,18 +42,18 @@ function a(e) {
|
|
|
43
42
|
s,
|
|
44
43
|
c,
|
|
45
44
|
l
|
|
46
|
-
], a[1] = l, a[2] = o, a[3] = c, a[4] = s, a[5] = m, a[6] = h) : (m = a[5], h = a[6]),
|
|
45
|
+
], a[1] = l, a[2] = o, a[3] = c, a[4] = s, a[5] = m, a[6] = h) : (m = a[5], h = a[6]), t(m, h);
|
|
47
46
|
let g;
|
|
48
|
-
a[7] !== u || a[8] !== o ? (g = async (
|
|
49
|
-
if (
|
|
50
|
-
if (!t
|
|
51
|
-
window.open(
|
|
47
|
+
a[7] !== u || a[8] !== o ? (g = async (t) => {
|
|
48
|
+
if (t.url) {
|
|
49
|
+
if (!e(t.url)) return;
|
|
50
|
+
window.open(t.url, "_blank", "noopener,noreferrer");
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
|
-
if (
|
|
55
|
-
let
|
|
56
|
-
if (typeof
|
|
57
|
-
u(await o.getPageIndex(
|
|
53
|
+
if (t.dest && o) {
|
|
54
|
+
let e = null;
|
|
55
|
+
if (typeof t.dest == "string" ? e = await o.getDestination(t.dest) : Array.isArray(t.dest) && (e = t.dest), !e) return;
|
|
56
|
+
u(await o.getPageIndex(e[0]) + 1);
|
|
58
57
|
}
|
|
59
58
|
}, a[7] = u, a[8] = o, a[9] = g) : g = a[9];
|
|
60
59
|
let _ = g, v;
|
|
@@ -68,4 +67,4 @@ function a(e) {
|
|
|
68
67
|
return v;
|
|
69
68
|
}
|
|
70
69
|
//#endregion
|
|
71
|
-
export {
|
|
70
|
+
export { i as useAnnotationLayer };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as t } from "react";
|
|
1
|
+
import { useEffect as e } from "react";
|
|
3
2
|
import "pdfjs-dist";
|
|
3
|
+
import { c as t } from "react/compiler-runtime";
|
|
4
4
|
//#region src/hooks/useKeyboardShortcuts.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
r[0] !== c || r[1] !== u || r[2] !== s || r[3] !== f || r[4] !== d ? (p = () => {
|
|
5
|
+
function n(n) {
|
|
6
|
+
let o = t(13), { pdf: s, currentPage: c, numPages: l, goToPage: u, setZoom: d, setRotation: f } = n, p;
|
|
7
|
+
o[0] !== c || o[1] !== u || o[2] !== s || o[3] !== f || o[4] !== d ? (p = () => {
|
|
9
8
|
if (!s) return;
|
|
10
9
|
let e = (e) => {
|
|
11
10
|
let t = e.target.tagName;
|
|
@@ -20,35 +19,35 @@ function r(e) {
|
|
|
20
19
|
break bb13;
|
|
21
20
|
case "+":
|
|
22
21
|
case "=":
|
|
23
|
-
e.preventDefault(), d(
|
|
22
|
+
e.preventDefault(), d(a);
|
|
24
23
|
break bb13;
|
|
25
24
|
case "-":
|
|
26
|
-
e.preventDefault(), d(
|
|
25
|
+
e.preventDefault(), d(i);
|
|
27
26
|
break bb13;
|
|
28
27
|
case "r":
|
|
29
|
-
case "R": e.preventDefault(), f(
|
|
28
|
+
case "R": e.preventDefault(), f(r);
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
33
|
-
},
|
|
32
|
+
}, o[0] = c, o[1] = u, o[2] = s, o[3] = f, o[4] = d, o[5] = p) : p = o[5];
|
|
34
33
|
let m;
|
|
35
|
-
|
|
34
|
+
o[6] !== c || o[7] !== u || o[8] !== l || o[9] !== s || o[10] !== f || o[11] !== d ? (m = [
|
|
36
35
|
s,
|
|
37
36
|
c,
|
|
38
37
|
l,
|
|
39
38
|
u,
|
|
40
39
|
d,
|
|
41
40
|
f
|
|
42
|
-
],
|
|
41
|
+
], o[6] = c, o[7] = u, o[8] = l, o[9] = s, o[10] = f, o[11] = d, o[12] = m) : m = o[12], e(p, m);
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function r(e) {
|
|
45
44
|
return (e + 90) % 360;
|
|
46
45
|
}
|
|
47
|
-
function
|
|
46
|
+
function i(e) {
|
|
48
47
|
return Math.max(e - .2, .2);
|
|
49
48
|
}
|
|
50
|
-
function
|
|
49
|
+
function a(e) {
|
|
51
50
|
return Math.min(e + .2, 3);
|
|
52
51
|
}
|
|
53
52
|
//#endregion
|
|
54
|
-
export {
|
|
53
|
+
export { n as useKeyboardShortcuts };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as t, useState as n } from "react";
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
3
2
|
import "pdfjs-dist";
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
4
|
//#region src/hooks/useOutline.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let i = (0, r.c)(7), { pdf: a } = e, o;
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(7), { pdf: a } = r, o;
|
|
8
7
|
i[0] === Symbol.for("react.memo_cache_sentinel") ? (o = [], i[0] = o) : o = i[0];
|
|
9
|
-
let [s, c] =
|
|
8
|
+
let [s, c] = t(o), [l, u] = t(!1), d, f;
|
|
10
9
|
i[1] === a ? (d = i[2], f = i[3]) : (d = () => {
|
|
11
10
|
a && (u(!0), a.getOutline().then((e) => c(e ?? [])).catch(() => c([])).finally(() => u(!1)));
|
|
12
|
-
}, f = [a], i[1] = a, i[2] = d, i[3] = f),
|
|
11
|
+
}, f = [a], i[1] = a, i[2] = d, i[3] = f), e(d, f);
|
|
13
12
|
let p;
|
|
14
13
|
return i[4] !== l || i[5] !== s ? (p = {
|
|
15
14
|
outline: s,
|
|
@@ -17,4 +16,4 @@ function i(e) {
|
|
|
17
16
|
}, i[4] = l, i[5] = s, i[6] = p) : p = i[6], p;
|
|
18
17
|
}
|
|
19
18
|
//#endregion
|
|
20
|
-
export {
|
|
19
|
+
export { r as useOutline };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as t, useState as n } from "react";
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
3
2
|
import "pdfjs-dist";
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
4
|
//#region src/hooks/useScrollTracking.ts
|
|
5
|
-
var r =
|
|
6
|
-
function
|
|
7
|
-
let a = (
|
|
5
|
+
var r = 10;
|
|
6
|
+
function i(i) {
|
|
7
|
+
let a = n(16), { pdf: o, numPages: s, zoom: c, rotation: l, containerRef: u, canvasRefs: d } = i, [f, p] = t(1), m;
|
|
8
8
|
a[0] !== d || a[1] !== u ? (m = () => {
|
|
9
9
|
let e = u.current;
|
|
10
10
|
if (!e) return;
|
|
@@ -24,13 +24,13 @@ function a(e) {
|
|
|
24
24
|
l,
|
|
25
25
|
u,
|
|
26
26
|
d
|
|
27
|
-
], a[3] = d, a[4] = u, a[5] = o, a[6] = l, a[7] = c, a[8] = h) : h = a[8],
|
|
27
|
+
], a[3] = d, a[4] = u, a[5] = o, a[6] = l, a[7] = c, a[8] = h) : h = a[8], e(m, h);
|
|
28
28
|
let g;
|
|
29
29
|
a[9] !== d || a[10] !== u || a[11] !== s ? (g = (e) => {
|
|
30
|
-
let t = Math.min(Math.max(e, 1), s), n = d.current[t - 1],
|
|
31
|
-
if (n &&
|
|
32
|
-
let e = (n.parentElement ?? n).getBoundingClientRect().top, a =
|
|
33
|
-
|
|
30
|
+
let t = Math.min(Math.max(e, 1), s), n = d.current[t - 1], i = u.current;
|
|
31
|
+
if (n && i) {
|
|
32
|
+
let e = (n.parentElement ?? n).getBoundingClientRect().top, a = i.getBoundingClientRect().top, o = i.scrollTop + (e - a) - r;
|
|
33
|
+
i.scrollTo({
|
|
34
34
|
top: o,
|
|
35
35
|
behavior: "smooth"
|
|
36
36
|
}), p(t);
|
|
@@ -43,4 +43,4 @@ function a(e) {
|
|
|
43
43
|
}, a[13] = f, a[14] = _, a[15] = v) : v = a[15], v;
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
export {
|
|
46
|
+
export { i as useScrollTracking };
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { require_compiler_runtime as e } from "../node_modules/react/compiler-runtime.js";
|
|
2
1
|
/* empty css */
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import * as
|
|
2
|
+
import { useEffect as e, useRef as t } from "react";
|
|
3
|
+
import * as n from "pdfjs-dist";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
5
|
//#region src/hooks/useTextLayer.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let a = (0, i.c)(8), { pdf: o, zoom: s, rotation: c, numPages: l, canvasRefs: u } = e, d;
|
|
6
|
+
function i(i) {
|
|
7
|
+
let a = r(8), { pdf: o, zoom: s, rotation: c, numPages: l, canvasRefs: u } = i, d;
|
|
9
8
|
a[0] === Symbol.for("react.memo_cache_sentinel") ? (d = [], a[0] = d) : d = a[0];
|
|
10
|
-
let f =
|
|
9
|
+
let f = t(d), p, m;
|
|
11
10
|
return a[1] !== u || a[2] !== l || a[3] !== o || a[4] !== c || a[5] !== s ? (p = () => {
|
|
12
11
|
if (!o) return;
|
|
13
12
|
let e = !1;
|
|
14
13
|
return (async () => {
|
|
15
14
|
for (let t = 1; t <= l && !e; t++) {
|
|
16
|
-
let
|
|
17
|
-
if (!
|
|
18
|
-
|
|
15
|
+
let r = f.current[t - 1], i = u.current[t - 1];
|
|
16
|
+
if (!r || !i) continue;
|
|
17
|
+
r.replaceChildren();
|
|
19
18
|
let a = await o.getPage(t), l = a.getViewport({
|
|
20
19
|
scale: s,
|
|
21
20
|
rotation: c
|
|
22
21
|
}), d = await a.getTextContent();
|
|
23
22
|
if (e) break;
|
|
24
|
-
|
|
23
|
+
r.style.width = `${l.width}px`, r.style.height = `${l.height}px`, await new n.TextLayer({
|
|
25
24
|
textContentSource: d,
|
|
26
|
-
container:
|
|
25
|
+
container: r,
|
|
27
26
|
viewport: l
|
|
28
27
|
}).render();
|
|
29
28
|
}
|
|
@@ -36,7 +35,7 @@ function a(e) {
|
|
|
36
35
|
c,
|
|
37
36
|
l,
|
|
38
37
|
u
|
|
39
|
-
], a[1] = u, a[2] = l, a[3] = o, a[4] = c, a[5] = s, a[6] = p, a[7] = m) : (p = a[6], m = a[7]),
|
|
38
|
+
], a[1] = u, a[2] = l, a[3] = o, a[4] = c, a[5] = s, a[6] = p, a[7] = m) : (p = a[6], m = a[7]), e(p, m), f;
|
|
40
39
|
}
|
|
41
40
|
//#endregion
|
|
42
|
-
export {
|
|
41
|
+
export { i as useTextLayer };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as t, useState as n } from "react";
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
3
2
|
import "pdfjs-dist";
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
4
|
//#region src/hooks/useTextSearch.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let i = (0, r.c)(8), { pdf: a, query: o } = e, s;
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(8), { pdf: a, query: o } = r, s;
|
|
8
7
|
i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], i[0] = s) : s = i[0];
|
|
9
|
-
let [c, l] =
|
|
8
|
+
let [c, l] = t(s), [u, d] = t(!1), f, p;
|
|
10
9
|
i[1] !== a || i[2] !== o ? (f = () => {
|
|
11
10
|
let e = o.trim().toLowerCase();
|
|
12
11
|
if (!a || !e) {
|
|
@@ -42,7 +41,7 @@ function i(e) {
|
|
|
42
41
|
})(), () => {
|
|
43
42
|
t = !0;
|
|
44
43
|
};
|
|
45
|
-
}, p = [a, o], i[1] = a, i[2] = o, i[3] = f, i[4] = p) : (f = i[3], p = i[4]),
|
|
44
|
+
}, p = [a, o], i[1] = a, i[2] = o, i[3] = f, i[4] = p) : (f = i[3], p = i[4]), e(f, p);
|
|
46
45
|
let m;
|
|
47
46
|
return i[5] !== c || i[6] !== u ? (m = {
|
|
48
47
|
matches: c,
|
|
@@ -50,4 +49,4 @@ function i(e) {
|
|
|
50
49
|
}, i[5] = c, i[6] = u, i[7] = m) : m = i[7], m;
|
|
51
50
|
}
|
|
52
51
|
//#endregion
|
|
53
|
-
export {
|
|
52
|
+
export { r as useTextSearch };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as t, useState as n } from "react";
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
3
2
|
import "pdfjs-dist";
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
4
|
//#region src/hooks/useThumbnails.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let i = (0, r.c)(7), { pdf: a, rotation: o } = e, s;
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(7), { pdf: a, rotation: o } = r, s;
|
|
8
7
|
i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], i[0] = s) : s = i[0];
|
|
9
|
-
let [c, l] =
|
|
8
|
+
let [c, l] = t(s), u, d;
|
|
10
9
|
i[1] !== a || i[2] !== o ? (u = () => {
|
|
11
10
|
a && (async () => {
|
|
12
11
|
let e = [];
|
|
@@ -23,9 +22,9 @@ function i(e) {
|
|
|
23
22
|
}
|
|
24
23
|
l(e);
|
|
25
24
|
})();
|
|
26
|
-
}, d = [a, o], i[1] = a, i[2] = o, i[3] = u, i[4] = d) : (u = i[3], d = i[4]),
|
|
25
|
+
}, d = [a, o], i[1] = a, i[2] = o, i[3] = u, i[4] = d) : (u = i[3], d = i[4]), e(u, d);
|
|
27
26
|
let f;
|
|
28
27
|
return i[5] === c ? f = i[6] : (f = { thumbnails: c }, i[5] = c, i[6] = f), f;
|
|
29
28
|
}
|
|
30
29
|
//#endregion
|
|
31
|
-
export {
|
|
30
|
+
export { r as useThumbnails };
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require(`../../../_virtual/_rolldown/runtime.cjs`).__commonJSMin((e=>{process.env.NODE_ENV!==`production`&&(function(){var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){var n=t.H;return n===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
|
-
2. You might be breaking the Rules of Hooks
|
|
4
|
-
3. You might have more than one copy of React in the same app
|
|
5
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n.useMemoCache(e)}})()}));Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return e()}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require(`../../../_virtual/_rolldown/runtime.cjs`).__commonJSMin((e=>{var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}}));Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return e()}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./cjs/react-compiler-runtime.production.cjs`),n=require(`./cjs/react-compiler-runtime.development.cjs`);var r=e.__commonJSMin(((e,r)=>{process.env.NODE_ENV===`production`?r.exports=t.default:r.exports=n.default}));Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return r()}});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), t = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
3
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
-
});
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as __commonJSMin, t as __require };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region node_modules/react/cjs/react-compiler-runtime.development.js
|
|
3
|
-
var n = /* @__PURE__ */ e(((e) => {
|
|
4
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
5
|
-
var n = t("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
6
|
-
e.c = function(e) {
|
|
7
|
-
var t = n.H;
|
|
8
|
-
return t === null && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."), t.useMemoCache(e);
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
}));
|
|
12
|
-
//#endregion
|
|
13
|
-
export default n();
|
|
14
|
-
export { n as require_react_compiler_runtime_development };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region node_modules/react/cjs/react-compiler-runtime.production.js
|
|
3
|
-
var n = /* @__PURE__ */ e(((e) => {
|
|
4
|
-
var n = t("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
5
|
-
e.c = function(e) {
|
|
6
|
-
return n.H.useMemoCache(e);
|
|
7
|
-
};
|
|
8
|
-
}));
|
|
9
|
-
//#endregion
|
|
10
|
-
export default n();
|
|
11
|
-
export { n as require_react_compiler_runtime_production };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_react_compiler_runtime_production as t } from "./cjs/react-compiler-runtime.production.js";
|
|
3
|
-
import { require_react_compiler_runtime_development as n } from "./cjs/react-compiler-runtime.development.js";
|
|
4
|
-
//#region node_modules/react/compiler-runtime.js
|
|
5
|
-
var r = /* @__PURE__ */ e(((e, r) => {
|
|
6
|
-
process.env.NODE_ENV === "production" ? r.exports = t() : r.exports = n();
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default r();
|
|
10
|
-
export { r as require_compiler_runtime };
|