pdfjs-reader-core 0.2.8 → 0.2.9
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 +315 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +224 -236
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4740,7 +4740,7 @@ var init_ThumbnailPanel = __esm({
|
|
|
4740
4740
|
className,
|
|
4741
4741
|
thumbnailScale = 0.2
|
|
4742
4742
|
}) {
|
|
4743
|
-
const { document: document2, currentPage, numPages, goToPage
|
|
4743
|
+
const { document: document2, currentPage, numPages, goToPage } = usePDFViewer();
|
|
4744
4744
|
const containerRef = useRef7(null);
|
|
4745
4745
|
useEffect9(() => {
|
|
4746
4746
|
const container = containerRef.current;
|
|
@@ -4757,10 +4757,7 @@ var init_ThumbnailPanel = __esm({
|
|
|
4757
4757
|
[goToPage]
|
|
4758
4758
|
);
|
|
4759
4759
|
if (!document2) {
|
|
4760
|
-
|
|
4761
|
-
return null;
|
|
4762
|
-
}
|
|
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" }) });
|
|
4760
|
+
return null;
|
|
4764
4761
|
}
|
|
4765
4762
|
return /* @__PURE__ */ jsx4(
|
|
4766
4763
|
"div",
|
|
@@ -5091,7 +5088,7 @@ var init_OutlinePanel = __esm({
|
|
|
5091
5088
|
OutlinePanel = memo5(function OutlinePanel2({
|
|
5092
5089
|
className
|
|
5093
5090
|
}) {
|
|
5094
|
-
const { document: document2, goToPage
|
|
5091
|
+
const { document: document2, goToPage } = usePDFViewer();
|
|
5095
5092
|
const [outline, setOutline] = useState8(null);
|
|
5096
5093
|
const [isLoading, setIsLoading] = useState8(false);
|
|
5097
5094
|
const [error, setError] = useState8(null);
|
|
@@ -5170,10 +5167,7 @@ var init_OutlinePanel = __esm({
|
|
|
5170
5167
|
[goToPage]
|
|
5171
5168
|
);
|
|
5172
5169
|
if (!document2) {
|
|
5173
|
-
|
|
5174
|
-
return null;
|
|
5175
|
-
}
|
|
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" }) });
|
|
5170
|
+
return null;
|
|
5177
5171
|
}
|
|
5178
5172
|
if (isLoading) {
|
|
5179
5173
|
return /* @__PURE__ */ jsx6("div", { className: cn("flex items-center justify-center p-4", className), children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
@@ -7693,9 +7687,141 @@ var init_PDFPage2 = __esm({
|
|
|
7693
7687
|
}
|
|
7694
7688
|
});
|
|
7695
7689
|
|
|
7696
|
-
// src/components/
|
|
7697
|
-
import { memo as memo18
|
|
7690
|
+
// src/components/PDFLoadingScreen/PDFLoadingScreen.tsx
|
|
7691
|
+
import { memo as memo18 } from "react";
|
|
7698
7692
|
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7693
|
+
function formatBytes(bytes) {
|
|
7694
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
7695
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
7696
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
7697
|
+
}
|
|
7698
|
+
var phaseMessages, PDFLoadingScreen;
|
|
7699
|
+
var init_PDFLoadingScreen = __esm({
|
|
7700
|
+
"src/components/PDFLoadingScreen/PDFLoadingScreen.tsx"() {
|
|
7701
|
+
"use strict";
|
|
7702
|
+
init_utils();
|
|
7703
|
+
phaseMessages = {
|
|
7704
|
+
initializing: "Initializing...",
|
|
7705
|
+
fetching: "Loading document...",
|
|
7706
|
+
parsing: "Processing pages...",
|
|
7707
|
+
rendering: "Preparing view..."
|
|
7708
|
+
};
|
|
7709
|
+
PDFLoadingScreen = memo18(function PDFLoadingScreen2({
|
|
7710
|
+
progress,
|
|
7711
|
+
bytesLoaded,
|
|
7712
|
+
totalBytes,
|
|
7713
|
+
phase = "fetching",
|
|
7714
|
+
documentName,
|
|
7715
|
+
className
|
|
7716
|
+
}) {
|
|
7717
|
+
const hasProgress = progress !== void 0 && progress >= 0;
|
|
7718
|
+
const hasBytes = bytesLoaded !== void 0 && totalBytes !== void 0 && totalBytes > 0;
|
|
7719
|
+
return /* @__PURE__ */ jsxs16(
|
|
7720
|
+
"div",
|
|
7721
|
+
{
|
|
7722
|
+
className: cn(
|
|
7723
|
+
"pdf-loading-screen",
|
|
7724
|
+
"flex flex-col items-center justify-center",
|
|
7725
|
+
"w-full h-full min-h-[400px]",
|
|
7726
|
+
"bg-slate-50 dark:bg-slate-800",
|
|
7727
|
+
className
|
|
7728
|
+
),
|
|
7729
|
+
role: "status",
|
|
7730
|
+
"aria-live": "polite",
|
|
7731
|
+
"aria-label": phaseMessages[phase],
|
|
7732
|
+
children: [
|
|
7733
|
+
/* @__PURE__ */ jsxs16("div", { className: "pdf-loading-skeleton", children: [
|
|
7734
|
+
/* @__PURE__ */ jsx19("div", { className: "pdf-loading-icon", children: /* @__PURE__ */ jsxs16(
|
|
7735
|
+
"svg",
|
|
7736
|
+
{
|
|
7737
|
+
width: "48",
|
|
7738
|
+
height: "56",
|
|
7739
|
+
viewBox: "0 0 48 56",
|
|
7740
|
+
fill: "none",
|
|
7741
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7742
|
+
className: "pdf-document-icon",
|
|
7743
|
+
children: [
|
|
7744
|
+
/* @__PURE__ */ jsx19(
|
|
7745
|
+
"path",
|
|
7746
|
+
{
|
|
7747
|
+
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",
|
|
7748
|
+
className: "fill-white dark:fill-slate-700"
|
|
7749
|
+
}
|
|
7750
|
+
),
|
|
7751
|
+
/* @__PURE__ */ jsx19(
|
|
7752
|
+
"path",
|
|
7753
|
+
{
|
|
7754
|
+
d: "M30 0L44 14H34C31.7909 14 30 12.2091 30 10V0Z",
|
|
7755
|
+
className: "fill-slate-200 dark:fill-slate-600"
|
|
7756
|
+
}
|
|
7757
|
+
),
|
|
7758
|
+
/* @__PURE__ */ jsx19("rect", { x: "10", y: "22", width: "24", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
7759
|
+
/* @__PURE__ */ jsx19("rect", { x: "10", y: "28", width: "20", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
7760
|
+
/* @__PURE__ */ jsx19("rect", { x: "10", y: "34", width: "22", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
7761
|
+
/* @__PURE__ */ jsx19("rect", { x: "10", y: "40", width: "16", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
|
|
7762
|
+
/* @__PURE__ */ jsx19(
|
|
7763
|
+
"path",
|
|
7764
|
+
{
|
|
7765
|
+
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",
|
|
7766
|
+
className: "stroke-slate-300 dark:stroke-slate-500",
|
|
7767
|
+
strokeWidth: "1",
|
|
7768
|
+
fill: "none"
|
|
7769
|
+
}
|
|
7770
|
+
)
|
|
7771
|
+
]
|
|
7772
|
+
}
|
|
7773
|
+
) }),
|
|
7774
|
+
/* @__PURE__ */ jsxs16("div", { className: "pdf-skeleton-lines", children: [
|
|
7775
|
+
/* @__PURE__ */ jsx19("div", { className: "pdf-skeleton-line pdf-skeleton-line-1" }),
|
|
7776
|
+
/* @__PURE__ */ jsx19("div", { className: "pdf-skeleton-line pdf-skeleton-line-2" }),
|
|
7777
|
+
/* @__PURE__ */ jsx19("div", { className: "pdf-skeleton-line pdf-skeleton-line-3" })
|
|
7778
|
+
] })
|
|
7779
|
+
] }),
|
|
7780
|
+
/* @__PURE__ */ jsxs16("div", { className: "pdf-loading-info", children: [
|
|
7781
|
+
documentName && /* @__PURE__ */ jsx19("p", { className: "pdf-loading-document-name", children: documentName }),
|
|
7782
|
+
/* @__PURE__ */ jsx19("p", { className: "pdf-loading-message", children: phaseMessages[phase] }),
|
|
7783
|
+
/* @__PURE__ */ jsxs16("div", { className: "pdf-loading-progress-container", children: [
|
|
7784
|
+
/* @__PURE__ */ jsx19("div", { className: "pdf-loading-progress-track", children: /* @__PURE__ */ jsx19(
|
|
7785
|
+
"div",
|
|
7786
|
+
{
|
|
7787
|
+
className: cn(
|
|
7788
|
+
"pdf-loading-progress-fill",
|
|
7789
|
+
!hasProgress && "pdf-loading-progress-indeterminate"
|
|
7790
|
+
),
|
|
7791
|
+
style: hasProgress ? { width: `${Math.min(100, progress)}%` } : void 0
|
|
7792
|
+
}
|
|
7793
|
+
) }),
|
|
7794
|
+
/* @__PURE__ */ jsxs16("div", { className: "pdf-loading-progress-details", children: [
|
|
7795
|
+
hasProgress && /* @__PURE__ */ jsxs16("span", { className: "pdf-loading-progress-percent", children: [
|
|
7796
|
+
Math.round(progress),
|
|
7797
|
+
"%"
|
|
7798
|
+
] }),
|
|
7799
|
+
hasBytes && /* @__PURE__ */ jsxs16("span", { className: "pdf-loading-progress-bytes", children: [
|
|
7800
|
+
formatBytes(bytesLoaded),
|
|
7801
|
+
" / ",
|
|
7802
|
+
formatBytes(totalBytes)
|
|
7803
|
+
] })
|
|
7804
|
+
] })
|
|
7805
|
+
] })
|
|
7806
|
+
] })
|
|
7807
|
+
]
|
|
7808
|
+
}
|
|
7809
|
+
);
|
|
7810
|
+
});
|
|
7811
|
+
}
|
|
7812
|
+
});
|
|
7813
|
+
|
|
7814
|
+
// src/components/PDFLoadingScreen/index.ts
|
|
7815
|
+
var init_PDFLoadingScreen2 = __esm({
|
|
7816
|
+
"src/components/PDFLoadingScreen/index.ts"() {
|
|
7817
|
+
"use strict";
|
|
7818
|
+
init_PDFLoadingScreen();
|
|
7819
|
+
}
|
|
7820
|
+
});
|
|
7821
|
+
|
|
7822
|
+
// src/components/SelectionToolbar/SelectionToolbar.tsx
|
|
7823
|
+
import { memo as memo19, useEffect as useEffect17, useState as useState16, useCallback as useCallback27, useRef as useRef14 } from "react";
|
|
7824
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7699
7825
|
function calculatePosition(selection) {
|
|
7700
7826
|
if (!selection || selection.rects.length === 0) {
|
|
7701
7827
|
return { top: 0, left: 0, visible: false };
|
|
@@ -7722,7 +7848,7 @@ var init_SelectionToolbar = __esm({
|
|
|
7722
7848
|
{ color: "pink", bg: "bg-pink-300", hoverBg: "hover:bg-pink-400", ringColor: "ring-pink-400" },
|
|
7723
7849
|
{ color: "orange", bg: "bg-orange-300", hoverBg: "hover:bg-orange-400", ringColor: "ring-orange-400" }
|
|
7724
7850
|
];
|
|
7725
|
-
SelectionToolbar =
|
|
7851
|
+
SelectionToolbar = memo19(function SelectionToolbar2({
|
|
7726
7852
|
selection,
|
|
7727
7853
|
onCreateHighlight,
|
|
7728
7854
|
onCopy,
|
|
@@ -7771,7 +7897,7 @@ var init_SelectionToolbar = __esm({
|
|
|
7771
7897
|
if (!position.visible || !selection?.text) {
|
|
7772
7898
|
return null;
|
|
7773
7899
|
}
|
|
7774
|
-
return /* @__PURE__ */
|
|
7900
|
+
return /* @__PURE__ */ jsxs17(
|
|
7775
7901
|
"div",
|
|
7776
7902
|
{
|
|
7777
7903
|
ref: toolbarRef,
|
|
@@ -7795,7 +7921,7 @@ var init_SelectionToolbar = __esm({
|
|
|
7795
7921
|
e.stopPropagation();
|
|
7796
7922
|
},
|
|
7797
7923
|
children: [
|
|
7798
|
-
HIGHLIGHT_COLOR_BUTTONS.map((btn) => /* @__PURE__ */
|
|
7924
|
+
HIGHLIGHT_COLOR_BUTTONS.map((btn) => /* @__PURE__ */ jsx20(
|
|
7799
7925
|
"button",
|
|
7800
7926
|
{
|
|
7801
7927
|
onClick: () => handleColorClick(btn.color),
|
|
@@ -7812,7 +7938,7 @@ var init_SelectionToolbar = __esm({
|
|
|
7812
7938
|
),
|
|
7813
7939
|
title: `Highlight ${btn.color}`,
|
|
7814
7940
|
"aria-label": `Highlight with ${btn.color}`,
|
|
7815
|
-
children: /* @__PURE__ */
|
|
7941
|
+
children: /* @__PURE__ */ jsx20("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx20(
|
|
7816
7942
|
"path",
|
|
7817
7943
|
{
|
|
7818
7944
|
strokeLinecap: "round",
|
|
@@ -7824,8 +7950,8 @@ var init_SelectionToolbar = __esm({
|
|
|
7824
7950
|
},
|
|
7825
7951
|
btn.color
|
|
7826
7952
|
)),
|
|
7827
|
-
/* @__PURE__ */
|
|
7828
|
-
/* @__PURE__ */
|
|
7953
|
+
/* @__PURE__ */ jsx20("div", { className: "w-px h-6 bg-gray-300 dark:bg-gray-600 mx-1" }),
|
|
7954
|
+
/* @__PURE__ */ jsx20(
|
|
7829
7955
|
"button",
|
|
7830
7956
|
{
|
|
7831
7957
|
onClick: handleCopy,
|
|
@@ -7837,7 +7963,7 @@ var init_SelectionToolbar = __esm({
|
|
|
7837
7963
|
),
|
|
7838
7964
|
title: "Copy text",
|
|
7839
7965
|
"aria-label": "Copy selected text",
|
|
7840
|
-
children: /* @__PURE__ */
|
|
7966
|
+
children: /* @__PURE__ */ jsx20("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx20(
|
|
7841
7967
|
"path",
|
|
7842
7968
|
{
|
|
7843
7969
|
strokeLinecap: "round",
|
|
@@ -7864,8 +7990,8 @@ var init_SelectionToolbar2 = __esm({
|
|
|
7864
7990
|
});
|
|
7865
7991
|
|
|
7866
7992
|
// src/components/HighlightPopover/HighlightPopover.tsx
|
|
7867
|
-
import { memo as
|
|
7868
|
-
import { jsx as
|
|
7993
|
+
import { memo as memo20, useCallback as useCallback28, useState as useState17, useRef as useRef15, useEffect as useEffect18 } from "react";
|
|
7994
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7869
7995
|
function calculatePopoverPosition(highlight, scale, pageElement) {
|
|
7870
7996
|
if (!pageElement || !highlight.rects.length) {
|
|
7871
7997
|
return { top: 0, left: 0, visible: false };
|
|
@@ -7891,7 +8017,7 @@ var init_HighlightPopover = __esm({
|
|
|
7891
8017
|
{ color: "pink", bg: "bg-pink-300", hoverBg: "hover:bg-pink-400", borderColor: "border-pink-400" },
|
|
7892
8018
|
{ color: "orange", bg: "bg-orange-300", hoverBg: "hover:bg-orange-400", borderColor: "border-orange-400" }
|
|
7893
8019
|
];
|
|
7894
|
-
HighlightPopover =
|
|
8020
|
+
HighlightPopover = memo20(function HighlightPopover2({
|
|
7895
8021
|
highlight,
|
|
7896
8022
|
scale,
|
|
7897
8023
|
pageElement,
|
|
@@ -8002,7 +8128,7 @@ var init_HighlightPopover = __esm({
|
|
|
8002
8128
|
if (!highlight || !position.visible) {
|
|
8003
8129
|
return null;
|
|
8004
8130
|
}
|
|
8005
|
-
return /* @__PURE__ */
|
|
8131
|
+
return /* @__PURE__ */ jsxs18(
|
|
8006
8132
|
"div",
|
|
8007
8133
|
{
|
|
8008
8134
|
ref: popoverRef,
|
|
@@ -8022,8 +8148,8 @@ var init_HighlightPopover = __esm({
|
|
|
8022
8148
|
width: 280
|
|
8023
8149
|
},
|
|
8024
8150
|
children: [
|
|
8025
|
-
/* @__PURE__ */
|
|
8026
|
-
/* @__PURE__ */
|
|
8151
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between p-2 border-b border-gray-200 dark:border-gray-700", children: [
|
|
8152
|
+
/* @__PURE__ */ jsx21("div", { className: "flex items-center gap-1", children: HIGHLIGHT_COLOR_OPTIONS.map((opt) => /* @__PURE__ */ jsx21(
|
|
8027
8153
|
"button",
|
|
8028
8154
|
{
|
|
8029
8155
|
onClick: () => handleColorClick(opt.color),
|
|
@@ -8041,7 +8167,7 @@ var init_HighlightPopover = __esm({
|
|
|
8041
8167
|
},
|
|
8042
8168
|
opt.color
|
|
8043
8169
|
)) }),
|
|
8044
|
-
/* @__PURE__ */
|
|
8170
|
+
/* @__PURE__ */ jsx21(
|
|
8045
8171
|
"button",
|
|
8046
8172
|
{
|
|
8047
8173
|
onClick: handleDeleteClick,
|
|
@@ -8053,7 +8179,7 @@ var init_HighlightPopover = __esm({
|
|
|
8053
8179
|
),
|
|
8054
8180
|
title: "Delete highlight",
|
|
8055
8181
|
"aria-label": "Delete highlight",
|
|
8056
|
-
children: /* @__PURE__ */
|
|
8182
|
+
children: /* @__PURE__ */ jsx21("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx21(
|
|
8057
8183
|
"path",
|
|
8058
8184
|
{
|
|
8059
8185
|
strokeLinecap: "round",
|
|
@@ -8065,8 +8191,8 @@ var init_HighlightPopover = __esm({
|
|
|
8065
8191
|
}
|
|
8066
8192
|
)
|
|
8067
8193
|
] }),
|
|
8068
|
-
/* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8194
|
+
/* @__PURE__ */ jsx21("div", { className: "p-2", children: isEditingComment ? /* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
|
|
8195
|
+
/* @__PURE__ */ jsx21(
|
|
8070
8196
|
"textarea",
|
|
8071
8197
|
{
|
|
8072
8198
|
ref: textareaRef,
|
|
@@ -8085,8 +8211,8 @@ var init_HighlightPopover = __esm({
|
|
|
8085
8211
|
rows: 3
|
|
8086
8212
|
}
|
|
8087
8213
|
),
|
|
8088
|
-
/* @__PURE__ */
|
|
8089
|
-
/* @__PURE__ */
|
|
8214
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex justify-end gap-2", children: [
|
|
8215
|
+
/* @__PURE__ */ jsx21(
|
|
8090
8216
|
"button",
|
|
8091
8217
|
{
|
|
8092
8218
|
onClick: () => {
|
|
@@ -8102,7 +8228,7 @@ var init_HighlightPopover = __esm({
|
|
|
8102
8228
|
children: "Cancel"
|
|
8103
8229
|
}
|
|
8104
8230
|
),
|
|
8105
|
-
/* @__PURE__ */
|
|
8231
|
+
/* @__PURE__ */ jsx21(
|
|
8106
8232
|
"button",
|
|
8107
8233
|
{
|
|
8108
8234
|
onClick: handleSaveComment,
|
|
@@ -8116,14 +8242,14 @@ var init_HighlightPopover = __esm({
|
|
|
8116
8242
|
}
|
|
8117
8243
|
)
|
|
8118
8244
|
] })
|
|
8119
|
-
] }) : /* @__PURE__ */
|
|
8120
|
-
/* @__PURE__ */
|
|
8245
|
+
] }) : /* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
|
|
8246
|
+
/* @__PURE__ */ jsxs18("p", { className: "text-xs text-gray-500 dark:text-gray-400 line-clamp-2", children: [
|
|
8121
8247
|
"\u201C",
|
|
8122
8248
|
highlight.text.slice(0, 100),
|
|
8123
8249
|
highlight.text.length > 100 ? "..." : "",
|
|
8124
8250
|
"\u201D"
|
|
8125
8251
|
] }),
|
|
8126
|
-
highlight.comment ? /* @__PURE__ */
|
|
8252
|
+
highlight.comment ? /* @__PURE__ */ jsx21(
|
|
8127
8253
|
"button",
|
|
8128
8254
|
{
|
|
8129
8255
|
onClick: () => setIsEditingComment(true),
|
|
@@ -8136,7 +8262,7 @@ var init_HighlightPopover = __esm({
|
|
|
8136
8262
|
),
|
|
8137
8263
|
children: highlight.comment
|
|
8138
8264
|
}
|
|
8139
|
-
) : /* @__PURE__ */
|
|
8265
|
+
) : /* @__PURE__ */ jsx21(
|
|
8140
8266
|
"button",
|
|
8141
8267
|
{
|
|
8142
8268
|
onClick: () => setIsEditingComment(true),
|
|
@@ -8149,7 +8275,7 @@ var init_HighlightPopover = __esm({
|
|
|
8149
8275
|
children: "+ Add a note..."
|
|
8150
8276
|
}
|
|
8151
8277
|
),
|
|
8152
|
-
/* @__PURE__ */
|
|
8278
|
+
/* @__PURE__ */ jsxs18(
|
|
8153
8279
|
"button",
|
|
8154
8280
|
{
|
|
8155
8281
|
onClick: handleCopyClick,
|
|
@@ -8160,7 +8286,7 @@ var init_HighlightPopover = __esm({
|
|
|
8160
8286
|
"focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
8161
8287
|
),
|
|
8162
8288
|
children: [
|
|
8163
|
-
/* @__PURE__ */
|
|
8289
|
+
/* @__PURE__ */ jsx21("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx21(
|
|
8164
8290
|
"path",
|
|
8165
8291
|
{
|
|
8166
8292
|
strokeLinecap: "round",
|
|
@@ -8190,19 +8316,20 @@ var init_HighlightPopover2 = __esm({
|
|
|
8190
8316
|
});
|
|
8191
8317
|
|
|
8192
8318
|
// src/components/PDFViewer/DocumentContainer.tsx
|
|
8193
|
-
import { memo as
|
|
8194
|
-
import { jsx as
|
|
8319
|
+
import { memo as memo21, useEffect as useEffect19, useState as useState18, useRef as useRef16, useCallback as useCallback29 } from "react";
|
|
8320
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8195
8321
|
var DocumentContainer;
|
|
8196
8322
|
var init_DocumentContainer = __esm({
|
|
8197
8323
|
"src/components/PDFViewer/DocumentContainer.tsx"() {
|
|
8198
8324
|
"use strict";
|
|
8199
8325
|
init_PDFPage2();
|
|
8326
|
+
init_PDFLoadingScreen2();
|
|
8200
8327
|
init_hooks();
|
|
8201
8328
|
init_useHighlights();
|
|
8202
8329
|
init_SelectionToolbar2();
|
|
8203
8330
|
init_HighlightPopover2();
|
|
8204
8331
|
init_utils();
|
|
8205
|
-
DocumentContainer =
|
|
8332
|
+
DocumentContainer = memo21(function DocumentContainer2({
|
|
8206
8333
|
className,
|
|
8207
8334
|
enableTouchGestures = true
|
|
8208
8335
|
}) {
|
|
@@ -8352,23 +8479,20 @@ var init_DocumentContainer = __esm({
|
|
|
8352
8479
|
sepia: "bg-amber-50"
|
|
8353
8480
|
};
|
|
8354
8481
|
if (!document2) {
|
|
8355
|
-
|
|
8356
|
-
return null;
|
|
8357
|
-
}
|
|
8358
|
-
return /* @__PURE__ */ jsx21(
|
|
8482
|
+
return /* @__PURE__ */ jsx22(
|
|
8359
8483
|
"div",
|
|
8360
8484
|
{
|
|
8361
8485
|
className: cn(
|
|
8362
8486
|
"document-container",
|
|
8363
|
-
"flex-1
|
|
8487
|
+
"flex-1",
|
|
8364
8488
|
themeStyles[theme],
|
|
8365
8489
|
className
|
|
8366
8490
|
),
|
|
8367
|
-
children: /* @__PURE__ */
|
|
8491
|
+
children: /* @__PURE__ */ jsx22(PDFLoadingScreen, { phase: isLoading ? "fetching" : "initializing" })
|
|
8368
8492
|
}
|
|
8369
8493
|
);
|
|
8370
8494
|
}
|
|
8371
|
-
return /* @__PURE__ */
|
|
8495
|
+
return /* @__PURE__ */ jsxs19(
|
|
8372
8496
|
"div",
|
|
8373
8497
|
{
|
|
8374
8498
|
ref: setContainerRef,
|
|
@@ -8381,7 +8505,7 @@ var init_DocumentContainer = __esm({
|
|
|
8381
8505
|
className
|
|
8382
8506
|
),
|
|
8383
8507
|
children: [
|
|
8384
|
-
/* @__PURE__ */
|
|
8508
|
+
/* @__PURE__ */ jsx22(
|
|
8385
8509
|
PDFPage,
|
|
8386
8510
|
{
|
|
8387
8511
|
pageNumber: currentPage,
|
|
@@ -8390,7 +8514,7 @@ var init_DocumentContainer = __esm({
|
|
|
8390
8514
|
rotation
|
|
8391
8515
|
}
|
|
8392
8516
|
),
|
|
8393
|
-
/* @__PURE__ */
|
|
8517
|
+
/* @__PURE__ */ jsx22(
|
|
8394
8518
|
SelectionToolbar,
|
|
8395
8519
|
{
|
|
8396
8520
|
selection,
|
|
@@ -8399,7 +8523,7 @@ var init_DocumentContainer = __esm({
|
|
|
8399
8523
|
activeColor
|
|
8400
8524
|
}
|
|
8401
8525
|
),
|
|
8402
|
-
/* @__PURE__ */
|
|
8526
|
+
/* @__PURE__ */ jsx22(
|
|
8403
8527
|
HighlightPopover,
|
|
8404
8528
|
{
|
|
8405
8529
|
highlight: selectedHighlight,
|
|
@@ -8411,7 +8535,7 @@ var init_DocumentContainer = __esm({
|
|
|
8411
8535
|
onClose: handleClosePopover
|
|
8412
8536
|
}
|
|
8413
8537
|
),
|
|
8414
|
-
isLoadingPage && !currentPageObj && /* @__PURE__ */
|
|
8538
|
+
isLoadingPage && !currentPageObj && /* @__PURE__ */ jsx22("div", { className: "fixed bottom-4 right-4 px-3 py-2 bg-black/75 text-white text-sm rounded-lg", children: "Loading..." })
|
|
8415
8539
|
]
|
|
8416
8540
|
}
|
|
8417
8541
|
);
|
|
@@ -8420,13 +8544,14 @@ var init_DocumentContainer = __esm({
|
|
|
8420
8544
|
});
|
|
8421
8545
|
|
|
8422
8546
|
// src/components/PDFViewer/VirtualizedDocumentContainer.tsx
|
|
8423
|
-
import { memo as
|
|
8424
|
-
import { jsx as
|
|
8547
|
+
import { memo as memo22, useEffect as useEffect20, useState as useState19, useRef as useRef17, useCallback as useCallback30 } from "react";
|
|
8548
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8425
8549
|
var DEFAULT_PAGE_WIDTH, DEFAULT_PAGE_HEIGHT, VirtualizedDocumentContainer;
|
|
8426
8550
|
var init_VirtualizedDocumentContainer = __esm({
|
|
8427
8551
|
"src/components/PDFViewer/VirtualizedDocumentContainer.tsx"() {
|
|
8428
8552
|
"use strict";
|
|
8429
8553
|
init_PDFPage2();
|
|
8554
|
+
init_PDFLoadingScreen2();
|
|
8430
8555
|
init_hooks();
|
|
8431
8556
|
init_useHighlights();
|
|
8432
8557
|
init_SelectionToolbar2();
|
|
@@ -8434,7 +8559,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8434
8559
|
init_utils();
|
|
8435
8560
|
DEFAULT_PAGE_WIDTH = 612;
|
|
8436
8561
|
DEFAULT_PAGE_HEIGHT = 792;
|
|
8437
|
-
VirtualizedDocumentContainer =
|
|
8562
|
+
VirtualizedDocumentContainer = memo22(function VirtualizedDocumentContainer2({
|
|
8438
8563
|
overscan = 2,
|
|
8439
8564
|
pageGap = 16,
|
|
8440
8565
|
enableTouchGestures = true,
|
|
@@ -8703,23 +8828,20 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8703
8828
|
sepia: "bg-amber-50"
|
|
8704
8829
|
};
|
|
8705
8830
|
if (!document2) {
|
|
8706
|
-
|
|
8707
|
-
return null;
|
|
8708
|
-
}
|
|
8709
|
-
return /* @__PURE__ */ jsx22(
|
|
8831
|
+
return /* @__PURE__ */ jsx23(
|
|
8710
8832
|
"div",
|
|
8711
8833
|
{
|
|
8712
8834
|
className: cn(
|
|
8713
8835
|
"virtualized-document-container",
|
|
8714
|
-
"flex-1
|
|
8836
|
+
"flex-1",
|
|
8715
8837
|
themeStyles[theme],
|
|
8716
8838
|
className
|
|
8717
8839
|
),
|
|
8718
|
-
children: /* @__PURE__ */
|
|
8840
|
+
children: /* @__PURE__ */ jsx23(PDFLoadingScreen, { phase: isLoading ? "fetching" : "initializing" })
|
|
8719
8841
|
}
|
|
8720
8842
|
);
|
|
8721
8843
|
}
|
|
8722
|
-
return /* @__PURE__ */
|
|
8844
|
+
return /* @__PURE__ */ jsxs20(
|
|
8723
8845
|
"div",
|
|
8724
8846
|
{
|
|
8725
8847
|
ref: containerRef,
|
|
@@ -8730,7 +8852,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8730
8852
|
className
|
|
8731
8853
|
),
|
|
8732
8854
|
children: [
|
|
8733
|
-
/* @__PURE__ */
|
|
8855
|
+
/* @__PURE__ */ jsx23(
|
|
8734
8856
|
"div",
|
|
8735
8857
|
{
|
|
8736
8858
|
ref: setContainerRef,
|
|
@@ -8739,7 +8861,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8739
8861
|
// Smooth scrolling on iOS
|
|
8740
8862
|
WebkitOverflowScrolling: "touch"
|
|
8741
8863
|
},
|
|
8742
|
-
children: /* @__PURE__ */
|
|
8864
|
+
children: /* @__PURE__ */ jsx23(
|
|
8743
8865
|
"div",
|
|
8744
8866
|
{
|
|
8745
8867
|
className: "relative mx-auto",
|
|
@@ -8751,7 +8873,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8751
8873
|
const page = pageObjects.get(info.pageNumber);
|
|
8752
8874
|
const dimensions = pageDimensionsCache.current.get(info.pageNumber);
|
|
8753
8875
|
const scaledWidth = dimensions ? Math.floor(dimensions.width * scale) : Math.floor(DEFAULT_PAGE_WIDTH * scale);
|
|
8754
|
-
return /* @__PURE__ */
|
|
8876
|
+
return /* @__PURE__ */ jsx23(
|
|
8755
8877
|
"div",
|
|
8756
8878
|
{
|
|
8757
8879
|
className: "absolute left-1/2 -translate-x-1/2",
|
|
@@ -8759,7 +8881,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8759
8881
|
top: info.top,
|
|
8760
8882
|
width: scaledWidth
|
|
8761
8883
|
},
|
|
8762
|
-
children: /* @__PURE__ */
|
|
8884
|
+
children: /* @__PURE__ */ jsx23(
|
|
8763
8885
|
PDFPage,
|
|
8764
8886
|
{
|
|
8765
8887
|
pageNumber: info.pageNumber,
|
|
@@ -8776,7 +8898,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8776
8898
|
)
|
|
8777
8899
|
}
|
|
8778
8900
|
),
|
|
8779
|
-
/* @__PURE__ */
|
|
8901
|
+
/* @__PURE__ */ jsx23(
|
|
8780
8902
|
SelectionToolbar,
|
|
8781
8903
|
{
|
|
8782
8904
|
selection,
|
|
@@ -8785,7 +8907,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8785
8907
|
activeColor
|
|
8786
8908
|
}
|
|
8787
8909
|
),
|
|
8788
|
-
/* @__PURE__ */
|
|
8910
|
+
/* @__PURE__ */ jsx23(
|
|
8789
8911
|
HighlightPopover,
|
|
8790
8912
|
{
|
|
8791
8913
|
highlight: selectedHighlight,
|
|
@@ -8805,15 +8927,15 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8805
8927
|
});
|
|
8806
8928
|
|
|
8807
8929
|
// src/components/PDFViewer/ContinuousScrollContainer.tsx
|
|
8808
|
-
import { memo as
|
|
8809
|
-
import { jsx as
|
|
8930
|
+
import { memo as memo23 } from "react";
|
|
8931
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
8810
8932
|
var ContinuousScrollContainer;
|
|
8811
8933
|
var init_ContinuousScrollContainer = __esm({
|
|
8812
8934
|
"src/components/PDFViewer/ContinuousScrollContainer.tsx"() {
|
|
8813
8935
|
"use strict";
|
|
8814
8936
|
init_VirtualizedDocumentContainer();
|
|
8815
|
-
ContinuousScrollContainer =
|
|
8816
|
-
return /* @__PURE__ */
|
|
8937
|
+
ContinuousScrollContainer = memo23(function ContinuousScrollContainer2(props) {
|
|
8938
|
+
return /* @__PURE__ */ jsx24(
|
|
8817
8939
|
VirtualizedDocumentContainer,
|
|
8818
8940
|
{
|
|
8819
8941
|
overscan: 3,
|
|
@@ -8826,19 +8948,20 @@ var init_ContinuousScrollContainer = __esm({
|
|
|
8826
8948
|
});
|
|
8827
8949
|
|
|
8828
8950
|
// src/components/PDFViewer/DualPageContainer.tsx
|
|
8829
|
-
import { memo as
|
|
8830
|
-
import { jsx as
|
|
8951
|
+
import { memo as memo24, useEffect as useEffect21, useState as useState20, useRef as useRef18, useCallback as useCallback31 } from "react";
|
|
8952
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8831
8953
|
var DualPageContainer;
|
|
8832
8954
|
var init_DualPageContainer = __esm({
|
|
8833
8955
|
"src/components/PDFViewer/DualPageContainer.tsx"() {
|
|
8834
8956
|
"use strict";
|
|
8835
8957
|
init_PDFPage2();
|
|
8958
|
+
init_PDFLoadingScreen2();
|
|
8836
8959
|
init_hooks();
|
|
8837
8960
|
init_useHighlights();
|
|
8838
8961
|
init_SelectionToolbar2();
|
|
8839
8962
|
init_HighlightPopover2();
|
|
8840
8963
|
init_utils();
|
|
8841
|
-
DualPageContainer =
|
|
8964
|
+
DualPageContainer = memo24(function DualPageContainer2({
|
|
8842
8965
|
showCover = true,
|
|
8843
8966
|
bookSpread = true,
|
|
8844
8967
|
pageGap = 4,
|
|
@@ -9044,23 +9167,20 @@ var init_DualPageContainer = __esm({
|
|
|
9044
9167
|
};
|
|
9045
9168
|
const spread = getSpreadPages(currentPage);
|
|
9046
9169
|
if (!document2) {
|
|
9047
|
-
|
|
9048
|
-
return null;
|
|
9049
|
-
}
|
|
9050
|
-
return /* @__PURE__ */ jsx24(
|
|
9170
|
+
return /* @__PURE__ */ jsx25(
|
|
9051
9171
|
"div",
|
|
9052
9172
|
{
|
|
9053
9173
|
className: cn(
|
|
9054
9174
|
"dual-page-container",
|
|
9055
|
-
"flex-1
|
|
9175
|
+
"flex-1",
|
|
9056
9176
|
themeStyles[theme],
|
|
9057
9177
|
className
|
|
9058
9178
|
),
|
|
9059
|
-
children: /* @__PURE__ */
|
|
9179
|
+
children: /* @__PURE__ */ jsx25(PDFLoadingScreen, { phase: isDocumentLoading ? "fetching" : "initializing" })
|
|
9060
9180
|
}
|
|
9061
9181
|
);
|
|
9062
9182
|
}
|
|
9063
|
-
return /* @__PURE__ */
|
|
9183
|
+
return /* @__PURE__ */ jsxs21(
|
|
9064
9184
|
"div",
|
|
9065
9185
|
{
|
|
9066
9186
|
ref: setContainerRef,
|
|
@@ -9073,13 +9193,13 @@ var init_DualPageContainer = __esm({
|
|
|
9073
9193
|
className
|
|
9074
9194
|
),
|
|
9075
9195
|
children: [
|
|
9076
|
-
/* @__PURE__ */
|
|
9196
|
+
/* @__PURE__ */ jsxs21(
|
|
9077
9197
|
"div",
|
|
9078
9198
|
{
|
|
9079
9199
|
className: "flex items-center",
|
|
9080
9200
|
style: { gap: pageGap },
|
|
9081
9201
|
children: [
|
|
9082
|
-
spread.left && /* @__PURE__ */
|
|
9202
|
+
spread.left && /* @__PURE__ */ jsx25(
|
|
9083
9203
|
PDFPage,
|
|
9084
9204
|
{
|
|
9085
9205
|
pageNumber: spread.left,
|
|
@@ -9088,14 +9208,14 @@ var init_DualPageContainer = __esm({
|
|
|
9088
9208
|
rotation
|
|
9089
9209
|
}
|
|
9090
9210
|
),
|
|
9091
|
-
spread.left && spread.right && /* @__PURE__ */
|
|
9211
|
+
spread.left && spread.right && /* @__PURE__ */ jsx25(
|
|
9092
9212
|
"div",
|
|
9093
9213
|
{
|
|
9094
9214
|
className: "w-px h-full bg-gray-300 dark:bg-gray-600 opacity-50",
|
|
9095
9215
|
style: { minHeight: "100%" }
|
|
9096
9216
|
}
|
|
9097
9217
|
),
|
|
9098
|
-
spread.right && /* @__PURE__ */
|
|
9218
|
+
spread.right && /* @__PURE__ */ jsx25(
|
|
9099
9219
|
PDFPage,
|
|
9100
9220
|
{
|
|
9101
9221
|
pageNumber: spread.right,
|
|
@@ -9104,7 +9224,7 @@ var init_DualPageContainer = __esm({
|
|
|
9104
9224
|
rotation
|
|
9105
9225
|
}
|
|
9106
9226
|
),
|
|
9107
|
-
(!spread.left || !spread.right) && /* @__PURE__ */
|
|
9227
|
+
(!spread.left || !spread.right) && /* @__PURE__ */ jsx25(
|
|
9108
9228
|
"div",
|
|
9109
9229
|
{
|
|
9110
9230
|
className: "flex items-center justify-center",
|
|
@@ -9117,7 +9237,7 @@ var init_DualPageContainer = __esm({
|
|
|
9117
9237
|
]
|
|
9118
9238
|
}
|
|
9119
9239
|
),
|
|
9120
|
-
/* @__PURE__ */
|
|
9240
|
+
/* @__PURE__ */ jsx25(
|
|
9121
9241
|
SelectionToolbar,
|
|
9122
9242
|
{
|
|
9123
9243
|
selection,
|
|
@@ -9126,7 +9246,7 @@ var init_DualPageContainer = __esm({
|
|
|
9126
9246
|
activeColor
|
|
9127
9247
|
}
|
|
9128
9248
|
),
|
|
9129
|
-
/* @__PURE__ */
|
|
9249
|
+
/* @__PURE__ */ jsx25(
|
|
9130
9250
|
HighlightPopover,
|
|
9131
9251
|
{
|
|
9132
9252
|
highlight: selectedHighlight,
|
|
@@ -9138,7 +9258,7 @@ var init_DualPageContainer = __esm({
|
|
|
9138
9258
|
onClose: () => selectHighlight(null)
|
|
9139
9259
|
}
|
|
9140
9260
|
),
|
|
9141
|
-
isLoading && /* @__PURE__ */
|
|
9261
|
+
isLoading && /* @__PURE__ */ jsx25("div", { className: "fixed bottom-4 right-4 px-3 py-2 bg-black/75 text-white text-sm rounded-lg", children: "Loading..." })
|
|
9142
9262
|
]
|
|
9143
9263
|
}
|
|
9144
9264
|
);
|
|
@@ -9147,15 +9267,15 @@ var init_DualPageContainer = __esm({
|
|
|
9147
9267
|
});
|
|
9148
9268
|
|
|
9149
9269
|
// src/components/FloatingZoomControls/FloatingZoomControls.tsx
|
|
9150
|
-
import { memo as
|
|
9151
|
-
import { jsx as
|
|
9270
|
+
import { memo as memo25, useCallback as useCallback32 } from "react";
|
|
9271
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9152
9272
|
var FloatingZoomControls;
|
|
9153
9273
|
var init_FloatingZoomControls = __esm({
|
|
9154
9274
|
"src/components/FloatingZoomControls/FloatingZoomControls.tsx"() {
|
|
9155
9275
|
"use strict";
|
|
9156
9276
|
init_hooks();
|
|
9157
9277
|
init_utils();
|
|
9158
|
-
FloatingZoomControls =
|
|
9278
|
+
FloatingZoomControls = memo25(function FloatingZoomControls2({
|
|
9159
9279
|
position = "bottom-right",
|
|
9160
9280
|
className,
|
|
9161
9281
|
showFitToWidth = true,
|
|
@@ -9189,7 +9309,7 @@ var init_FloatingZoomControls = __esm({
|
|
|
9189
9309
|
"top-left": "top-4 left-4"
|
|
9190
9310
|
};
|
|
9191
9311
|
const zoomPercentage = Math.round(scale * 100);
|
|
9192
|
-
return /* @__PURE__ */
|
|
9312
|
+
return /* @__PURE__ */ jsxs22(
|
|
9193
9313
|
"div",
|
|
9194
9314
|
{
|
|
9195
9315
|
className: cn(
|
|
@@ -9201,7 +9321,7 @@ var init_FloatingZoomControls = __esm({
|
|
|
9201
9321
|
className
|
|
9202
9322
|
),
|
|
9203
9323
|
children: [
|
|
9204
|
-
/* @__PURE__ */
|
|
9324
|
+
/* @__PURE__ */ jsx26(
|
|
9205
9325
|
"button",
|
|
9206
9326
|
{
|
|
9207
9327
|
onClick: handleZoomOut,
|
|
@@ -9215,14 +9335,14 @@ var init_FloatingZoomControls = __esm({
|
|
|
9215
9335
|
disabled: scale <= 0.25,
|
|
9216
9336
|
title: "Zoom Out",
|
|
9217
9337
|
"aria-label": "Zoom Out",
|
|
9218
|
-
children: /* @__PURE__ */
|
|
9338
|
+
children: /* @__PURE__ */ jsx26("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx26("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) })
|
|
9219
9339
|
}
|
|
9220
9340
|
),
|
|
9221
|
-
showZoomLevel && /* @__PURE__ */
|
|
9341
|
+
showZoomLevel && /* @__PURE__ */ jsxs22("span", { className: "min-w-[48px] text-center text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
9222
9342
|
zoomPercentage,
|
|
9223
9343
|
"%"
|
|
9224
9344
|
] }),
|
|
9225
|
-
/* @__PURE__ */
|
|
9345
|
+
/* @__PURE__ */ jsx26(
|
|
9226
9346
|
"button",
|
|
9227
9347
|
{
|
|
9228
9348
|
onClick: handleZoomIn,
|
|
@@ -9236,11 +9356,11 @@ var init_FloatingZoomControls = __esm({
|
|
|
9236
9356
|
disabled: scale >= 4,
|
|
9237
9357
|
title: "Zoom In",
|
|
9238
9358
|
"aria-label": "Zoom In",
|
|
9239
|
-
children: /* @__PURE__ */
|
|
9359
|
+
children: /* @__PURE__ */ jsx26("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx26("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) })
|
|
9240
9360
|
}
|
|
9241
9361
|
),
|
|
9242
|
-
(showFitToWidth || showFitToPage) && /* @__PURE__ */
|
|
9243
|
-
showFitToWidth && /* @__PURE__ */
|
|
9362
|
+
(showFitToWidth || showFitToPage) && /* @__PURE__ */ jsx26("div", { className: "w-px h-6 bg-gray-200 dark:bg-gray-700 mx-1" }),
|
|
9363
|
+
showFitToWidth && /* @__PURE__ */ jsx26(
|
|
9244
9364
|
"button",
|
|
9245
9365
|
{
|
|
9246
9366
|
onClick: handleFitToWidth,
|
|
@@ -9252,10 +9372,10 @@ var init_FloatingZoomControls = __esm({
|
|
|
9252
9372
|
),
|
|
9253
9373
|
title: "Fit to Width",
|
|
9254
9374
|
"aria-label": "Fit to Width",
|
|
9255
|
-
children: /* @__PURE__ */
|
|
9375
|
+
children: /* @__PURE__ */ jsx26("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx26("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) })
|
|
9256
9376
|
}
|
|
9257
9377
|
),
|
|
9258
|
-
showFitToPage && /* @__PURE__ */
|
|
9378
|
+
showFitToPage && /* @__PURE__ */ jsx26(
|
|
9259
9379
|
"button",
|
|
9260
9380
|
{
|
|
9261
9381
|
onClick: handleFitToPage,
|
|
@@ -9267,7 +9387,7 @@ var init_FloatingZoomControls = __esm({
|
|
|
9267
9387
|
),
|
|
9268
9388
|
title: "Fit to Page",
|
|
9269
9389
|
"aria-label": "Fit to Page",
|
|
9270
|
-
children: /* @__PURE__ */
|
|
9390
|
+
children: /* @__PURE__ */ jsx26("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx26("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) })
|
|
9271
9391
|
}
|
|
9272
9392
|
)
|
|
9273
9393
|
]
|
|
@@ -9285,138 +9405,6 @@ var init_FloatingZoomControls2 = __esm({
|
|
|
9285
9405
|
}
|
|
9286
9406
|
});
|
|
9287
9407
|
|
|
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
|
-
|
|
9420
9408
|
// src/components/PDFViewer/PDFViewerClient.tsx
|
|
9421
9409
|
var PDFViewerClient_exports = {};
|
|
9422
9410
|
__export(PDFViewerClient_exports, {
|