@arbidocs/react 0.5.109 → 0.5.111
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/PdfViewerImpl-QUSDLNNM.cjs +380 -0
- package/dist/PdfViewerImpl-QUSDLNNM.cjs.map +1 -0
- package/dist/PdfViewerImpl-TEBYF2QI.js +378 -0
- package/dist/PdfViewerImpl-TEBYF2QI.js.map +1 -0
- package/dist/{PdfViewer.d-bQH9yxFg.d.cts → PdfViewerImpl.d-B28hLEuj.d.cts} +8 -1
- package/dist/{PdfViewer.d-bQH9yxFg.d.ts → PdfViewerImpl.d-B28hLEuj.d.ts} +8 -1
- package/dist/annotations/freeze/index.d.cts +1 -1
- package/dist/annotations/freeze/index.d.ts +1 -1
- package/dist/artifacts/index.cjs +13 -13
- package/dist/artifacts/index.js +3 -3
- package/dist/calls/livekit/index.cjs +48 -48
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-W2FATOTX.cjs → chunk-3JAEX57E.cjs} +4 -4
- package/dist/{chunk-W2FATOTX.cjs.map → chunk-3JAEX57E.cjs.map} +1 -1
- package/dist/{chunk-H5M7FXLB.js → chunk-4FL3X3LA.js} +3 -3
- package/dist/{chunk-H5M7FXLB.js.map → chunk-4FL3X3LA.js.map} +1 -1
- package/dist/{chunk-HD5H2PPP.cjs → chunk-5TRUFWKT.cjs} +66 -66
- package/dist/{chunk-HD5H2PPP.cjs.map → chunk-5TRUFWKT.cjs.map} +1 -1
- package/dist/chunk-6QNBSXCE.js +271 -0
- package/dist/chunk-6QNBSXCE.js.map +1 -0
- package/dist/{chunk-QF2BW6HZ.cjs → chunk-DI5KSVKY.cjs} +38 -38
- package/dist/{chunk-QF2BW6HZ.cjs.map → chunk-DI5KSVKY.cjs.map} +1 -1
- package/dist/{chunk-DQALOQPI.js → chunk-DZKRL5H3.js} +4 -4
- package/dist/{chunk-DQALOQPI.js.map → chunk-DZKRL5H3.js.map} +1 -1
- package/dist/{chunk-RVUGSM65.cjs → chunk-GKGAPU6T.cjs} +44 -44
- package/dist/{chunk-RVUGSM65.cjs.map → chunk-GKGAPU6T.cjs.map} +1 -1
- package/dist/chunk-L2IPPTVC.js +20 -0
- package/dist/chunk-L2IPPTVC.js.map +1 -0
- package/dist/{chunk-FZJMA32S.js → chunk-LSU4UPS5.js} +4 -4
- package/dist/{chunk-FZJMA32S.js.map → chunk-LSU4UPS5.js.map} +1 -1
- package/dist/{chunk-7LIMHY56.cjs → chunk-O32T7XRD.cjs} +3 -3
- package/dist/{chunk-7LIMHY56.cjs.map → chunk-O32T7XRD.cjs.map} +1 -1
- package/dist/chunk-PWGSIM3F.cjs +291 -0
- package/dist/chunk-PWGSIM3F.cjs.map +1 -0
- package/dist/{chunk-CPQ3CU4B.js → chunk-QMY2JKBI.js} +3 -3
- package/dist/{chunk-CPQ3CU4B.js.map → chunk-QMY2JKBI.js.map} +1 -1
- package/dist/chunk-QP3WQSAA.cjs +23 -0
- package/dist/chunk-QP3WQSAA.cjs.map +1 -0
- package/dist/chunk-SSXFVWCT.js +46 -0
- package/dist/chunk-SSXFVWCT.js.map +1 -0
- package/dist/chunk-T5FZICXN.cjs +50 -0
- package/dist/chunk-T5FZICXN.cjs.map +1 -0
- package/dist/{chunk-P6WLV5UY.js → chunk-XWPLOFDN.js} +3 -3
- package/dist/{chunk-P6WLV5UY.js.map → chunk-XWPLOFDN.js.map} +1 -1
- package/dist/{chunk-5HDKL6XB.cjs → chunk-YMB6XUR2.cjs} +57 -57
- package/dist/{chunk-5HDKL6XB.cjs.map → chunk-YMB6XUR2.cjs.map} +1 -1
- package/dist/{chunk-6H3O63TQ.js → chunk-ZM6N7YZH.js} +3 -3
- package/dist/{chunk-6H3O63TQ.js.map → chunk-ZM6N7YZH.js.map} +1 -1
- package/dist/document-tools/core.cjs +98 -98
- package/dist/document-tools/core.d.cts +2 -2
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/core.js +3 -3
- package/dist/document-tools/index.cjs +100 -100
- package/dist/document-tools/index.d.cts +1 -1
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +4 -4
- package/dist/index.cjs +1426 -1341
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-BMhTH98a.d.ts → index.d-CYXcTKYt.d.ts} +1 -0
- package/dist/{index.d-BMhTH98a.d.cts → index.d-LArLnpI8.d.cts} +1 -0
- package/dist/index.d.cts +39 -8
- package/dist/index.d.ts +39 -8
- package/dist/index.js +104 -33
- package/dist/index.js.map +1 -1
- package/dist/lazy-chunk.d-B6YDLMKI.d.cts +31 -0
- package/dist/lazy-chunk.d-B6YDLMKI.d.ts +31 -0
- package/dist/{query-keys.d-ChgpJLPF.d.cts → query-keys.d-B1Am9tIF.d.cts} +1 -1
- package/dist/{query-keys.d-ChgpJLPF.d.ts → query-keys.d-B1Am9tIF.d.ts} +1 -1
- package/dist/ui/index.cjs +13 -0
- package/dist/ui/index.d.cts +2 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -0
- package/dist/viewers/PdfViewer.cjs +17 -0
- package/dist/viewers/PdfViewer.cjs.map +1 -0
- package/dist/viewers/PdfViewer.d.cts +9 -0
- package/dist/viewers/PdfViewer.d.ts +9 -0
- package/dist/viewers/PdfViewer.js +4 -0
- package/dist/viewers/PdfViewer.js.map +1 -0
- package/dist/viewers/index.cjs +79 -653
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +3 -1
- package/dist/viewers/index.d.ts +3 -1
- package/dist/viewers/index.js +6 -639
- package/dist/viewers/index.js.map +1 -1
- package/package.json +11 -3
package/dist/viewers/index.cjs
CHANGED
|
@@ -1,645 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkQP3WQSAA_cjs = require('../chunk-QP3WQSAA.cjs');
|
|
4
|
+
var chunkPWGSIM3F_cjs = require('../chunk-PWGSIM3F.cjs');
|
|
3
5
|
var chunkIU2CJNTB_cjs = require('../chunk-IU2CJNTB.cjs');
|
|
4
6
|
var chunkTMPDW7J5_cjs = require('../chunk-TMPDW7J5.cjs');
|
|
7
|
+
require('../chunk-T5FZICXN.cjs');
|
|
5
8
|
var react = require('react');
|
|
6
|
-
var reactPdf = require('react-pdf');
|
|
7
|
-
require('react-pdf/dist/Page/AnnotationLayer.css');
|
|
8
|
-
require('react-pdf/dist/Page/TextLayer.css');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
11
|
-
var PAGE_SELECTOR = '[role="article"][data-page-number]';
|
|
12
|
-
function anchorDelta(previousHeight, nextHeight, pageTop, containerTop) {
|
|
13
|
-
const delta = nextHeight - previousHeight;
|
|
14
|
-
if (delta === 0) return 0;
|
|
15
|
-
return pageTop + previousHeight <= containerTop + 1 ? delta : 0;
|
|
16
|
-
}
|
|
17
|
-
function measureVisiblePages(pages, viewTop, viewBottom) {
|
|
18
|
-
const visibility = /* @__PURE__ */ new Map();
|
|
19
|
-
let page = null;
|
|
20
|
-
let bestPx = 0;
|
|
21
|
-
let score = 0;
|
|
22
|
-
const viewHeight = viewBottom - viewTop;
|
|
23
|
-
for (const p of pages) {
|
|
24
|
-
const height = p.bottom - p.top;
|
|
25
|
-
const px = Math.min(p.bottom, viewBottom) - Math.max(p.top, viewTop);
|
|
26
|
-
if (px <= 0 || height <= 0) continue;
|
|
27
|
-
visibility.set(p.n, px / height);
|
|
28
|
-
if (px > bestPx) {
|
|
29
|
-
bestPx = px;
|
|
30
|
-
page = p.n;
|
|
31
|
-
score = px / Math.min(height, viewHeight);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return { page, score, visibility };
|
|
35
|
-
}
|
|
36
|
-
function useScrollAnchor(containerRef, key) {
|
|
37
|
-
react.useEffect(() => {
|
|
38
|
-
const container = containerRef.current;
|
|
39
|
-
if (!container || typeof ResizeObserver === "undefined") return;
|
|
40
|
-
container.style.overflowAnchor = "none";
|
|
41
|
-
const heights = /* @__PURE__ */ new Map();
|
|
42
|
-
const observer = new ResizeObserver((entries) => {
|
|
43
|
-
let shift = 0;
|
|
44
|
-
const containerTop = container.getBoundingClientRect().top;
|
|
45
|
-
for (const entry of entries) {
|
|
46
|
-
const el = entry.target;
|
|
47
|
-
const height = el.getBoundingClientRect().height;
|
|
48
|
-
const previous = heights.get(el);
|
|
49
|
-
heights.set(el, height);
|
|
50
|
-
if (previous === void 0) continue;
|
|
51
|
-
shift += anchorDelta(previous, height, el.getBoundingClientRect().top, containerTop);
|
|
52
|
-
}
|
|
53
|
-
if (shift !== 0 && !container.dataset.zooming) container.scrollTop += shift;
|
|
54
|
-
});
|
|
55
|
-
container.querySelectorAll(PAGE_SELECTOR).forEach((el) => {
|
|
56
|
-
heights.set(el, el.getBoundingClientRect().height);
|
|
57
|
-
observer.observe(el);
|
|
58
|
-
});
|
|
59
|
-
return () => observer.disconnect();
|
|
60
|
-
}, [containerRef, key]);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// src/viewers/usePageIntersectionObserver.ts
|
|
64
|
-
var PAGE_UPDATE_DEBOUNCE_MS = 10;
|
|
65
|
-
var MIN_VISIBILITY_THRESHOLD = 0.15;
|
|
66
|
-
var INTERSECTION_THRESHOLDS = [0, 0.25, 0.5, 0.75, 1];
|
|
67
|
-
function usePageIntersectionObserver({
|
|
68
|
-
containerRef,
|
|
69
|
-
scrollCompleteRef,
|
|
70
|
-
isEnabled,
|
|
71
|
-
getPageElements,
|
|
72
|
-
getPageNumber,
|
|
73
|
-
onPageChange,
|
|
74
|
-
onVisibilityUpdate,
|
|
75
|
-
observeKey
|
|
76
|
-
}) {
|
|
77
|
-
const latest = react.useRef({ getPageElements, getPageNumber, onPageChange, onVisibilityUpdate });
|
|
78
|
-
latest.current = { getPageElements, getPageNumber, onPageChange, onVisibilityUpdate };
|
|
79
|
-
react.useEffect(() => {
|
|
80
|
-
if (!isEnabled || !containerRef.current) return;
|
|
81
|
-
const container = containerRef.current;
|
|
82
|
-
let lastReportedPage = null;
|
|
83
|
-
let updateTimeout = null;
|
|
84
|
-
let frame = 0;
|
|
85
|
-
const evaluate = () => {
|
|
86
|
-
const root = container.getBoundingClientRect();
|
|
87
|
-
const pages = [];
|
|
88
|
-
for (const el of latest.current.getPageElements()) {
|
|
89
|
-
const n = latest.current.getPageNumber(el);
|
|
90
|
-
if (n <= 0) continue;
|
|
91
|
-
const r = el.getBoundingClientRect();
|
|
92
|
-
pages.push({ n, top: r.top, bottom: r.bottom });
|
|
93
|
-
}
|
|
94
|
-
const { page, score, visibility } = measureVisiblePages(pages, root.top, root.bottom);
|
|
95
|
-
if (scrollCompleteRef.current && page !== null && page !== lastReportedPage && score > MIN_VISIBILITY_THRESHOLD) {
|
|
96
|
-
lastReportedPage = page;
|
|
97
|
-
latest.current.onPageChange(page);
|
|
98
|
-
}
|
|
99
|
-
latest.current.onVisibilityUpdate?.(visibility);
|
|
100
|
-
};
|
|
101
|
-
const observer = new IntersectionObserver(
|
|
102
|
-
() => {
|
|
103
|
-
if (updateTimeout) clearTimeout(updateTimeout);
|
|
104
|
-
updateTimeout = setTimeout(evaluate, PAGE_UPDATE_DEBOUNCE_MS);
|
|
105
|
-
},
|
|
106
|
-
{ root: container, threshold: INTERSECTION_THRESHOLDS }
|
|
107
|
-
);
|
|
108
|
-
const onScroll = () => {
|
|
109
|
-
if (!frame) {
|
|
110
|
-
frame = requestAnimationFrame(() => {
|
|
111
|
-
frame = 0;
|
|
112
|
-
evaluate();
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
container.addEventListener("scroll", onScroll, { passive: true });
|
|
117
|
-
latest.current.getPageElements().forEach((element) => observer.observe(element));
|
|
118
|
-
return () => {
|
|
119
|
-
observer.disconnect();
|
|
120
|
-
container.removeEventListener("scroll", onScroll);
|
|
121
|
-
if (updateTimeout) clearTimeout(updateTimeout);
|
|
122
|
-
if (frame) cancelAnimationFrame(frame);
|
|
123
|
-
};
|
|
124
|
-
}, [containerRef, scrollCompleteRef, isEnabled, observeKey]);
|
|
125
|
-
}
|
|
126
|
-
var MIN_ZOOM = 0.5;
|
|
127
|
-
var MAX_ZOOM = 4;
|
|
128
|
-
var DOUBLE_TAP_ZOOM = 2;
|
|
129
|
-
var MAX_CANVAS_PIXELS = 8e6;
|
|
130
|
-
var MAX_RENDER_DPR = 2;
|
|
131
|
-
function clampZoom(zoom) {
|
|
132
|
-
if (!Number.isFinite(zoom)) return 1;
|
|
133
|
-
return Math.round(Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, zoom)) * 100) / 100;
|
|
134
|
-
}
|
|
135
|
-
var ZOOM_PRESETS = [1.5, 2, 3];
|
|
136
|
-
function cycleZoom(zoom) {
|
|
137
|
-
return ZOOM_PRESETS.find((preset) => preset > zoom + 0.05) ?? 1;
|
|
138
|
-
}
|
|
139
|
-
function doubleTapZoom(zoom) {
|
|
140
|
-
return zoom > 1.05 ? 1 : DOUBLE_TAP_ZOOM;
|
|
141
|
-
}
|
|
142
|
-
function zoomLabel(zoom) {
|
|
143
|
-
return `${Math.round(zoom * 100)}%`;
|
|
144
|
-
}
|
|
145
|
-
function pinchZoom(startZoom, startDistance, distance2) {
|
|
146
|
-
if (startDistance <= 0) return startZoom;
|
|
147
|
-
return clampZoom(startZoom * distance2 / startDistance);
|
|
148
|
-
}
|
|
149
|
-
function anchoredScroll(scroll, focal, oldZoom, newZoom) {
|
|
150
|
-
if (oldZoom <= 0) return scroll;
|
|
151
|
-
return (scroll + focal) * newZoom / oldZoom - focal;
|
|
152
|
-
}
|
|
153
|
-
function renderDpr(cssWidth, cssHeight, devicePixelRatio, maxPixels = MAX_CANVAS_PIXELS) {
|
|
154
|
-
const wanted = Math.min(Math.max(devicePixelRatio || 1, 1), MAX_RENDER_DPR);
|
|
155
|
-
const area = cssWidth * cssHeight;
|
|
156
|
-
if (area <= 0) return wanted;
|
|
157
|
-
const fits = Math.sqrt(maxPixels / area);
|
|
158
|
-
return Math.max(1, Math.min(wanted, fits));
|
|
159
|
-
}
|
|
160
|
-
function fitPageWidth(contentWidth, pageBorder) {
|
|
161
|
-
if (!Number.isFinite(contentWidth)) return 0;
|
|
162
|
-
return Math.max(0, Math.floor(contentWidth) - pageBorder);
|
|
163
|
-
}
|
|
164
|
-
function contentBoxWidth(el) {
|
|
165
|
-
const style = getComputedStyle(el);
|
|
166
|
-
const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);
|
|
167
|
-
return Math.max(0, el.clientWidth - padding);
|
|
168
|
-
}
|
|
169
|
-
var distance = (a, b) => Math.hypot(a.clientX - b.clientX, a.clientY - b.clientY);
|
|
170
|
-
var INTERACTIVE = 'button, a, input, textarea, select, [role="button"]';
|
|
171
|
-
var DOUBLE_TAP_MS = 300;
|
|
172
|
-
var DOUBLE_TAP_SLOP_PX = 30;
|
|
173
|
-
function usePinchZoom({ containerRef, zoom, onZoomChange }) {
|
|
174
|
-
const zoomRef = react.useRef(zoom);
|
|
175
|
-
const onChangeRef = react.useRef(onZoomChange);
|
|
176
|
-
onChangeRef.current = onZoomChange;
|
|
177
|
-
const focalRef = react.useRef(null);
|
|
178
|
-
const appliedZoomRef = react.useRef(zoom);
|
|
179
|
-
const request = react.useCallback((next, focal) => {
|
|
180
|
-
const clamped = clampZoom(next);
|
|
181
|
-
if (clamped === zoomRef.current) return;
|
|
182
|
-
focalRef.current = focal;
|
|
183
|
-
zoomRef.current = clamped;
|
|
184
|
-
onChangeRef.current?.(clamped);
|
|
185
|
-
}, []);
|
|
186
|
-
react.useLayoutEffect(() => {
|
|
187
|
-
zoomRef.current = zoom;
|
|
188
|
-
const container = containerRef.current;
|
|
189
|
-
const previous = appliedZoomRef.current;
|
|
190
|
-
appliedZoomRef.current = zoom;
|
|
191
|
-
if (!container || previous === zoom) return;
|
|
192
|
-
const rect = container.getBoundingClientRect();
|
|
193
|
-
const focal = focalRef.current ?? { x: rect.width / 2, y: rect.height / 2 };
|
|
194
|
-
focalRef.current = null;
|
|
195
|
-
container.dataset.zooming = "true";
|
|
196
|
-
container.scrollLeft = anchoredScroll(container.scrollLeft, focal.x, previous, zoom);
|
|
197
|
-
container.scrollTop = anchoredScroll(container.scrollTop, focal.y, previous, zoom);
|
|
198
|
-
requestAnimationFrame(
|
|
199
|
-
() => requestAnimationFrame(() => {
|
|
200
|
-
delete container.dataset.zooming;
|
|
201
|
-
})
|
|
202
|
-
);
|
|
203
|
-
}, [zoom, containerRef]);
|
|
204
|
-
react.useEffect(() => {
|
|
205
|
-
const el = containerRef.current;
|
|
206
|
-
if (!el) return;
|
|
207
|
-
let pinch = null;
|
|
208
|
-
let lastTap = null;
|
|
209
|
-
let frame = 0;
|
|
210
|
-
let pending = null;
|
|
211
|
-
const focalOf = (a, b) => {
|
|
212
|
-
const rect = el.getBoundingClientRect();
|
|
213
|
-
return {
|
|
214
|
-
x: (a.clientX + b.clientX) / 2 - rect.left,
|
|
215
|
-
y: (a.clientY + b.clientY) / 2 - rect.top
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
const flush = () => {
|
|
219
|
-
frame = 0;
|
|
220
|
-
if (pending) request(pending.zoom, pending.focal);
|
|
221
|
-
pending = null;
|
|
222
|
-
};
|
|
223
|
-
const onStart = (e) => {
|
|
224
|
-
if (e.touches.length === 2) {
|
|
225
|
-
pinch = { startDistance: distance(e.touches[0], e.touches[1]), startZoom: zoomRef.current };
|
|
226
|
-
lastTap = null;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
const onMove = (e) => {
|
|
230
|
-
if (!pinch || e.touches.length !== 2) return;
|
|
231
|
-
e.preventDefault();
|
|
232
|
-
pending = {
|
|
233
|
-
zoom: pinchZoom(pinch.startZoom, pinch.startDistance, distance(e.touches[0], e.touches[1])),
|
|
234
|
-
focal: focalOf(e.touches[0], e.touches[1])
|
|
235
|
-
};
|
|
236
|
-
if (!frame) frame = requestAnimationFrame(flush);
|
|
237
|
-
};
|
|
238
|
-
const onEnd = (e) => {
|
|
239
|
-
if (pinch && e.touches.length < 2) {
|
|
240
|
-
pinch = null;
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
if (e.touches.length !== 0 || e.changedTouches.length !== 1) return;
|
|
244
|
-
const t = e.changedTouches[0];
|
|
245
|
-
if (e.target?.closest?.(INTERACTIVE)) return;
|
|
246
|
-
const now = e.timeStamp;
|
|
247
|
-
if (lastTap && now - lastTap.time < DOUBLE_TAP_MS && Math.hypot(t.clientX - lastTap.x, t.clientY - lastTap.y) < DOUBLE_TAP_SLOP_PX) {
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
const rect = el.getBoundingClientRect();
|
|
250
|
-
request(doubleTapZoom(zoomRef.current), {
|
|
251
|
-
x: t.clientX - rect.left,
|
|
252
|
-
y: t.clientY - rect.top
|
|
253
|
-
});
|
|
254
|
-
lastTap = null;
|
|
255
|
-
} else {
|
|
256
|
-
lastTap = { time: now, x: t.clientX, y: t.clientY };
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
el.addEventListener("touchstart", onStart, { passive: true });
|
|
260
|
-
el.addEventListener("touchmove", onMove, { passive: false });
|
|
261
|
-
el.addEventListener("touchend", onEnd, { passive: false });
|
|
262
|
-
el.addEventListener("touchcancel", onEnd, { passive: false });
|
|
263
|
-
return () => {
|
|
264
|
-
el.removeEventListener("touchstart", onStart);
|
|
265
|
-
el.removeEventListener("touchmove", onMove);
|
|
266
|
-
el.removeEventListener("touchend", onEnd);
|
|
267
|
-
el.removeEventListener("touchcancel", onEnd);
|
|
268
|
-
if (frame) cancelAnimationFrame(frame);
|
|
269
|
-
};
|
|
270
|
-
}, [containerRef, request]);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// src/viewers/pdf-viewer-constants.ts
|
|
274
|
-
var LAZY_LOAD_BUFFER_BEFORE = 2;
|
|
275
|
-
var LAZY_LOAD_BUFFER_AFTER = 5;
|
|
276
|
-
var INITIAL_LAZY_LOAD_BUFFER = { before: 0, after: 1 };
|
|
277
|
-
var DEFAULT_ASSETS = {
|
|
278
|
-
workerSrc: "/pdf.worker.min.mjs",
|
|
279
|
-
cMapUrl: "/cmaps/",
|
|
280
|
-
standardFontDataUrl: "/standard_fonts/",
|
|
281
|
-
wasmUrl: "/wasm/"
|
|
282
|
-
};
|
|
283
|
-
function ensurePdfWorker(workerSrc) {
|
|
284
|
-
chunkIU2CJNTB_cjs.installPdfjsPolyfills();
|
|
285
|
-
if (reactPdf.pdfjs.GlobalWorkerOptions.workerSrc !== workerSrc) {
|
|
286
|
-
reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
var DEFAULT_PAGE_ASPECT_RATIO = 1.414;
|
|
290
|
-
var PAGE_BORDER_PX = 2;
|
|
291
|
-
var RERENDER_DEBOUNCE_MS = 250;
|
|
292
|
-
var ZOOMED_BUFFER_THRESHOLD = 1.5;
|
|
293
|
-
function sameSet(a, b) {
|
|
294
|
-
if (a.size !== b.size) return false;
|
|
295
|
-
for (const v of a) if (!b.has(v)) return false;
|
|
296
|
-
return true;
|
|
297
|
-
}
|
|
298
|
-
var TEXT_LAYER_BUFFER = 1;
|
|
299
|
-
var ratioOf = (page) => {
|
|
300
|
-
const { width, height } = page.getViewport({ scale: 1 });
|
|
301
|
-
return width > 0 && height > 0 ? height / width : DEFAULT_PAGE_ASPECT_RATIO;
|
|
302
|
-
};
|
|
303
|
-
function PdfViewer({
|
|
304
|
-
file,
|
|
305
|
-
currentPage,
|
|
306
|
-
onLoadSuccess,
|
|
307
|
-
scrollTrigger,
|
|
308
|
-
zoom = 1,
|
|
309
|
-
onZoomChange,
|
|
310
|
-
onPageChange,
|
|
311
|
-
disableFontFace = false,
|
|
312
|
-
assets,
|
|
313
|
-
renderPageOverlay
|
|
314
|
-
}) {
|
|
315
|
-
const workerSrc = assets?.workerSrc ?? DEFAULT_ASSETS.workerSrc;
|
|
316
|
-
const cMapUrl = assets?.cMapUrl ?? DEFAULT_ASSETS.cMapUrl;
|
|
317
|
-
const standardFontDataUrl = assets?.standardFontDataUrl ?? DEFAULT_ASSETS.standardFontDataUrl;
|
|
318
|
-
const wasmUrl = assets?.wasmUrl ?? DEFAULT_ASSETS.wasmUrl;
|
|
319
|
-
ensurePdfWorker(workerSrc);
|
|
320
|
-
const [numPages, setNumPages] = react.useState(0);
|
|
321
|
-
const [containerWidth, setContainerWidth] = react.useState(0);
|
|
322
|
-
const [defaultRatio, setDefaultRatio] = react.useState(DEFAULT_PAGE_ASPECT_RATIO);
|
|
323
|
-
const [pageRatios, setPageRatios] = react.useState(/* @__PURE__ */ new Map());
|
|
324
|
-
const [pageWidthsPt, setPageWidthsPt] = react.useState(/* @__PURE__ */ new Map());
|
|
325
|
-
const [loadError, setLoadError] = react.useState(null);
|
|
326
|
-
const [documentKey, setDocumentKey] = react.useState(() => `pdf-${Date.now()}`);
|
|
327
|
-
const initialPage = currentPage || 1;
|
|
328
|
-
const [renderedPages, setRenderedPages] = react.useState(
|
|
329
|
-
/* @__PURE__ */ new Set([
|
|
330
|
-
Math.max(1, initialPage - INITIAL_LAZY_LOAD_BUFFER.before),
|
|
331
|
-
initialPage,
|
|
332
|
-
initialPage + INITIAL_LAZY_LOAD_BUFFER.after
|
|
333
|
-
])
|
|
334
|
-
);
|
|
335
|
-
const [visiblePages, setVisiblePages] = react.useState(/* @__PURE__ */ new Set([initialPage]));
|
|
336
|
-
const loadLifetime = react.useMemo(() => ({ file, active: true }), [file]);
|
|
337
|
-
react.useEffect(() => {
|
|
338
|
-
loadLifetime.active = true;
|
|
339
|
-
return () => {
|
|
340
|
-
loadLifetime.active = false;
|
|
341
|
-
};
|
|
342
|
-
}, [loadLifetime]);
|
|
343
|
-
react.useEffect(() => {
|
|
344
|
-
setDocumentKey(`pdf-${Date.now()}`);
|
|
345
|
-
setNumPages(0);
|
|
346
|
-
setLoadError(null);
|
|
347
|
-
}, [file]);
|
|
348
|
-
const containerRef = react.useRef(null);
|
|
349
|
-
const pageRefs = react.useRef(/* @__PURE__ */ new Map());
|
|
350
|
-
const onDocumentLoadSuccess = react.useCallback(
|
|
351
|
-
(pdf) => {
|
|
352
|
-
if (!loadLifetime.active) return;
|
|
353
|
-
const n = pdf.numPages;
|
|
354
|
-
void pdf.getPage?.(1).then((page) => {
|
|
355
|
-
if (loadLifetime.active) setDefaultRatio(ratioOf(page));
|
|
356
|
-
}).catch(() => {
|
|
357
|
-
});
|
|
358
|
-
setNumPages(n);
|
|
359
|
-
setLoadError(null);
|
|
360
|
-
try {
|
|
361
|
-
onLoadSuccess?.(n);
|
|
362
|
-
} catch (error) {
|
|
363
|
-
console.error("Error in onLoadSuccess callback:", error);
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
[onLoadSuccess, loadLifetime]
|
|
367
|
-
);
|
|
368
|
-
react.useEffect(() => {
|
|
369
|
-
if (numPages === 0) return;
|
|
370
|
-
let cancelled = false;
|
|
371
|
-
const expand = () => {
|
|
372
|
-
if (cancelled || !loadLifetime.active) return;
|
|
373
|
-
setRenderedPages((prev) => {
|
|
374
|
-
if (prev.size === 0) return prev;
|
|
375
|
-
const newSet = new Set(prev);
|
|
376
|
-
const anchor = currentPage || 1;
|
|
377
|
-
for (let i = Math.max(1, anchor - LAZY_LOAD_BUFFER_BEFORE); i <= Math.min(numPages, anchor + LAZY_LOAD_BUFFER_AFTER); i++) {
|
|
378
|
-
newSet.add(i);
|
|
379
|
-
}
|
|
380
|
-
return newSet;
|
|
381
|
-
});
|
|
382
|
-
};
|
|
383
|
-
if (typeof requestIdleCallback !== "undefined") {
|
|
384
|
-
const handle2 = requestIdleCallback(expand, { timeout: 500 });
|
|
385
|
-
return () => {
|
|
386
|
-
cancelled = true;
|
|
387
|
-
if (typeof cancelIdleCallback !== "undefined") cancelIdleCallback(handle2);
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
const handle = setTimeout(expand, 500);
|
|
391
|
-
return () => {
|
|
392
|
-
cancelled = true;
|
|
393
|
-
clearTimeout(handle);
|
|
394
|
-
};
|
|
395
|
-
}, [numPages, currentPage, loadLifetime]);
|
|
396
|
-
const onDocumentLoadError = react.useCallback((error) => {
|
|
397
|
-
console.error("PDF loading error:", error);
|
|
398
|
-
setLoadError(error);
|
|
399
|
-
setNumPages(0);
|
|
400
|
-
}, []);
|
|
401
|
-
const onPassword = react.useCallback((updatePassword, reason) => {
|
|
402
|
-
const message = reason === 2 ? "Incorrect password. Enter the password to unlock this PDF:" : "This PDF is password-protected. Enter the password to view it:";
|
|
403
|
-
const password = window.prompt(message);
|
|
404
|
-
if (password === null) {
|
|
405
|
-
setLoadError(new Error("Password required to open this PDF"));
|
|
406
|
-
setNumPages(0);
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
updatePassword(password);
|
|
410
|
-
}, []);
|
|
411
|
-
react.useEffect(() => {
|
|
412
|
-
const container = containerRef.current;
|
|
413
|
-
if (!container) return;
|
|
414
|
-
const setFromContentWidth = (contentWidth) => setContainerWidth(fitPageWidth(contentWidth, PAGE_BORDER_PX));
|
|
415
|
-
setFromContentWidth(contentBoxWidth(container));
|
|
416
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
417
|
-
const entry = entries[entries.length - 1];
|
|
418
|
-
const box = entry?.contentBoxSize?.[0];
|
|
419
|
-
setFromContentWidth(box ? box.inlineSize : entry?.contentRect.width ?? 0);
|
|
420
|
-
});
|
|
421
|
-
resizeObserver.observe(container);
|
|
422
|
-
return () => {
|
|
423
|
-
resizeObserver.disconnect();
|
|
424
|
-
};
|
|
425
|
-
}, []);
|
|
426
|
-
const scrollCompleteRef = react.useRef(false);
|
|
427
|
-
react.useEffect(() => {
|
|
428
|
-
if (numPages === 0) return;
|
|
429
|
-
if (scrollCompleteRef.current) return;
|
|
430
|
-
if (currentPage) {
|
|
431
|
-
setRenderedPages((prev) => {
|
|
432
|
-
const newSet = new Set(prev);
|
|
433
|
-
for (let i = Math.max(1, currentPage - LAZY_LOAD_BUFFER_BEFORE); i <= Math.min(numPages, currentPage + LAZY_LOAD_BUFFER_AFTER); i++) {
|
|
434
|
-
newSet.add(i);
|
|
435
|
-
}
|
|
436
|
-
return newSet;
|
|
437
|
-
});
|
|
438
|
-
requestAnimationFrame(() => {
|
|
439
|
-
const pageElement = pageRefs.current.get(currentPage);
|
|
440
|
-
if (pageElement) {
|
|
441
|
-
pageElement.scrollIntoView({ behavior: "auto", block: "start" });
|
|
442
|
-
}
|
|
443
|
-
setTimeout(() => {
|
|
444
|
-
scrollCompleteRef.current = true;
|
|
445
|
-
}, 100);
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
}, [numPages]);
|
|
449
|
-
const currentPageRef = react.useRef(currentPage);
|
|
450
|
-
currentPageRef.current = currentPage;
|
|
451
|
-
react.useEffect(() => {
|
|
452
|
-
const currentPage2 = currentPageRef.current;
|
|
453
|
-
if (!scrollTrigger || numPages === 0 || !currentPage2) return;
|
|
454
|
-
scrollCompleteRef.current = false;
|
|
455
|
-
setRenderedPages((prev) => {
|
|
456
|
-
const newSet = new Set(prev);
|
|
457
|
-
for (let i = Math.max(1, currentPage2 - LAZY_LOAD_BUFFER_BEFORE); i <= Math.min(numPages, currentPage2 + LAZY_LOAD_BUFFER_AFTER); i++) {
|
|
458
|
-
newSet.add(i);
|
|
459
|
-
}
|
|
460
|
-
return newSet;
|
|
461
|
-
});
|
|
462
|
-
requestAnimationFrame(() => {
|
|
463
|
-
requestAnimationFrame(() => {
|
|
464
|
-
const pageElement = pageRefs.current.get(currentPage2);
|
|
465
|
-
if (pageElement) {
|
|
466
|
-
pageElement.scrollIntoView({ behavior: "instant", block: "start" });
|
|
467
|
-
}
|
|
468
|
-
scrollCompleteRef.current = true;
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
}, [scrollTrigger, numPages]);
|
|
472
|
-
const handleVisibilityUpdate = react.useCallback(
|
|
473
|
-
(visibilityMap) => {
|
|
474
|
-
const visiblePageNums = Array.from(visibilityMap.entries()).filter(([, ratio]) => ratio > 0).map(([pageNum]) => pageNum);
|
|
475
|
-
if (visiblePageNums.length > 0) {
|
|
476
|
-
const minVisible = Math.min(...visiblePageNums);
|
|
477
|
-
const maxVisible = Math.max(...visiblePageNums);
|
|
478
|
-
const zoomed = zoom > ZOOMED_BUFFER_THRESHOLD;
|
|
479
|
-
const before = zoomed ? 1 : LAZY_LOAD_BUFFER_BEFORE;
|
|
480
|
-
const after = zoomed ? 2 : LAZY_LOAD_BUFFER_AFTER;
|
|
481
|
-
const pagesToRender = /* @__PURE__ */ new Set();
|
|
482
|
-
for (let i = Math.max(1, minVisible - before); i <= Math.min(numPages, maxVisible + after); i++) {
|
|
483
|
-
pagesToRender.add(i);
|
|
484
|
-
}
|
|
485
|
-
setRenderedPages((prev) => sameSet(prev, pagesToRender) ? prev : pagesToRender);
|
|
486
|
-
const nearViewport = /* @__PURE__ */ new Set();
|
|
487
|
-
for (let i = Math.max(1, minVisible - TEXT_LAYER_BUFFER); i <= Math.min(numPages, maxVisible + TEXT_LAYER_BUFFER); i++) {
|
|
488
|
-
nearViewport.add(i);
|
|
489
|
-
}
|
|
490
|
-
setVisiblePages((prev) => sameSet(prev, nearViewport) ? prev : nearViewport);
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
[numPages, zoom]
|
|
494
|
-
);
|
|
495
|
-
const documentOptions = react.useMemo(
|
|
496
|
-
() => ({
|
|
497
|
-
standardFontDataUrl,
|
|
498
|
-
cMapUrl,
|
|
499
|
-
cMapPacked: true,
|
|
500
|
-
wasmUrl,
|
|
501
|
-
...disableFontFace && { disableFontFace: true }
|
|
502
|
-
}),
|
|
503
|
-
[standardFontDataUrl, cMapUrl, wasmUrl, disableFontFace]
|
|
504
|
-
);
|
|
505
|
-
const handlePageChange = react.useCallback(
|
|
506
|
-
(pageNumber) => onPageChange?.(pageNumber),
|
|
507
|
-
[onPageChange]
|
|
508
|
-
);
|
|
509
|
-
usePageIntersectionObserver({
|
|
510
|
-
containerRef,
|
|
511
|
-
scrollCompleteRef,
|
|
512
|
-
isEnabled: numPages > 0,
|
|
513
|
-
getPageElements: () => Array.from(pageRefs.current.values()),
|
|
514
|
-
getPageNumber: (element) => parseInt(element.getAttribute("data-page-number") ?? "0"),
|
|
515
|
-
onPageChange: handlePageChange,
|
|
516
|
-
onVisibilityUpdate: handleVisibilityUpdate,
|
|
517
|
-
observeKey: `${numPages}:${containerWidth > 0}`
|
|
518
|
-
});
|
|
519
|
-
useScrollAnchor(containerRef, `${numPages}:${containerWidth > 0}`);
|
|
520
|
-
usePinchZoom({ containerRef, zoom, onZoomChange });
|
|
521
|
-
const [renderZoom, setRenderZoom] = react.useState(zoom);
|
|
522
|
-
react.useEffect(() => {
|
|
523
|
-
if (zoom === renderZoom) return;
|
|
524
|
-
const timer = setTimeout(() => setRenderZoom(zoom), RERENDER_DEBOUNCE_MS);
|
|
525
|
-
return () => clearTimeout(timer);
|
|
526
|
-
}, [zoom, renderZoom]);
|
|
527
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
528
|
-
"div",
|
|
529
|
-
{
|
|
530
|
-
ref: containerRef,
|
|
531
|
-
className: "w-full h-full overflow-auto bg-muted flex flex-col items-start p-4 pb-20",
|
|
532
|
-
style: { touchAction: "pan-x pan-y", scrollbarGutter: "stable" },
|
|
533
|
-
role: "region",
|
|
534
|
-
"aria-label": "PDF document viewer",
|
|
535
|
-
"data-testid": "pdf-viewer",
|
|
536
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
537
|
-
reactPdf.Document,
|
|
538
|
-
{
|
|
539
|
-
className: "flex w-max min-w-full flex-col",
|
|
540
|
-
suspense: false,
|
|
541
|
-
file,
|
|
542
|
-
onLoadSuccess: onDocumentLoadSuccess,
|
|
543
|
-
onLoadError: onDocumentLoadError,
|
|
544
|
-
onPassword,
|
|
545
|
-
options: documentOptions,
|
|
546
|
-
loading: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: "Loading PDF..." }) }),
|
|
547
|
-
error: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center h-full gap-4 p-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-destructive text-center", children: loadError?.message === "Cannot read properties of null (reading 'sendWithPromise')" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
548
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold mb-2", children: "PDF viewer initialization failed" }),
|
|
549
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Please refresh the page to retry" })
|
|
550
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
551
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold mb-2", children: "Failed to load PDF" }),
|
|
552
|
-
loadError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: loadError.message })
|
|
553
|
-
] }) }) }),
|
|
554
|
-
children: containerWidth > 0 && Array.from(new Array(numPages), (_, index) => {
|
|
555
|
-
const pageNumber = index + 1;
|
|
556
|
-
const shouldRender = renderedPages.has(pageNumber);
|
|
557
|
-
const ratio = pageRatios.get(pageNumber) ?? defaultRatio;
|
|
558
|
-
const pageWidth = containerWidth * zoom;
|
|
559
|
-
const pageHeight = pageWidth * ratio;
|
|
560
|
-
const renderWidth = containerWidth * renderZoom;
|
|
561
|
-
const scale = zoom / renderZoom;
|
|
562
|
-
const shouldRenderTextLayer = visiblePages.has(pageNumber);
|
|
563
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
564
|
-
"div",
|
|
565
|
-
{
|
|
566
|
-
ref: (el) => {
|
|
567
|
-
if (el) {
|
|
568
|
-
pageRefs.current.set(pageNumber, el);
|
|
569
|
-
} else {
|
|
570
|
-
pageRefs.current.delete(pageNumber);
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
|
-
"data-page-number": pageNumber,
|
|
574
|
-
className: "relative mx-auto mb-6 shrink-0 shadow-xl bg-white border border-border",
|
|
575
|
-
style: { width: pageWidth + PAGE_BORDER_PX, height: pageHeight + PAGE_BORDER_PX },
|
|
576
|
-
role: "article",
|
|
577
|
-
"aria-label": `Page ${pageNumber} of ${numPages}`,
|
|
578
|
-
children: [
|
|
579
|
-
shouldRender ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
|
-
"div",
|
|
581
|
-
{
|
|
582
|
-
"data-testid": `pdf-page-scaler-${pageNumber}`,
|
|
583
|
-
style: scale === 1 ? void 0 : { transform: `scale(${scale})`, transformOrigin: "0 0" },
|
|
584
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
585
|
-
reactPdf.Page,
|
|
586
|
-
{
|
|
587
|
-
pageNumber,
|
|
588
|
-
width: renderWidth,
|
|
589
|
-
renderTextLayer: shouldRenderTextLayer,
|
|
590
|
-
renderAnnotationLayer: false,
|
|
591
|
-
onLoadSuccess: (page) => {
|
|
592
|
-
setPageWidthsPt(
|
|
593
|
-
(prev) => prev.get(pageNumber) === page.originalWidth ? prev : new Map(prev).set(pageNumber, page.originalWidth)
|
|
594
|
-
);
|
|
595
|
-
const ratio2 = page.originalHeight / page.originalWidth;
|
|
596
|
-
setPageRatios(
|
|
597
|
-
(prev) => Math.abs((prev.get(pageNumber) ?? defaultRatio) - ratio2) < 1e-3 ? prev : new Map(prev).set(pageNumber, ratio2)
|
|
598
|
-
);
|
|
599
|
-
},
|
|
600
|
-
devicePixelRatio: renderDpr(
|
|
601
|
-
renderWidth,
|
|
602
|
-
renderWidth * ratio,
|
|
603
|
-
window.devicePixelRatio || 1
|
|
604
|
-
),
|
|
605
|
-
loading: /* @__PURE__ */ jsxRuntime.jsx(
|
|
606
|
-
"div",
|
|
607
|
-
{
|
|
608
|
-
className: "flex items-center justify-center bg-muted",
|
|
609
|
-
style: { width: renderWidth, height: renderWidth * ratio },
|
|
610
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-muted-foreground", children: [
|
|
611
|
-
"Loading page ",
|
|
612
|
-
pageNumber,
|
|
613
|
-
"..."
|
|
614
|
-
] })
|
|
615
|
-
}
|
|
616
|
-
)
|
|
617
|
-
}
|
|
618
|
-
)
|
|
619
|
-
}
|
|
620
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
621
|
-
"div",
|
|
622
|
-
{
|
|
623
|
-
className: "flex items-center justify-center bg-muted",
|
|
624
|
-
style: { width: pageWidth, height: pageHeight },
|
|
625
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-muted-foreground", children: [
|
|
626
|
-
"Page ",
|
|
627
|
-
pageNumber
|
|
628
|
-
] })
|
|
629
|
-
}
|
|
630
|
-
),
|
|
631
|
-
renderPageOverlay?.({ pageNumber, pageWidthPt: pageWidthsPt.get(pageNumber) })
|
|
632
|
-
]
|
|
633
|
-
},
|
|
634
|
-
`page_${pageNumber}`
|
|
635
|
-
);
|
|
636
|
-
})
|
|
637
|
-
},
|
|
638
|
-
documentKey
|
|
639
|
-
)
|
|
640
|
-
}
|
|
641
|
-
);
|
|
642
|
-
}
|
|
643
11
|
function measureContentWidth(container) {
|
|
644
12
|
let pageWidth = 0;
|
|
645
13
|
container.querySelectorAll("section.docx").forEach((section) => {
|
|
@@ -901,6 +269,82 @@ function computeSelectionRuns(pages, selectedChunks) {
|
|
|
901
269
|
return runs;
|
|
902
270
|
}
|
|
903
271
|
|
|
272
|
+
Object.defineProperty(exports, "PdfViewer", {
|
|
273
|
+
enumerable: true,
|
|
274
|
+
get: function () { return chunkQP3WQSAA_cjs.PdfViewer; }
|
|
275
|
+
});
|
|
276
|
+
Object.defineProperty(exports, "pdfViewerChunk", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function () { return chunkQP3WQSAA_cjs.pdfViewerChunk; }
|
|
279
|
+
});
|
|
280
|
+
Object.defineProperty(exports, "INITIAL_LAZY_LOAD_BUFFER", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
get: function () { return chunkPWGSIM3F_cjs.INITIAL_LAZY_LOAD_BUFFER; }
|
|
283
|
+
});
|
|
284
|
+
Object.defineProperty(exports, "LAZY_LOAD_BUFFER_AFTER", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
get: function () { return chunkPWGSIM3F_cjs.LAZY_LOAD_BUFFER_AFTER; }
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, "LAZY_LOAD_BUFFER_BEFORE", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () { return chunkPWGSIM3F_cjs.LAZY_LOAD_BUFFER_BEFORE; }
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(exports, "MAX_ZOOM", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
get: function () { return chunkPWGSIM3F_cjs.MAX_ZOOM; }
|
|
295
|
+
});
|
|
296
|
+
Object.defineProperty(exports, "MIN_ZOOM", {
|
|
297
|
+
enumerable: true,
|
|
298
|
+
get: function () { return chunkPWGSIM3F_cjs.MIN_ZOOM; }
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, "PAGE_SELECTOR", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function () { return chunkPWGSIM3F_cjs.PAGE_SELECTOR; }
|
|
303
|
+
});
|
|
304
|
+
Object.defineProperty(exports, "anchorDelta", {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function () { return chunkPWGSIM3F_cjs.anchorDelta; }
|
|
307
|
+
});
|
|
308
|
+
Object.defineProperty(exports, "anchoredScroll", {
|
|
309
|
+
enumerable: true,
|
|
310
|
+
get: function () { return chunkPWGSIM3F_cjs.anchoredScroll; }
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "clampZoom", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function () { return chunkPWGSIM3F_cjs.clampZoom; }
|
|
315
|
+
});
|
|
316
|
+
Object.defineProperty(exports, "cycleZoom", {
|
|
317
|
+
enumerable: true,
|
|
318
|
+
get: function () { return chunkPWGSIM3F_cjs.cycleZoom; }
|
|
319
|
+
});
|
|
320
|
+
Object.defineProperty(exports, "doubleTapZoom", {
|
|
321
|
+
enumerable: true,
|
|
322
|
+
get: function () { return chunkPWGSIM3F_cjs.doubleTapZoom; }
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(exports, "pinchZoom", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function () { return chunkPWGSIM3F_cjs.pinchZoom; }
|
|
327
|
+
});
|
|
328
|
+
Object.defineProperty(exports, "renderDpr", {
|
|
329
|
+
enumerable: true,
|
|
330
|
+
get: function () { return chunkPWGSIM3F_cjs.renderDpr; }
|
|
331
|
+
});
|
|
332
|
+
Object.defineProperty(exports, "usePageIntersectionObserver", {
|
|
333
|
+
enumerable: true,
|
|
334
|
+
get: function () { return chunkPWGSIM3F_cjs.usePageIntersectionObserver; }
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(exports, "usePinchZoom", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function () { return chunkPWGSIM3F_cjs.usePinchZoom; }
|
|
339
|
+
});
|
|
340
|
+
Object.defineProperty(exports, "useScrollAnchor", {
|
|
341
|
+
enumerable: true,
|
|
342
|
+
get: function () { return chunkPWGSIM3F_cjs.useScrollAnchor; }
|
|
343
|
+
});
|
|
344
|
+
Object.defineProperty(exports, "zoomLabel", {
|
|
345
|
+
enumerable: true,
|
|
346
|
+
get: function () { return chunkPWGSIM3F_cjs.zoomLabel; }
|
|
347
|
+
});
|
|
904
348
|
Object.defineProperty(exports, "installPdfjsPolyfills", {
|
|
905
349
|
enumerable: true,
|
|
906
350
|
get: function () { return chunkIU2CJNTB_cjs.installPdfjsPolyfills; }
|
|
@@ -918,26 +362,8 @@ Object.defineProperty(exports, "VideoViewer", {
|
|
|
918
362
|
get: function () { return chunkTMPDW7J5_cjs.VideoViewer; }
|
|
919
363
|
});
|
|
920
364
|
exports.DocxViewer = DocxViewer;
|
|
921
|
-
exports.INITIAL_LAZY_LOAD_BUFFER = INITIAL_LAZY_LOAD_BUFFER;
|
|
922
|
-
exports.LAZY_LOAD_BUFFER_AFTER = LAZY_LOAD_BUFFER_AFTER;
|
|
923
|
-
exports.LAZY_LOAD_BUFFER_BEFORE = LAZY_LOAD_BUFFER_BEFORE;
|
|
924
|
-
exports.MAX_ZOOM = MAX_ZOOM;
|
|
925
|
-
exports.MIN_ZOOM = MIN_ZOOM;
|
|
926
|
-
exports.PAGE_SELECTOR = PAGE_SELECTOR;
|
|
927
|
-
exports.PdfViewer = PdfViewer;
|
|
928
365
|
exports.XlsxViewer = XlsxViewer;
|
|
929
|
-
exports.anchorDelta = anchorDelta;
|
|
930
|
-
exports.anchoredScroll = anchoredScroll;
|
|
931
|
-
exports.clampZoom = clampZoom;
|
|
932
366
|
exports.computeSelectionRuns = computeSelectionRuns;
|
|
933
|
-
exports.cycleZoom = cycleZoom;
|
|
934
|
-
exports.doubleTapZoom = doubleTapZoom;
|
|
935
|
-
exports.pinchZoom = pinchZoom;
|
|
936
|
-
exports.renderDpr = renderDpr;
|
|
937
|
-
exports.usePageIntersectionObserver = usePageIntersectionObserver;
|
|
938
|
-
exports.usePinchZoom = usePinchZoom;
|
|
939
367
|
exports.useProcessedChunks = useProcessedChunks;
|
|
940
|
-
exports.useScrollAnchor = useScrollAnchor;
|
|
941
|
-
exports.zoomLabel = zoomLabel;
|
|
942
368
|
//# sourceMappingURL=index.cjs.map
|
|
943
369
|
//# sourceMappingURL=index.cjs.map
|