@sync-in/server 1.9.1 → 1.9.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/CHANGELOG.md +12 -8
- package/package.json +7 -7
- package/server/applications/files/services/files-manager.service.js +2 -2
- package/server/applications/files/services/files-manager.service.js.map +1 -1
- package/server/applications/files/services/files-tasks-manager.service.js +1 -1
- package/server/applications/files/services/files-tasks-manager.service.js.map +1 -1
- package/server/applications/files/utils/send-file.js +18 -9
- package/server/applications/files/utils/send-file.js.map +1 -1
- package/server/applications/files/utils/url-file.js +6 -6
- package/server/applications/files/utils/url-file.js.map +1 -1
- package/server/applications/links/services/links-manager.service.js +1 -1
- package/server/applications/links/services/links-manager.service.js.map +1 -1
- package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
- package/server/applications/shares/services/shares-manager.service.js +6 -4
- package/server/applications/shares/services/shares-manager.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +15 -12
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.js +4 -0
- package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
- package/server/applications/users/users.controller.js +4 -1
- package/server/applications/users/users.controller.js.map +1 -1
- package/static/assets/pdfjs/build/pdf.mjs +35 -20
- package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
- package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
- package/static/assets/pdfjs/build/pdf.worker.mjs +1488 -52
- package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
- package/static/assets/pdfjs/version +1 -1
- package/static/assets/pdfjs/web/locale/be/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/bg/viewer.ftl +4 -0
- package/static/assets/pdfjs/web/locale/bs/viewer.ftl +0 -15
- package/static/assets/pdfjs/web/locale/ca/viewer.ftl +0 -4
- package/static/assets/pdfjs/web/locale/cs/viewer.ftl +4 -14
- package/static/assets/pdfjs/web/locale/cy/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/da/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/de/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/el/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/en-CA/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/en-GB/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/eo/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/es-AR/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/es-CL/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/es-ES/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/es-MX/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/eu/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/fi/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/fr/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/fur/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/fy-NL/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/gn/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/he/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/hsb/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/hu/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/hy-AM/viewer.ftl +0 -15
- package/static/assets/pdfjs/web/locale/ia/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/id/viewer.ftl +0 -15
- package/static/assets/pdfjs/web/locale/is/viewer.ftl +0 -15
- package/static/assets/pdfjs/web/locale/it/viewer.ftl +2 -14
- package/static/assets/pdfjs/web/locale/ja/viewer.ftl +7 -2
- package/static/assets/pdfjs/web/locale/ka/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/kab/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/kk/viewer.ftl +3 -12
- package/static/assets/pdfjs/web/locale/ko/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/nb-NO/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/nl/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/nn-NO/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/pa-IN/viewer.ftl +4 -12
- package/static/assets/pdfjs/web/locale/pl/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/pt-BR/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/rm/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/ro/viewer.ftl +2 -14
- package/static/assets/pdfjs/web/locale/ru/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/sc/viewer.ftl +0 -1
- package/static/assets/pdfjs/web/locale/sk/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/sl/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/sq/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/sv-SE/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/tg/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/th/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/tr/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/vi/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/locale/zh-CN/viewer.ftl +2 -12
- package/static/assets/pdfjs/web/locale/zh-TW/viewer.ftl +0 -12
- package/static/assets/pdfjs/web/viewer.css +53 -41
- package/static/assets/pdfjs/web/viewer.html +493 -132
- package/static/assets/pdfjs/web/viewer.mjs +225 -150
- package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
- package/static/{chunk-LYZGJZNP.js → chunk-25PWAXTJ.js} +1 -1
- package/static/{chunk-HCSWO7BO.js → chunk-27XEAHMV.js} +1 -1
- package/static/{chunk-YMAN4LIU.js → chunk-2CAAJBRO.js} +1 -1
- package/static/{chunk-RK2ONYTL.js → chunk-2LHHXDD5.js} +1 -1
- package/static/{chunk-YCTCESL4.js → chunk-2XY4PMI5.js} +1 -1
- package/static/{chunk-ERDZ7IVF.js → chunk-33WFRCUP.js} +1 -1
- package/static/chunk-3LVFDMTN.js +1 -0
- package/static/{chunk-V6FA5QY4.js → chunk-4DF2SQD4.js} +1 -1
- package/static/{chunk-Q556XB3S.js → chunk-4EUHBTWV.js} +1 -1
- package/static/{chunk-AADK5D2H.js → chunk-4KXJ6C4N.js} +1 -1
- package/static/{chunk-BHZEPHRI.js → chunk-4OV3SAUS.js} +1 -1
- package/static/{chunk-5S6KPQRA.js → chunk-5HCVWZMA.js} +1 -1
- package/static/{chunk-ZCOWBVOT.js → chunk-5HYSNQR4.js} +1 -1
- package/static/{chunk-4PZPHJ7L.js → chunk-5NHB7SV3.js} +1 -1
- package/static/chunk-6VJI4X2A.js +1 -0
- package/static/{chunk-XCLK7NJL.js → chunk-7H5O4BLV.js} +1 -1
- package/static/{chunk-ACUF7IKP.js → chunk-7NI353LS.js} +1 -1
- package/static/{chunk-TGLJFALR.js → chunk-A6J6SOM6.js} +1 -1
- package/static/{chunk-XOF4UW3S.js → chunk-A7DSX7VP.js} +1 -1
- package/static/chunk-A7R246NW.js +1 -0
- package/static/{chunk-EL6QL4TP.js → chunk-ASBPYTLT.js} +1 -1
- package/static/chunk-BJARRIS6.js +562 -0
- package/static/{chunk-VQJYCYWI.js → chunk-CAZSNVMS.js} +1 -1
- package/static/{chunk-EIYRBM4J.js → chunk-CURVLK7L.js} +1 -1
- package/static/{chunk-5E3TYOL3.js → chunk-DDRGLHOP.js} +1 -1
- package/static/{chunk-ZXXHFBGL.js → chunk-FLPZB3OX.js} +1 -1
- package/static/{chunk-23UUFZSR.js → chunk-FRBTL2ER.js} +1 -1
- package/static/{chunk-JY2I3HGL.js → chunk-FXM7XXWA.js} +1 -1
- package/static/{chunk-7CKHC72R.js → chunk-GDPJRUVU.js} +1 -1
- package/static/{chunk-QMHUIHSR.js → chunk-GENTF6JM.js} +1 -1
- package/static/{chunk-VK7XMFVE.js → chunk-H4RLHI3Y.js} +1 -1
- package/static/{chunk-3WLBVJ2S.js → chunk-HE6EDXWI.js} +1 -1
- package/static/{chunk-U4RW6XG5.js → chunk-IUJ4IK26.js} +1 -1
- package/static/{chunk-XQGPSNQB.js → chunk-JEVBUJQ4.js} +1 -1
- package/static/{chunk-K657XPXA.js → chunk-K3MOXDU5.js} +1 -1
- package/static/{chunk-6B3GGAV3.js → chunk-KBWK65KM.js} +1 -1
- package/static/{chunk-I2S3XPC5.js → chunk-L3PDWJZ3.js} +2 -2
- package/static/{chunk-KDEEERWZ.js → chunk-LBXOAKBD.js} +1 -1
- package/static/{chunk-Y5RLD72B.js → chunk-LFAQLJZK.js} +1 -1
- package/static/{chunk-M4XL3JN5.js → chunk-MBFMTBVJ.js} +1 -1
- package/static/{chunk-HMOB6XC5.js → chunk-MZBO5PAR.js} +1 -1
- package/static/{chunk-DJDRX53V.js → chunk-NFIES7BC.js} +1 -1
- package/static/{chunk-3YDYZLF7.js → chunk-NK2NMAJI.js} +1 -1
- package/static/{chunk-FNOTGWRW.js → chunk-O7UXVNR2.js} +1 -1
- package/static/{chunk-RDNTK4YH.js → chunk-PKU4IIIR.js} +1 -1
- package/static/{chunk-NN4ONTOT.js → chunk-QUSS6SUC.js} +1 -1
- package/static/{chunk-BU4ZICZR.js → chunk-R6VB3INJ.js} +1 -1
- package/static/{chunk-2TB2INBF.js → chunk-RJOHDAPM.js} +1 -1
- package/static/{chunk-BODMMLVB.js → chunk-S6YKBWJE.js} +1 -1
- package/static/{chunk-AZ5TF5Y3.js → chunk-SDR3UG2F.js} +1 -1
- package/static/{chunk-C3AAEQKW.js → chunk-TGHBDJZA.js} +1 -1
- package/static/{chunk-HNMGPG72.js → chunk-TVJQXN73.js} +1 -1
- package/static/{chunk-6NEBGCAZ.js → chunk-U75PLYIJ.js} +1 -1
- package/static/chunk-UUX3M6DC.js +1 -0
- package/static/{chunk-JWPXQOS3.js → chunk-VJ2HWQRJ.js} +2 -2
- package/static/{chunk-S2VBGI6Q.js → chunk-VO4WVT6K.js} +1 -1
- package/static/{chunk-5XUIPWOH.js → chunk-W72JYHOH.js} +1 -1
- package/static/{chunk-PXRT4L57.js → chunk-WJYVS27M.js} +1 -1
- package/static/{chunk-HKRGIRKB.js → chunk-XAIOGRBO.js} +1 -1
- package/static/{chunk-NKGKBQBX.js → chunk-XHQEF2IX.js} +1 -1
- package/static/{chunk-DQ3GEMPM.js → chunk-XXYMVRSH.js} +1 -1
- package/static/{chunk-HHWXIK2M.js → chunk-YTBSB2GE.js} +1 -1
- package/static/{chunk-GRLHFXGB.js → chunk-YXWF2DGF.js} +1 -1
- package/static/{chunk-JMYAD7E2.js → chunk-Z6RJZIDG.js} +1 -1
- package/static/{chunk-GNZPP2VO.js → chunk-ZC5ZDCDC.js} +1 -1
- package/static/{chunk-EDJAISWO.js → chunk-ZERBTNFW.js} +8 -8
- package/static/{chunk-MIA5YBOI.js → chunk-ZPI7RQ2S.js} +1 -1
- package/static/{chunk-NOPACN4F.js → chunk-ZRBLCAOK.js} +1 -1
- package/static/index.html +2 -2
- package/static/{main-56PZQ6TJ.js → main-FE6GWZXU.js} +4 -4
- package/static/{styles-Q4OZOSSK.css → styles-S5HVK4H5.css} +1 -1
- package/static/chunk-H6WOTGQ5.js +0 -1
- package/static/chunk-HC7F57NA.js +0 -1
- package/static/chunk-IOIBQGHN.js +0 -562
- package/static/chunk-J6YSFHLZ.js +0 -1
- package/static/chunk-QVFPHTOH.js +0 -1
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* pdfjsVersion = 5.4.
|
|
25
|
-
* pdfjsBuild =
|
|
24
|
+
* pdfjsVersion = 5.4.449
|
|
25
|
+
* pdfjsBuild = f44e5f0e6
|
|
26
26
|
*/
|
|
27
27
|
/******/ // The require scope
|
|
28
28
|
/******/ var __webpack_require__ = {};
|
|
@@ -3416,6 +3416,11 @@ class NewAltTextManager {
|
|
|
3416
3416
|
textarea.addEventListener("input", () => {
|
|
3417
3417
|
this.#toggleTitleAndDisclaimer();
|
|
3418
3418
|
});
|
|
3419
|
+
textarea.addEventListener("keydown", e => {
|
|
3420
|
+
if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled) {
|
|
3421
|
+
this.#save();
|
|
3422
|
+
}
|
|
3423
|
+
});
|
|
3419
3424
|
eventBus._on("enableguessalttext", ({
|
|
3420
3425
|
value
|
|
3421
3426
|
}) => {
|
|
@@ -3658,7 +3663,7 @@ class NewAltTextManager {
|
|
|
3658
3663
|
this.#overlayManager.closeIfActive(this.#dialog);
|
|
3659
3664
|
}
|
|
3660
3665
|
#close() {
|
|
3661
|
-
const canvas = this.#imagePreview.
|
|
3666
|
+
const canvas = this.#imagePreview.firstElementChild;
|
|
3662
3667
|
canvas.remove();
|
|
3663
3668
|
canvas.width = canvas.height = 0;
|
|
3664
3669
|
this.#imageData = null;
|
|
@@ -3802,7 +3807,7 @@ class ImageAltTextSettings {
|
|
|
3802
3807
|
async #download(isFromUI = false) {
|
|
3803
3808
|
if (isFromUI) {
|
|
3804
3809
|
this.#downloadModelButton.disabled = true;
|
|
3805
|
-
const span = this.#downloadModelButton.
|
|
3810
|
+
const span = this.#downloadModelButton.firstElementChild;
|
|
3806
3811
|
span.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-settings-downloading-model-button");
|
|
3807
3812
|
await this.#mlManager.downloadModel("altText");
|
|
3808
3813
|
span.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-settings-download-model-button");
|
|
@@ -3911,6 +3916,11 @@ class AltTextManager {
|
|
|
3911
3916
|
saveButton.addEventListener("click", this.#save.bind(this));
|
|
3912
3917
|
optionDescription.addEventListener("change", onUpdateUIState);
|
|
3913
3918
|
optionDecorative.addEventListener("change", onUpdateUIState);
|
|
3919
|
+
textarea.addEventListener("keydown", e => {
|
|
3920
|
+
if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled) {
|
|
3921
|
+
this.#save();
|
|
3922
|
+
}
|
|
3923
|
+
});
|
|
3914
3924
|
this.#overlayManager.register(dialog);
|
|
3915
3925
|
}
|
|
3916
3926
|
#createSVGElement() {
|
|
@@ -4433,9 +4443,129 @@ class CaretBrowsingMode {
|
|
|
4433
4443
|
}
|
|
4434
4444
|
}
|
|
4435
4445
|
|
|
4446
|
+
;// ./web/sidebar.js
|
|
4447
|
+
|
|
4448
|
+
class Sidebar {
|
|
4449
|
+
#minWidth = 0;
|
|
4450
|
+
#maxWidth = 0;
|
|
4451
|
+
#initialWidth = 0;
|
|
4452
|
+
#width = 0;
|
|
4453
|
+
#coefficient;
|
|
4454
|
+
#visible = false;
|
|
4455
|
+
constructor({
|
|
4456
|
+
sidebar,
|
|
4457
|
+
resizer,
|
|
4458
|
+
toggleButton
|
|
4459
|
+
}, ltr, isResizerOnTheLeft) {
|
|
4460
|
+
this._sidebar = sidebar;
|
|
4461
|
+
this.#coefficient = ltr === isResizerOnTheLeft ? -1 : 1;
|
|
4462
|
+
const style = window.getComputedStyle(sidebar);
|
|
4463
|
+
this.#minWidth = parseFloat(style.getPropertyValue("--sidebar-min-width"));
|
|
4464
|
+
this.#maxWidth = parseFloat(style.getPropertyValue("--sidebar-max-width"));
|
|
4465
|
+
this.#initialWidth = this.#width = parseFloat(style.getPropertyValue("--sidebar-width"));
|
|
4466
|
+
this.#makeSidebarResizable(resizer, isResizerOnTheLeft);
|
|
4467
|
+
toggleButton.addEventListener("click", this.toggle.bind(this));
|
|
4468
|
+
sidebar.hidden = true;
|
|
4469
|
+
}
|
|
4470
|
+
#makeSidebarResizable(resizer, isResizerOnTheLeft) {
|
|
4471
|
+
resizer.ariaValueMin = this.#minWidth;
|
|
4472
|
+
resizer.ariaValueMax = this.#maxWidth;
|
|
4473
|
+
resizer.ariaValueNow = this.#width;
|
|
4474
|
+
let pointerMoveAC;
|
|
4475
|
+
const cancelResize = () => {
|
|
4476
|
+
this.#width = MathClamp(this.#width, this.#minWidth, this.#maxWidth);
|
|
4477
|
+
this._sidebar.classList.remove("resizing");
|
|
4478
|
+
pointerMoveAC?.abort();
|
|
4479
|
+
pointerMoveAC = null;
|
|
4480
|
+
};
|
|
4481
|
+
resizer.addEventListener("pointerdown", e => {
|
|
4482
|
+
if (pointerMoveAC) {
|
|
4483
|
+
cancelResize();
|
|
4484
|
+
return;
|
|
4485
|
+
}
|
|
4486
|
+
const {
|
|
4487
|
+
clientX
|
|
4488
|
+
} = e;
|
|
4489
|
+
stopEvent(e);
|
|
4490
|
+
let prevX = clientX;
|
|
4491
|
+
pointerMoveAC = new AbortController();
|
|
4492
|
+
const {
|
|
4493
|
+
signal
|
|
4494
|
+
} = pointerMoveAC;
|
|
4495
|
+
const sidebar = this._sidebar;
|
|
4496
|
+
const sidebarStyle = sidebar.style;
|
|
4497
|
+
sidebar.classList.add("resizing");
|
|
4498
|
+
const parentStyle = sidebar.parentElement.style;
|
|
4499
|
+
parentStyle.minWidth = 0;
|
|
4500
|
+
window.addEventListener("contextmenu", noContextMenu, {
|
|
4501
|
+
signal
|
|
4502
|
+
});
|
|
4503
|
+
window.addEventListener("pointermove", ev => {
|
|
4504
|
+
if (!pointerMoveAC) {
|
|
4505
|
+
return;
|
|
4506
|
+
}
|
|
4507
|
+
stopEvent(ev);
|
|
4508
|
+
const {
|
|
4509
|
+
clientX: x
|
|
4510
|
+
} = ev;
|
|
4511
|
+
this.#setNewWidth(x - prevX, parentStyle, resizer, sidebarStyle, isResizerOnTheLeft, false);
|
|
4512
|
+
prevX = x;
|
|
4513
|
+
}, {
|
|
4514
|
+
signal,
|
|
4515
|
+
capture: true
|
|
4516
|
+
});
|
|
4517
|
+
window.addEventListener("blur", cancelResize, {
|
|
4518
|
+
signal
|
|
4519
|
+
});
|
|
4520
|
+
window.addEventListener("pointerup", ev => {
|
|
4521
|
+
if (pointerMoveAC) {
|
|
4522
|
+
cancelResize();
|
|
4523
|
+
stopEvent(ev);
|
|
4524
|
+
}
|
|
4525
|
+
}, {
|
|
4526
|
+
signal
|
|
4527
|
+
});
|
|
4528
|
+
});
|
|
4529
|
+
resizer.addEventListener("keydown", e => {
|
|
4530
|
+
const {
|
|
4531
|
+
key
|
|
4532
|
+
} = e;
|
|
4533
|
+
const isArrowLeft = key === "ArrowLeft";
|
|
4534
|
+
if (isArrowLeft || key === "ArrowRight") {
|
|
4535
|
+
const base = e.ctrlKey || e.metaKey ? 10 : 1;
|
|
4536
|
+
const dx = base * (isArrowLeft ? -1 : 1);
|
|
4537
|
+
this.#setNewWidth(dx, this._sidebar.parentElement.style, resizer, this._sidebar.style, isResizerOnTheLeft, true);
|
|
4538
|
+
stopEvent(e);
|
|
4539
|
+
}
|
|
4540
|
+
});
|
|
4541
|
+
}
|
|
4542
|
+
#setNewWidth(dx, parentStyle, resizer, sidebarStyle, isResizerOnTheLeft, isFromKeyboard) {
|
|
4543
|
+
let newWidth = this.#width + this.#coefficient * dx;
|
|
4544
|
+
if (!isFromKeyboard) {
|
|
4545
|
+
this.#width = newWidth;
|
|
4546
|
+
}
|
|
4547
|
+
if ((newWidth > this.#maxWidth || newWidth < this.#minWidth) && (this.#width === this.#maxWidth || this.#width === this.#minWidth)) {
|
|
4548
|
+
return;
|
|
4549
|
+
}
|
|
4550
|
+
newWidth = MathClamp(newWidth, this.#minWidth, this.#maxWidth);
|
|
4551
|
+
if (isFromKeyboard) {
|
|
4552
|
+
this.#width = newWidth;
|
|
4553
|
+
}
|
|
4554
|
+
resizer.ariaValueNow = Math.round(newWidth);
|
|
4555
|
+
sidebarStyle.width = `${newWidth.toFixed(3)}px`;
|
|
4556
|
+
if (isResizerOnTheLeft) {
|
|
4557
|
+
parentStyle.insetInlineStart = `${(this.#initialWidth - newWidth).toFixed(3)}px`;
|
|
4558
|
+
}
|
|
4559
|
+
}
|
|
4560
|
+
toggle() {
|
|
4561
|
+
this._sidebar.hidden = !(this.#visible = !this.#visible);
|
|
4562
|
+
}
|
|
4563
|
+
}
|
|
4564
|
+
|
|
4436
4565
|
;// ./web/comment_manager.js
|
|
4437
4566
|
|
|
4438
4567
|
|
|
4568
|
+
|
|
4439
4569
|
class CommentManager {
|
|
4440
4570
|
#dialog;
|
|
4441
4571
|
#popup;
|
|
@@ -4500,12 +4630,11 @@ class CommentManager {
|
|
|
4500
4630
|
this.#popup.destroy();
|
|
4501
4631
|
}
|
|
4502
4632
|
}
|
|
4503
|
-
class CommentSidebar {
|
|
4633
|
+
class CommentSidebar extends Sidebar {
|
|
4504
4634
|
#annotations = null;
|
|
4505
4635
|
#eventBus;
|
|
4506
4636
|
#boundCommentClick = this.#commentClick.bind(this);
|
|
4507
4637
|
#boundCommentKeydown = this.#commentKeydown.bind(this);
|
|
4508
|
-
#sidebar;
|
|
4509
4638
|
#closeButton;
|
|
4510
4639
|
#commentsList;
|
|
4511
4640
|
#commentCount;
|
|
@@ -4517,11 +4646,6 @@ class CommentSidebar {
|
|
|
4517
4646
|
#elementsToAnnotations = null;
|
|
4518
4647
|
#idsToElements = null;
|
|
4519
4648
|
#uiManager = null;
|
|
4520
|
-
#minWidth = 0;
|
|
4521
|
-
#maxWidth = 0;
|
|
4522
|
-
#initialWidth = 0;
|
|
4523
|
-
#width = 0;
|
|
4524
|
-
#ltr;
|
|
4525
4649
|
constructor({
|
|
4526
4650
|
learnMoreUrl,
|
|
4527
4651
|
sidebar,
|
|
@@ -4532,7 +4656,11 @@ class CommentSidebar {
|
|
|
4532
4656
|
closeButton,
|
|
4533
4657
|
commentToolbarButton
|
|
4534
4658
|
}, eventBus, linkService, popup, dateFormat, ltr) {
|
|
4535
|
-
|
|
4659
|
+
super({
|
|
4660
|
+
sidebar,
|
|
4661
|
+
resizer: sidebarResizer,
|
|
4662
|
+
toggleButton: commentToolbarButton
|
|
4663
|
+
}, ltr, true);
|
|
4536
4664
|
this.#sidebarTitle = sidebarTitle;
|
|
4537
4665
|
this.#commentsList = commentsList;
|
|
4538
4666
|
this.#commentCount = commentCount;
|
|
@@ -4541,13 +4669,7 @@ class CommentSidebar {
|
|
|
4541
4669
|
this.#closeButton = closeButton;
|
|
4542
4670
|
this.#popup = popup;
|
|
4543
4671
|
this.#dateFormat = dateFormat;
|
|
4544
|
-
this.#ltr = ltr;
|
|
4545
4672
|
this.#eventBus = eventBus;
|
|
4546
|
-
const style = window.getComputedStyle(sidebar);
|
|
4547
|
-
this.#minWidth = parseFloat(style.getPropertyValue("--sidebar-min-width"));
|
|
4548
|
-
this.#maxWidth = parseFloat(style.getPropertyValue("--sidebar-max-width"));
|
|
4549
|
-
this.#initialWidth = this.#width = parseFloat(style.getPropertyValue("--sidebar-width"));
|
|
4550
|
-
this.#makeSidebarResizable(sidebarResizer);
|
|
4551
4673
|
closeButton.addEventListener("click", () => {
|
|
4552
4674
|
eventBus.dispatch("switchannotationeditormode", {
|
|
4553
4675
|
source: this,
|
|
@@ -4565,70 +4687,6 @@ class CommentSidebar {
|
|
|
4565
4687
|
};
|
|
4566
4688
|
commentToolbarButton.addEventListener("keydown", keyDownCallback);
|
|
4567
4689
|
sidebar.addEventListener("keydown", keyDownCallback);
|
|
4568
|
-
this.#sidebar.hidden = true;
|
|
4569
|
-
}
|
|
4570
|
-
#makeSidebarResizable(resizer) {
|
|
4571
|
-
let pointerMoveAC;
|
|
4572
|
-
const cancelResize = () => {
|
|
4573
|
-
this.#width = MathClamp(this.#width, this.#minWidth, this.#maxWidth);
|
|
4574
|
-
this.#sidebar.classList.remove("resizing");
|
|
4575
|
-
pointerMoveAC?.abort();
|
|
4576
|
-
pointerMoveAC = null;
|
|
4577
|
-
};
|
|
4578
|
-
resizer.addEventListener("pointerdown", e => {
|
|
4579
|
-
if (pointerMoveAC) {
|
|
4580
|
-
cancelResize();
|
|
4581
|
-
return;
|
|
4582
|
-
}
|
|
4583
|
-
const {
|
|
4584
|
-
clientX
|
|
4585
|
-
} = e;
|
|
4586
|
-
stopEvent(e);
|
|
4587
|
-
let prevX = clientX;
|
|
4588
|
-
pointerMoveAC = new AbortController();
|
|
4589
|
-
const {
|
|
4590
|
-
signal
|
|
4591
|
-
} = pointerMoveAC;
|
|
4592
|
-
const sign = this.#ltr ? -1 : 1;
|
|
4593
|
-
const sidebar = this.#sidebar;
|
|
4594
|
-
const sidebarStyle = sidebar.style;
|
|
4595
|
-
sidebar.classList.add("resizing");
|
|
4596
|
-
const parentStyle = sidebar.parentElement.style;
|
|
4597
|
-
parentStyle.minWidth = 0;
|
|
4598
|
-
window.addEventListener("contextmenu", noContextMenu, {
|
|
4599
|
-
signal
|
|
4600
|
-
});
|
|
4601
|
-
window.addEventListener("pointermove", ev => {
|
|
4602
|
-
if (!pointerMoveAC) {
|
|
4603
|
-
return;
|
|
4604
|
-
}
|
|
4605
|
-
stopEvent(ev);
|
|
4606
|
-
const {
|
|
4607
|
-
clientX: x
|
|
4608
|
-
} = ev;
|
|
4609
|
-
const newWidth = this.#width += sign * (x - prevX);
|
|
4610
|
-
prevX = x;
|
|
4611
|
-
if (newWidth > this.#maxWidth || newWidth < this.#minWidth) {
|
|
4612
|
-
return;
|
|
4613
|
-
}
|
|
4614
|
-
sidebarStyle.width = `${newWidth.toFixed(3)}px`;
|
|
4615
|
-
parentStyle.insetInlineStart = `${(this.#initialWidth - newWidth).toFixed(3)}px`;
|
|
4616
|
-
}, {
|
|
4617
|
-
signal,
|
|
4618
|
-
capture: true
|
|
4619
|
-
});
|
|
4620
|
-
window.addEventListener("blur", cancelResize, {
|
|
4621
|
-
signal
|
|
4622
|
-
});
|
|
4623
|
-
window.addEventListener("pointerup", ev => {
|
|
4624
|
-
if (pointerMoveAC) {
|
|
4625
|
-
cancelResize();
|
|
4626
|
-
stopEvent(ev);
|
|
4627
|
-
}
|
|
4628
|
-
}, {
|
|
4629
|
-
signal
|
|
4630
|
-
});
|
|
4631
|
-
});
|
|
4632
4690
|
}
|
|
4633
4691
|
setUIManager(uiManager) {
|
|
4634
4692
|
this.#uiManager = uiManager;
|
|
@@ -4648,7 +4706,7 @@ class CommentSidebar {
|
|
|
4648
4706
|
} else {
|
|
4649
4707
|
this.#setCommentsCount();
|
|
4650
4708
|
}
|
|
4651
|
-
this
|
|
4709
|
+
this._sidebar.hidden = false;
|
|
4652
4710
|
this.#eventBus.dispatch("reporttelemetry", {
|
|
4653
4711
|
source: this,
|
|
4654
4712
|
details: {
|
|
@@ -4660,7 +4718,7 @@ class CommentSidebar {
|
|
|
4660
4718
|
});
|
|
4661
4719
|
}
|
|
4662
4720
|
hide() {
|
|
4663
|
-
this
|
|
4721
|
+
this._sidebar.hidden = true;
|
|
4664
4722
|
this.#commentsList.replaceChildren();
|
|
4665
4723
|
this.#elementsToAnnotations = null;
|
|
4666
4724
|
this.#idsToElements = null;
|
|
@@ -4683,7 +4741,7 @@ class CommentSidebar {
|
|
|
4683
4741
|
if (!element) {
|
|
4684
4742
|
return;
|
|
4685
4743
|
}
|
|
4686
|
-
this
|
|
4744
|
+
this._sidebar.scrollTop = element.offsetTop - this._sidebar.offsetTop;
|
|
4687
4745
|
for (const el of this.#commentsList.children) {
|
|
4688
4746
|
el.classList.toggle("selected", el === element);
|
|
4689
4747
|
}
|
|
@@ -4712,8 +4770,8 @@ class CommentSidebar {
|
|
|
4712
4770
|
if (index >= this.#annotations.length) {
|
|
4713
4771
|
return;
|
|
4714
4772
|
}
|
|
4715
|
-
this.#setDate(element.
|
|
4716
|
-
this.#setText(element.
|
|
4773
|
+
this.#setDate(element.firstElementChild, modificationDate || creationDate);
|
|
4774
|
+
this.#setText(element.lastElementChild, richText, contentsObj);
|
|
4717
4775
|
this.#annotations.splice(index, 1);
|
|
4718
4776
|
index = binarySearchFirstItem(this.#annotations, a => this.#sortComments(a, annotation) >= 0);
|
|
4719
4777
|
this.#annotations.splice(index, 0, annotation);
|
|
@@ -4986,6 +5044,11 @@ class CommentDialog {
|
|
|
4986
5044
|
textInput.addEventListener("input", () => {
|
|
4987
5045
|
saveButton.disabled = textInput.value === this.#previousText;
|
|
4988
5046
|
});
|
|
5047
|
+
textInput.addEventListener("keydown", e => {
|
|
5048
|
+
if ((e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled) {
|
|
5049
|
+
this.#save();
|
|
5050
|
+
}
|
|
5051
|
+
});
|
|
4989
5052
|
let pointerMoveAC;
|
|
4990
5053
|
const cancelDrag = () => {
|
|
4991
5054
|
dialog.classList.remove("dragging");
|
|
@@ -6355,6 +6418,7 @@ class PDFDocumentProperties {
|
|
|
6355
6418
|
}
|
|
6356
6419
|
|
|
6357
6420
|
;// ./web/pdf_find_utils.js
|
|
6421
|
+
|
|
6358
6422
|
const CharacterType = {
|
|
6359
6423
|
SPACE: 0,
|
|
6360
6424
|
ALPHA_LETTER: 1,
|
|
@@ -6424,7 +6488,6 @@ function getCharacterType(charCode) {
|
|
|
6424
6488
|
}
|
|
6425
6489
|
let NormalizeWithNFKC;
|
|
6426
6490
|
function getNormalizeWithNFKC() {
|
|
6427
|
-
NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
|
|
6428
6491
|
return NormalizeWithNFKC;
|
|
6429
6492
|
}
|
|
6430
6493
|
|
|
@@ -6456,7 +6519,7 @@ const CHARACTERS_TO_NORMALIZE = {
|
|
|
6456
6519
|
const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]);
|
|
6457
6520
|
let DIACRITICS_EXCEPTION_STR;
|
|
6458
6521
|
const DIACRITICS_REG_EXP = /\p{M}+/gu;
|
|
6459
|
-
const SPECIAL_CHARS_REG_EXP = /([
|
|
6522
|
+
const SPECIAL_CHARS_REG_EXP = /([*+^${}()|[\]\\])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu;
|
|
6460
6523
|
const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;
|
|
6461
6524
|
const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;
|
|
6462
6525
|
const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g;
|
|
@@ -6852,12 +6915,24 @@ class PDFFindController {
|
|
|
6852
6915
|
matchDiacritics
|
|
6853
6916
|
} = this.#state;
|
|
6854
6917
|
let isUnicode = false;
|
|
6918
|
+
const addExtraWhitespaces = (original, fixed) => {
|
|
6919
|
+
if (original === query) {
|
|
6920
|
+
return fixed;
|
|
6921
|
+
}
|
|
6922
|
+
if (query.startsWith(original)) {
|
|
6923
|
+
return `${fixed}[ ]*`;
|
|
6924
|
+
}
|
|
6925
|
+
if (query.endsWith(original)) {
|
|
6926
|
+
return `[ ]*${fixed}`;
|
|
6927
|
+
}
|
|
6928
|
+
return `[ ]*${fixed}[ ]*`;
|
|
6929
|
+
};
|
|
6855
6930
|
query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => {
|
|
6856
6931
|
if (p1) {
|
|
6857
|
-
return
|
|
6932
|
+
return addExtraWhitespaces(p1, `\\${p1}`);
|
|
6858
6933
|
}
|
|
6859
6934
|
if (p2) {
|
|
6860
|
-
return
|
|
6935
|
+
return addExtraWhitespaces(p2, p2.replaceAll(/[.?]/g, "\\$&"));
|
|
6861
6936
|
}
|
|
6862
6937
|
if (p3) {
|
|
6863
6938
|
return "[ ]+";
|
|
@@ -9767,16 +9842,16 @@ class PdfTextExtractor {
|
|
|
9767
9842
|
const DRAW_UPSCALE_FACTOR = 2;
|
|
9768
9843
|
const MAX_NUM_SCALING_STEPS = 3;
|
|
9769
9844
|
const THUMBNAIL_WIDTH = 98;
|
|
9770
|
-
function zeroCanvas(c) {
|
|
9771
|
-
c.width = 0;
|
|
9772
|
-
c.height = 0;
|
|
9773
|
-
}
|
|
9774
9845
|
class TempImageFactory {
|
|
9775
|
-
static #tempCanvas = null;
|
|
9776
9846
|
static getCanvas(width, height) {
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9847
|
+
let tempCanvas;
|
|
9848
|
+
if (FeatureTest.isOffscreenCanvasSupported) {
|
|
9849
|
+
tempCanvas = new OffscreenCanvas(width, height);
|
|
9850
|
+
} else {
|
|
9851
|
+
tempCanvas = document.createElement("canvas");
|
|
9852
|
+
tempCanvas.width = width;
|
|
9853
|
+
tempCanvas.height = height;
|
|
9854
|
+
}
|
|
9780
9855
|
const ctx = tempCanvas.getContext("2d", {
|
|
9781
9856
|
alpha: false
|
|
9782
9857
|
});
|
|
@@ -9784,13 +9859,7 @@ class TempImageFactory {
|
|
|
9784
9859
|
ctx.fillStyle = "rgb(255, 255, 255)";
|
|
9785
9860
|
ctx.fillRect(0, 0, width, height);
|
|
9786
9861
|
ctx.restore();
|
|
9787
|
-
return [tempCanvas,
|
|
9788
|
-
}
|
|
9789
|
-
static destroyCanvas() {
|
|
9790
|
-
if (this.#tempCanvas) {
|
|
9791
|
-
zeroCanvas(this.#tempCanvas);
|
|
9792
|
-
}
|
|
9793
|
-
this.#tempCanvas = null;
|
|
9862
|
+
return [tempCanvas, ctx];
|
|
9794
9863
|
}
|
|
9795
9864
|
}
|
|
9796
9865
|
class PDFThumbnailView {
|
|
@@ -9823,24 +9892,21 @@ class PDFThumbnailView {
|
|
|
9823
9892
|
this.renderTask = null;
|
|
9824
9893
|
this.renderingState = RenderingStates.INITIAL;
|
|
9825
9894
|
this.resume = null;
|
|
9826
|
-
const anchor = document.createElement("a");
|
|
9827
|
-
anchor.href = linkService.getAnchorUrl(
|
|
9895
|
+
const anchor = this.anchor = document.createElement("a");
|
|
9896
|
+
anchor.href = linkService.getAnchorUrl(`#page=${id}`);
|
|
9828
9897
|
anchor.setAttribute("data-l10n-id", "pdfjs-thumb-page-title");
|
|
9829
9898
|
anchor.setAttribute("data-l10n-args", this.#pageL10nArgs);
|
|
9830
|
-
anchor.onclick =
|
|
9899
|
+
anchor.onclick = () => {
|
|
9831
9900
|
linkService.goToPage(id);
|
|
9832
9901
|
return false;
|
|
9833
9902
|
};
|
|
9834
|
-
this.
|
|
9835
|
-
|
|
9836
|
-
div.className = "thumbnail";
|
|
9903
|
+
const div = this.div = document.createElement("div");
|
|
9904
|
+
div.classList.add("thumbnail", "missingThumbnailImage");
|
|
9837
9905
|
div.setAttribute("data-page-number", this.id);
|
|
9838
|
-
this.div = div;
|
|
9839
9906
|
this.#updateDims();
|
|
9840
|
-
const
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
div.append(img);
|
|
9907
|
+
const image = this.image = document.createElement("img");
|
|
9908
|
+
image.className = "thumbnailImage";
|
|
9909
|
+
div.append(image);
|
|
9844
9910
|
anchor.append(div);
|
|
9845
9911
|
container.append(anchor);
|
|
9846
9912
|
}
|
|
@@ -9850,14 +9916,10 @@ class PDFThumbnailView {
|
|
|
9850
9916
|
height
|
|
9851
9917
|
} = this.viewport;
|
|
9852
9918
|
const ratio = width / height;
|
|
9853
|
-
this.canvasWidth = THUMBNAIL_WIDTH;
|
|
9854
|
-
this.canvasHeight =
|
|
9855
|
-
this.scale =
|
|
9856
|
-
|
|
9857
|
-
style
|
|
9858
|
-
} = this.div;
|
|
9859
|
-
style.setProperty("--thumbnail-width", `${this.canvasWidth}px`);
|
|
9860
|
-
style.setProperty("--thumbnail-height", `${this.canvasHeight}px`);
|
|
9919
|
+
const canvasWidth = this.canvasWidth = THUMBNAIL_WIDTH;
|
|
9920
|
+
const canvasHeight = this.canvasHeight = canvasWidth / ratio | 0;
|
|
9921
|
+
this.scale = canvasWidth / width;
|
|
9922
|
+
this.div.style.height = `${canvasHeight}px`;
|
|
9861
9923
|
}
|
|
9862
9924
|
setPdfPage(pdfPage) {
|
|
9863
9925
|
this.pdfPage = pdfPage;
|
|
@@ -9872,12 +9934,17 @@ class PDFThumbnailView {
|
|
|
9872
9934
|
reset() {
|
|
9873
9935
|
this.cancelRendering();
|
|
9874
9936
|
this.renderingState = RenderingStates.INITIAL;
|
|
9875
|
-
this.div.removeAttribute("data-loaded");
|
|
9876
|
-
this.image?.replaceWith(this._placeholderImg);
|
|
9877
9937
|
this.#updateDims();
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9938
|
+
const {
|
|
9939
|
+
image
|
|
9940
|
+
} = this;
|
|
9941
|
+
const url = image.src;
|
|
9942
|
+
if (url) {
|
|
9943
|
+
URL.revokeObjectURL(url);
|
|
9944
|
+
image.removeAttribute("data-l10n-id");
|
|
9945
|
+
image.removeAttribute("data-l10n-args");
|
|
9946
|
+
image.src = "";
|
|
9947
|
+
this.div.classList.add("missingThumbnailImage");
|
|
9881
9948
|
}
|
|
9882
9949
|
}
|
|
9883
9950
|
update({
|
|
@@ -9901,11 +9968,11 @@ class PDFThumbnailView {
|
|
|
9901
9968
|
this.resume = null;
|
|
9902
9969
|
}
|
|
9903
9970
|
#getPageDrawContext(upscaleFactor = 1) {
|
|
9904
|
-
const canvas = document.createElement("canvas");
|
|
9905
9971
|
const outputScale = new OutputScale();
|
|
9906
9972
|
const width = upscaleFactor * this.canvasWidth,
|
|
9907
9973
|
height = upscaleFactor * this.canvasHeight;
|
|
9908
9974
|
outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim);
|
|
9975
|
+
const canvas = document.createElement("canvas");
|
|
9909
9976
|
canvas.width = width * outputScale.sx | 0;
|
|
9910
9977
|
canvas.height = height * outputScale.sy | 0;
|
|
9911
9978
|
const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
|
|
@@ -9914,20 +9981,27 @@ class PDFThumbnailView {
|
|
|
9914
9981
|
transform
|
|
9915
9982
|
};
|
|
9916
9983
|
}
|
|
9917
|
-
#convertCanvasToImage(canvas) {
|
|
9984
|
+
async #convertCanvasToImage(canvas) {
|
|
9918
9985
|
if (this.renderingState !== RenderingStates.FINISHED) {
|
|
9919
9986
|
throw new Error("#convertCanvasToImage: Rendering has not finished.");
|
|
9920
9987
|
}
|
|
9921
9988
|
const reducedCanvas = this.#reduceImage(canvas);
|
|
9922
|
-
const
|
|
9923
|
-
|
|
9989
|
+
const {
|
|
9990
|
+
image
|
|
9991
|
+
} = this;
|
|
9992
|
+
const {
|
|
9993
|
+
promise,
|
|
9994
|
+
resolve
|
|
9995
|
+
} = Promise.withResolvers();
|
|
9996
|
+
reducedCanvas.toBlob(resolve);
|
|
9997
|
+
const blob = await promise;
|
|
9998
|
+
image.src = URL.createObjectURL(blob);
|
|
9924
9999
|
image.setAttribute("data-l10n-id", "pdfjs-thumb-page-canvas");
|
|
9925
10000
|
image.setAttribute("data-l10n-args", this.#pageL10nArgs);
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
zeroCanvas(reducedCanvas);
|
|
10001
|
+
this.div.classList.remove("missingThumbnailImage");
|
|
10002
|
+
if (!FeatureTest.isOffscreenCanvasSupported) {
|
|
10003
|
+
reducedCanvas.width = reducedCanvas.height = 0;
|
|
10004
|
+
}
|
|
9931
10005
|
}
|
|
9932
10006
|
async draw() {
|
|
9933
10007
|
if (this.renderingState !== RenderingStates.INITIAL) {
|
|
@@ -9975,7 +10049,6 @@ class PDFThumbnailView {
|
|
|
9975
10049
|
await renderTask.promise;
|
|
9976
10050
|
} catch (e) {
|
|
9977
10051
|
if (e instanceof RenderingCancelledException) {
|
|
9978
|
-
zeroCanvas(canvas);
|
|
9979
10052
|
return;
|
|
9980
10053
|
}
|
|
9981
10054
|
error = e;
|
|
@@ -9985,8 +10058,7 @@ class PDFThumbnailView {
|
|
|
9985
10058
|
}
|
|
9986
10059
|
}
|
|
9987
10060
|
this.renderingState = RenderingStates.FINISHED;
|
|
9988
|
-
this.#convertCanvasToImage(canvas);
|
|
9989
|
-
zeroCanvas(canvas);
|
|
10061
|
+
await this.#convertCanvasToImage(canvas);
|
|
9990
10062
|
this.eventBus.dispatch("thumbnailrendered", {
|
|
9991
10063
|
source: this,
|
|
9992
10064
|
pageNumber: this.id,
|
|
@@ -10060,10 +10132,7 @@ class PDFThumbnailView {
|
|
|
10060
10132
|
setPageLabel(label) {
|
|
10061
10133
|
this.pageLabel = typeof label === "string" ? label : null;
|
|
10062
10134
|
this.anchor.setAttribute("data-l10n-args", this.#pageL10nArgs);
|
|
10063
|
-
|
|
10064
|
-
return;
|
|
10065
|
-
}
|
|
10066
|
-
this.image?.setAttribute("data-l10n-args", this.#pageL10nArgs);
|
|
10135
|
+
this.image.setAttribute("data-l10n-args", this.#pageL10nArgs);
|
|
10067
10136
|
}
|
|
10068
10137
|
}
|
|
10069
10138
|
|
|
@@ -10177,7 +10246,6 @@ class PDFThumbnailViewer {
|
|
|
10177
10246
|
thumbnail.reset();
|
|
10178
10247
|
}
|
|
10179
10248
|
}
|
|
10180
|
-
TempImageFactory.destroyCanvas();
|
|
10181
10249
|
}
|
|
10182
10250
|
#resetView() {
|
|
10183
10251
|
this._thumbnails = [];
|
|
@@ -10204,9 +10272,10 @@ class PDFThumbnailViewer {
|
|
|
10204
10272
|
const viewport = firstPdfPage.getViewport({
|
|
10205
10273
|
scale: 1
|
|
10206
10274
|
});
|
|
10275
|
+
const fragment = document.createDocumentFragment();
|
|
10207
10276
|
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
|
10208
10277
|
const thumbnail = new PDFThumbnailView({
|
|
10209
|
-
container:
|
|
10278
|
+
container: fragment,
|
|
10210
10279
|
eventBus: this.eventBus,
|
|
10211
10280
|
id: pageNum,
|
|
10212
10281
|
defaultViewport: viewport.clone(),
|
|
@@ -10223,6 +10292,7 @@ class PDFThumbnailViewer {
|
|
|
10223
10292
|
this._thumbnails[0]?.setPdfPage(firstPdfPage);
|
|
10224
10293
|
const thumbnailView = this._thumbnails[this._currentPageNumber - 1];
|
|
10225
10294
|
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
|
|
10295
|
+
this.container.append(fragment);
|
|
10226
10296
|
}).catch(reason => {
|
|
10227
10297
|
console.error("Unable to initialize thumbnail viewer", reason);
|
|
10228
10298
|
});
|
|
@@ -12886,7 +12956,7 @@ class PDFViewer {
|
|
|
12886
12956
|
#textLayerMode = TextLayerMode.ENABLE;
|
|
12887
12957
|
#viewerAlert = null;
|
|
12888
12958
|
constructor(options) {
|
|
12889
|
-
const viewerVersion = "5.4.
|
|
12959
|
+
const viewerVersion = "5.4.449";
|
|
12890
12960
|
if (version !== viewerVersion) {
|
|
12891
12961
|
throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
|
|
12892
12962
|
}
|
|
@@ -17118,11 +17188,16 @@ const PDFViewerApplication = {
|
|
|
17118
17188
|
info,
|
|
17119
17189
|
metadata,
|
|
17120
17190
|
contentDispositionFilename,
|
|
17121
|
-
contentLength
|
|
17191
|
+
contentLength,
|
|
17192
|
+
hasStructTree
|
|
17122
17193
|
} = await pdfDocument.getMetadata();
|
|
17123
17194
|
if (pdfDocument !== this.pdfDocument) {
|
|
17124
17195
|
return;
|
|
17125
17196
|
}
|
|
17197
|
+
this.externalServices.reportTelemetry({
|
|
17198
|
+
type: "taggedPDF",
|
|
17199
|
+
data: hasStructTree
|
|
17200
|
+
});
|
|
17126
17201
|
this.documentInfo = info;
|
|
17127
17202
|
this.metadata = metadata;
|
|
17128
17203
|
this._contentDispositionFilename ??= contentDispositionFilename;
|