@pdf-viewer/react 1.6.0-beta.3 → 1.6.0-beta.5

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 (55) hide show
  1. package/dist/{RPDefaultLayout-f579f051.js → RPDefaultLayout-eb8d9898.js} +699 -694
  2. package/dist/assets/PasswordModal.css +1 -0
  3. package/dist/assets/RPDefaultLayout.css +1 -1
  4. package/dist/components/RPController.js +1 -1
  5. package/dist/components/RPPages.js +4 -2
  6. package/dist/components/RPProvider.js +13 -12
  7. package/dist/components/layout/LayoutContainer.js +3 -2
  8. package/dist/components/layout/RPDefaultLayout.js +1 -1
  9. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  11. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  12. package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
  13. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  14. package/dist/components/layout/toolbar/MostPageTool.js +3 -2
  15. package/dist/components/layout/toolbar/OtherTool.js +1 -1
  16. package/dist/components/layout/toolbar/Paginate.js +1 -1
  17. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  20. package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
  21. package/dist/components/layout/toolbar/SearchTool.js +3 -2
  22. package/dist/components/layout/toolbar/ZoomTool.js +1 -1
  23. package/dist/components/page/AnnotationLayer.js +3 -2
  24. package/dist/components/page/CanvasLayer.js +3 -2
  25. package/dist/components/page/DualPage.js +1 -1
  26. package/dist/components/page/RPPage.js +3 -2
  27. package/dist/components/page/SinglePage.js +1 -1
  28. package/dist/components/page/TextHighlightLayer.js +3 -2
  29. package/dist/components/page/TextLayer.js +3 -2
  30. package/dist/components/ui/LoadingIndicator.js +1 -1
  31. package/dist/components/ui/PasswordModal.js +58 -0
  32. package/dist/contexts/DocumentPasswordContext.js +40 -0
  33. package/dist/contexts/PaginationContext.js +1 -1
  34. package/dist/contexts/PrintContext.js +1 -1
  35. package/dist/contexts/RPDocumentContext.js +11 -8
  36. package/dist/contexts/SearchContext.js +1 -1
  37. package/dist/contexts/ThumbnailsContext.js +1 -1
  38. package/dist/main.js +1 -1
  39. package/dist/types/components/ui/PasswordModal.d.ts +3 -0
  40. package/dist/types/contexts/DocumentPasswordContext.d.ts +14 -0
  41. package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -0
  42. package/dist/types/utils/types.d.ts +8 -0
  43. package/dist/utils/getZoomLevel.js +13 -14
  44. package/dist/utils/hooks/useFileDownload.js +3 -2
  45. package/dist/utils/hooks/useLicense.js +1 -1
  46. package/dist/utils/hooks/useLoadPdf.js +52 -40
  47. package/dist/utils/hooks/usePaginate.js +3 -2
  48. package/dist/utils/hooks/usePresentPage.js +3 -2
  49. package/dist/utils/hooks/usePrint.js +3 -2
  50. package/dist/utils/hooks/useScrollToPage.js +3 -2
  51. package/dist/utils/hooks/useSearch.js +3 -2
  52. package/dist/utils/hooks/useThumbnail.js +3 -2
  53. package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
  54. package/dist/utils/types.js +7 -7
  55. package/package.json +1 -1
@@ -19,21 +19,24 @@ const m = C({
19
19
  onLoadError: c,
20
20
  onLoaded: P
21
21
  }) => {
22
- const [o, n] = l(e), { pdf: r, pages: s, loading: i, loadingProgress: p } = D(o, u, { onLoadError: c, onLoaded: P }), [d, f] = l(), a = F(o, r, d);
22
+ const [o, n] = l(e), [s, i] = l(), { pdf: r, pages: p, loading: d, loadingProgress: f } = D(o, u, {
23
+ onLoadError: c,
24
+ onLoaded: P
25
+ }), a = F(o, r, s);
23
26
  h(() => {
24
- f(e == null ? void 0 : e.split("/").pop()), n(e);
27
+ i(e == null ? void 0 : e.split("/").pop()), n(e);
25
28
  }, [e]);
26
29
  const g = S(() => ({
27
30
  pdf: r,
28
- pages: s,
31
+ pages: p,
29
32
  pdfSrc: o,
30
33
  setPdfSrc: n,
31
34
  pdfProperties: a,
32
- setFilename: f,
33
- filename: d,
34
- loading: i,
35
- loaderProgress: p
36
- }), [r, s, o, a, i, p]);
35
+ setFilename: i,
36
+ filename: s,
37
+ loading: d,
38
+ loaderProgress: f
39
+ }), [r, p, o, a, d, f]);
37
40
  return /* @__PURE__ */ x(m.Provider, { value: g, children: o ? t : null });
