@react-pdf-kit/viewer 2.8.0-beta.9 → 2.9.0-beta.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 (112) hide show
  1. package/README.md +10 -0
  2. package/dist/{Button-BNlmxWrV.js → Button-DBu3SaMk.js} +1 -1
  3. package/dist/{Checkbox-Brta-YKG.js → Checkbox-CSIEUyO8.js} +4 -4
  4. package/dist/{Combination-DqNkTtir.js → Combination-11kyhTGt.js} +15 -15
  5. package/dist/{Container-BxNZX82X.js → Container-BuamPhw4.js} +1 -1
  6. package/dist/{DocumentDialog-C9G7lVTh.js → DocumentDialog-cRr9sSSH.js} +4 -4
  7. package/dist/{DropDown-DikL-krI.js → DropDown-CM6xEwZC.js} +2 -2
  8. package/dist/{Input-DjSWOjCI.js → Input-Dpo1Xfxe.js} +1 -1
  9. package/dist/{LoaderIcon-D9YjinGf.js → LoaderIcon-B3ddfd0D.js} +1 -1
  10. package/dist/{LoadingIndicator-B_Jsf8No.js → LoadingIndicator-0E8WHnSN.js} +1 -1
  11. package/dist/{MenuItem-D-GflAAo.js → MenuItem-lItnKNd5.js} +2 -2
  12. package/dist/{MenuSeparator-D1H5l8Ej.js → MenuSeparator-CaFxd8b5.js} +1 -1
  13. package/dist/{PasswordModal-S0leMhEd.js → PasswordModal-CxHFn0pB.js} +1 -1
  14. package/dist/{RPDropFileZone-D1C3ouep.js → RPDropFileZone-Bq1bzWmO.js} +1 -1
  15. package/dist/RPPages-cyO0Tn21.js +690 -0
  16. package/dist/{RPTooltip-COLVx-C_.js → RPTooltip-QWwWh4HW.js} +4 -4
  17. package/dist/{Thumbnail-C6zkvwcs.js → Thumbnail-BXMk0OWF.js} +2 -2
  18. package/dist/{Thumbnails-DKG6I7pb.js → Thumbnails-BIuN8LZ8.js} +1 -1
  19. package/dist/{clsx-B7LyVm5O.js → clsx-DSGuh5YW.js} +1 -1
  20. package/dist/components/RPConfig.js +5 -4
  21. package/dist/components/RPDropFileZone.js +1 -1
  22. package/dist/components/RPPages.js +1 -1
  23. package/dist/components/icons/LoaderIcon.js +1 -1
  24. package/dist/components/layout/Container.js +1 -1
  25. package/dist/components/layout/LayoutContainer.js +1 -1
  26. package/dist/components/layout/RPDefaultLayout.js +2 -2
  27. package/dist/components/layout/RPLayout.js +2 -2
  28. package/dist/components/layout/sidebar/RPSidebar.js +3 -3
  29. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  30. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  31. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  32. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  33. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  34. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -3
  35. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  36. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  37. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  38. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  39. package/dist/components/layout/toolbar/MostPageTool.js +4 -4
  40. package/dist/components/layout/toolbar/OtherTool.js +6 -6
  41. package/dist/components/layout/toolbar/Paginate.js +3 -3
  42. package/dist/components/layout/toolbar/PrintTool.js +3 -3
  43. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  44. package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
  45. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  46. package/dist/components/layout/toolbar/RotateTool.js +4 -4
  47. package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
  48. package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
  49. package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
  50. package/dist/components/layout/toolbar/SearchTool.js +6 -6
  51. package/dist/components/layout/toolbar/SelectionModeTool.js +4 -4
  52. package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
  53. package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
  54. package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
  55. package/dist/components/layout/toolbar/ViewModeTool.js +4 -4
  56. package/dist/components/layout/toolbar/ZoomTool.js +7 -7
  57. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
  58. package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
  59. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
  60. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
  61. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  62. package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
  63. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  64. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
  65. package/dist/components/layout/toolbar/tools/InputPageTool.js +2 -2
  66. package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
  67. package/dist/components/layout/toolbar/tools/NextPageTool.js +2 -2
  68. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
  69. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +2 -2
  70. package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
  71. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  72. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  73. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  74. package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
  75. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  76. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
  77. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
  78. package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
  79. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
  80. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
  81. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
  82. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
  83. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
  84. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
  85. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +4 -4
  86. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
  87. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
  88. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  89. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
  90. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
  91. package/dist/components/ui/Button.js +1 -1
  92. package/dist/components/ui/Checkbox.js +1 -1
  93. package/dist/components/ui/DropDown.js +1 -1
  94. package/dist/components/ui/Input.js +1 -1
  95. package/dist/components/ui/LoadingIndicator.js +1 -1
  96. package/dist/components/ui/PasswordModal.js +1 -1
  97. package/dist/components/ui/RPTooltip.js +1 -1
  98. package/dist/contexts/ConfigContext.js +2 -1
  99. package/dist/contexts/LoaderContext.js +1 -1
  100. package/dist/{dist-7FA4Do6I.js → dist-B2hwhF6G.js} +7 -7
  101. package/dist/{dist-BRVqFn7R.js → dist-BfuBBQ14.js} +6 -6
  102. package/dist/{dist-C3WNMuW2.js → dist-CNbFpoT1.js} +2 -2
  103. package/dist/{dist-bK-AHWLF.js → dist-CgoP608h.js} +7 -7
  104. package/dist/{dist-CKteKPPA.js → dist-VbpVNBs6.js} +7 -7
  105. package/dist/icons.js +1 -1
  106. package/dist/{main-7sMXtgRg.js → main-DCzVrq0G.js} +2 -2
  107. package/dist/main.js +4 -4
  108. package/dist/types/utils/types.d.ts +1 -0
  109. package/dist/utils/hooks/useLicense.js +1 -1
  110. package/dist/utils/hooks/useLoadPdf.js +38 -36
  111. package/package.json +1 -1
  112. package/dist/RPPages-BQw330_L.js +0 -655
