@page-speed/lightbox 0.1.8 → 0.2.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/components/index.js +330 -230
- package/dist/index.cjs +330 -230
- package/dist/index.js +330 -230
- package/dist/renderers/index.js +315 -215
- package/package.json +2 -2
package/dist/components/index.js
CHANGED
|
@@ -18069,7 +18069,7 @@ var require_pdf = __commonJS({
|
|
|
18069
18069
|
}
|
|
18070
18070
|
});
|
|
18071
18071
|
|
|
18072
|
-
// node_modules/.pnpm/@page-speed+pdf-viewer@0.1.
|
|
18072
|
+
// node_modules/.pnpm/@page-speed+pdf-viewer@0.1.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
|
|
18073
18073
|
var dist_exports = {};
|
|
18074
18074
|
__export(dist_exports, {
|
|
18075
18075
|
PDFCanvas: () => PDFCanvas,
|
|
@@ -18083,10 +18083,8 @@ __export(dist_exports, {
|
|
|
18083
18083
|
extractPageText: () => extractPageText,
|
|
18084
18084
|
formatFileSize: () => formatFileSize,
|
|
18085
18085
|
getOptimalRangeHeader: () => getOptimalRangeHeader,
|
|
18086
|
-
injectPDFViewerStyles: () => injectPDFViewerStyles,
|
|
18087
18086
|
isLinearizedPDF: () => isLinearizedPDF,
|
|
18088
18087
|
linearizedPDFConfig: () => linearizedPDFConfig,
|
|
18089
|
-
pdfViewerStyles: () => pdfViewerStyles,
|
|
18090
18088
|
usePDFDocument: () => usePDFDocument,
|
|
18091
18089
|
usePageRenderer: () => usePageRenderer,
|
|
18092
18090
|
usePageState: () => usePageState,
|
|
@@ -18339,19 +18337,8 @@ function useSearch(pdfDoc) {
|
|
|
18339
18337
|
prevResult
|
|
18340
18338
|
};
|
|
18341
18339
|
}
|
|
18342
|
-
function
|
|
18343
|
-
|
|
18344
|
-
if (stylesInjected) return;
|
|
18345
|
-
const styleId = "page-speed-pdf-viewer-styles";
|
|
18346
|
-
if (document.getElementById(styleId)) {
|
|
18347
|
-
stylesInjected = true;
|
|
18348
|
-
return;
|
|
18349
|
-
}
|
|
18350
|
-
const styleElement = document.createElement("style");
|
|
18351
|
-
styleElement.id = styleId;
|
|
18352
|
-
styleElement.textContent = PDF_VIEWER_STYLES;
|
|
18353
|
-
document.head.appendChild(styleElement);
|
|
18354
|
-
stylesInjected = true;
|
|
18340
|
+
function cn2(...classes) {
|
|
18341
|
+
return classes.filter(Boolean).join(" ");
|
|
18355
18342
|
}
|
|
18356
18343
|
function PDFCanvas({
|
|
18357
18344
|
pdfDoc,
|
|
@@ -18368,6 +18355,11 @@ function PDFCanvas({
|
|
|
18368
18355
|
while (containerRef.current.firstChild) {
|
|
18369
18356
|
containerRef.current.removeChild(containerRef.current.firstChild);
|
|
18370
18357
|
}
|
|
18358
|
+
renderedCanvas.style.maxWidth = "100%";
|
|
18359
|
+
renderedCanvas.style.maxHeight = "100%";
|
|
18360
|
+
renderedCanvas.style.width = "auto";
|
|
18361
|
+
renderedCanvas.style.height = "auto";
|
|
18362
|
+
renderedCanvas.style.objectFit = "contain";
|
|
18371
18363
|
containerRef.current.appendChild(renderedCanvas);
|
|
18372
18364
|
setCanvas(renderedCanvas);
|
|
18373
18365
|
}
|
|
@@ -18376,7 +18368,18 @@ function PDFCanvas({
|
|
|
18376
18368
|
render();
|
|
18377
18369
|
}
|
|
18378
18370
|
}, [pdfDoc, pageNumber, scale, onRender]);
|
|
18379
|
-
return /* @__PURE__ */ jsx4(
|
|
18371
|
+
return /* @__PURE__ */ jsx4(
|
|
18372
|
+
"div",
|
|
18373
|
+
{
|
|
18374
|
+
ref: containerRef,
|
|
18375
|
+
className: cn2(
|
|
18376
|
+
"flex-1 overflow-auto",
|
|
18377
|
+
"flex items-center justify-center",
|
|
18378
|
+
"p-4 min-h-0"
|
|
18379
|
+
),
|
|
18380
|
+
"data-pdf-viewer": "canvas"
|
|
18381
|
+
}
|
|
18382
|
+
);
|
|
18380
18383
|
}
|
|
18381
18384
|
async function isLinearizedPDF(url) {
|
|
18382
18385
|
try {
|
|
@@ -18450,101 +18453,151 @@ function PDFControls({
|
|
|
18450
18453
|
url
|
|
18451
18454
|
}) {
|
|
18452
18455
|
if (!pdfDocument) return null;
|
|
18453
|
-
return /* @__PURE__ */ jsxs(
|
|
18454
|
-
|
|
18455
|
-
|
|
18456
|
-
|
|
18457
|
-
|
|
18458
|
-
|
|
18459
|
-
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
|
|
18463
|
-
|
|
18464
|
-
|
|
18465
|
-
|
|
18466
|
-
|
|
18467
|
-
|
|
18468
|
-
|
|
18469
|
-
|
|
18470
|
-
|
|
18471
|
-
|
|
18472
|
-
|
|
18473
|
-
|
|
18474
|
-
|
|
18475
|
-
|
|
18476
|
-
|
|
18477
|
-
|
|
18478
|
-
|
|
18479
|
-
|
|
18480
|
-
|
|
18481
|
-
|
|
18482
|
-
|
|
18483
|
-
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
18490
|
-
|
|
18491
|
-
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
|
|
18514
|
-
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18518
|
-
|
|
18519
|
-
|
|
18520
|
-
|
|
18521
|
-
|
|
18522
|
-
|
|
18523
|
-
|
|
18524
|
-
|
|
18525
|
-
|
|
18526
|
-
|
|
18527
|
-
|
|
18528
|
-
|
|
18529
|
-
|
|
18530
|
-
|
|
18531
|
-
|
|
18532
|
-
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
|
|
18546
|
-
|
|
18547
|
-
|
|
18456
|
+
return /* @__PURE__ */ jsxs(
|
|
18457
|
+
"div",
|
|
18458
|
+
{
|
|
18459
|
+
className: cn2(
|
|
18460
|
+
"flex items-center gap-2",
|
|
18461
|
+
"px-3 py-2",
|
|
18462
|
+
"bg-background border-b border-border",
|
|
18463
|
+
"overflow-x-auto flex-wrap",
|
|
18464
|
+
"flex-shrink-0 z-10"
|
|
18465
|
+
),
|
|
18466
|
+
"data-pdf-viewer": "controls",
|
|
18467
|
+
children: [
|
|
18468
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
18469
|
+
/* @__PURE__ */ jsx22(
|
|
18470
|
+
IconButton,
|
|
18471
|
+
{
|
|
18472
|
+
onClick: pageState.prevPage,
|
|
18473
|
+
disabled: !pageState.canPrev,
|
|
18474
|
+
title: "Previous page",
|
|
18475
|
+
children: /* @__PURE__ */ jsx22(ChevronLeftIcon, {})
|
|
18476
|
+
}
|
|
18477
|
+
),
|
|
18478
|
+
/* @__PURE__ */ jsx22(
|
|
18479
|
+
"input",
|
|
18480
|
+
{
|
|
18481
|
+
type: "number",
|
|
18482
|
+
min: "1",
|
|
18483
|
+
max: pdfDocument.numPages,
|
|
18484
|
+
value: pageState.currentPage,
|
|
18485
|
+
onChange: (e) => pageState.goToPage(parseInt(e.target.value, 10) || 1),
|
|
18486
|
+
className: cn2(
|
|
18487
|
+
"w-14 h-8 px-2",
|
|
18488
|
+
"text-center text-sm font-medium",
|
|
18489
|
+
"bg-background border border-input rounded-md",
|
|
18490
|
+
"focus:outline-none focus:ring-2 focus:ring-ring"
|
|
18491
|
+
)
|
|
18492
|
+
}
|
|
18493
|
+
),
|
|
18494
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground whitespace-nowrap", children: [
|
|
18495
|
+
"of ",
|
|
18496
|
+
pdfDocument.numPages
|
|
18497
|
+
] }),
|
|
18498
|
+
/* @__PURE__ */ jsx22(
|
|
18499
|
+
IconButton,
|
|
18500
|
+
{
|
|
18501
|
+
onClick: pageState.nextPage,
|
|
18502
|
+
disabled: !pageState.canNext,
|
|
18503
|
+
title: "Next page",
|
|
18504
|
+
children: /* @__PURE__ */ jsx22(ChevronRightIcon, {})
|
|
18505
|
+
}
|
|
18506
|
+
)
|
|
18507
|
+
] }),
|
|
18508
|
+
/* @__PURE__ */ jsx22("div", { className: "w-px h-6 bg-border mx-1" }),
|
|
18509
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
18510
|
+
/* @__PURE__ */ jsx22(
|
|
18511
|
+
IconButton,
|
|
18512
|
+
{
|
|
18513
|
+
onClick: zoom.zoomOut,
|
|
18514
|
+
disabled: !zoom.canZoomOut,
|
|
18515
|
+
title: "Zoom out",
|
|
18516
|
+
children: /* @__PURE__ */ jsx22(MinusIcon, {})
|
|
18517
|
+
}
|
|
18518
|
+
),
|
|
18519
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-foreground min-w-[3.5rem] text-center", children: [
|
|
18520
|
+
Math.round(zoom.zoomLevel * 100),
|
|
18521
|
+
"%"
|
|
18522
|
+
] }),
|
|
18523
|
+
/* @__PURE__ */ jsx22(
|
|
18524
|
+
IconButton,
|
|
18525
|
+
{
|
|
18526
|
+
onClick: zoom.zoomIn,
|
|
18527
|
+
disabled: !zoom.canZoomIn,
|
|
18528
|
+
title: "Zoom in",
|
|
18529
|
+
children: /* @__PURE__ */ jsx22(PlusIcon, {})
|
|
18530
|
+
}
|
|
18531
|
+
)
|
|
18532
|
+
] }),
|
|
18533
|
+
/* @__PURE__ */ jsx22("div", { className: "w-px h-6 bg-border mx-1" }),
|
|
18534
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
18535
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
18536
|
+
/* @__PURE__ */ jsx22(
|
|
18537
|
+
"input",
|
|
18538
|
+
{
|
|
18539
|
+
type: "text",
|
|
18540
|
+
placeholder: "Search...",
|
|
18541
|
+
value: search.query,
|
|
18542
|
+
onChange: (e) => search.search(e.target.value),
|
|
18543
|
+
className: cn2(
|
|
18544
|
+
"h-8 pl-8 pr-3 w-32",
|
|
18545
|
+
"text-sm",
|
|
18546
|
+
"bg-background border border-input rounded-md",
|
|
18547
|
+
"placeholder:text-muted-foreground",
|
|
18548
|
+
"focus:outline-none focus:ring-2 focus:ring-ring"
|
|
18549
|
+
)
|
|
18550
|
+
}
|
|
18551
|
+
),
|
|
18552
|
+
/* @__PURE__ */ jsx22("div", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsx22(SearchIcon, {}) })
|
|
18553
|
+
] }),
|
|
18554
|
+
search.results.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
|
|
18555
|
+
search.results.length,
|
|
18556
|
+
" results"
|
|
18557
|
+
] })
|
|
18558
|
+
] }),
|
|
18559
|
+
/* @__PURE__ */ jsx22("div", { className: "flex-1" }),
|
|
18560
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
18561
|
+
enableDownload && /* @__PURE__ */ jsxs(
|
|
18562
|
+
ActionButton,
|
|
18563
|
+
{
|
|
18564
|
+
onClick: () => downloadPDF(url),
|
|
18565
|
+
title: "Download",
|
|
18566
|
+
children: [
|
|
18567
|
+
/* @__PURE__ */ jsx22(DownloadIcon, {}),
|
|
18568
|
+
/* @__PURE__ */ jsx22("span", { children: "Download" })
|
|
18569
|
+
]
|
|
18570
|
+
}
|
|
18571
|
+
),
|
|
18572
|
+
enablePrint && /* @__PURE__ */ jsxs(
|
|
18573
|
+
ActionButton,
|
|
18574
|
+
{
|
|
18575
|
+
onClick: () => window.print(),
|
|
18576
|
+
title: "Print",
|
|
18577
|
+
children: [
|
|
18578
|
+
/* @__PURE__ */ jsx22(PrintIcon, {}),
|
|
18579
|
+
/* @__PURE__ */ jsx22("span", { children: "Print" })
|
|
18580
|
+
]
|
|
18581
|
+
}
|
|
18582
|
+
),
|
|
18583
|
+
enableFullscreen && typeof document !== "undefined" && /* @__PURE__ */ jsx22(
|
|
18584
|
+
IconButton,
|
|
18585
|
+
{
|
|
18586
|
+
onClick: () => {
|
|
18587
|
+
if (document.fullscreenElement) {
|
|
18588
|
+
document.exitFullscreen();
|
|
18589
|
+
} else {
|
|
18590
|
+
document.documentElement?.requestFullscreen();
|
|
18591
|
+
}
|
|
18592
|
+
},
|
|
18593
|
+
title: "Fullscreen",
|
|
18594
|
+
children: /* @__PURE__ */ jsx22(FullscreenIcon, {})
|
|
18595
|
+
}
|
|
18596
|
+
)
|
|
18597
|
+
] })
|
|
18598
|
+
]
|
|
18599
|
+
}
|
|
18600
|
+
);
|
|
18548
18601
|
}
|
|
18549
18602
|
function PDFThumbnails({
|
|
18550
18603
|
pdfDoc,
|
|
@@ -18582,32 +18635,55 @@ function PDFThumbnails({
|
|
|
18582
18635
|
};
|
|
18583
18636
|
generateThumbnails();
|
|
18584
18637
|
}, [pdfDoc, numPages]);
|
|
18585
|
-
return /* @__PURE__ */ jsx32(
|
|
18638
|
+
return /* @__PURE__ */ jsx32(
|
|
18586
18639
|
"div",
|
|
18587
18640
|
{
|
|
18588
|
-
className:
|
|
18589
|
-
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
18641
|
+
className: cn2(
|
|
18642
|
+
"w-32 flex-shrink-0",
|
|
18643
|
+
"overflow-y-auto",
|
|
18644
|
+
"bg-muted/50 border-r border-border",
|
|
18645
|
+
"p-2 space-y-2"
|
|
18646
|
+
),
|
|
18647
|
+
"data-pdf-viewer": "thumbnails",
|
|
18648
|
+
children: thumbnails.map((thumb, idx) => /* @__PURE__ */ jsxs2(
|
|
18649
|
+
"div",
|
|
18650
|
+
{
|
|
18651
|
+
className: cn2(
|
|
18652
|
+
"cursor-pointer rounded-md overflow-hidden",
|
|
18653
|
+
"border-2 transition-colors duration-150",
|
|
18654
|
+
idx + 1 === currentPage ? "border-primary ring-2 ring-primary/20" : "border-transparent hover:border-muted-foreground/30"
|
|
18655
|
+
),
|
|
18656
|
+
onClick: () => onSelectPage(idx + 1),
|
|
18657
|
+
"data-pdf-viewer": "thumbnail",
|
|
18658
|
+
"data-active": idx + 1 === currentPage,
|
|
18659
|
+
children: [
|
|
18660
|
+
/* @__PURE__ */ jsx32(
|
|
18661
|
+
"canvas",
|
|
18662
|
+
{
|
|
18663
|
+
width: thumb.width,
|
|
18664
|
+
height: thumb.height,
|
|
18665
|
+
ref: (el) => {
|
|
18666
|
+
if (el && thumb) {
|
|
18667
|
+
const ctx = el.getContext("2d");
|
|
18668
|
+
if (ctx) {
|
|
18669
|
+
ctx.drawImage(thumb, 0, 0);
|
|
18670
|
+
}
|
|
18671
|
+
}
|
|
18672
|
+
},
|
|
18673
|
+
className: "w-full h-auto"
|
|
18674
|
+
}
|
|
18675
|
+
),
|
|
18676
|
+
/* @__PURE__ */ jsx32("span", { className: cn2(
|
|
18677
|
+
"block text-center text-xs py-1",
|
|
18678
|
+
"text-muted-foreground",
|
|
18679
|
+
idx + 1 === currentPage && "text-primary font-medium"
|
|
18680
|
+
), children: idx + 1 })
|
|
18681
|
+
]
|
|
18682
|
+
},
|
|
18683
|
+
idx
|
|
18684
|
+
))
|
|
18685
|
+
}
|
|
18686
|
+
);
|
|
18611
18687
|
}
|
|
18612
18688
|
function PDFViewer({
|
|
18613
18689
|
url,
|
|
@@ -18633,9 +18709,6 @@ function PDFViewer({
|
|
|
18633
18709
|
initialZoom = "auto",
|
|
18634
18710
|
withCredentials = false
|
|
18635
18711
|
} = config;
|
|
18636
|
-
useEffect42(() => {
|
|
18637
|
-
injectPDFViewerStyles();
|
|
18638
|
-
}, []);
|
|
18639
18712
|
const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError, withCredentials);
|
|
18640
18713
|
const pageState = usePageState({
|
|
18641
18714
|
totalPages: document2?.numPages || 0,
|
|
@@ -18658,19 +18731,48 @@ function PDFViewer({
|
|
|
18658
18731
|
}
|
|
18659
18732
|
}, [search.results, onSearchResults]);
|
|
18660
18733
|
if (error) {
|
|
18661
|
-
return /* @__PURE__ */ jsx42(
|
|
18662
|
-
"
|
|
18663
|
-
|
|
18664
|
-
|
|
18734
|
+
return /* @__PURE__ */ jsx42(
|
|
18735
|
+
"div",
|
|
18736
|
+
{
|
|
18737
|
+
className: cn2(
|
|
18738
|
+
"flex items-center justify-center",
|
|
18739
|
+
"bg-background rounded-lg",
|
|
18740
|
+
className
|
|
18741
|
+
),
|
|
18742
|
+
style: { height, width },
|
|
18743
|
+
children: /* @__PURE__ */ jsxs3("p", { className: "text-destructive text-base", children: [
|
|
18744
|
+
"Failed to load PDF: ",
|
|
18745
|
+
error.message
|
|
18746
|
+
] })
|
|
18747
|
+
}
|
|
18748
|
+
);
|
|
18665
18749
|
}
|
|
18666
18750
|
if (loading) {
|
|
18667
|
-
return /* @__PURE__ */ jsx42(
|
|
18751
|
+
return /* @__PURE__ */ jsx42(
|
|
18752
|
+
"div",
|
|
18753
|
+
{
|
|
18754
|
+
className: cn2(
|
|
18755
|
+
"flex items-center justify-center",
|
|
18756
|
+
"bg-background rounded-lg",
|
|
18757
|
+
className
|
|
18758
|
+
),
|
|
18759
|
+
style: { height, width },
|
|
18760
|
+
children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-base", children: "Loading PDF..." })
|
|
18761
|
+
}
|
|
18762
|
+
);
|
|
18668
18763
|
}
|
|
18669
18764
|
return /* @__PURE__ */ jsxs3(
|
|
18670
18765
|
"div",
|
|
18671
18766
|
{
|
|
18672
|
-
className:
|
|
18767
|
+
className: cn2(
|
|
18768
|
+
"flex flex-col",
|
|
18769
|
+
"bg-muted/30 rounded-lg overflow-hidden",
|
|
18770
|
+
"shadow-sm border border-border",
|
|
18771
|
+
"font-sans",
|
|
18772
|
+
className
|
|
18773
|
+
),
|
|
18673
18774
|
style: { height, width, ...style },
|
|
18775
|
+
"data-pdf-viewer": "root",
|
|
18674
18776
|
children: [
|
|
18675
18777
|
showControls && /* @__PURE__ */ jsx42(
|
|
18676
18778
|
PDFControls,
|
|
@@ -18685,7 +18787,7 @@ function PDFViewer({
|
|
|
18685
18787
|
url
|
|
18686
18788
|
}
|
|
18687
18789
|
),
|
|
18688
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
18790
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 overflow-hidden min-h-0", "data-pdf-viewer": "content", children: [
|
|
18689
18791
|
showThumbnails && document2 && /* @__PURE__ */ jsx42(
|
|
18690
18792
|
PDFThumbnails,
|
|
18691
18793
|
{
|
|
@@ -18733,82 +18835,80 @@ function createProgressiveFetchHandler(onProgress) {
|
|
|
18733
18835
|
return response.arrayBuffer();
|
|
18734
18836
|
};
|
|
18735
18837
|
}
|
|
18736
|
-
var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP,
|
|
18838
|
+
var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, ChevronLeftIcon, ChevronRightIcon, MinusIcon, PlusIcon, DownloadIcon, PrintIcon, FullscreenIcon, SearchIcon, IconButton, ActionButton, linearizedPDFConfig;
|
|
18737
18839
|
var init_dist = __esm({
|
|
18738
|
-
"node_modules/.pnpm/@page-speed+pdf-viewer@0.1.
|
|
18840
|
+
"node_modules/.pnpm/@page-speed+pdf-viewer@0.1.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
|
|
18739
18841
|
"use client";
|
|
18740
18842
|
DEFAULT_SCALE = 1.5;
|
|
18741
18843
|
CACHE_SIZE = 50 * 1024 * 1024;
|
|
18742
18844
|
MIN_ZOOM = 0.5;
|
|
18743
18845
|
MAX_ZOOM = 3;
|
|
18744
18846
|
ZOOM_STEP = 0.25;
|
|
18745
|
-
|
|
18746
|
-
/*
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
/*
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
18759
|
-
|
|
18760
|
-
|
|
18761
|
-
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
|
|
18765
|
-
|
|
18766
|
-
/*
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
}
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
|
|
18795
|
-
|
|
18796
|
-
|
|
18797
|
-
|
|
18798
|
-
|
|
18799
|
-
|
|
18800
|
-
|
|
18801
|
-
|
|
18802
|
-
|
|
18803
|
-
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
error: "PDFViewer_error"
|
|
18811
|
-
};
|
|
18847
|
+
ChevronLeftIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M15 18l-6-6 6-6" }) });
|
|
18848
|
+
ChevronRightIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M9 18l6-6-6-6" }) });
|
|
18849
|
+
MinusIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M5 12h14" }) });
|
|
18850
|
+
PlusIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M12 5v14M5 12h14" }) });
|
|
18851
|
+
DownloadIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }) });
|
|
18852
|
+
PrintIcon = () => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
18853
|
+
/* @__PURE__ */ jsx22("polyline", { points: "6 9 6 2 18 2 18 9" }),
|
|
18854
|
+
/* @__PURE__ */ jsx22("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
|
|
18855
|
+
/* @__PURE__ */ jsx22("rect", { x: "6", y: "14", width: "12", height: "8" })
|
|
18856
|
+
] });
|
|
18857
|
+
FullscreenIcon = () => /* @__PURE__ */ jsx22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx22("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) });
|
|
18858
|
+
SearchIcon = () => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
18859
|
+
/* @__PURE__ */ jsx22("circle", { cx: "11", cy: "11", r: "8" }),
|
|
18860
|
+
/* @__PURE__ */ jsx22("path", { d: "M21 21l-4.35-4.35" })
|
|
18861
|
+
] });
|
|
18862
|
+
IconButton = ({
|
|
18863
|
+
onClick,
|
|
18864
|
+
disabled,
|
|
18865
|
+
title,
|
|
18866
|
+
children,
|
|
18867
|
+
className
|
|
18868
|
+
}) => /* @__PURE__ */ jsx22(
|
|
18869
|
+
"button",
|
|
18870
|
+
{
|
|
18871
|
+
type: "button",
|
|
18872
|
+
onClick,
|
|
18873
|
+
disabled,
|
|
18874
|
+
title,
|
|
18875
|
+
className: cn2(
|
|
18876
|
+
"inline-flex items-center justify-center",
|
|
18877
|
+
"h-8 w-8 rounded-md",
|
|
18878
|
+
"bg-secondary text-secondary-foreground",
|
|
18879
|
+
"hover:bg-secondary/80",
|
|
18880
|
+
"transition-colors duration-150",
|
|
18881
|
+
"disabled:opacity-50 disabled:pointer-events-none",
|
|
18882
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
18883
|
+
className
|
|
18884
|
+
),
|
|
18885
|
+
children
|
|
18886
|
+
}
|
|
18887
|
+
);
|
|
18888
|
+
ActionButton = ({
|
|
18889
|
+
onClick,
|
|
18890
|
+
title,
|
|
18891
|
+
children,
|
|
18892
|
+
className
|
|
18893
|
+
}) => /* @__PURE__ */ jsx22(
|
|
18894
|
+
"button",
|
|
18895
|
+
{
|
|
18896
|
+
type: "button",
|
|
18897
|
+
onClick,
|
|
18898
|
+
title,
|
|
18899
|
+
className: cn2(
|
|
18900
|
+
"inline-flex items-center justify-center gap-1.5",
|
|
18901
|
+
"h-8 px-3 rounded-md",
|
|
18902
|
+
"bg-primary text-primary-foreground",
|
|
18903
|
+
"hover:bg-primary/90",
|
|
18904
|
+
"text-sm font-medium",
|
|
18905
|
+
"transition-colors duration-150",
|
|
18906
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
18907
|
+
className
|
|
18908
|
+
),
|
|
18909
|
+
children
|
|
18910
|
+
}
|
|
18911
|
+
);
|
|
18812
18912
|
linearizedPDFConfig = {
|
|
18813
18913
|
rangeChunkSize: 65536,
|
|
18814
18914
|
// 64 KB chunks for streaming
|
|
@@ -22737,7 +22837,7 @@ var DEFAULT_CONTROLS = {
|
|
|
22737
22837
|
function mergeControls(overrides) {
|
|
22738
22838
|
return { ...DEFAULT_CONTROLS, ...overrides || {} };
|
|
22739
22839
|
}
|
|
22740
|
-
var
|
|
22840
|
+
var IconButton2 = ({
|
|
22741
22841
|
onClick,
|
|
22742
22842
|
disabled,
|
|
22743
22843
|
ariaLabel,
|
|
@@ -22766,8 +22866,8 @@ var IconButton = ({
|
|
|
22766
22866
|
var ArrowLeftIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M19 12H5M12 19l-7-7 7-7" }) });
|
|
22767
22867
|
var ArrowRightIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M5 12h14M12 5l7 7-7 7" }) });
|
|
22768
22868
|
var CloseIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M18 6L6 18M6 6l12 12" }) });
|
|
22769
|
-
var
|
|
22770
|
-
var
|
|
22869
|
+
var FullscreenIcon2 = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) });
|
|
22870
|
+
var DownloadIcon2 = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }) });
|
|
22771
22871
|
var ShareIcon = () => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8M16 6l-4-4-4 4M12 2v13" }) });
|
|
22772
22872
|
function LightboxChrome({
|
|
22773
22873
|
currentIndex,
|
|
@@ -22905,23 +23005,23 @@ function LightboxChrome({
|
|
|
22905
23005
|
className
|
|
22906
23006
|
), children: [
|
|
22907
23007
|
resolved.navigation && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
22908
|
-
/* @__PURE__ */ jsx8(
|
|
22909
|
-
/* @__PURE__ */ jsx8(
|
|
23008
|
+
/* @__PURE__ */ jsx8(IconButton2, { onClick: onPrev, disabled: !canPrev, ariaLabel: "Previous item", children: /* @__PURE__ */ jsx8(ArrowLeftIcon, {}) }),
|
|
23009
|
+
/* @__PURE__ */ jsx8(IconButton2, { onClick: onNext, disabled: !canNext, ariaLabel: "Next item", children: /* @__PURE__ */ jsx8(ArrowRightIcon, {}) })
|
|
22910
23010
|
] }),
|
|
22911
23011
|
/* @__PURE__ */ jsx8("div", { className: "flex flex-col", children: resolved.captions && currentItem && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
22912
23012
|
currentItem.title && /* @__PURE__ */ jsx8("div", { className: "text-sm font-semibold", children: currentItem.title }),
|
|
22913
23013
|
currentItem.caption && /* @__PURE__ */ jsx8("div", { className: "text-xs text-white/70", children: currentItem.caption })
|
|
22914
23014
|
] }) }),
|
|
22915
23015
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
22916
|
-
resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(
|
|
22917
|
-
resolved.fullscreen && /* @__PURE__ */ jsx8(
|
|
22918
|
-
resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(
|
|
23016
|
+
resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleShare, ariaLabel: "Share", children: /* @__PURE__ */ jsx8(ShareIcon, {}) }),
|
|
23017
|
+
resolved.fullscreen && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleFullscreen, ariaLabel: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsx8(FullscreenIcon2, {}) }),
|
|
23018
|
+
resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleDownload, ariaLabel: "Download", children: /* @__PURE__ */ jsx8(DownloadIcon2, {}) }),
|
|
22919
23019
|
resolved.counter && totalItems > 0 && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-white/70", children: [
|
|
22920
23020
|
currentIndex + 1,
|
|
22921
23021
|
" / ",
|
|
22922
23022
|
totalItems
|
|
22923
23023
|
] }),
|
|
22924
|
-
resolved.closeButton && /* @__PURE__ */ jsx8(
|
|
23024
|
+
resolved.closeButton && /* @__PURE__ */ jsx8(IconButton2, { onClick: onClose, ariaLabel: "Close lightbox", children: /* @__PURE__ */ jsx8(CloseIcon, {}) })
|
|
22925
23025
|
] })
|
|
22926
23026
|
] });
|
|
22927
23027
|
}
|
|
@@ -22931,14 +23031,14 @@ function LightboxChrome({
|
|
|
22931
23031
|
"flex items-center gap-2",
|
|
22932
23032
|
className
|
|
22933
23033
|
), children: [
|
|
22934
|
-
resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(
|
|
22935
|
-
resolved.fullscreen && /* @__PURE__ */ jsx8(
|
|
22936
|
-
resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(
|
|
22937
|
-
resolved.closeButton && /* @__PURE__ */ jsx8(
|
|
23034
|
+
resolved.share && "share" in navigator && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleShare, ariaLabel: "Share", children: /* @__PURE__ */ jsx8(ShareIcon, {}) }),
|
|
23035
|
+
resolved.fullscreen && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleFullscreen, ariaLabel: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsx8(FullscreenIcon2, {}) }),
|
|
23036
|
+
resolved.download && currentItem?.src && /* @__PURE__ */ jsx8(IconButton2, { onClick: handleDownload, ariaLabel: "Download", children: /* @__PURE__ */ jsx8(DownloadIcon2, {}) }),
|
|
23037
|
+
resolved.closeButton && /* @__PURE__ */ jsx8(IconButton2, { onClick: onClose, ariaLabel: "Close lightbox", children: /* @__PURE__ */ jsx8(CloseIcon, {}) })
|
|
22938
23038
|
] }),
|
|
22939
23039
|
resolved.navigation && /* @__PURE__ */ jsxs4("div", { className: "fixed bottom-6 right-6 z-50 flex items-center gap-3", children: [
|
|
22940
|
-
/* @__PURE__ */ jsx8(
|
|
22941
|
-
/* @__PURE__ */ jsx8(
|
|
23040
|
+
/* @__PURE__ */ jsx8(IconButton2, { onClick: onPrev, disabled: !canPrev, ariaLabel: "Previous item", children: /* @__PURE__ */ jsx8(ArrowLeftIcon, {}) }),
|
|
23041
|
+
/* @__PURE__ */ jsx8(IconButton2, { onClick: onNext, disabled: !canNext, ariaLabel: "Next item", children: /* @__PURE__ */ jsx8(ArrowRightIcon, {}) })
|
|
22942
23042
|
] }),
|
|
22943
23043
|
resolved.captions && currentItem && (currentItem.title || currentItem.caption) && /* @__PURE__ */ jsxs4("div", { className: cn(
|
|
22944
23044
|
"fixed bottom-6 left-6 z-50",
|