@cannyminds/dms-file-viewers 0.14.0 → 0.16.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-5VXNBCB7.mjs +268 -0
- package/dist/chunk-5VXNBCB7.mjs.map +1 -0
- package/dist/chunk-7S4B534E.js +742 -0
- package/dist/chunk-7S4B534E.js.map +1 -0
- package/dist/chunk-AUNFO5WZ.js +268 -0
- package/dist/chunk-AUNFO5WZ.js.map +1 -0
- package/dist/chunk-BL4HRFCJ.mjs +487 -0
- package/dist/chunk-BL4HRFCJ.mjs.map +1 -0
- package/dist/chunk-CIAMJ46F.js +309 -0
- package/dist/chunk-CIAMJ46F.js.map +1 -0
- package/dist/chunk-DLSRPPBM.mjs +1863 -0
- package/dist/chunk-DLSRPPBM.mjs.map +1 -0
- package/dist/{chunk-J3JKVSAM.js → chunk-EEIQAW55.js} +5 -2
- package/dist/chunk-EEIQAW55.js.map +1 -0
- package/dist/chunk-FUNU3LUV.js +487 -0
- package/dist/chunk-FUNU3LUV.js.map +1 -0
- package/dist/chunk-HX5KWJCV.mjs +742 -0
- package/dist/chunk-HX5KWJCV.mjs.map +1 -0
- package/dist/chunk-LOXGEZRZ.js +329 -0
- package/dist/chunk-LOXGEZRZ.js.map +1 -0
- package/dist/chunk-NZLZUCP2.mjs +329 -0
- package/dist/chunk-NZLZUCP2.mjs.map +1 -0
- package/dist/chunk-PFX2NN3C.js +1863 -0
- package/dist/chunk-PFX2NN3C.js.map +1 -0
- package/dist/{chunk-DFBVN4MO.mjs → chunk-Q4OU6YDO.mjs} +5 -2
- package/dist/chunk-Q4OU6YDO.mjs.map +1 -0
- package/dist/chunk-VM5I5IEA.mjs +309 -0
- package/dist/chunk-VM5I5IEA.mjs.map +1 -0
- package/dist/chunk-YGQ6UYNQ.js +299 -0
- package/dist/chunk-YGQ6UYNQ.js.map +1 -0
- package/dist/chunk-ZRASAXL6.mjs +299 -0
- package/dist/chunk-ZRASAXL6.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/AudioViewer.js +3 -3
- package/dist/components/viewers/AudioViewer.mjs +2 -2
- package/dist/components/viewers/DefaultViewer.d.mts +1 -1
- package/dist/components/viewers/DefaultViewer.d.ts +1 -1
- package/dist/components/viewers/DefaultViewer.js +3 -3
- package/dist/components/viewers/DefaultViewer.mjs +2 -2
- 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/TIFFViewer.js +3 -3
- package/dist/components/viewers/TIFFViewer.mjs +2 -2
- package/dist/components/viewers/TextViewer.d.mts +1 -1
- package/dist/components/viewers/TextViewer.d.ts +1 -1
- package/dist/components/viewers/TextViewer.js +3 -3
- package/dist/components/viewers/TextViewer.mjs +2 -2
- package/dist/components/viewers/VideoViewer.d.mts +1 -1
- package/dist/components/viewers/VideoViewer.d.ts +1 -1
- package/dist/components/viewers/VideoViewer.js +3 -3
- package/dist/components/viewers/VideoViewer.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/index.mjs +8 -8
- package/dist/{types-DNrkDJdK.d.mts → types-DM0RG-Yu.d.mts} +6 -2
- package/dist/{types-DNrkDJdK.d.ts → types-DM0RG-Yu.d.ts} +6 -2
- package/package.json +1 -1
- package/dist/chunk-7QRYWFCO.js +0 -639
- package/dist/chunk-7QRYWFCO.js.map +0 -1
- package/dist/chunk-7R2KG3PE.mjs +0 -210
- package/dist/chunk-7R2KG3PE.mjs.map +0 -1
- package/dist/chunk-CFYOPDCG.mjs +0 -235
- package/dist/chunk-CFYOPDCG.mjs.map +0 -1
- package/dist/chunk-D74R4IKW.mjs +0 -341
- package/dist/chunk-D74R4IKW.mjs.map +0 -1
- package/dist/chunk-DFBVN4MO.mjs.map +0 -1
- package/dist/chunk-EXZCEYLI.js +0 -247
- package/dist/chunk-EXZCEYLI.js.map +0 -1
- package/dist/chunk-J3JKVSAM.js.map +0 -1
- package/dist/chunk-NXVIRFGL.mjs +0 -247
- package/dist/chunk-NXVIRFGL.mjs.map +0 -1
- package/dist/chunk-P2VNW6OE.mjs +0 -180
- package/dist/chunk-P2VNW6OE.mjs.map +0 -1
- package/dist/chunk-P5FH7LK7.mjs +0 -639
- package/dist/chunk-P5FH7LK7.mjs.map +0 -1
- package/dist/chunk-PZJSY6OF.mjs +0 -1736
- package/dist/chunk-PZJSY6OF.mjs.map +0 -1
- package/dist/chunk-RVHIXSUP.js +0 -235
- package/dist/chunk-RVHIXSUP.js.map +0 -1
- package/dist/chunk-TGVFAAIP.js +0 -341
- package/dist/chunk-TGVFAAIP.js.map +0 -1
- package/dist/chunk-VOLQW3NF.js +0 -1736
- package/dist/chunk-VOLQW3NF.js.map +0 -1
- package/dist/chunk-VSGX22FQ.js +0 -180
- package/dist/chunk-VSGX22FQ.js.map +0 -1
- package/dist/chunk-WCAXWJE7.js +0 -210
- package/dist/chunk-WCAXWJE7.js.map +0 -1
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkYEPEMLM3js = require('./chunk-YEPEMLM3.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkEEIQAW55js = require('./chunk-EEIQAW55.js');
|
|
9
|
+
|
|
10
|
+
// src/components/viewers/TIFFViewer.tsx
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
var _material = require('@mui/material');
|
|
29
|
+
var _Download = require('@mui/icons-material/Download'); var _Download2 = _interopRequireDefault(_Download);
|
|
30
|
+
var _Print = require('@mui/icons-material/Print'); var _Print2 = _interopRequireDefault(_Print);
|
|
31
|
+
var _Fullscreen = require('@mui/icons-material/Fullscreen'); var _Fullscreen2 = _interopRequireDefault(_Fullscreen);
|
|
32
|
+
var _FirstPage = require('@mui/icons-material/FirstPage'); var _FirstPage2 = _interopRequireDefault(_FirstPage);
|
|
33
|
+
var _LastPage = require('@mui/icons-material/LastPage'); var _LastPage2 = _interopRequireDefault(_LastPage);
|
|
34
|
+
var _ChevronLeft = require('@mui/icons-material/ChevronLeft'); var _ChevronLeft2 = _interopRequireDefault(_ChevronLeft);
|
|
35
|
+
var _ChevronRight = require('@mui/icons-material/ChevronRight'); var _ChevronRight2 = _interopRequireDefault(_ChevronRight);
|
|
36
|
+
var _ZoomIn = require('@mui/icons-material/ZoomIn'); var _ZoomIn2 = _interopRequireDefault(_ZoomIn);
|
|
37
|
+
var _ZoomOut = require('@mui/icons-material/ZoomOut'); var _ZoomOut2 = _interopRequireDefault(_ZoomOut);
|
|
38
|
+
var _FitScreen = require('@mui/icons-material/FitScreen'); var _FitScreen2 = _interopRequireDefault(_FitScreen);
|
|
39
|
+
var _AspectRatio = require('@mui/icons-material/AspectRatio'); var _AspectRatio2 = _interopRequireDefault(_AspectRatio);
|
|
40
|
+
var _Info = require('@mui/icons-material/Info'); var _Info2 = _interopRequireDefault(_Info);
|
|
41
|
+
var _Description = require('@mui/icons-material/Description'); var _Description2 = _interopRequireDefault(_Description);
|
|
42
|
+
var _History = require('@mui/icons-material/History'); var _History2 = _interopRequireDefault(_History);
|
|
43
|
+
var _iconsmaterial = require('@mui/icons-material');
|
|
44
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
45
|
+
var resolveDocumentName = (file, fileName, url) => {
|
|
46
|
+
if (_optionalChain([file, 'optionalAccess', _ => _.name])) {
|
|
47
|
+
return file.name;
|
|
48
|
+
}
|
|
49
|
+
if (fileName) {
|
|
50
|
+
return fileName;
|
|
51
|
+
}
|
|
52
|
+
if (url) {
|
|
53
|
+
const parts = _nullishCoalesce(_optionalChain([url, 'access', _2 => _2.split, 'call', _3 => _3("?"), 'access', _4 => _4[0], 'optionalAccess', _5 => _5.split, 'call', _6 => _6("#"), 'access', _7 => _7[0], 'optionalAccess', _8 => _8.split, 'call', _9 => _9("/")]), () => ( []));
|
|
54
|
+
return parts[parts.length - 1] || "document.tiff";
|
|
55
|
+
}
|
|
56
|
+
return "document.tiff";
|
|
57
|
+
};
|
|
58
|
+
var TIFFViewerContent = ({
|
|
59
|
+
sourceDescription,
|
|
60
|
+
file,
|
|
61
|
+
url,
|
|
62
|
+
fileName,
|
|
63
|
+
totalPages = 1,
|
|
64
|
+
className = "",
|
|
65
|
+
style = {},
|
|
66
|
+
width = "100%",
|
|
67
|
+
height = "100%",
|
|
68
|
+
onLoad,
|
|
69
|
+
onError,
|
|
70
|
+
onDownloadClick,
|
|
71
|
+
onPrintClick,
|
|
72
|
+
onTagsClick,
|
|
73
|
+
onMetadataClick,
|
|
74
|
+
onPropertiesClick,
|
|
75
|
+
onHistoryClick,
|
|
76
|
+
pageLoader,
|
|
77
|
+
showDownload = true,
|
|
78
|
+
showPrint = true,
|
|
79
|
+
showMetadata = false,
|
|
80
|
+
showTags = true,
|
|
81
|
+
showProperties = false,
|
|
82
|
+
showHistory = true,
|
|
83
|
+
// Extract props that shouldn't be passed to DOM elements
|
|
84
|
+
mimeType,
|
|
85
|
+
fileSize,
|
|
86
|
+
showPageCount,
|
|
87
|
+
showPageNavigation,
|
|
88
|
+
showZoomControls,
|
|
89
|
+
showSearch,
|
|
90
|
+
customRegistry,
|
|
91
|
+
initialSearchText,
|
|
92
|
+
initialSearchPages,
|
|
93
|
+
autoOpenSearch,
|
|
94
|
+
autoExecuteSearch,
|
|
95
|
+
onSearchComplete,
|
|
96
|
+
toolbarActions,
|
|
97
|
+
...props
|
|
98
|
+
}) => {
|
|
99
|
+
const [currentPage, setCurrentPage] = _react.useState.call(void 0, 1);
|
|
100
|
+
const [isLoading, setIsLoading] = _react.useState.call(void 0, false);
|
|
101
|
+
const [error, setError] = _react.useState.call(void 0, null);
|
|
102
|
+
const [fitMode, setFitMode] = _react.useState.call(void 0,
|
|
103
|
+
"fit-page"
|
|
104
|
+
);
|
|
105
|
+
const [zoom, setZoom] = _react.useState.call(void 0, 100);
|
|
106
|
+
const [viewportWidth, setViewportWidth] = _react.useState.call(void 0, 0);
|
|
107
|
+
const [viewportHeight, setViewportHeight] = _react.useState.call(void 0, 0);
|
|
108
|
+
const [isFullScreen, setIsFullScreen] = _react.useState.call(void 0, false);
|
|
109
|
+
const [imageUrl, setImageUrl] = _react.useState.call(void 0, null);
|
|
110
|
+
const [pageImages, setPageImages] = _react.useState.call(void 0, /* @__PURE__ */ new Map());
|
|
111
|
+
const [internalLoading, setInternalLoading] = _react.useState.call(void 0, false);
|
|
112
|
+
const [imageSize, setImageSize] = _react.useState.call(void 0, null);
|
|
113
|
+
const viewportRef = _react.useRef.call(void 0, null);
|
|
114
|
+
const containerRef = _react.useRef.call(void 0, null);
|
|
115
|
+
const imgRef = _react.useRef.call(void 0, null);
|
|
116
|
+
const pageLoaderRef = _react.useRef.call(void 0, pageLoader);
|
|
117
|
+
_react.useEffect.call(void 0, () => {
|
|
118
|
+
pageLoaderRef.current = pageLoader;
|
|
119
|
+
}, [pageLoader]);
|
|
120
|
+
const updatePageImage = _react.useCallback.call(void 0,
|
|
121
|
+
(pageData, pageNumber) => {
|
|
122
|
+
const blob = new Blob([pageData]);
|
|
123
|
+
const imageUrl2 = URL.createObjectURL(blob);
|
|
124
|
+
setPageImages((prev) => {
|
|
125
|
+
const oldUrl = prev.get(pageNumber);
|
|
126
|
+
if (oldUrl && oldUrl !== imageUrl2) {
|
|
127
|
+
URL.revokeObjectURL(oldUrl);
|
|
128
|
+
}
|
|
129
|
+
return new Map(prev).set(pageNumber, imageUrl2);
|
|
130
|
+
});
|
|
131
|
+
setCurrentPage(pageNumber);
|
|
132
|
+
setImageUrl(imageUrl2);
|
|
133
|
+
},
|
|
134
|
+
[]
|
|
135
|
+
);
|
|
136
|
+
_react.useEffect.call(void 0, () => {
|
|
137
|
+
const loadInitialPage = async () => {
|
|
138
|
+
if (pageLoaderRef.current && !pageImages.has(1) && currentPage === 1) {
|
|
139
|
+
setInternalLoading(true);
|
|
140
|
+
setError(null);
|
|
141
|
+
try {
|
|
142
|
+
const pageData = await pageLoaderRef.current(1);
|
|
143
|
+
if (pageData) {
|
|
144
|
+
updatePageImage(pageData, 1);
|
|
145
|
+
} else {
|
|
146
|
+
setError("Failed to load page 1");
|
|
147
|
+
}
|
|
148
|
+
} catch (err) {
|
|
149
|
+
const message = err instanceof Error ? err.message : "Unable to load page 1";
|
|
150
|
+
setError(message);
|
|
151
|
+
_optionalChain([onError, 'optionalCall', _10 => _10(new Error(message))]);
|
|
152
|
+
} finally {
|
|
153
|
+
setInternalLoading(false);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
loadInitialPage();
|
|
158
|
+
}, [pageImages, currentPage, updatePageImage, onError]);
|
|
159
|
+
const handlePageChange = _react.useCallback.call(void 0,
|
|
160
|
+
async (newPageNumber) => {
|
|
161
|
+
if (!pageLoaderRef.current) {
|
|
162
|
+
console.warn("pageLoader not provided - page navigation disabled");
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const cachedUrl = pageImages.get(newPageNumber);
|
|
166
|
+
if (cachedUrl) {
|
|
167
|
+
setCurrentPage(newPageNumber);
|
|
168
|
+
setImageUrl(cachedUrl);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
setInternalLoading(true);
|
|
172
|
+
setError(null);
|
|
173
|
+
try {
|
|
174
|
+
const pageData = await pageLoaderRef.current(newPageNumber);
|
|
175
|
+
if (pageData) {
|
|
176
|
+
updatePageImage(pageData, newPageNumber);
|
|
177
|
+
} else {
|
|
178
|
+
setError(`Failed to load page ${newPageNumber}`);
|
|
179
|
+
}
|
|
180
|
+
} catch (err) {
|
|
181
|
+
const message = err instanceof Error ? err.message : `Unable to load page ${newPageNumber}`;
|
|
182
|
+
setError(message);
|
|
183
|
+
_optionalChain([onError, 'optionalCall', _11 => _11(new Error(message))]);
|
|
184
|
+
} finally {
|
|
185
|
+
setInternalLoading(false);
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
[pageImages, onError, updatePageImage]
|
|
189
|
+
);
|
|
190
|
+
const resolvedFileName = _react.useMemo.call(void 0,
|
|
191
|
+
() => fileName || sourceDescription,
|
|
192
|
+
[fileName, sourceDescription]
|
|
193
|
+
);
|
|
194
|
+
const fileExtension = _react.useMemo.call(void 0,
|
|
195
|
+
() => _chunkYEPEMLM3js.getFileExtension.call(void 0, resolvedFileName || ""),
|
|
196
|
+
[resolvedFileName]
|
|
197
|
+
);
|
|
198
|
+
const loadImage = _react.useCallback.call(void 0,
|
|
199
|
+
async (resetPage = false) => {
|
|
200
|
+
if (!file && !url) {
|
|
201
|
+
setImageUrl(null);
|
|
202
|
+
if (resetPage) setCurrentPage(1);
|
|
203
|
+
setError(null);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
setIsLoading(true);
|
|
207
|
+
setError(null);
|
|
208
|
+
try {
|
|
209
|
+
let imageDataUrl;
|
|
210
|
+
if (file) {
|
|
211
|
+
imageDataUrl = URL.createObjectURL(file);
|
|
212
|
+
} else if (url) {
|
|
213
|
+
imageDataUrl = url;
|
|
214
|
+
} else {
|
|
215
|
+
throw new Error("No file or URL provided");
|
|
216
|
+
}
|
|
217
|
+
setImageUrl(imageDataUrl);
|
|
218
|
+
if (resetPage) {
|
|
219
|
+
setCurrentPage(1);
|
|
220
|
+
setFitMode("fit-page");
|
|
221
|
+
setZoom(100);
|
|
222
|
+
}
|
|
223
|
+
_optionalChain([onLoad, 'optionalCall', _12 => _12()]);
|
|
224
|
+
} catch (err) {
|
|
225
|
+
const message = err instanceof Error ? err.message : "Unable to load image file";
|
|
226
|
+
setError(message);
|
|
227
|
+
setImageUrl(null);
|
|
228
|
+
if (resetPage) {
|
|
229
|
+
setCurrentPage(1);
|
|
230
|
+
setFitMode("fit-width");
|
|
231
|
+
setZoom(100);
|
|
232
|
+
}
|
|
233
|
+
_optionalChain([onError, 'optionalCall', _13 => _13(new Error(message))]);
|
|
234
|
+
} finally {
|
|
235
|
+
setIsLoading(false);
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
[file, url, onLoad, onError]
|
|
239
|
+
);
|
|
240
|
+
const [previousFileSource, setPreviousFileSource] = _react.useState.call(void 0, {});
|
|
241
|
+
_react.useEffect.call(void 0, () => {
|
|
242
|
+
const currentFileSource = { file, url };
|
|
243
|
+
const isNewFile = previousFileSource.file !== file || previousFileSource.url !== url;
|
|
244
|
+
if (isNewFile) {
|
|
245
|
+
setPreviousFileSource(currentFileSource);
|
|
246
|
+
void loadImage(true);
|
|
247
|
+
} else {
|
|
248
|
+
void loadImage(false);
|
|
249
|
+
}
|
|
250
|
+
}, [file, url, loadImage, previousFileSource.file, previousFileSource.url]);
|
|
251
|
+
_react.useEffect.call(void 0, () => {
|
|
252
|
+
return () => {
|
|
253
|
+
pageImages.forEach((url2) => {
|
|
254
|
+
URL.revokeObjectURL(url2);
|
|
255
|
+
});
|
|
256
|
+
if (imageUrl && file && !pageImages.has(currentPage)) {
|
|
257
|
+
URL.revokeObjectURL(imageUrl);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
}, []);
|
|
261
|
+
const hasImage = !!imageUrl;
|
|
262
|
+
const hasMultiplePages = totalPages > 1;
|
|
263
|
+
const MARGIN = 40;
|
|
264
|
+
const MIN_ZOOM = 25;
|
|
265
|
+
const MAX_ZOOM = 400;
|
|
266
|
+
const ZOOM_LEVELS = [25, 50, 75, 100, 125, 150, 200, 300, 400];
|
|
267
|
+
const calculateFitZoom = _react.useCallback.call(void 0,
|
|
268
|
+
(mode) => {
|
|
269
|
+
if (!imageSize || viewportWidth <= 0) return null;
|
|
270
|
+
const availableWidth = viewportWidth - MARGIN;
|
|
271
|
+
if (mode === "fit-width") {
|
|
272
|
+
const calculatedZoom = Math.round(
|
|
273
|
+
availableWidth / imageSize.width * 100
|
|
274
|
+
);
|
|
275
|
+
return Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, calculatedZoom));
|
|
276
|
+
}
|
|
277
|
+
if (mode === "fit-page" && viewportHeight > 0) {
|
|
278
|
+
const availableHeight = viewportHeight - MARGIN;
|
|
279
|
+
const scaleW = availableWidth / imageSize.width;
|
|
280
|
+
const scaleH = availableHeight / imageSize.height;
|
|
281
|
+
const calculatedZoom = Math.round(Math.min(scaleW, scaleH) * 100);
|
|
282
|
+
return Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, calculatedZoom));
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
},
|
|
286
|
+
[imageSize, viewportWidth, viewportHeight]
|
|
287
|
+
);
|
|
288
|
+
_react.useEffect.call(void 0, () => {
|
|
289
|
+
if (!hasImage || !imageSize) return;
|
|
290
|
+
const newZoom = calculateFitZoom(fitMode);
|
|
291
|
+
if (newZoom !== null) {
|
|
292
|
+
setZoom(newZoom);
|
|
293
|
+
}
|
|
294
|
+
}, [currentPage, hasImage, imageSize, fitMode, calculateFitZoom]);
|
|
295
|
+
_react.useEffect.call(void 0, () => {
|
|
296
|
+
if (typeof window === "undefined" || typeof ResizeObserver === "undefined") {
|
|
297
|
+
return void 0;
|
|
298
|
+
}
|
|
299
|
+
if (!viewportRef.current) {
|
|
300
|
+
return void 0;
|
|
301
|
+
}
|
|
302
|
+
const updateSize = () => {
|
|
303
|
+
const bounds = _optionalChain([viewportRef, 'access', _14 => _14.current, 'optionalAccess', _15 => _15.getBoundingClientRect, 'call', _16 => _16()]);
|
|
304
|
+
if (bounds) {
|
|
305
|
+
setViewportWidth(bounds.width);
|
|
306
|
+
setViewportHeight(bounds.height);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
updateSize();
|
|
310
|
+
const observer = new ResizeObserver(updateSize);
|
|
311
|
+
observer.observe(viewportRef.current);
|
|
312
|
+
return () => {
|
|
313
|
+
observer.disconnect();
|
|
314
|
+
};
|
|
315
|
+
}, []);
|
|
316
|
+
const handleZoomIn = _react.useCallback.call(void 0, () => {
|
|
317
|
+
setFitMode("zoom");
|
|
318
|
+
setZoom((value) => {
|
|
319
|
+
const nextLevel = ZOOM_LEVELS.find((level) => level > value);
|
|
320
|
+
return nextLevel || MAX_ZOOM;
|
|
321
|
+
});
|
|
322
|
+
}, []);
|
|
323
|
+
const handleZoomOut = _react.useCallback.call(void 0, () => {
|
|
324
|
+
setFitMode("zoom");
|
|
325
|
+
setZoom((value) => {
|
|
326
|
+
const prevLevel = [...ZOOM_LEVELS].reverse().find((level) => level < value);
|
|
327
|
+
return prevLevel || MIN_ZOOM;
|
|
328
|
+
});
|
|
329
|
+
}, []);
|
|
330
|
+
const handleFitWidth = _react.useCallback.call(void 0, () => {
|
|
331
|
+
setFitMode("fit-width");
|
|
332
|
+
const newZoom = calculateFitZoom("fit-width");
|
|
333
|
+
if (newZoom !== null) {
|
|
334
|
+
setZoom(newZoom);
|
|
335
|
+
}
|
|
336
|
+
}, [calculateFitZoom]);
|
|
337
|
+
const handleFitPage = _react.useCallback.call(void 0, () => {
|
|
338
|
+
setFitMode("fit-page");
|
|
339
|
+
const newZoom = calculateFitZoom("fit-page");
|
|
340
|
+
if (newZoom !== null) {
|
|
341
|
+
setZoom(newZoom);
|
|
342
|
+
}
|
|
343
|
+
}, [calculateFitZoom]);
|
|
344
|
+
const handleFirstPage = _react.useCallback.call(void 0, () => {
|
|
345
|
+
handlePageChange(1);
|
|
346
|
+
}, [handlePageChange]);
|
|
347
|
+
const handleLastPage = _react.useCallback.call(void 0, () => {
|
|
348
|
+
handlePageChange(totalPages);
|
|
349
|
+
}, [handlePageChange, totalPages]);
|
|
350
|
+
const handlePreviousPage = _react.useCallback.call(void 0, () => {
|
|
351
|
+
const newPage = Math.max(currentPage - 1, 1);
|
|
352
|
+
if (newPage !== currentPage) {
|
|
353
|
+
handlePageChange(newPage);
|
|
354
|
+
}
|
|
355
|
+
}, [currentPage, handlePageChange]);
|
|
356
|
+
const handleNextPage = _react.useCallback.call(void 0, () => {
|
|
357
|
+
const newPage = Math.min(currentPage + 1, totalPages);
|
|
358
|
+
if (newPage !== currentPage) {
|
|
359
|
+
handlePageChange(newPage);
|
|
360
|
+
}
|
|
361
|
+
}, [currentPage, totalPages, handlePageChange]);
|
|
362
|
+
const handleToggleFullScreen = _react.useCallback.call(void 0, () => {
|
|
363
|
+
if (!isFullScreen && _optionalChain([containerRef, 'access', _17 => _17.current, 'optionalAccess', _18 => _18.requestFullscreen])) {
|
|
364
|
+
containerRef.current.requestFullscreen();
|
|
365
|
+
setIsFullScreen(true);
|
|
366
|
+
} else if (isFullScreen && document.exitFullscreen) {
|
|
367
|
+
document.exitFullscreen();
|
|
368
|
+
setIsFullScreen(false);
|
|
369
|
+
}
|
|
370
|
+
}, [isFullScreen]);
|
|
371
|
+
const toolbar = _chunkEEIQAW55js.mergeToolbarConfig.call(void 0, {
|
|
372
|
+
showDownload,
|
|
373
|
+
showPrint,
|
|
374
|
+
showMetadata,
|
|
375
|
+
showTags,
|
|
376
|
+
showProperties,
|
|
377
|
+
showHistory,
|
|
378
|
+
onDownloadClick,
|
|
379
|
+
onPrintClick,
|
|
380
|
+
onTagsClick,
|
|
381
|
+
onMetadataClick,
|
|
382
|
+
onPropertiesClick,
|
|
383
|
+
onHistoryClick,
|
|
384
|
+
toolbarActions
|
|
385
|
+
});
|
|
386
|
+
const displayScale = zoom;
|
|
387
|
+
const handleImageLoad = _react.useCallback.call(void 0,
|
|
388
|
+
(e) => {
|
|
389
|
+
const img = e.currentTarget;
|
|
390
|
+
setImageSize({ width: img.naturalWidth, height: img.naturalHeight });
|
|
391
|
+
if (!hasImage) {
|
|
392
|
+
_optionalChain([onLoad, 'optionalCall', _19 => _19()]);
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
[hasImage, onLoad]
|
|
396
|
+
);
|
|
397
|
+
const renderImage = () => {
|
|
398
|
+
if (!imageUrl) {
|
|
399
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", color: "text.secondary", children: "No image available." });
|
|
400
|
+
}
|
|
401
|
+
let imgStyle = {
|
|
402
|
+
display: "block",
|
|
403
|
+
borderRadius: "4px"
|
|
404
|
+
};
|
|
405
|
+
if (imageSize) {
|
|
406
|
+
const zoomFactor = zoom / 100;
|
|
407
|
+
const scaledWidth = imageSize.width * zoomFactor;
|
|
408
|
+
const scaledHeight = imageSize.height * zoomFactor;
|
|
409
|
+
imgStyle = {
|
|
410
|
+
...imgStyle,
|
|
411
|
+
width: `${scaledWidth}px`,
|
|
412
|
+
height: `${scaledHeight}px`,
|
|
413
|
+
maxWidth: "none",
|
|
414
|
+
maxHeight: "none"
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
418
|
+
_material.Box,
|
|
419
|
+
{
|
|
420
|
+
component: "img",
|
|
421
|
+
ref: imgRef,
|
|
422
|
+
src: imageUrl,
|
|
423
|
+
alt: `${resolvedFileName} page ${currentPage}`,
|
|
424
|
+
onLoad: handleImageLoad,
|
|
425
|
+
onError: () => {
|
|
426
|
+
setError("Failed to load image");
|
|
427
|
+
_optionalChain([onError, 'optionalCall', _20 => _20(new Error("Failed to load image"))]);
|
|
428
|
+
},
|
|
429
|
+
sx: {
|
|
430
|
+
...imgStyle,
|
|
431
|
+
boxShadow: 1,
|
|
432
|
+
backgroundColor: "#fff",
|
|
433
|
+
margin: "20px"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
);
|
|
437
|
+
};
|
|
438
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
_material.Box,
|
|
440
|
+
{
|
|
441
|
+
ref: containerRef,
|
|
442
|
+
className: `tiff-viewer ${className}`,
|
|
443
|
+
sx: {
|
|
444
|
+
width,
|
|
445
|
+
height,
|
|
446
|
+
display: "flex",
|
|
447
|
+
flexDirection: "column",
|
|
448
|
+
overflow: "hidden",
|
|
449
|
+
...style
|
|
450
|
+
},
|
|
451
|
+
...props,
|
|
452
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
453
|
+
_material.Card,
|
|
454
|
+
{
|
|
455
|
+
sx: {
|
|
456
|
+
height: "100%",
|
|
457
|
+
width: "100%",
|
|
458
|
+
display: "flex",
|
|
459
|
+
flexDirection: "column",
|
|
460
|
+
overflow: "hidden"
|
|
461
|
+
},
|
|
462
|
+
elevation: 1,
|
|
463
|
+
children: [
|
|
464
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
465
|
+
_material.CardHeader,
|
|
466
|
+
{
|
|
467
|
+
avatar: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEEIQAW55js.FileIcon_default, { ext: fileExtension, size: 32 }),
|
|
468
|
+
title: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "subtitle1", fontWeight: 500, children: resolvedFileName }),
|
|
469
|
+
sx: { pb: 1 }
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { px: 2, pb: 1, display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
473
|
+
_material.Stack,
|
|
474
|
+
{
|
|
475
|
+
direction: "row",
|
|
476
|
+
spacing: 1,
|
|
477
|
+
alignItems: "center",
|
|
478
|
+
flexWrap: "wrap",
|
|
479
|
+
gap: 1,
|
|
480
|
+
children: [
|
|
481
|
+
hasMultiplePages && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
482
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
483
|
+
_material.IconButton,
|
|
484
|
+
{
|
|
485
|
+
size: "small",
|
|
486
|
+
onClick: handleFirstPage,
|
|
487
|
+
disabled: currentPage === 1,
|
|
488
|
+
title: "First Page",
|
|
489
|
+
"aria-label": "Go to first page",
|
|
490
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FirstPage2.default, { fontSize: "small" })
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
494
|
+
_material.IconButton,
|
|
495
|
+
{
|
|
496
|
+
size: "small",
|
|
497
|
+
onClick: handlePreviousPage,
|
|
498
|
+
disabled: currentPage === 1,
|
|
499
|
+
title: "Previous Page",
|
|
500
|
+
"aria-label": "Go to previous page",
|
|
501
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronLeft2.default, { fontSize: "small" })
|
|
502
|
+
}
|
|
503
|
+
),
|
|
504
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
505
|
+
_material.Typography,
|
|
506
|
+
{
|
|
507
|
+
variant: "body2",
|
|
508
|
+
color: "text.secondary",
|
|
509
|
+
sx: { minWidth: 100, textAlign: "center" },
|
|
510
|
+
children: [
|
|
511
|
+
"Page ",
|
|
512
|
+
currentPage,
|
|
513
|
+
" of ",
|
|
514
|
+
totalPages
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
519
|
+
_material.IconButton,
|
|
520
|
+
{
|
|
521
|
+
size: "small",
|
|
522
|
+
onClick: handleNextPage,
|
|
523
|
+
disabled: currentPage === totalPages,
|
|
524
|
+
title: "Next Page",
|
|
525
|
+
"aria-label": "Go to next page",
|
|
526
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronRight2.default, { fontSize: "small" })
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
530
|
+
_material.IconButton,
|
|
531
|
+
{
|
|
532
|
+
size: "small",
|
|
533
|
+
onClick: handleLastPage,
|
|
534
|
+
disabled: currentPage === totalPages,
|
|
535
|
+
title: "Last Page",
|
|
536
|
+
"aria-label": "Go to last page",
|
|
537
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _LastPage2.default, { fontSize: "small" })
|
|
538
|
+
}
|
|
539
|
+
),
|
|
540
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 1 } })
|
|
541
|
+
] }),
|
|
542
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
543
|
+
_material.IconButton,
|
|
544
|
+
{
|
|
545
|
+
size: "small",
|
|
546
|
+
onClick: handleZoomOut,
|
|
547
|
+
disabled: !hasImage || zoom <= 25,
|
|
548
|
+
title: "Zoom Out",
|
|
549
|
+
"aria-label": "Zoom out",
|
|
550
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ZoomOut2.default, { fontSize: "small" })
|
|
551
|
+
}
|
|
552
|
+
),
|
|
553
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
554
|
+
_material.Typography,
|
|
555
|
+
{
|
|
556
|
+
variant: "body2",
|
|
557
|
+
color: "text.secondary",
|
|
558
|
+
sx: { minWidth: 64, textAlign: "center" },
|
|
559
|
+
children: hasImage ? `${displayScale}%` : "\u2014"
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
563
|
+
_material.IconButton,
|
|
564
|
+
{
|
|
565
|
+
size: "small",
|
|
566
|
+
onClick: handleZoomIn,
|
|
567
|
+
disabled: !hasImage || zoom >= 400,
|
|
568
|
+
title: "Zoom In",
|
|
569
|
+
"aria-label": "Zoom in",
|
|
570
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ZoomIn2.default, { fontSize: "small" })
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
574
|
+
_material.IconButton,
|
|
575
|
+
{
|
|
576
|
+
size: "small",
|
|
577
|
+
onClick: handleFitWidth,
|
|
578
|
+
disabled: !hasImage,
|
|
579
|
+
title: "Fit to Width",
|
|
580
|
+
"aria-label": "Fit to width",
|
|
581
|
+
color: fitMode === "fit-width" ? "primary" : "default",
|
|
582
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _AspectRatio2.default, { fontSize: "small" })
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
586
|
+
_material.IconButton,
|
|
587
|
+
{
|
|
588
|
+
size: "small",
|
|
589
|
+
onClick: handleFitPage,
|
|
590
|
+
disabled: !hasImage,
|
|
591
|
+
title: "Fit to Page",
|
|
592
|
+
"aria-label": "Fit to page",
|
|
593
|
+
color: fitMode === "fit-page" ? "primary" : "default",
|
|
594
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FitScreen2.default, { fontSize: "small" })
|
|
595
|
+
}
|
|
596
|
+
),
|
|
597
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 1 } }),
|
|
598
|
+
!toolbar.isHidden("download") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
599
|
+
_material.IconButton,
|
|
600
|
+
{
|
|
601
|
+
size: "small",
|
|
602
|
+
onClick: toolbar.getHandler("download", onDownloadClick),
|
|
603
|
+
disabled: toolbar.isDisabled("download"),
|
|
604
|
+
title: toolbar.getLabel("download") || "Download",
|
|
605
|
+
"aria-label": "Download TIFF",
|
|
606
|
+
children: toolbar.getIcon("download") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Download2.default, { fontSize: "small" })
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
!toolbar.isHidden("print") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
610
|
+
_material.IconButton,
|
|
611
|
+
{
|
|
612
|
+
size: "small",
|
|
613
|
+
onClick: toolbar.getHandler("print", onPrintClick),
|
|
614
|
+
disabled: toolbar.isDisabled("print"),
|
|
615
|
+
title: toolbar.getLabel("print") || "Print",
|
|
616
|
+
"aria-label": "Print TIFF",
|
|
617
|
+
children: toolbar.getIcon("print") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Print2.default, { fontSize: "small" })
|
|
618
|
+
}
|
|
619
|
+
),
|
|
620
|
+
!toolbar.isHidden("fullscreen") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
621
|
+
_material.IconButton,
|
|
622
|
+
{
|
|
623
|
+
size: "small",
|
|
624
|
+
onClick: toolbar.getHandler(
|
|
625
|
+
"fullscreen",
|
|
626
|
+
handleToggleFullScreen
|
|
627
|
+
),
|
|
628
|
+
disabled: toolbar.isDisabled("fullscreen"),
|
|
629
|
+
title: toolbar.getLabel("fullscreen") || "Fullscreen",
|
|
630
|
+
"aria-label": "Toggle fullscreen",
|
|
631
|
+
children: toolbar.getIcon("fullscreen") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Fullscreen2.default, { fontSize: "small" })
|
|
632
|
+
}
|
|
633
|
+
),
|
|
634
|
+
!toolbar.isHidden("metadata") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
635
|
+
_material.IconButton,
|
|
636
|
+
{
|
|
637
|
+
size: "small",
|
|
638
|
+
onClick: toolbar.getHandler("metadata", onMetadataClick),
|
|
639
|
+
disabled: toolbar.isDisabled("metadata"),
|
|
640
|
+
title: toolbar.getLabel("metadata") || "Document Metadata",
|
|
641
|
+
"aria-label": "View document metadata",
|
|
642
|
+
children: toolbar.getIcon("metadata") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Description2.default, { fontSize: "small" })
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
!toolbar.isHidden("properties") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
646
|
+
_material.IconButton,
|
|
647
|
+
{
|
|
648
|
+
size: "small",
|
|
649
|
+
onClick: toolbar.getHandler("properties", onPropertiesClick),
|
|
650
|
+
disabled: toolbar.isDisabled("properties"),
|
|
651
|
+
title: toolbar.getLabel("properties") || "Document Properties",
|
|
652
|
+
"aria-label": "View document properties",
|
|
653
|
+
children: toolbar.getIcon("properties") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Info2.default, { fontSize: "small" })
|
|
654
|
+
}
|
|
655
|
+
),
|
|
656
|
+
!toolbar.isHidden("tags") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
+
_material.IconButton,
|
|
658
|
+
{
|
|
659
|
+
size: "small",
|
|
660
|
+
onClick: toolbar.getHandler("tags", onTagsClick),
|
|
661
|
+
disabled: toolbar.isDisabled("tags"),
|
|
662
|
+
title: toolbar.getLabel("tags") || "Document Tags",
|
|
663
|
+
"aria-label": "View document tags",
|
|
664
|
+
children: toolbar.getIcon("tags") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.LocalOffer, { fontSize: "small" })
|
|
665
|
+
}
|
|
666
|
+
),
|
|
667
|
+
!toolbar.isHidden("history") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
668
|
+
_material.IconButton,
|
|
669
|
+
{
|
|
670
|
+
size: "small",
|
|
671
|
+
onClick: toolbar.getHandler("history", onHistoryClick),
|
|
672
|
+
disabled: toolbar.isDisabled("history"),
|
|
673
|
+
title: toolbar.getLabel("history") || "Document History",
|
|
674
|
+
"aria-label": "View document history",
|
|
675
|
+
children: toolbar.getIcon("history") || /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _History2.default, { fontSize: "small" })
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
) }),
|
|
681
|
+
(isLoading || internalLoading) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.LinearProgress, { sx: { mx: 3, mb: 1 } }),
|
|
682
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { color: "error", variant: "body2", sx: { px: 3, pb: 1 }, children: error }),
|
|
683
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, {}),
|
|
684
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
685
|
+
_material.CardContent,
|
|
686
|
+
{
|
|
687
|
+
sx: {
|
|
688
|
+
flexGrow: 1,
|
|
689
|
+
flexShrink: 1,
|
|
690
|
+
minHeight: 0,
|
|
691
|
+
p: 0,
|
|
692
|
+
overflow: "hidden",
|
|
693
|
+
backgroundColor: "#f6f8fa",
|
|
694
|
+
position: "relative"
|
|
695
|
+
},
|
|
696
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
697
|
+
_material.Box,
|
|
698
|
+
{
|
|
699
|
+
ref: viewportRef,
|
|
700
|
+
sx: {
|
|
701
|
+
position: "absolute",
|
|
702
|
+
top: 0,
|
|
703
|
+
left: 0,
|
|
704
|
+
right: 0,
|
|
705
|
+
bottom: 0,
|
|
706
|
+
overflow: "auto"
|
|
707
|
+
},
|
|
708
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
709
|
+
_material.Box,
|
|
710
|
+
{
|
|
711
|
+
sx: {
|
|
712
|
+
minWidth: "100%",
|
|
713
|
+
minHeight: "100%",
|
|
714
|
+
display: "flex",
|
|
715
|
+
alignItems: "center",
|
|
716
|
+
justifyContent: "center"
|
|
717
|
+
},
|
|
718
|
+
children: renderImage()
|
|
719
|
+
}
|
|
720
|
+
)
|
|
721
|
+
}
|
|
722
|
+
)
|
|
723
|
+
}
|
|
724
|
+
)
|
|
725
|
+
]
|
|
726
|
+
}
|
|
727
|
+
)
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
};
|
|
731
|
+
var TIFFViewer = (props) => {
|
|
732
|
+
const sourceDescription = _react.useMemo.call(void 0,
|
|
733
|
+
() => resolveDocumentName(props.file, props.fileName, props.url),
|
|
734
|
+
[props.file, props.fileName, props.url]
|
|
735
|
+
);
|
|
736
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TIFFViewerContent, { ...props, sourceDescription });
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
exports.TIFFViewer = TIFFViewer;
|
|
742
|
+
//# sourceMappingURL=chunk-7S4B534E.js.map
|