pdf-tsx 0.1.6 → 0.2.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.
Files changed (40) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +263 -212
  3. package/dist/cjs/components/PDFSidebar.module.cjs +1 -1
  4. package/dist/cjs/components/PDFViewer.cjs +1 -1
  5. package/dist/cjs/components/PDFViewer.module.cjs +1 -1
  6. package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
  7. package/dist/cjs/components/features/PDFNavigation.module.cjs +1 -1
  8. package/dist/cjs/components/features/PDFOutline.module.cjs +1 -1
  9. package/dist/cjs/components/features/PDFSearch.module.cjs +1 -1
  10. package/dist/cjs/components/features/PDFSignatures.module.cjs +1 -1
  11. package/dist/cjs/components/features/PDFThumbnails.module.cjs +1 -1
  12. package/dist/cjs/components/features/PDFZoomControls.module.cjs +1 -1
  13. package/dist/cjs/components/ui/ToolbarButton.module.cjs +1 -1
  14. package/dist/cjs/context/ThemeContext.cjs +1 -1
  15. package/dist/cjs/hooks/useTextLayer.cjs +1 -1
  16. package/dist/cjs/index.cjs +1 -1
  17. package/dist/cjs/pdf-tsx.css +1 -1
  18. package/dist/components/PDFViewer.d.ts +5 -0
  19. package/dist/context/ThemeContext.d.ts +7 -2
  20. package/dist/es/components/PDFSidebar.module.js +7 -7
  21. package/dist/es/components/PDFViewer.js +165 -162
  22. package/dist/es/components/PDFViewer.module.js +15 -12
  23. package/dist/es/components/features/PDFAnnotations.module.js +10 -10
  24. package/dist/es/components/features/PDFNavigation.module.js +3 -3
  25. package/dist/es/components/features/PDFOutline.module.js +5 -5
  26. package/dist/es/components/features/PDFSearch.module.js +4 -4
  27. package/dist/es/components/features/PDFSignatures.module.js +14 -14
  28. package/dist/es/components/features/PDFThumbnails.module.js +7 -7
  29. package/dist/es/components/features/PDFZoomControls.module.js +1 -1
  30. package/dist/es/components/ui/ToolbarButton.module.js +2 -2
  31. package/dist/es/context/ThemeContext.js +31 -24
  32. package/dist/es/hooks/useTextLayer.js +0 -1
  33. package/dist/es/index.js +17 -16
  34. package/dist/es/pdf-tsx.css +1 -1
  35. package/dist/index.d.ts +2 -0
  36. package/package.json +61 -61
  37. package/dist/pdf-tsx.cjs.js +0 -5
  38. package/dist/pdf-tsx.css +0 -2
  39. package/dist/pdf-tsx.es.js +0 -2637
  40. package/dist/vite.svg +0 -1
@@ -5,31 +5,38 @@ import { jsx as s } from "react/jsx-runtime";
5
5
  //#region src/context/ThemeContext.tsx
6
6
  var c = r(null);
7
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
- let h = m, g;
11
- i[2] === Symbol.for("react.memo_cache_sentinel") ? (g = () => f(u), i[2] = g) : g = i[2];
12
- let _;
13
- i[3] !== d || i[4] !== p ? (_ = {
14
- isDark: d,
15
- toggleTheme: g,
16
- theme: p
17
- }, i[3] = d, i[4] = p, i[5] = _) : _ = i[5];
18
- let v = h, y;
19
- i[6] === v ? y = i[7] : (y = {
20
- ...v,
21
- display: "contents"
22
- }, i[6] = v, i[7] = y);
23
- let b;
24
- i[8] !== l || i[9] !== y ? (b = /* @__PURE__ */ s("div", {
25
- style: y,
26
- children: l
27
- }), i[8] = l, i[9] = y, i[10] = b) : b = i[10];
8
+ let i = o(17), { children: l, themeOverrides: d } = r, [f, p] = a(!0), m, h;
9
+ i[0] !== f || i[1] !== d?.dark || i[2] !== d?.light ? (h = f ? {
10
+ ...e,
11
+ ...d?.dark
12
+ } : {
13
+ ...t,
14
+ ...d?.light
15
+ }, m = n(h), i[0] = f, i[1] = d?.dark, i[2] = d?.light, i[3] = m, i[4] = h) : (m = i[3], h = i[4]);
16
+ let g = m, _;
17
+ i[5] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => p(u), i[5] = _) : _ = i[5];
18
+ let v;
19
+ i[6] !== f || i[7] !== h ? (v = {
20
+ isDark: f,
21
+ toggleTheme: _,
22
+ theme: h
23
+ }, i[6] = f, i[7] = h, i[8] = v) : v = i[8];
24
+ let y = g, b;
25
+ i[9] === y ? b = i[10] : (b = {
26
+ ...y,
27
+ height: "100%",
28
+ width: "100%"
29
+ }, i[9] = y, i[10] = b);
28
30
  let x;
