pdfjs-reader-core 0.2.6 → 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 +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -2
- 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 } = usePDFViewer();
|
|
4743
|
+
const { document: document2, currentPage, numPages, goToPage, isLoading } = usePDFViewer();
|
|
4744
4744
|
const containerRef = useRef7(null);
|
|
4745
4745
|
useEffect9(() => {
|
|
4746
4746
|
const container = containerRef.current;
|
|
@@ -4757,6 +4757,9 @@ var init_ThumbnailPanel = __esm({
|
|
|
4757
4757
|
[goToPage]
|
|
4758
4758
|
);
|
|
4759
4759
|
if (!document2) {
|
|
4760
|
+
if (isLoading) {
|
|
4761
|
+
return null;
|
|
4762
|
+
}
|
|
4760
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" }) });
|
|
4761
4764
|
}
|
|
4762
4765
|
return /* @__PURE__ */ jsx4(
|
|
@@ -5088,7 +5091,7 @@ var init_OutlinePanel = __esm({
|
|
|
5088
5091
|
OutlinePanel = memo5(function OutlinePanel2({
|
|
5089
5092
|
className
|
|
5090
5093
|
}) {
|
|
5091
|
-
const { document: document2, goToPage } = usePDFViewer();
|
|
5094
|
+
const { document: document2, goToPage, isLoading: isDocumentLoading } = usePDFViewer();
|
|
5092
5095
|
const [outline, setOutline] = useState8(null);
|
|
5093
5096
|
const [isLoading, setIsLoading] = useState8(false);
|
|
5094
5097
|
const [error, setError] = useState8(null);
|
|
@@ -5167,6 +5170,9 @@ var init_OutlinePanel = __esm({
|
|
|
5167
5170
|
[goToPage]
|
|
5168
5171
|
);
|
|
5169
5172
|
if (!document2) {
|
|
5173
|
+
if (isDocumentLoading) {
|
|
5174
|
+
return null;
|
|
5175
|
+
}
|
|
5170
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" }) });
|
|
5171
5177
|
}
|
|
5172
5178
|
if (isLoading) {
|
|
@@ -8206,6 +8212,7 @@ var init_DocumentContainer = __esm({
|
|
|
8206
8212
|
scale,
|
|
8207
8213
|
rotation,
|
|
8208
8214
|
theme,
|
|
8215
|
+
isLoading,
|
|
8209
8216
|
setScale,
|
|
8210
8217
|
nextPage,
|
|
8211
8218
|
previousPage
|
|
@@ -8345,6 +8352,9 @@ var init_DocumentContainer = __esm({
|
|
|
8345
8352
|
sepia: "bg-amber-50"
|
|
8346
8353
|
};
|
|
8347
8354
|
if (!document2) {
|
|
8355
|
+
if (isLoading) {
|
|
8356
|
+
return null;
|
|
8357
|
+
}
|
|
8348
8358
|
return /* @__PURE__ */ jsx21(
|
|
8349
8359
|
"div",
|
|
8350
8360
|
{
|
|
@@ -8437,6 +8447,7 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8437
8447
|
scale,
|
|
8438
8448
|
rotation,
|
|
8439
8449
|
theme,
|
|
8450
|
+
isLoading,
|
|
8440
8451
|
setScale,
|
|
8441
8452
|
goToPage,
|
|
8442
8453
|
nextPage,
|
|
@@ -8692,6 +8703,9 @@ var init_VirtualizedDocumentContainer = __esm({
|
|
|
8692
8703
|
sepia: "bg-amber-50"
|
|
8693
8704
|
};
|
|
8694
8705
|
if (!document2) {
|
|
8706
|
+
if (isLoading) {
|
|
8707
|
+
return null;
|
|
8708
|
+
}
|
|
8695
8709
|
return /* @__PURE__ */ jsx22(
|
|
8696
8710
|
"div",
|
|
8697
8711
|
{
|
|
@@ -8838,6 +8852,7 @@ var init_DualPageContainer = __esm({
|
|
|
8838
8852
|
scale,
|
|
8839
8853
|
rotation,
|
|
8840
8854
|
theme,
|
|
8855
|
+
isLoading: isDocumentLoading,
|
|
8841
8856
|
setScale,
|
|
8842
8857
|
goToPage
|
|
8843
8858
|
} = usePDFViewer();
|
|
@@ -9029,6 +9044,9 @@ var init_DualPageContainer = __esm({
|
|
|
9029
9044
|
};
|
|
9030
9045
|
const spread = getSpreadPages(currentPage);
|
|
9031
9046
|
if (!document2) {
|
|
9047
|
+
if (isDocumentLoading) {
|
|
9048
|
+
return null;
|
|
9049
|
+
}
|
|
9032
9050
|
return /* @__PURE__ */ jsx24(
|
|
9033
9051
|
"div",
|
|
9034
9052
|
{
|