@@ -8,7 +8,7 @@ function i(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
8
8
  };
9
9
  }
10
10
  //#endregion
11
- //#region node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
11
+ //#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
12
12
  function a(e, t) {
13
13
  if (typeof e == "function") return e(t);
14
14
  e != null && (e.current = t);
@@ -31,7 +31,7 @@ function s(...t) {
31
31
  return e.useCallback(o(...t), t);
32
32
  }
33
33
  //#endregion
34
- //#region node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs
34
+ //#region node_modules/@radix-ui/react-context/dist/index.mjs
35
35
  function c(t, r) {
36
36
  let i = e.createContext(r), a = (t) => {
37
37
  let { children: r, ...a } = t, o = e.useMemo(() => a, Object.values(a));
@@ -104,7 +104,7 @@ function u(...t) {
104
104
  return r.scopeName = n.scopeName, r;
105
105
  }
106
106
  //#endregion
107
- //#region node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
107
+ //#region node_modules/@radix-ui/react-slot/dist/index.mjs
108
108
  /* @__NO_SIDE_EFFECTS__ */
109
109
  function d(t) {
110
110
  let r = /* @__PURE__ */ f(t), i = e.forwardRef((t, i) => {
@@ -168,7 +168,7 @@ function _(e) {
168
168
  return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
169
169
  }
170
170
  //#endregion
171
- //#region node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@18.3.7_@types+react@18.3.27__@types+re_8fc36fddadfc5720002d5ad7c1f55b49/node_modules/@radix-ui/react-primitive/dist/index.mjs
171
+ //#region node_modules/@radix-ui/react-primitive/dist/index.mjs
172
172
  var v = [
173
173
  "a",
174
174
  "button",
@@ -204,10 +204,10 @@ function y(e, t) {
204
204
  e && r.flushSync(() => e.dispatchEvent(t));
205
205
  }
206
206
  //#endregion
207
- //#region node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
207
+ //#region node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
208
208
  var b = globalThis?.document ? e.useLayoutEffect : () => {};
209
209
  //#endregion
210
- //#region node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@18.3.7_@types+react@18.3.27__@types+rea_3fd5045f6b2ce13867beb3cd4d530871/node_modules/@radix-ui/react-presence/dist/index.mjs
210
+ //#region node_modules/@radix-ui/react-presence/dist/index.mjs
211
211
  function x(t, n) {
212
212
  return e.useReducer((e, t) => n[e][t] ?? e, t);
213
213
  }
@@ -269,7 +269,7 @@ function T(e) {
269
269
  return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
270
270
  }
271
271
  //#endregion
272
- //#region node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
272
+ //#region node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
273
273
  var E = e.useInsertionEffect || b;
274
274
  function D({ prop: t, defaultProp: n, onChange: r = () => {}, caller: i }) {
275
275
  let [a, o, s] = O({
@@ -1,11 +1,11 @@
1
- import { a as e, d as t, f as n, i as r, l as i, n as a, o, t as s, u as c } from "./dist-bK-AHWLF.js";
2
- import { i as l, n as u, r as d, t as f } from "./dist-BRVqFn7R.js";
3
- import { a as p, i as m, n as h, r as g, t as _ } from "./dist-7FA4Do6I.js";
4
- import { i as v, n as y, r as b, t as x } from "./Combination-DqNkTtir.js";
1
+ import { a as e, d as t, f as n, i as r, l as i, n as a, o, t as s, u as c } from "./dist-CgoP608h.js";
2
+ import { i as l, n as u, r as d, t as f } from "./dist-BfuBBQ14.js";
3
+ import { a as p, i as m, n as h, r as g, t as _ } from "./dist-B2hwhF6G.js";
4
+ import { i as v, n as y, r as b, t as x } from "./Combination-11kyhTGt.js";
5
5
  import * as S from "react";
6
6
  import C from "react";
7
7
  import { jsx as w } from "react/jsx-runtime";
8
- //#region node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@18.3.7_@types+react@18.3.27__@types+r_2a160d6c4f7d367deed369796ce196e5/node_modules/@radix-ui/react-collection/dist/index.mjs
8
+ //#region node_modules/@radix-ui/react-collection/dist/index.mjs
9
9
  function T(e) {
10
10
  let n = e + "CollectionProvider", [r, a] = i(n), [s, c] = r(n, {
11
11
  collectionRef: { current: null },
@@ -60,14 +60,14 @@ function T(e) {
60
60
  ];
61
61
  }
62
62
  //#endregion
63
- //#region node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs
63
+ //#region node_modules/@radix-ui/react-direction/dist/index.mjs
64
64
  var E = S.createContext(void 0);
65
65
  function D(e) {
66
66
  let t = S.useContext(E);
67
67
  return e || t || "ltr";
68
68
  }
69
69
  //#endregion
70
- //#region node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@18.3.7_@types+react@18.3.27__@type_7c6f9bc85f65519fbef65d6b537f1710/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
70
+ //#region node_modules/@radix-ui/react-roving-focus/dist/index.mjs
71
71
  var O = "rovingFocusGroup.onEntryFocus", ee = {
72
72
  bubbles: !1,
73
73
  cancelable: !0
package/dist/icons.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./LoaderIcon-D9YjinGf.js";
1
+ import { t as e } from "./LoaderIcon-B3ddfd0D.js";
2
2
  import { ChevronUpIcon as t } from "./components/icons/ChevronUpIcon.js";
3
3
  import { FileUploadDefaultIcon as n } from "./components/icons/FileUploadDefaultIcon.js";
4
4
  import { MoonIcon as r } from "./components/icons/MoonIcon.js";
@@ -1,8 +1,8 @@
1
1
  import { useViewModeContext as e } from "./contexts/ViewModeContext.js";
2
2
  import { r as t } from "./PaginationContext-DIzsZhFd.js";
3
3
  import { useLocalizationContext as n } from "./contexts/LocalizationContext.js";
4
- import { t as r } from "./Button-BNlmxWrV.js";
5
- import { t as i } from "./RPTooltip-COLVx-C_.js";
4
+ import { t as r } from "./Button-DBu3SaMk.js";
5
+ import { t as i } from "./RPTooltip-QWwWh4HW.js";
6
6
  import { DualPageWithCoverIcon as a } from "./components/icons/DualPageWithCoverIcon.js";
7
7
  import { GoToDownIcon as o } from "./components/icons/GoToDownIcon.js";
8
8
  import { t as s } from "./MostPageTool.module-BRVv-sGz.js";
package/dist/main.js CHANGED
@@ -16,12 +16,12 @@ import { useHighlightContext as y } from "./contexts/HighlightContext.js";
16
16
  import { useElementPageContext as b } from "./contexts/ElementPageContext.js";
17
17
  import { useElementThumbnailContext as x } from "./contexts/ElementThumbnailContext.js";
18
18
  import { RPProvider as S } from "./components/RPProvider.js";
19
- import { t as C } from "./RPPages-BQw330_L.js";
19
+ import { t as C } from "./RPPages-cyO0Tn21.js";
20
20
  import { useFileDownload as w } from "./utils/hooks/useFileDownload.js";
21
21
  import { RPTheme as T } from "./components/RPTheme.js";
22
22
  import { RPConfig as E } from "./components/RPConfig.js";
23
- import { t as D } from "./Button-BNlmxWrV.js";
24
- import { t as O } from "./RPTooltip-COLVx-C_.js";
23
+ import { t as D } from "./Button-DBu3SaMk.js";
24
+ import { t as O } from "./RPTooltip-QWwWh4HW.js";
25
25
  import { SearchTool as k } from "./components/layout/toolbar/SearchTool.js";
26
26
  import { RPDefaultLayout as A } from "./components/layout/RPDefaultLayout.js";
27
27
  import { RPVerticalBar as j } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
@@ -46,7 +46,7 @@ import { RotateCounterclockwiseTool as Y } from "./components/layout/toolbar/too
46
46
  import { SelectionModeSwitcherTool as X } from "./components/layout/toolbar/tools/SelectionModeSwitcherTool.js";
47
47
  import { SinglePageTool as Z } from "./components/layout/toolbar/tools/SinglePageTool.js";
48
48
  import { DualPageTool as Q } from "./components/layout/toolbar/tools/DualPageTool.js";
49
- import { n as $, r as ee, t as te } from "./main-7sMXtgRg.js";
49
+ import { n as $, r as ee, t as te } from "./main-DCzVrq0G.js";
50
50
  import { PageScrollingTool as ne } from "./components/layout/toolbar/tools/PageScrollingTool.js";
51
51
  import { VerticalScrollingTool as re } from "./components/layout/toolbar/tools/VerticalScrollingTool.js";
52
52
  import { HorizontalScrollingTool as ie } from "./components/layout/toolbar/tools/HorizontalScrollingTool.js";
@@ -378,6 +378,7 @@ export interface PdfProperties {
378
378
  export interface ConfigContextType {
379
379
  workerUrlAdded: boolean;
380
380
  wasmUrl?: string;
381
+ standardFontDataUrl?: string;
381
382
  }
382
383
  export declare enum ThemeVariables {
383
384
  FONT_FAMILY = "--rp-font-family",
@@ -3,7 +3,7 @@ import { LicenseType as t } from "../types.js";
3
3
  import { appConsole as n } from "../appConsole.js";
4
4
  import { useCallback as r, useEffect as i, useState as a } from "react";
5
5
  //#region lib/utils/hooks/useLicense.ts
6
- var o = /* @__PURE__ */ new Date("2026-08-04T07:41:30.328Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
6
+ var o = /* @__PURE__ */ new Date("2026-08-10T06:12:32.238Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
7
7
  invalidLicense: `You are currently using without a valid license. ${c}`,
8
8
  mismatchedDomain: `Your license key is not valid for the current domain / IP. ${c}`,
9
9
  expired: `Your license key has expired. ${c}`,
@@ -24,40 +24,41 @@ function _(e) {
24
24
  return t.cause = e, t;
25
25
  }
26
26
  var v = (a, o, c = {}) => {
27
- let [p, v] = d(), { workerUrlAdded: y, wasmUrl: b } = n(), [x, S] = d(/* @__PURE__ */ new Map()), C = u(), [w, T] = d(0), [E, D] = d(!1), [O, k] = d(), { password: A, passwordError: j, setPasswordError: M, passwordRequired: N, setPasswordRequired: P } = i(), { onLoadError: F, onLoaded: I, onLoadProgress: L, disableAutoFetch: R, disableStream: z, rangeChunkSize: B, withCredentials: V, httpHeaders: H } = c;
27
+ let [p, v] = d(), { workerUrlAdded: y, wasmUrl: b, standardFontDataUrl: x } = n(), [S, C] = d(/* @__PURE__ */ new Map()), w = u(), [T, E] = d(0), [D, O] = d(!1), [k, A] = d(), { password: j, passwordError: M, setPasswordError: N, passwordRequired: P, setPasswordRequired: F } = i(), { onLoadError: I, onLoaded: L, onLoadProgress: R, disableAutoFetch: z, disableStream: B, rangeChunkSize: V, withCredentials: H, httpHeaders: U } = c;
28
28
  return l(() => {
29
- L && L(w);
30
- }, [w, L]), l(() => {
29
+ R && R(T);
30
+ }, [T, R]), l(() => {
31
31
  if (!y || !a) return;
32
- T(0), k(void 0), C.current = Date.now();
33
- let t = C.current, n = {
32
+ E(0), A(void 0), w.current = Date.now();
33
+ let t = w.current, n = {
34
34
  url: a,
35
35
  cMapPacked: o?.isCompressed ?? !0,
36
36
  ...o?.url && { cMapUrl: o.url },
37
- ...A && { password: A },
38
- ...R !== void 0 && { disableAutoFetch: R },
39
- ...z !== void 0 && { disableStream: z },
40
- ...B !== void 0 && { rangeChunkSize: B },
41
- ...V !== void 0 && { withCredentials: V },
42
- ...H !== void 0 && { httpHeaders: H },
37
+ ...j && { password: j },
38
+ ...z !== void 0 && { disableAutoFetch: z },
39
+ ...B !== void 0 && { disableStream: B },
40
+ ...V !== void 0 && { rangeChunkSize: V },
41
+ ...H !== void 0 && { withCredentials: H },
42
+ ...U !== void 0 && { httpHeaders: U },
43
43
  ...b && { wasmUrl: b },
44
+ ...x && { standardFontDataUrl: x },
44
45
  verbosity: f.VerbosityLevel.ERRORS
45
46
  };
46
47
  try {
47
48
  let i = f.getDocument(n);
48
49
  i.onProgress = (e) => {
49
- if (t === C.current) {
50
+ if (t === w.current) {
50
51
  let { loaded: t, total: n } = e;
51
- T(n ? Math.min(100, Math.round(t / n * 100)) : 0);
52
+ E(n ? Math.min(100, Math.round(t / n * 100)) : 0);
52
53
  }
53
- }, D(!0), v(void 0);
54
- let a = i.promise.then(async (n) => !b && m(await n.getData()) ? (t === C.current && (v(void 0), k(e.WASM_URL_REQUIRED)), r.error(s), F?.(g()), n) : (t === C.current && (v(n), T(100)), I && I(n), P(!1), M(""), n)).catch((t) => {
54
+ }, O(!0), v(void 0);
55
+ let a = i.promise.then(async (n) => !b && m(await n.getData()) ? (t === w.current && (v(void 0), A(e.WASM_URL_REQUIRED)), r.error(s), I?.(g()), n) : (t === w.current && (v(n), E(100)), L && L(n), F(!1), N(""), n)).catch((t) => {
55
56
  if (t instanceof Error && t.name === "PasswordException") {
56
57
  let e = t.code;
57
- P(!0), e === f.PasswordResponses.INCORRECT_PASSWORD ? M("Incorrect password") : M(void 0);
58
- } else t instanceof Error && t.name === "InvalidPDFException" && A ? (P(!0), M("Incorrect password")) : t instanceof Error && t.name === "InvalidPDFException" ? (k(e.INVALID_OR_CORRUPTED_PDF), F?.(h(t))) : F && F(t);
58
+ F(!0), e === f.PasswordResponses.INCORRECT_PASSWORD ? N("Incorrect password") : N(void 0);
59
+ } else t instanceof Error && t.name === "InvalidPDFException" && j ? (F(!0), N("Incorrect password")) : t instanceof Error && t.name === "InvalidPDFException" ? (A(e.INVALID_OR_CORRUPTED_PDF), I?.(h(t))) : I && I(t);
59
60
  }).finally(() => {
60
- D(!1);
61
+ O(!1);
61
62
  });
62
63
  return () => {
63
64
  a.finally(() => {
@@ -65,20 +66,21 @@ var v = (a, o, c = {}) => {
65
66
  });
66
67
  };
67
68
  } catch (t) {
68
- k(e.NOT_SUPPORTED), F?.(_(t));
69
+ A(e.NOT_SUPPORTED), I?.(_(t));
69
70
  }
70
71
  }, [
71
72
  a,
72
73
  y,
73
74
  b,
74
- A,
75
- F,
76
- I
75
+ x,
76
+ j,
77
+ I,
78
+ L
77
79
  ]), l(() => {
78
- if (N) return;
80
+ if (P) return;
79
81
  let n = /* @__PURE__ */ new Map();
80
- if (!p || E) {
81
- S(n);
82
+ if (!p || D) {
83
+ C(n);
82
84
  return;
83
85
  }
84
86
  let r = p.numPages, i = [];
@@ -97,23 +99,23 @@ var v = (a, o, c = {}) => {
97
99
  thumbnailScale: i,
98
100
  defaultRotation: a.rotation
99
101
  });
100
- }), S(n);
102
+ }), C(n);
101
103
  }).catch((t) => {
102
- v(void 0), k(e.INVALID_OR_CORRUPTED_PDF), F?.(h(t));
104
+ v(void 0), A(e.INVALID_OR_CORRUPTED_PDF), I?.(h(t));
103
105
  });
104
106
  }, [
105
107
  p,
106
- E,
107
- N,
108
- F
108
+ D,
109
+ P,
110
+ I
109
111
  ]), {
110
112
  pdf: p,
111
- pages: x,
112
- loading: E,
113
- error: O,
114
- loadingProgress: w,
115
- passwordRequired: N,
116
- passwordError: j
113
+ pages: S,
114
+ loading: D,
115
+ error: k,
116
+ loadingProgress: T,
117
+ passwordRequired: P,
118
+ passwordError: M
117
119
  };
118
120
  };
119
121
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pdf-kit/viewer",
3
- "version": "2.8.0-beta.9",
3
+ "version": "2.9.0-beta.0",
4
4
  "private": false,
5
5
  "description": "A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.",
6
6
  "keywords": [