@file-viewer/assets-standard 3.0.2 → 3.0.3
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/package.json +2 -2
- package/viewer/flyfish-viewer-assets.json +1 -1
- package/viewer/flyfish-viewer-manifest.json +1 -1
- package/viewer/vendor/docx/docx.worker.js +1 -1
- package/viewer/vendor/pdf/pdf.worker.mjs +48 -18
- package/viewer/vendor/pptx/pptx.worker.js +2 -2
- package/viewer/vendor/xlsx/sheet.worker.js +33 -33
|
@@ -66846,15 +66846,21 @@ class WorkerMessageHandler {
|
|
|
66846
66846
|
};
|
|
66847
66847
|
return pdfManagerCapability.promise;
|
|
66848
66848
|
}
|
|
66849
|
+
// File Viewer modification: canceled initialization must not reject detached
|
|
66850
|
+
// startup promises or send messages through an already destroyed handler.
|
|
66849
66851
|
function setupDoc(data) {
|
|
66850
66852
|
function onSuccess(doc) {
|
|
66851
|
-
|
|
66853
|
+
if (terminated) {
|
|
66854
|
+
return;
|
|
66855
|
+
}
|
|
66852
66856
|
handler.send("GetDoc", {
|
|
66853
66857
|
pdfInfo: doc
|
|
66854
66858
|
});
|
|
66855
66859
|
}
|
|
66856
66860
|
function onFailure(ex) {
|
|
66857
|
-
|
|
66861
|
+
if (terminated) {
|
|
66862
|
+
return;
|
|
66863
|
+
}
|
|
66858
66864
|
if (ex instanceof PasswordException) {
|
|
66859
66865
|
const task = new WorkerTask(`PasswordException: response ${ex.code}`);
|
|
66860
66866
|
startWorkerTask(task);
|
|
@@ -66862,43 +66868,67 @@ class WorkerMessageHandler {
|
|
|
66862
66868
|
password
|
|
66863
66869
|
}) {
|
|
66864
66870
|
finishWorkerTask(task);
|
|
66871
|
+
if (terminated) {
|
|
66872
|
+
return;
|
|
66873
|
+
}
|
|
66865
66874
|
pdfManager.updatePassword(password);
|
|
66866
66875
|
pdfManagerReady();
|
|
66867
66876
|
}).catch(function () {
|
|
66868
66877
|
finishWorkerTask(task);
|
|
66878
|
+
if (terminated) {
|
|
66879
|
+
return;
|
|
66880
|
+
}
|
|
66869
66881
|
handler.send("DocException", ex);
|
|
66870
66882
|
});
|
|
66871
66883
|
} else {
|
|
66872
66884
|
handler.send("DocException", wrapReason(ex));
|
|
66873
66885
|
}
|
|
66874
66886
|
}
|
|
66875
|
-
function pdfManagerReady() {
|
|
66876
|
-
|
|
66877
|
-
|
|
66878
|
-
|
|
66879
|
-
|
|
66880
|
-
|
|
66881
|
-
|
|
66887
|
+
async function pdfManagerReady() {
|
|
66888
|
+
if (terminated) {
|
|
66889
|
+
return;
|
|
66890
|
+
}
|
|
66891
|
+
try {
|
|
66892
|
+
let doc;
|
|
66893
|
+
try {
|
|
66894
|
+
doc = await loadDocument(false);
|
|
66895
|
+
} catch (reason) {
|
|
66896
|
+
if (terminated) {
|
|
66897
|
+
return;
|
|
66898
|
+
}
|
|
66899
|
+
if (!(reason instanceof XRefParseException)) {
|
|
66900
|
+
throw reason;
|
|
66901
|
+
}
|
|
66902
|
+
await pdfManager.requestLoadedStream();
|
|
66903
|
+
if (terminated) {
|
|
66904
|
+
return;
|
|
66905
|
+
}
|
|
66906
|
+
doc = await loadDocument(true);
|
|
66882
66907
|
}
|
|
66883
|
-
|
|
66884
|
-
|
|
66885
|
-
|
|
66886
|
-
|
|
66887
|
-
|
|
66908
|
+
onSuccess(doc);
|
|
66909
|
+
} catch (reason) {
|
|
66910
|
+
onFailure(reason);
|
|
66911
|
+
}
|
|
66912
|
+
}
|
|
66913
|
+
if (terminated) {
|
|
66914
|
+
return;
|
|
66888
66915
|
}
|
|
66889
|
-
ensureNotTerminated();
|
|
66890
66916
|
getPdfManager(data).then(function (newPdfManager) {
|
|
66891
66917
|
if (terminated) {
|
|
66892
66918
|
newPdfManager.terminate(new AbortException("Worker was terminated."));
|
|
66893
|
-
|
|
66919
|
+
return;
|
|
66894
66920
|
}
|
|
66895
66921
|
pdfManager = newPdfManager;
|
|
66896
66922
|
pdfManager.requestLoadedStream(true).then(stream => {
|
|
66923
|
+
if (terminated) {
|
|
66924
|
+
return;
|
|
66925
|
+
}
|
|
66897
66926
|
handler.send("DataLoaded", {
|
|
66898
66927
|
length: stream.bytes.byteLength
|
|
66899
66928
|
});
|
|
66900
|
-
});
|
|
66901
|
-
|
|
66929
|
+
}, onFailure);
|
|
66930
|
+
return pdfManagerReady();
|
|
66931
|
+
}).catch(onFailure);
|
|
66902
66932
|
}
|
|
66903
66933
|
handler.on("GetPage", function (data) {
|
|
66904
66934
|
return pdfManager.getPage(data.pageIndex).then(function (page) {
|