@react-pdf-kit/viewer 0.0.0-experimental.3 → 0.0.0-experimental.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 (150) hide show
  1. package/dist/{Combination-479e39c6.js → Combination-136ff99c.js} +184 -187
  2. package/dist/assets/style.css +1 -1
  3. package/dist/components/RPConfig.js +16 -6
  4. package/dist/components/RPController.js +3 -4
  5. package/dist/components/RPDropFileZone.js +35 -29
  6. package/dist/components/RPPages.js +76 -84
  7. package/dist/components/RPProvider.js +3 -4
  8. package/dist/components/layout/RPDefaultLayout.js +11 -10
  9. package/dist/components/layout/RPLayout.js +27 -25
  10. package/dist/components/layout/WrapperLayout.js +10 -11
  11. package/dist/components/layout/sidebar/RPSidebar.js +7 -8
  12. package/dist/components/layout/sidebar/Thumbnail.js +3 -4
  13. package/dist/components/layout/sidebar/Thumbnails.js +3 -4
  14. package/dist/components/layout/toolbar/DarkModeTool.js +4 -4
  15. package/dist/components/layout/toolbar/DocumentDialog.js +8 -9
  16. package/dist/components/layout/toolbar/DocumentProperties.js +6 -6
  17. package/dist/components/layout/toolbar/FileDownloadTool.js +9 -10
  18. package/dist/components/layout/toolbar/FileUploadTool.js +9 -10
  19. package/dist/components/layout/toolbar/FullScreenTool.js +6 -6
  20. package/dist/components/layout/toolbar/MenuItem.js +6 -6
  21. package/dist/components/layout/toolbar/MenuSeparator.js +6 -6
  22. package/dist/components/layout/toolbar/MostPageTool.js +9 -10
  23. package/dist/components/layout/toolbar/OtherTool.js +9 -10
  24. package/dist/components/layout/toolbar/Paginate.js +7 -8
  25. package/dist/components/layout/toolbar/PrintTool.js +9 -10
  26. package/dist/components/layout/toolbar/RPMenuItem.js +6 -6
  27. package/dist/components/layout/toolbar/RPMoreOptions.js +9 -10
  28. package/dist/components/layout/toolbar/RPToolbar.js +9 -10
  29. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -10
  30. package/dist/components/layout/toolbar/RotateTool.js +9 -10
  31. package/dist/components/layout/toolbar/ScrollModeTool.js +6 -6
  32. package/dist/components/layout/toolbar/SearchCloseButton.js +4 -4
  33. package/dist/components/layout/toolbar/SearchResultNavigator.js +7 -8
  34. package/dist/components/layout/toolbar/SearchTool.js +11 -12
  35. package/dist/components/layout/toolbar/SelectionModeTool.js +6 -6
  36. package/dist/components/layout/toolbar/ThumbnailTool.js +7 -8
  37. package/dist/components/layout/toolbar/ToolbarCustom.js +3 -4
  38. package/dist/components/layout/toolbar/ToolbarDefault.js +9 -10
  39. package/dist/components/layout/toolbar/ToolbarLayout.js +9 -10
  40. package/dist/components/layout/toolbar/ViewModeTool.js +6 -6
  41. package/dist/components/layout/toolbar/ZoomTool.js +9 -10
  42. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +8 -9
  43. package/dist/components/layout/toolbar/tools/DualPageTool.js +4 -4
  44. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +11 -10
  45. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +7 -8
  46. package/dist/components/layout/toolbar/tools/FileUploadTool.js +7 -8
  47. package/dist/components/layout/toolbar/tools/FirstPageTool.js +11 -10
  48. package/dist/components/layout/toolbar/tools/FullScreenTool.js +4 -4
  49. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +4 -4
  50. package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -8
  51. package/dist/components/layout/toolbar/tools/LastPageTool.js +11 -10
  52. package/dist/components/layout/toolbar/tools/NextPageTool.js +7 -8
  53. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +4 -4
  54. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +7 -8
  55. package/dist/components/layout/toolbar/tools/PrintTool.js +7 -8
  56. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +7 -8
  57. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +7 -8
  58. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +4 -4
  59. package/dist/components/layout/toolbar/tools/SinglePageTool.js +4 -4
  60. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +4 -4
  61. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +7 -8
  62. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +4 -4
  63. package/dist/components/layout/toolbar/tools/ZoomInTool.js +7 -8
  64. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +19 -20
  65. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +7 -8
  66. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +9 -10
  67. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +7 -8
  68. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +6 -6
  69. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +9 -10
  70. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +9 -10
  71. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +6 -6
  72. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +9 -10
  73. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +9 -10
  74. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +9 -10
  75. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +6 -6
  76. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +6 -6
  77. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +6 -6
  78. package/dist/components/page/AnnotationLayer.js +24 -25
  79. package/dist/components/page/CanvasLayer.js +3 -4
  80. package/dist/components/page/CustomElement.js +3 -4
  81. package/dist/components/page/DualPage.js +3 -4
  82. package/dist/components/page/DualPageWithCover.js +3 -4
  83. package/dist/components/page/RPPage.js +4 -5
  84. package/dist/components/page/SinglePage.js +3 -4
  85. package/dist/components/page/TextHighlightLayer.js +15 -16
  86. package/dist/components/page/TextLayer.js +11 -12
  87. package/dist/components/ui/Checkbox.js +2 -2
  88. package/dist/components/ui/DropDown.js +6 -6
  89. package/dist/components/ui/LoadingIndicator.js +7 -8
  90. package/dist/components/ui/RPTooltip.js +411 -197
  91. package/dist/contexts/ConfigContext.js +5 -4
  92. package/dist/contexts/DimensionPagesContext.js +5 -6
  93. package/dist/contexts/DropFileZoneContext.js +4 -5
  94. package/dist/contexts/ElementPageContext.js +5 -6
  95. package/dist/contexts/FileInputContext.js +5 -6
  96. package/dist/contexts/HighlightContext.js +5 -6
  97. package/dist/contexts/LayoutDropFileZoneContext.js +11 -0
  98. package/dist/contexts/PagesRotateContext.js +5 -6
  99. package/dist/contexts/PaginationContext.js +5 -6
  100. package/dist/contexts/PrintContext.js +16 -17
  101. package/dist/contexts/RPDocumentContext.js +13 -14
  102. package/dist/contexts/RenderQueueProvider.js +5 -6
  103. package/dist/contexts/RotationContext.js +8 -9
  104. package/dist/contexts/SearchContext.js +5 -6
  105. package/dist/contexts/ThumbnailsContext.js +4 -5
  106. package/dist/contexts/ZoomContext.js +5 -6
  107. package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
  108. package/dist/index-61f59539.js +1198 -0
  109. package/dist/{index-ada501c4.js → index-655864a7.js} +1 -1
  110. package/dist/{index-113053cf.js → index-c0faa594.js} +2 -2
  111. package/dist/{index-23911b43.js → index-e3ee9457.js} +6 -6
  112. package/dist/main.js +117 -115
  113. package/dist/polyfills.js +8055 -0
  114. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +2 -2
  115. package/dist/types/contexts/LayoutDropFileZoneContext.d.ts +9 -0
  116. package/dist/types/contexts/RPDocumentContext.d.ts +1 -1
  117. package/dist/types/contexts/RenderQueueProvider.d.ts +1 -1
  118. package/dist/types/contexts/RenderedPagesCache.d.ts +2 -2
  119. package/dist/types/main.d.ts +1 -1
  120. package/dist/types/utils/annotations.d.ts +2 -2
  121. package/dist/types/utils/getThumbnailViewport.d.ts +2 -2
  122. package/dist/types/utils/highlight.d.ts +5 -5
  123. package/dist/types/utils/hooks/useDropFileZone.d.ts +5 -0
  124. package/dist/types/utils/hooks/useHighlight.d.ts +1 -1
  125. package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
  126. package/dist/types/utils/hooks/useLoadWorker.d.ts +1 -5
  127. package/dist/types/utils/hooks/usePdfProperties.d.ts +1 -1
  128. package/dist/types/utils/link_service.d.ts +3 -2
  129. package/dist/types/utils/renderPage.d.ts +2 -2
  130. package/dist/types/utils/types.d.ts +8 -5
  131. package/dist/utils/hooks/useDropFileZone.js +12 -0
  132. package/dist/utils/hooks/useFileDownload.js +5 -6
  133. package/dist/utils/hooks/useLicense.js +1 -1
  134. package/dist/utils/hooks/useLoadPdf.js +70 -95
  135. package/dist/utils/hooks/useLoadWorker.js +14 -4
  136. package/dist/utils/hooks/usePageRotateContext.js +7 -8
  137. package/dist/utils/hooks/usePaginate.js +3 -4
  138. package/dist/utils/hooks/usePinch.js +10 -11
  139. package/dist/utils/hooks/usePresentPage.js +3 -4
  140. package/dist/utils/hooks/usePrint.js +55 -54
  141. package/dist/utils/hooks/useRotate.js +3 -4
  142. package/dist/utils/hooks/useScrollToPage.js +3 -4
  143. package/dist/utils/hooks/useSearch.js +15 -16
  144. package/dist/utils/hooks/useThumbnail.js +17 -18
  145. package/dist/utils/hooks/useVirtualReactWindow.js +3 -4
  146. package/dist/utils/link_service.js +19 -18
  147. package/dist/utils/renderPage.js +1 -1
  148. package/package.json +13 -4
  149. package/dist/index-535ad364.js +0 -983
  150. package/dist/index-d0f0aa9a.js +0 -1542
