@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.d.cts CHANGED
@@ -151,6 +151,7 @@ interface DocumentViewerProps {
151
151
  blob?: Blob;
152
152
  fileName?: string;
153
153
  fileType?: SupportedFileType;
154
+ loading?: boolean;
154
155
  pdfWorkerSrc?: string;
155
156
  mode?: DocumentMode;
156
157
  allowSigning?: boolean;
package/dist/index.d.ts CHANGED
@@ -151,6 +151,7 @@ interface DocumentViewerProps {
151
151
  blob?: Blob;
152
152
  fileName?: string;
153
153
  fileType?: SupportedFileType;
154
+ loading?: boolean;
154
155
  pdfWorkerSrc?: string;
155
156
  mode?: DocumentMode;
156
157
  allowSigning?: boolean;
package/dist/index.mjs CHANGED
@@ -9091,6 +9091,7 @@ function getFileNameHint(fileUrl, fileName) {
9091
9091
  function DocumentViewer(props) {
9092
9092
  const mode = props.mode ?? "view";
9093
9093
  const theme = props.theme ?? "light";
9094
+ const externalLoading = props.loading ?? false;
9094
9095
  const locale = useMemo9(
9095
9096
  () => ({ ...defaultLocale, ...props.locale }),
9096
9097
  [props.locale]
@@ -9240,6 +9241,12 @@ function DocumentViewer(props) {
9240
9241
  let active = true;
9241
9242
  let cleanupSource;
9242
9243
  const loadFile = async () => {
9244
+ if (externalLoading) {
9245
+ setLoading(true);
9246
+ setError("");
9247
+ setResolved(null);
9248
+ return;
9249
+ }
9243
9250
  setLoading(true);
9244
9251
  setError("");
9245
9252
  setResolved(null);
@@ -9285,6 +9292,7 @@ function DocumentViewer(props) {
9285
9292
  cleanupSource?.();
9286
9293
  };
9287
9294
  }, [
9295
+ externalLoading,
9288
9296
  hasIncomingSource,
9289
9297
  isRequestedCreateUnsupported,
9290
9298
  mode,