@react-pdf-kit/viewer 2.3.0-beta.0 → 2.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Combination-479e39c6.js → Combination-17ab8af1.js} +184 -187
- package/dist/assets/style.css +1 -1
- package/dist/assets/style.js +7 -7
- package/dist/components/RPPages.js +126 -126
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/MenuItem.js +2 -2
- package/dist/components/layout/toolbar/MenuSeparator.js +2 -2
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/RPMenuItem.js +2 -2
- package/dist/components/layout/toolbar/RPMoreOptions.js +2 -2
- package/dist/components/layout/toolbar/RPToolbar.js +2 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
- package/dist/components/layout/toolbar/RotateTool.js +2 -2
- package/dist/components/layout/toolbar/ScrollModeTool.js +2 -2
- package/dist/components/layout/toolbar/SearchTool.js +2 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +2 -2
- package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
- package/dist/components/layout/toolbar/ToolbarLayout.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +2 -2
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +2 -2
- package/dist/components/ui/DropDown.js +2 -2
- package/dist/index-0b2a9a20.js +11698 -0
- package/dist/{index-535ad364.js → index-11f3cd64.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/utils/hooks/useLicense.js +106 -84
- package/package.json +3 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createElement as
|
|
1
|
+
import { jsx as R, jsxs as _e, Fragment as st } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as ue, PureComponent as at, Component as lt, memo as ct, useRef as G, useMemo as we, useCallback as ae, useEffect as ne } from "react";
|
|
3
3
|
import { RPPage as Ce } from "./page/RPPage.js";
|
|
4
|
-
import { useVirtualReactWindow as
|
|
5
|
-
import { useVirtualScrollContext as
|
|
4
|
+
import { useVirtualReactWindow as ut } from "../utils/hooks/useVirtualReactWindow.js";
|
|
5
|
+
import { useVirtualScrollContext as dt } from "../contexts/VirtualScrollContext.js";
|
|
6
6
|
import { a as ft, u as mt } from "../PaginationContext-9217cab4.js";
|
|
7
7
|
import { useDocumentContext as pt } from "../contexts/RPDocumentContext.js";
|
|
8
8
|
import { useViewModeContext as ht } from "../contexts/ViewModeContext.js";
|
|
@@ -14,8 +14,8 @@ import { DualPage as Ct } from "./page/DualPage.js";
|
|
|
14
14
|
import { DualPageWithCover as St } from "./page/DualPageWithCover.js";
|
|
15
15
|
import { SinglePage as It } from "./page/SinglePage.js";
|
|
16
16
|
import { useMousePressed as Tt } from "../utils/hooks/useMousePressed.js";
|
|
17
|
-
import { useSelectionModeContext as
|
|
18
|
-
import { useGrabScroll as
|
|
17
|
+
import { useSelectionModeContext as xt } from "../contexts/SelectionModeContext.js";
|
|
18
|
+
import { useGrabScroll as Rt } from "../utils/hooks/useGrabScroll.js";
|
|
19
19
|
import { usePinch as yt } from "../utils/hooks/usePinch.js";
|
|
20
20
|
import { useInitialStateContext as bt } from "../contexts/InitialStateContext.js";
|
|
21
21
|
import { useLayoutContainer as zt } from "../contexts/LayoutContainerContext.js";
|
|
@@ -91,17 +91,17 @@ import "../contexts/ThemeContext.js";
|
|
|
91
91
|
import "../contexts/DarkModeContext.js";
|
|
92
92
|
import "../utils/hooks/useDarkMode.js";
|
|
93
93
|
const U = {
|
|
94
|
-
"rp-pages": "_rp-
|
|
95
|
-
"rp-page-scrolling-wrapper": "_rp-page-scrolling-
|
|
96
|
-
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-
|
|
97
|
-
"rp-not-supported-list": "_rp-not-supported-
|
|
98
|
-
"rp-pages-container": "_rp-pages-
|
|
99
|
-
"rp-viewer": "_rp-
|
|
100
|
-
"rp-cursor-grab": "_rp-cursor-
|
|
101
|
-
"rp-cursor-grabbing": "_rp-cursor-
|
|
102
|
-
"rp-loader": "_rp-
|
|
103
|
-
"rp-not-supported": "_rp-not-
|
|
104
|
-
"rp-not-supported-content": "_rp-not-supported-
|
|
94
|
+
"rp-pages": "_rp-pages_1muxf_1",
|
|
95
|
+
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_1muxf_6",
|
|
96
|
+
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_1muxf_11",
|
|
97
|
+
"rp-not-supported-list": "_rp-not-supported-list_1muxf_15",
|
|
98
|
+
"rp-pages-container": "_rp-pages-container_1muxf_23",
|
|
99
|
+
"rp-viewer": "_rp-viewer_1muxf_65",
|
|
100
|
+
"rp-cursor-grab": "_rp-cursor-grab_1muxf_70",
|
|
101
|
+
"rp-cursor-grabbing": "_rp-cursor-grabbing_1muxf_78",
|
|
102
|
+
"rp-loader": "_rp-loader_1muxf_86",
|
|
103
|
+
"rp-not-supported": "_rp-not-supported_1muxf_15",
|
|
104
|
+
"rp-not-supported-content": "_rp-not-supported-content_1muxf_102"
|
|
105
105
|
};
|
|
106
106
|
function be() {
|
|
107
107
|
return be = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -180,13 +180,13 @@ function $t(n, e) {
|
|
|
180
180
|
};
|
|
181
181
|
return s;
|
|
182
182
|
}
|
|
183
|
-
var
|
|
183
|
+
var xe = -1;
|
|
184
184
|
function jt(n) {
|
|
185
|
-
if (n === void 0 && (n = !1),
|
|
185
|
+
if (n === void 0 && (n = !1), xe === -1 || n) {
|
|
186
186
|
var e = document.createElement("div"), t = e.style;
|
|
187
|
-
t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e),
|
|
187
|
+
t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), xe = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
188
188
|
}
|
|
189
|
-
return
|
|
189
|
+
return xe;
|
|
190
190
|
}
|
|
191
191
|
var se = null;
|
|
192
192
|
function ke(n) {
|
|
@@ -203,8 +203,8 @@ var Bt = 150, Kt = function(e) {
|
|
|
203
203
|
e.data;
|
|
204
204
|
var r = e.rowIndex;
|
|
205
205
|
return r + ":" + t;
|
|
206
|
-
},
|
|
207
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (
|
|
206
|
+
}, de = null, fe = null, me = null;
|
|
207
|
+
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
208
|
function Zt(n) {
|
|
209
209
|
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
210
|
return e = /* @__PURE__ */ function(b) {
|
|
@@ -219,10 +219,10 @@ function Zt(n) {
|
|
|
219
219
|
scrollTop: typeof o.props.initialScrollTop == "number" ? o.props.initialScrollTop : 0,
|
|
220
220
|
scrollUpdateWasRequested: !1,
|
|
221
221
|
verticalScrollDirection: "forward"
|
|
222
|
-
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = Te(function(
|
|
222
|
+
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = Te(function(u, d, m, C, p, T, z, L) {
|
|
223
223
|
return o.props.onItemsRendered({
|
|
224
|
-
overscanColumnStartIndex:
|
|
225
|
-
overscanColumnStopIndex:
|
|
224
|
+
overscanColumnStartIndex: u,
|
|
225
|
+
overscanColumnStopIndex: d,
|
|
226
226
|
overscanRowStartIndex: m,
|
|
227
227
|
overscanRowStopIndex: C,
|
|
228
228
|
visibleColumnStartIndex: p,
|
|
@@ -230,61 +230,61 @@ function Zt(n) {
|
|
|
230
230
|
visibleRowStartIndex: z,
|
|
231
231
|
visibleRowStopIndex: L
|
|
232
232
|
});
|
|
233
|
-
}), o._callOnScroll = void 0, o._callOnScroll = Te(function(
|
|
233
|
+
}), o._callOnScroll = void 0, o._callOnScroll = Te(function(u, d, m, C, p) {
|
|
234
234
|
return o.props.onScroll({
|
|
235
235
|
horizontalScrollDirection: m,
|
|
236
|
-
scrollLeft:
|
|
237
|
-
scrollTop:
|
|
236
|
+
scrollLeft: u,
|
|
237
|
+
scrollTop: d,
|
|
238
238
|
verticalScrollDirection: C,
|
|
239
239
|
scrollUpdateWasRequested: p
|
|
240
240
|
});
|
|
241
|
-
}), o._getItemStyle = void 0, o._getItemStyle = function(
|
|
242
|
-
var m = o.props, C = m.columnWidth, p = m.direction, T = m.rowHeight, z = o._getItemStyleCache(S && C, S && p, S && T), L =
|
|
241
|
+
}), o._getItemStyle = void 0, o._getItemStyle = function(u, d) {
|
|
242
|
+
var m = o.props, C = m.columnWidth, p = m.direction, T = m.rowHeight, z = o._getItemStyleCache(S && C, S && p, S && T), L = u + ":" + d, M;
|
|
243
243
|
if (z.hasOwnProperty(L))
|
|
244
244
|
M = z[L];
|
|
245
245
|
else {
|
|
246
|
-
var E = t(o.props,
|
|
246
|
+
var E = t(o.props, d, o._instanceProps), x = p === "rtl";
|
|
247
247
|
z[L] = M = {
|
|
248
248
|
position: "absolute",
|
|
249
|
-
left:
|
|
250
|
-
right:
|
|
251
|
-
top: _(o.props,
|
|
252
|
-
height: h(o.props,
|
|
253
|
-
width: l(o.props,
|
|
249
|
+
left: x ? void 0 : E,
|
|
250
|
+
right: x ? E : void 0,
|
|
251
|
+
top: _(o.props, u, o._instanceProps),
|
|
252
|
+
height: h(o.props, u, o._instanceProps),
|
|
253
|
+
width: l(o.props, d, o._instanceProps)
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
256
|
return M;
|
|
257
|
-
}, o._getItemStyleCache = void 0, o._getItemStyleCache = Te(function(
|
|
257
|
+
}, o._getItemStyleCache = void 0, o._getItemStyleCache = Te(function(u, d, m) {
|
|
258
258
|
return {};
|
|
259
|
-
}), o._onScroll = function(
|
|
260
|
-
var
|
|
259
|
+
}), o._onScroll = function(u) {
|
|
260
|
+
var d = u.currentTarget, m = d.clientHeight, C = d.clientWidth, p = d.scrollLeft, T = d.scrollTop, z = d.scrollHeight, L = d.scrollWidth;
|
|
261
261
|
o.setState(function(M) {
|
|
262
262
|
if (M.scrollLeft === p && M.scrollTop === T)
|
|
263
263
|
return null;
|
|
264
|
-
var E = o.props.direction,
|
|
264
|
+
var E = o.props.direction, x = p;
|
|
265
265
|
if (E === "rtl")
|
|
266
266
|
switch (ke()) {
|
|
267
267
|
case "negative":
|
|
268
|
-
|
|
268
|
+
x = -p;
|
|
269
269
|
break;
|
|
270
270
|
case "positive-descending":
|
|
271
|
-
|
|
271
|
+
x = L - C - p;
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
x = Math.max(0, Math.min(x, L - C));
|
|
275
275
|
var F = Math.max(0, Math.min(T, z - m));
|
|
276
276
|
return {
|
|
277
277
|
isScrolling: !0,
|
|
278
278
|
horizontalScrollDirection: M.scrollLeft < p ? "forward" : "backward",
|
|
279
|
-
scrollLeft:
|
|
279
|
+
scrollLeft: x,
|
|
280
280
|
scrollTop: F,
|
|
281
281
|
verticalScrollDirection: M.scrollTop < T ? "forward" : "backward",
|
|
282
282
|
scrollUpdateWasRequested: !1
|
|
283
283
|
};
|
|
284
284
|
}, o._resetIsScrollingDebounced);
|
|
285
|
-
}, o._outerRefSetter = function(
|
|
286
|
-
var
|
|
287
|
-
o._outerRef =
|
|
285
|
+
}, o._outerRefSetter = function(u) {
|
|
286
|
+
var d = o.props.outerRef;
|
|
287
|
+
o._outerRef = u, typeof d == "function" ? d(u) : d != null && typeof d == "object" && d.hasOwnProperty("current") && (d.current = u);
|
|
288
288
|
}, o._resetIsScrollingDebounced = function() {
|
|
289
289
|
o._resetIsScrollingTimeoutId !== null && He(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = $t(o._resetIsScrolling, Bt);
|
|
290
290
|
}, o._resetIsScrolling = function() {
|
|
@@ -295,70 +295,70 @@ function Zt(n) {
|
|
|
295
295
|
});
|
|
296
296
|
}, o;
|
|
297
297
|
}
|
|
298
|
-
I.getDerivedStateFromProps = function(o,
|
|
299
|
-
return Jt(o,
|
|
298
|
+
I.getDerivedStateFromProps = function(o, u) {
|
|
299
|
+
return Jt(o, u), D(o), null;
|
|
300
300
|
};
|
|
301
301
|
var W = I.prototype;
|
|
302
302
|
return W.scrollTo = function(o) {
|
|
303
|
-
var
|
|
304
|
-
|
|
305
|
-
return
|
|
306
|
-
horizontalScrollDirection: m.scrollLeft <
|
|
307
|
-
scrollLeft:
|
|
308
|
-
scrollTop:
|
|
303
|
+
var u = o.scrollLeft, d = o.scrollTop;
|
|
304
|
+
u !== void 0 && (u = Math.max(0, u)), d !== void 0 && (d = Math.max(0, d)), this.setState(function(m) {
|
|
305
|
+
return u === void 0 && (u = m.scrollLeft), d === void 0 && (d = m.scrollTop), m.scrollLeft === u && m.scrollTop === d ? null : {
|
|
306
|
+
horizontalScrollDirection: m.scrollLeft < u ? "forward" : "backward",
|
|
307
|
+
scrollLeft: u,
|
|
308
|
+
scrollTop: d,
|
|
309
309
|
scrollUpdateWasRequested: !0,
|
|
310
|
-
verticalScrollDirection: m.scrollTop <
|
|
310
|
+
verticalScrollDirection: m.scrollTop < d ? "forward" : "backward"
|
|
311
311
|
};
|
|
312
312
|
}, this._resetIsScrollingDebounced);
|
|
313
313
|
}, W.scrollToItem = function(o) {
|
|
314
|
-
var
|
|
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, x = E.scrollLeft, F = E.scrollTop, P = jt();
|
|
315
315
|
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
316
|
var H = a(this.props, this._instanceProps), N = c(this.props, this._instanceProps), k = N > M ? P : 0, Z = H > z ? P : 0;
|
|
317
317
|
this.scrollTo({
|
|
318
|
-
scrollLeft: m !== void 0 ? f(this.props, m,
|
|
319
|
-
scrollTop: C !== void 0 ? g(this.props, C,
|
|
318
|
+
scrollLeft: m !== void 0 ? f(this.props, m, d, x, this._instanceProps, Z) : x,
|
|
319
|
+
scrollTop: C !== void 0 ? g(this.props, C, d, F, this._instanceProps, k) : F
|
|
320
320
|
});
|
|
321
321
|
}, W.componentDidMount = function() {
|
|
322
|
-
var o = this.props,
|
|
322
|
+
var o = this.props, u = o.initialScrollLeft, d = o.initialScrollTop;
|
|
323
323
|
if (this._outerRef != null) {
|
|
324
324
|
var m = this._outerRef;
|
|
325
|
-
typeof
|
|
325
|
+
typeof u == "number" && (m.scrollLeft = u), typeof d == "number" && (m.scrollTop = d);
|
|
326
326
|
}
|
|
327
327
|
this._callPropsCallbacks();
|
|
328
328
|
}, W.componentDidUpdate = function() {
|
|
329
|
-
var o = this.props.direction,
|
|
329
|
+
var o = this.props.direction, u = this.state, d = u.scrollLeft, m = u.scrollTop, C = u.scrollUpdateWasRequested;
|
|
330
330
|
if (C && this._outerRef != null) {
|
|
331
331
|
var p = this._outerRef;
|
|
332
332
|
if (o === "rtl")
|
|
333
333
|
switch (ke()) {
|
|
334
334
|
case "negative":
|
|
335
|
-
p.scrollLeft = -
|
|
335
|
+
p.scrollLeft = -d;
|
|
336
336
|
break;
|
|
337
337
|
case "positive-ascending":
|
|
338
|
-
p.scrollLeft =
|
|
338
|
+
p.scrollLeft = d;
|
|
339
339
|
break;
|
|
340
340
|
default:
|
|
341
341
|
var T = p.clientWidth, z = p.scrollWidth;
|
|
342
|
-
p.scrollLeft = z - T -
|
|
342
|
+
p.scrollLeft = z - T - d;
|
|
343
343
|
break;
|
|
344
344
|
}
|
|
345
345
|
else
|
|
346
|
-
p.scrollLeft = Math.max(0,
|
|
346
|
+
p.scrollLeft = Math.max(0, d);
|
|
347
347
|
p.scrollTop = Math.max(0, m);
|
|
348
348
|
}
|
|
349
349
|
this._callPropsCallbacks();
|
|
350
350
|
}, W.componentWillUnmount = function() {
|
|
351
351
|
this._resetIsScrollingTimeoutId !== null && He(this._resetIsScrollingTimeoutId);
|
|
352
352
|
}, W.render = function() {
|
|
353
|
-
var o = this.props,
|
|
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, x = 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
354
|
if (m > 0 && H)
|
|
355
355
|
for (var B = X; B <= Y; B++)
|
|
356
356
|
for (var K = ie; K <= j; K++)
|
|
357
|
-
ee.push(
|
|
357
|
+
ee.push(ue(u, {
|
|
358
358
|
columnIndex: K,
|
|
359
359
|
data: M,
|
|
360
360
|
isScrolling: k ? J : void 0,
|
|
361
|
-
key:
|
|
361
|
+
key: x({
|
|
362
362
|
columnIndex: K,
|
|
363
363
|
data: M,
|
|
364
364
|
rowIndex: B
|
|
@@ -367,8 +367,8 @@ function Zt(n) {
|
|
|
367
367
|
style: this._getItemStyle(B, K)
|
|
368
368
|
}));
|
|
369
369
|
var pe = a(this.props, this._instanceProps), te = c(this.props, this._instanceProps);
|
|
370
|
-
return
|
|
371
|
-
className:
|
|
370
|
+
return ue(F || P || "div", {
|
|
371
|
+
className: d,
|
|
372
372
|
onScroll: this._onScroll,
|
|
373
373
|
ref: this._outerRefSetter,
|
|
374
374
|
style: be({
|
|
@@ -380,7 +380,7 @@ function Zt(n) {
|
|
|
380
380
|
willChange: "transform",
|
|
381
381
|
direction: C
|
|
382
382
|
}, N)
|
|
383
|
-
},
|
|
383
|
+
}, ue(z || L || "div", {
|
|
384
384
|
children: ee,
|
|
385
385
|
ref: T,
|
|
386
386
|
style: {
|
|
@@ -390,27 +390,27 @@ function Zt(n) {
|
|
|
390
390
|
}
|
|
391
391
|
}));
|
|
392
392
|
}, W._callPropsCallbacks = function() {
|
|
393
|
-
var o = this.props,
|
|
394
|
-
if (typeof
|
|
395
|
-
var p = this._getHorizontalRangeToRender(), T = p[0], z = p[1], L = p[2], M = p[3], E = this._getVerticalRangeToRender(),
|
|
396
|
-
this._callOnItemsRendered(T, z,
|
|
393
|
+
var o = this.props, u = o.columnCount, d = o.onItemsRendered, m = o.onScroll, C = o.rowCount;
|
|
394
|
+
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(), x = E[0], F = E[1], P = E[2], H = E[3];
|
|
396
|
+
this._callOnItemsRendered(T, z, x, F, L, M, P, H);
|
|
397
397
|
}
|
|
398
398
|
if (typeof m == "function") {
|
|
399
399
|
var N = this.state, k = N.horizontalScrollDirection, Z = N.scrollLeft, J = N.scrollTop, Q = N.scrollUpdateWasRequested, ie = N.verticalScrollDirection;
|
|
400
400
|
this._callOnScroll(Z, J, k, ie, Q);
|
|
401
401
|
}
|
|
402
402
|
}, W._getHorizontalRangeToRender = function() {
|
|
403
|
-
var o = this.props,
|
|
404
|
-
if (
|
|
403
|
+
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
|
+
if (u === 0 || p === 0)
|
|
405
405
|
return [0, 0, 0, 0];
|
|
406
|
-
var
|
|
407
|
-
return [Math.max(0,
|
|
406
|
+
var x = r(this.props, M, this._instanceProps), F = s(this.props, x, M, this._instanceProps), P = !L || z === "backward" ? Math.max(1, E) : 1, H = !L || z === "forward" ? Math.max(1, E) : 1;
|
|
407
|
+
return [Math.max(0, x - P), Math.max(0, Math.min(u - 1, F + H)), x, F];
|
|
408
408
|
}, W._getVerticalRangeToRender = function() {
|
|
409
|
-
var o = this.props,
|
|
410
|
-
if (
|
|
409
|
+
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
|
+
if (u === 0 || p === 0)
|
|
411
411
|
return [0, 0, 0, 0];
|
|
412
|
-
var
|
|
413
|
-
return [Math.max(0,
|
|
412
|
+
var x = i(this.props, M, this._instanceProps), F = y(this.props, x, M, this._instanceProps), P = !z || L === "backward" ? Math.max(1, E) : 1, H = !z || L === "forward" ? Math.max(1, E) : 1;
|
|
413
|
+
return [Math.max(0, x - P), Math.max(0, Math.min(p - 1, F + H)), x, F];
|
|
414
414
|
}, I;
|
|
415
415
|
}(at), e.defaultProps = {
|
|
416
416
|
direction: "ltr",
|
|
@@ -421,7 +421,7 @@ function Zt(n) {
|
|
|
421
421
|
var Jt = function(e, t) {
|
|
422
422
|
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
423
|
if (process.env.NODE_ENV !== "production") {
|
|
424
|
-
if (typeof g == "number" &&
|
|
424
|
+
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)
|
|
425
425
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
426
426
|
switch (s) {
|
|
427
427
|
case "ltr":
|
|
@@ -589,14 +589,14 @@ function tr(n, e) {
|
|
|
589
589
|
let V;
|
|
590
590
|
typeof window < "u" ? V = window : typeof self < "u" ? V = self : V = global;
|
|
591
591
|
let Le = null, Me = null;
|
|
592
|
-
const $e = 20,
|
|
593
|
-
ye == null || Be == null ? (Le =
|
|
592
|
+
const $e = 20, Re = V.clearTimeout, je = V.setTimeout, ye = V.cancelAnimationFrame || V.mozCancelAnimationFrame || V.webkitCancelAnimationFrame, Be = V.requestAnimationFrame || V.mozRequestAnimationFrame || V.webkitRequestAnimationFrame;
|
|
593
|
+
ye == null || Be == null ? (Le = Re, Me = function(e) {
|
|
594
594
|
return je(e, $e);
|
|
595
595
|
}) : (Le = function([e, t]) {
|
|
596
|
-
ye(e),
|
|
596
|
+
ye(e), Re(t);
|
|
597
597
|
}, Me = function(e) {
|
|
598
598
|
const t = Be(function() {
|
|
599
|
-
|
|
599
|
+
Re(r), e();
|
|
600
600
|
}), r = je(function() {
|
|
601
601
|
ye(t), e();
|
|
602
602
|
}, $e);
|
|
@@ -748,7 +748,7 @@ class or extends lt {
|
|
|
748
748
|
overflow: "visible"
|
|
749
749
|
}, S = {};
|
|
750
750
|
let D = !1;
|
|
751
|
-
return s || (i === 0 && (D = !0), w.height = 0, S.height = i, S.scaledHeight = i), l || (y === 0 && (D = !0), w.width = 0, S.width = y, S.scaledWidth = y), a && (D = !1),
|
|
751
|
+
return s || (i === 0 && (D = !0), w.height = 0, S.height = i, S.scaledHeight = i), l || (y === 0 && (D = !0), w.width = 0, S.width = y, S.scaledWidth = y), a && (D = !1), ue(h, {
|
|
752
752
|
ref: this._setRef,
|
|
753
753
|
style: {
|
|
754
754
|
...w,
|
|
@@ -771,7 +771,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
771
771
|
const a = s === t.totalPages && t.totalPages % 2 === 0;
|
|
772
772
|
if (e === 0 && s === 1 || a && n === 0) {
|
|
773
773
|
const f = t.columnWidths.reduce((g, h) => g + h, 0);
|
|
774
|
-
return /* @__PURE__ */
|
|
774
|
+
return /* @__PURE__ */ R(
|
|
775
775
|
"div",
|
|
776
776
|
{
|
|
777
777
|
style: {
|
|
@@ -781,12 +781,12 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
781
781
|
justifyContent: "center",
|
|
782
782
|
alignItems: "flex-start"
|
|
783
783
|
},
|
|
784
|
-
children: /* @__PURE__ */
|
|
784
|
+
children: /* @__PURE__ */ R(Ce, { style: { position: "relative" }, pageNumber: s }, s)
|
|
785
785
|
}
|
|
786
786
|
);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
return t.columnCount === 2 ? /* @__PURE__ */
|
|
789
|
+
return t.columnCount === 2 ? /* @__PURE__ */ R(
|
|
790
790
|
"div",
|
|
791
791
|
{
|
|
792
792
|
style: {
|
|
@@ -795,9 +795,9 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
795
795
|
justifyContent: n === 0 ? "flex-end" : "flex-start",
|
|
796
796
|
alignItems: "flex-start"
|
|
797
797
|
},
|
|
798
|
-
children: /* @__PURE__ */
|
|
798
|
+
children: /* @__PURE__ */ R(Ce, { style: { position: "relative" }, pageNumber: s }, s)
|
|
799
799
|
}
|
|
800
|
-
) : /* @__PURE__ */
|
|
800
|
+
) : /* @__PURE__ */ R(Ce, { style: r, pageNumber: s }, s);
|
|
801
801
|
}, tr), $o = () => {
|
|
802
802
|
const n = G(new kt()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = zt(), { scrollToPage: a } = ft();
|
|
803
803
|
Dt(r);
|
|
@@ -810,12 +810,12 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
810
810
|
virtualScrollableElementRef: i,
|
|
811
811
|
totalInnerDimensions: y,
|
|
812
812
|
pageScrollElementRef: w
|
|
813
|
-
} =
|
|
813
|
+
} = 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(
|
|
814
814
|
y
|
|
815
815
|
), L = G({
|
|
816
|
-
viewMode:
|
|
816
|
+
viewMode: u,
|
|
817
817
|
scrollMode: o
|
|
818
|
-
}), M = G(!1), E = G(), { isFullScreen:
|
|
818
|
+
}), M = G(!1), E = G(), { isFullScreen: x } = wt(), {
|
|
819
819
|
pageDimension: F,
|
|
820
820
|
rowCount: P,
|
|
821
821
|
rowHeight: H,
|
|
@@ -824,36 +824,36 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
824
824
|
estimatedColumnWidth: Z,
|
|
825
825
|
estimatedRowHeight: J,
|
|
826
826
|
totalDimension: Q
|
|
827
|
-
} =
|
|
827
|
+
} = ut(), ie = Lt(y, 100), { onScroll: j, onTextSelect: le } = Ft();
|
|
828
828
|
Ht({ onTextSelect: le, pagesRef: r });
|
|
829
829
|
const X = G();
|
|
830
|
-
Ot(N, P, i,
|
|
830
|
+
Ot(N, P, i, u);
|
|
831
831
|
const Y = G({
|
|
832
832
|
scrollTop: 0,
|
|
833
833
|
scrollLeft: 0
|
|
834
834
|
});
|
|
835
835
|
yt(r);
|
|
836
|
-
const { isPressed: ee } = Tt(), { selectionMode: B } =
|
|
836
|
+
const { isPressed: ee } = Tt(), { selectionMode: B } = xt(), { initializeGrabScroll: K, resetGrabState: pe } = Rt({
|
|
837
837
|
isPressed: ee
|
|
838
838
|
}), te = we(() => B === vt.HAND, [B]), Qe = we(() => {
|
|
839
839
|
const v = Array.from({ length: N }, (O, q) => k(q));
|
|
840
840
|
return {
|
|
841
841
|
columnCount: N,
|
|
842
|
-
isDualPageWithCover:
|
|
842
|
+
isDualPageWithCover: u === Se.DUAL_PAGE_WITH_COVER,
|
|
843
843
|
columnWidths: v,
|
|
844
844
|
totalPages: A
|
|
845
845
|
};
|
|
846
|
-
}, [N,
|
|
846
|
+
}, [N, u, k, A]), he = ae(
|
|
847
847
|
(v) => {
|
|
848
848
|
const O = document.activeElement !== r;
|
|
849
|
-
!
|
|
849
|
+
!x && O || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), D()));
|
|
850
850
|
},
|
|
851
|
-
[D, b,
|
|
851
|
+
[D, b, x, o]
|
|
852
852
|
);
|
|
853
853
|
ne(() => (window.addEventListener("keydown", he), () => {
|
|
854
854
|
window.removeEventListener("keydown", he);
|
|
855
855
|
}), [he]), ne(() => {
|
|
856
|
-
if (
|
|
856
|
+
if (d.current && (d.current.style.position = "relative"), !!c)
|
|
857
857
|
for (let v = 0; v < P; v++)
|
|
858
858
|
for (let O = 0; O < N; O++)
|
|
859
859
|
c.resetAfterIndices({
|
|
@@ -875,10 +875,10 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
875
875
|
[i]
|
|
876
876
|
), Ee = ae(
|
|
877
877
|
(v, O) => {
|
|
878
|
-
if (L.current.viewMode !==
|
|
878
|
+
if (L.current.viewMode !== u || L.current.scrollMode !== o) {
|
|
879
879
|
X.current && clearTimeout(X.current), M.current = !0, a(W, "auto"), X.current = setTimeout(() => {
|
|
880
880
|
requestAnimationFrame(() => {
|
|
881
|
-
L.current = { viewMode:
|
|
881
|
+
L.current = { viewMode: u, scrollMode: o };
|
|
882
882
|
});
|
|
883
883
|
}, 100);
|
|
884
884
|
return;
|
|
@@ -904,7 +904,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
904
904
|
width: O.width
|
|
905
905
|
};
|
|
906
906
|
},
|
|
907
|
-
[i,
|
|
907
|
+
[i, u, o, a]
|
|
908
908
|
);
|
|
909
909
|
ne(() => {
|
|
910
910
|
clearTimeout(E.current);
|
|
@@ -966,7 +966,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
966
966
|
I,
|
|
967
967
|
ie
|
|
968
968
|
]), /* @__PURE__ */ _e(st, { children: [
|
|
969
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ R(Pt, { ref: l, children: /* @__PURE__ */ R(
|
|
970
970
|
Nt,
|
|
971
971
|
{
|
|
972
972
|
ref: s,
|
|
@@ -976,21 +976,21 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
976
976
|
"--scale-round-x": `${Ae(n.current.sx)[1]}px`,
|
|
977
977
|
"--scale-round-y": `${Ae(n.current.sy)[1]}px`
|
|
978
978
|
},
|
|
979
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ R(or, { style: { minHeight: "50px" }, children: ({ width: v, height: O }) => /* @__PURE__ */ R("div", { "data-rp": "pages", ref: tt, style: { width: v, height: O }, children: o === Ie.PAGE_SCROLLING ? /* @__PURE__ */ R(
|
|
980
980
|
"div",
|
|
981
981
|
{
|
|
982
982
|
ref: g,
|
|
983
983
|
style: { width: v, height: O },
|
|
984
984
|
className: ce(U["rp-pages"], U["rp-page-scrolling-wrapper"]),
|
|
985
|
-
children:
|
|
985
|
+
children: u === Se.DUAL_PAGE ? /* @__PURE__ */ R(Ct, { widths: k, heights: H }) : u === Se.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ R(St, { widths: k, heights: H }) : /* @__PURE__ */ R(It, { widths: k, heights: H })
|
|
986
986
|
}
|
|
987
|
-
) : J ? /* @__PURE__ */
|
|
987
|
+
) : J ? /* @__PURE__ */ R(
|
|
988
988
|
Xt,
|
|
989
989
|
{
|
|
990
990
|
ref: f,
|
|
991
991
|
itemData: Qe,
|
|
992
992
|
outerRef: h,
|
|
993
|
-
innerRef:
|
|
993
|
+
innerRef: d,
|
|
994
994
|
onScroll: Ye,
|
|
995
995
|
columnCount: N,
|
|
996
996
|
columnWidth: k,
|
|
@@ -1012,7 +1012,7 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
1012
1012
|
},
|
|
1013
1013
|
children: nr
|
|
1014
1014
|
}
|
|
1015
|
-
) : !m && !C ? /* @__PURE__ */
|
|
1015
|
+
) : !m && !C ? /* @__PURE__ */ R(
|
|
1016
1016
|
"div",
|
|
1017
1017
|
{
|
|
1018
1018
|
className: U["rp-loader"],
|
|
@@ -1023,22 +1023,22 @@ const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
|
1023
1023
|
height: "100%",
|
|
1024
1024
|
width: "100%"
|
|
1025
1025
|
},
|
|
1026
|
-
children: T && /* @__PURE__ */
|
|
1026
|
+
children: T && /* @__PURE__ */ R(T, {})
|
|
1027
1027
|
}
|
|
1028
|
-
) : C === _t.NOT_SUPPORTED ? /* @__PURE__ */
|
|
1028
|
+
) : C === _t.NOT_SUPPORTED ? /* @__PURE__ */ R("div", { className: U["rp-not-supported"], children: /* @__PURE__ */ _e("div", { className: U["rp-not-supported-content"], children: [
|
|
1029
1029
|
"React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ R("div", { children: /* @__PURE__ */ _e("ul", { className: U["rp-not-supported-list"], children: [
|
|
1031
|
+
/* @__PURE__ */ R("li", { children: "Chrome 126+" }),
|
|
1032
|
+
/* @__PURE__ */ R("li", { children: "Edge 126+" }),
|
|
1033
|
+
/* @__PURE__ */ R("li", { children: "Firefox 126+" }),
|
|
1034
|
+
/* @__PURE__ */ R("li", { children: "Safari 18.4+" }),
|
|
1035
|
+
/* @__PURE__ */ R("li", { children: "Safari iOS 18.4+" }),
|
|
1036
|
+
/* @__PURE__ */ R("li", { children: "Chrome Android 126+" })
|
|
1037
1037
|
] }) })
|
|
1038
1038
|
] }) }) : null }) })
|
|
1039
1039
|
}
|
|
1040
1040
|
) }),
|
|
1041
|
-
p && /* @__PURE__ */
|
|
1041
|
+
p && /* @__PURE__ */ R(Et, {})
|
|
1042
1042
|
] });
|
|
1043
1043
|
};
|
|
1044
1044
|
export {
|
|
@@ -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-
|
|
62
|
-
import "../../Combination-
|
|
61
|
+
import "../../index-11f3cd64.js";
|
|
62
|
+
import "../../Combination-17ab8af1.js";
|
|
63
63
|
import "../../contexts/FileInputContext.js";
|
|
64
64
|
import "../../contexts/DocumentPasswordContext.js";
|
|
65
65
|
import "./toolbar/DarkModeTool.js";
|
|
@@ -84,8 +84,8 @@ import "../icons/ChevronUpIcon.js";
|
|
|
84
84
|
import "./toolbar/SearchCloseButton.js";
|
|
85
85
|
import "../icons/CloseIcon.js";
|
|
86
86
|
import "../ui/DropDown.js";
|
|
87
|
-
import "../../index-
|
|
88
|
-
import "../../Combination-
|
|
87
|
+
import "../../index-11f3cd64.js";
|
|
88
|
+
import "../../Combination-17ab8af1.js";
|
|
89
89
|
import "./toolbar/Paginate.js";
|
|
90
90
|
import "../../Paginate.module-4eef00aa.js";
|
|
91
91
|
import "./toolbar/ZoomTool.js";
|
|
@@ -3,7 +3,7 @@ import * as c from "react";
|
|
|
3
3
|
import { useMemo as J } from "react";
|
|
4
4
|
import { c as Q, a as R, P as D, b as v, d as y, e as X, f as M, g as ee } from "../../../index-113053cf.js";
|
|
5
5
|
import { D as te, u as P } from "../../../index-23911b43.js";
|
|
6
|
-
import { R as oe, h as re, u as ne, F as ie, P as ae } from "../../../Combination-
|
|
6
|
+
import { R as oe, h as re, u as ne, F as ie, P as ae } from "../../../Combination-17ab8af1.js";
|
|
7
7
|
import { useLayoutContainer as le } from "../../../contexts/LayoutContainerContext.js";
|
|
8
8
|
import { CloseIcon as ce } from "../../icons/CloseIcon.js";
|
|
9
9
|
import { dateFormatter as A } from "../../../utils/dateFormatter.js";
|
|
@@ -9,12 +9,12 @@ import { useLocalizationContext as x } from "../../../contexts/LocalizationConte
|
|
|
9
9
|
import { useIconToolContext as C } from "../../../contexts/IconToolContext.js";
|
|
10
10
|
import { useToolComponentContext as I } from "../../../contexts/ToolComponentContext.js";
|
|
11
11
|
import { MenuSeparator as T } from "./MenuSeparator.js";
|
|
12
|
-
import "../../../index-
|
|
12
|
+
import "../../../index-11f3cd64.js";
|
|
13
13
|
import "react";
|
|
14
14
|
import "../../../index-113053cf.js";
|
|
15
15
|
import "react-dom";
|
|
16
16
|
import "../../../index-23911b43.js";
|
|
17
|
-
import "../../../Combination-
|
|
17
|
+
import "../../../Combination-17ab8af1.js";
|
|
18
18
|
import "../../../index-d0f0aa9a.js";
|
|
19
19
|
import "../../../index-ada501c4.js";
|
|
20
20
|
import "../../../clsx-0c6e471a.js";
|
|
@@ -26,11 +26,11 @@ import "../../../utils/hooks/usePdfProperties.js";
|
|
|
26
26
|
import "../../../utils/convertPdfDate.js";
|
|
27
27
|
import "../../../utils/formatFileSize.js";
|
|
28
28
|
import "../../../contexts/DownloadContext.js";
|
|
29
|
-
import "../../../index-
|
|
29
|
+
import "../../../index-11f3cd64.js";
|
|
30
30
|
import "../../../index-113053cf.js";
|
|
31
31
|
import "react-dom";
|
|
32
32
|
import "../../../index-23911b43.js";
|
|
33
|
-
import "../../../Combination-
|
|
33
|
+
import "../../../Combination-17ab8af1.js";
|
|
34
34
|
import "../../../index-d0f0aa9a.js";
|
|
35
35
|
import "../../../index-ada501c4.js";
|
|
36
36
|
import "../../../contexts/LayoutContainerContext.js";
|