@@ -24,13 +24,14 @@ import { useLoaderContext as Mt } from "../contexts/LoaderContext.js";
24
24
  import Et from "./ui/PasswordModal.js";
25
25
  import { usePresentPage as Ot } from "../utils/hooks/usePresentPage.js";
26
26
  import { getPageFromPosition as Wt } from "../utils/calculatePage.js";
27
- import { useDocumentPasswordContext as Pt } from "../contexts/DocumentPasswordContext.js";
28
- import { LayoutContainer as At } from "./layout/LayoutContainer.js";
29
- import { LayoutWrapper as Nt } from "./layout/LayoutWrapper.js";
27
+ import { useDocumentPasswordContext as At } from "../contexts/DocumentPasswordContext.js";
28
+ import { LayoutContainer as Nt } from "./layout/LayoutContainer.js";
29
+ import { LayoutWrapper as Pt } from "./layout/LayoutWrapper.js";
30
30
  import { useEventCallbackContext as Ft } from "../contexts/EventCallbackContext.js";
31
31
  import { useCopyText as Dt } from "../utils/hooks/useCopyText.js";
32
32
  import { useTextSelection as Ht } from "../utils/hooks/useTextSelection.js";
33
- import { approximateFraction as Pe } from "../utils/approximateFragtion.js";
33
+ import { OutputScale as kt } from "pdfjs-dist";
34
+ import { approximateFraction as Ae } from "../utils/approximateFragtion.js";
34
35
  import "./page/CanvasLayer.js";
35
36
  import "../contexts/ZoomContext.js";
