@cannymindstech/file-viewers 0.27.12 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7P6WEBHN.js → chunk-4HVU224A.js} +637 -482
- package/dist/chunk-4HVU224A.js.map +1 -0
- package/dist/{chunk-PZGUVU6N.mjs → chunk-6L72TJIW.mjs} +545 -390
- package/dist/chunk-6L72TJIW.mjs.map +1 -0
- package/dist/{chunk-KQCU7XW2.mjs → chunk-KWHXS7I4.mjs} +192 -1
- package/dist/chunk-KWHXS7I4.mjs.map +1 -0
- package/dist/{chunk-QV63FULE.js → chunk-NELCZBZV.js} +7 -6
- package/dist/chunk-NELCZBZV.js.map +1 -0
- package/dist/{chunk-ECZ6IBOS.js → chunk-S5KXYKBX.js} +192 -1
- package/dist/chunk-S5KXYKBX.js.map +1 -0
- package/dist/{chunk-7JPF5AYR.mjs → chunk-W2P6JHTQ.mjs} +5 -4
- package/dist/chunk-W2P6JHTQ.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/ImageViewer.js +3 -3
- package/dist/components/viewers/ImageViewer.mjs +2 -2
- package/dist/components/viewers/PDFViewer.d.mts +1 -1
- package/dist/components/viewers/PDFViewer.d.ts +1 -1
- package/dist/components/viewers/PDFViewer.js +3 -3
- package/dist/components/viewers/PDFViewer.mjs +2 -2
- 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 +4 -4
- package/dist/index.mjs +3 -3
- package/dist/{types-BYTxtKEc.d.mts → types-DMF9gANJ.d.mts} +1 -0
- package/dist/{types-BYTxtKEc.d.ts → types-DMF9gANJ.d.ts} +1 -0
- package/package.json +4 -3
- package/dist/chunk-7JPF5AYR.mjs.map +0 -1
- package/dist/chunk-7P6WEBHN.js.map +0 -1
- package/dist/chunk-ECZ6IBOS.js.map +0 -1
- package/dist/chunk-KQCU7XW2.mjs.map +0 -1
- package/dist/chunk-PZGUVU6N.mjs.map +0 -1
- package/dist/chunk-QV63FULE.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
toolbarStyles
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KWHXS7I4.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getFileExtension
|
|
7
7
|
} from "./chunk-KJNOBIUZ.mjs";
|
|
@@ -43,7 +43,9 @@ var StablePDFViewer = React.memo(({
|
|
|
43
43
|
hideInternalLoading,
|
|
44
44
|
isAnnotationForeign,
|
|
45
45
|
onAnnotationNoteClick,
|
|
46
|
-
isAnnotationInteractive
|
|
46
|
+
isAnnotationInteractive,
|
|
47
|
+
twoPageMode,
|
|
48
|
+
scrollStrategy
|
|
47
49
|
}) => {
|
|
48
50
|
return /* @__PURE__ */ jsx(
|
|
49
51
|
HeadlessPDFViewer,
|
|
@@ -64,7 +66,9 @@ var StablePDFViewer = React.memo(({
|
|
|
64
66
|
hideInternalLoading,
|
|
65
67
|
isAnnotationForeign,
|
|
66
68
|
onAnnotationNoteClick,
|
|
67
|
-
isAnnotationInteractive
|
|
69
|
+
isAnnotationInteractive,
|
|
70
|
+
twoPageMode,
|
|
71
|
+
scrollStrategy
|
|
68
72
|
}
|
|
69
73
|
);
|
|
70
74
|
});
|
|
@@ -98,8 +102,12 @@ import ApprovalIcon from "@mui/icons-material/Approval";
|
|
|
98
102
|
import StickyNote2Icon from "@mui/icons-material/StickyNote2";
|
|
99
103
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
100
104
|
import PortraitIcon from "@mui/icons-material/Portrait";
|
|
105
|
+
import MenuBookIcon from "@mui/icons-material/MenuBook";
|
|
106
|
+
import VerticalSplitIcon from "@mui/icons-material/VerticalSplit";
|
|
101
107
|
import SwapVertIcon from "@mui/icons-material/SwapVert";
|
|
108
|
+
import SwapHorizIcon from "@mui/icons-material/SwapHoriz";
|
|
102
109
|
import AutoFixHighIcon from "@mui/icons-material/AutoFixHigh";
|
|
110
|
+
import { ScrollStrategy } from "@cannymindstech/pdf-viewer";
|
|
103
111
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
104
112
|
var PDFToolbar = React2.memo(
|
|
105
113
|
({
|
|
@@ -119,6 +127,13 @@ var PDFToolbar = React2.memo(
|
|
|
119
127
|
showPrint,
|
|
120
128
|
showRotation,
|
|
121
129
|
showAnnotations,
|
|
130
|
+
// Layout and Sidebar controls
|
|
131
|
+
twoPageMode = false,
|
|
132
|
+
onTwoPageModeChange,
|
|
133
|
+
scrollStrategy = ScrollStrategy.Vertical,
|
|
134
|
+
onScrollStrategyChange,
|
|
135
|
+
showThumbnails = false,
|
|
136
|
+
onToggleThumbnails,
|
|
122
137
|
// Destructure new props with defaults
|
|
123
138
|
showAnnotate = true,
|
|
124
139
|
disabledAnnotate = false,
|
|
@@ -174,7 +189,10 @@ var PDFToolbar = React2.memo(
|
|
|
174
189
|
hasUnsavedAnnotations,
|
|
175
190
|
isSavingAnnotations,
|
|
176
191
|
canSaveAnnotations,
|
|
177
|
-
onSaveAnnotations
|
|
192
|
+
onSaveAnnotations,
|
|
193
|
+
// Toolbar mode state
|
|
194
|
+
activeMode = "view",
|
|
195
|
+
onActiveModeChange
|
|
178
196
|
}) => {
|
|
179
197
|
const [isPrintMenuOpen, setIsPrintMenuOpen] = useState(false);
|
|
180
198
|
const [isDownloadMenuOpen, setIsDownloadMenuOpen] = useState(false);
|
|
@@ -218,430 +236,508 @@ var PDFToolbar = React2.memo(
|
|
|
218
236
|
setIsDownloadMenuOpen(false);
|
|
219
237
|
onDownloadWithoutAnnotations?.();
|
|
220
238
|
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
239
|
+
return /* @__PURE__ */ jsx2("div", { className: "pdf-viewer-toolbar-container", children: /* @__PURE__ */ jsxs("div", { className: "pdf-viewer-toolbar", children: [
|
|
240
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-left", children: [
|
|
241
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Toggle Page Previews", children: /* @__PURE__ */ jsx2(
|
|
242
|
+
"button",
|
|
243
|
+
{
|
|
244
|
+
className: `toolbar-button ${showThumbnails ? "toolbar-button-active" : ""}`,
|
|
245
|
+
onClick: onToggleThumbnails,
|
|
246
|
+
style: { marginRight: "8px" },
|
|
247
|
+
children: /* @__PURE__ */ jsx2(VerticalSplitIcon, { fontSize: "small" })
|
|
248
|
+
}
|
|
249
|
+
) }),
|
|
250
|
+
showPageNavigation && /* @__PURE__ */ jsxs("div", { className: "toolbar-section", children: [
|
|
251
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "First Page", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
252
|
+
"button",
|
|
253
|
+
{
|
|
254
|
+
className: "toolbar-button",
|
|
255
|
+
onClick: onFirstPage,
|
|
256
|
+
disabled: currentPage <= 1,
|
|
257
|
+
children: /* @__PURE__ */ jsx2(FirstPageIcon, { fontSize: "small" })
|
|
258
|
+
}
|
|
259
|
+
) }) }),
|
|
260
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Previous Page", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
261
|
+
"button",
|
|
262
|
+
{
|
|
263
|
+
className: "toolbar-button",
|
|
264
|
+
onClick: onPreviousPage,
|
|
265
|
+
disabled: currentPage <= 1,
|
|
266
|
+
children: /* @__PURE__ */ jsx2(ChevronLeftIcon, { fontSize: "small" })
|
|
267
|
+
}
|
|
268
|
+
) }) }),
|
|
269
|
+
/* @__PURE__ */ jsxs("span", { className: "page-info", style: { display: "flex", alignItems: "center", margin: "0 8px", fontSize: "14px", fontWeight: 500 }, children: [
|
|
270
|
+
currentPage,
|
|
271
|
+
" ",
|
|
272
|
+
showPageCount && /* @__PURE__ */ jsxs("span", { style: { color: "#6b7280", marginLeft: "4px" }, children: [
|
|
273
|
+
"/ ",
|
|
274
|
+
totalPages || "..."
|
|
275
|
+
] })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Next Page", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
278
|
+
"button",
|
|
279
|
+
{
|
|
280
|
+
className: "toolbar-button",
|
|
281
|
+
onClick: onNextPage,
|
|
282
|
+
disabled: currentPage >= totalPages,
|
|
283
|
+
children: /* @__PURE__ */ jsx2(ChevronRightIcon, { fontSize: "small" })
|
|
284
|
+
}
|
|
285
|
+
) }) }),
|
|
286
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Last Page", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
287
|
+
"button",
|
|
288
|
+
{
|
|
289
|
+
className: "toolbar-button",
|
|
290
|
+
onClick: onLastPage,
|
|
291
|
+
disabled: currentPage >= totalPages,
|
|
292
|
+
children: /* @__PURE__ */ jsx2(LastPageIcon, { fontSize: "small" })
|
|
293
|
+
}
|
|
294
|
+
) }) })
|
|
295
|
+
] }),
|
|
296
|
+
showZoomControls && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
297
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
298
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-section", children: [
|
|
299
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Zoom Out", children: /* @__PURE__ */ jsx2(
|
|
236
300
|
"button",
|
|
237
301
|
{
|
|
238
302
|
className: "toolbar-button",
|
|
239
|
-
onClick:
|
|
240
|
-
|
|
241
|
-
children: /* @__PURE__ */ jsx2(ChevronLeftIcon, { fontSize: "small" })
|
|
303
|
+
onClick: onZoomOut,
|
|
304
|
+
children: /* @__PURE__ */ jsx2(RemoveIcon, { fontSize: "small" })
|
|
242
305
|
}
|
|
243
|
-
) })
|
|
244
|
-
/* @__PURE__ */ jsxs("span", { className: "
|
|
245
|
-
|
|
246
|
-
"
|
|
247
|
-
showPageCount && /* @__PURE__ */ jsxs("span", { style: { color: "#6b7280", marginLeft: "4px" }, children: [
|
|
248
|
-
"/ ",
|
|
249
|
-
totalPages || "..."
|
|
250
|
-
] })
|
|
306
|
+
) }),
|
|
307
|
+
/* @__PURE__ */ jsxs("span", { className: "zoom-display", children: [
|
|
308
|
+
zoom,
|
|
309
|
+
"%"
|
|
251
310
|
] }),
|
|
252
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "
|
|
311
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Zoom In", children: /* @__PURE__ */ jsx2(
|
|
253
312
|
"button",
|
|
254
313
|
{
|
|
255
314
|
className: "toolbar-button",
|
|
256
|
-
onClick:
|
|
257
|
-
|
|
258
|
-
children: /* @__PURE__ */ jsx2(ChevronRightIcon, { fontSize: "small" })
|
|
315
|
+
onClick: onZoomIn,
|
|
316
|
+
children: /* @__PURE__ */ jsx2(AddIcon, { fontSize: "small" })
|
|
259
317
|
}
|
|
260
|
-
) })
|
|
261
|
-
|
|
318
|
+
) })
|
|
319
|
+
] })
|
|
320
|
+
] }),
|
|
321
|
+
(showZoomControls || showRotation) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
322
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
323
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-section", children: /* @__PURE__ */ jsxs("div", { className: "toolbar-dropdown-container", ref: viewMenuRef, children: [
|
|
324
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "View Options", children: /* @__PURE__ */ jsxs(
|
|
262
325
|
"button",
|
|
263
326
|
{
|
|
264
|
-
className: "toolbar-button"
|
|
265
|
-
onClick:
|
|
266
|
-
|
|
267
|
-
|
|
327
|
+
className: `toolbar-button toolbar-dropdown-button ${isViewMenuOpen ? "toolbar-button-active" : ""}`,
|
|
328
|
+
onClick: () => setIsViewMenuOpen(!isViewMenuOpen),
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsx2(TuneIcon, { fontSize: "small" }),
|
|
331
|
+
/* @__PURE__ */ jsx2(KeyboardArrowDownIcon, { fontSize: "small", style: { marginLeft: -4 } })
|
|
332
|
+
]
|
|
268
333
|
}
|
|
269
|
-
) })
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-section", children: [
|
|
274
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Zoom Out", children: /* @__PURE__ */ jsx2(
|
|
334
|
+
) }),
|
|
335
|
+
isViewMenuOpen && /* @__PURE__ */ jsxs("div", { className: "toolbar-dropdown-menu", style: { width: "240px" }, children: [
|
|
336
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-header", children: "SPREAD MODE" }),
|
|
337
|
+
/* @__PURE__ */ jsxs(
|
|
275
338
|
"button",
|
|
276
339
|
{
|
|
277
|
-
className: "toolbar-
|
|
278
|
-
onClick:
|
|
279
|
-
|
|
340
|
+
className: `toolbar-dropdown-item ${!twoPageMode ? "toolbar-dropdown-item-active" : ""}`,
|
|
341
|
+
onClick: () => {
|
|
342
|
+
setIsViewMenuOpen(false);
|
|
343
|
+
onTwoPageModeChange?.(false);
|
|
344
|
+
},
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ jsx2(PortraitIcon, { fontSize: "small" }),
|
|
347
|
+
/* @__PURE__ */ jsx2("span", { children: "Single Page" })
|
|
348
|
+
]
|
|
280
349
|
}
|
|
281
|
-
)
|
|
282
|
-
/* @__PURE__ */ jsxs(
|
|
283
|
-
zoom,
|
|
284
|
-
"%"
|
|
285
|
-
] }),
|
|
286
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Zoom In", children: /* @__PURE__ */ jsx2(
|
|
350
|
+
),
|
|
351
|
+
/* @__PURE__ */ jsxs(
|
|
287
352
|
"button",
|
|
288
353
|
{
|
|
289
|
-
className: "toolbar-
|
|
290
|
-
onClick:
|
|
291
|
-
|
|
354
|
+
className: `toolbar-dropdown-item ${twoPageMode ? "toolbar-dropdown-item-active" : ""}`,
|
|
355
|
+
onClick: () => {
|
|
356
|
+
setIsViewMenuOpen(false);
|
|
357
|
+
onTwoPageModeChange?.(true);
|
|
358
|
+
},
|
|
359
|
+
children: [
|
|
360
|
+
/* @__PURE__ */ jsx2(MenuBookIcon, { fontSize: "small" }),
|
|
361
|
+
/* @__PURE__ */ jsx2("span", { children: "Two-Page Spread" })
|
|
362
|
+
]
|
|
292
363
|
}
|
|
293
|
-
)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
298
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-section", children: /* @__PURE__ */ jsxs("div", { className: "toolbar-dropdown-container", ref: viewMenuRef, children: [
|
|
299
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "View Options", children: /* @__PURE__ */ jsxs(
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-divider" }),
|
|
366
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-header", children: "SCROLL LAYOUT" }),
|
|
367
|
+
/* @__PURE__ */ jsxs(
|
|
300
368
|
"button",
|
|
301
369
|
{
|
|
302
|
-
className: `toolbar-
|
|
303
|
-
onClick: () =>
|
|
370
|
+
className: `toolbar-dropdown-item ${scrollStrategy !== ScrollStrategy.Horizontal ? "toolbar-dropdown-item-active" : ""}`,
|
|
371
|
+
onClick: () => {
|
|
372
|
+
setIsViewMenuOpen(false);
|
|
373
|
+
onScrollStrategyChange?.(ScrollStrategy.Vertical);
|
|
374
|
+
},
|
|
304
375
|
children: [
|
|
305
|
-
/* @__PURE__ */ jsx2(
|
|
306
|
-
/* @__PURE__ */ jsx2(
|
|
376
|
+
/* @__PURE__ */ jsx2(SwapVertIcon, { fontSize: "small" }),
|
|
377
|
+
/* @__PURE__ */ jsx2("span", { children: "Vertical Scroll" })
|
|
307
378
|
]
|
|
308
379
|
}
|
|
309
|
-
)
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
/* @__PURE__ */ jsx2("
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
{
|
|
343
|
-
className: "toolbar-dropdown-item",
|
|
344
|
-
onClick: () => {
|
|
345
|
-
setIsViewMenuOpen(false);
|
|
346
|
-
onRotateRight?.();
|
|
347
|
-
},
|
|
348
|
-
disabled: false,
|
|
349
|
-
children: [
|
|
350
|
-
/* @__PURE__ */ jsx2(RotateRightIcon, { fontSize: "small" }),
|
|
351
|
-
/* @__PURE__ */ jsx2("span", { children: "Rotate Clockwise" })
|
|
352
|
-
]
|
|
353
|
-
}
|
|
354
|
-
),
|
|
355
|
-
/* @__PURE__ */ jsxs(
|
|
356
|
-
"button",
|
|
357
|
-
{
|
|
358
|
-
className: "toolbar-dropdown-item",
|
|
359
|
-
onClick: () => {
|
|
360
|
-
setIsViewMenuOpen(false);
|
|
361
|
-
onRotateLeft?.();
|
|
362
|
-
},
|
|
363
|
-
disabled: disabledRotateLeft,
|
|
364
|
-
children: [
|
|
365
|
-
/* @__PURE__ */ jsx2(RotateLeftIcon, { fontSize: "small" }),
|
|
366
|
-
/* @__PURE__ */ jsx2("span", { children: "Rotate Counter-Clockwise" })
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
)
|
|
370
|
-
] }),
|
|
371
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-divider" }),
|
|
380
|
+
),
|
|
381
|
+
/* @__PURE__ */ jsxs(
|
|
382
|
+
"button",
|
|
383
|
+
{
|
|
384
|
+
className: `toolbar-dropdown-item ${scrollStrategy === ScrollStrategy.Horizontal ? "toolbar-dropdown-item-active" : ""}`,
|
|
385
|
+
onClick: () => {
|
|
386
|
+
setIsViewMenuOpen(false);
|
|
387
|
+
onScrollStrategyChange?.(ScrollStrategy.Horizontal);
|
|
388
|
+
},
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ jsx2(SwapHorizIcon, { fontSize: "small" }),
|
|
391
|
+
/* @__PURE__ */ jsx2("span", { children: "Horizontal Scroll" })
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-divider" }),
|
|
396
|
+
/* @__PURE__ */ jsxs("button", { className: "toolbar-dropdown-item", onClick: () => {
|
|
397
|
+
setIsViewMenuOpen(false);
|
|
398
|
+
onFitToWidth?.();
|
|
399
|
+
}, children: [
|
|
400
|
+
/* @__PURE__ */ jsx2(AspectRatioIcon, { fontSize: "small" }),
|
|
401
|
+
/* @__PURE__ */ jsx2("span", { children: "Fit to Width" })
|
|
402
|
+
] }),
|
|
403
|
+
/* @__PURE__ */ jsxs("button", { className: "toolbar-dropdown-item", onClick: () => {
|
|
404
|
+
setIsViewMenuOpen(false);
|
|
405
|
+
onFitToPage?.();
|
|
406
|
+
}, children: [
|
|
407
|
+
/* @__PURE__ */ jsx2(FitScreenIcon, { fontSize: "small" }),
|
|
408
|
+
/* @__PURE__ */ jsx2("span", { children: "Fit to Page" })
|
|
409
|
+
] }),
|
|
410
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-divider" }),
|
|
411
|
+
showRotation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
412
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-header", children: "PAGE ROTATION" }),
|
|
372
413
|
/* @__PURE__ */ jsxs(
|
|
373
414
|
"button",
|
|
374
415
|
{
|
|
375
416
|
className: "toolbar-dropdown-item",
|
|
376
417
|
onClick: () => {
|
|
377
418
|
setIsViewMenuOpen(false);
|
|
378
|
-
|
|
419
|
+
onRotateRight?.();
|
|
379
420
|
},
|
|
421
|
+
disabled: false,
|
|
380
422
|
children: [
|
|
381
|
-
/* @__PURE__ */ jsx2(
|
|
382
|
-
/* @__PURE__ */ jsx2("span", { children: "
|
|
423
|
+
/* @__PURE__ */ jsx2(RotateRightIcon, { fontSize: "small" }),
|
|
424
|
+
/* @__PURE__ */ jsx2("span", { children: "Rotate Clockwise" })
|
|
383
425
|
]
|
|
384
426
|
}
|
|
385
|
-
)
|
|
386
|
-
|
|
387
|
-
] }) })
|
|
388
|
-
] }),
|
|
389
|
-
showSearch && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
390
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
391
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-section", children: /* @__PURE__ */ jsx2(Tooltip, { title: "Search", children: /* @__PURE__ */ jsx2(
|
|
392
|
-
"button",
|
|
393
|
-
{
|
|
394
|
-
className: `toolbar-button ${isSidebarOpen ? "toolbar-button-active" : ""}`,
|
|
395
|
-
onClick: onToggleSidebar,
|
|
396
|
-
children: /* @__PURE__ */ jsx2(SearchIcon, { fontSize: "small" })
|
|
397
|
-
}
|
|
398
|
-
) }) })
|
|
399
|
-
] })
|
|
400
|
-
] }),
|
|
401
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-center", children: [
|
|
402
|
-
/* @__PURE__ */ jsx2(
|
|
403
|
-
"button",
|
|
404
|
-
{
|
|
405
|
-
className: `toolbar-tab ${activeMode === "view" ? "toolbar-tab-active" : ""}`,
|
|
406
|
-
onClick: () => setActiveMode("view"),
|
|
407
|
-
children: "View"
|
|
408
|
-
}
|
|
409
|
-
),
|
|
410
|
-
showAnnotate && /* @__PURE__ */ jsxs(
|
|
411
|
-
"button",
|
|
412
|
-
{
|
|
413
|
-
className: `toolbar-tab ${activeMode === "annotate" ? "toolbar-tab-active" : ""}`,
|
|
414
|
-
onClick: () => !disabledAnnotate && setActiveMode("annotate"),
|
|
415
|
-
style: {
|
|
416
|
-
position: "relative",
|
|
417
|
-
opacity: disabledAnnotate ? 0.5 : 1,
|
|
418
|
-
cursor: disabledAnnotate ? "not-allowed" : "pointer"
|
|
419
|
-
},
|
|
420
|
-
children: [
|
|
421
|
-
"Annotate",
|
|
422
|
-
hasUnsavedAnnotations && /* @__PURE__ */ jsx2("span", { style: {
|
|
423
|
-
position: "absolute",
|
|
424
|
-
top: "4px",
|
|
425
|
-
right: "4px",
|
|
426
|
-
width: "6px",
|
|
427
|
-
height: "6px",
|
|
428
|
-
backgroundColor: "#ef4444",
|
|
429
|
-
borderRadius: "50%"
|
|
430
|
-
} })
|
|
431
|
-
]
|
|
432
|
-
}
|
|
433
|
-
)
|
|
434
|
-
] }),
|
|
435
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-right", children: (hasUnsavedAnnotations || showDownload || showPrint || showMetadata || showProperties || showTags || showHistory) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
436
|
-
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
437
|
-
/* @__PURE__ */ jsxs("div", { className: "toolbar-section", children: [
|
|
438
|
-
showDownload && /* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-container", ref: downloadMenuRef, children: showDownloadOriginal && showDownloadWithAnnotations ? (
|
|
439
|
-
// RENDER DROPDOWN if BOTH are enabled
|
|
440
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
441
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Download", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsxs(
|
|
427
|
+
),
|
|
428
|
+
/* @__PURE__ */ jsxs(
|
|
442
429
|
"button",
|
|
443
430
|
{
|
|
444
|
-
className:
|
|
445
|
-
onClick: () =>
|
|
446
|
-
|
|
431
|
+
className: "toolbar-dropdown-item",
|
|
432
|
+
onClick: () => {
|
|
433
|
+
setIsViewMenuOpen(false);
|
|
434
|
+
onRotateLeft?.();
|
|
435
|
+
},
|
|
436
|
+
disabled: disabledRotateLeft,
|
|
447
437
|
children: [
|
|
448
|
-
/* @__PURE__ */ jsx2(
|
|
449
|
-
/* @__PURE__ */ jsx2(
|
|
438
|
+
/* @__PURE__ */ jsx2(RotateLeftIcon, { fontSize: "small" }),
|
|
439
|
+
/* @__PURE__ */ jsx2("span", { children: "Rotate Counter-Clockwise" })
|
|
450
440
|
]
|
|
451
441
|
}
|
|
452
|
-
)
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
{
|
|
457
|
-
className: "toolbar-dropdown-item",
|
|
458
|
-
onClick: handleDownloadWithoutAnnotations,
|
|
459
|
-
children: /* @__PURE__ */ jsx2("span", { children: "Download Document Only" })
|
|
460
|
-
}
|
|
461
|
-
),
|
|
462
|
-
/* @__PURE__ */ jsx2(
|
|
463
|
-
"button",
|
|
464
|
-
{
|
|
465
|
-
className: "toolbar-dropdown-item",
|
|
466
|
-
onClick: handleDownloadWithAnnotations,
|
|
467
|
-
children: /* @__PURE__ */ jsx2("span", { children: "Download with Annotations" })
|
|
468
|
-
}
|
|
469
|
-
)
|
|
470
|
-
] })
|
|
471
|
-
] })
|
|
472
|
-
) : (
|
|
473
|
-
// RENDER SINGLE BUTTON if ONLY ONE is enabled
|
|
474
|
-
(showDownloadOriginal || showDownloadWithAnnotations) && /* @__PURE__ */ jsx2(Tooltip, { title: "Download", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
442
|
+
)
|
|
443
|
+
] }),
|
|
444
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-divider" }),
|
|
445
|
+
/* @__PURE__ */ jsxs(
|
|
475
446
|
"button",
|
|
476
447
|
{
|
|
477
|
-
className: "toolbar-
|
|
478
|
-
onClick:
|
|
448
|
+
className: "toolbar-dropdown-item",
|
|
449
|
+
onClick: () => {
|
|
450
|
+
setIsViewMenuOpen(false);
|
|
451
|
+
onToggleFullScreen();
|
|
452
|
+
},
|
|
453
|
+
children: [
|
|
454
|
+
/* @__PURE__ */ jsx2(FullscreenIcon, { fontSize: "small" }),
|
|
455
|
+
/* @__PURE__ */ jsx2("span", { children: "Fullscreen" })
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
] })
|
|
460
|
+
] }) })
|
|
461
|
+
] }),
|
|
462
|
+
showSearch && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
463
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
464
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-section", children: /* @__PURE__ */ jsx2(Tooltip, { title: "Search", children: /* @__PURE__ */ jsx2(
|
|
465
|
+
"button",
|
|
466
|
+
{
|
|
467
|
+
className: `toolbar-button ${isSidebarOpen ? "toolbar-button-active" : ""}`,
|
|
468
|
+
onClick: onToggleSidebar,
|
|
469
|
+
children: /* @__PURE__ */ jsx2(SearchIcon, { fontSize: "small" })
|
|
470
|
+
}
|
|
471
|
+
) }) })
|
|
472
|
+
] })
|
|
473
|
+
] }),
|
|
474
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-center", children: [
|
|
475
|
+
/* @__PURE__ */ jsx2(
|
|
476
|
+
"button",
|
|
477
|
+
{
|
|
478
|
+
className: `toolbar-tab ${activeMode === "view" ? "toolbar-tab-active" : ""}`,
|
|
479
|
+
onClick: () => onActiveModeChange?.("view"),
|
|
480
|
+
children: "View"
|
|
481
|
+
}
|
|
482
|
+
),
|
|
483
|
+
showAnnotate && /* @__PURE__ */ jsxs(
|
|
484
|
+
"button",
|
|
485
|
+
{
|
|
486
|
+
className: `toolbar-tab ${activeMode === "annotate" ? "toolbar-tab-active" : ""}`,
|
|
487
|
+
onClick: () => !disabledAnnotate && onActiveModeChange?.("annotate"),
|
|
488
|
+
style: {
|
|
489
|
+
position: "relative",
|
|
490
|
+
opacity: disabledAnnotate ? 0.5 : 1,
|
|
491
|
+
cursor: disabledAnnotate ? "not-allowed" : "pointer"
|
|
492
|
+
},
|
|
493
|
+
children: [
|
|
494
|
+
"Annotate",
|
|
495
|
+
hasUnsavedAnnotations && /* @__PURE__ */ jsx2("span", { style: {
|
|
496
|
+
position: "absolute",
|
|
497
|
+
top: "4px",
|
|
498
|
+
right: "4px",
|
|
499
|
+
width: "6px",
|
|
500
|
+
height: "6px",
|
|
501
|
+
backgroundColor: "#ef4444",
|
|
502
|
+
borderRadius: "50%"
|
|
503
|
+
} })
|
|
504
|
+
]
|
|
505
|
+
}
|
|
506
|
+
)
|
|
507
|
+
] }),
|
|
508
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-right", children: (hasUnsavedAnnotations || showDownload || showPrint || showMetadata || showProperties || showTags || showHistory) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
509
|
+
/* @__PURE__ */ jsx2("div", { className: "toolbar-separator" }),
|
|
510
|
+
/* @__PURE__ */ jsxs("div", { className: "toolbar-section", children: [
|
|
511
|
+
showDownload && /* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-container", ref: downloadMenuRef, children: showDownloadOriginal && showDownloadWithAnnotations ? (
|
|
512
|
+
// RENDER DROPDOWN if BOTH are enabled
|
|
513
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
514
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Download", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsxs(
|
|
515
|
+
"button",
|
|
516
|
+
{
|
|
517
|
+
className: `toolbar-button toolbar-dropdown-button ${isDownloadMenuOpen ? "toolbar-button-active" : ""}`,
|
|
518
|
+
onClick: () => setIsDownloadMenuOpen(!isDownloadMenuOpen),
|
|
479
519
|
disabled: disabledDownload,
|
|
480
|
-
children:
|
|
520
|
+
children: [
|
|
521
|
+
/* @__PURE__ */ jsx2(DownloadIcon, { fontSize: "small" }),
|
|
522
|
+
/* @__PURE__ */ jsx2(KeyboardArrowDownIcon, { fontSize: "small", style: { marginLeft: -4 } })
|
|
523
|
+
]
|
|
481
524
|
}
|
|
482
|
-
) }) })
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
// RENDER DROPDOWN if BOTH are enabled
|
|
486
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
487
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Print", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsxs(
|
|
525
|
+
) }) }),
|
|
526
|
+
isDownloadMenuOpen && /* @__PURE__ */ jsxs("div", { className: "toolbar-dropdown-menu toolbar-dropdown-menu-right", children: [
|
|
527
|
+
/* @__PURE__ */ jsx2(
|
|
488
528
|
"button",
|
|
489
529
|
{
|
|
490
|
-
className:
|
|
491
|
-
onClick:
|
|
492
|
-
|
|
493
|
-
children: [
|
|
494
|
-
/* @__PURE__ */ jsx2(PrintIcon, { fontSize: "small" }),
|
|
495
|
-
/* @__PURE__ */ jsx2(KeyboardArrowDownIcon, { fontSize: "small", style: { marginLeft: -4 } })
|
|
496
|
-
]
|
|
530
|
+
className: "toolbar-dropdown-item",
|
|
531
|
+
onClick: handleDownloadWithoutAnnotations,
|
|
532
|
+
children: /* @__PURE__ */ jsx2("span", { children: "Download Document Only" })
|
|
497
533
|
}
|
|
498
|
-
)
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
),
|
|
508
|
-
/* @__PURE__ */ jsx2(
|
|
509
|
-
"button",
|
|
510
|
-
{
|
|
511
|
-
className: "toolbar-dropdown-item",
|
|
512
|
-
onClick: handlePrintWithAnnotations,
|
|
513
|
-
children: /* @__PURE__ */ jsx2("span", { children: "Print with Annotations" })
|
|
514
|
-
}
|
|
515
|
-
)
|
|
516
|
-
] })
|
|
534
|
+
),
|
|
535
|
+
/* @__PURE__ */ jsx2(
|
|
536
|
+
"button",
|
|
537
|
+
{
|
|
538
|
+
className: "toolbar-dropdown-item",
|
|
539
|
+
onClick: handleDownloadWithAnnotations,
|
|
540
|
+
children: /* @__PURE__ */ jsx2("span", { children: "Download with Annotations" })
|
|
541
|
+
}
|
|
542
|
+
)
|
|
517
543
|
] })
|
|
518
|
-
)
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
{
|
|
523
|
-
className: "toolbar-button",
|
|
524
|
-
onClick: showPrintOriginal ? handlePrintWithoutAnnotations : handlePrintWithAnnotations,
|
|
525
|
-
disabled: disabledPrint,
|
|
526
|
-
children: /* @__PURE__ */ jsx2(PrintIcon, { fontSize: "small" })
|
|
527
|
-
}
|
|
528
|
-
) }) })
|
|
529
|
-
) }),
|
|
530
|
-
showMetadata && /* @__PURE__ */ jsx2(Tooltip, { title: "Metadata", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
531
|
-
"button",
|
|
532
|
-
{
|
|
533
|
-
className: "toolbar-button",
|
|
534
|
-
onClick: onMetadataClick,
|
|
535
|
-
disabled: disabledMetadata,
|
|
536
|
-
children: /* @__PURE__ */ jsx2(DescriptionIcon, { fontSize: "small" })
|
|
537
|
-
}
|
|
538
|
-
) }) }),
|
|
539
|
-
showProperties && /* @__PURE__ */ jsx2(Tooltip, { title: "Properties", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
540
|
-
"button",
|
|
541
|
-
{
|
|
542
|
-
className: "toolbar-button",
|
|
543
|
-
onClick: onPropertiesClick,
|
|
544
|
-
disabled: disabledProperties,
|
|
545
|
-
children: /* @__PURE__ */ jsx2(InfoIcon, { fontSize: "small" })
|
|
546
|
-
}
|
|
547
|
-
) }) }),
|
|
548
|
-
showTags && /* @__PURE__ */ jsx2(Tooltip, { title: "Tags", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
544
|
+
] })
|
|
545
|
+
) : (
|
|
546
|
+
// RENDER SINGLE BUTTON if ONLY ONE is enabled
|
|
547
|
+
(showDownloadOriginal || showDownloadWithAnnotations) && /* @__PURE__ */ jsx2(Tooltip, { title: "Download", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
549
548
|
"button",
|
|
550
549
|
{
|
|
551
550
|
className: "toolbar-button",
|
|
552
|
-
onClick:
|
|
553
|
-
disabled:
|
|
554
|
-
children: /* @__PURE__ */ jsx2(
|
|
551
|
+
onClick: showDownloadOriginal ? handleDownloadWithoutAnnotations : handleDownloadWithAnnotations,
|
|
552
|
+
disabled: disabledDownload,
|
|
553
|
+
children: /* @__PURE__ */ jsx2(DownloadIcon, { fontSize: "small" })
|
|
555
554
|
}
|
|
556
|
-
) }) })
|
|
557
|
-
|
|
555
|
+
) }) })
|
|
556
|
+
) }),
|
|
557
|
+
showPrint && /* @__PURE__ */ jsx2("div", { className: "toolbar-dropdown-container", ref: printMenuRef, children: showPrintOriginal && showPrintWithAnnotations ? (
|
|
558
|
+
// RENDER DROPDOWN if BOTH are enabled
|
|
559
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
560
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Print", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsxs(
|
|
561
|
+
"button",
|
|
562
|
+
{
|
|
563
|
+
className: `toolbar-button toolbar-dropdown-button ${isPrintMenuOpen ? "toolbar-button-active" : ""}`,
|
|
564
|
+
onClick: () => setIsPrintMenuOpen(!isPrintMenuOpen),
|
|
565
|
+
disabled: disabledPrint,
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ jsx2(PrintIcon, { fontSize: "small" }),
|
|
568
|
+
/* @__PURE__ */ jsx2(KeyboardArrowDownIcon, { fontSize: "small", style: { marginLeft: -4 } })
|
|
569
|
+
]
|
|
570
|
+
}
|
|
571
|
+
) }) }),
|
|
572
|
+
isPrintMenuOpen && /* @__PURE__ */ jsxs("div", { className: "toolbar-dropdown-menu toolbar-dropdown-menu-right", children: [
|
|
573
|
+
/* @__PURE__ */ jsx2(
|
|
574
|
+
"button",
|
|
575
|
+
{
|
|
576
|
+
className: "toolbar-dropdown-item",
|
|
577
|
+
onClick: handlePrintWithoutAnnotations,
|
|
578
|
+
children: /* @__PURE__ */ jsx2("span", { children: "Print Document Only" })
|
|
579
|
+
}
|
|
580
|
+
),
|
|
581
|
+
/* @__PURE__ */ jsx2(
|
|
582
|
+
"button",
|
|
583
|
+
{
|
|
584
|
+
className: "toolbar-dropdown-item",
|
|
585
|
+
onClick: handlePrintWithAnnotations,
|
|
586
|
+
children: /* @__PURE__ */ jsx2("span", { children: "Print with Annotations" })
|
|
587
|
+
}
|
|
588
|
+
)
|
|
589
|
+
] })
|
|
590
|
+
] })
|
|
591
|
+
) : (
|
|
592
|
+
// RENDER SINGLE BUTTON if ONLY ONE is enabled
|
|
593
|
+
(showPrintOriginal || showPrintWithAnnotations) && /* @__PURE__ */ jsx2(Tooltip, { title: "Print", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
558
594
|
"button",
|
|
559
595
|
{
|
|
560
596
|
className: "toolbar-button",
|
|
561
|
-
onClick:
|
|
562
|
-
disabled:
|
|
563
|
-
children: /* @__PURE__ */ jsx2(
|
|
597
|
+
onClick: showPrintOriginal ? handlePrintWithoutAnnotations : handlePrintWithAnnotations,
|
|
598
|
+
disabled: disabledPrint,
|
|
599
|
+
children: /* @__PURE__ */ jsx2(PrintIcon, { fontSize: "small" })
|
|
564
600
|
}
|
|
565
601
|
) }) })
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
] }),
|
|
569
|
-
activeMode === "annotate" && showAnnotations && /* @__PURE__ */ jsxs("div", { className: "pdf-viewer-secondary-toolbar", children: [
|
|
570
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Highlight", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
571
|
-
"button",
|
|
572
|
-
{
|
|
573
|
-
className: `toolbar-button ${isHighlighterActive ? "toolbar-button-active" : ""}`,
|
|
574
|
-
onClick: onHighlighterClick,
|
|
575
|
-
disabled: disabledHighlighter,
|
|
576
|
-
children: /* @__PURE__ */ jsx2(HighlightIcon, { fontSize: "small" })
|
|
577
|
-
}
|
|
578
|
-
) }) }),
|
|
579
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Stamp", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
580
|
-
"button",
|
|
581
|
-
{
|
|
582
|
-
className: `toolbar-button ${isStampActive ? "toolbar-button-active" : ""}`,
|
|
583
|
-
onClick: onStampClick,
|
|
584
|
-
disabled: disabledStamp,
|
|
585
|
-
children: /* @__PURE__ */ jsx2(ApprovalIcon, { fontSize: "small" })
|
|
586
|
-
}
|
|
587
|
-
) }) }),
|
|
588
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Signature", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
589
|
-
"button",
|
|
590
|
-
{
|
|
591
|
-
className: "toolbar-button",
|
|
592
|
-
onClick: onSignatureClick,
|
|
593
|
-
disabled: disabledSignature,
|
|
594
|
-
children: /* @__PURE__ */ jsx2(DrawIcon, { fontSize: "small" })
|
|
595
|
-
}
|
|
596
|
-
) }) }),
|
|
597
|
-
onNoteClick && /* @__PURE__ */ jsx2(Tooltip, { title: "Sticky Note", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
598
|
-
"button",
|
|
599
|
-
{
|
|
600
|
-
className: "toolbar-button",
|
|
601
|
-
onClick: onNoteClick,
|
|
602
|
-
disabled: disabledNote,
|
|
603
|
-
children: /* @__PURE__ */ jsx2(StickyNote2Icon, { fontSize: "small" })
|
|
604
|
-
}
|
|
605
|
-
) }) }),
|
|
606
|
-
hasUnsavedAnnotations && canSaveAnnotations !== false && onSaveAnnotations && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
607
|
-
/* @__PURE__ */ jsx2("div", { style: { width: 1, height: 24, backgroundColor: "#e5e7eb", margin: "0 8px" } }),
|
|
608
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: "Save Annotations", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsxs(
|
|
602
|
+
) }),
|
|
603
|
+
showMetadata && /* @__PURE__ */ jsx2(Tooltip, { title: "Metadata", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
609
604
|
"button",
|
|
610
605
|
{
|
|
611
606
|
className: "toolbar-button",
|
|
612
|
-
onClick:
|
|
613
|
-
disabled:
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
607
|
+
onClick: onMetadataClick,
|
|
608
|
+
disabled: disabledMetadata,
|
|
609
|
+
children: /* @__PURE__ */ jsx2(DescriptionIcon, { fontSize: "small" })
|
|
610
|
+
}
|
|
611
|
+
) }) }),
|
|
612
|
+
showProperties && /* @__PURE__ */ jsx2(Tooltip, { title: "Properties", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
613
|
+
"button",
|
|
614
|
+
{
|
|
615
|
+
className: "toolbar-button",
|
|
616
|
+
onClick: onPropertiesClick,
|
|
617
|
+
disabled: disabledProperties,
|
|
618
|
+
children: /* @__PURE__ */ jsx2(InfoIcon, { fontSize: "small" })
|
|
619
|
+
}
|
|
620
|
+
) }) }),
|
|
621
|
+
showTags && /* @__PURE__ */ jsx2(Tooltip, { title: "Tags", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
622
|
+
"button",
|
|
623
|
+
{
|
|
624
|
+
className: "toolbar-button",
|
|
625
|
+
onClick: onTagsClick,
|
|
626
|
+
disabled: disabledTags,
|
|
627
|
+
children: /* @__PURE__ */ jsx2(LocalOffer, { fontSize: "small" })
|
|
628
|
+
}
|
|
629
|
+
) }) }),
|
|
630
|
+
showHistory && /* @__PURE__ */ jsx2(Tooltip, { title: "Version History", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
631
|
+
"button",
|
|
632
|
+
{
|
|
633
|
+
className: "toolbar-button",
|
|
634
|
+
onClick: onHistoryClick,
|
|
635
|
+
disabled: disabledHistory,
|
|
636
|
+
children: /* @__PURE__ */ jsx2(HistoryIcon, { fontSize: "small" })
|
|
636
637
|
}
|
|
637
638
|
) }) })
|
|
638
639
|
] })
|
|
639
|
-
] })
|
|
640
|
-
|
|
641
|
-
] });
|
|
640
|
+
] }) })
|
|
641
|
+
] }) });
|
|
642
642
|
}
|
|
643
643
|
);
|
|
644
644
|
PDFToolbar.displayName = "PDFToolbar";
|
|
645
|
+
var PDFSecondaryToolbar = React2.memo(({
|
|
646
|
+
activeMode,
|
|
647
|
+
showAnnotations,
|
|
648
|
+
isHighlighterActive,
|
|
649
|
+
isStampActive,
|
|
650
|
+
disabledHighlighter,
|
|
651
|
+
disabledStamp,
|
|
652
|
+
disabledSignature,
|
|
653
|
+
disabledNote,
|
|
654
|
+
onHighlighterClick,
|
|
655
|
+
onStampClick,
|
|
656
|
+
onSignatureClick,
|
|
657
|
+
onNoteClick,
|
|
658
|
+
hasUnsavedAnnotations,
|
|
659
|
+
isSavingAnnotations,
|
|
660
|
+
canSaveAnnotations,
|
|
661
|
+
onSaveAnnotations
|
|
662
|
+
}) => {
|
|
663
|
+
if (!showAnnotations) return null;
|
|
664
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
665
|
+
activeMode === "annotate" && /* @__PURE__ */ jsxs("div", { className: "pdf-viewer-secondary-toolbar", children: [
|
|
666
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Highlight", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
667
|
+
"button",
|
|
668
|
+
{
|
|
669
|
+
className: `toolbar-button ${isHighlighterActive ? "toolbar-button-active" : ""}`,
|
|
670
|
+
onClick: onHighlighterClick,
|
|
671
|
+
disabled: disabledHighlighter,
|
|
672
|
+
children: /* @__PURE__ */ jsx2(HighlightIcon, { fontSize: "small" })
|
|
673
|
+
}
|
|
674
|
+
) }) }),
|
|
675
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Stamp", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
676
|
+
"button",
|
|
677
|
+
{
|
|
678
|
+
className: `toolbar-button ${isStampActive ? "toolbar-button-active" : ""}`,
|
|
679
|
+
onClick: onStampClick,
|
|
680
|
+
disabled: disabledStamp,
|
|
681
|
+
children: /* @__PURE__ */ jsx2(ApprovalIcon, { fontSize: "small" })
|
|
682
|
+
}
|
|
683
|
+
) }) }),
|
|
684
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Signature", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
685
|
+
"button",
|
|
686
|
+
{
|
|
687
|
+
className: "toolbar-button",
|
|
688
|
+
onClick: onSignatureClick,
|
|
689
|
+
disabled: disabledSignature,
|
|
690
|
+
children: /* @__PURE__ */ jsx2(DrawIcon, { fontSize: "small" })
|
|
691
|
+
}
|
|
692
|
+
) }) }),
|
|
693
|
+
onNoteClick && /* @__PURE__ */ jsx2(Tooltip, { title: "Sticky Note", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(
|
|
694
|
+
"button",
|
|
695
|
+
{
|
|
696
|
+
className: "toolbar-button",
|
|
697
|
+
onClick: onNoteClick,
|
|
698
|
+
disabled: disabledNote,
|
|
699
|
+
children: /* @__PURE__ */ jsx2(StickyNote2Icon, { fontSize: "small" })
|
|
700
|
+
}
|
|
701
|
+
) }) }),
|
|
702
|
+
hasUnsavedAnnotations && canSaveAnnotations !== false && onSaveAnnotations && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
703
|
+
/* @__PURE__ */ jsx2("div", { style: { width: 1, height: 24, backgroundColor: "#e5e7eb", margin: "0 8px" } }),
|
|
704
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: "Save Annotations", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsxs(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
className: "toolbar-button",
|
|
708
|
+
onClick: onSaveAnnotations,
|
|
709
|
+
disabled: isSavingAnnotations,
|
|
710
|
+
style: {
|
|
711
|
+
color: hasUnsavedAnnotations ? "#2563eb" : "inherit",
|
|
712
|
+
padding: "6px 16px",
|
|
713
|
+
border: hasUnsavedAnnotations ? "1px solid #2563eb" : "1px solid transparent",
|
|
714
|
+
borderRadius: "6px",
|
|
715
|
+
display: "flex",
|
|
716
|
+
alignItems: "center",
|
|
717
|
+
gap: "6px",
|
|
718
|
+
backgroundColor: hasUnsavedAnnotations ? "#eff6ff" : "transparent",
|
|
719
|
+
fontSize: "14px",
|
|
720
|
+
fontWeight: 500,
|
|
721
|
+
width: "auto",
|
|
722
|
+
cursor: isSavingAnnotations ? "not-allowed" : "pointer"
|
|
723
|
+
},
|
|
724
|
+
children: [
|
|
725
|
+
isSavingAnnotations ? /* @__PURE__ */ jsx2("svg", { width: "16", height: "16", viewBox: "0 0 24 24", style: { animation: "spin 1s linear infinite" }, children: /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", fill: "none", strokeDasharray: "31.4", strokeDashoffset: "10" }) }) : /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
726
|
+
/* @__PURE__ */ jsx2("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
|
|
727
|
+
/* @__PURE__ */ jsx2("polyline", { points: "17 21 17 13 7 13 7 21" }),
|
|
728
|
+
/* @__PURE__ */ jsx2("polyline", { points: "7 3 7 8 15 8" })
|
|
729
|
+
] }),
|
|
730
|
+
/* @__PURE__ */ jsx2("span", { children: isSavingAnnotations ? "Saving..." : "Save" })
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
) }) })
|
|
734
|
+
] })
|
|
735
|
+
] }),
|
|
736
|
+
activeMode === "redact" && /* @__PURE__ */ jsx2("div", { className: "pdf-viewer-secondary-toolbar", children: /* @__PURE__ */ jsx2(Tooltip, { title: "Redact Text", children: /* @__PURE__ */ jsx2("button", { className: "toolbar-button", children: /* @__PURE__ */ jsx2(AutoFixHighIcon, { fontSize: "small" }) }) }) })
|
|
737
|
+
] });
|
|
738
|
+
});
|
|
739
|
+
PDFSecondaryToolbar.displayName = "PDFSecondaryToolbar";
|
|
740
|
+
PDFToolbar.displayName = "PDFToolbar";
|
|
645
741
|
|
|
646
742
|
// src/components/viewers/pdf/PDFHeader.tsx
|
|
647
743
|
import React3 from "react";
|
|
@@ -1317,6 +1413,7 @@ var PasswordDialog = ({
|
|
|
1317
1413
|
};
|
|
1318
1414
|
|
|
1319
1415
|
// src/components/viewers/PDFViewer.tsx
|
|
1416
|
+
import { ScrollStrategy as ScrollStrategy2, PdfThumbnailSidebar } from "@cannymindstech/pdf-viewer";
|
|
1320
1417
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1321
1418
|
var PDFViewerContent = forwardRef(
|
|
1322
1419
|
(props, ref) => {
|
|
@@ -1372,7 +1469,8 @@ var PDFViewerContent = forwardRef(
|
|
|
1372
1469
|
isSavingAnnotations,
|
|
1373
1470
|
canSaveAnnotations,
|
|
1374
1471
|
onSaveAnnotations,
|
|
1375
|
-
loading
|
|
1472
|
+
loading,
|
|
1473
|
+
themeMode = "light"
|
|
1376
1474
|
} = props;
|
|
1377
1475
|
const [pdfBuffer, setPdfBuffer] = useState4(null);
|
|
1378
1476
|
const [state, setState] = useState4("idle");
|
|
@@ -1398,7 +1496,7 @@ var PDFViewerContent = forwardRef(
|
|
|
1398
1496
|
);
|
|
1399
1497
|
const [currentPage, setCurrentPage] = useState4(1);
|
|
1400
1498
|
const [totalPages, setTotalPages] = useState4(0);
|
|
1401
|
-
const [zoom, setZoom] = useState4(
|
|
1499
|
+
const [zoom, setZoom] = useState4(122);
|
|
1402
1500
|
const [searchQuery, setSearchQuery] = useState4("");
|
|
1403
1501
|
const [isSearching, setIsSearching] = useState4(false);
|
|
1404
1502
|
const [pdfContainer, setPdfContainer] = useState4(null);
|
|
@@ -1410,6 +1508,10 @@ var PDFViewerContent = forwardRef(
|
|
|
1410
1508
|
!!initialSearchText
|
|
1411
1509
|
);
|
|
1412
1510
|
const [isFullScreen, setIsFullScreen] = useState4(false);
|
|
1511
|
+
const [twoPageMode, setTwoPageMode] = useState4(false);
|
|
1512
|
+
const [scrollStrategy, setScrollStrategy] = useState4(ScrollStrategy2.Vertical);
|
|
1513
|
+
const [showThumbnails, setShowThumbnails] = useState4(true);
|
|
1514
|
+
const [activeMode, setActiveMode] = useState4("view");
|
|
1413
1515
|
const containerRef = useRef3(null);
|
|
1414
1516
|
const [isPasswordDialogOpen, setIsPasswordDialogOpen] = useState4(false);
|
|
1415
1517
|
const [passwordError, setPasswordError] = useState4("");
|
|
@@ -1666,7 +1768,7 @@ var PDFViewerContent = forwardRef(
|
|
|
1666
1768
|
hasExecutedInitialSearch.current = false;
|
|
1667
1769
|
setCurrentPage(1);
|
|
1668
1770
|
setTotalPages(0);
|
|
1669
|
-
setZoom(
|
|
1771
|
+
setZoom(122);
|
|
1670
1772
|
setState("idle");
|
|
1671
1773
|
setError(null);
|
|
1672
1774
|
setPdfBuffer(null);
|
|
@@ -1715,6 +1817,15 @@ var PDFViewerContent = forwardRef(
|
|
|
1715
1817
|
const pollInterval = setInterval(checkInternalReadiness, 100);
|
|
1716
1818
|
return () => clearInterval(pollInterval);
|
|
1717
1819
|
}, [state]);
|
|
1820
|
+
useEffect4(() => {
|
|
1821
|
+
if (isInternalReady && pdfViewerRef.current) {
|
|
1822
|
+
try {
|
|
1823
|
+
pdfViewerRef.current.zoom.setZoom(1.22);
|
|
1824
|
+
setZoom(122);
|
|
1825
|
+
} catch (e) {
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}, [isInternalReady]);
|
|
1718
1829
|
useEffect4(() => {
|
|
1719
1830
|
if (state !== "ready" || totalPages > 0) return;
|
|
1720
1831
|
const initializePageCount = async () => {
|
|
@@ -2148,7 +2259,7 @@ var PDFViewerContent = forwardRef(
|
|
|
2148
2259
|
}
|
|
2149
2260
|
const isReady = pdfBuffer && state === "ready";
|
|
2150
2261
|
const showOverlay = loading || !isReady || !isInternalReady;
|
|
2151
|
-
return /* @__PURE__ */ jsxs5("div", { ref: containerRef, className:
|
|
2262
|
+
return /* @__PURE__ */ jsxs5("div", { ref: containerRef, className: `pdf-viewer-container ${themeMode === "dark" ? "dark-theme" : ""}`, style: { position: "relative", height: "100%", width: "100%" }, children: [
|
|
2152
2263
|
/* @__PURE__ */ jsx6("style", { children: toolbarStyles }),
|
|
2153
2264
|
showOverlay && /* @__PURE__ */ jsx6(LoadingSpinner, { fileName: resolvedFileName }),
|
|
2154
2265
|
/* @__PURE__ */ jsxs5("div", { style: { opacity: !showOverlay ? 1 : 0, height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
@@ -2224,35 +2335,79 @@ var PDFViewerContent = forwardRef(
|
|
|
2224
2335
|
showPrintWithAnnotations,
|
|
2225
2336
|
showDownloadOriginal,
|
|
2226
2337
|
showDownloadWithAnnotations,
|
|
2338
|
+
twoPageMode,
|
|
2339
|
+
onTwoPageModeChange: setTwoPageMode,
|
|
2340
|
+
scrollStrategy,
|
|
2341
|
+
onScrollStrategyChange: setScrollStrategy,
|
|
2342
|
+
showThumbnails,
|
|
2343
|
+
onToggleThumbnails: () => setShowThumbnails(!showThumbnails),
|
|
2227
2344
|
hasUnsavedAnnotations,
|
|
2228
2345
|
isSavingAnnotations,
|
|
2229
2346
|
canSaveAnnotations,
|
|
2230
|
-
onSaveAnnotations
|
|
2347
|
+
onSaveAnnotations,
|
|
2348
|
+
activeMode,
|
|
2349
|
+
onActiveModeChange: setActiveMode
|
|
2231
2350
|
}
|
|
2232
2351
|
),
|
|
2233
2352
|
/* @__PURE__ */ jsxs5("div", { className: "pdf-viewer-main", children: [
|
|
2234
|
-
|
|
2235
|
-
|
|
2353
|
+
showThumbnails && pdfBuffer && /* @__PURE__ */ jsx6(
|
|
2354
|
+
PdfThumbnailSidebar,
|
|
2236
2355
|
{
|
|
2237
|
-
pdfBuffer
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
annotationSelectionMenu,
|
|
2244
|
-
isHighlighterActive: highlighterActive,
|
|
2245
|
-
isStampActive: stampActive,
|
|
2246
|
-
onHighlighterClick: onHighlighterClick || toolbarHandlers.handleHighlighterClick,
|
|
2247
|
-
onStampClick: onStampClick || toolbarHandlers.handleStampClick,
|
|
2248
|
-
onSignatureClick: onSignatureClick || toolbarHandlers.handleSignatureClick,
|
|
2249
|
-
onNoteClick,
|
|
2250
|
-
permissions: props.permissions,
|
|
2251
|
-
isAnnotationForeign,
|
|
2252
|
-
onAnnotationNoteClick,
|
|
2253
|
-
isAnnotationInteractive
|
|
2356
|
+
pdfBuffer,
|
|
2357
|
+
totalPages,
|
|
2358
|
+
currentPage,
|
|
2359
|
+
onPageClick: (pageNum) => pdfViewerRef.current?.navigation.goToPage(pageNum),
|
|
2360
|
+
onClose: () => setShowThumbnails(false),
|
|
2361
|
+
twoPageMode: false
|
|
2254
2362
|
}
|
|
2255
|
-
)
|
|
2363
|
+
),
|
|
2364
|
+
/* @__PURE__ */ jsxs5("div", { className: "pdf-viewer-viewer-area", children: [
|
|
2365
|
+
/* @__PURE__ */ jsx6(
|
|
2366
|
+
PDFSecondaryToolbar,
|
|
2367
|
+
{
|
|
2368
|
+
activeMode,
|
|
2369
|
+
showAnnotations,
|
|
2370
|
+
isHighlighterActive: highlighterActive,
|
|
2371
|
+
isStampActive: stampActive,
|
|
2372
|
+
disabledHighlighter: toolbar.isDisabled("highlighter"),
|
|
2373
|
+
disabledStamp: toolbar.isDisabled("stamp"),
|
|
2374
|
+
disabledSignature: toolbar.isDisabled("signature"),
|
|
2375
|
+
disabledNote: toolbar.isDisabled("note"),
|
|
2376
|
+
onHighlighterClick: onHighlighterClick || toolbarHandlers.handleHighlighterClick,
|
|
2377
|
+
onStampClick: onStampClick || toolbarHandlers.handleStampClick,
|
|
2378
|
+
onSignatureClick: onSignatureClick || toolbarHandlers.handleSignatureClick,
|
|
2379
|
+
onNoteClick,
|
|
2380
|
+
hasUnsavedAnnotations,
|
|
2381
|
+
isSavingAnnotations,
|
|
2382
|
+
canSaveAnnotations,
|
|
2383
|
+
onSaveAnnotations
|
|
2384
|
+
}
|
|
2385
|
+
),
|
|
2386
|
+
/* @__PURE__ */ jsx6(
|
|
2387
|
+
StablePDFViewer,
|
|
2388
|
+
{
|
|
2389
|
+
pdfBuffer: pdfBuffer || new ArrayBuffer(0),
|
|
2390
|
+
onPasswordRequest: handlePasswordRequest,
|
|
2391
|
+
pdfViewerRef,
|
|
2392
|
+
hideInternalLoading: true,
|
|
2393
|
+
showAnnotations,
|
|
2394
|
+
userDetails,
|
|
2395
|
+
annotationSelectionMenu,
|
|
2396
|
+
isHighlighterActive: highlighterActive,
|
|
2397
|
+
isStampActive: stampActive,
|
|
2398
|
+
onHighlighterClick: onHighlighterClick || toolbarHandlers.handleHighlighterClick,
|
|
2399
|
+
onStampClick: onStampClick || toolbarHandlers.handleStampClick,
|
|
2400
|
+
onSignatureClick: onSignatureClick || toolbarHandlers.handleSignatureClick,
|
|
2401
|
+
onNoteClick,
|
|
2402
|
+
permissions: props.permissions,
|
|
2403
|
+
isAnnotationForeign,
|
|
2404
|
+
onAnnotationNoteClick,
|
|
2405
|
+
isAnnotationInteractive,
|
|
2406
|
+
twoPageMode,
|
|
2407
|
+
scrollStrategy
|
|
2408
|
+
}
|
|
2409
|
+
)
|
|
2410
|
+
] }),
|
|
2256
2411
|
/* @__PURE__ */ jsx6(
|
|
2257
2412
|
SearchSidebar,
|
|
2258
2413
|
{
|
|
@@ -2296,4 +2451,4 @@ PDFViewer.displayName = "PDFViewer";
|
|
|
2296
2451
|
export {
|
|
2297
2452
|
PDFViewer
|
|
2298
2453
|
};
|
|
2299
|
-
//# sourceMappingURL=chunk-
|
|
2454
|
+
//# sourceMappingURL=chunk-6L72TJIW.mjs.map
|