pdfjs-reader-core 0.2.5 → 0.2.7
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/index.cjs +460 -275
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +367 -183
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -324,6 +324,7 @@ function createViewerStore(initialOverrides = {}) {
|
|
|
324
324
|
document: document2,
|
|
325
325
|
numPages: document2.numPages,
|
|
326
326
|
isLoading: false,
|
|
327
|
+
loadingProgress: null,
|
|
327
328
|
error: null,
|
|
328
329
|
currentPage: 1
|
|
329
330
|
});
|
|
@@ -331,15 +332,22 @@ function createViewerStore(initialOverrides = {}) {
|
|
|
331
332
|
set({
|
|
332
333
|
document: null,
|
|
333
334
|
numPages: 0,
|
|
334
|
-
isLoading: false
|
|
335
|
+
isLoading: false,
|
|
336
|
+
loadingProgress: null
|
|
335
337
|
});
|
|
336
338
|
}
|
|
337
339
|
},
|
|
338
|
-
setLoading: (isLoading) => {
|
|
339
|
-
set({
|
|
340
|
+
setLoading: (isLoading, progress) => {
|
|
341
|
+
set({
|
|
342
|
+
isLoading,
|
|
343
|
+
loadingProgress: isLoading ? progress ?? { phase: "initializing" } : null
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
setLoadingProgress: (progress) => {
|
|
347
|
+
set({ loadingProgress: progress });
|
|
340
348
|
},
|
|
341
349
|
setError: (error) => {
|
|
342
|
-
set({ error, isLoading: false });
|
|
350
|
+
set({ error, isLoading: false, loadingProgress: null });
|
|
343
351
|
},
|
|
344
352
|
// Navigation actions
|
|
345
353
|
setCurrentPage: (page) => {
|
|
@@ -486,6 +494,7 @@ var init_viewer_store = __esm({
|
|
|
486
494
|
document: null,
|
|
487
495
|
numPages: 0,
|
|
488
496
|
isLoading: false,
|
|
497
|
+
loadingProgress: null,
|
|
489
498
|
error: null,
|
|
490
499
|
// Navigation state
|
|
491
500
|
currentPage: 1,
|
|
@@ -4731,7 +4740,7 @@ var init_ThumbnailPanel = __esm({
|
|
|
4731
4740
|
className,
|
|
4732
4741
|
thumbnailScale = 0.2
|
|
4733
4742
|
}) {
|
|
4734
|
-
const { document: document2, currentPage, numPages, goToPage } = usePDFViewer();
|
|
4743
|
+
const { document: document2, currentPage, numPages, goToPage, isLoading } = usePDFViewer();
|
|
4735
4744
|
const containerRef = useRef7(null);
|
|
4736
4745
|
useEffect9(() => {
|
|
4737
4746
|
const container = containerRef.current;
|
|
@@ -4748,6 +4757,9 @@ var init_ThumbnailPanel = __esm({
|
|
|
4748
4757
|
[goToPage]
|
|
4749
4758
|
);
|
|
4750
4759
|
if (!document2) {
|
|
4760
|
+
if (isLoading) {
|
|
4761
|
+
return null;
|
|
4762
|
+
}
|
|
4751
4763
|
return /* @__PURE__ */ jsx4("div", { className: cn("thumbnail-panel p-4", className), children: /* @__PURE__ */ jsx4("div", { className: "text-sm text-gray-500", children: "No document loaded" }) });
|
|
4752
4764
|
}
|
|
4753
4765
|
return /* @__PURE__ */ jsx4(
|
|
@@ -5079,7 +5091,7 @@ var init_OutlinePanel = __esm({
|
|
|
5079
5091
|
OutlinePanel = memo5(function OutlinePanel2({
|
|
5080
5092
|
className
|
|
5081
5093
|
}) {
|
|
5082
|
-
const { document: document2, goToPage } = usePDFViewer();
|
|
5094
|
+
const { document: document2, goToPage, isLoading: isDocumentLoading } = usePDFViewer();
|
|
5083
5095
|
const [outline, setOutline] = useState8(null);
|
|
5084
5096
|
const [isLoading, setIsLoading] = useState8(false);
|
|
5085
5097
|
const [error, setError] = useState8(null);
|
|
@@ -5158,6 +5170,9 @@ var init_OutlinePanel = __esm({
|
|
|
5158
5170
|
[goToPage]
|
|
5159
5171
|
);
|
|
5160
5172
|
if (!document2) {
|
|
5173
|
+
if (isDocumentLoading) {
|
|
5174
|
+
return null;
|
|
5175
|
+
}
|
|
5161
5176
|
return /* @__PURE__ */ jsx6("div", { className: cn("flex items-center justify-center p-4", className), children: /* @__PURE__ */ jsx6("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "No document loaded" }) });
|
|
5162
5177
|
}
|
|
5163
5178
|
if (isLoading) {
|
|
@@ -8197,6 +8212,7 @@ var init_DocumentContainer = __esm({
|
|
|
8197
8212
|
scale,
|
|
8198
8213
|
rotation,
|
|
8199
8214
|
theme,
|
|
8215
|
+
isLoading,
|
|
8200
8216
|
setScale,
|
|
8201
8217
|
nextPage,
|
|
8202
8218
|
previousPage
|
|
@@ -8336,6 +8352,9 @@ var init_DocumentContainer = __esm({
|
|
|
8336
8352
|
sepia: "bg-amber-50"
|
|
8337
8353
|
};
|
|
8338
8354
|
if (!document2) {
|
|
8355
|
+
if (isLoading) {
|
|
8356
|
+
return null;
|
|
8357
|
+
}
|
|
8339
8358
|
return /* @__PURE__ */ jsx21(
|
|
8340
8359
|
"div",
|
|
8341
8360
|
{
|
|
@@ -8428,6 +8447,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8428
8447
|
scale,
|
|
8429
8448
|
rotation,
|
|
8430
8449
|
theme,
|
|
8450
|
+
isLoading,
|
|
8431
8451
|
setScale,
|
|
8432
8452
|
goToPage,
|
|
8433
8453
|
nextPage,
|
|
@@ -8683,6 +8703,9 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8683
8703
|
sepia: "bg-amber-50"
|
|
8684
8704
|
};
|
|
8685
8705
|
if (!document2) {
|
|
8706
|
+
if (isLoading) {
|
|
8707
|
+
return null;
|
|
8708
|
+
}
|
|
8686
8709
|
return /* @__PURE__ */ jsx22(
|
|
8687
8710
|
"div",
|
|
8688
8711
|
{
|
|
@@ -8829,6 +8852,7 @@ var init_DualPageContainer = __esm({
|
|
|
8829
8852
|
scale,
|
|
8830
8853
|
rotation,
|
|
8831
8854
|
theme,
|
|
8855
|
+
isLoading: isDocumentLoading,
|
|
8832
8856
|
setScale,
|
|
8833
8857
|
goToPage
|
|
8834
8858
|
} = usePDFViewer();
|
|
@@ -9020,6 +9044,9 @@ var init_DualPageContainer = __esm({
|
|
|
9020
9044
|
};
|
|
9021
9045
|
const spread = getSpreadPages(currentPage);
|
|
9022
9046
|
if (!document2) {
|
|
9047
|
+
if (isDocumentLoading) {
|
|
9048
|
+
return null;
|
|
9049
|
+
}
|
|
9023
9050
|
return /* @__PURE__ */ jsx24(
|
|
9024
9051
|
"div",
|
|
9025
9052
|
{
|
|
@@ -9258,6 +9285,138 @@ var init_FloatingZoomControls2 = __esm({
|
|
|
9258
9285
|
}
|
|
9259
9286
|
});
|
|
9260
9287
|
|
|
9288
|
+
// src/components/PDFLoadingScreen/PDFLoadingScreen.tsx
|
|
9289
|
+
import { memo as memo25 } from "react";
|
|
9290
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9291
|
+
function formatBytes(bytes) {
|
|
9292
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
9293
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
9294
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
9295
|
+
}
|
|
9296
|
+
var phaseMessages, PDFLoadingScreen;
|
|
9297
|
+
var init_PDFLoadingScreen = __esm({
|
|
9298
|
+
"src/components/PDFLoadingScreen/PDFLoadingScreen.tsx"() {
|
|
9299
|
+
"use strict";
|
|
9300
|
+
init_utils();
|
|
9301
|
+
phaseMessages = {
|
|
9302
|
+
initializing: "Initializing...",
|
|
9303
|
+
fetching: "Loading document...",
|
|
9304
|
+
parsing: "Processing pages...",
|
|
9305
|
+
rendering: "Preparing view..."
|
|
9306
|
+
};
|
|
9307
|
+
PDFLoadingScreen = memo25(function PDFLoadingScreen2({
|
|
9308
|
+
progress,
|
|
9309
|
+
bytesLoaded,
|
|
9310
|
+
totalBytes,
|
|
9311
|
+
phase = "fetching",
|
|
9312
|
+
documentName,
|
|
9313
|
+
className
|
|
9314
|
+
}) {
|
|
9315
|
+
const hasProgress = progress !== void 0 && progress >= 0;
|
|
9316
|
+
const hasBytes = bytesLoaded !== void 0 && totalBytes !== void 0 && totalBytes > 0;
|
|
9317
|
+
return /* @__PURE__ */ jsxs22(
|
|
9318
|
+
"div",
|
|
9319
|
+
{
|
|
9320
|
+
className: cn(
|
|
9321
|
+
"pdf-loading-screen",
|
|
9322
|
+
"flex flex-col items-center justify-center",
|
|
9323
|
+
"w-full h-full min-h-[400px]",
|
|
9324
|
+
"bg-slate-50 dark:bg-slate-800",
|
|
9325
|
+
className
|
|
9326
|
+
),
|
|
9327
|
+
role: "status",
|
|
9328
|
+
"aria-live": "polite",
|
|
9329
|
+
"aria-label": phaseMessages[phase],
|
|
9330
|
+
children: [
|
|
9331
|
+
/* @__PURE__ */ jsxs22("div", { className: "pdf-loading-skeleton", children: [
|
|
9332
|
+
/* @__PURE__ */ jsx26("div", { className: "pdf-loading-icon", children: /* @__PURE__ */ jsxs22(
|
|
9333
|
+
"svg",
|
|
9334
|
+
{
|
|
9335
|
+
width: "48",
|
|
9336
|
+
height: "56",
|
|
9337
|
+
viewBox: "0 0 48 56",
|
|
9338
|
+
fill: "none",
|
|
9339
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9340
|
+
className: "pdf-document-icon",
|
|
9341
|
+
children: [
|
|
9342
|
+
/* @__PURE__ */ jsx26(
|
|
9343
|
+
"path",
|
|
9344
|
+
{
|
|
9345
|
+
d: "M4 4C4 1.79086 5.79086 0 8 0H30L44 14V52C44 54.2091 42.2091 56 40 56H8C5.79086 56 4 54.2091 4 52V4Z",
|
|
9346
|
+
className: "fill-white dark:fill-slate-700"
|
|
9347
|
+
}
|
|
9348
|
+
),
|
|
9349
|
+
/* @__PURE__ */ jsx26(
|
|
9350
|
+
"path",
|
|
9351
|
+
{
|
|
9352
|
+
d: "M30 0L44 14H34C31.7909 14 30 12.2091 30 10V0Z",
|
|
9353
|
+
className: "fill-slate-200 dark:fill-slate-600"
|
|
9354
|
+
}
|
|
9355
|
+
),
|
|
9356
|
+
/* @__PURE__ */ jsx26("rect", { x: "10", y: "22", width: "24", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
9357
|
+
/* @__PURE__ */ jsx26("rect", { x: "10", y: "28", width: "20", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
9358
|
+
/* @__PURE__ */ jsx26("rect", { x: "10", y: "34", width: "22", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
9359
|
+
/* @__PURE__ */ jsx26("rect", { x: "10", y: "40", width: "16", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
9360
|
+
/* @__PURE__ */ jsx26(
|
|
9361
|
+
"path",
|
|
9362
|
+
{
|
|
9363
|
+
d: "M4 4C4 1.79086 5.79086 0 8 0H30L44 14V52C44 54.2091 42.2091 56 40 56H8C5.79086 56 4 54.2091 4 52V4Z",
|
|
9364
|
+
className: "stroke-slate-300 dark:stroke-slate-500",
|
|
9365
|
+
strokeWidth: "1",
|
|
9366
|
+
fill: "none"
|
|
9367
|
+
}
|
|
9368
|
+
)
|
|
9369
|
+
]
|
|
9370
|
+
}
|
|
9371
|
+
) }),
|
|
9372
|
+
/* @__PURE__ */ jsxs22("div", { className: "pdf-skeleton-lines", children: [
|
|
9373
|
+
/* @__PURE__ */ jsx26("div", { className: "pdf-skeleton-line pdf-skeleton-line-1" }),
|
|
9374
|
+
/* @__PURE__ */ jsx26("div", { className: "pdf-skeleton-line pdf-skeleton-line-2" }),
|
|
9375
|
+
/* @__PURE__ */ jsx26("div", { className: "pdf-skeleton-line pdf-skeleton-line-3" })
|
|
9376
|
+
] })
|
|
9377
|
+
] }),
|
|
9378
|
+
/* @__PURE__ */ jsxs22("div", { className: "pdf-loading-info", children: [
|
|
9379
|
+
documentName && /* @__PURE__ */ jsx26("p", { className: "pdf-loading-document-name", children: documentName }),
|
|
9380
|
+
/* @__PURE__ */ jsx26("p", { className: "pdf-loading-message", children: phaseMessages[phase] }),
|
|
9381
|
+
/* @__PURE__ */ jsxs22("div", { className: "pdf-loading-progress-container", children: [
|
|
9382
|
+
/* @__PURE__ */ jsx26("div", { className: "pdf-loading-progress-track", children: /* @__PURE__ */ jsx26(
|
|
9383
|
+
"div",
|
|
9384
|
+
{
|
|
9385
|
+
className: cn(
|
|
9386
|
+
"pdf-loading-progress-fill",
|
|
9387
|
+
!hasProgress && "pdf-loading-progress-indeterminate"
|
|
9388
|
+
),
|
|
9389
|
+
style: hasProgress ? { width: `${Math.min(100, progress)}%` } : void 0
|
|
9390
|
+
}
|
|
9391
|
+
) }),
|
|
9392
|
+
/* @__PURE__ */ jsxs22("div", { className: "pdf-loading-progress-details", children: [
|
|
9393
|
+
hasProgress && /* @__PURE__ */ jsxs22("span", { className: "pdf-loading-progress-percent", children: [
|
|
9394
|
+
Math.round(progress),
|
|
9395
|
+
"%"
|
|
9396
|
+
] }),
|
|
9397
|
+
hasBytes && /* @__PURE__ */ jsxs22("span", { className: "pdf-loading-progress-bytes", children: [
|
|
9398
|
+
formatBytes(bytesLoaded),
|
|
9399
|
+
" / ",
|
|
9400
|
+
formatBytes(totalBytes)
|
|
9401
|
+
] })
|
|
9402
|
+
] })
|
|
9403
|
+
] })
|
|
9404
|
+
] })
|
|
9405
|
+
]
|
|
9406
|
+
}
|
|
9407
|
+
);
|
|
9408
|
+
});
|
|
9409
|
+
}
|
|
9410
|
+
});
|
|
9411
|
+
|
|
9412
|
+
// src/components/PDFLoadingScreen/index.ts
|
|
9413
|
+
var init_PDFLoadingScreen2 = __esm({
|
|
9414
|
+
"src/components/PDFLoadingScreen/index.ts"() {
|
|
9415
|
+
"use strict";
|
|
9416
|
+
init_PDFLoadingScreen();
|
|
9417
|
+
}
|
|
9418
|
+
});
|
|
9419
|
+
|
|
9261
9420
|
// src/components/PDFViewer/PDFViewerClient.tsx
|
|
9262
9421
|
var PDFViewerClient_exports = {};
|
|
9263
9422
|
__export(PDFViewerClient_exports, {
|
|
@@ -9266,12 +9425,12 @@ __export(PDFViewerClient_exports, {
|
|
|
9266
9425
|
import {
|
|
9267
9426
|
useEffect as useEffect22,
|
|
9268
9427
|
useCallback as useCallback33,
|
|
9269
|
-
memo as
|
|
9428
|
+
memo as memo26,
|
|
9270
9429
|
useRef as useRef19,
|
|
9271
9430
|
useState as useState21,
|
|
9272
9431
|
forwardRef
|
|
9273
9432
|
} from "react";
|
|
9274
|
-
import { jsx as
|
|
9433
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9275
9434
|
function getSrcIdentifier(src) {
|
|
9276
9435
|
if (typeof src === "string") {
|
|
9277
9436
|
return src;
|
|
@@ -9324,8 +9483,9 @@ var init_PDFViewerClient = __esm({
|
|
|
9324
9483
|
init_ContinuousScrollContainer();
|
|
9325
9484
|
init_DualPageContainer();
|
|
9326
9485
|
init_FloatingZoomControls2();
|
|
9486
|
+
init_PDFLoadingScreen2();
|
|
9327
9487
|
init_utils();
|
|
9328
|
-
PDFViewerInner =
|
|
9488
|
+
PDFViewerInner = memo26(function PDFViewerInner2({
|
|
9329
9489
|
src,
|
|
9330
9490
|
initialPage = 1,
|
|
9331
9491
|
page: controlledPage,
|
|
@@ -9383,6 +9543,7 @@ var init_PDFViewerClient = __esm({
|
|
|
9383
9543
|
const scale = useViewerStore((s) => s.scale);
|
|
9384
9544
|
const theme = useViewerStore((s) => s.theme);
|
|
9385
9545
|
const isLoading = useViewerStore((s) => s.isLoading);
|
|
9546
|
+
const loadingProgress = useViewerStore((s) => s.loadingProgress);
|
|
9386
9547
|
const error = useViewerStore((s) => s.error);
|
|
9387
9548
|
const sidebarOpen = useViewerStore((s) => s.sidebarOpen);
|
|
9388
9549
|
const srcId = getSrcIdentifier(src);
|
|
@@ -9830,13 +9991,27 @@ var init_PDFViewerClient = __esm({
|
|
|
9830
9991
|
const loadDoc = async () => {
|
|
9831
9992
|
if (!mountedRef.current) return;
|
|
9832
9993
|
try {
|
|
9833
|
-
viewerStore.getState().setLoading(true);
|
|
9994
|
+
viewerStore.getState().setLoading(true, { phase: "fetching" });
|
|
9834
9995
|
viewerStore.getState().setError(null);
|
|
9835
9996
|
setLoadState("loading");
|
|
9836
9997
|
const { document: document2, numPages } = await loadDocument({
|
|
9837
9998
|
src,
|
|
9838
|
-
workerSrc
|
|
9999
|
+
workerSrc,
|
|
10000
|
+
onProgress: ({ loaded, total }) => {
|
|
10001
|
+
if (mountedRef.current && srcIdRef.current === loadId) {
|
|
10002
|
+
const percent = total > 0 ? Math.round(loaded / total * 100) : void 0;
|
|
10003
|
+
viewerStore.getState().setLoadingProgress({
|
|
10004
|
+
phase: "fetching",
|
|
10005
|
+
percent,
|
|
10006
|
+
bytesLoaded: loaded,
|
|
10007
|
+
totalBytes: total
|
|
10008
|
+
});
|
|
10009
|
+
}
|
|
10010
|
+
}
|
|
9839
10011
|
});
|
|
10012
|
+
if (mountedRef.current && srcIdRef.current === loadId) {
|
|
10013
|
+
viewerStore.getState().setLoadingProgress({ phase: "parsing", percent: 100 });
|
|
10014
|
+
}
|
|
9840
10015
|
if (mountedRef.current && srcIdRef.current === loadId) {
|
|
9841
10016
|
viewerStore.getState().setDocument(document2);
|
|
9842
10017
|
setLoadState("loaded");
|
|
@@ -9896,7 +10071,7 @@ var init_PDFViewerClient = __esm({
|
|
|
9896
10071
|
if (error) {
|
|
9897
10072
|
if (errorComponent) {
|
|
9898
10073
|
const errorContent = typeof errorComponent === "function" ? errorComponent(error, handleRetry) : errorComponent;
|
|
9899
|
-
return /* @__PURE__ */
|
|
10074
|
+
return /* @__PURE__ */ jsx27(
|
|
9900
10075
|
"div",
|
|
9901
10076
|
{
|
|
9902
10077
|
className: cn(
|
|
@@ -9910,7 +10085,7 @@ var init_PDFViewerClient = __esm({
|
|
|
9910
10085
|
}
|
|
9911
10086
|
);
|
|
9912
10087
|
}
|
|
9913
|
-
return /* @__PURE__ */
|
|
10088
|
+
return /* @__PURE__ */ jsx27(
|
|
9914
10089
|
"div",
|
|
9915
10090
|
{
|
|
9916
10091
|
className: cn(
|
|
@@ -9920,10 +10095,10 @@ var init_PDFViewerClient = __esm({
|
|
|
9920
10095
|
themeClass,
|
|
9921
10096
|
className
|
|
9922
10097
|
),
|
|
9923
|
-
children: /* @__PURE__ */
|
|
9924
|
-
/* @__PURE__ */
|
|
9925
|
-
/* @__PURE__ */
|
|
9926
|
-
/* @__PURE__ */
|
|
10098
|
+
children: /* @__PURE__ */ jsx27("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs23("div", { className: "text-center p-8", children: [
|
|
10099
|
+
/* @__PURE__ */ jsx27("div", { className: "text-red-500 text-lg font-semibold mb-2", children: "Failed to load PDF" }),
|
|
10100
|
+
/* @__PURE__ */ jsx27("div", { className: "text-gray-500 text-sm", children: error.message }),
|
|
10101
|
+
/* @__PURE__ */ jsx27(
|
|
9927
10102
|
"button",
|
|
9928
10103
|
{
|
|
9929
10104
|
onClick: handleRetry,
|
|
@@ -9938,15 +10113,15 @@ var init_PDFViewerClient = __esm({
|
|
|
9938
10113
|
const renderContainer = () => {
|
|
9939
10114
|
switch (viewMode) {
|
|
9940
10115
|
case "continuous":
|
|
9941
|
-
return /* @__PURE__ */
|
|
10116
|
+
return /* @__PURE__ */ jsx27(ContinuousScrollContainer, {});
|
|
9942
10117
|
case "dual":
|
|
9943
|
-
return /* @__PURE__ */
|
|
10118
|
+
return /* @__PURE__ */ jsx27(DualPageContainer, {});
|
|
9944
10119
|
case "single":
|
|
9945
10120
|
default:
|
|
9946
|
-
return /* @__PURE__ */
|
|
10121
|
+
return /* @__PURE__ */ jsx27(DocumentContainer, {});
|
|
9947
10122
|
}
|
|
9948
10123
|
};
|
|
9949
|
-
return /* @__PURE__ */
|
|
10124
|
+
return /* @__PURE__ */ jsxs23(
|
|
9950
10125
|
"div",
|
|
9951
10126
|
{
|
|
9952
10127
|
className: cn(
|
|
@@ -9958,17 +10133,22 @@ var init_PDFViewerClient = __esm({
|
|
|
9958
10133
|
className
|
|
9959
10134
|
),
|
|
9960
10135
|
children: [
|
|
9961
|
-
showToolbar && /* @__PURE__ */
|
|
9962
|
-
showAnnotationToolbar && /* @__PURE__ */
|
|
9963
|
-
/* @__PURE__ */
|
|
9964
|
-
showSidebar && sidebarOpen && /* @__PURE__ */
|
|
10136
|
+
showToolbar && /* @__PURE__ */ jsx27(Toolbar, {}),
|
|
10137
|
+
showAnnotationToolbar && /* @__PURE__ */ jsx27(AnnotationToolbar, {}),
|
|
10138
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
10139
|
+
showSidebar && sidebarOpen && /* @__PURE__ */ jsx27(Sidebar, {}),
|
|
9965
10140
|
renderContainer()
|
|
9966
10141
|
] }),
|
|
9967
|
-
showFloatingZoom && /* @__PURE__ */
|
|
9968
|
-
isLoading && /* @__PURE__ */
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
10142
|
+
showFloatingZoom && /* @__PURE__ */ jsx27(FloatingZoomControls, { position: "bottom-right" }),
|
|
10143
|
+
isLoading && /* @__PURE__ */ jsx27("div", { className: "absolute inset-0 z-50", children: loadingComponent ?? /* @__PURE__ */ jsx27(
|
|
10144
|
+
PDFLoadingScreen,
|
|
10145
|
+
{
|
|
10146
|
+
phase: loadingProgress?.phase ?? "fetching",
|
|
10147
|
+
progress: loadingProgress?.percent,
|
|
10148
|
+
bytesLoaded: loadingProgress?.bytesLoaded,
|
|
10149
|
+
totalBytes: loadingProgress?.totalBytes
|
|
10150
|
+
}
|
|
10151
|
+
) })
|
|
9972
10152
|
]
|
|
9973
10153
|
}
|
|
9974
10154
|
);
|
|
@@ -9984,17 +10164,17 @@ var init_PDFViewerClient = __esm({
|
|
|
9984
10164
|
ref.current = handle;
|
|
9985
10165
|
}
|
|
9986
10166
|
}, [ref]);
|
|
9987
|
-
return /* @__PURE__ */
|
|
10167
|
+
return /* @__PURE__ */ jsx27(PDFViewerInner, { ...props, onReady: handleReady });
|
|
9988
10168
|
}
|
|
9989
10169
|
);
|
|
9990
|
-
PDFViewerClient =
|
|
10170
|
+
PDFViewerClient = memo26(
|
|
9991
10171
|
forwardRef(function PDFViewerClient2(props, ref) {
|
|
9992
|
-
return /* @__PURE__ */
|
|
10172
|
+
return /* @__PURE__ */ jsx27(
|
|
9993
10173
|
PDFViewerProvider,
|
|
9994
10174
|
{
|
|
9995
10175
|
theme: props.theme,
|
|
9996
10176
|
defaultSidebarPanel: props.defaultSidebarPanel,
|
|
9997
|
-
children: /* @__PURE__ */
|
|
10177
|
+
children: /* @__PURE__ */ jsx27(PDFViewerInnerWithRef, { ref, ...props })
|
|
9998
10178
|
}
|
|
9999
10179
|
);
|
|
10000
10180
|
})
|
|
@@ -10003,8 +10183,8 @@ var init_PDFViewerClient = __esm({
|
|
|
10003
10183
|
});
|
|
10004
10184
|
|
|
10005
10185
|
// src/components/PDFViewer/PDFViewer.tsx
|
|
10006
|
-
import { lazy, Suspense, memo as
|
|
10007
|
-
import { jsx as
|
|
10186
|
+
import { lazy, Suspense, memo as memo27 } from "react";
|
|
10187
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10008
10188
|
var PDFViewerClient3, PDFViewerLoading, PDFViewer;
|
|
10009
10189
|
var init_PDFViewer = __esm({
|
|
10010
10190
|
"src/components/PDFViewer/PDFViewer.tsx"() {
|
|
@@ -10013,10 +10193,10 @@ var init_PDFViewer = __esm({
|
|
|
10013
10193
|
PDFViewerClient3 = lazy(
|
|
10014
10194
|
() => Promise.resolve().then(() => (init_PDFViewerClient(), PDFViewerClient_exports)).then((mod) => ({ default: mod.PDFViewerClient }))
|
|
10015
10195
|
);
|
|
10016
|
-
PDFViewerLoading =
|
|
10196
|
+
PDFViewerLoading = memo27(function PDFViewerLoading2({
|
|
10017
10197
|
className
|
|
10018
10198
|
}) {
|
|
10019
|
-
return /* @__PURE__ */
|
|
10199
|
+
return /* @__PURE__ */ jsx28(
|
|
10020
10200
|
"div",
|
|
10021
10201
|
{
|
|
10022
10202
|
className: cn(
|
|
@@ -10025,18 +10205,18 @@ var init_PDFViewer = __esm({
|
|
|
10025
10205
|
"bg-white dark:bg-gray-900",
|
|
10026
10206
|
className
|
|
10027
10207
|
),
|
|
10028
|
-
children: /* @__PURE__ */
|
|
10029
|
-
/* @__PURE__ */
|
|
10030
|
-
/* @__PURE__ */
|
|
10208
|
+
children: /* @__PURE__ */ jsx28("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs24("div", { className: "flex flex-col items-center", children: [
|
|
10209
|
+
/* @__PURE__ */ jsx28("div", { className: "w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" }),
|
|
10210
|
+
/* @__PURE__ */ jsx28("div", { className: "mt-2 text-sm text-gray-500", children: "Loading PDF viewer..." })
|
|
10031
10211
|
] }) })
|
|
10032
10212
|
}
|
|
10033
10213
|
);
|
|
10034
10214
|
});
|
|
10035
|
-
PDFViewer =
|
|
10215
|
+
PDFViewer = memo27(function PDFViewer2(props) {
|
|
10036
10216
|
if (typeof window === "undefined") {
|
|
10037
|
-
return /* @__PURE__ */
|
|
10217
|
+
return /* @__PURE__ */ jsx28(PDFViewerLoading, { className: props.className });
|
|
10038
10218
|
}
|
|
10039
|
-
return /* @__PURE__ */
|
|
10219
|
+
return /* @__PURE__ */ jsx28(Suspense, { fallback: /* @__PURE__ */ jsx28(PDFViewerLoading, { className: props.className }), children: /* @__PURE__ */ jsx28(PDFViewerClient3, { ...props }) });
|
|
10040
10220
|
});
|
|
10041
10221
|
}
|
|
10042
10222
|
});
|
|
@@ -10065,8 +10245,8 @@ init_AnnotationToolbar2();
|
|
|
10065
10245
|
|
|
10066
10246
|
// src/components/Annotations/StickyNote.tsx
|
|
10067
10247
|
init_utils();
|
|
10068
|
-
import { memo as
|
|
10069
|
-
import { jsx as
|
|
10248
|
+
import { memo as memo28, useState as useState22, useRef as useRef20, useEffect as useEffect23, useCallback as useCallback34 } from "react";
|
|
10249
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10070
10250
|
var NOTE_COLORS = [
|
|
10071
10251
|
"#fef08a",
|
|
10072
10252
|
// yellow
|
|
@@ -10079,7 +10259,7 @@ var NOTE_COLORS = [
|
|
|
10079
10259
|
"#fed7aa"
|
|
10080
10260
|
// orange
|
|
10081
10261
|
];
|
|
10082
|
-
var StickyNote =
|
|
10262
|
+
var StickyNote = memo28(function StickyNote2({
|
|
10083
10263
|
note,
|
|
10084
10264
|
scale,
|
|
10085
10265
|
isSelected,
|
|
@@ -10139,7 +10319,7 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10139
10319
|
onEndEdit?.();
|
|
10140
10320
|
}, [onEndEdit]);
|
|
10141
10321
|
if (!isExpanded) {
|
|
10142
|
-
return /* @__PURE__ */
|
|
10322
|
+
return /* @__PURE__ */ jsx29(
|
|
10143
10323
|
"div",
|
|
10144
10324
|
{
|
|
10145
10325
|
ref: noteRef,
|
|
@@ -10160,14 +10340,14 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10160
10340
|
onMouseDown: onDragStart,
|
|
10161
10341
|
onTouchStart: onDragStart,
|
|
10162
10342
|
title: note.content || "Empty note",
|
|
10163
|
-
children: /* @__PURE__ */
|
|
10343
|
+
children: /* @__PURE__ */ jsx29(
|
|
10164
10344
|
"svg",
|
|
10165
10345
|
{
|
|
10166
10346
|
className: "w-4 h-4 opacity-70",
|
|
10167
10347
|
fill: "currentColor",
|
|
10168
10348
|
viewBox: "0 0 20 20",
|
|
10169
10349
|
style: { color: "#333" },
|
|
10170
|
-
children: /* @__PURE__ */
|
|
10350
|
+
children: /* @__PURE__ */ jsx29(
|
|
10171
10351
|
"path",
|
|
10172
10352
|
{
|
|
10173
10353
|
fillRule: "evenodd",
|
|
@@ -10180,7 +10360,7 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10180
10360
|
}
|
|
10181
10361
|
);
|
|
10182
10362
|
}
|
|
10183
|
-
return /* @__PURE__ */
|
|
10363
|
+
return /* @__PURE__ */ jsxs25(
|
|
10184
10364
|
"div",
|
|
10185
10365
|
{
|
|
10186
10366
|
ref: noteRef,
|
|
@@ -10198,14 +10378,14 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10198
10378
|
},
|
|
10199
10379
|
onClick: handleClick,
|
|
10200
10380
|
children: [
|
|
10201
|
-
/* @__PURE__ */
|
|
10381
|
+
/* @__PURE__ */ jsxs25(
|
|
10202
10382
|
"div",
|
|
10203
10383
|
{
|
|
10204
10384
|
className: "flex items-center justify-between px-2 py-1 border-b border-black/10 cursor-move",
|
|
10205
10385
|
onMouseDown: onDragStart,
|
|
10206
10386
|
onTouchStart: onDragStart,
|
|
10207
10387
|
children: [
|
|
10208
|
-
/* @__PURE__ */
|
|
10388
|
+
/* @__PURE__ */ jsx29("div", { className: "flex gap-1", children: NOTE_COLORS.map((color) => /* @__PURE__ */ jsx29(
|
|
10209
10389
|
"button",
|
|
10210
10390
|
{
|
|
10211
10391
|
className: cn(
|
|
@@ -10222,8 +10402,8 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10222
10402
|
},
|
|
10223
10403
|
color
|
|
10224
10404
|
)) }),
|
|
10225
|
-
/* @__PURE__ */
|
|
10226
|
-
/* @__PURE__ */
|
|
10405
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex gap-1", children: [
|
|
10406
|
+
/* @__PURE__ */ jsx29(
|
|
10227
10407
|
"button",
|
|
10228
10408
|
{
|
|
10229
10409
|
className: "p-0.5 hover:bg-black/10 rounded",
|
|
@@ -10232,23 +10412,23 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10232
10412
|
onDelete?.();
|
|
10233
10413
|
},
|
|
10234
10414
|
title: "Delete note",
|
|
10235
|
-
children: /* @__PURE__ */
|
|
10415
|
+
children: /* @__PURE__ */ jsx29("svg", { className: "w-3.5 h-3.5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx29("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) })
|
|
10236
10416
|
}
|
|
10237
10417
|
),
|
|
10238
|
-
/* @__PURE__ */
|
|
10418
|
+
/* @__PURE__ */ jsx29(
|
|
10239
10419
|
"button",
|
|
10240
10420
|
{
|
|
10241
10421
|
className: "p-0.5 hover:bg-black/10 rounded",
|
|
10242
10422
|
onClick: handleCollapse,
|
|
10243
10423
|
title: "Collapse note",
|
|
10244
|
-
children: /* @__PURE__ */
|
|
10424
|
+
children: /* @__PURE__ */ jsx29("svg", { className: "w-3.5 h-3.5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx29("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
10245
10425
|
}
|
|
10246
10426
|
)
|
|
10247
10427
|
] })
|
|
10248
10428
|
]
|
|
10249
10429
|
}
|
|
10250
10430
|
),
|
|
10251
|
-
/* @__PURE__ */
|
|
10431
|
+
/* @__PURE__ */ jsx29("div", { className: "p-2", children: isEditing ? /* @__PURE__ */ jsx29(
|
|
10252
10432
|
"textarea",
|
|
10253
10433
|
{
|
|
10254
10434
|
ref: textareaRef,
|
|
@@ -10263,7 +10443,7 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10263
10443
|
onKeyDown: handleKeyDown,
|
|
10264
10444
|
placeholder: "Enter note..."
|
|
10265
10445
|
}
|
|
10266
|
-
) : /* @__PURE__ */
|
|
10446
|
+
) : /* @__PURE__ */ jsx29(
|
|
10267
10447
|
"div",
|
|
10268
10448
|
{
|
|
10269
10449
|
className: cn(
|
|
@@ -10274,7 +10454,7 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10274
10454
|
children: note.content || "Double-click to edit..."
|
|
10275
10455
|
}
|
|
10276
10456
|
) }),
|
|
10277
|
-
/* @__PURE__ */
|
|
10457
|
+
/* @__PURE__ */ jsx29("div", { className: "px-2 pb-1 text-[10px] text-gray-500", children: new Date(note.updatedAt).toLocaleDateString() })
|
|
10278
10458
|
]
|
|
10279
10459
|
}
|
|
10280
10460
|
);
|
|
@@ -10282,8 +10462,8 @@ var StickyNote = memo27(function StickyNote2({
|
|
|
10282
10462
|
|
|
10283
10463
|
// src/components/Annotations/DrawingCanvas.tsx
|
|
10284
10464
|
init_utils();
|
|
10285
|
-
import { memo as
|
|
10286
|
-
import { jsx as
|
|
10465
|
+
import { memo as memo29, useRef as useRef21, useCallback as useCallback35, useState as useState23 } from "react";
|
|
10466
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
10287
10467
|
function pointsToSvgPath(points) {
|
|
10288
10468
|
if (points.length === 0) return "";
|
|
10289
10469
|
if (points.length === 1) {
|
|
@@ -10321,7 +10501,7 @@ function simplifyPath(points, tolerance = 1) {
|
|
|
10321
10501
|
result.push(points[points.length - 1]);
|
|
10322
10502
|
return result;
|
|
10323
10503
|
}
|
|
10324
|
-
var DrawingCanvas =
|
|
10504
|
+
var DrawingCanvas = memo29(function DrawingCanvas2({
|
|
10325
10505
|
width,
|
|
10326
10506
|
height,
|
|
10327
10507
|
scale,
|
|
@@ -10378,7 +10558,7 @@ var DrawingCanvas = memo28(function DrawingCanvas2({
|
|
|
10378
10558
|
}
|
|
10379
10559
|
setCurrentPath([]);
|
|
10380
10560
|
}, [isDrawing, currentPath, onDrawingComplete]);
|
|
10381
|
-
return /* @__PURE__ */
|
|
10561
|
+
return /* @__PURE__ */ jsx30(
|
|
10382
10562
|
"svg",
|
|
10383
10563
|
{
|
|
10384
10564
|
ref: svgRef,
|
|
@@ -10398,7 +10578,7 @@ var DrawingCanvas = memo28(function DrawingCanvas2({
|
|
|
10398
10578
|
onTouchStart: handleStart,
|
|
10399
10579
|
onTouchMove: handleMove,
|
|
10400
10580
|
onTouchEnd: handleEnd,
|
|
10401
|
-
children: isDrawing && currentPath.length > 0 && /* @__PURE__ */
|
|
10581
|
+
children: isDrawing && currentPath.length > 0 && /* @__PURE__ */ jsx30(
|
|
10402
10582
|
"path",
|
|
10403
10583
|
{
|
|
10404
10584
|
d: pointsToSvgPath(currentPath),
|
|
@@ -10416,9 +10596,9 @@ var DrawingCanvas = memo28(function DrawingCanvas2({
|
|
|
10416
10596
|
|
|
10417
10597
|
// src/components/Annotations/ShapeRenderer.tsx
|
|
10418
10598
|
init_utils();
|
|
10419
|
-
import { memo as
|
|
10420
|
-
import { jsx as
|
|
10421
|
-
var ShapeRenderer =
|
|
10599
|
+
import { memo as memo30, useCallback as useCallback36, useState as useState24, useRef as useRef22 } from "react";
|
|
10600
|
+
import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10601
|
+
var ShapeRenderer = memo30(function ShapeRenderer2({
|
|
10422
10602
|
shape,
|
|
10423
10603
|
scale,
|
|
10424
10604
|
isSelected,
|
|
@@ -10541,7 +10721,7 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10541
10721
|
};
|
|
10542
10722
|
switch (shapeType) {
|
|
10543
10723
|
case "rect":
|
|
10544
|
-
return /* @__PURE__ */
|
|
10724
|
+
return /* @__PURE__ */ jsx31(
|
|
10545
10725
|
"rect",
|
|
10546
10726
|
{
|
|
10547
10727
|
x: scaledX,
|
|
@@ -10552,7 +10732,7 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10552
10732
|
}
|
|
10553
10733
|
);
|
|
10554
10734
|
case "circle":
|
|
10555
|
-
return /* @__PURE__ */
|
|
10735
|
+
return /* @__PURE__ */ jsx31(
|
|
10556
10736
|
"ellipse",
|
|
10557
10737
|
{
|
|
10558
10738
|
cx: scaledX + scaledWidth / 2,
|
|
@@ -10563,7 +10743,7 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10563
10743
|
}
|
|
10564
10744
|
);
|
|
10565
10745
|
case "line":
|
|
10566
|
-
return /* @__PURE__ */
|
|
10746
|
+
return /* @__PURE__ */ jsx31(
|
|
10567
10747
|
"line",
|
|
10568
10748
|
{
|
|
10569
10749
|
x1: scaledX,
|
|
@@ -10583,22 +10763,22 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10583
10763
|
const arrow1Y = endY - arrowLength * Math.sin(angle - arrowAngle);
|
|
10584
10764
|
const arrow2X = endX - arrowLength * Math.cos(angle + arrowAngle);
|
|
10585
10765
|
const arrow2Y = endY - arrowLength * Math.sin(angle + arrowAngle);
|
|
10586
|
-
return /* @__PURE__ */
|
|
10587
|
-
/* @__PURE__ */
|
|
10588
|
-
/* @__PURE__ */
|
|
10589
|
-
/* @__PURE__ */
|
|
10766
|
+
return /* @__PURE__ */ jsxs26("g", { children: [
|
|
10767
|
+
/* @__PURE__ */ jsx31("line", { x1: scaledX, y1: scaledY, x2: endX, y2: endY, ...commonProps }),
|
|
10768
|
+
/* @__PURE__ */ jsx31("line", { x1: endX, y1: endY, x2: arrow1X, y2: arrow1Y, ...commonProps }),
|
|
10769
|
+
/* @__PURE__ */ jsx31("line", { x1: endX, y1: endY, x2: arrow2X, y2: arrow2Y, ...commonProps })
|
|
10590
10770
|
] });
|
|
10591
10771
|
default:
|
|
10592
10772
|
return null;
|
|
10593
10773
|
}
|
|
10594
10774
|
}, [shapeType, scaledX, scaledY, scaledWidth, scaledHeight, color, scaledStroke, isSelected]);
|
|
10595
|
-
return /* @__PURE__ */
|
|
10775
|
+
return /* @__PURE__ */ jsxs26(
|
|
10596
10776
|
"g",
|
|
10597
10777
|
{
|
|
10598
10778
|
className: cn("shape-renderer", className),
|
|
10599
10779
|
onMouseDown: (e) => handleMouseDown(e),
|
|
10600
10780
|
children: [
|
|
10601
|
-
/* @__PURE__ */
|
|
10781
|
+
/* @__PURE__ */ jsx31(
|
|
10602
10782
|
"rect",
|
|
10603
10783
|
{
|
|
10604
10784
|
x: scaledX - 5,
|
|
@@ -10611,7 +10791,7 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10611
10791
|
}
|
|
10612
10792
|
),
|
|
10613
10793
|
renderShape2(),
|
|
10614
|
-
isSelected && /* @__PURE__ */
|
|
10794
|
+
isSelected && /* @__PURE__ */ jsx31(
|
|
10615
10795
|
"rect",
|
|
10616
10796
|
{
|
|
10617
10797
|
x: scaledX - 2,
|
|
@@ -10624,7 +10804,7 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10624
10804
|
strokeDasharray: "4 2"
|
|
10625
10805
|
}
|
|
10626
10806
|
),
|
|
10627
|
-
isSelected && isEditing && getResizeHandles().map((handle) => /* @__PURE__ */
|
|
10807
|
+
isSelected && isEditing && getResizeHandles().map((handle) => /* @__PURE__ */ jsx31(
|
|
10628
10808
|
"rect",
|
|
10629
10809
|
{
|
|
10630
10810
|
x: handle.x,
|
|
@@ -10644,7 +10824,7 @@ var ShapeRenderer = memo29(function ShapeRenderer2({
|
|
|
10644
10824
|
}
|
|
10645
10825
|
);
|
|
10646
10826
|
});
|
|
10647
|
-
var ShapePreview =
|
|
10827
|
+
var ShapePreview = memo30(function ShapePreview2({
|
|
10648
10828
|
shapeType,
|
|
10649
10829
|
startPoint,
|
|
10650
10830
|
endPoint,
|
|
@@ -10665,9 +10845,9 @@ var ShapePreview = memo29(function ShapePreview2({
|
|
|
10665
10845
|
};
|
|
10666
10846
|
switch (shapeType) {
|
|
10667
10847
|
case "rect":
|
|
10668
|
-
return /* @__PURE__ */
|
|
10848
|
+
return /* @__PURE__ */ jsx31("rect", { x, y, width, height, ...commonProps });
|
|
10669
10849
|
case "circle":
|
|
10670
|
-
return /* @__PURE__ */
|
|
10850
|
+
return /* @__PURE__ */ jsx31(
|
|
10671
10851
|
"ellipse",
|
|
10672
10852
|
{
|
|
10673
10853
|
cx: x + width / 2,
|
|
@@ -10678,7 +10858,7 @@ var ShapePreview = memo29(function ShapePreview2({
|
|
|
10678
10858
|
}
|
|
10679
10859
|
);
|
|
10680
10860
|
case "line":
|
|
10681
|
-
return /* @__PURE__ */
|
|
10861
|
+
return /* @__PURE__ */ jsx31(
|
|
10682
10862
|
"line",
|
|
10683
10863
|
{
|
|
10684
10864
|
x1: startPoint.x * scale,
|
|
@@ -10700,8 +10880,8 @@ var ShapePreview = memo29(function ShapePreview2({
|
|
|
10700
10880
|
const arrow1Y = endY - arrowLength * Math.sin(angle - arrowAngle);
|
|
10701
10881
|
const arrow2X = endX - arrowLength * Math.cos(angle + arrowAngle);
|
|
10702
10882
|
const arrow2Y = endY - arrowLength * Math.sin(angle + arrowAngle);
|
|
10703
|
-
return /* @__PURE__ */
|
|
10704
|
-
/* @__PURE__ */
|
|
10883
|
+
return /* @__PURE__ */ jsxs26("g", { children: [
|
|
10884
|
+
/* @__PURE__ */ jsx31(
|
|
10705
10885
|
"line",
|
|
10706
10886
|
{
|
|
10707
10887
|
x1: startPoint.x * scale,
|
|
@@ -10711,8 +10891,8 @@ var ShapePreview = memo29(function ShapePreview2({
|
|
|
10711
10891
|
...commonProps
|
|
10712
10892
|
}
|
|
10713
10893
|
),
|
|
10714
|
-
/* @__PURE__ */
|
|
10715
|
-
/* @__PURE__ */
|
|
10894
|
+
/* @__PURE__ */ jsx31("line", { x1: endX, y1: endY, x2: arrow1X, y2: arrow1Y, ...commonProps }),
|
|
10895
|
+
/* @__PURE__ */ jsx31("line", { x1: endX, y1: endY, x2: arrow2X, y2: arrow2Y, ...commonProps })
|
|
10716
10896
|
] });
|
|
10717
10897
|
default:
|
|
10718
10898
|
return null;
|
|
@@ -10721,9 +10901,9 @@ var ShapePreview = memo29(function ShapePreview2({
|
|
|
10721
10901
|
|
|
10722
10902
|
// src/components/Annotations/QuickNoteButton.tsx
|
|
10723
10903
|
init_utils();
|
|
10724
|
-
import { memo as
|
|
10725
|
-
import { jsx as
|
|
10726
|
-
var QuickNoteButton =
|
|
10904
|
+
import { memo as memo31, useCallback as useCallback37, useState as useState25 } from "react";
|
|
10905
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
10906
|
+
var QuickNoteButton = memo31(function QuickNoteButton2({
|
|
10727
10907
|
pageNumber,
|
|
10728
10908
|
scale,
|
|
10729
10909
|
position = "top-right",
|
|
@@ -10744,7 +10924,7 @@ var QuickNoteButton = memo30(function QuickNoteButton2({
|
|
|
10744
10924
|
if (!visible) {
|
|
10745
10925
|
return null;
|
|
10746
10926
|
}
|
|
10747
|
-
return /* @__PURE__ */
|
|
10927
|
+
return /* @__PURE__ */ jsx32(
|
|
10748
10928
|
"button",
|
|
10749
10929
|
{
|
|
10750
10930
|
onClick: handleClick,
|
|
@@ -10766,7 +10946,7 @@ var QuickNoteButton = memo30(function QuickNoteButton2({
|
|
|
10766
10946
|
),
|
|
10767
10947
|
title: "Add quick note",
|
|
10768
10948
|
"aria-label": "Add quick note",
|
|
10769
|
-
children: /* @__PURE__ */
|
|
10949
|
+
children: /* @__PURE__ */ jsx32(
|
|
10770
10950
|
"svg",
|
|
10771
10951
|
{
|
|
10772
10952
|
className: "w-4 h-4 text-yellow-900",
|
|
@@ -10774,7 +10954,7 @@ var QuickNoteButton = memo30(function QuickNoteButton2({
|
|
|
10774
10954
|
viewBox: "0 0 24 24",
|
|
10775
10955
|
stroke: "currentColor",
|
|
10776
10956
|
strokeWidth: 2,
|
|
10777
|
-
children: /* @__PURE__ */
|
|
10957
|
+
children: /* @__PURE__ */ jsx32("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" })
|
|
10778
10958
|
}
|
|
10779
10959
|
)
|
|
10780
10960
|
}
|
|
@@ -10783,9 +10963,9 @@ var QuickNoteButton = memo30(function QuickNoteButton2({
|
|
|
10783
10963
|
|
|
10784
10964
|
// src/components/Annotations/QuickNotePopover.tsx
|
|
10785
10965
|
init_utils();
|
|
10786
|
-
import { memo as
|
|
10787
|
-
import { jsx as
|
|
10788
|
-
var QuickNotePopover =
|
|
10966
|
+
import { memo as memo32, useCallback as useCallback38, useState as useState26, useRef as useRef23, useEffect as useEffect24 } from "react";
|
|
10967
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10968
|
+
var QuickNotePopover = memo32(function QuickNotePopover2({
|
|
10789
10969
|
visible,
|
|
10790
10970
|
position,
|
|
10791
10971
|
initialContent = "",
|
|
@@ -10849,7 +11029,7 @@ var QuickNotePopover = memo31(function QuickNotePopover2({
|
|
|
10849
11029
|
if (!visible) {
|
|
10850
11030
|
return null;
|
|
10851
11031
|
}
|
|
10852
|
-
return /* @__PURE__ */
|
|
11032
|
+
return /* @__PURE__ */ jsxs27(
|
|
10853
11033
|
"div",
|
|
10854
11034
|
{
|
|
10855
11035
|
ref: popoverRef,
|
|
@@ -10868,15 +11048,15 @@ var QuickNotePopover = memo31(function QuickNotePopover2({
|
|
|
10868
11048
|
top: adjustedPosition.y
|
|
10869
11049
|
},
|
|
10870
11050
|
children: [
|
|
10871
|
-
agentLastStatement && /* @__PURE__ */
|
|
10872
|
-
/* @__PURE__ */
|
|
10873
|
-
/* @__PURE__ */
|
|
11051
|
+
agentLastStatement && /* @__PURE__ */ jsx33("div", { className: "mb-2 p-2 bg-blue-50 dark:bg-blue-900/50 rounded text-xs text-blue-600 dark:text-blue-300 border border-blue-100 dark:border-blue-800", children: /* @__PURE__ */ jsxs27("div", { className: "flex items-start gap-1", children: [
|
|
11052
|
+
/* @__PURE__ */ jsx33("svg", { className: "w-3 h-3 mt-0.5 flex-shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx33("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) }),
|
|
11053
|
+
/* @__PURE__ */ jsxs27("span", { className: "line-clamp-2", children: [
|
|
10874
11054
|
"AI discussed: \u201C",
|
|
10875
11055
|
agentLastStatement,
|
|
10876
11056
|
"\u201D"
|
|
10877
11057
|
] })
|
|
10878
11058
|
] }) }),
|
|
10879
|
-
/* @__PURE__ */
|
|
11059
|
+
/* @__PURE__ */ jsx33(
|
|
10880
11060
|
"textarea",
|
|
10881
11061
|
{
|
|
10882
11062
|
ref: textareaRef,
|
|
@@ -10895,13 +11075,13 @@ var QuickNotePopover = memo31(function QuickNotePopover2({
|
|
|
10895
11075
|
)
|
|
10896
11076
|
}
|
|
10897
11077
|
),
|
|
10898
|
-
/* @__PURE__ */
|
|
10899
|
-
/* @__PURE__ */
|
|
11078
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between mt-2", children: [
|
|
11079
|
+
/* @__PURE__ */ jsxs27("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
10900
11080
|
navigator.platform.includes("Mac") ? "\u2318" : "Ctrl",
|
|
10901
11081
|
"+Enter to save"
|
|
10902
11082
|
] }),
|
|
10903
|
-
/* @__PURE__ */
|
|
10904
|
-
/* @__PURE__ */
|
|
11083
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex gap-2", children: [
|
|
11084
|
+
/* @__PURE__ */ jsx33(
|
|
10905
11085
|
"button",
|
|
10906
11086
|
{
|
|
10907
11087
|
onClick: onCancel,
|
|
@@ -10914,7 +11094,7 @@ var QuickNotePopover = memo31(function QuickNotePopover2({
|
|
|
10914
11094
|
children: "Cancel"
|
|
10915
11095
|
}
|
|
10916
11096
|
),
|
|
10917
|
-
/* @__PURE__ */
|
|
11097
|
+
/* @__PURE__ */ jsx33(
|
|
10918
11098
|
"button",
|
|
10919
11099
|
{
|
|
10920
11100
|
onClick: handleSave,
|
|
@@ -10938,9 +11118,9 @@ var QuickNotePopover = memo31(function QuickNotePopover2({
|
|
|
10938
11118
|
|
|
10939
11119
|
// src/components/AskAbout/AskAboutOverlay.tsx
|
|
10940
11120
|
init_utils();
|
|
10941
|
-
import { memo as
|
|
10942
|
-
import { jsx as
|
|
10943
|
-
var AskAboutOverlay =
|
|
11121
|
+
import { memo as memo33 } from "react";
|
|
11122
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
11123
|
+
var AskAboutOverlay = memo33(function AskAboutOverlay2({
|
|
10944
11124
|
visible,
|
|
10945
11125
|
progress,
|
|
10946
11126
|
position,
|
|
@@ -10954,7 +11134,7 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
10954
11134
|
const radius = (size - strokeWidth) / 2;
|
|
10955
11135
|
const circumference = 2 * Math.PI * radius;
|
|
10956
11136
|
const strokeDashoffset = circumference * (1 - progress);
|
|
10957
|
-
return /* @__PURE__ */
|
|
11137
|
+
return /* @__PURE__ */ jsxs28(
|
|
10958
11138
|
"div",
|
|
10959
11139
|
{
|
|
10960
11140
|
className: cn(
|
|
@@ -10967,7 +11147,7 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
10967
11147
|
top: position.y - size / 2
|
|
10968
11148
|
},
|
|
10969
11149
|
children: [
|
|
10970
|
-
/* @__PURE__ */
|
|
11150
|
+
/* @__PURE__ */ jsxs28(
|
|
10971
11151
|
"svg",
|
|
10972
11152
|
{
|
|
10973
11153
|
width: size,
|
|
@@ -10975,7 +11155,7 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
10975
11155
|
viewBox: `0 0 ${size} ${size}`,
|
|
10976
11156
|
className: "transform -rotate-90",
|
|
10977
11157
|
children: [
|
|
10978
|
-
/* @__PURE__ */
|
|
11158
|
+
/* @__PURE__ */ jsx34(
|
|
10979
11159
|
"circle",
|
|
10980
11160
|
{
|
|
10981
11161
|
cx: size / 2,
|
|
@@ -10986,7 +11166,7 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
10986
11166
|
strokeWidth
|
|
10987
11167
|
}
|
|
10988
11168
|
),
|
|
10989
|
-
/* @__PURE__ */
|
|
11169
|
+
/* @__PURE__ */ jsx34(
|
|
10990
11170
|
"circle",
|
|
10991
11171
|
{
|
|
10992
11172
|
cx: size / 2,
|
|
@@ -11004,12 +11184,12 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
11004
11184
|
]
|
|
11005
11185
|
}
|
|
11006
11186
|
),
|
|
11007
|
-
/* @__PURE__ */
|
|
11187
|
+
/* @__PURE__ */ jsx34(
|
|
11008
11188
|
"div",
|
|
11009
11189
|
{
|
|
11010
11190
|
className: "absolute inset-0 flex items-center justify-center",
|
|
11011
11191
|
style: { color: progress >= 1 ? "#22c55e" : "white" },
|
|
11012
|
-
children: progress >= 1 ? /* @__PURE__ */
|
|
11192
|
+
children: progress >= 1 ? /* @__PURE__ */ jsx34(
|
|
11013
11193
|
"svg",
|
|
11014
11194
|
{
|
|
11015
11195
|
width: "24",
|
|
@@ -11020,9 +11200,9 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
11020
11200
|
strokeWidth: "2",
|
|
11021
11201
|
strokeLinecap: "round",
|
|
11022
11202
|
strokeLinejoin: "round",
|
|
11023
|
-
children: /* @__PURE__ */
|
|
11203
|
+
children: /* @__PURE__ */ jsx34("polyline", { points: "20 6 9 17 4 12" })
|
|
11024
11204
|
}
|
|
11025
|
-
) : /* @__PURE__ */
|
|
11205
|
+
) : /* @__PURE__ */ jsxs28(
|
|
11026
11206
|
"svg",
|
|
11027
11207
|
{
|
|
11028
11208
|
width: "20",
|
|
@@ -11034,9 +11214,9 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
11034
11214
|
strokeLinecap: "round",
|
|
11035
11215
|
strokeLinejoin: "round",
|
|
11036
11216
|
children: [
|
|
11037
|
-
/* @__PURE__ */
|
|
11038
|
-
/* @__PURE__ */
|
|
11039
|
-
/* @__PURE__ */
|
|
11217
|
+
/* @__PURE__ */ jsx34("circle", { cx: "12", cy: "12", r: "10" }),
|
|
11218
|
+
/* @__PURE__ */ jsx34("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
|
11219
|
+
/* @__PURE__ */ jsx34("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
11040
11220
|
]
|
|
11041
11221
|
}
|
|
11042
11222
|
)
|
|
@@ -11049,9 +11229,9 @@ var AskAboutOverlay = memo32(function AskAboutOverlay2({
|
|
|
11049
11229
|
|
|
11050
11230
|
// src/components/AskAbout/AskAboutTrigger.tsx
|
|
11051
11231
|
init_utils();
|
|
11052
|
-
import { memo as
|
|
11053
|
-
import { jsx as
|
|
11054
|
-
var AskAboutTrigger =
|
|
11232
|
+
import { memo as memo34, useCallback as useCallback39, useState as useState27, useRef as useRef24, useEffect as useEffect25 } from "react";
|
|
11233
|
+
import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11234
|
+
var AskAboutTrigger = memo34(function AskAboutTrigger2({
|
|
11055
11235
|
position,
|
|
11056
11236
|
onConfirm,
|
|
11057
11237
|
onCancel,
|
|
@@ -11099,7 +11279,7 @@ var AskAboutTrigger = memo33(function AskAboutTrigger2({
|
|
|
11099
11279
|
if (!visible) {
|
|
11100
11280
|
return null;
|
|
11101
11281
|
}
|
|
11102
|
-
return /* @__PURE__ */
|
|
11282
|
+
return /* @__PURE__ */ jsxs29(
|
|
11103
11283
|
"div",
|
|
11104
11284
|
{
|
|
11105
11285
|
ref: triggerRef,
|
|
@@ -11118,8 +11298,8 @@ var AskAboutTrigger = memo33(function AskAboutTrigger2({
|
|
|
11118
11298
|
transform: "translate(-50%, 0)"
|
|
11119
11299
|
},
|
|
11120
11300
|
children: [
|
|
11121
|
-
/* @__PURE__ */
|
|
11122
|
-
/* @__PURE__ */
|
|
11301
|
+
/* @__PURE__ */ jsx35("span", { className: "text-sm text-gray-600 dark:text-gray-300 px-2", children: "Ask about this?" }),
|
|
11302
|
+
/* @__PURE__ */ jsx35(
|
|
11123
11303
|
"button",
|
|
11124
11304
|
{
|
|
11125
11305
|
onClick: handleConfirm,
|
|
@@ -11132,7 +11312,7 @@ var AskAboutTrigger = memo33(function AskAboutTrigger2({
|
|
|
11132
11312
|
children: "Ask"
|
|
11133
11313
|
}
|
|
11134
11314
|
),
|
|
11135
|
-
/* @__PURE__ */
|
|
11315
|
+
/* @__PURE__ */ jsx35(
|
|
11136
11316
|
"button",
|
|
11137
11317
|
{
|
|
11138
11318
|
onClick: handleCancel,
|
|
@@ -11154,9 +11334,9 @@ var AskAboutTrigger = memo33(function AskAboutTrigger2({
|
|
|
11154
11334
|
// src/components/Minimap/Minimap.tsx
|
|
11155
11335
|
init_hooks();
|
|
11156
11336
|
init_utils();
|
|
11157
|
-
import { memo as
|
|
11158
|
-
import { Fragment as Fragment3, jsx as
|
|
11159
|
-
var PageIndicator =
|
|
11337
|
+
import { memo as memo35, useMemo as useMemo14, useCallback as useCallback40 } from "react";
|
|
11338
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11339
|
+
var PageIndicator = memo35(function PageIndicator2({
|
|
11160
11340
|
pageNumber,
|
|
11161
11341
|
status,
|
|
11162
11342
|
isBookmarked,
|
|
@@ -11170,7 +11350,7 @@ var PageIndicator = memo34(function PageIndicator2({
|
|
|
11170
11350
|
if (status === "visited") return "bg-green-400";
|
|
11171
11351
|
return "bg-gray-200 dark:bg-gray-700";
|
|
11172
11352
|
};
|
|
11173
|
-
return /* @__PURE__ */
|
|
11353
|
+
return /* @__PURE__ */ jsxs30(
|
|
11174
11354
|
"button",
|
|
11175
11355
|
{
|
|
11176
11356
|
onClick,
|
|
@@ -11186,13 +11366,13 @@ var PageIndicator = memo34(function PageIndicator2({
|
|
|
11186
11366
|
title: `Page ${pageNumber}${isBookmarked ? " (bookmarked)" : ""}`,
|
|
11187
11367
|
"aria-label": `Go to page ${pageNumber}`,
|
|
11188
11368
|
children: [
|
|
11189
|
-
isBookmarked && !compact && /* @__PURE__ */
|
|
11190
|
-
showNumber && !compact && /* @__PURE__ */
|
|
11369
|
+
isBookmarked && !compact && /* @__PURE__ */ jsx36("div", { className: "absolute -top-1 -right-1 w-2 h-2 bg-yellow-500 rounded-full border border-white" }),
|
|
11370
|
+
showNumber && !compact && /* @__PURE__ */ jsx36("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-medium text-white", children: pageNumber })
|
|
11191
11371
|
]
|
|
11192
11372
|
}
|
|
11193
11373
|
);
|
|
11194
11374
|
});
|
|
11195
|
-
var Minimap =
|
|
11375
|
+
var Minimap = memo35(function Minimap2({
|
|
11196
11376
|
variant = "sidebar",
|
|
11197
11377
|
floatingPosition = "right",
|
|
11198
11378
|
maxHeight = 300,
|
|
@@ -11229,7 +11409,7 @@ var Minimap = memo34(function Minimap2({
|
|
|
11229
11409
|
const pages = [];
|
|
11230
11410
|
for (let i = 1; i <= numPages; i++) {
|
|
11231
11411
|
pages.push(
|
|
11232
|
-
/* @__PURE__ */
|
|
11412
|
+
/* @__PURE__ */ jsx36(
|
|
11233
11413
|
PageIndicator,
|
|
11234
11414
|
{
|
|
11235
11415
|
pageNumber: i,
|
|
@@ -11250,16 +11430,16 @@ var Minimap = memo34(function Minimap2({
|
|
|
11250
11430
|
if (numPages === 0) {
|
|
11251
11431
|
return null;
|
|
11252
11432
|
}
|
|
11253
|
-
const content = /* @__PURE__ */
|
|
11254
|
-
/* @__PURE__ */
|
|
11255
|
-
/* @__PURE__ */
|
|
11256
|
-
/* @__PURE__ */
|
|
11257
|
-
/* @__PURE__ */
|
|
11433
|
+
const content = /* @__PURE__ */ jsxs30(Fragment3, { children: [
|
|
11434
|
+
/* @__PURE__ */ jsxs30("div", { className: "mb-3", children: [
|
|
11435
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1", children: [
|
|
11436
|
+
/* @__PURE__ */ jsx36("span", { children: "Progress" }),
|
|
11437
|
+
/* @__PURE__ */ jsxs30("span", { children: [
|
|
11258
11438
|
progressPercentage,
|
|
11259
11439
|
"%"
|
|
11260
11440
|
] })
|
|
11261
11441
|
] }),
|
|
11262
|
-
/* @__PURE__ */
|
|
11442
|
+
/* @__PURE__ */ jsx36("div", { className: "h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx36(
|
|
11263
11443
|
"div",
|
|
11264
11444
|
{
|
|
11265
11445
|
className: "h-full bg-green-500 rounded-full transition-all duration-300",
|
|
@@ -11267,7 +11447,7 @@ var Minimap = memo34(function Minimap2({
|
|
|
11267
11447
|
}
|
|
11268
11448
|
) })
|
|
11269
11449
|
] }),
|
|
11270
|
-
/* @__PURE__ */
|
|
11450
|
+
/* @__PURE__ */ jsx36(
|
|
11271
11451
|
"div",
|
|
11272
11452
|
{
|
|
11273
11453
|
className: cn(
|
|
@@ -11278,21 +11458,21 @@ var Minimap = memo34(function Minimap2({
|
|
|
11278
11458
|
children: pageIndicators
|
|
11279
11459
|
}
|
|
11280
11460
|
),
|
|
11281
|
-
/* @__PURE__ */
|
|
11282
|
-
/* @__PURE__ */
|
|
11283
|
-
/* @__PURE__ */
|
|
11284
|
-
/* @__PURE__ */
|
|
11461
|
+
/* @__PURE__ */ jsx36("div", { className: "mt-3 pt-2 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-wrap gap-3 text-xs text-gray-500 dark:text-gray-400", children: [
|
|
11462
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1", children: [
|
|
11463
|
+
/* @__PURE__ */ jsx36("div", { className: "w-2 h-2 rounded-sm bg-blue-500" }),
|
|
11464
|
+
/* @__PURE__ */ jsx36("span", { children: "Current" })
|
|
11285
11465
|
] }),
|
|
11286
|
-
/* @__PURE__ */
|
|
11287
|
-
/* @__PURE__ */
|
|
11288
|
-
/* @__PURE__ */
|
|
11466
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1", children: [
|
|
11467
|
+
/* @__PURE__ */ jsx36("div", { className: "w-2 h-2 rounded-sm bg-green-400" }),
|
|
11468
|
+
/* @__PURE__ */ jsx36("span", { children: "Visited" })
|
|
11289
11469
|
] }),
|
|
11290
|
-
/* @__PURE__ */
|
|
11291
|
-
/* @__PURE__ */
|
|
11292
|
-
/* @__PURE__ */
|
|
11470
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1", children: [
|
|
11471
|
+
/* @__PURE__ */ jsx36("div", { className: "w-2 h-2 rounded-sm bg-yellow-400" }),
|
|
11472
|
+
/* @__PURE__ */ jsx36("span", { children: "Bookmarked" })
|
|
11293
11473
|
] })
|
|
11294
11474
|
] }) }),
|
|
11295
|
-
/* @__PURE__ */
|
|
11475
|
+
/* @__PURE__ */ jsxs30("div", { className: "mt-2 text-xs text-gray-500 dark:text-gray-400", children: [
|
|
11296
11476
|
visitedCount,
|
|
11297
11477
|
" of ",
|
|
11298
11478
|
numPages,
|
|
@@ -11300,7 +11480,7 @@ var Minimap = memo34(function Minimap2({
|
|
|
11300
11480
|
] })
|
|
11301
11481
|
] });
|
|
11302
11482
|
if (variant === "floating") {
|
|
11303
|
-
return /* @__PURE__ */
|
|
11483
|
+
return /* @__PURE__ */ jsxs30(
|
|
11304
11484
|
"div",
|
|
11305
11485
|
{
|
|
11306
11486
|
className: cn(
|
|
@@ -11316,13 +11496,13 @@ var Minimap = memo34(function Minimap2({
|
|
|
11316
11496
|
),
|
|
11317
11497
|
style: { maxHeight },
|
|
11318
11498
|
children: [
|
|
11319
|
-
/* @__PURE__ */
|
|
11499
|
+
/* @__PURE__ */ jsx36("h3", { className: "text-sm font-semibold text-gray-700 dark:text-gray-200 mb-2", children: "Reading Progress" }),
|
|
11320
11500
|
content
|
|
11321
11501
|
]
|
|
11322
11502
|
}
|
|
11323
11503
|
);
|
|
11324
11504
|
}
|
|
11325
|
-
return /* @__PURE__ */
|
|
11505
|
+
return /* @__PURE__ */ jsx36(
|
|
11326
11506
|
"div",
|
|
11327
11507
|
{
|
|
11328
11508
|
className: cn(
|
|
@@ -11342,11 +11522,11 @@ init_FloatingZoomControls2();
|
|
|
11342
11522
|
// src/components/PDFThumbnailNav/PDFThumbnailNav.tsx
|
|
11343
11523
|
init_hooks();
|
|
11344
11524
|
init_utils();
|
|
11345
|
-
import { memo as
|
|
11346
|
-
import { jsx as
|
|
11525
|
+
import { memo as memo36, useEffect as useEffect26, useState as useState28, useRef as useRef25, useCallback as useCallback41 } from "react";
|
|
11526
|
+
import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11347
11527
|
var DEFAULT_WIDTH = 612;
|
|
11348
11528
|
var DEFAULT_HEIGHT = 792;
|
|
11349
|
-
var PDFThumbnailNav =
|
|
11529
|
+
var PDFThumbnailNav = memo36(function PDFThumbnailNav2({
|
|
11350
11530
|
thumbnailScale = 0.15,
|
|
11351
11531
|
orientation = "vertical",
|
|
11352
11532
|
maxVisible = 10,
|
|
@@ -11458,7 +11638,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11458
11638
|
viewerStore.getState().requestScrollToPage(pageNum, "smooth");
|
|
11459
11639
|
}, [onThumbnailClick, viewerStore]);
|
|
11460
11640
|
if (!document2 || numPages === 0) {
|
|
11461
|
-
return /* @__PURE__ */
|
|
11641
|
+
return /* @__PURE__ */ jsx37(
|
|
11462
11642
|
"div",
|
|
11463
11643
|
{
|
|
11464
11644
|
className: cn(
|
|
@@ -11479,7 +11659,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11479
11659
|
}
|
|
11480
11660
|
const isHorizontal = orientation === "horizontal";
|
|
11481
11661
|
const totalSize = numPages * ((isHorizontal ? thumbnailWidth : thumbnailHeight) + gap) - gap;
|
|
11482
|
-
return /* @__PURE__ */
|
|
11662
|
+
return /* @__PURE__ */ jsx37(
|
|
11483
11663
|
"div",
|
|
11484
11664
|
{
|
|
11485
11665
|
ref: containerRef,
|
|
@@ -11493,7 +11673,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11493
11673
|
style: {
|
|
11494
11674
|
...isHorizontal ? { overflowX: "auto", overflowY: "hidden" } : { overflowX: "hidden", overflowY: "auto" }
|
|
11495
11675
|
},
|
|
11496
|
-
children: /* @__PURE__ */
|
|
11676
|
+
children: /* @__PURE__ */ jsx37(
|
|
11497
11677
|
"div",
|
|
11498
11678
|
{
|
|
11499
11679
|
className: cn(
|
|
@@ -11510,7 +11690,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11510
11690
|
const thumbnail = thumbnails.get(pageNum);
|
|
11511
11691
|
const isActive = pageNum === currentPage;
|
|
11512
11692
|
const isVisible = pageNum >= visibleRange.start && pageNum <= visibleRange.end;
|
|
11513
|
-
return /* @__PURE__ */
|
|
11693
|
+
return /* @__PURE__ */ jsxs31(
|
|
11514
11694
|
"div",
|
|
11515
11695
|
{
|
|
11516
11696
|
className: cn(
|
|
@@ -11535,7 +11715,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11535
11715
|
}
|
|
11536
11716
|
},
|
|
11537
11717
|
children: [
|
|
11538
|
-
/* @__PURE__ */
|
|
11718
|
+
/* @__PURE__ */ jsx37(
|
|
11539
11719
|
"div",
|
|
11540
11720
|
{
|
|
11541
11721
|
className: "relative bg-white dark:bg-gray-700",
|
|
@@ -11543,7 +11723,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11543
11723
|
width: thumbnailWidth,
|
|
11544
11724
|
height: thumbnailHeight
|
|
11545
11725
|
},
|
|
11546
|
-
children: isVisible && thumbnail?.canvas ? /* @__PURE__ */
|
|
11726
|
+
children: isVisible && thumbnail?.canvas ? /* @__PURE__ */ jsx37(
|
|
11547
11727
|
"img",
|
|
11548
11728
|
{
|
|
11549
11729
|
src: thumbnail.canvas.toDataURL(),
|
|
@@ -11551,10 +11731,10 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11551
11731
|
className: "w-full h-full object-contain",
|
|
11552
11732
|
loading: "lazy"
|
|
11553
11733
|
}
|
|
11554
|
-
) : /* @__PURE__ */
|
|
11734
|
+
) : /* @__PURE__ */ jsx37("div", { className: "absolute inset-0 flex items-center justify-center text-gray-400 dark:text-gray-500 text-xs", children: pageNum })
|
|
11555
11735
|
}
|
|
11556
11736
|
),
|
|
11557
|
-
showPageNumbers && /* @__PURE__ */
|
|
11737
|
+
showPageNumbers && /* @__PURE__ */ jsx37(
|
|
11558
11738
|
"div",
|
|
11559
11739
|
{
|
|
11560
11740
|
className: cn(
|
|
@@ -11579,7 +11759,7 @@ var PDFThumbnailNav = memo35(function PDFThumbnailNav2({
|
|
|
11579
11759
|
// src/components/ErrorBoundary/PDFErrorBoundary.tsx
|
|
11580
11760
|
init_utils();
|
|
11581
11761
|
import { Component } from "react";
|
|
11582
|
-
import { jsx as
|
|
11762
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11583
11763
|
var PDFErrorBoundary = class extends Component {
|
|
11584
11764
|
constructor(props) {
|
|
11585
11765
|
super(props);
|
|
@@ -11607,7 +11787,7 @@ var PDFErrorBoundary = class extends Component {
|
|
|
11607
11787
|
return fallback;
|
|
11608
11788
|
}
|
|
11609
11789
|
if (showDefaultUI) {
|
|
11610
|
-
return /* @__PURE__ */
|
|
11790
|
+
return /* @__PURE__ */ jsx38(
|
|
11611
11791
|
DefaultErrorUI,
|
|
11612
11792
|
{
|
|
11613
11793
|
error,
|
|
@@ -11626,7 +11806,7 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11626
11806
|
const isNetworkError = error.message.includes("fetch") || error.message.includes("network") || error.message.includes("Failed to load");
|
|
11627
11807
|
let title = "Something went wrong";
|
|
11628
11808
|
let description = error.message;
|
|
11629
|
-
let icon = /* @__PURE__ */
|
|
11809
|
+
let icon = /* @__PURE__ */ jsx38("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx38(
|
|
11630
11810
|
"path",
|
|
11631
11811
|
{
|
|
11632
11812
|
strokeLinecap: "round",
|
|
@@ -11638,7 +11818,7 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11638
11818
|
if (isPDFError) {
|
|
11639
11819
|
title = "Unable to load PDF";
|
|
11640
11820
|
description = "The PDF file could not be loaded. It may be corrupted or in an unsupported format.";
|
|
11641
|
-
icon = /* @__PURE__ */
|
|
11821
|
+
icon = /* @__PURE__ */ jsx38("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx38(
|
|
11642
11822
|
"path",
|
|
11643
11823
|
{
|
|
11644
11824
|
strokeLinecap: "round",
|
|
@@ -11650,7 +11830,7 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11650
11830
|
} else if (isNetworkError) {
|
|
11651
11831
|
title = "Network error";
|
|
11652
11832
|
description = "Unable to fetch the PDF file. Please check your internet connection and try again.";
|
|
11653
|
-
icon = /* @__PURE__ */
|
|
11833
|
+
icon = /* @__PURE__ */ jsx38("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx38(
|
|
11654
11834
|
"path",
|
|
11655
11835
|
{
|
|
11656
11836
|
strokeLinecap: "round",
|
|
@@ -11660,7 +11840,7 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11660
11840
|
}
|
|
11661
11841
|
) });
|
|
11662
11842
|
}
|
|
11663
|
-
return /* @__PURE__ */
|
|
11843
|
+
return /* @__PURE__ */ jsxs32(
|
|
11664
11844
|
"div",
|
|
11665
11845
|
{
|
|
11666
11846
|
className: cn(
|
|
@@ -11673,14 +11853,14 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11673
11853
|
),
|
|
11674
11854
|
children: [
|
|
11675
11855
|
icon,
|
|
11676
|
-
/* @__PURE__ */
|
|
11677
|
-
/* @__PURE__ */
|
|
11678
|
-
/* @__PURE__ */
|
|
11679
|
-
/* @__PURE__ */
|
|
11680
|
-
/* @__PURE__ */
|
|
11856
|
+
/* @__PURE__ */ jsx38("h2", { className: "mt-4 text-xl font-semibold text-gray-900 dark:text-gray-100", children: title }),
|
|
11857
|
+
/* @__PURE__ */ jsx38("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400 max-w-md", children: description }),
|
|
11858
|
+
/* @__PURE__ */ jsxs32("details", { className: "mt-4 text-left max-w-md w-full", children: [
|
|
11859
|
+
/* @__PURE__ */ jsx38("summary", { className: "cursor-pointer text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200", children: "Technical details" }),
|
|
11860
|
+
/* @__PURE__ */ jsx38("pre", { className: "mt-2 p-2 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto", children: error.stack || error.message })
|
|
11681
11861
|
] }),
|
|
11682
|
-
/* @__PURE__ */
|
|
11683
|
-
/* @__PURE__ */
|
|
11862
|
+
/* @__PURE__ */ jsxs32("div", { className: "mt-6 flex gap-3", children: [
|
|
11863
|
+
/* @__PURE__ */ jsx38(
|
|
11684
11864
|
"button",
|
|
11685
11865
|
{
|
|
11686
11866
|
onClick: onReset,
|
|
@@ -11694,7 +11874,7 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11694
11874
|
children: "Try again"
|
|
11695
11875
|
}
|
|
11696
11876
|
),
|
|
11697
|
-
/* @__PURE__ */
|
|
11877
|
+
/* @__PURE__ */ jsx38(
|
|
11698
11878
|
"button",
|
|
11699
11879
|
{
|
|
11700
11880
|
onClick: () => window.location.reload(),
|
|
@@ -11714,9 +11894,12 @@ function DefaultErrorUI({ error, onReset, className }) {
|
|
|
11714
11894
|
);
|
|
11715
11895
|
}
|
|
11716
11896
|
function withErrorBoundary({ component, ...props }) {
|
|
11717
|
-
return /* @__PURE__ */
|
|
11897
|
+
return /* @__PURE__ */ jsx38(PDFErrorBoundary, { ...props, children: component });
|
|
11718
11898
|
}
|
|
11719
11899
|
|
|
11900
|
+
// src/components/index.ts
|
|
11901
|
+
init_PDFLoadingScreen2();
|
|
11902
|
+
|
|
11720
11903
|
// src/index.ts
|
|
11721
11904
|
init_hooks();
|
|
11722
11905
|
init_store();
|
|
@@ -11747,6 +11930,7 @@ export {
|
|
|
11747
11930
|
MobileToolbar,
|
|
11748
11931
|
OutlinePanel,
|
|
11749
11932
|
PDFErrorBoundary,
|
|
11933
|
+
PDFLoadingScreen,
|
|
11750
11934
|
PDFPage,
|
|
11751
11935
|
PDFThumbnailNav,
|
|
11752
11936
|
PDFViewer,
|