@cannyminds/dms-file-viewers 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-26SS5FLZ.js → chunk-BYCREULH.js} +381 -359
- package/dist/chunk-BYCREULH.js.map +1 -0
- package/dist/{chunk-IY5EEUCU.mjs → chunk-UFPC67AQ.mjs} +298 -276
- package/dist/chunk-UFPC67AQ.mjs.map +1 -0
- package/dist/components/viewers/AudioViewer.d.mts +1 -1
- package/dist/components/viewers/AudioViewer.d.ts +1 -1
- package/dist/components/viewers/DefaultViewer.d.mts +1 -1
- package/dist/components/viewers/DefaultViewer.d.ts +1 -1
- package/dist/components/viewers/ImageViewer.d.mts +1 -1
- package/dist/components/viewers/ImageViewer.d.ts +1 -1
- package/dist/components/viewers/PDFViewer.d.mts +5 -2
- package/dist/components/viewers/PDFViewer.d.ts +5 -2
- package/dist/components/viewers/PDFViewer.js +2 -2
- package/dist/components/viewers/PDFViewer.mjs +1 -1
- package/dist/components/viewers/TIFFViewer.d.mts +1 -1
- package/dist/components/viewers/TIFFViewer.d.ts +1 -1
- package/dist/components/viewers/TextViewer.d.mts +1 -1
- package/dist/components/viewers/TextViewer.d.ts +1 -1
- package/dist/components/viewers/VideoViewer.d.mts +1 -1
- package/dist/components/viewers/VideoViewer.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -23
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DFkMK86Q.d.mts → types-BnnKCdrQ.d.mts} +2 -0
- package/dist/{types-DFkMK86Q.d.ts → types-BnnKCdrQ.d.ts} +2 -0
- package/package.json +1 -1
- package/dist/chunk-26SS5FLZ.js.map +0 -1
- package/dist/chunk-IY5EEUCU.mjs.map +0 -1
|
@@ -38,7 +38,8 @@ var StablePDFViewer = _react2.default.memo(({
|
|
|
38
38
|
onHighlighterClick,
|
|
39
39
|
onStampClick,
|
|
40
40
|
onSignatureClick,
|
|
41
|
-
permissions
|
|
41
|
+
permissions,
|
|
42
|
+
hideInternalLoading
|
|
42
43
|
}) => {
|
|
43
44
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
44
45
|
HeadlessPDFViewer,
|
|
@@ -54,7 +55,8 @@ var StablePDFViewer = _react2.default.memo(({
|
|
|
54
55
|
onHighlighterClick,
|
|
55
56
|
onStampClick,
|
|
56
57
|
onSignatureClick,
|
|
57
|
-
permissions
|
|
58
|
+
permissions,
|
|
59
|
+
hideInternalLoading
|
|
58
60
|
}
|
|
59
61
|
);
|
|
60
62
|
});
|
|
@@ -118,6 +120,7 @@ var PDFToolbar = _react2.default.memo(
|
|
|
118
120
|
disabledHistory,
|
|
119
121
|
disabledDownload,
|
|
120
122
|
disabledPrint,
|
|
123
|
+
disabledCopy,
|
|
121
124
|
disabledHighlighter,
|
|
122
125
|
disabledStamp,
|
|
123
126
|
disabledSignature,
|
|
@@ -136,9 +139,12 @@ var PDFToolbar = _react2.default.memo(
|
|
|
136
139
|
onRotateLeft,
|
|
137
140
|
onRotateRight,
|
|
138
141
|
onDownloadClick,
|
|
142
|
+
onDownloadWithAnnotations,
|
|
143
|
+
onDownloadWithoutAnnotations,
|
|
139
144
|
onPrintClick,
|
|
140
145
|
onPrintWithAnnotations,
|
|
141
146
|
onPrintWithoutAnnotations,
|
|
147
|
+
onCopyClick,
|
|
142
148
|
onMetadataClick,
|
|
143
149
|
onPropertiesClick,
|
|
144
150
|
onTagsClick,
|
|
@@ -153,9 +159,11 @@ var PDFToolbar = _react2.default.memo(
|
|
|
153
159
|
onSaveAnnotations
|
|
154
160
|
}) => {
|
|
155
161
|
const [isPrintMenuOpen, setIsPrintMenuOpen] = _react.useState.call(void 0, false);
|
|
162
|
+
const [isDownloadMenuOpen, setIsDownloadMenuOpen] = _react.useState.call(void 0, false);
|
|
156
163
|
const [isAnnotationMenuOpen, setIsAnnotationMenuOpen] = _react.useState.call(void 0, false);
|
|
157
164
|
const [isViewMenuOpen, setIsViewMenuOpen] = _react.useState.call(void 0, false);
|
|
158
165
|
const printMenuRef = _react.useRef.call(void 0, null);
|
|
166
|
+
const downloadMenuRef = _react.useRef.call(void 0, null);
|
|
159
167
|
const annotationMenuRef = _react.useRef.call(void 0, null);
|
|
160
168
|
const viewMenuRef = _react.useRef.call(void 0, null);
|
|
161
169
|
_react.useEffect.call(void 0, () => {
|
|
@@ -163,6 +171,9 @@ var PDFToolbar = _react2.default.memo(
|
|
|
163
171
|
if (printMenuRef.current && !printMenuRef.current.contains(event.target)) {
|
|
164
172
|
setIsPrintMenuOpen(false);
|
|
165
173
|
}
|
|
174
|
+
if (downloadMenuRef.current && !downloadMenuRef.current.contains(event.target)) {
|
|
175
|
+
setIsDownloadMenuOpen(false);
|
|
176
|
+
}
|
|
166
177
|
if (annotationMenuRef.current && !annotationMenuRef.current.contains(event.target)) {
|
|
167
178
|
setIsAnnotationMenuOpen(false);
|
|
168
179
|
}
|
|
@@ -181,12 +192,20 @@ var PDFToolbar = _react2.default.memo(
|
|
|
181
192
|
setIsPrintMenuOpen(false);
|
|
182
193
|
_optionalChain([onPrintWithoutAnnotations, 'optionalCall', _2 => _2()]);
|
|
183
194
|
};
|
|
195
|
+
const handleDownloadWithAnnotations = () => {
|
|
196
|
+
setIsDownloadMenuOpen(false);
|
|
197
|
+
_optionalChain([onDownloadWithAnnotations, 'optionalCall', _3 => _3()]);
|
|
198
|
+
};
|
|
199
|
+
const handleDownloadWithoutAnnotations = () => {
|
|
200
|
+
setIsDownloadMenuOpen(false);
|
|
201
|
+
_optionalChain([onDownloadWithoutAnnotations, 'optionalCall', _4 => _4()]);
|
|
202
|
+
};
|
|
184
203
|
const [activeMode, setActiveMode] = _react.useState.call(void 0, "view");
|
|
185
204
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "pdf-viewer-toolbar-container", children: [
|
|
186
205
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "pdf-viewer-toolbar", children: [
|
|
187
206
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-left", children: [
|
|
188
207
|
showPageNavigation && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-section", children: [
|
|
189
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "First Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
208
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "First Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
190
209
|
"button",
|
|
191
210
|
{
|
|
192
211
|
className: "toolbar-button",
|
|
@@ -194,8 +213,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
194
213
|
disabled: currentPage <= 1,
|
|
195
214
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FirstPage2.default, { fontSize: "small" })
|
|
196
215
|
}
|
|
197
|
-
) }),
|
|
198
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Previous Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
216
|
+
) }) }),
|
|
217
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Previous Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
199
218
|
"button",
|
|
200
219
|
{
|
|
201
220
|
className: "toolbar-button",
|
|
@@ -203,24 +222,16 @@ var PDFToolbar = _react2.default.memo(
|
|
|
203
222
|
disabled: currentPage <= 1,
|
|
204
223
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronLeft2.default, { fontSize: "small" })
|
|
205
224
|
}
|
|
206
|
-
) }),
|
|
207
|
-
/* @__PURE__ */ _jsxruntime.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
onKeyPress: onPageInputKeyPress,
|
|
215
|
-
min: 1,
|
|
216
|
-
max: totalPages || void 0
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
showPageCount && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "page-info", children: [
|
|
220
|
-
"/ ",
|
|
221
|
-
totalPages || "..."
|
|
225
|
+
) }) }),
|
|
226
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "page-info", style: { display: "flex", alignItems: "center", margin: "0 8px", fontSize: "14px", fontWeight: 500 }, children: [
|
|
227
|
+
currentPage,
|
|
228
|
+
" ",
|
|
229
|
+
showPageCount && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "#6b7280", marginLeft: "4px" }, children: [
|
|
230
|
+
"/ ",
|
|
231
|
+
totalPages || "..."
|
|
232
|
+
] })
|
|
222
233
|
] }),
|
|
223
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Next Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Next Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
235
|
"button",
|
|
225
236
|
{
|
|
226
237
|
className: "toolbar-button",
|
|
@@ -228,8 +239,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
228
239
|
disabled: currentPage >= totalPages,
|
|
229
240
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronRight2.default, { fontSize: "small" })
|
|
230
241
|
}
|
|
231
|
-
) }),
|
|
232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Last Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
242
|
+
) }) }),
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Last Page", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
244
|
"button",
|
|
234
245
|
{
|
|
235
246
|
className: "toolbar-button",
|
|
@@ -237,7 +248,7 @@ var PDFToolbar = _react2.default.memo(
|
|
|
237
248
|
disabled: currentPage >= totalPages,
|
|
238
249
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _LastPage2.default, { fontSize: "small" })
|
|
239
250
|
}
|
|
240
|
-
) })
|
|
251
|
+
) }) })
|
|
241
252
|
] }),
|
|
242
253
|
showZoomControls && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
243
254
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "toolbar-separator" }),
|
|
@@ -293,14 +304,14 @@ var PDFToolbar = _react2.default.memo(
|
|
|
293
304
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "toolbar-dropdown-divider" }),
|
|
294
305
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { className: "toolbar-dropdown-item", onClick: () => {
|
|
295
306
|
setIsViewMenuOpen(false);
|
|
296
|
-
_optionalChain([onFitToWidth, 'optionalCall',
|
|
307
|
+
_optionalChain([onFitToWidth, 'optionalCall', _5 => _5()]);
|
|
297
308
|
}, children: [
|
|
298
309
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _AspectRatio2.default, { fontSize: "small" }),
|
|
299
310
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fit to Width" })
|
|
300
311
|
] }),
|
|
301
312
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { className: "toolbar-dropdown-item", onClick: () => {
|
|
302
313
|
setIsViewMenuOpen(false);
|
|
303
|
-
_optionalChain([onFitToPage, 'optionalCall',
|
|
314
|
+
_optionalChain([onFitToPage, 'optionalCall', _6 => _6()]);
|
|
304
315
|
}, children: [
|
|
305
316
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FitScreen2.default, { fontSize: "small" }),
|
|
306
317
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fit to Page" })
|
|
@@ -314,7 +325,7 @@ var PDFToolbar = _react2.default.memo(
|
|
|
314
325
|
className: "toolbar-dropdown-item",
|
|
315
326
|
onClick: () => {
|
|
316
327
|
setIsViewMenuOpen(false);
|
|
317
|
-
_optionalChain([onRotateRight, 'optionalCall',
|
|
328
|
+
_optionalChain([onRotateRight, 'optionalCall', _7 => _7()]);
|
|
318
329
|
},
|
|
319
330
|
disabled: false,
|
|
320
331
|
children: [
|
|
@@ -329,7 +340,7 @@ var PDFToolbar = _react2.default.memo(
|
|
|
329
340
|
className: "toolbar-dropdown-item",
|
|
330
341
|
onClick: () => {
|
|
331
342
|
setIsViewMenuOpen(false);
|
|
332
|
-
_optionalChain([onRotateLeft, 'optionalCall',
|
|
343
|
+
_optionalChain([onRotateLeft, 'optionalCall', _8 => _8()]);
|
|
333
344
|
},
|
|
334
345
|
disabled: disabledRotateLeft,
|
|
335
346
|
children: [
|
|
@@ -402,27 +413,51 @@ var PDFToolbar = _react2.default.memo(
|
|
|
402
413
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "toolbar-right", children: (hasUnsavedAnnotations || showDownload || showPrint || showMetadata || showProperties || showTags || showHistory) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
403
414
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "toolbar-separator" }),
|
|
404
415
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-section", children: [
|
|
405
|
-
showDownload && /* @__PURE__ */ _jsxruntime.
|
|
406
|
-
"
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
416
|
+
showDownload && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-dropdown-container", ref: downloadMenuRef, children: [
|
|
417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Download", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
418
|
+
"button",
|
|
419
|
+
{
|
|
420
|
+
className: `toolbar-button toolbar-dropdown-button ${isDownloadMenuOpen ? "toolbar-button-active" : ""}`,
|
|
421
|
+
onClick: () => setIsDownloadMenuOpen(!isDownloadMenuOpen),
|
|
422
|
+
disabled: disabledDownload,
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Download2.default, { fontSize: "small" }),
|
|
425
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowDown2.default, { fontSize: "small", style: { marginLeft: -4 } })
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
) }) }),
|
|
429
|
+
isDownloadMenuOpen && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-dropdown-menu", children: [
|
|
430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
431
|
+
"button",
|
|
432
|
+
{
|
|
433
|
+
className: "toolbar-dropdown-item",
|
|
434
|
+
onClick: handleDownloadWithoutAnnotations,
|
|
435
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Download Document Only" })
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
"button",
|
|
440
|
+
{
|
|
441
|
+
className: "toolbar-dropdown-item",
|
|
442
|
+
onClick: handleDownloadWithAnnotations,
|
|
443
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Download with Annotations" })
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
] })
|
|
447
|
+
] }),
|
|
414
448
|
showPrint && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-dropdown-container", ref: printMenuRef, children: [
|
|
415
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Print", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Print", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
416
450
|
"button",
|
|
417
451
|
{
|
|
418
452
|
className: `toolbar-button toolbar-dropdown-button ${isPrintMenuOpen ? "toolbar-button-active" : ""}`,
|
|
419
453
|
onClick: () => setIsPrintMenuOpen(!isPrintMenuOpen),
|
|
454
|
+
disabled: disabledPrint,
|
|
420
455
|
children: [
|
|
421
456
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Print2.default, { fontSize: "small" }),
|
|
422
457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowDown2.default, { fontSize: "small", style: { marginLeft: -4 } })
|
|
423
458
|
]
|
|
424
459
|
}
|
|
425
|
-
) }),
|
|
460
|
+
) }) }),
|
|
426
461
|
isPrintMenuOpen && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "toolbar-dropdown-menu", children: [
|
|
427
462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
463
|
"button",
|
|
@@ -442,7 +477,7 @@ var PDFToolbar = _react2.default.memo(
|
|
|
442
477
|
)
|
|
443
478
|
] })
|
|
444
479
|
] }),
|
|
445
|
-
showMetadata && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Metadata", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
480
|
+
showMetadata && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Metadata", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
446
481
|
"button",
|
|
447
482
|
{
|
|
448
483
|
className: "toolbar-button",
|
|
@@ -450,8 +485,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
450
485
|
disabled: disabledMetadata,
|
|
451
486
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Description2.default, { fontSize: "small" })
|
|
452
487
|
}
|
|
453
|
-
) }),
|
|
454
|
-
showProperties && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Properties", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
488
|
+
) }) }),
|
|
489
|
+
showProperties && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Properties", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
455
490
|
"button",
|
|
456
491
|
{
|
|
457
492
|
className: "toolbar-button",
|
|
@@ -459,8 +494,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
459
494
|
disabled: disabledProperties,
|
|
460
495
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Info2.default, { fontSize: "small" })
|
|
461
496
|
}
|
|
462
|
-
) }),
|
|
463
|
-
showTags && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Tags", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
497
|
+
) }) }),
|
|
498
|
+
showTags && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Tags", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
464
499
|
"button",
|
|
465
500
|
{
|
|
466
501
|
className: "toolbar-button",
|
|
@@ -468,8 +503,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
468
503
|
disabled: disabledTags,
|
|
469
504
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.LocalOffer, { fontSize: "small" })
|
|
470
505
|
}
|
|
471
|
-
) }),
|
|
472
|
-
showHistory && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Version History", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
506
|
+
) }) }),
|
|
507
|
+
showHistory && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Version History", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
473
508
|
"button",
|
|
474
509
|
{
|
|
475
510
|
className: "toolbar-button",
|
|
@@ -477,12 +512,12 @@ var PDFToolbar = _react2.default.memo(
|
|
|
477
512
|
disabled: disabledHistory,
|
|
478
513
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _History2.default, { fontSize: "small" })
|
|
479
514
|
}
|
|
480
|
-
) })
|
|
515
|
+
) }) })
|
|
481
516
|
] })
|
|
482
517
|
] }) })
|
|
483
518
|
] }),
|
|
484
519
|
activeMode === "annotate" && showAnnotations && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "pdf-viewer-secondary-toolbar", children: [
|
|
485
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Highlight", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
520
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Highlight", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
486
521
|
"button",
|
|
487
522
|
{
|
|
488
523
|
className: `toolbar-button ${isHighlighterActive ? "toolbar-button-active" : ""}`,
|
|
@@ -490,8 +525,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
490
525
|
disabled: disabledHighlighter,
|
|
491
526
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Highlight2.default, { fontSize: "small" })
|
|
492
527
|
}
|
|
493
|
-
) }),
|
|
494
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Stamp", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
528
|
+
) }) }),
|
|
529
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Stamp", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
495
530
|
"button",
|
|
496
531
|
{
|
|
497
532
|
className: `toolbar-button ${isStampActive ? "toolbar-button-active" : ""}`,
|
|
@@ -499,8 +534,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
499
534
|
disabled: disabledStamp,
|
|
500
535
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Approval2.default, { fontSize: "small" })
|
|
501
536
|
}
|
|
502
|
-
) }),
|
|
503
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Signature", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
537
|
+
) }) }),
|
|
538
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Signature", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
504
539
|
"button",
|
|
505
540
|
{
|
|
506
541
|
className: "toolbar-button",
|
|
@@ -508,10 +543,10 @@ var PDFToolbar = _react2.default.memo(
|
|
|
508
543
|
disabled: disabledSignature,
|
|
509
544
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Draw2.default, { fontSize: "small" })
|
|
510
545
|
}
|
|
511
|
-
) }),
|
|
546
|
+
) }) }),
|
|
512
547
|
hasUnsavedAnnotations && canSaveAnnotations !== false && onSaveAnnotations && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
513
548
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { width: 1, height: 24, backgroundColor: "#e5e7eb", margin: "0 8px" } }),
|
|
514
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Save Annotations", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
549
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Save Annotations", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
515
550
|
"button",
|
|
516
551
|
{
|
|
517
552
|
className: "toolbar-button",
|
|
@@ -528,7 +563,8 @@ var PDFToolbar = _react2.default.memo(
|
|
|
528
563
|
backgroundColor: hasUnsavedAnnotations ? "#eff6ff" : "transparent",
|
|
529
564
|
fontSize: "14px",
|
|
530
565
|
fontWeight: 500,
|
|
531
|
-
width: "auto"
|
|
566
|
+
width: "auto",
|
|
567
|
+
cursor: isSavingAnnotations ? "not-allowed" : "pointer"
|
|
532
568
|
},
|
|
533
569
|
children: [
|
|
534
570
|
isSavingAnnotations ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "16", height: "16", viewBox: "0 0 24 24", style: { animation: "spin 1s linear infinite" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", fill: "none", strokeDasharray: "31.4", strokeDashoffset: "10" }) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -539,7 +575,7 @@ var PDFToolbar = _react2.default.memo(
|
|
|
539
575
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isSavingAnnotations ? "Saving..." : "Save" })
|
|
540
576
|
]
|
|
541
577
|
}
|
|
542
|
-
) })
|
|
578
|
+
) }) })
|
|
543
579
|
] })
|
|
544
580
|
] }),
|
|
545
581
|
activeMode === "redact" && showAnnotations && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pdf-viewer-secondary-toolbar", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: "Redact Text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { className: "toolbar-button", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _AutoFixHigh2.default, { fontSize: "small" }) }) }) })
|
|
@@ -1246,6 +1282,8 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1246
1282
|
onTagsClick,
|
|
1247
1283
|
onHistoryClick,
|
|
1248
1284
|
onDownloadClick,
|
|
1285
|
+
onDownloadWithAnnotations,
|
|
1286
|
+
onDownloadWithoutAnnotations,
|
|
1249
1287
|
onPrintClick,
|
|
1250
1288
|
initialSearchText,
|
|
1251
1289
|
initialSearchPages,
|
|
@@ -1261,12 +1299,14 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1261
1299
|
hasUnsavedAnnotations,
|
|
1262
1300
|
isSavingAnnotations,
|
|
1263
1301
|
canSaveAnnotations,
|
|
1264
|
-
onSaveAnnotations
|
|
1302
|
+
onSaveAnnotations,
|
|
1303
|
+
loading
|
|
1265
1304
|
} = props;
|
|
1266
1305
|
const [pdfBuffer, setPdfBuffer] = _react.useState.call(void 0, null);
|
|
1267
1306
|
const [state, setState] = _react.useState.call(void 0, "idle");
|
|
1268
1307
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
1269
1308
|
const pdfViewerRef = _react.useRef.call(void 0, null);
|
|
1309
|
+
const [isInternalReady, setIsInternalReady] = _react.useState.call(void 0, false);
|
|
1270
1310
|
const [internalHighlighterActive, setInternalHighlighterActive] = _react.useState.call(void 0, false);
|
|
1271
1311
|
const [internalStampActive, setInternalStampActive] = _react.useState.call(void 0, false);
|
|
1272
1312
|
const highlighterActive = isHighlighterActive !== void 0 ? isHighlighterActive : internalHighlighterActive;
|
|
@@ -1306,7 +1346,7 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1306
1346
|
const passwordTimeoutRef = _react.useRef.call(void 0, null);
|
|
1307
1347
|
const hasExecutedInitialSearch = _react.useRef.call(void 0, false);
|
|
1308
1348
|
const handleToggleFullScreen = _react.useCallback.call(void 0, () => {
|
|
1309
|
-
if (!isFullScreen && _optionalChain([containerRef, 'access',
|
|
1349
|
+
if (!isFullScreen && _optionalChain([containerRef, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.requestFullscreen])) {
|
|
1310
1350
|
containerRef.current.requestFullscreen();
|
|
1311
1351
|
setIsFullScreen(true);
|
|
1312
1352
|
} else if (isFullScreen && document.exitFullscreen) {
|
|
@@ -1330,7 +1370,7 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1330
1370
|
setSearchResults([]);
|
|
1331
1371
|
setTotalSearchResults(0);
|
|
1332
1372
|
setCurrentSearchResultIndex(0);
|
|
1333
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1373
|
+
_optionalChain([pdfViewerRef, 'access', _11 => _11.current, 'optionalAccess', _12 => _12.search, 'access', _13 => _13.stopSearch, 'call', _14 => _14()]);
|
|
1334
1374
|
}, []);
|
|
1335
1375
|
const toolbar = _chunkEEIQAW55js.mergeToolbarConfig.call(void 0, {
|
|
1336
1376
|
showDownload,
|
|
@@ -1351,66 +1391,66 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1351
1391
|
const toolbarHandlers = _react.useMemo.call(void 0,
|
|
1352
1392
|
() => ({
|
|
1353
1393
|
handleZoomIn: () => {
|
|
1354
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1394
|
+
_optionalChain([pdfViewerRef, 'access', _15 => _15.current, 'optionalAccess', _16 => _16.zoom, 'access', _17 => _17.zoomIn, 'call', _18 => _18()]);
|
|
1355
1395
|
requestAnimationFrame(() => {
|
|
1356
|
-
const zoomValue = _optionalChain([pdfViewerRef, 'access',
|
|
1396
|
+
const zoomValue = _optionalChain([pdfViewerRef, 'access', _19 => _19.current, 'optionalAccess', _20 => _20.zoom, 'access', _21 => _21.getZoom, 'call', _22 => _22()]);
|
|
1357
1397
|
if (typeof zoomValue === "number") {
|
|
1358
1398
|
setZoom(Math.round(zoomValue * 100));
|
|
1359
1399
|
}
|
|
1360
1400
|
});
|
|
1361
1401
|
},
|
|
1362
1402
|
handleZoomOut: () => {
|
|
1363
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1403
|
+
_optionalChain([pdfViewerRef, 'access', _23 => _23.current, 'optionalAccess', _24 => _24.zoom, 'access', _25 => _25.zoomOut, 'call', _26 => _26()]);
|
|
1364
1404
|
requestAnimationFrame(() => {
|
|
1365
|
-
const zoomValue = _optionalChain([pdfViewerRef, 'access',
|
|
1405
|
+
const zoomValue = _optionalChain([pdfViewerRef, 'access', _27 => _27.current, 'optionalAccess', _28 => _28.zoom, 'access', _29 => _29.getZoom, 'call', _30 => _30()]);
|
|
1366
1406
|
if (typeof zoomValue === "number") {
|
|
1367
1407
|
setZoom(Math.round(zoomValue * 100));
|
|
1368
1408
|
}
|
|
1369
1409
|
});
|
|
1370
1410
|
},
|
|
1371
1411
|
handleFitToWidth: () => {
|
|
1372
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1412
|
+
_optionalChain([pdfViewerRef, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.zoom, 'access', _33 => _33.fitToWidth, 'call', _34 => _34()]);
|
|
1373
1413
|
requestAnimationFrame(() => {
|
|
1374
|
-
const zoomValue = _optionalChain([pdfViewerRef, 'access',
|
|
1414
|
+
const zoomValue = _optionalChain([pdfViewerRef, 'access', _35 => _35.current, 'optionalAccess', _36 => _36.zoom, 'access', _37 => _37.getZoom, 'call', _38 => _38()]);
|
|
1375
1415
|
if (typeof zoomValue === "number") {
|
|
1376
1416
|
setZoom(Math.round(zoomValue * 100));
|
|
1377
1417
|
}
|
|
1378
1418
|
});
|
|
1379
1419
|
},
|
|
1380
1420
|
handleFitToPage: () => {
|
|
1381
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1421
|
+
_optionalChain([pdfViewerRef, 'access', _39 => _39.current, 'optionalAccess', _40 => _40.zoom, 'access', _41 => _41.fitToPage, 'call', _42 => _42()]);
|
|
1382
1422
|
requestAnimationFrame(() => {
|
|
1383
|
-
const zoomValue = _optionalChain([pdfViewerRef, 'access',
|
|
1423
|
+
const zoomValue = _optionalChain([pdfViewerRef, 'access', _43 => _43.current, 'optionalAccess', _44 => _44.zoom, 'access', _45 => _45.getZoom, 'call', _46 => _46()]);
|
|
1384
1424
|
if (typeof zoomValue === "number") {
|
|
1385
1425
|
setZoom(Math.round(zoomValue * 100));
|
|
1386
1426
|
}
|
|
1387
1427
|
});
|
|
1388
1428
|
},
|
|
1389
1429
|
handlePreviousPage: () => {
|
|
1390
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1430
|
+
_optionalChain([pdfViewerRef, 'access', _47 => _47.current, 'optionalAccess', _48 => _48.navigation, 'access', _49 => _49.previousPage, 'call', _50 => _50()]);
|
|
1391
1431
|
requestAnimationFrame(() => {
|
|
1392
|
-
const current = _optionalChain([pdfViewerRef, 'access',
|
|
1432
|
+
const current = _optionalChain([pdfViewerRef, 'access', _51 => _51.current, 'optionalAccess', _52 => _52.navigation, 'access', _53 => _53.getCurrentPage, 'call', _54 => _54()]) || 1;
|
|
1393
1433
|
setCurrentPage(current);
|
|
1394
1434
|
});
|
|
1395
1435
|
},
|
|
1396
1436
|
handleNextPage: () => {
|
|
1397
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1437
|
+
_optionalChain([pdfViewerRef, 'access', _55 => _55.current, 'optionalAccess', _56 => _56.navigation, 'access', _57 => _57.nextPage, 'call', _58 => _58()]);
|
|
1398
1438
|
requestAnimationFrame(() => {
|
|
1399
|
-
const current = _optionalChain([pdfViewerRef, 'access',
|
|
1439
|
+
const current = _optionalChain([pdfViewerRef, 'access', _59 => _59.current, 'optionalAccess', _60 => _60.navigation, 'access', _61 => _61.getCurrentPage, 'call', _62 => _62()]) || 1;
|
|
1400
1440
|
setCurrentPage(current);
|
|
1401
1441
|
});
|
|
1402
1442
|
},
|
|
1403
1443
|
handleFirstPage: () => {
|
|
1404
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1444
|
+
_optionalChain([pdfViewerRef, 'access', _63 => _63.current, 'optionalAccess', _64 => _64.navigation, 'access', _65 => _65.goToFirstPage, 'call', _66 => _66()]);
|
|
1405
1445
|
requestAnimationFrame(() => {
|
|
1406
|
-
const current = _optionalChain([pdfViewerRef, 'access',
|
|
1446
|
+
const current = _optionalChain([pdfViewerRef, 'access', _67 => _67.current, 'optionalAccess', _68 => _68.navigation, 'access', _69 => _69.getCurrentPage, 'call', _70 => _70()]) || 1;
|
|
1407
1447
|
setCurrentPage(current);
|
|
1408
1448
|
});
|
|
1409
1449
|
},
|
|
1410
1450
|
handleLastPage: () => {
|
|
1411
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1451
|
+
_optionalChain([pdfViewerRef, 'access', _71 => _71.current, 'optionalAccess', _72 => _72.navigation, 'access', _73 => _73.goToLastPage, 'call', _74 => _74()]);
|
|
1412
1452
|
requestAnimationFrame(() => {
|
|
1413
|
-
const current = _optionalChain([pdfViewerRef, 'access',
|
|
1453
|
+
const current = _optionalChain([pdfViewerRef, 'access', _75 => _75.current, 'optionalAccess', _76 => _76.navigation, 'access', _77 => _77.getCurrentPage, 'call', _78 => _78()]) || 1;
|
|
1414
1454
|
setCurrentPage(current);
|
|
1415
1455
|
});
|
|
1416
1456
|
},
|
|
@@ -1428,7 +1468,7 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1428
1468
|
}
|
|
1429
1469
|
const page = parseInt(value, 10);
|
|
1430
1470
|
if (!isNaN(page) && page >= 1 && (totalPages === 0 || page <= totalPages)) {
|
|
1431
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1471
|
+
_optionalChain([pdfViewerRef, 'access', _79 => _79.current, 'optionalAccess', _80 => _80.navigation, 'access', _81 => _81.goToPage, 'call', _82 => _82(page)]);
|
|
1432
1472
|
setCurrentPage(page);
|
|
1433
1473
|
}
|
|
1434
1474
|
},
|
|
@@ -1437,86 +1477,87 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1437
1477
|
const value = e.target.value;
|
|
1438
1478
|
const page = parseInt(value, 10);
|
|
1439
1479
|
if (!isNaN(page) && page >= 1 && (totalPages === 0 || page <= totalPages)) {
|
|
1440
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1480
|
+
_optionalChain([pdfViewerRef, 'access', _83 => _83.current, 'optionalAccess', _84 => _84.navigation, 'access', _85 => _85.goToPage, 'call', _86 => _86(page)]);
|
|
1441
1481
|
setCurrentPage(page);
|
|
1442
1482
|
}
|
|
1443
1483
|
}
|
|
1444
1484
|
},
|
|
1445
1485
|
handleRotateLeft: () => {
|
|
1446
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1486
|
+
_optionalChain([pdfViewerRef, 'access', _87 => _87.current, 'optionalAccess', _88 => _88.rotate, 'optionalAccess', _89 => _89.rotateBackward, 'call', _90 => _90()]);
|
|
1447
1487
|
},
|
|
1448
1488
|
handleRotateRight: () => {
|
|
1449
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1489
|
+
_optionalChain([pdfViewerRef, 'access', _91 => _91.current, 'optionalAccess', _92 => _92.rotate, 'optionalAccess', _93 => _93.rotateForward, 'call', _94 => _94()]);
|
|
1450
1490
|
},
|
|
1451
1491
|
handlePrint: () => {
|
|
1452
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1492
|
+
_optionalChain([pdfViewerRef, 'access', _95 => _95.current, 'optionalAccess', _96 => _96.print, 'optionalAccess', _97 => _97.print, 'call', _98 => _98()]);
|
|
1453
1493
|
},
|
|
1454
1494
|
handlePrintWithAnnotations: async () => {
|
|
1455
|
-
console.log("\u{1F5A8}\uFE0F Print with Annotations clicked");
|
|
1456
|
-
console.log("pdfViewerRef.current:", pdfViewerRef.current);
|
|
1457
|
-
console.log("pdfViewerRef.current?.print:", _optionalChain([pdfViewerRef, 'access', _97 => _97.current, 'optionalAccess', _98 => _98.print]));
|
|
1458
1495
|
await _optionalChain([pdfViewerRef, 'access', _99 => _99.current, 'optionalAccess', _100 => _100.print, 'optionalAccess', _101 => _101.printWithAnnotations, 'optionalCall', _102 => _102()]);
|
|
1459
1496
|
},
|
|
1460
1497
|
handlePrintWithoutAnnotations: async () => {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1498
|
+
await _optionalChain([pdfViewerRef, 'access', _103 => _103.current, 'optionalAccess', _104 => _104.print, 'optionalAccess', _105 => _105.printWithoutAnnotations, 'optionalCall', _106 => _106()]);
|
|
1499
|
+
},
|
|
1500
|
+
handleDownloadWithAnnotations: async () => {
|
|
1501
|
+
if (onDownloadWithAnnotations) {
|
|
1502
|
+
onDownloadWithAnnotations();
|
|
1503
|
+
} else {
|
|
1504
|
+
await _optionalChain([pdfViewerRef, 'access', _107 => _107.current, 'optionalAccess', _108 => _108.download, 'optionalAccess', _109 => _109.downloadWithAnnotations, 'optionalCall', _110 => _110(resolvedFileName)]);
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1507
|
+
handleDownloadWithoutAnnotations: async () => {
|
|
1508
|
+
if (onDownloadWithoutAnnotations) {
|
|
1509
|
+
onDownloadWithoutAnnotations();
|
|
1510
|
+
} else {
|
|
1511
|
+
await _optionalChain([pdfViewerRef, 'access', _111 => _111.current, 'optionalAccess', _112 => _112.download, 'optionalAccess', _113 => _113.downloadWithoutAnnotations, 'optionalCall', _114 => _114(resolvedFileName)]);
|
|
1512
|
+
}
|
|
1465
1513
|
},
|
|
1466
1514
|
handleHighlighterClick: () => {
|
|
1467
1515
|
if (highlighterActive) {
|
|
1468
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1516
|
+
_optionalChain([pdfViewerRef, 'access', _115 => _115.current, 'optionalAccess', _116 => _116.annotation, 'optionalAccess', _117 => _117.deactivateHighlighter, 'call', _118 => _118()]);
|
|
1469
1517
|
setInternalHighlighterActive(false);
|
|
1470
1518
|
} else {
|
|
1471
1519
|
if (stampActive) {
|
|
1472
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1520
|
+
_optionalChain([pdfViewerRef, 'access', _119 => _119.current, 'optionalAccess', _120 => _120.annotation, 'optionalAccess', _121 => _121.deactivateStamp, 'call', _122 => _122()]);
|
|
1473
1521
|
setInternalStampActive(false);
|
|
1474
1522
|
}
|
|
1475
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1523
|
+
_optionalChain([pdfViewerRef, 'access', _123 => _123.current, 'optionalAccess', _124 => _124.annotation, 'optionalAccess', _125 => _125.activateHighlighter, 'call', _126 => _126()]);
|
|
1476
1524
|
setInternalHighlighterActive(true);
|
|
1477
1525
|
}
|
|
1478
1526
|
},
|
|
1479
1527
|
handleStampClick: () => {
|
|
1480
1528
|
if (stampActive) {
|
|
1481
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1529
|
+
_optionalChain([pdfViewerRef, 'access', _127 => _127.current, 'optionalAccess', _128 => _128.annotation, 'optionalAccess', _129 => _129.deactivateStamp, 'call', _130 => _130()]);
|
|
1482
1530
|
setInternalStampActive(false);
|
|
1483
1531
|
} else {
|
|
1484
1532
|
if (highlighterActive) {
|
|
1485
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1533
|
+
_optionalChain([pdfViewerRef, 'access', _131 => _131.current, 'optionalAccess', _132 => _132.annotation, 'optionalAccess', _133 => _133.deactivateHighlighter, 'call', _134 => _134()]);
|
|
1486
1534
|
setInternalHighlighterActive(false);
|
|
1487
1535
|
}
|
|
1488
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1536
|
+
_optionalChain([pdfViewerRef, 'access', _135 => _135.current, 'optionalAccess', _136 => _136.annotation, 'optionalAccess', _137 => _137.activateStamp, 'call', _138 => _138("")]);
|
|
1489
1537
|
setInternalStampActive(true);
|
|
1490
1538
|
}
|
|
1491
1539
|
},
|
|
1492
1540
|
handleSignatureClick: () => {
|
|
1493
1541
|
},
|
|
1542
|
+
handleCopy: () => {
|
|
1543
|
+
_optionalChain([pdfViewerRef, 'access', _139 => _139.current, 'optionalAccess', _140 => _140.selection, 'access', _141 => _141.copy, 'call', _142 => _142()]);
|
|
1544
|
+
},
|
|
1494
1545
|
handleToggleFullScreen
|
|
1495
1546
|
}),
|
|
1496
|
-
[isSidebarOpen, totalPages, handleToggleFullScreen, highlighterActive, stampActive]
|
|
1547
|
+
[isSidebarOpen, totalPages, handleToggleFullScreen, highlighterActive, stampActive, onDownloadWithAnnotations, onDownloadWithoutAnnotations]
|
|
1497
1548
|
);
|
|
1498
1549
|
_react.useEffect.call(void 0, () => {
|
|
1499
|
-
console.log(
|
|
1500
|
-
"came",
|
|
1501
|
-
initialSearchText,
|
|
1502
|
-
pdfViewerRef.current,
|
|
1503
|
-
hasExecutedInitialSearch.current,
|
|
1504
|
-
"state:",
|
|
1505
|
-
state,
|
|
1506
|
-
"totalPages:",
|
|
1507
|
-
totalPages
|
|
1508
|
-
);
|
|
1509
1550
|
if (!initialSearchText || hasExecutedInitialSearch.current) return;
|
|
1510
1551
|
const isPDFReady = state === "ready";
|
|
1511
1552
|
const isPagesInitialized = totalPages > 0;
|
|
1512
1553
|
const isViewerAvailable = !!pdfViewerRef.current;
|
|
1513
|
-
const isSearchAPIReady = !!_optionalChain([pdfViewerRef, 'access',
|
|
1554
|
+
const isSearchAPIReady = !!_optionalChain([pdfViewerRef, 'access', _143 => _143.current, 'optionalAccess', _144 => _144.search, 'optionalAccess', _145 => _145.searchText]);
|
|
1514
1555
|
const canExecuteSearch = isPDFReady && isPagesInitialized && isViewerAvailable && isSearchAPIReady;
|
|
1515
1556
|
if (!canExecuteSearch) return;
|
|
1516
1557
|
hasExecutedInitialSearch.current = true;
|
|
1517
1558
|
const SEARCH_INITIALIZATION_DELAY = 100;
|
|
1518
1559
|
setTimeout(() => {
|
|
1519
|
-
if (!_optionalChain([pdfViewerRef, 'access',
|
|
1560
|
+
if (!_optionalChain([pdfViewerRef, 'access', _146 => _146.current, 'optionalAccess', _147 => _147.search, 'optionalAccess', _148 => _148.searchText])) {
|
|
1520
1561
|
console.warn(
|
|
1521
1562
|
"Search API became unavailable, skipping initial search"
|
|
1522
1563
|
);
|
|
@@ -1574,6 +1615,29 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1574
1615
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
1575
1616
|
return () => observer.disconnect();
|
|
1576
1617
|
}, [state]);
|
|
1618
|
+
_react.useEffect.call(void 0, () => {
|
|
1619
|
+
if (state !== "ready") return;
|
|
1620
|
+
const checkInternalReadiness = async () => {
|
|
1621
|
+
if (!pdfViewerRef.current) return;
|
|
1622
|
+
try {
|
|
1623
|
+
const count = _optionalChain([pdfViewerRef, 'access', _149 => _149.current, 'access', _150 => _150.navigation, 'optionalAccess', _151 => _151.getTotalPages, 'optionalCall', _152 => _152()]);
|
|
1624
|
+
if (count && count > 0) {
|
|
1625
|
+
setTotalPages(count);
|
|
1626
|
+
setIsInternalReady(true);
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
const docInfo = _optionalChain([pdfViewerRef, 'access', _153 => _153.current, 'optionalAccess', _154 => _154.document, 'optionalAccess', _155 => _155.getDocumentInfo, 'optionalCall', _156 => _156()]);
|
|
1630
|
+
if (docInfo && docInfo.totalPages > 0) {
|
|
1631
|
+
setTotalPages(docInfo.totalPages);
|
|
1632
|
+
setIsInternalReady(true);
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1635
|
+
} catch (e) {
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
const pollInterval = setInterval(checkInternalReadiness, 100);
|
|
1639
|
+
return () => clearInterval(pollInterval);
|
|
1640
|
+
}, [state]);
|
|
1577
1641
|
_react.useEffect.call(void 0, () => {
|
|
1578
1642
|
if (state !== "ready" || totalPages > 0) return;
|
|
1579
1643
|
const initializePageCount = async () => {
|
|
@@ -1592,65 +1656,32 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1592
1656
|
if (!viewer) return;
|
|
1593
1657
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1594
1658
|
try {
|
|
1595
|
-
const count = _optionalChain([viewer, 'access',
|
|
1596
|
-
if (count && count > 1) {
|
|
1597
|
-
setTotalPages(count);
|
|
1598
|
-
return;
|
|
1599
|
-
}
|
|
1600
|
-
} catch (e) {
|
|
1601
|
-
}
|
|
1602
|
-
try {
|
|
1603
|
-
const results = await _optionalChain([viewer, 'access', _142 => _142.search, 'optionalAccess', _143 => _143.searchText, 'optionalCall', _144 => _144("e")]);
|
|
1604
|
-
if (_optionalChain([results, 'optionalAccess', _145 => _145.results]) && results.results.length > 0) {
|
|
1605
|
-
const pageIndices = results.results.map((m) => m.pageIndex).filter((idx) => typeof idx === "number");
|
|
1606
|
-
const count = Math.max(...pageIndices) + 1;
|
|
1607
|
-
_optionalChain([viewer, 'access', _146 => _146.search, 'optionalAccess', _147 => _147.stopSearch, 'optionalCall', _148 => _148()]);
|
|
1608
|
-
setTotalPages(count);
|
|
1609
|
-
return;
|
|
1610
|
-
}
|
|
1611
|
-
} catch (error2) {
|
|
1612
|
-
}
|
|
1613
|
-
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
1614
|
-
try {
|
|
1615
|
-
const selectors = [
|
|
1616
|
-
"[data-page-index]",
|
|
1617
|
-
"[data-page-number]",
|
|
1618
|
-
".embedpdf-page",
|
|
1619
|
-
'[role="article"]',
|
|
1620
|
-
"canvas[data-page]",
|
|
1621
|
-
".react-pdf__Page"
|
|
1622
|
-
];
|
|
1623
|
-
for (const selector of selectors) {
|
|
1624
|
-
const pages = document.querySelectorAll(selector);
|
|
1625
|
-
if (pages.length > 0) {
|
|
1626
|
-
setTotalPages(pages.length);
|
|
1627
|
-
return;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
} catch (error2) {
|
|
1631
|
-
}
|
|
1632
|
-
try {
|
|
1633
|
-
const count = _optionalChain([viewer, 'access', _149 => _149.navigation, 'optionalAccess', _150 => _150.getTotalPages, 'optionalCall', _151 => _151()]);
|
|
1659
|
+
const count = _optionalChain([viewer, 'access', _157 => _157.navigation, 'optionalAccess', _158 => _158.getTotalPages, 'optionalCall', _159 => _159()]);
|
|
1634
1660
|
if (count && count > 0) {
|
|
1635
1661
|
setTotalPages(count);
|
|
1662
|
+
setIsInternalReady(true);
|
|
1636
1663
|
return;
|
|
1637
1664
|
}
|
|
1638
1665
|
} catch (e) {
|
|
1639
1666
|
}
|
|
1640
|
-
console.warn(
|
|
1641
|
-
"Could not determine total pages, using fallback value of 1"
|
|
1642
|
-
);
|
|
1643
|
-
setTotalPages(1);
|
|
1644
1667
|
};
|
|
1645
1668
|
initializePageCount();
|
|
1646
1669
|
}, [state, totalPages]);
|
|
1647
1670
|
_react.useEffect.call(void 0, () => {
|
|
1648
|
-
if (state === "ready"
|
|
1671
|
+
if (state === "ready") {
|
|
1649
1672
|
const updateInfo = () => {
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
const
|
|
1653
|
-
const
|
|
1673
|
+
if (!pdfViewerRef.current) return;
|
|
1674
|
+
const current = _optionalChain([pdfViewerRef, 'access', _160 => _160.current, 'optionalAccess', _161 => _161.navigation, 'access', _162 => _162.getCurrentPage, 'call', _163 => _163()]) || 1;
|
|
1675
|
+
const docInfo = _optionalChain([pdfViewerRef, 'access', _164 => _164.current, 'optionalAccess', _165 => _165.document, 'optionalAccess', _166 => _166.getDocumentInfo, 'optionalCall', _167 => _167()]);
|
|
1676
|
+
const navTotal = _optionalChain([pdfViewerRef, 'access', _168 => _168.current, 'optionalAccess', _169 => _169.navigation, 'optionalAccess', _170 => _170.getTotalPages, 'optionalCall', _171 => _171()]);
|
|
1677
|
+
let total = 0;
|
|
1678
|
+
if (docInfo && docInfo.totalPages > 0) {
|
|
1679
|
+
total = docInfo.totalPages;
|
|
1680
|
+
} else if (typeof navTotal === "number" && navTotal > 0) {
|
|
1681
|
+
total = navTotal;
|
|
1682
|
+
}
|
|
1683
|
+
const zoomValue = _optionalChain([pdfViewerRef, 'access', _172 => _172.current, 'optionalAccess', _173 => _173.zoom, 'access', _174 => _174.getZoom, 'call', _175 => _175()]);
|
|
1684
|
+
const currentSearchState = _optionalChain([pdfViewerRef, 'access', _176 => _176.current, 'optionalAccess', _177 => _177.search, 'access', _178 => _178.getSearchState, 'call', _179 => _179()]);
|
|
1654
1685
|
setCurrentPage(current);
|
|
1655
1686
|
if (total > 0 && total !== totalPages) {
|
|
1656
1687
|
setTotalPages(total);
|
|
@@ -1660,7 +1691,8 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1660
1691
|
}
|
|
1661
1692
|
};
|
|
1662
1693
|
updateInfo();
|
|
1663
|
-
const
|
|
1694
|
+
const pollInterval = totalPages === 0 ? 50 : 300;
|
|
1695
|
+
const interval = setInterval(updateInfo, pollInterval);
|
|
1664
1696
|
return () => clearInterval(interval);
|
|
1665
1697
|
}
|
|
1666
1698
|
}, [state, totalPages]);
|
|
@@ -1668,50 +1700,50 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1668
1700
|
ref,
|
|
1669
1701
|
() => ({
|
|
1670
1702
|
zoomIn: () => {
|
|
1671
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1703
|
+
_optionalChain([pdfViewerRef, 'access', _180 => _180.current, 'optionalAccess', _181 => _181.zoom, 'access', _182 => _182.zoomIn, 'call', _183 => _183()]);
|
|
1672
1704
|
updateZoomDisplay();
|
|
1673
1705
|
},
|
|
1674
1706
|
zoomOut: () => {
|
|
1675
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1707
|
+
_optionalChain([pdfViewerRef, 'access', _184 => _184.current, 'optionalAccess', _185 => _185.zoom, 'access', _186 => _186.zoomOut, 'call', _187 => _187()]);
|
|
1676
1708
|
updateZoomDisplay();
|
|
1677
1709
|
},
|
|
1678
1710
|
setZoom: (level) => {
|
|
1679
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1711
|
+
_optionalChain([pdfViewerRef, 'access', _188 => _188.current, 'optionalAccess', _189 => _189.zoom, 'access', _190 => _190.setZoom, 'call', _191 => _191(level)]);
|
|
1680
1712
|
updateZoomDisplay();
|
|
1681
1713
|
},
|
|
1682
1714
|
resetZoom: () => {
|
|
1683
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1715
|
+
_optionalChain([pdfViewerRef, 'access', _192 => _192.current, 'optionalAccess', _193 => _193.zoom, 'access', _194 => _194.resetZoom, 'call', _195 => _195()]);
|
|
1684
1716
|
updateZoomDisplay();
|
|
1685
1717
|
},
|
|
1686
1718
|
getZoom: () => {
|
|
1687
|
-
const zoom2 = _optionalChain([pdfViewerRef, 'access',
|
|
1719
|
+
const zoom2 = _optionalChain([pdfViewerRef, 'access', _196 => _196.current, 'optionalAccess', _197 => _197.zoom, 'access', _198 => _198.getZoom, 'call', _199 => _199()]);
|
|
1688
1720
|
return typeof zoom2 === "number" ? zoom2 : 1;
|
|
1689
1721
|
},
|
|
1690
1722
|
goToPage: (page) => {
|
|
1691
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1723
|
+
_optionalChain([pdfViewerRef, 'access', _200 => _200.current, 'optionalAccess', _201 => _201.navigation, 'access', _202 => _202.goToPage, 'call', _203 => _203(page)]);
|
|
1692
1724
|
setCurrentPage(page);
|
|
1693
1725
|
},
|
|
1694
|
-
getCurrentPage: () => _optionalChain([pdfViewerRef, 'access',
|
|
1695
|
-
getTotalPages: () => _optionalChain([pdfViewerRef, 'access',
|
|
1726
|
+
getCurrentPage: () => _optionalChain([pdfViewerRef, 'access', _204 => _204.current, 'optionalAccess', _205 => _205.navigation, 'access', _206 => _206.getCurrentPage, 'call', _207 => _207()]) || 1,
|
|
1727
|
+
getTotalPages: () => _optionalChain([pdfViewerRef, 'access', _208 => _208.current, 'optionalAccess', _209 => _209.navigation, 'access', _210 => _210.getTotalPages, 'call', _211 => _211()]) || 0,
|
|
1696
1728
|
nextPage: () => {
|
|
1697
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1729
|
+
_optionalChain([pdfViewerRef, 'access', _212 => _212.current, 'optionalAccess', _213 => _213.navigation, 'access', _214 => _214.nextPage, 'call', _215 => _215()]);
|
|
1698
1730
|
updatePageDisplay();
|
|
1699
1731
|
},
|
|
1700
1732
|
previousPage: () => {
|
|
1701
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1733
|
+
_optionalChain([pdfViewerRef, 'access', _216 => _216.current, 'optionalAccess', _217 => _217.navigation, 'access', _218 => _218.previousPage, 'call', _219 => _219()]);
|
|
1702
1734
|
updatePageDisplay();
|
|
1703
1735
|
},
|
|
1704
1736
|
goToFirstPage: () => {
|
|
1705
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1737
|
+
_optionalChain([pdfViewerRef, 'access', _220 => _220.current, 'optionalAccess', _221 => _221.navigation, 'access', _222 => _222.goToFirstPage, 'call', _223 => _223()]);
|
|
1706
1738
|
updatePageDisplay();
|
|
1707
1739
|
},
|
|
1708
1740
|
goToLastPage: () => {
|
|
1709
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1741
|
+
_optionalChain([pdfViewerRef, 'access', _224 => _224.current, 'optionalAccess', _225 => _225.navigation, 'access', _226 => _226.goToLastPage, 'call', _227 => _227()]);
|
|
1710
1742
|
updatePageDisplay();
|
|
1711
1743
|
},
|
|
1712
1744
|
searchText: async (keyword) => {
|
|
1713
1745
|
setIsSearching(true);
|
|
1714
|
-
const results = await _optionalChain([pdfViewerRef, 'access',
|
|
1746
|
+
const results = await _optionalChain([pdfViewerRef, 'access', _228 => _228.current, 'optionalAccess', _229 => _229.search, 'access', _230 => _230.searchText, 'call', _231 => _231(
|
|
1715
1747
|
keyword
|
|
1716
1748
|
)]);
|
|
1717
1749
|
setIsSearching(false);
|
|
@@ -1719,49 +1751,58 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1719
1751
|
return results;
|
|
1720
1752
|
},
|
|
1721
1753
|
nextResult: () => {
|
|
1722
|
-
const index = _optionalChain([pdfViewerRef, 'access',
|
|
1754
|
+
const index = _optionalChain([pdfViewerRef, 'access', _232 => _232.current, 'optionalAccess', _233 => _233.search, 'access', _234 => _234.nextResult, 'call', _235 => _235()]) || -1;
|
|
1723
1755
|
return index;
|
|
1724
1756
|
},
|
|
1725
1757
|
previousResult: () => {
|
|
1726
|
-
const index = _optionalChain([pdfViewerRef, 'access',
|
|
1758
|
+
const index = _optionalChain([pdfViewerRef, 'access', _236 => _236.current, 'optionalAccess', _237 => _237.search, 'access', _238 => _238.previousResult, 'call', _239 => _239()]) || -1;
|
|
1727
1759
|
return index;
|
|
1728
1760
|
},
|
|
1729
|
-
goToResult: (index) => _optionalChain([pdfViewerRef, 'access',
|
|
1761
|
+
goToResult: (index) => _optionalChain([pdfViewerRef, 'access', _240 => _240.current, 'optionalAccess', _241 => _241.search, 'access', _242 => _242.goToResult, 'call', _243 => _243(index)]) || -1,
|
|
1730
1762
|
stopSearch: () => {
|
|
1731
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1763
|
+
_optionalChain([pdfViewerRef, 'access', _244 => _244.current, 'optionalAccess', _245 => _245.search, 'access', _246 => _246.stopSearch, 'call', _247 => _247()]);
|
|
1732
1764
|
setSearchQuery("");
|
|
1733
1765
|
},
|
|
1734
|
-
getSearchState: () => _optionalChain([pdfViewerRef, 'access',
|
|
1735
|
-
getSelectedText: () =>
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1766
|
+
getSearchState: () => _optionalChain([pdfViewerRef, 'access', _248 => _248.current, 'optionalAccess', _249 => _249.search, 'access', _250 => _250.getSearchState, 'call', _251 => _251()]) || null,
|
|
1767
|
+
getSelectedText: async () => {
|
|
1768
|
+
return await _optionalChain([pdfViewerRef, 'access', _252 => _252.current, 'optionalAccess', _253 => _253.selection, 'access', _254 => _254.getSelectedText, 'call', _255 => _255()]) || "";
|
|
1769
|
+
},
|
|
1770
|
+
clearSelection: () => _optionalChain([pdfViewerRef, 'access', _256 => _256.current, 'optionalAccess', _257 => _257.selection, 'access', _258 => _258.clearSelection, 'call', _259 => _259()]),
|
|
1771
|
+
copy: () => _optionalChain([pdfViewerRef, 'access', _260 => _260.current, 'optionalAccess', _261 => _261.selection, 'access', _262 => _262.copy, 'call', _263 => _263()]),
|
|
1772
|
+
rotateForward: () => _optionalChain([pdfViewerRef, 'access', _264 => _264.current, 'optionalAccess', _265 => _265.rotate, 'optionalAccess', _266 => _266.rotateForward, 'call', _267 => _267()]),
|
|
1773
|
+
rotateBackward: () => _optionalChain([pdfViewerRef, 'access', _268 => _268.current, 'optionalAccess', _269 => _269.rotate, 'optionalAccess', _270 => _270.rotateBackward, 'call', _271 => _271()]),
|
|
1774
|
+
getRotation: () => _optionalChain([pdfViewerRef, 'access', _272 => _272.current, 'optionalAccess', _273 => _273.rotate, 'optionalAccess', _274 => _274.getRotation, 'call', _275 => _275()]) || 0,
|
|
1775
|
+
print: () => _optionalChain([pdfViewerRef, 'access', _276 => _276.current, 'optionalAccess', _277 => _277.print, 'optionalAccess', _278 => _278.print, 'call', _279 => _279()]),
|
|
1741
1776
|
printWithAnnotations: async () => {
|
|
1742
|
-
await _optionalChain([pdfViewerRef, 'access',
|
|
1777
|
+
await _optionalChain([pdfViewerRef, 'access', _280 => _280.current, 'optionalAccess', _281 => _281.print, 'optionalAccess', _282 => _282.printWithAnnotations, 'optionalCall', _283 => _283()]);
|
|
1743
1778
|
},
|
|
1744
1779
|
printWithoutAnnotations: async () => {
|
|
1745
|
-
await _optionalChain([pdfViewerRef, 'access',
|
|
1780
|
+
await _optionalChain([pdfViewerRef, 'access', _284 => _284.current, 'optionalAccess', _285 => _285.print, 'optionalAccess', _286 => _286.printWithoutAnnotations, 'optionalCall', _287 => _287()]);
|
|
1781
|
+
},
|
|
1782
|
+
downloadWithAnnotations: async (filename) => {
|
|
1783
|
+
await _optionalChain([pdfViewerRef, 'access', _288 => _288.current, 'optionalAccess', _289 => _289.download, 'optionalAccess', _290 => _290.downloadWithAnnotations, 'optionalCall', _291 => _291(filename)]);
|
|
1784
|
+
},
|
|
1785
|
+
downloadWithoutAnnotations: async (filename) => {
|
|
1786
|
+
await _optionalChain([pdfViewerRef, 'access', _292 => _292.current, 'optionalAccess', _293 => _293.download, 'optionalAccess', _294 => _294.downloadWithoutAnnotations, 'optionalCall', _295 => _295(filename)]);
|
|
1746
1787
|
},
|
|
1747
1788
|
get annotation() {
|
|
1748
|
-
return _optionalChain([pdfViewerRef, 'access',
|
|
1789
|
+
return _optionalChain([pdfViewerRef, 'access', _296 => _296.current, 'optionalAccess', _297 => _297.annotation]);
|
|
1749
1790
|
},
|
|
1750
1791
|
get download() {
|
|
1751
|
-
return _optionalChain([pdfViewerRef, 'access',
|
|
1792
|
+
return _optionalChain([pdfViewerRef, 'access', _298 => _298.current, 'optionalAccess', _299 => _299.download]);
|
|
1752
1793
|
}
|
|
1753
1794
|
}),
|
|
1754
1795
|
[]
|
|
1755
1796
|
);
|
|
1756
1797
|
const updatePageDisplay = () => {
|
|
1757
1798
|
requestAnimationFrame(() => {
|
|
1758
|
-
const current = _optionalChain([pdfViewerRef, 'access',
|
|
1799
|
+
const current = _optionalChain([pdfViewerRef, 'access', _300 => _300.current, 'optionalAccess', _301 => _301.navigation, 'access', _302 => _302.getCurrentPage, 'call', _303 => _303()]) || 1;
|
|
1759
1800
|
setCurrentPage(current);
|
|
1760
1801
|
});
|
|
1761
1802
|
};
|
|
1762
1803
|
const updateZoomDisplay = () => {
|
|
1763
1804
|
requestAnimationFrame(() => {
|
|
1764
|
-
const zoomValue = _optionalChain([pdfViewerRef, 'access',
|
|
1805
|
+
const zoomValue = _optionalChain([pdfViewerRef, 'access', _304 => _304.current, 'optionalAccess', _305 => _305.zoom, 'access', _306 => _306.getZoom, 'call', _307 => _307()]);
|
|
1765
1806
|
if (typeof zoomValue === "number") {
|
|
1766
1807
|
setZoom(Math.round(zoomValue * 100));
|
|
1767
1808
|
}
|
|
@@ -1770,11 +1811,11 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1770
1811
|
const handleSearch = async () => {
|
|
1771
1812
|
if (!searchQuery.trim()) return;
|
|
1772
1813
|
setIsSearching(true);
|
|
1773
|
-
const results = await _optionalChain([pdfViewerRef, 'access',
|
|
1814
|
+
const results = await _optionalChain([pdfViewerRef, 'access', _308 => _308.current, 'optionalAccess', _309 => _309.search, 'access', _310 => _310.searchText, 'call', _311 => _311(
|
|
1774
1815
|
searchQuery
|
|
1775
1816
|
)]);
|
|
1776
1817
|
setIsSearching(false);
|
|
1777
|
-
if (_optionalChain([results, 'optionalAccess',
|
|
1818
|
+
if (_optionalChain([results, 'optionalAccess', _312 => _312.results]) && Array.isArray(results.results) && results.results.length > 0) {
|
|
1778
1819
|
const formattedResults = formatSearchResults(results.results);
|
|
1779
1820
|
updateSearchState(formattedResults);
|
|
1780
1821
|
} else {
|
|
@@ -1792,19 +1833,18 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1792
1833
|
setSearchResults([]);
|
|
1793
1834
|
setTotalSearchResults(0);
|
|
1794
1835
|
setCurrentSearchResultIndex(0);
|
|
1795
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1836
|
+
_optionalChain([pdfViewerRef, 'access', _313 => _313.current, 'optionalAccess', _314 => _314.search, 'access', _315 => _315.stopSearch, 'call', _316 => _316()]);
|
|
1796
1837
|
return;
|
|
1797
1838
|
}
|
|
1798
|
-
if (!_optionalChain([pdfViewerRef, 'access',
|
|
1839
|
+
if (!_optionalChain([pdfViewerRef, 'access', _317 => _317.current, 'optionalAccess', _318 => _318.search, 'optionalAccess', _319 => _319.searchText])) {
|
|
1799
1840
|
console.warn("Search functionality not yet available");
|
|
1800
1841
|
return;
|
|
1801
1842
|
}
|
|
1802
1843
|
setIsSearching(true);
|
|
1803
1844
|
try {
|
|
1804
1845
|
const results = await pdfViewerRef.current.search.searchText(keyword);
|
|
1805
|
-
console.log("Search completed:", results);
|
|
1806
1846
|
setIsSearching(false);
|
|
1807
|
-
const hasValidResults = _optionalChain([results, 'optionalAccess',
|
|
1847
|
+
const hasValidResults = _optionalChain([results, 'optionalAccess', _320 => _320.results]) && Array.isArray(results.results) && results.results.length > 0;
|
|
1808
1848
|
if (hasValidResults) {
|
|
1809
1849
|
const formattedResults = formatSearchResults(results.results);
|
|
1810
1850
|
updateSearchState(formattedResults);
|
|
@@ -1870,24 +1910,24 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1870
1910
|
};
|
|
1871
1911
|
const navigateToPage = (pageNumber) => {
|
|
1872
1912
|
requestAnimationFrame(() => {
|
|
1873
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1913
|
+
_optionalChain([pdfViewerRef, 'access', _321 => _321.current, 'optionalAccess', _322 => _322.navigation, 'access', _323 => _323.goToPage, 'call', _324 => _324(pageNumber)]);
|
|
1874
1914
|
setCurrentPage(pageNumber);
|
|
1875
1915
|
});
|
|
1876
1916
|
};
|
|
1877
1917
|
const handleSearchResultClick = (pageNumber, resultIndex) => {
|
|
1878
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1918
|
+
_optionalChain([pdfViewerRef, 'access', _325 => _325.current, 'optionalAccess', _326 => _326.navigation, 'access', _327 => _327.goToPage, 'call', _328 => _328(pageNumber)]);
|
|
1879
1919
|
setCurrentSearchResultIndex(resultIndex);
|
|
1880
1920
|
setCurrentPage(pageNumber);
|
|
1881
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1921
|
+
_optionalChain([pdfViewerRef, 'access', _329 => _329.current, 'optionalAccess', _330 => _330.search, 'access', _331 => _331.goToResult, 'call', _332 => _332(resultIndex)]);
|
|
1882
1922
|
};
|
|
1883
1923
|
const handleNextSearchResult = () => {
|
|
1884
1924
|
if (currentSearchResultIndex < totalSearchResults - 1) {
|
|
1885
1925
|
const nextIndex = currentSearchResultIndex + 1;
|
|
1886
1926
|
setCurrentSearchResultIndex(nextIndex);
|
|
1887
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1927
|
+
_optionalChain([pdfViewerRef, 'access', _333 => _333.current, 'optionalAccess', _334 => _334.search, 'access', _335 => _335.nextResult, 'call', _336 => _336()]);
|
|
1888
1928
|
if (searchResults[nextIndex]) {
|
|
1889
1929
|
const pageNumber = searchResults[nextIndex].pageNumber;
|
|
1890
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1930
|
+
_optionalChain([pdfViewerRef, 'access', _337 => _337.current, 'optionalAccess', _338 => _338.navigation, 'access', _339 => _339.goToPage, 'call', _340 => _340(pageNumber)]);
|
|
1891
1931
|
setCurrentPage(pageNumber);
|
|
1892
1932
|
}
|
|
1893
1933
|
}
|
|
@@ -1896,10 +1936,10 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1896
1936
|
if (currentSearchResultIndex > 0) {
|
|
1897
1937
|
const prevIndex = currentSearchResultIndex - 1;
|
|
1898
1938
|
setCurrentSearchResultIndex(prevIndex);
|
|
1899
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1939
|
+
_optionalChain([pdfViewerRef, 'access', _341 => _341.current, 'optionalAccess', _342 => _342.search, 'access', _343 => _343.previousResult, 'call', _344 => _344()]);
|
|
1900
1940
|
if (searchResults[prevIndex]) {
|
|
1901
1941
|
const pageNumber = searchResults[prevIndex].pageNumber;
|
|
1902
|
-
_optionalChain([pdfViewerRef, 'access',
|
|
1942
|
+
_optionalChain([pdfViewerRef, 'access', _345 => _345.current, 'optionalAccess', _346 => _346.navigation, 'access', _347 => _347.goToPage, 'call', _348 => _348(pageNumber)]);
|
|
1903
1943
|
setCurrentPage(pageNumber);
|
|
1904
1944
|
}
|
|
1905
1945
|
}
|
|
@@ -1930,12 +1970,12 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1930
1970
|
}
|
|
1931
1971
|
setPdfBuffer(arrayBuffer);
|
|
1932
1972
|
setState("ready");
|
|
1933
|
-
_optionalChain([onLoad, 'optionalCall',
|
|
1973
|
+
_optionalChain([onLoad, 'optionalCall', _349 => _349()]);
|
|
1934
1974
|
} catch (err) {
|
|
1935
1975
|
const errorMessage = err.message || "Failed to load PDF";
|
|
1936
1976
|
setState("error");
|
|
1937
1977
|
setError(errorMessage);
|
|
1938
|
-
_optionalChain([onError, 'optionalCall',
|
|
1978
|
+
_optionalChain([onError, 'optionalCall', _350 => _350(err)]);
|
|
1939
1979
|
}
|
|
1940
1980
|
};
|
|
1941
1981
|
loadPDF();
|
|
@@ -1973,44 +2013,31 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
1973
2013
|
setPasswordError("");
|
|
1974
2014
|
}
|
|
1975
2015
|
}, [passwordResolve]);
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
}
|
|
2002
|
-
),
|
|
2003
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: "Loading PDF..." }),
|
|
2004
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: `
|
|
2005
|
-
@keyframes spin {
|
|
2006
|
-
0% { transform: rotate(0deg); }
|
|
2007
|
-
100% { transform: rotate(360deg); }
|
|
2008
|
-
}
|
|
2009
|
-
` })
|
|
2010
|
-
]
|
|
2011
|
-
}
|
|
2012
|
-
);
|
|
2013
|
-
}
|
|
2016
|
+
const LoadingSpinner = ({ fileName: fileName2 }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: {
|
|
2017
|
+
position: "absolute",
|
|
2018
|
+
inset: 0,
|
|
2019
|
+
zIndex: 50,
|
|
2020
|
+
backgroundColor: "#fff",
|
|
2021
|
+
display: "flex",
|
|
2022
|
+
flexDirection: "column",
|
|
2023
|
+
alignItems: "center",
|
|
2024
|
+
justifyContent: "center"
|
|
2025
|
+
}, children: [
|
|
2026
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "dms-loading-spinner", style: {
|
|
2027
|
+
width: "40px",
|
|
2028
|
+
height: "40px",
|
|
2029
|
+
border: "3px solid #f3f3f3",
|
|
2030
|
+
borderTop: "3px solid #3498db",
|
|
2031
|
+
borderRadius: "50%",
|
|
2032
|
+
animation: "spin 1s linear infinite"
|
|
2033
|
+
} }),
|
|
2034
|
+
fileName2 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { style: { marginTop: "16px", color: "#666", fontSize: "14px" }, children: [
|
|
2035
|
+
"Loading ",
|
|
2036
|
+
fileName2,
|
|
2037
|
+
"..."
|
|
2038
|
+
] }),
|
|
2039
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: `@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }` })
|
|
2040
|
+
] });
|
|
2014
2041
|
if (state === "error" || error) {
|
|
2015
2042
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2016
2043
|
"div",
|
|
@@ -2042,135 +2069,130 @@ var PDFViewerContent = _react.forwardRef.call(void 0,
|
|
|
2042
2069
|
}
|
|
2043
2070
|
);
|
|
2044
2071
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
{
|
|
2049
|
-
style: {
|
|
2050
|
-
display: "flex",
|
|
2051
|
-
alignItems: "center",
|
|
2052
|
-
justifyContent: "center",
|
|
2053
|
-
height: "100%"
|
|
2054
|
-
},
|
|
2055
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: "Preparing PDF..." })
|
|
2056
|
-
}
|
|
2057
|
-
);
|
|
2058
|
-
}
|
|
2059
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: containerRef, className: "pdf-viewer-container", children: [
|
|
2072
|
+
const isReady = pdfBuffer && state === "ready";
|
|
2073
|
+
const showOverlay = loading || !isReady || !isInternalReady;
|
|
2074
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: containerRef, className: "pdf-viewer-container", style: { position: "relative", height: "100%", width: "100%" }, children: [
|
|
2060
2075
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: _chunk5ECHDPQZjs.toolbarStyles }),
|
|
2061
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2062
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
totalPages,
|
|
2067
|
-
zoom,
|
|
2068
|
-
isSidebarOpen,
|
|
2069
|
-
showPageNavigation,
|
|
2070
|
-
showPageCount,
|
|
2071
|
-
showZoomControls,
|
|
2072
|
-
showSearch,
|
|
2073
|
-
showRotation: !toolbar.isHidden("rotation"),
|
|
2074
|
-
showMetadata: !toolbar.isHidden("metadata"),
|
|
2075
|
-
showProperties: !toolbar.isHidden("properties"),
|
|
2076
|
-
showDownload: !toolbar.isHidden("download"),
|
|
2077
|
-
showPrint: !toolbar.isHidden("print"),
|
|
2078
|
-
showTags: !toolbar.isHidden("tags"),
|
|
2079
|
-
showHistory: !toolbar.isHidden("history"),
|
|
2080
|
-
disabledRotateLeft: toolbar.isDisabled("rotateLeft"),
|
|
2081
|
-
disabledRotateRight: false,
|
|
2082
|
-
disabledMetadata: toolbar.isDisabled("metadata"),
|
|
2083
|
-
disabledTags: toolbar.isDisabled("tags"),
|
|
2084
|
-
disabledProperties: toolbar.isDisabled("properties"),
|
|
2085
|
-
disabledHistory: toolbar.isDisabled("history"),
|
|
2086
|
-
disabledDownload: toolbar.isDisabled("download"),
|
|
2087
|
-
disabledPrint: toolbar.isDisabled("print"),
|
|
2088
|
-
onFirstPage: toolbarHandlers.handleFirstPage,
|
|
2089
|
-
onPreviousPage: toolbarHandlers.handlePreviousPage,
|
|
2090
|
-
onNextPage: toolbarHandlers.handleNextPage,
|
|
2091
|
-
onLastPage: toolbarHandlers.handleLastPage,
|
|
2092
|
-
onPageInput: toolbarHandlers.handlePageInput,
|
|
2093
|
-
onPageInputKeyPress: toolbarHandlers.handlePageInputKeyPress,
|
|
2094
|
-
onZoomIn: toolbarHandlers.handleZoomIn,
|
|
2095
|
-
onZoomOut: toolbarHandlers.handleZoomOut,
|
|
2096
|
-
onFitToWidth: toolbarHandlers.handleFitToWidth,
|
|
2097
|
-
onFitToPage: toolbarHandlers.handleFitToPage,
|
|
2098
|
-
onToggleSidebar: toolbarHandlers.toggleSidebar,
|
|
2099
|
-
onToggleFullScreen: toolbarHandlers.handleToggleFullScreen,
|
|
2100
|
-
onRotateLeft: toolbarHandlers.handleRotateLeft,
|
|
2101
|
-
onRotateRight: toolbarHandlers.handleRotateRight,
|
|
2102
|
-
onDownloadClick: toolbar.getHandler("download", onDownloadClick),
|
|
2103
|
-
onPrintClick: toolbar.getHandler("print", onPrintClick || toolbarHandlers.handlePrint),
|
|
2104
|
-
onPrintWithAnnotations: toolbarHandlers.handlePrintWithAnnotations,
|
|
2105
|
-
onPrintWithoutAnnotations: toolbarHandlers.handlePrintWithoutAnnotations,
|
|
2106
|
-
onMetadataClick: toolbar.getHandler("metadata", onMetadataClick),
|
|
2107
|
-
onPropertiesClick: toolbar.getHandler(
|
|
2108
|
-
"properties",
|
|
2109
|
-
onPropertiesClick
|
|
2110
|
-
),
|
|
2111
|
-
onTagsClick: toolbar.getHandler("tags", onTagsClick),
|
|
2112
|
-
onHistoryClick: toolbar.getHandler("history", onHistoryClick),
|
|
2113
|
-
showAnnotations,
|
|
2114
|
-
isHighlighterActive: highlighterActive,
|
|
2115
|
-
isStampActive: stampActive,
|
|
2116
|
-
disabledHighlighter: toolbar.isDisabled("highlighter"),
|
|
2117
|
-
disabledStamp: toolbar.isDisabled("stamp"),
|
|
2118
|
-
disabledSignature: toolbar.isDisabled("signature"),
|
|
2119
|
-
onHighlighterClick: toolbar.getHandler("highlighter", onHighlighterClick || toolbarHandlers.handleHighlighterClick),
|
|
2120
|
-
onStampClick: toolbar.getHandler("stamp", onStampClick || toolbarHandlers.handleStampClick),
|
|
2121
|
-
onSignatureClick: toolbar.getHandler("signature", onSignatureClick || toolbarHandlers.handleSignatureClick),
|
|
2122
|
-
hasUnsavedAnnotations,
|
|
2123
|
-
isSavingAnnotations,
|
|
2124
|
-
canSaveAnnotations,
|
|
2125
|
-
onSaveAnnotations
|
|
2126
|
-
}
|
|
2127
|
-
),
|
|
2128
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "pdf-viewer-main", children: [
|
|
2129
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pdf-viewer-viewer-area", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2130
|
-
StablePDFViewer,
|
|
2076
|
+
showOverlay && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LoadingSpinner, { fileName: resolvedFileName }),
|
|
2077
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { opacity: !showOverlay ? 1 : 0, height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
2078
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PDFHeader, { fileName: resolvedFileName, fileExtension }),
|
|
2079
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2080
|
+
PDFToolbar,
|
|
2131
2081
|
{
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2082
|
+
currentPage,
|
|
2083
|
+
totalPages,
|
|
2084
|
+
zoom,
|
|
2085
|
+
isSidebarOpen,
|
|
2086
|
+
showPageNavigation,
|
|
2087
|
+
showPageCount,
|
|
2088
|
+
showZoomControls,
|
|
2089
|
+
showSearch,
|
|
2090
|
+
showRotation: !toolbar.isHidden("rotation"),
|
|
2091
|
+
showMetadata: !toolbar.isHidden("metadata"),
|
|
2092
|
+
showProperties: !toolbar.isHidden("properties"),
|
|
2093
|
+
showDownload: !toolbar.isHidden("download"),
|
|
2094
|
+
showPrint: !toolbar.isHidden("print"),
|
|
2095
|
+
showTags: !toolbar.isHidden("tags"),
|
|
2096
|
+
showHistory: !toolbar.isHidden("history"),
|
|
2097
|
+
disabledRotateLeft: toolbar.isDisabled("rotateLeft"),
|
|
2098
|
+
disabledRotateRight: false,
|
|
2099
|
+
disabledMetadata: toolbar.isDisabled("metadata"),
|
|
2100
|
+
disabledTags: toolbar.isDisabled("tags"),
|
|
2101
|
+
disabledProperties: toolbar.isDisabled("properties"),
|
|
2102
|
+
disabledHistory: toolbar.isDisabled("history"),
|
|
2103
|
+
disabledDownload: toolbar.isDisabled("download"),
|
|
2104
|
+
disabledPrint: toolbar.isDisabled("print"),
|
|
2105
|
+
onFirstPage: toolbarHandlers.handleFirstPage,
|
|
2106
|
+
onPreviousPage: toolbarHandlers.handlePreviousPage,
|
|
2107
|
+
onNextPage: toolbarHandlers.handleNextPage,
|
|
2108
|
+
onLastPage: toolbarHandlers.handleLastPage,
|
|
2109
|
+
onPageInput: toolbarHandlers.handlePageInput,
|
|
2110
|
+
onPageInputKeyPress: toolbarHandlers.handlePageInputKeyPress,
|
|
2111
|
+
onZoomIn: toolbarHandlers.handleZoomIn,
|
|
2112
|
+
onZoomOut: toolbarHandlers.handleZoomOut,
|
|
2113
|
+
onFitToWidth: toolbarHandlers.handleFitToWidth,
|
|
2114
|
+
onFitToPage: toolbarHandlers.handleFitToPage,
|
|
2115
|
+
onToggleSidebar: toolbarHandlers.toggleSidebar,
|
|
2116
|
+
onToggleFullScreen: toolbarHandlers.handleToggleFullScreen,
|
|
2117
|
+
onRotateLeft: toolbarHandlers.handleRotateLeft,
|
|
2118
|
+
onRotateRight: toolbarHandlers.handleRotateRight,
|
|
2119
|
+
onDownloadClick: toolbar.getHandler("download", onDownloadClick),
|
|
2120
|
+
onDownloadWithAnnotations: toolbarHandlers.handleDownloadWithAnnotations,
|
|
2121
|
+
onDownloadWithoutAnnotations: toolbarHandlers.handleDownloadWithoutAnnotations,
|
|
2122
|
+
onPrintClick: toolbar.getHandler("print", onPrintClick || toolbarHandlers.handlePrint),
|
|
2123
|
+
onPrintWithAnnotations: toolbarHandlers.handlePrintWithAnnotations,
|
|
2124
|
+
onPrintWithoutAnnotations: toolbarHandlers.handlePrintWithoutAnnotations,
|
|
2125
|
+
onCopyClick: toolbarHandlers.handleCopy,
|
|
2126
|
+
onMetadataClick: toolbar.getHandler("metadata", onMetadataClick),
|
|
2127
|
+
onPropertiesClick: toolbar.getHandler(
|
|
2128
|
+
"properties",
|
|
2129
|
+
onPropertiesClick
|
|
2130
|
+
),
|
|
2131
|
+
onTagsClick: toolbar.getHandler("tags", onTagsClick),
|
|
2132
|
+
onHistoryClick: toolbar.getHandler("history", onHistoryClick),
|
|
2135
2133
|
showAnnotations,
|
|
2136
|
-
userDetails,
|
|
2137
|
-
annotationSelectionMenu,
|
|
2138
2134
|
isHighlighterActive: highlighterActive,
|
|
2139
2135
|
isStampActive: stampActive,
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2136
|
+
disabledHighlighter: toolbar.isDisabled("highlighter"),
|
|
2137
|
+
disabledStamp: toolbar.isDisabled("stamp"),
|
|
2138
|
+
disabledSignature: toolbar.isDisabled("signature"),
|
|
2139
|
+
onHighlighterClick: toolbar.getHandler("highlighter", onHighlighterClick || toolbarHandlers.handleHighlighterClick),
|
|
2140
|
+
onStampClick: toolbar.getHandler("stamp", onStampClick || toolbarHandlers.handleStampClick),
|
|
2141
|
+
onSignatureClick: toolbar.getHandler("signature", onSignatureClick || toolbarHandlers.handleSignatureClick),
|
|
2142
|
+
hasUnsavedAnnotations,
|
|
2143
|
+
isSavingAnnotations,
|
|
2144
|
+
canSaveAnnotations,
|
|
2145
|
+
onSaveAnnotations
|
|
2144
2146
|
}
|
|
2145
|
-
)
|
|
2147
|
+
),
|
|
2148
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "pdf-viewer-main", children: [
|
|
2149
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pdf-viewer-viewer-area", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2150
|
+
StablePDFViewer,
|
|
2151
|
+
{
|
|
2152
|
+
pdfBuffer: pdfBuffer || new ArrayBuffer(0),
|
|
2153
|
+
onPasswordRequest: handlePasswordRequest,
|
|
2154
|
+
pdfViewerRef,
|
|
2155
|
+
hideInternalLoading: true,
|
|
2156
|
+
showAnnotations,
|
|
2157
|
+
userDetails,
|
|
2158
|
+
annotationSelectionMenu,
|
|
2159
|
+
isHighlighterActive: highlighterActive,
|
|
2160
|
+
isStampActive: stampActive,
|
|
2161
|
+
onHighlighterClick: onHighlighterClick || toolbarHandlers.handleHighlighterClick,
|
|
2162
|
+
onStampClick: onStampClick || toolbarHandlers.handleStampClick,
|
|
2163
|
+
onSignatureClick: onSignatureClick || toolbarHandlers.handleSignatureClick,
|
|
2164
|
+
permissions: props.permissions
|
|
2165
|
+
}
|
|
2166
|
+
) }),
|
|
2167
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2168
|
+
SearchSidebar,
|
|
2169
|
+
{
|
|
2170
|
+
isOpen: isSidebarOpen,
|
|
2171
|
+
onClose: handleSidebarClose,
|
|
2172
|
+
onSearch: handleSidebarSearch,
|
|
2173
|
+
onSearchResultClick: handleSearchResultClick,
|
|
2174
|
+
onNextResult: handleNextSearchResult,
|
|
2175
|
+
onPreviousResult: handlePreviousSearchResult,
|
|
2176
|
+
currentResultIndex: currentSearchResultIndex,
|
|
2177
|
+
totalResults: totalSearchResults,
|
|
2178
|
+
searchKeyword: searchQuery,
|
|
2179
|
+
searchResults,
|
|
2180
|
+
isSearching
|
|
2181
|
+
}
|
|
2182
|
+
)
|
|
2183
|
+
] }),
|
|
2146
2184
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2147
|
-
|
|
2185
|
+
PasswordDialog,
|
|
2148
2186
|
{
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
currentResultIndex: currentSearchResultIndex,
|
|
2156
|
-
totalResults: totalSearchResults,
|
|
2157
|
-
searchKeyword: searchQuery,
|
|
2158
|
-
searchResults,
|
|
2159
|
-
isSearching
|
|
2187
|
+
open: isPasswordDialogOpen,
|
|
2188
|
+
fileName: resolvedFileName,
|
|
2189
|
+
onSubmit: handlePasswordSubmit,
|
|
2190
|
+
onCancel: handlePasswordCancel,
|
|
2191
|
+
error: passwordError,
|
|
2192
|
+
isLoading: isVerifyingPassword
|
|
2160
2193
|
}
|
|
2161
2194
|
)
|
|
2162
|
-
] })
|
|
2163
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2164
|
-
PasswordDialog,
|
|
2165
|
-
{
|
|
2166
|
-
open: isPasswordDialogOpen,
|
|
2167
|
-
fileName: resolvedFileName,
|
|
2168
|
-
onSubmit: handlePasswordSubmit,
|
|
2169
|
-
onCancel: handlePasswordCancel,
|
|
2170
|
-
error: passwordError,
|
|
2171
|
-
isLoading: isVerifyingPassword
|
|
2172
|
-
}
|
|
2173
|
-
)
|
|
2195
|
+
] })
|
|
2174
2196
|
] });
|
|
2175
2197
|
}
|
|
2176
2198
|
);
|
|
@@ -2185,4 +2207,4 @@ PDFViewer.displayName = "PDFViewer";
|
|
|
2185
2207
|
|
|
2186
2208
|
|
|
2187
2209
|
exports.PDFViewer = PDFViewer;
|
|
2188
|
-
//# sourceMappingURL=chunk-
|
|
2210
|
+
//# sourceMappingURL=chunk-BYCREULH.js.map
|