38
41
  }, b = () => {
39
42
  const t = v(m);
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { o as a, S as s, e as S } from "../RPDefaultLayout-f579f051.js";
3
+ import { o as a, S as s, e as S } from "../RPDefaultLayout-eb8d9898.js";
4
4
  export {
5
5
  a as SearchContext,
6
6
  s as SearchProvider,
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { l as i, T as r, m as e } from "../RPDefaultLayout-f579f051.js";
3
+ import { l as i, T as r, m as e } from "../RPDefaultLayout-eb8d9898.js";
4
4
  export {
5
5
  i as ThumbnailContext,
6
6
  r as ThumbnailProvider,
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RPProvider as t } from "./components/RPProvider.js";
2
- import { b as x, R as n, c as s, u as m, d as p, e as f } from "./RPDefaultLayout-f579f051.js";
2
+ import { b as x, R as n, c as s, u as m, d as p, e as f } from "./RPDefaultLayout-eb8d9898.js";
3
3
  import { RPConfig as a } from "./components/RPConfig.js";
4
4
  import { RPController as l } from "./components/RPController.js";
5
5
  import { RPTheme as P } from "./components/RPTheme.js";
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const PasswordModal: FC;
3
+ export default PasswordModal;
@@ -0,0 +1,14 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export interface DocumentPasswordContextType {
3
+ password?: string;
4
+ setPassword: React.Dispatch<React.SetStateAction<string | undefined>>;
5
+ passwordError?: string;
6
+ setPasswordError: React.Dispatch<React.SetStateAction<string | undefined>>;
7
+ passwordRequired?: boolean;
8
+ setPasswordRequired: React.Dispatch<React.SetStateAction<boolean | undefined>>;
9
+ invalidPassword?: boolean;
10
+ }
11
+ declare const DocumentPasswordContext: React.Context<DocumentPasswordContextType>;
12
+ export declare const DocumentPasswordProvider: FC<PropsWithChildren>;
13
+ export declare const useDocumentPasswordContext: () => DocumentPasswordContextType;
14
+ export default DocumentPasswordContext;
@@ -5,4 +5,6 @@ export declare const useLoadPdf: (src?: RPSrc, characterMap?: CharacterMap, opti
5
5
  pages: Map<number, PdfPage>;
6
6
  loading: boolean;
7
7
  loadingProgress: number;
8
+ passwordRequired: boolean | undefined;
9
+ passwordError: string | undefined;
8
10
  };
@@ -140,6 +140,11 @@ export type Localization = {
140
140
  propertiesPDFVersionLabel?: string;
141
141
  propertiesPageCountLabel?: string;
142
142
  thumbnailTooltip?: string;
143
+ passwordModalTitle?: string;
144
+ passwordModalMessage?: string;
145
+ passwordPlaceholder?: string;
146
+ passwordConfirmLabel?: string;
147
+ passwordError?: string;
143
148
  dragDropFileMessage?: string;
144
149
  };
145
150
  interface Attachment {
@@ -447,6 +452,9 @@ export declare enum ThemeVariables {
447
452
  CURRENT_HIGHLIGHT_BACKGROUND_COLOR = "--rp-current-highlight-background-color",
448
453
  TOOLTIP_BACKGROUND_COLOR = "--rp-tooltip-background-color",
449
454
  TOOLTIP_BORDER_RADIUS = "--rp-tooltip-border-radius",
455
+ PASSWORD_MODAL_BACKGROUND = "--rp-password-background",
456
+ PASSWORD_MODAL_TITLE_COLOR = "--rp-password-title-color",
457
+ PASSWORD_MODAL_CONTENT_COLOR = "--rp-password-content-color",
450
458
  CONTAINER_FOCUS_OUTLINE_WIDTH = "--rp-container-focus-outline-width",
451
459
  CONTAINER_FOCUS_OUTLINE_COLOR = "--rp-container-focus-outline-color",
452
460
  CONTAINER_FOCUS_OUTLINE_OFFSET = "--rp-container-focus-outline-offset"
@@ -1,24 +1,23 @@
1
- import { SCROLL_BAR_WIDTH as s } from "./constants.js";
2
- import { ZoomLevel as e, ViewMode as c } from "./types.js";
3
- const Z = (o, t, m, r, a, u) => {
1
+ import { SCROLL_BAR_WIDTH as A } from "./constants.js";
2
+ import { ZoomLevel as t, ViewMode as u } from "./types.js";
3
+ const f = 1, l = (o, e, n, r, m, a) => {
4
4
  if (typeof o == "number")
5
5
  return o;
6
6
  switch (o) {
7
- case e.ACTUAL:
7
+ case t.ACTUAL:
8
8
  return 100;
9
- case e.PAGE_FIT:
10
- let n = 0;
11
- const l = u === c.DUAL_PAGE ? 2 * r : r;
12
- return n = Math.min(
13
- (t - s) / l,
14
- m / a
15
- ), Math.floor(n * 100);
16
- case e.PAGE_WIDTH:
17
- return Math.floor(t / r * 100);
9
+ case t.PAGE_FIT:
10
+ const c = a === u.DUAL_PAGE ? 2 * r : r, s = Math.min(
11
+ (e - A) / c,
12
+ n * f / m
13
+ );
14
+ return Math.floor(s * 100);
15
+ case t.PAGE_WIDTH:
16
+ return Math.floor(e / r * 100);
18
17
  default:
19
18
  return 100;
20
19
  }
21
20
  };
22
21
  export {
23
- Z as getZoomLevel
22
+ l as getZoomLevel
24
23
  };
@@ -1,7 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../contexts/RPDocumentContext.js";
4
- import { c as C } from "../../RPDefaultLayout-f579f051.js";
4
+ import "../../contexts/DocumentPasswordContext.js";
5
+ import { c as E } from "../../RPDefaultLayout-eb8d9898.js";
5
6
  import "../../contexts/DarkModeContext.js";
6
7
  import "../../contexts/RotationContext.js";
7
8
  import "../../contexts/LayerContext.js";
@@ -28,5 +29,5 @@ import "../../contexts/ThemeContext.js";
28
29
  import "../../components/RPDropFileZone.js";
29
30
  import "../../contexts/ToolbarComponentContext.js";
30
31
  export {
31
- C as useFileDownload
32
+ E as useFileDownload
32
33
  };
@@ -1,6 +1,6 @@
1
1
  import { useState as g, useCallback as h, useEffect as A } from "react";
2
2
  import { appConsole as c } from "../appConsole.js";
3
- const b = /* @__PURE__ */ new Date("2025-05-16T04:25:03.248Z"), l = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
3
+ const b = /* @__PURE__ */ new Date("2025-05-19T03:10:31.245Z"), l = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
4
4
  invalidLicense: `You are currently using without a valid license. ${l}`,
5
5
  mismatchedDomain: `Your license key is not valid for the current domain / IP. ${l}`,
6
6
  expired: `Your license key has expired. ${l}`,
@@ -1,58 +1,70 @@
1
- import { useState as u, useRef as x, useEffect as L } from "react";
2
- import * as p from "pdfjs-dist";
3
- import { getThumbnailViewport as E } from "../getThumbnailViewport.js";
4
- import { useConfigContext as I } from "../../contexts/ConfigContext.js";
5
- const V = (d, e, y = {}) => {
6
- const [r, C] = u(), { workerUrlAdded: w } = I(), [T, b] = u(/* @__PURE__ */ new Map()), i = x(), [j, f] = u(0), [g, k] = u(!1), { onLoadError: m, onLoaded: a } = y;
7
- return L(() => {
8
- if (!w || !d)
1
+ import { useState as f, useRef as D, useEffect as C } from "react";
2
+ import * as k from "pdfjs-dist";
3
+ import { getThumbnailViewport as N } from "../getThumbnailViewport.js";
4
+ import { useConfigContext as S } from "../../contexts/ConfigContext.js";
5
+ import { useDocumentPasswordContext as U } from "../../contexts/DocumentPasswordContext.js";
6
+ const z = (m, o, I = {}) => {
7
+ const [r, q] = f(), { workerUrlAdded: x } = S(), [v, L] = f(/* @__PURE__ */ new Map()), i = D(), [R, g] = f(0), [P, y] = f(!1), {
8
+ password: d,
9
+ passwordError: T,
10
+ setPasswordError: u,
11
+ passwordRequired: c,
12
+ setPasswordRequired: a
13
+ } = U(), { onLoadError: p, onLoaded: w } = I;
14
+ return C(() => {
15
+ if (!x || !m)
9
16
  return;
10
- i.current = Date.now();
11
- const t = i.current, P = {
12
- url: d,
13
- cMapPacked: (e == null ? void 0 : e.isCompressed) ?? !0,
14
- ...(e == null ? void 0 : e.url) && { cMapUrl: e.url }
17
+ g(0), a(!1), u(""), i.current = Date.now();
18
+ const t = i.current, E = {
19
+ url: m,
20
+ cMapPacked: (o == null ? void 0 : o.isCompressed) ?? !0,
21
+ ...(o == null ? void 0 : o.url) && { cMapUrl: o.url },
22
+ ...d && { password: d }
15
23
  };
16
- console.log("currently pdfjs version", p.version, p);
17
- const n = p.getDocument(P);
18
- n.onProgress = (o) => {
24
+ console.log("currently pdfjs version", k.version, k);
25
+ const n = k.getDocument(E);
26
+ n.onProgress = (s) => {
19
27
  if (t === i.current) {
20
- const { loaded: c, total: l } = o, v = l ? Math.min(100, Math.round(c / l * 100)) : 0;
21
- f(v);
28
+ const { loaded: b, total: l } = s, j = l ? Math.min(100, Math.round(b / l * 100)) : 0;
29
+ g(j);
22
30
  }
23
- }, k(!0), f(0);
24
- const s = n.promise.then((o) => (t === i.current && (C(o), f(100)), a && a(o), o)).catch((o) => {
25
- m && m(o);
26
- }).finally(() => k(!1));
31
+ }, y(!0);
32
+ const e = n.promise.then((s) => (t === i.current && (q(s), g(100)), w && w(s), a(!1), u(""), s)).catch((s) => {
33
+ s instanceof Error && s.name === "PasswordException" ? (a(!0), u(s.message || "Password required")) : s instanceof Error && s.name === "InvalidPDFException" && d ? (a(!0), u("Incorrect password")) : p && p(s);
34
+ }).finally(() => y(!1));
27
35
  return () => {
28
- s.finally(() => {
36
+ e.finally(() => {
29
37
  n.destroy();
30
38
  });
31
39
  };
32
- }, [d, w, m, a]), L(() => {
40
+ }, [m, x, d, p, w]), C(() => {
41
+ if (c)
42
+ return;
33
43
  const t = /* @__PURE__ */ new Map();
34
- if (!r || g) {
35
- b(t);
44
+ if (!r || P) {
45
+ L(t);
36
46
  return;
37
47
  }
38
- const P = r.numPages, n = [];
39
- for (let s = 1; s <= P; s++) {
40
- const o = r.getPage(s);
41
- n.push(o);
48
+ const E = r.numPages, n = [];
49
+ for (let e = 1; e <= E; e++) {
50
+ const s = r.getPage(e);
51
+ n.push(s);
42
52
  }
43
- Promise.all(n).then((s) => {
44
- s.map((o) => {
45
- const { thumbnailViewport: c, scale: l } = E(o);
46
- t.set(o.pageNumber, { page: o, thumbnailViewport: c, thumbnailScale: l });
47
- }), b(t);
53
+ Promise.all(n).then((e) => {
54
+ e.map((s) => {
55
+ const { thumbnailViewport: b, scale: l } = N(s);
56
+ t.set(s.pageNumber, { page: s, thumbnailViewport: b, thumbnailScale: l });
57
+ }), L(t);
48
58
  });
49
- }, [r, g]), {
59
+ }, [r, P, c]), {
50
60
  pdf: r,
51
- pages: T,
52
- loading: g,
53
- loadingProgress: j
61
+ pages: v,
62
+ loading: P,
63
+ loadingProgress: R,
64
+ passwordRequired: c,
65
+ passwordError: T
54
66
  };
55
67
  };
56
68
  export {
57
- V as useLoadPdf
69
+ z as useLoadPdf
58
70
  };
@@ -1,7 +1,8 @@
1
1
  import "react";
2
- import { g as E } from "../../RPDefaultLayout-f579f051.js";
2
+ import { g as F } from "../../RPDefaultLayout-eb8d9898.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../contexts/RPDocumentContext.js";
5
+ import "../../contexts/DocumentPasswordContext.js";
5
6
  import "../../contexts/DarkModeContext.js";
6
7
  import "../../contexts/RotationContext.js";
7
8
  import "../../contexts/LayerContext.js";
@@ -29,5 +30,5 @@ import "../../components/RPDropFileZone.js";
29
30
  import "../../contexts/ToolbarComponentContext.js";
30
31
  import "./useDebounce.js";
31
32
  export {
32
- E as usePaginate
33
+ F as usePaginate
33
34
  };
@@ -4,7 +4,8 @@ import "../../contexts/DimensionPagesContext.js";
4
4
  import "../calculatePage.js";
5
5
  import "react/jsx-runtime";
6
6
  import "../../contexts/RPDocumentContext.js";
7
- import { v as F } from "../../RPDefaultLayout-f579f051.js";
7
+ import "../../contexts/DocumentPasswordContext.js";
8
+ import { v as G } from "../../RPDefaultLayout-eb8d9898.js";
8
9
  import "../../contexts/DarkModeContext.js";
9
10
  import "../../contexts/RotationContext.js";
10
11
  import "../../contexts/LayerContext.js";
@@ -30,5 +31,5 @@ import "../../components/RPDropFileZone.js";
30
31
  import "../../contexts/ToolbarComponentContext.js";
31
32
  import "./useDebounce.js";
32
33
  export {
33
- F as usePresentPage
34
+ G as usePresentPage
34
35
  };
@@ -1,7 +1,8 @@
1
1
  import "react";
2
2
  import "react/jsx-runtime";
3
3
  import "../../contexts/RPDocumentContext.js";
4
- import { i as E } from "../../RPDefaultLayout-f579f051.js";
4
+ import "../../contexts/DocumentPasswordContext.js";
5
+ import { i as F } from "../../RPDefaultLayout-eb8d9898.js";
5
6
  import "../../contexts/DarkModeContext.js";
6
7
  import "../../contexts/RotationContext.js";
7
8
  import "../../contexts/LayerContext.js";
@@ -29,5 +30,5 @@ import "../../components/RPDropFileZone.js";
29
30
  import "../../contexts/ToolbarComponentContext.js";
30
31
  import "pdfjs-dist";
31
32
  export {
32
- E as usePrint
33
+ F as usePrint
33
34
  };
@@ -2,7 +2,8 @@ import "react";
2
2
  import "../../contexts/ScrollModeContext.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../contexts/RPDocumentContext.js";
5
- import { f as D } from "../../RPDefaultLayout-f579f051.js";
5
+ import "../../contexts/DocumentPasswordContext.js";
6
+ import { f as E } from "../../RPDefaultLayout-eb8d9898.js";
6
7
  import "../../contexts/DarkModeContext.js";
7
8
  import "../types.js";
8
9
  import "../../contexts/RotationContext.js";
@@ -30,5 +31,5 @@ import "../../components/RPDropFileZone.js";
30
31
  import "../../contexts/ToolbarComponentContext.js";
31
32
  import "../smoothScrollTo.js";
32
33
  export {
33
- D as useScrollToPage
34
+ E as useScrollToPage
34
35
  };
@@ -7,7 +7,8 @@ import "pdfjs-dist";
7
7
  import "../../contexts/RPDocumentContext.js";
8
8
  import "../../contexts/ZoomContext.js";
9
9
  import "react/jsx-runtime";
10
- import { n as G } from "../../RPDefaultLayout-f579f051.js";
10
+ import "../../contexts/DocumentPasswordContext.js";
11
+ import { n as H } from "../../RPDefaultLayout-eb8d9898.js";
11
12
  import "../../contexts/DarkModeContext.js";
12
13
  import "../../contexts/RotationContext.js";
13
14
  import "../../contexts/LayerContext.js";
@@ -31,5 +32,5 @@ import "../../contexts/ThemeContext.js";
31
32
  import "../../components/RPDropFileZone.js";
32
33
  import "../../contexts/ToolbarComponentContext.js";
33
34
  export {
34
- G as useSearch
35
+ H as useSearch
35
36
  };
@@ -2,7 +2,8 @@ import "react";
2
2
  import "../renderPage.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../contexts/RPDocumentContext.js";
5
- import { k as F } from "../../RPDefaultLayout-f579f051.js";
5
+ import "../../contexts/DocumentPasswordContext.js";
6
+ import { k as G } from "../../RPDefaultLayout-eb8d9898.js";
6
7
  import "../../contexts/DarkModeContext.js";
7
8
  import "../../contexts/RotationContext.js";
8
9
  import "../../contexts/LayerContext.js";
@@ -30,5 +31,5 @@ import "../../components/RPDropFileZone.js";
30
31
  import "../../contexts/ToolbarComponentContext.js";
31
32
  import "../getThumbnailViewport.js";
32
33
  export {
33
- F as useThumbnail
34
+ G as useThumbnail
34
35
  };
@@ -3,7 +3,8 @@ import "../types.js";
3
3
  import "../../contexts/ScrollModeContext.js";
4
4
  import "react/jsx-runtime";
5
5
  import "../../contexts/RPDocumentContext.js";
6
- import { s as C } from "../../RPDefaultLayout-f579f051.js";
6
+ import "../../contexts/DocumentPasswordContext.js";
7
+ import { s as D } from "../../RPDefaultLayout-eb8d9898.js";
7
8
  import "../../contexts/DarkModeContext.js";
8
9
  import "../../contexts/RotationContext.js";
9
10
  import "../../contexts/LayerContext.js";
@@ -29,5 +30,5 @@ import "../../contexts/ThemeContext.js";
29
30
  import "../../components/RPDropFileZone.js";
30
31
  import "../../contexts/ToolbarComponentContext.js";
31
32
  export {
32
- C as useVirtualReactWindow
33
+ D as useVirtualReactWindow
33
34
  };
@@ -1,20 +1,20 @@
1
- import { e as r, z as _, i as R, p as o, t as E } from "../th_TH-2c4015a5.js";
2
- var I = /* @__PURE__ */ ((O) => (O[O.Text = 1] = "Text", O[O.Link = 2] = "Link", O[O.FreeText = 3] = "FreeText", O[O.Line = 4] = "Line", O[O.Square = 5] = "Square", O[O.Circle = 6] = "Circle", O[O.Polygon = 7] = "Polygon", O[O.Polyline = 8] = "Polyline", O[O.Highlight = 9] = "Highlight", O[O.Underline = 10] = "Underline", O[O.Squiggly = 11] = "Squiggly", O[O.StrikeOut = 12] = "StrikeOut", O[O.Stamp = 13] = "Stamp", O[O.Caret = 14] = "Caret", O[O.Ink = 15] = "Ink", O[O.Popup = 16] = "Popup", O[O.FileAttachment = 17] = "FileAttachment", O[O.Widget = 20] = "Widget", O))(I || {}), p = /* @__PURE__ */ ((O) => (O.INTERNAL_LINK = "internal-link", O.LINK = "link", O.FILE_ATTACHMENT = "file-attachment", O.FORM_TEXT = "form-text", O.FORM_SELECT = "form-select", O.FORM_CHECKBOX = "form-checkbox", O.FORM_RADIO = "form-radio", O.FORM_BUTTON = "form-button", O.BUTTON = "button", O))(p || {}), N = /* @__PURE__ */ ((O) => (O.ACTUAL = "Actual", O.PAGE_FIT = "Fit", O.PAGE_WIDTH = "Width", O))(N || {}), D = /* @__PURE__ */ ((O) => (O.Organization = "organization", O.Developer = "developer", O))(D || {}), d = /* @__PURE__ */ ((O) => (O.SINGLE_PAGE = "Single", O.DUAL_PAGE = "Dual", O))(d || {}), L = /* @__PURE__ */ ((O) => (O.FONT_FAMILY = "--rp-font-family", O.PRIMARY_COLOR = "--rp-primary-color", O.BORDER_RADIUS = "--rp-border-radius", O.TEXT_COLOR = "--rp-text-color", O.OUTLINE_COLOR = "--rp-outline-color", O.FONT_SIZE = "--rp-font-size", O.DROP_MASK_BACKGROUND_COLOR = "--rp-drop-mask-background-color", O.LOADER_BACKDROP_COLOR = "--rp-loader-backdrop-color", O.ICON_DISABLED = "--rp-icon-disabled", O.ICON_FONT_SIZE = "--rp-icon-font-size", O.TOOLBAR_BACKGROUND = "--rp-toolbar-background", O.TOOLBAR_BORDER_COLOR = "--rp-toolbar-border-color", O.TOOLBAR_PADDING = "--rp-toolbar-padding", O.TOOLBAR_GAP = "--rp-toolbar-gap", O.TOOLBAR_SIZE = "--rp-toolbar-size", O.SIDEBAR_WIDTH = "--rp-sidebar-width", O.THUMBNAIL_BORDER_COLOR = "--rp-thumbnail-border-color", O.THUMBNAIL_BACKGROUND_COLOR = "--rp-thumbnail-background-color", O.THUMBNAIL_ACTIVE_COLOR = "--rp-thumbnail-active-color", O.THUMBNAIL_PADDING_Y = "--rp-thumbnail-padding-y", O.BUTTON_HOVER_BACKGROUND = "--rp-button-hover-background", O.BUTTON_PADDING = "--rp-button-padding", O.INPUT_PADDING = "--rp-input-padding", O.INPUT_BORDER_RADIUS = "--rp-input-border-radius", O.INPUT_BACKGROUND_COLOR = "--rp-input-background-color", O.INPUT_PLACEHOLDER_COLOR = "--rp-input-placeholder-color", O.PAGES_BACKGROUND_COLOR = "--rp-pages-background-color", O.ANNOTATION_LAYER_LINK_HOVER_BACKGROUND = "--rp-annotation-layer__link-hover-background", O.DROPDOWN_BACKGROUND_COLOR = "--rp-dropdown-background-color", O.DROPDOWN_PADDING = "--rp-dropdown-padding", O.DROPDOWN_HOVER_BACKGROUND_COLOR = "--rp-dropdown-hover-background-color", O.DROPDOWN_SEPARATOR_COLOR = "--rp-dropdown-separator-color", O.DROPDOWN_SEPARATOR_MARGIN = "--rp-dropdown-separator-margin", O.DROPDOWN_PADDING_MENU_ITEM = "--rp-dropdown-padding-menu-item", O.DROPDOWN_FONT_SIZE = "--rp-dropdown-font-size", O.DROPDOWN_BORDER_RADIUS = "--rp-dropdown-border-radius", O.SEARCH_TOOL_DROPDOWN_PADDING = "--rp-search-tool-dropdown-padding", O.POPOVER_FONT_SIZE = "--rp-popover-font-size", O.POPOVER_BACKGROUND_COLOR = "--rp-popover-background-color", O.POPOVER_COLOR = "--rp-popover-color", O.POPOVER_BORDER_COLOR = "--rp-popover-border-color", O.POPOVER_BORDER_RADIUS = "--rp-popover-border-radius", O.OVERLAY_BACKGROUND_COLOR = "--rp-overlay-background-color", O.DIALOG_BACKGROUND_COLOR = "--rp-dialog-background-color", O.PROPERTIES_DIVIDER_COLOR = "--rp-properties-divider-color", O.PROPERTIES_DIVIDER_MARGIN = "--rp-properties-divider-margin", O.PROPERTY_ITEM_GAP = "--rp-property-item-gap", O.DIALOG_TITLE_COLOR = "--rp-dialog-title-color", O.PROPERTY_ITEM_LABEL_COLOR = "--rp-property-item-label-color", O.PROPERTY_CLOSE_ICON_SIZE = "--rp-property-close-icon-size", O.PROPERTY_ITEM_FONT_SIZE = "--rp-property-item-font-size", O.PROPERTY_ITEM_FONT_WEIGHT = "--rp-property-item-font-weight", O.DIALOG_TITLE_FONT_SIZE = "--rp-dialog-title-font-size", O.DIALOG_TITLE_FONT_WEIGHT = "--rp-dialog-title-font-weight", O.MENU_ITEM_ICON_SIZE = "--rp-menu-item-icon-size", O.PRINT_PROGRESS_BACKGROUND = "--rp-print-progress-background", O.PRINT_PROGRESS_COLOR = "--rp-print-progress-color", O.DROP_ZONE_BORDER = "--rp-drop-zone-border", O.DROP_ZONE_FONT_COLOR = "--rp-drop-zone-font-color", O.DROP_ZONE_FONT_SIZE = "--rp-drop-zone-font-size", O.DROP_ZONE_BACKGROUND_COLOR = "--rp-drop-zone-background-color", O.CHECKBOX_BORDER_RADIUS = "--rp-checkbox-border-radius", O.CHECKBOX_BORDER_COLOR = "--rp-checkbox-border-color", O.CHECKBOX_INDICATOR_COLOR = "--rp-checkbox-indicator-color", O.HIGHLIGHT_BACKGROUND_COLOR = "--rp-highlight-background-color", O.TEXT_LAYER_HIGHLIGHT_BORDER_RADIUS = "--rp-text-layer-highlight-border-radius", O.CURRENT_HIGHLIGHT_BACKGROUND_COLOR = "--rp-current-highlight-background-color", O.TOOLTIP_BACKGROUND_COLOR = "--rp-tooltip-background-color", O.TOOLTIP_BORDER_RADIUS = "--rp-tooltip-border-radius", O.CONTAINER_FOCUS_OUTLINE_WIDTH = "--rp-container-focus-outline-width", O.CONTAINER_FOCUS_OUTLINE_COLOR = "--rp-container-focus-outline-color", O.CONTAINER_FOCUS_OUTLINE_OFFSET = "--rp-container-focus-outline-offset", O))(L || {}), C = /* @__PURE__ */ ((O) => (O.PAGE_SCROLLING = "PAGE", O.VERTICAL_SCROLLING = "VERTICAL", O.HORIZONTAL_SCROLLING = "HORIZONTAL", O))(C || {}), c = /* @__PURE__ */ ((O) => (O.TEXT = "TEXT", O.HAND = "HAND", O))(c || {});
1
+ import { e as r, z as _, i as R, p as o, t as p } from "../th_TH-2c4015a5.js";
2
+ var E = /* @__PURE__ */ ((O) => (O[O.Text = 1] = "Text", O[O.Link = 2] = "Link", O[O.FreeText = 3] = "FreeText", O[O.Line = 4] = "Line", O[O.Square = 5] = "Square", O[O.Circle = 6] = "Circle", O[O.Polygon = 7] = "Polygon", O[O.Polyline = 8] = "Polyline", O[O.Highlight = 9] = "Highlight", O[O.Underline = 10] = "Underline", O[O.Squiggly = 11] = "Squiggly", O[O.StrikeOut = 12] = "StrikeOut", O[O.Stamp = 13] = "Stamp", O[O.Caret = 14] = "Caret", O[O.Ink = 15] = "Ink", O[O.Popup = 16] = "Popup", O[O.FileAttachment = 17] = "FileAttachment", O[O.Widget = 20] = "Widget", O))(E || {}), I = /* @__PURE__ */ ((O) => (O.INTERNAL_LINK = "internal-link", O.LINK = "link", O.FILE_ATTACHMENT = "file-attachment", O.FORM_TEXT = "form-text", O.FORM_SELECT = "form-select", O.FORM_CHECKBOX = "form-checkbox", O.FORM_RADIO = "form-radio", O.FORM_BUTTON = "form-button", O.BUTTON = "button", O))(I || {}), D = /* @__PURE__ */ ((O) => (O.ACTUAL = "Actual", O.PAGE_FIT = "Fit", O.PAGE_WIDTH = "Width", O))(D || {}), N = /* @__PURE__ */ ((O) => (O.Organization = "organization", O.Developer = "developer", O))(N || {}), d = /* @__PURE__ */ ((O) => (O.SINGLE_PAGE = "Single", O.DUAL_PAGE = "Dual", O))(d || {}), L = /* @__PURE__ */ ((O) => (O.FONT_FAMILY = "--rp-font-family", O.PRIMARY_COLOR = "--rp-primary-color", O.BORDER_RADIUS = "--rp-border-radius", O.TEXT_COLOR = "--rp-text-color", O.OUTLINE_COLOR = "--rp-outline-color", O.FONT_SIZE = "--rp-font-size", O.DROP_MASK_BACKGROUND_COLOR = "--rp-drop-mask-background-color", O.LOADER_BACKDROP_COLOR = "--rp-loader-backdrop-color", O.ICON_DISABLED = "--rp-icon-disabled", O.ICON_FONT_SIZE = "--rp-icon-font-size", O.TOOLBAR_BACKGROUND = "--rp-toolbar-background", O.TOOLBAR_BORDER_COLOR = "--rp-toolbar-border-color", O.TOOLBAR_PADDING = "--rp-toolbar-padding", O.TOOLBAR_GAP = "--rp-toolbar-gap", O.TOOLBAR_SIZE = "--rp-toolbar-size", O.SIDEBAR_WIDTH = "--rp-sidebar-width", O.THUMBNAIL_BORDER_COLOR = "--rp-thumbnail-border-color", O.THUMBNAIL_BACKGROUND_COLOR = "--rp-thumbnail-background-color", O.THUMBNAIL_ACTIVE_COLOR = "--rp-thumbnail-active-color", O.THUMBNAIL_PADDING_Y = "--rp-thumbnail-padding-y", O.BUTTON_HOVER_BACKGROUND = "--rp-button-hover-background", O.BUTTON_PADDING = "--rp-button-padding", O.INPUT_PADDING = "--rp-input-padding", O.INPUT_BORDER_RADIUS = "--rp-input-border-radius", O.INPUT_BACKGROUND_COLOR = "--rp-input-background-color", O.INPUT_PLACEHOLDER_COLOR = "--rp-input-placeholder-color", O.PAGES_BACKGROUND_COLOR = "--rp-pages-background-color", O.ANNOTATION_LAYER_LINK_HOVER_BACKGROUND = "--rp-annotation-layer__link-hover-background", O.DROPDOWN_BACKGROUND_COLOR = "--rp-dropdown-background-color", O.DROPDOWN_PADDING = "--rp-dropdown-padding", O.DROPDOWN_HOVER_BACKGROUND_COLOR = "--rp-dropdown-hover-background-color", O.DROPDOWN_SEPARATOR_COLOR = "--rp-dropdown-separator-color", O.DROPDOWN_SEPARATOR_MARGIN = "--rp-dropdown-separator-margin", O.DROPDOWN_PADDING_MENU_ITEM = "--rp-dropdown-padding-menu-item", O.DROPDOWN_FONT_SIZE = "--rp-dropdown-font-size", O.DROPDOWN_BORDER_RADIUS = "--rp-dropdown-border-radius", O.SEARCH_TOOL_DROPDOWN_PADDING = "--rp-search-tool-dropdown-padding", O.POPOVER_FONT_SIZE = "--rp-popover-font-size", O.POPOVER_BACKGROUND_COLOR = "--rp-popover-background-color", O.POPOVER_COLOR = "--rp-popover-color", O.POPOVER_BORDER_COLOR = "--rp-popover-border-color", O.POPOVER_BORDER_RADIUS = "--rp-popover-border-radius", O.OVERLAY_BACKGROUND_COLOR = "--rp-overlay-background-color", O.DIALOG_BACKGROUND_COLOR = "--rp-dialog-background-color", O.PROPERTIES_DIVIDER_COLOR = "--rp-properties-divider-color", O.PROPERTIES_DIVIDER_MARGIN = "--rp-properties-divider-margin", O.PROPERTY_ITEM_GAP = "--rp-property-item-gap", O.DIALOG_TITLE_COLOR = "--rp-dialog-title-color", O.PROPERTY_ITEM_LABEL_COLOR = "--rp-property-item-label-color", O.PROPERTY_CLOSE_ICON_SIZE = "--rp-property-close-icon-size", O.PROPERTY_ITEM_FONT_SIZE = "--rp-property-item-font-size", O.PROPERTY_ITEM_FONT_WEIGHT = "--rp-property-item-font-weight", O.DIALOG_TITLE_FONT_SIZE = "--rp-dialog-title-font-size", O.DIALOG_TITLE_FONT_WEIGHT = "--rp-dialog-title-font-weight", O.MENU_ITEM_ICON_SIZE = "--rp-menu-item-icon-size", O.PRINT_PROGRESS_BACKGROUND = "--rp-print-progress-background", O.PRINT_PROGRESS_COLOR = "--rp-print-progress-color", O.DROP_ZONE_BORDER = "--rp-drop-zone-border", O.DROP_ZONE_FONT_COLOR = "--rp-drop-zone-font-color", O.DROP_ZONE_FONT_SIZE = "--rp-drop-zone-font-size", O.DROP_ZONE_BACKGROUND_COLOR = "--rp-drop-zone-background-color", O.CHECKBOX_BORDER_RADIUS = "--rp-checkbox-border-radius", O.CHECKBOX_BORDER_COLOR = "--rp-checkbox-border-color", O.CHECKBOX_INDICATOR_COLOR = "--rp-checkbox-indicator-color", O.HIGHLIGHT_BACKGROUND_COLOR = "--rp-highlight-background-color", O.TEXT_LAYER_HIGHLIGHT_BORDER_RADIUS = "--rp-text-layer-highlight-border-radius", O.CURRENT_HIGHLIGHT_BACKGROUND_COLOR = "--rp-current-highlight-background-color", O.TOOLTIP_BACKGROUND_COLOR = "--rp-tooltip-background-color", O.TOOLTIP_BORDER_RADIUS = "--rp-tooltip-border-radius", O.PASSWORD_MODAL_BACKGROUND = "--rp-password-background", O.PASSWORD_MODAL_TITLE_COLOR = "--rp-password-title-color", O.PASSWORD_MODAL_CONTENT_COLOR = "--rp-password-content-color", O.CONTAINER_FOCUS_OUTLINE_WIDTH = "--rp-container-focus-outline-width", O.CONTAINER_FOCUS_OUTLINE_COLOR = "--rp-container-focus-outline-color", O.CONTAINER_FOCUS_OUTLINE_OFFSET = "--rp-container-focus-outline-offset", O))(L || {}), C = /* @__PURE__ */ ((O) => (O.PAGE_SCROLLING = "PAGE", O.VERTICAL_SCROLLING = "VERTICAL", O.HORIZONTAL_SCROLLING = "HORIZONTAL", O))(C || {}), c = /* @__PURE__ */ ((O) => (O.TEXT = "TEXT", O.HAND = "HAND", O))(c || {});
3
3
  const g = {
4
4
  en_US: r,
5
5
  zh_CN: _,
6
6
  it_IT: R,
7
7
  pt_PT: o,
8
- th_TH: E
8
+ th_TH: p
9
9
  };
10
10
  export {
11
- I as AnnotationSubType,
12
- p as AnnotationType,
13
- D as LicenseType,
11
+ E as AnnotationSubType,
12
+ I as AnnotationType,
13
+ N as LicenseType,
14
14
  g as Locales,
15
15
  C as ScrollMode,
16
16
  c as SelectionMode,
17
17
  L as ThemeVariables,
18
18
  d as ViewMode,
19
- N as ZoomLevel
19
+ D as ZoomLevel
20
20
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pdf-viewer/react",
3
3
  "private": false,
4
4
  "description": "The PDF Viewer component for React and Next.js",
5
- "version": "1.6.0-beta.3",
5
+ "version": "1.6.0-beta.5",
6
6
  "keywords": [
7
7
  "component",
8
8
  "frontend",