29
- return i[11] !== _ || i[12] !== b ? (x = /* @__PURE__ */ s(c.Provider, {
30
- value: _,
31
- children: b
32
- }), i[11] = _, i[12] = b, i[13] = x) : x = i[13], x;
31
+ i[11] !== l || i[12] !== b ? (x = /* @__PURE__ */ s("div", {
32
+ style: b,
33
+ children: l
34
+ }), i[11] = l, i[12] = b, i[13] = x) : x = i[13];
35
+ let S;
36
+ return i[14] !== v || i[15] !== x ? (S = /* @__PURE__ */ s(c.Provider, {
37
+ value: v,
38
+ children: x
39
+ }), i[14] = v, i[15] = x, i[16] = S) : S = i[16], S;
33
40
  }
34
41
  function u(e) {
35
42
  return !e;
@@ -1,4 +1,3 @@
1
- /* empty css */
2
1
  import { useEffect as e, useRef as t } from "react";
3
2
  import * as n from "pdfjs-dist";
4
3
  import { c as r } from "react/compiler-runtime";
package/dist/es/index.js CHANGED
@@ -1,16 +1,17 @@
1
- import e from "./components/PDFViewer.js";
2
- import { PDFSidebar as t } from "./components/PDFSidebar.js";
3
- import { PDFAnnotations as n } from "./components/features/PDFAnnotations.js";
4
- import { PDFChangeFile as r } from "./components/features/PDFChangeFile.js";
5
- import { PDFDownloadButton as i } from "./components/features/PDFDownloadButton.js";
6
- import { PDFNavigation as a } from "./components/features/PDFNavigation.js";
7
- import { PDFOutline as o } from "./components/features/PDFOutline.js";
8
- import { PDFPageFit as s } from "./components/features/PDFPageFit.js";
9
- import { PDFRotationControl as c } from "./components/features/PDFRotationControl.js";
10
- import { PDFSearch as l } from "./components/features/PDFSearch.js";
11
- import { PDFSignatures as u } from "./components/features/PDFSignatures.js";
12
- import { PDFThumbnails as d } from "./components/features/PDFThumbnails.js";
13
- import { PDFZoomControls as f } from "./components/features/PDFZoomControls.js";
14
- import { PDFThemeToggle as p } from "./components/features/PDFThemeToggle.js";
15
- import { PDFPrintButton as m } from "./components/features/PDFPrintButton.js";
16
- export { n as PDFAnnotations, r as PDFChangeFile, i as PDFDownloadButton, a as PDFNavigation, o as PDFOutline, s as PDFPageFit, m as PDFPrintButton, c as PDFRotationControl, l as PDFSearch, t as PDFSidebar, u as PDFSignatures, p as PDFThemeToggle, d as PDFThumbnails, e as PDFViewer, f as PDFZoomControls };
1
+ import { darkTheme as e, lightTheme as t } from "./theme.js";
2
+ import n from "./components/PDFViewer.js";
3
+ import { PDFSidebar as r } from "./components/PDFSidebar.js";
4
+ import { PDFAnnotations as i } from "./components/features/PDFAnnotations.js";
5
+ import { PDFChangeFile as a } from "./components/features/PDFChangeFile.js";
6
+ import { PDFDownloadButton as o } from "./components/features/PDFDownloadButton.js";
7
+ import { PDFNavigation as s } from "./components/features/PDFNavigation.js";
8
+ import { PDFOutline as c } from "./components/features/PDFOutline.js";
9
+ import { PDFPageFit as l } from "./components/features/PDFPageFit.js";
10
+ import { PDFRotationControl as u } from "./components/features/PDFRotationControl.js";
11
+ import { PDFSearch as d } from "./components/features/PDFSearch.js";
12
+ import { PDFSignatures as f } from "./components/features/PDFSignatures.js";
13
+ import { PDFThumbnails as p } from "./components/features/PDFThumbnails.js";
14
+ import { PDFZoomControls as m } from "./components/features/PDFZoomControls.js";
15
+ import { PDFThemeToggle as h } from "./components/features/PDFThemeToggle.js";
16
+ import { PDFPrintButton as g } from "./components/features/PDFPrintButton.js";
17
+ export { i as PDFAnnotations, a as PDFChangeFile, o as PDFDownloadButton, s as PDFNavigation, c as PDFOutline, l as PDFPageFit, g as PDFPrintButton, u as PDFRotationControl, d as PDFSearch, r as PDFSidebar, f as PDFSignatures, h as PDFThemeToggle, p as PDFThumbnails, n as PDFViewer, m as PDFZoomControls, e as darkTheme, t as lightTheme };