36
37
  import "../utils/appConsole.js";
@@ -39,8 +40,6 @@ import "../utils/getZoomLevel.js";
39
40
  import "../de_DE-a553b162.js";
40
41
  import "../contexts/RotationContext.js";
41
42
  import "../utils/hooks/useLoadPdf.js";
42
- import "@pdf-viewer/pdfium";
43
- import "@pdf-viewer/pdfium/compat";
44
43
  import "../utils/getThumbnailViewport.js";
45
44
  import "../contexts/ConfigContext.js";
46
45
  import "../utils/hooks/usePdfProperties.js";
@@ -113,7 +112,7 @@ function be() {
113
112
  return n;
114
113
  }, be.apply(null, arguments);
115
114
  }
116
- function Ae(n) {
115
+ function Ne(n) {
117
116
  if (n === void 0)
118
117
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
119
118
  return n;
@@ -123,25 +122,25 @@ function ze(n, e) {
123
122
  return t.__proto__ = r, t;
124
123
  }, ze(n, e);
125
124
  }
126
- function kt(n, e) {
125
+ function Ut(n, e) {
127
126
  n.prototype = Object.create(e.prototype), n.prototype.constructor = n, ze(n, e);
128
127
  }
129
- var Ne = Number.isNaN || function(e) {
128
+ var Pe = Number.isNaN || function(e) {
130
129
  return typeof e == "number" && e !== e;
131
130
  };
132
- function Ut(n, e) {
133
- return !!(n === e || Ne(n) && Ne(e));
134
- }
135
131
  function Vt(n, e) {
132
+ return !!(n === e || Pe(n) && Pe(e));
133
+ }
134
+ function qt(n, e) {
136
135
  if (n.length !== e.length)
137
136
  return !1;
138
137
  for (var t = 0; t < n.length; t++)
139
- if (!Ut(n[t], e[t]))
138
+ if (!Vt(n[t], e[t]))
140
139
  return !1;
141
140
  return !0;
142
141
  }
143
142
  function Te(n, e) {
144
- e === void 0 && (e = Vt);
143
+ e === void 0 && (e = qt);
145
144
  var t, r = [], s, l = !1;
146
145
  function a() {
147
146
  for (var c = [], f = 0; f < arguments.length; f++)
@@ -162,7 +161,7 @@ function Fe(n, e) {
162
161
  }
163
162
  return t;
164
163
  }
165
- var qt = typeof performance == "object" && typeof performance.now == "function", De = qt ? function() {
164
+ var Gt = typeof performance == "object" && typeof performance.now == "function", De = Gt ? function() {
166
165
  return performance.now();
167
166
  } : function() {
168
167
  return Date.now();
@@ -170,7 +169,7 @@ var qt = typeof performance == "object" && typeof performance.now == "function",
170
169
  function He(n) {
171
170
  cancelAnimationFrame(n.id);
172
171
  }
173
- function Gt(n, e) {
172
+ function $t(n, e) {
174
173
  var t = De();
175
174
  function r() {
176
175
  De() - t >= e ? n.call(null) : s.id = requestAnimationFrame(r);
@@ -181,7 +180,7 @@ function Gt(n, e) {
181
180
  return s;
182
181
  }
183
182
  var Re = -1;
184
- function $t(n) {
183
+ function jt(n) {
185
184
  if (n === void 0 && (n = !1), Re === -1 || n) {
186
185
  var e = document.createElement("div"), t = e.style;
187
186
  t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), Re = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
@@ -198,21 +197,21 @@ function ke(n) {
198
197
  }
199
198
  return se;
200
199
  }
201
- var jt = 150, Bt = function(e) {
200
+ var Bt = 150, Kt = function(e) {
202
201
  var t = e.columnIndex;
203
202
  e.data;
204
203
  var r = e.rowIndex;
205
204
  return r + ":" + t;
206
205
  }, de = null, fe = null, me = null;
207
206
  process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (de = /* @__PURE__ */ new WeakSet(), fe = /* @__PURE__ */ new WeakSet(), me = /* @__PURE__ */ new WeakSet());
208
- function Kt(n) {
207
+ function Zt(n) {
209
208
  var e, t = n.getColumnOffset, r = n.getColumnStartIndexForOffset, s = n.getColumnStopIndexForStartIndex, l = n.getColumnWidth, a = n.getEstimatedTotalHeight, c = n.getEstimatedTotalWidth, f = n.getOffsetForColumnAndAlignment, g = n.getOffsetForRowAndAlignment, h = n.getRowHeight, _ = n.getRowOffset, i = n.getRowStartIndexForOffset, y = n.getRowStopIndexForStartIndex, w = n.initInstanceProps, S = n.shouldResetStyleCacheOnItemSizeChange, D = n.validateProps;
210
209
  return e = /* @__PURE__ */ function(b) {
211
- kt(I, b);
212
- function I(P) {
210
+ Ut(I, b);
211
+ function I(A) {
213
212
  var o;
214
- return o = b.call(this, P) || this, o._instanceProps = w(o.props, Ae(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
215
- instance: Ae(o),
213
+ return o = b.call(this, A) || this, o._instanceProps = w(o.props, Ne(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
214
+ instance: Ne(o),
216
215
  isScrolling: !1,
217
216
  horizontalScrollDirection: "forward",
218
217
  scrollLeft: typeof o.props.initialScrollLeft == "number" ? o.props.initialScrollLeft : 0,
@@ -286,7 +285,7 @@ function Kt(n) {
286
285
  var d = o.props.outerRef;
287
286
  o._outerRef = u, typeof d == "function" ? d(u) : d != null && typeof d == "object" && d.hasOwnProperty("current") && (d.current = u);
288
287
  }, o._resetIsScrollingDebounced = function() {
289
- o._resetIsScrollingTimeoutId !== null && He(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = Gt(o._resetIsScrolling, jt);
288
+ o._resetIsScrollingTimeoutId !== null && He(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = $t(o._resetIsScrolling, Bt);
290
289
  }, o._resetIsScrolling = function() {
291
290
  o._resetIsScrollingTimeoutId = null, o.setState({
292
291
  isScrolling: !1
@@ -296,7 +295,7 @@ function Kt(n) {
296
295
  }, o;
297
296
  }
298
297
  I.getDerivedStateFromProps = function(o, u) {
299
- return Zt(o, u), D(o), null;
298
+ return Jt(o, u), D(o), null;
300
299
  };
301
300
  var W = I.prototype;
302
301
  return W.scrollTo = function(o) {
@@ -311,9 +310,9 @@ function Kt(n) {
311
310
  };
312
311
  }, this._resetIsScrollingDebounced);
313
312
  }, W.scrollToItem = function(o) {
314
- var u = o.align, d = u === void 0 ? "auto" : u, m = o.columnIndex, C = o.rowIndex, p = this.props, T = p.columnCount, z = p.height, L = p.rowCount, M = p.width, E = this.state, R = E.scrollLeft, F = E.scrollTop, N = $t();
313
+ var u = o.align, d = u === void 0 ? "auto" : u, m = o.columnIndex, C = o.rowIndex, p = this.props, T = p.columnCount, z = p.height, L = p.rowCount, M = p.width, E = this.state, R = E.scrollLeft, F = E.scrollTop, P = jt();
315
314
  m !== void 0 && (m = Math.max(0, Math.min(m, T - 1))), C !== void 0 && (C = Math.max(0, Math.min(C, L - 1)));
316
- var H = a(this.props, this._instanceProps), A = c(this.props, this._instanceProps), k = A > M ? N : 0, Z = H > z ? N : 0;
315
+ var H = a(this.props, this._instanceProps), N = c(this.props, this._instanceProps), k = N > M ? P : 0, Z = H > z ? P : 0;
317
316
  this.scrollTo({
318
317
  scrollLeft: m !== void 0 ? f(this.props, m, d, R, this._instanceProps, Z) : R,
319
318
  scrollTop: C !== void 0 ? g(this.props, C, d, F, this._instanceProps, k) : F
@@ -350,7 +349,7 @@ function Kt(n) {
350
349
  }, W.componentWillUnmount = function() {
351
350
  this._resetIsScrollingTimeoutId !== null && He(this._resetIsScrollingTimeoutId);
352
351
  }, W.render = function() {
353
- var o = this.props, u = o.children, d = o.className, m = o.columnCount, C = o.direction, p = o.height, T = o.innerRef, z = o.innerElementType, L = o.innerTagName, M = o.itemData, E = o.itemKey, R = E === void 0 ? Bt : E, F = o.outerElementType, N = o.outerTagName, H = o.rowCount, A = o.style, k = o.useIsScrolling, Z = o.width, J = this.state.isScrolling, Q = this._getHorizontalRangeToRender(), ie = Q[0], j = Q[1], le = this._getVerticalRangeToRender(), X = le[0], Y = le[1], ee = [];
352
+ var o = this.props, u = o.children, d = o.className, m = o.columnCount, C = o.direction, p = o.height, T = o.innerRef, z = o.innerElementType, L = o.innerTagName, M = o.itemData, E = o.itemKey, R = E === void 0 ? Kt : E, F = o.outerElementType, P = o.outerTagName, H = o.rowCount, N = o.style, k = o.useIsScrolling, Z = o.width, J = this.state.isScrolling, Q = this._getHorizontalRangeToRender(), ie = Q[0], j = Q[1], le = this._getVerticalRangeToRender(), X = le[0], Y = le[1], ee = [];
354
353
  if (m > 0 && H)
355
354
  for (var B = X; B <= Y; B++)
356
355
  for (var K = ie; K <= j; K++)
@@ -367,7 +366,7 @@ function Kt(n) {
367
366
  style: this._getItemStyle(B, K)
368
367
  }));
369
368
  var pe = a(this.props, this._instanceProps), te = c(this.props, this._instanceProps);
370
- return ue(F || N || "div", {
369
+ return ue(F || P || "div", {
371
370
  className: d,
372
371
  onScroll: this._onScroll,
373
372
  ref: this._outerRefSetter,
@@ -379,7 +378,7 @@ function Kt(n) {
379
378
  WebkitOverflowScrolling: "touch",
380
379
  willChange: "transform",
381
380
  direction: C
382
- }, A)
381
+ }, N)
383
382
  }, ue(z || L || "div", {
384
383
  children: ee,
385
384
  ref: T,
@@ -392,25 +391,25 @@ function Kt(n) {
392
391
  }, W._callPropsCallbacks = function() {
393
392
  var o = this.props, u = o.columnCount, d = o.onItemsRendered, m = o.onScroll, C = o.rowCount;
394
393
  if (typeof d == "function" && u > 0 && C > 0) {
395
- var p = this._getHorizontalRangeToRender(), T = p[0], z = p[1], L = p[2], M = p[3], E = this._getVerticalRangeToRender(), R = E[0], F = E[1], N = E[2], H = E[3];
396
- this._callOnItemsRendered(T, z, R, F, L, M, N, H);
394
+ var p = this._getHorizontalRangeToRender(), T = p[0], z = p[1], L = p[2], M = p[3], E = this._getVerticalRangeToRender(), R = E[0], F = E[1], P = E[2], H = E[3];
395
+ this._callOnItemsRendered(T, z, R, F, L, M, P, H);
397
396
  }
398
397
  if (typeof m == "function") {
399
- var A = this.state, k = A.horizontalScrollDirection, Z = A.scrollLeft, J = A.scrollTop, Q = A.scrollUpdateWasRequested, ie = A.verticalScrollDirection;
398
+ var N = this.state, k = N.horizontalScrollDirection, Z = N.scrollLeft, J = N.scrollTop, Q = N.scrollUpdateWasRequested, ie = N.verticalScrollDirection;
400
399
  this._callOnScroll(Z, J, k, ie, Q);
401
400
  }
402
401
  }, W._getHorizontalRangeToRender = function() {
403
402
  var o = this.props, u = o.columnCount, d = o.overscanColumnCount, m = o.overscanColumnsCount, C = o.overscanCount, p = o.rowCount, T = this.state, z = T.horizontalScrollDirection, L = T.isScrolling, M = T.scrollLeft, E = d || m || C || 1;
404
403
  if (u === 0 || p === 0)
405
404
  return [0, 0, 0, 0];
406
- var R = r(this.props, M, this._instanceProps), F = s(this.props, R, M, this._instanceProps), N = !L || z === "backward" ? Math.max(1, E) : 1, H = !L || z === "forward" ? Math.max(1, E) : 1;
407
- return [Math.max(0, R - N), Math.max(0, Math.min(u - 1, F + H)), R, F];
405
+ var R = r(this.props, M, this._instanceProps), F = s(this.props, R, M, this._instanceProps), P = !L || z === "backward" ? Math.max(1, E) : 1, H = !L || z === "forward" ? Math.max(1, E) : 1;
406
+ return [Math.max(0, R - P), Math.max(0, Math.min(u - 1, F + H)), R, F];
408
407
  }, W._getVerticalRangeToRender = function() {
409
408
  var o = this.props, u = o.columnCount, d = o.overscanCount, m = o.overscanRowCount, C = o.overscanRowsCount, p = o.rowCount, T = this.state, z = T.isScrolling, L = T.verticalScrollDirection, M = T.scrollTop, E = m || C || d || 1;
410
409
  if (u === 0 || p === 0)
411
410
  return [0, 0, 0, 0];
412
- var R = i(this.props, M, this._instanceProps), F = y(this.props, R, M, this._instanceProps), N = !z || L === "backward" ? Math.max(1, E) : 1, H = !z || L === "forward" ? Math.max(1, E) : 1;
413
- return [Math.max(0, R - N), Math.max(0, Math.min(p - 1, F + H)), R, F];
411
+ var R = i(this.props, M, this._instanceProps), F = y(this.props, R, M, this._instanceProps), P = !z || L === "backward" ? Math.max(1, E) : 1, H = !z || L === "forward" ? Math.max(1, E) : 1;
412
+ return [Math.max(0, R - P), Math.max(0, Math.min(p - 1, F + H)), R, F];
414
413
  }, I;
415
414
  }(at), e.defaultProps = {
416
415
  direction: "ltr",
@@ -418,7 +417,7 @@ function Kt(n) {
418
417
  useIsScrolling: !1
419
418
  }, e;
420
419
  }
421
- var Zt = function(e, t) {
420
+ var Jt = function(e, t) {
422
421
  var r = e.children, s = e.direction, l = e.height, a = e.innerTagName, c = e.outerTagName, f = e.overscanColumnsCount, g = e.overscanCount, h = e.overscanRowsCount, _ = e.width, i = t.instance;
423
422
  if (process.env.NODE_ENV !== "production") {
424
423
  if (typeof g == "number" && de && !de.has(i) && (de.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof f == "number" || typeof h == "number") && fe && !fe.has(i) && (fe.add(i), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && me && !me.has(i) && (me.add(i), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
@@ -473,7 +472,7 @@ var Zt = function(e, t) {
473
472
  var l, a;
474
473
  e === "column" ? (l = r.columnMetadataMap, a = r.lastMeasuredColumnIndex) : (l = r.rowMetadataMap, a = r.lastMeasuredRowIndex);
475
474
  var c = a > 0 ? l[a].offset : 0;
476
- return c >= s ? Je(e, t, r, a, 0, s) : Jt(e, t, r, Math.max(0, a), s);
475
+ return c >= s ? Je(e, t, r, a, 0, s) : Qt(e, t, r, Math.max(0, a), s);
477
476
  }, Je = function(e, t, r, s, l, a) {
478
477
  for (; l <= s; ) {
479
478
  var c = l + Math.floor((s - l) / 2), f = $(e, t, c, r).offset;
@@ -482,7 +481,7 @@ var Zt = function(e, t) {
482
481
  f < a ? l = c + 1 : f > a && (s = c - 1);
483
482
  }
484
483
  return l > 0 ? l - 1 : 0;
485
- }, Jt = function(e, t, r, s, l) {
484
+ }, Qt = function(e, t, r, s, l) {
486
485
  for (var a = e === "column" ? t.columnCount : t.rowCount, c = 1; s < a && $(e, t, s, r).offset < l; )
487
486
  s += c, c *= 2;
488
487
  return Je(e, t, r, Math.min(s, a - 1), Math.floor(s / 2), l);
@@ -499,7 +498,7 @@ var Zt = function(e, t) {
499
498
  default:
500
499
  return l >= i && l <= _ ? l : i > _ || l < i ? i : _;
501
500
  }
502
- }, Qt = /* @__PURE__ */ Kt({
501
+ }, Xt = /* @__PURE__ */ Zt({
503
502
  getColumnOffset: function(e, t, r) {
504
503
  return $("column", e, t, r).offset;
505
504
  },
@@ -581,9 +580,9 @@ function Ge(n, e) {
581
580
  return !0;
582
581
  return !1;
583
582
  }
584
- var Xt = ["style"], Yt = ["style"];
585
- function er(n, e) {
586
- var t = n.style, r = Fe(n, Xt), s = e.style, l = Fe(e, Yt);
583
+ var Yt = ["style"], er = ["style"];
584
+ function tr(n, e) {
585
+ var t = n.style, r = Fe(n, Yt), s = e.style, l = Fe(e, er);
587
586
  return !Ge(t, s) && !Ge(r, l);
588
587
  }
589
588
  let V;
@@ -602,13 +601,13 @@ ye == null || Be == null ? (Le = xe, Me = function(e) {
602
601
  }, $e);
603
602
  return [t, r];
604
603
  });
605
- function tr(n) {
604
+ function rr(n) {
606
605
  let e, t, r, s, l, a, c;
607
606
  const f = typeof document < "u" && document.attachEvent;
608
607
  if (!f) {
609
608
  a = function(b) {
610
- const I = b.__resizeTriggers__, W = I.firstElementChild, P = I.lastElementChild, o = W.firstElementChild;
611
- P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight, o.style.width = W.offsetWidth + 1 + "px", o.style.height = W.offsetHeight + 1 + "px", W.scrollLeft = W.scrollWidth, W.scrollTop = W.scrollHeight;
609
+ const I = b.__resizeTriggers__, W = I.firstElementChild, A = I.lastElementChild, o = W.firstElementChild;
610
+ A.scrollLeft = A.scrollWidth, A.scrollTop = A.scrollHeight, o.style.width = W.offsetWidth + 1 + "px", o.style.height = W.offsetHeight + 1 + "px", W.scrollLeft = W.scrollWidth, W.scrollTop = W.scrollHeight;
612
611
  }, l = function(b) {
613
612
  return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
614
613
  }, c = function(b) {
@@ -674,7 +673,7 @@ function tr(n) {
674
673
  }
675
674
  };
676
675
  }
677
- class rr extends lt {
676
+ class or extends lt {
678
677
  constructor(...e) {
679
678
  super(...e), this.state = {
680
679
  height: this.props.defaultHeight || 0,
@@ -722,7 +721,7 @@ class rr extends lt {
722
721
  const r = t.ownerDocument.defaultView.ResizeObserver;
723
722
  r != null ? (this._resizeObserver = new r(() => {
724
723
  this._timeoutId = setTimeout(this._onResize, 0);
725
- }), this._resizeObserver.observe(t)) : (this._detectElementResize = tr(e), this._detectElementResize.addResizeListener(t, this._onResize)), this._onResize();
724
+ }), this._resizeObserver.observe(t)) : (this._detectElementResize = rr(e), this._detectElementResize.addResizeListener(t, this._onResize)), this._onResize();
726
725
  }
727
726
  }
728
727
  componentWillUnmount() {
@@ -758,14 +757,7 @@ class rr extends lt {
758
757
  }, !D && e(S));
759
758
  }
760
759
  }
761
- const or = class {
762
- get sx() {
763
- return window.devicePixelRatio || 1;
764
- }
765
- get sy() {
766
- return window.devicePixelRatio || 1;
767
- }
768
- }, nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
760
+ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
769
761
  const s = Wt(
770
762
  e,
771
763
  n,
@@ -805,8 +797,8 @@ const or = class {
805
797
  children: /* @__PURE__ */ x(Ce, { style: { position: "relative" }, pageNumber: s }, s)
806
798
  }
807
799
  ) : /* @__PURE__ */ x(Ce, { style: r, pageNumber: s }, s);
808
- }, er), jo = () => {
809
- const n = G(new or()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = zt(), { scrollToPage: a } = ft();
800
+ }, tr), $o = () => {
801
+ const n = G(new kt()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = zt(), { scrollToPage: a } = ft();
810
802
  Dt(r);
811
803
  const {
812
804
  virtualScrollRef: c,
@@ -817,16 +809,16 @@ const or = class {
817
809
  virtualScrollableElementRef: i,
818
810
  totalInnerDimensions: y,
819
811
  pageScrollElementRef: w
820
- } = dt(), S = G(!0), { nextPage: D, prevPage: b, setFocusedPage: I, focusedPage: W, totalPages: P } = mt(), { scrollMode: o } = gt(), { viewMode: u } = ht(), d = G(null), { loading: m, error: C } = pt(), { passwordRequired: p } = Pt(), { LoaderImageComponent: T } = Mt(), z = G(
812
+ } = dt(), S = G(!0), { nextPage: D, prevPage: b, setFocusedPage: I, focusedPage: W, totalPages: A } = mt(), { scrollMode: o } = gt(), { viewMode: u } = ht(), d = G(null), { loading: m, error: C } = pt(), { passwordRequired: p } = At(), { LoaderImageComponent: T } = Mt(), z = G(
821
813
  y
822
814
  ), L = G({
823
815
  viewMode: u,
824
816
  scrollMode: o
825
817
  }), M = G(!1), E = G(), { isFullScreen: R } = wt(), {
826
818
  pageDimension: F,
827
- rowCount: N,
819
+ rowCount: P,
828
820
  rowHeight: H,
829
- columnCount: A,
821
+ columnCount: N,
830
822
  columnWidth: k,
831
823
  estimatedColumnWidth: Z,
832
824
  estimatedRowHeight: J,
@@ -834,7 +826,7 @@ const or = class {
834
826
  } = ut(), ie = Lt(y, 100), { onScroll: j, onTextSelect: le } = Ft();
835
827
  Ht({ onTextSelect: le, pagesRef: r });
836
828
  const X = G();
837
- Ot(A, N, i, u);
829
+ Ot(N, P, i, u);
838
830
  const Y = G({
839
831
  scrollTop: 0,
840
832
  scrollLeft: 0
@@ -843,14 +835,14 @@ const or = class {
843
835
  const { isPressed: ee } = Tt(), { selectionMode: B } = Rt(), { initializeGrabScroll: K, resetGrabState: pe } = xt({
844
836
  isPressed: ee
845
837
  }), te = we(() => B === vt.HAND, [B]), Qe = we(() => {
846
- const v = Array.from({ length: A }, (O, q) => k(q));
838
+ const v = Array.from({ length: N }, (O, q) => k(q));
847
839
  return {
848
- columnCount: A,
840
+ columnCount: N,
849
841
  isDualPageWithCover: u === Se.DUAL_PAGE_WITH_COVER,
850
842
  columnWidths: v,
851
- totalPages: P
843
+ totalPages: A
852
844
  };
853
- }, [A, u, k, P]), he = ae(
845
+ }, [N, u, k, A]), he = ae(
854
846
  (v) => {
855
847
  const O = document.activeElement !== r;
856
848
  !R && O || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), D()));
@@ -861,14 +853,14 @@ const or = class {
861
853
  window.removeEventListener("keydown", he);
862
854
  }), [he]), ne(() => {
863
855
  if (d.current && (d.current.style.position = "relative"), !!c)
864
- for (let v = 0; v < N; v++)
865
- for (let O = 0; O < A; O++)
856
+ for (let v = 0; v < P; v++)
857
+ for (let O = 0; O < N; O++)
866
858
  c.resetAfterIndices({
867
859
  columnIndex: O,
868
860
  rowIndex: v,
869
861
  shouldForceUpdate: !0
870
862
  });
871
- }, [N, A, F, c]);
863
+ }, [P, N, F, c]);
872
864
  const Xe = ae(
873
865
  (v, O) => {
874
866
  if (!i)
@@ -915,10 +907,10 @@ const or = class {
915
907
  );
916
908
  ne(() => {
917
909
  clearTimeout(E.current);
918
- const v = Array.from({ length: N }).reduce(
910
+ const v = Array.from({ length: P }).reduce(
919
911
  (re, ge, oe) => re + H(oe),
920
912
  0
921
- ), O = Array.from({ length: A }).reduce(
913
+ ), O = Array.from({ length: N }).reduce(
922
914
  (re, ge, oe) => re + k(oe),
923
915
  0
924
916
  ), q = Xe(O, v);
@@ -926,7 +918,7 @@ const or = class {
926
918
  height: v,
927
919
  width: O
928
920
  });
929
- }, [F, N, A, Ee]);
921
+ }, [F, P, N, Ee]);
930
922
  const Ye = ae(
931
923
  (v) => {
932
924
  Y.current = {
@@ -973,17 +965,17 @@ const or = class {
973
965
  I,
974
966
  ie
975
967
  ]), /* @__PURE__ */ _e(st, { children: [
976
- /* @__PURE__ */ x(Nt, { ref: l, children: /* @__PURE__ */ x(
977
- At,
968
+ /* @__PURE__ */ x(Pt, { ref: l, children: /* @__PURE__ */ x(
969
+ Nt,
978
970
  {
979
971
  ref: s,
980
972
  tabIndex: -1,
981
973
  className: et,
982
974
  style: {
983
- "--scale-round-x": `${Pe(n.current.sx)[1]}px`,
984
- "--scale-round-y": `${Pe(n.current.sy)[1]}px`
975
+ "--scale-round-x": `${Ae(n.current.sx)[1]}px`,
976
+ "--scale-round-y": `${Ae(n.current.sy)[1]}px`
985
977
  },
986
- children: /* @__PURE__ */ x(rr, { style: { minHeight: "50px" }, children: ({ width: v, height: O }) => /* @__PURE__ */ x("div", { "data-rp": "pages", ref: tt, style: { width: v, height: O }, children: o === Ie.PAGE_SCROLLING ? /* @__PURE__ */ x(
978
+ children: /* @__PURE__ */ x(or, { style: { minHeight: "50px" }, children: ({ width: v, height: O }) => /* @__PURE__ */ x("div", { "data-rp": "pages", ref: tt, style: { width: v, height: O }, children: o === Ie.PAGE_SCROLLING ? /* @__PURE__ */ x(
987
979
  "div",
988
980
  {
989
981
  ref: g,
@@ -992,21 +984,21 @@ const or = class {
992
984
  children: u === Se.DUAL_PAGE ? /* @__PURE__ */ x(Ct, { widths: k, heights: H }) : u === Se.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ x(St, { widths: k, heights: H }) : /* @__PURE__ */ x(It, { widths: k, heights: H })
993
985
  }
994
986
  ) : J ? /* @__PURE__ */ x(
995
- Qt,
987
+ Xt,
996
988
  {
997
989
  ref: f,
998
990
  itemData: Qe,
999
991
  outerRef: h,
1000
992
  innerRef: d,
1001
993
  onScroll: Ye,
1002
- columnCount: A,
994
+ columnCount: N,
1003
995
  columnWidth: k,
1004
996
  rowHeight: H,
1005
997
  height: O,
1006
998
  width: v,
1007
999
  estimatedColumnWidth: Z,
1008
1000
  estimatedRowHeight: J,
1009
- rowCount: N,
1001
+ rowCount: P,
1010
1002
  className: ce(
1011
1003
  U["rp-pages"],
1012
1004
  o === Ie.HORIZONTAL_SCROLLING ? U["rp-pages-horizontal-scroll"] : ""
@@ -1014,8 +1006,8 @@ const or = class {
1014
1006
  style: {
1015
1007
  "--rp-pages-height": `${Q.height}px`,
1016
1008
  "--rp-pages-width": `${Q.width}px`,
1017
- "--rp-row-count": `${N}`,
1018
- "--rp-column-count": `${A}`
1009
+ "--rp-row-count": `${P}`,
1010
+ "--rp-column-count": `${N}`
1019
1011
  },
1020
1012
  children: nr
1021
1013
  }
@@ -1049,5 +1041,5 @@ const or = class {
1049
1041
  ] });
1050
1042
  };
1051
1043
  export {
1052
- jo as RPPages
1044
+ $o as RPPages
1053
1045
  };
@@ -13,8 +13,7 @@ import { combinedCSS as D } from "../assets/style.js";
13
13
  import { injectGlobalCSS as E } from "../libInjectCss.js";
14
14
  import { injectPrintCSS as R } from "../utils/injectPrintCSS.js";
15
15
  import "../utils/hooks/useLoadPdf.js";
16
- import "@pdf-viewer/pdfium";
17
- import "@pdf-viewer/pdfium/compat";
16
+ import "pdfjs-dist";
18
17
  import "../utils/types.js";
19
18
  import "../de_DE-a553b162.js";
20
19
  import "../utils/getThumbnailViewport.js";
@@ -76,7 +75,7 @@ import "../utils/Queue.js";
76
75
  import "../utils/renderPage.js";
77
76
  import "./icons/LoaderIcon.js";
78
77
  import "../clsx-0c6e471a.js";
79
- const to = (i) => {
78
+ const oo = (i) => {
80
79
  const {
81
80
  children: m,
82
81
  src: o,
@@ -122,5 +121,5 @@ const to = (i) => {
122
121
  ) });
123
122
  };
124
123
  export {
125
- to as RPProvider
124
+ oo as RPProvider
126
125
  };
@@ -45,11 +45,11 @@ import "../../contexts/SmoothScrollContext.js";
45
45
  import "../../utils/getScrollDistance.js";
46
46
  import "../../utils/calculatePage.js";
47
47
  import "../ui/RPTooltip.js";
48
- import "../../index-113053cf.js";
48
+ import "../../index-c0faa594.js";
49
49
  import "react-dom";
50
- import "../../index-23911b43.js";
51
- import "../../index-d0f0aa9a.js";
52
- import "../../index-ada501c4.js";
50
+ import "../../index-e3ee9457.js";
51
+ import "../../floating-ui.react-dom-5ec29bd6.js";
52
+ import "../../index-655864a7.js";
53
53
  import "../../contexts/LocalizationContext.js";
54
54
  import "../../utils/hooks/useLocalization.js";
55
55
  import "../../contexts/IconToolContext.js";
@@ -58,8 +58,8 @@ import "./toolbar/RPToolbarEnd.js";
58
58
  import "./toolbar/FileUploadTool.js";
59
59
  import "../icons/FileUploadDefaultIcon.js";
60
60
  import "./toolbar/MenuItem.js";
61
- import "../../index-535ad364.js";
62
- import "../../Combination-479e39c6.js";
61
+ import "../../index-61f59539.js";
62
+ import "../../Combination-136ff99c.js";
63
63
  import "../../contexts/FileInputContext.js";
64
64
  import "../../contexts/DocumentPasswordContext.js";
65
65
  import "./toolbar/DarkModeTool.js";
@@ -100,7 +100,7 @@ import "./toolbar/PrintTool.js";
100
100
  import "../icons/PrintDefaultIcon.js";
101
101
  import "../../contexts/PrintContext.js";
102
102
  import "../../utils/hooks/usePrint.js";
103
- import "@pdf-viewer/pdfium/compat";
103
+ import "pdfjs-dist";
104
104
  import "./toolbar/FullScreenTool.js";
105
105
  import "../../contexts/FullScreenContext.js";
106
106
  import "../../utils/hooks/useFullScreen.js";
@@ -146,14 +146,15 @@ import "../../utils/hooks/useInfiniteScroll.js";
146
146
  import "../../contexts/DropFileZoneContext.js";
147
147
  import "../icons/LightPdfIcon.js";
148
148
  import "../icons/DarkPdfIcon.js";
149
+ import "../../utils/hooks/useDropFileZone.js";
150
+ import "../../contexts/LayoutDropFileZoneContext.js";
149
151
  import "../../utils/hooks/useLoadPdf.js";
150
- import "@pdf-viewer/pdfium";
151
152
  import "../../contexts/ConfigContext.js";
152
153
  import "../../utils/hooks/usePdfProperties.js";
153
154
  import "../../utils/convertPdfDate.js";
154
155
  import "../../utils/formatFileSize.js";
155
156
  import "../../contexts/ThemeContext.js";
156
- const Ft = L((n, a) => {
157
+ const jt = L((n, a) => {
157
158
  const {
158
159
  children: l,
159
160
  slots: s,
@@ -235,5 +236,5 @@ const Ft = L((n, a) => {
235
236
  ] }) }) }) }) });
236
237
  });
237
238
  export {
238
- Ft as RPDefaultLayout
239
+ jt as RPDefaultLayout
239
240
  };