@zerohive/hive-viewer 2.0.4 → 2.0.5
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 +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9141,6 +9141,7 @@ function getFileNameHint(fileUrl, fileName) {
|
|
|
9141
9141
|
function DocumentViewer(props) {
|
|
9142
9142
|
const mode = props.mode ?? "view";
|
|
9143
9143
|
const theme = props.theme ?? "light";
|
|
9144
|
+
const externalLoading = props.loading ?? false;
|
|
9144
9145
|
const locale = (0, import_react10.useMemo)(
|
|
9145
9146
|
() => ({ ...defaultLocale, ...props.locale }),
|
|
9146
9147
|
[props.locale]
|
|
@@ -9290,6 +9291,12 @@ function DocumentViewer(props) {
|
|
|
9290
9291
|
let active = true;
|
|
9291
9292
|
let cleanupSource;
|
|
9292
9293
|
const loadFile = async () => {
|
|
9294
|
+
if (externalLoading) {
|
|
9295
|
+
setLoading(true);
|
|
9296
|
+
setError("");
|
|
9297
|
+
setResolved(null);
|
|
9298
|
+
return;
|
|
9299
|
+
}
|
|
9293
9300
|
setLoading(true);
|
|
9294
9301
|
setError("");
|
|
9295
9302
|
setResolved(null);
|
|
@@ -9335,6 +9342,7 @@ function DocumentViewer(props) {
|
|
|
9335
9342
|
cleanupSource?.();
|
|
9336
9343
|
};
|
|
9337
9344
|
}, [
|
|
9345
|
+
externalLoading,
|
|
9338
9346
|
hasIncomingSource,
|
|
9339
9347
|
isRequestedCreateUnsupported,
|
|
9340
9348
|
mode,
|