@pdfslick/core 2.0.0 → 2.1.0
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/esm/PDFSlick.d.ts +5 -2
- package/dist/esm/PDFSlick.d.ts.map +1 -1
- package/dist/esm/index.js +78 -76
- package/dist/esm/types.d.ts +4 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/pdf_viewer.css +4 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +8 -7
package/dist/esm/PDFSlick.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { PDFDocumentProxy, AbortException, MissingPDFException, InvalidPDFException, RenderingCancelledException, UnexpectedResponseException } from "pdfjs-dist";
|
|
1
|
+
import { type OnProgressParameters, PDFDocumentProxy, AbortException, MissingPDFException, InvalidPDFException, RenderingCancelledException, UnexpectedResponseException } from "pdfjs-dist";
|
|
2
|
+
import type { DocumentInitParameters } from "pdfjs-dist/types/src/display/api";
|
|
2
3
|
import { EventBus, PDFViewer, PDFLinkService, DownloadManager, PDFFindController, PDFPageView } from "pdfjs-dist/web/pdf_viewer.mjs";
|
|
3
4
|
import { IL10n } from "pdfjs-dist/types/web/pdf_viewer";
|
|
4
5
|
import type { PDFSlickInputArgs, PDFSlickState, TEventBusName, TEventBusOptions, TEventBusListener } from "./types";
|
|
@@ -33,9 +34,11 @@ export declare class PDFSlick {
|
|
|
33
34
|
maxCanvasPixels: number;
|
|
34
35
|
printResolution: number;
|
|
35
36
|
thumbnailWidth: number;
|
|
36
|
-
|
|
37
|
+
getDocumentParams: DocumentInitParameters;
|
|
38
|
+
constructor({ container, viewer, thumbs, store, options, onError, }: PDFSlickInputArgs);
|
|
37
39
|
loadDocument(url: string | URL | ArrayBuffer, options?: {
|
|
38
40
|
filename?: string;
|
|
41
|
+
onProgress?: (_: OnProgressParameters) => void;
|
|
39
42
|
}): Promise<void>;
|
|
40
43
|
forceRendering(isThumbnailViewEnabled?: boolean): void;
|
|
41
44
|
gotoPage(pageNumber: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PDFSlick.d.ts","sourceRoot":"","sources":["../PDFSlick.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PDFSlick.d.ts","sourceRoot":"","sources":["../PDFSlick.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EAMzB,gBAAgB,EAGhB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,EAE9B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EACH,QAAQ,EACR,SAAS,EACT,cAAc,EAEd,eAAe,EACf,iBAAiB,EACjB,WAAW,EAEd,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAoB,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAER,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAGpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,kBAAkB,EAGlB,mBAAmB,EACtB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAW3C,MAAM,MAAM,YAAY,GAClB,cAAc,GACd,mBAAmB,GACnB,mBAAmB,GACnB,2BAA2B,GAC3B,2BAA2B,CAAC;AA2BlC,qBAAa,QAAQ;;IAMjB,YAAY,EAAE,GAAG,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,cAAc,CAAC;IAC5B,eAAe,EAAE,eAAe,GAAG,IAAI,CAAQ;IAC/C,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAChD,mBAAmB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uBAAuB;IAIvB,eAAe;IAoFf,QAAQ;IAcR,uBAAuB,CAAC,oBAAoB,EAAE,MAAM;IAUpD,yBAAyB,CACrB,sBAAsB,EAChB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,GAC5B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,EAAE;IAkBxC,wBAAwB,CAAC,KAAK,EAAE,MAAM;IAetC,aAAa,CAAC,MAAM,EAAE,MAAM;IAO5B,aAAa,CAAC,MAAM,EAAE,MAAM;IAO5B,WAAW,CAAC,QAAQ,EAAE,MAAM;IAM5B,gBAAgB;eAIO,MAAM;gBACL,MAAM;kBACJ,MAAM;;IAQhC;;OAEG;IACH,aAAa;IAIb;;OAEG;IACH,aAAa;IAIb;;OAEG;IACH,IAAI,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAEhC;IAED;;OAEG;IACH,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,EAE3B;IAED,WAAW,CAAC,EAAE,EAAE,MAAM;IAItB;;;;;OAKG;IACH,EAAE,CACE,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,gBAAgB;IAK9B;;;;;OAKG;IACH,GAAG,CACC,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,gBAAgB;IAK9B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM;CAGlD"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderingCancelledException, PixelsPerInch, getXfaPageViewport, AnnotationMode, AnnotationEditorType, GlobalWorkerOptions,
|
|
1
|
+
import { RenderingCancelledException, PixelsPerInch, getXfaPageViewport, AnnotationMode, AnnotationEditorType, GlobalWorkerOptions, getPdfFilenameFromUrl, getDocument, AnnotationEditorParamsType, PDFDateString } from 'pdfjs-dist';
|
|
2
2
|
import { SimpleLinkService, XfaLayerBuilder, GenericL10n, DownloadManager, EventBus, PDFLinkService, PDFSinglePageViewer, PDFViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
|
|
3
3
|
import { createStore } from 'zustand/vanilla';
|
|
4
4
|
|
|
@@ -646,11 +646,11 @@ class ProgressBar {
|
|
|
646
646
|
var _a, _b, _c;
|
|
647
647
|
__classPrivateFieldSet(this, _ProgressBar_percent, clamp(val, 0, 100), "f");
|
|
648
648
|
if (isNaN(val)) {
|
|
649
|
-
(_a = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _a ===
|
|
649
|
+
(_a = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _a === undefined ? undefined : _a.add("indeterminate");
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
|
-
(_b = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _b ===
|
|
653
|
-
(_c = __classPrivateFieldGet(this, _ProgressBar_style, "f")) === null || _c ===
|
|
652
|
+
(_b = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _b === undefined ? undefined : _b.remove("indeterminate");
|
|
653
|
+
(_c = __classPrivateFieldGet(this, _ProgressBar_style, "f")) === null || _c === undefined ? undefined : _c.setProperty("--progressBar-percent", `${__classPrivateFieldGet(this, _ProgressBar_percent, "f")}%`);
|
|
654
654
|
}
|
|
655
655
|
setWidth(viewer) {
|
|
656
656
|
var _a;
|
|
@@ -660,7 +660,7 @@ class ProgressBar {
|
|
|
660
660
|
const container = viewer.parentNode;
|
|
661
661
|
const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;
|
|
662
662
|
if (scrollbarWidth > 0) {
|
|
663
|
-
(_a = __classPrivateFieldGet(this, _ProgressBar_style, "f")) === null || _a ===
|
|
663
|
+
(_a = __classPrivateFieldGet(this, _ProgressBar_style, "f")) === null || _a === undefined ? undefined : _a.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
setDisableAutoFetch(delay = /* ms = */ 5000) {
|
|
@@ -682,7 +682,7 @@ class ProgressBar {
|
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
684
|
__classPrivateFieldSet(this, _ProgressBar_visible, false, "f");
|
|
685
|
-
(_a = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _a ===
|
|
685
|
+
(_a = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _a === undefined ? undefined : _a.add("hidden");
|
|
686
686
|
}
|
|
687
687
|
show() {
|
|
688
688
|
var _a;
|
|
@@ -690,7 +690,7 @@ class ProgressBar {
|
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
692
|
__classPrivateFieldSet(this, _ProgressBar_visible, true, "f");
|
|
693
|
-
(_a = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _a ===
|
|
693
|
+
(_a = __classPrivateFieldGet(this, _ProgressBar_classList, "f")) === null || _a === undefined ? undefined : _a.remove("hidden");
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
_ProgressBar_classList = new WeakMap(), _ProgressBar_disableAutoFetchTimeout = new WeakMap(), _ProgressBar_percent = new WeakMap(), _ProgressBar_style = new WeakMap(), _ProgressBar_visible = new WeakMap();
|
|
@@ -705,7 +705,7 @@ _ProgressBar_classList = new WeakMap(), _ProgressBar_disableAutoFetchTimeout = n
|
|
|
705
705
|
function getActiveOrFocusedElement() {
|
|
706
706
|
let curRoot = document;
|
|
707
707
|
let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
|
|
708
|
-
while (curActiveOrFocused === null || curActiveOrFocused ===
|
|
708
|
+
while (curActiveOrFocused === null || curActiveOrFocused === undefined ? undefined : curActiveOrFocused.shadowRoot) {
|
|
709
709
|
curRoot = curActiveOrFocused.shadowRoot;
|
|
710
710
|
curActiveOrFocused =
|
|
711
711
|
curRoot.activeElement || curRoot.querySelector(":focus");
|
|
@@ -832,12 +832,12 @@ class PDFRenderingQueue {
|
|
|
832
832
|
this.idleTimeout = null;
|
|
833
833
|
}
|
|
834
834
|
// Pages have a higher priority than thumbnails, so check them first.
|
|
835
|
-
if ((_a = this.pdfViewer) === null || _a ===
|
|
835
|
+
if ((_a = this.pdfViewer) === null || _a === undefined ? undefined : _a.forceRendering(currentlyVisiblePages)) {
|
|
836
836
|
return;
|
|
837
837
|
}
|
|
838
838
|
// No pages needed rendering, so check thumbnails.
|
|
839
839
|
if (this.isThumbnailViewEnabled &&
|
|
840
|
-
((_b = this.pdfThumbnailViewer) === null || _b ===
|
|
840
|
+
((_b = this.pdfThumbnailViewer) === null || _b === undefined ? undefined : _b.forceRendering())) {
|
|
841
841
|
return;
|
|
842
842
|
}
|
|
843
843
|
if (this.printing) {
|
|
@@ -1141,7 +1141,7 @@ class PDFThumbnailView {
|
|
|
1141
1141
|
return Promise.reject(new Error("pdfPage is not loaded"));
|
|
1142
1142
|
}
|
|
1143
1143
|
this.renderingState = RenderingStates.RUNNING;
|
|
1144
|
-
const finishRenderTask = (error = null) => __awaiter(this,
|
|
1144
|
+
const finishRenderTask = (error = null) => __awaiter(this, undefined, undefined, function* () {
|
|
1145
1145
|
// The renderTask may have been replaced by a new one, so only remove
|
|
1146
1146
|
// the reference to the renderTask if it matches the one that is
|
|
1147
1147
|
// triggering this callback.
|
|
@@ -1251,13 +1251,13 @@ class PDFThumbnailView {
|
|
|
1251
1251
|
get _thumbPageTitle() {
|
|
1252
1252
|
var _b;
|
|
1253
1253
|
return this.l10n.get("thumb_page_title", {
|
|
1254
|
-
page: (_b = this.pageLabel) !== null && _b !==
|
|
1254
|
+
page: (_b = this.pageLabel) !== null && _b !== undefined ? _b : this.id,
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
get _thumbPageCanvas() {
|
|
1258
1258
|
var _b;
|
|
1259
1259
|
return this.l10n.get("thumb_page_canvas", {
|
|
1260
|
-
page: ((_b = this.pageLabel) !== null && _b !==
|
|
1260
|
+
page: ((_b = this.pageLabel) !== null && _b !== undefined ? _b : this.id),
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
1263
|
/**
|
|
@@ -1377,7 +1377,7 @@ class PDFThumbnailViewer {
|
|
|
1377
1377
|
// If the thumbnail isn't currently visible, scroll it into view.
|
|
1378
1378
|
if (views.length > 0) {
|
|
1379
1379
|
let shouldScroll = false;
|
|
1380
|
-
if (pageNumber <= first.id || pageNumber >= (last === null || last ===
|
|
1380
|
+
if (pageNumber <= first.id || pageNumber >= (last === null || last === undefined ? undefined : last.id)) {
|
|
1381
1381
|
shouldScroll = true;
|
|
1382
1382
|
}
|
|
1383
1383
|
else {
|
|
@@ -1472,7 +1472,7 @@ class PDFThumbnailViewer {
|
|
|
1472
1472
|
// Set the first `pdfPage` immediately, since it's already loaded,
|
|
1473
1473
|
// rather than having to repeat the `PDFDocumentProxy.getPage` call in
|
|
1474
1474
|
// the `this.#ensurePdfPageLoaded` method before rendering can start.
|
|
1475
|
-
(_a = this._thumbnails[0]) === null || _a ===
|
|
1475
|
+
(_a = this._thumbnails[0]) === null || _a === undefined ? undefined : _a.setPdfPage(firstPdfPage);
|
|
1476
1476
|
// Ensure that the current thumbnail is always highlighted on load.
|
|
1477
1477
|
const thumbnailView = this._thumbnails[this._currentPageNumber - 1];
|
|
1478
1478
|
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
|
|
@@ -1510,7 +1510,7 @@ class PDFThumbnailViewer {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
// Update all the `PDFThumbnailView` instances.
|
|
1512
1512
|
for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
|
|
1513
|
-
this._thumbnails[i].setPageLabel((_b = (_a = this._pageLabels) === null || _a ===
|
|
1513
|
+
this._thumbnails[i].setPageLabel((_b = (_a = this._pageLabels) === null || _a === undefined ? undefined : _a[i]) !== null && _b !== undefined ? _b : null);
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
1516
|
forceRendering() {
|
|
@@ -1530,8 +1530,8 @@ class PDFThumbnailViewer {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
_PDFThumbnailViewer_instances = new WeakSet(), _PDFThumbnailViewer_ensurePdfPageLoaded = function _PDFThumbnailViewer_ensurePdfPageLoaded(thumbView) {
|
|
1532
1532
|
var _a;
|
|
1533
|
-
return __awaiter(this,
|
|
1534
|
-
if (thumbView === null || thumbView ===
|
|
1533
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
1534
|
+
if (thumbView === null || thumbView === undefined ? undefined : thumbView.pdfPage) {
|
|
1535
1535
|
return thumbView.pdfPage;
|
|
1536
1536
|
}
|
|
1537
1537
|
try {
|
|
@@ -1549,10 +1549,10 @@ _PDFThumbnailViewer_instances = new WeakSet(), _PDFThumbnailViewer_ensurePdfPage
|
|
|
1549
1549
|
}, _PDFThumbnailViewer_getScrollAhead = function _PDFThumbnailViewer_getScrollAhead(visible) {
|
|
1550
1550
|
var _a, _b;
|
|
1551
1551
|
// console.log(`visible: `, visible)
|
|
1552
|
-
if (((_a = visible.first) === null || _a ===
|
|
1552
|
+
if (((_a = visible.first) === null || _a === undefined ? undefined : _a.id) === 1) {
|
|
1553
1553
|
return true;
|
|
1554
1554
|
}
|
|
1555
|
-
else if (((_b = visible.last) === null || _b ===
|
|
1555
|
+
else if (((_b = visible.last) === null || _b === undefined ? undefined : _b.id) === this._thumbnails.length) {
|
|
1556
1556
|
return false;
|
|
1557
1557
|
}
|
|
1558
1558
|
return this.scroll.down;
|
|
@@ -1589,7 +1589,7 @@ class OverlayManager {
|
|
|
1589
1589
|
* registered.
|
|
1590
1590
|
*/
|
|
1591
1591
|
register(dialog, canForceClose = false) {
|
|
1592
|
-
return __awaiter(this,
|
|
1592
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
1593
1593
|
if (typeof dialog !== "object") {
|
|
1594
1594
|
throw new Error("Not enough parameters.");
|
|
1595
1595
|
}
|
|
@@ -1608,7 +1608,7 @@ class OverlayManager {
|
|
|
1608
1608
|
* unregistered.
|
|
1609
1609
|
*/
|
|
1610
1610
|
unregister(dialog) {
|
|
1611
|
-
return __awaiter(this,
|
|
1611
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
1612
1612
|
if (!__classPrivateFieldGet(this, _OverlayManager_overlays, "f").has(dialog)) {
|
|
1613
1613
|
throw new Error("The overlay does not exist.");
|
|
1614
1614
|
}
|
|
@@ -1624,7 +1624,7 @@ class OverlayManager {
|
|
|
1624
1624
|
* opened.
|
|
1625
1625
|
*/
|
|
1626
1626
|
open(dialog) {
|
|
1627
|
-
return __awaiter(this,
|
|
1627
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
1628
1628
|
if (!__classPrivateFieldGet(this, _OverlayManager_overlays, "f").has(dialog)) {
|
|
1629
1629
|
throw new Error("The overlay does not exist.");
|
|
1630
1630
|
}
|
|
@@ -1649,7 +1649,7 @@ class OverlayManager {
|
|
|
1649
1649
|
* closed.
|
|
1650
1650
|
*/
|
|
1651
1651
|
close(dialog = __classPrivateFieldGet(this, _OverlayManager_active, "f")) {
|
|
1652
|
-
return __awaiter(this,
|
|
1652
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
1653
1653
|
if (!dialog || !__classPrivateFieldGet(this, _OverlayManager_overlays, "f").has(dialog)) {
|
|
1654
1654
|
throw new Error("The overlay does not exist.");
|
|
1655
1655
|
}
|
|
@@ -1687,7 +1687,7 @@ function getXfaHtmlForPrinting(printContainer, pdfDocument) {
|
|
|
1687
1687
|
const xfaHtml = pdfDocument.allXfaHtml;
|
|
1688
1688
|
const linkService = new SimpleLinkService();
|
|
1689
1689
|
const scale = Math.round(PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100;
|
|
1690
|
-
for (const xfaPage of xfaHtml === null || xfaHtml ===
|
|
1690
|
+
for (const xfaPage of xfaHtml === null || xfaHtml === undefined ? undefined : xfaHtml.children) {
|
|
1691
1691
|
const page = document.createElement("div");
|
|
1692
1692
|
page.className = "xfaPrintedPage";
|
|
1693
1693
|
printContainer.append(page);
|
|
@@ -1752,7 +1752,7 @@ class PDFPrintService {
|
|
|
1752
1752
|
layout() {
|
|
1753
1753
|
this.throwIfInactive();
|
|
1754
1754
|
const body = document.querySelector("body");
|
|
1755
|
-
body === null || body ===
|
|
1755
|
+
body === null || body === undefined ? undefined : body.setAttribute("data-pdfjsprinting", "true");
|
|
1756
1756
|
const hasEqualPageSizes = this.pagesOverview.every((size) => {
|
|
1757
1757
|
return (size.width === this.pagesOverview[0].width &&
|
|
1758
1758
|
size.height === this.pagesOverview[0].height);
|
|
@@ -1774,7 +1774,7 @@ class PDFPrintService {
|
|
|
1774
1774
|
const pageSize = this.pagesOverview[0];
|
|
1775
1775
|
this.pageStyleSheet.textContent =
|
|
1776
1776
|
"@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}";
|
|
1777
|
-
body === null || body ===
|
|
1777
|
+
body === null || body === undefined ? undefined : body.append(this.pageStyleSheet);
|
|
1778
1778
|
}
|
|
1779
1779
|
destroy() {
|
|
1780
1780
|
if (activeService !== this) {
|
|
@@ -1784,7 +1784,7 @@ class PDFPrintService {
|
|
|
1784
1784
|
}
|
|
1785
1785
|
this.printContainer.textContent = "";
|
|
1786
1786
|
const body = document.querySelector("body");
|
|
1787
|
-
body === null || body ===
|
|
1787
|
+
body === null || body === undefined ? undefined : body.removeAttribute("data-pdfjsprinting");
|
|
1788
1788
|
if (this.pageStyleSheet) {
|
|
1789
1789
|
this.pageStyleSheet.remove();
|
|
1790
1790
|
this.pageStyleSheet = null;
|
|
@@ -2038,7 +2038,7 @@ class PDFPresentationMode {
|
|
|
2038
2038
|
* @returns {Promise<boolean>} Indicating if the request was successful.
|
|
2039
2039
|
*/
|
|
2040
2040
|
request() {
|
|
2041
|
-
return __awaiter(this,
|
|
2041
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2042
2042
|
const { container, pdfViewer } = this;
|
|
2043
2043
|
if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) {
|
|
2044
2044
|
return false;
|
|
@@ -2134,7 +2134,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
2134
2134
|
// Text selection is disabled in Presentation Mode, thus it's not possible
|
|
2135
2135
|
// for the user to deselect text that is selected (e.g. with "Select all")
|
|
2136
2136
|
// when entering Presentation Mode, hence we remove any active selection.
|
|
2137
|
-
(_a = window.getSelection()) === null || _a ===
|
|
2137
|
+
(_a = window.getSelection()) === null || _a === undefined ? undefined : _a.removeAllRanges();
|
|
2138
2138
|
}, _PDFPresentationMode_exit = function _PDFPresentationMode_exit() {
|
|
2139
2139
|
const pageNumber = this.pdfViewer.currentPageNumber;
|
|
2140
2140
|
this.container.classList.remove(ACTIVE_SELECTOR);
|
|
@@ -2145,7 +2145,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
2145
2145
|
__classPrivateFieldGet(this, _PDFPresentationMode_instances, "m", _PDFPresentationMode_removeFullscreenChangeListeners).call(this);
|
|
2146
2146
|
__classPrivateFieldGet(this, _PDFPresentationMode_instances, "m", _PDFPresentationMode_notifyStateChange).call(this, PresentationModeState.NORMAL);
|
|
2147
2147
|
this.pdfViewer.scrollMode = __classPrivateFieldGet(this, _PDFPresentationMode_args, "f").scrollMode;
|
|
2148
|
-
if (((_a = __classPrivateFieldGet(this, _PDFPresentationMode_args, "f")) === null || _a ===
|
|
2148
|
+
if (((_a = __classPrivateFieldGet(this, _PDFPresentationMode_args, "f")) === null || _a === undefined ? undefined : _a.spreadMode) !== null) {
|
|
2149
2149
|
this.pdfViewer.spreadMode = __classPrivateFieldGet(this, _PDFPresentationMode_args, "f").spreadMode;
|
|
2150
2150
|
}
|
|
2151
2151
|
this.pdfViewer.currentScaleValue = __classPrivateFieldGet(this, _PDFPresentationMode_args, "f").scaleValue;
|
|
@@ -2172,7 +2172,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
2172
2172
|
// Enable clicking of links in presentation mode. Note: only links
|
|
2173
2173
|
// pointing to destinations in the current PDF document work.
|
|
2174
2174
|
if (evt.target.href &&
|
|
2175
|
-
((_a = evt.target.parentNode) === null || _a ===
|
|
2175
|
+
((_a = evt.target.parentNode) === null || _a === undefined ? undefined : _a.hasAttribute("data-internal-link"))) {
|
|
2176
2176
|
return;
|
|
2177
2177
|
}
|
|
2178
2178
|
// Unless an internal link was clicked, advance one page.
|
|
@@ -2380,39 +2380,40 @@ function getPageName(size, isPortrait, pageNames) {
|
|
|
2380
2380
|
return pageNames[`${width}x${height}`];
|
|
2381
2381
|
}
|
|
2382
2382
|
class PDFSlick {
|
|
2383
|
-
constructor({ container, viewer, thumbs, store = create(), options, onError }) {
|
|
2384
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2383
|
+
constructor({ container, viewer, thumbs, store = create(), options, onError, }) {
|
|
2384
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2385
2385
|
_PDFSlick_instances.add(this);
|
|
2386
|
-
_PDFSlick_renderingQueue.set(this,
|
|
2387
|
-
_PDFSlick_container.set(this,
|
|
2388
|
-
_PDFSlick_viewerContainer.set(this,
|
|
2389
|
-
_PDFSlick_thumbsContainer.set(this,
|
|
2386
|
+
_PDFSlick_renderingQueue.set(this, undefined);
|
|
2387
|
+
_PDFSlick_container.set(this, undefined);
|
|
2388
|
+
_PDFSlick_viewerContainer.set(this, undefined);
|
|
2389
|
+
_PDFSlick_thumbsContainer.set(this, undefined);
|
|
2390
2390
|
this.downloadManager = null;
|
|
2391
2391
|
this.findController = null;
|
|
2392
2392
|
this.pdfPresentationMode = null;
|
|
2393
2393
|
this.document = null;
|
|
2394
2394
|
// options
|
|
2395
|
-
_PDFSlick_annotationMode.set(this,
|
|
2396
|
-
_PDFSlick_annotationEditorMode.set(this,
|
|
2397
|
-
_PDFSlick_onError.set(this,
|
|
2395
|
+
_PDFSlick_annotationMode.set(this, undefined);
|
|
2396
|
+
_PDFSlick_annotationEditorMode.set(this, undefined);
|
|
2397
|
+
_PDFSlick_onError.set(this, undefined);
|
|
2398
2398
|
__classPrivateFieldSet(this, _PDFSlick_container, container, "f");
|
|
2399
2399
|
__classPrivateFieldSet(this, _PDFSlick_viewerContainer, viewer, "f");
|
|
2400
2400
|
__classPrivateFieldSet(this, _PDFSlick_thumbsContainer, thumbs, "f");
|
|
2401
2401
|
__classPrivateFieldSet(this, _PDFSlick_onError, onError, "f");
|
|
2402
|
-
this.l10n = (_a = options === null || options ===
|
|
2402
|
+
this.l10n = (_a = options === null || options === undefined ? undefined : options.l10n) !== null && _a !== undefined ? _a : new GenericL10n(navigator.language);
|
|
2403
2403
|
this.downloadManager = new DownloadManager();
|
|
2404
|
-
this.textLayerMode = (_b = options === null || options ===
|
|
2405
|
-
__classPrivateFieldSet(this, _PDFSlick_annotationMode, (_c = options === null || options ===
|
|
2406
|
-
__classPrivateFieldSet(this, _PDFSlick_annotationEditorMode, (_d = options === null || options ===
|
|
2407
|
-
this.annotationEditorHighlightColors = (_e = options === null || options ===
|
|
2408
|
-
this.removePageBorders = (_f = options === null || options ===
|
|
2409
|
-
this.singlePageViewer = (_g = options === null || options ===
|
|
2410
|
-
this.enablePrintAutoRotate = (_h = options === null || options ===
|
|
2411
|
-
this.useOnlyCssZoom = (_j = options === null || options ===
|
|
2412
|
-
this.pageColors = (_k = options === null || options ===
|
|
2413
|
-
this.maxCanvasPixels = (_l = options === null || options ===
|
|
2414
|
-
this.printResolution = (_m = options === null || options ===
|
|
2415
|
-
this.thumbnailWidth = (_o = options === null || options ===
|
|
2404
|
+
this.textLayerMode = (_b = options === null || options === undefined ? undefined : options.textLayerMode) !== null && _b !== undefined ? _b : TextLayerMode.ENABLE;
|
|
2405
|
+
__classPrivateFieldSet(this, _PDFSlick_annotationMode, (_c = options === null || options === undefined ? undefined : options.annotationMode) !== null && _c !== undefined ? _c : AnnotationMode.ENABLE_FORMS, "f");
|
|
2406
|
+
__classPrivateFieldSet(this, _PDFSlick_annotationEditorMode, (_d = options === null || options === undefined ? undefined : options.annotationEditorMode) !== null && _d !== undefined ? _d : AnnotationEditorType.NONE, "f");
|
|
2407
|
+
this.annotationEditorHighlightColors = (_e = options === null || options === undefined ? undefined : options.annotationEditorHighlightColors) !== null && _e !== undefined ? _e : "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F";
|
|
2408
|
+
this.removePageBorders = (_f = options === null || options === undefined ? undefined : options.removePageBorders) !== null && _f !== undefined ? _f : false;
|
|
2409
|
+
this.singlePageViewer = (_g = options === null || options === undefined ? undefined : options.singlePageViewer) !== null && _g !== undefined ? _g : false;
|
|
2410
|
+
this.enablePrintAutoRotate = (_h = options === null || options === undefined ? undefined : options.enablePrintAutoRotate) !== null && _h !== undefined ? _h : false;
|
|
2411
|
+
this.useOnlyCssZoom = (_j = options === null || options === undefined ? undefined : options.useOnlyCssZoom) !== null && _j !== undefined ? _j : false;
|
|
2412
|
+
this.pageColors = (_k = options === null || options === undefined ? undefined : options.pageColors) !== null && _k !== undefined ? _k : null;
|
|
2413
|
+
this.maxCanvasPixels = (_l = options === null || options === undefined ? undefined : options.maxCanvasPixels) !== null && _l !== undefined ? _l : 16777216;
|
|
2414
|
+
this.printResolution = (_m = options === null || options === undefined ? undefined : options.printResolution) !== null && _m !== undefined ? _m : 96;
|
|
2415
|
+
this.thumbnailWidth = (_o = options === null || options === undefined ? undefined : options.thumbnailWidth) !== null && _o !== undefined ? _o : 125;
|
|
2416
|
+
this.getDocumentParams = (_p = options === null || options === undefined ? undefined : options.getDocumentParams) !== null && _p !== undefined ? _p : {};
|
|
2416
2417
|
if (this.pageColors &&
|
|
2417
2418
|
!(CSS.supports("color", this.pageColors.background) &&
|
|
2418
2419
|
CSS.supports("color", this.pageColors.foreground))) {
|
|
@@ -2464,12 +2465,12 @@ class PDFSlick {
|
|
|
2464
2465
|
this.linkService = linkService;
|
|
2465
2466
|
this.viewer = pdfViewer;
|
|
2466
2467
|
this.linkService.setViewer(pdfViewer);
|
|
2467
|
-
const scaleValue = (
|
|
2468
|
+
const scaleValue = (_q = options === null || options === undefined ? undefined : options.scaleValue) !== null && _q !== undefined ? _q : "auto";
|
|
2468
2469
|
this.store.setState({ scaleValue });
|
|
2469
2470
|
}
|
|
2470
2471
|
loadDocument(url, options) {
|
|
2471
2472
|
var _a, _b, _c, _d, _e;
|
|
2472
|
-
return __awaiter(this,
|
|
2473
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2473
2474
|
if (this.url && typeof this.url === "string") {
|
|
2474
2475
|
try {
|
|
2475
2476
|
URL.revokeObjectURL(this.url);
|
|
@@ -2490,10 +2491,11 @@ class PDFSlick {
|
|
|
2490
2491
|
}
|
|
2491
2492
|
const filename = (_c = options === null || options === void 0 ? void 0 : options.filename) !== null && _c !== void 0 ? _c : getPdfFilenameFromUrl((_d = this.url) === null || _d === void 0 ? void 0 : _d.toString());
|
|
2492
2493
|
this.filename = filename;
|
|
2493
|
-
const
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
}
|
|
2494
|
+
const pdfDocumentLoader = getDocument(Object.assign(Object.assign({}, this.getDocumentParams), { url: this.url, isEvalSupported: false }));
|
|
2495
|
+
if (!!(options === null || options === void 0 ? void 0 : options.onProgress)) {
|
|
2496
|
+
pdfDocumentLoader.onProgress = options.onProgress;
|
|
2497
|
+
}
|
|
2498
|
+
const pdfDocument = yield pdfDocumentLoader.promise;
|
|
2497
2499
|
this.document = pdfDocument;
|
|
2498
2500
|
this.viewer.setDocument(this.document);
|
|
2499
2501
|
this.linkService.setDocument(this.document);
|
|
@@ -2535,11 +2537,11 @@ class PDFSlick {
|
|
|
2535
2537
|
}
|
|
2536
2538
|
openOrDownloadData(data, filename) {
|
|
2537
2539
|
var _a;
|
|
2538
|
-
(_a = this.downloadManager) === null || _a ===
|
|
2540
|
+
(_a = this.downloadManager) === null || _a === undefined ? undefined : _a.openOrDownloadData(data, filename);
|
|
2539
2541
|
}
|
|
2540
2542
|
download() {
|
|
2541
2543
|
var _a, _b;
|
|
2542
|
-
return __awaiter(this,
|
|
2544
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2543
2545
|
const url = this.url;
|
|
2544
2546
|
const { filename } = this;
|
|
2545
2547
|
try {
|
|
@@ -2551,13 +2553,13 @@ class PDFSlick {
|
|
|
2551
2553
|
catch (reason) {
|
|
2552
2554
|
// When the PDF document isn't ready, or the PDF file is still
|
|
2553
2555
|
// downloading, simply download using the URL.
|
|
2554
|
-
yield ((_b = this.downloadManager) === null || _b ===
|
|
2556
|
+
yield ((_b = this.downloadManager) === null || _b === undefined ? undefined : _b.download(null, url, filename));
|
|
2555
2557
|
}
|
|
2556
2558
|
});
|
|
2557
2559
|
}
|
|
2558
2560
|
save() {
|
|
2559
2561
|
var _a;
|
|
2560
|
-
return __awaiter(this,
|
|
2562
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2561
2563
|
// if (this._saveInProgress) return;
|
|
2562
2564
|
// this._saveInProgress = true;
|
|
2563
2565
|
// await this.pdfScriptingManager.dispatchWillSave();
|
|
@@ -2583,7 +2585,7 @@ class PDFSlick {
|
|
|
2583
2585
|
}
|
|
2584
2586
|
downloadOrSave() {
|
|
2585
2587
|
var _a;
|
|
2586
|
-
const { annotationStorage } = (_a = this.document) !== null && _a !==
|
|
2588
|
+
const { annotationStorage } = (_a = this.document) !== null && _a !== undefined ? _a : {};
|
|
2587
2589
|
if (annotationStorage && annotationStorage.size > 0) {
|
|
2588
2590
|
this.save();
|
|
2589
2591
|
}
|
|
@@ -2653,7 +2655,7 @@ class PDFSlick {
|
|
|
2653
2655
|
if (this.printService) {
|
|
2654
2656
|
this.printService.destroy();
|
|
2655
2657
|
this.printService = null;
|
|
2656
|
-
(_a = this.document) === null || _a ===
|
|
2658
|
+
(_a = this.document) === null || _a === undefined ? undefined : _a.annotationStorage.resetModified();
|
|
2657
2659
|
}
|
|
2658
2660
|
this.forceRendering();
|
|
2659
2661
|
// Re-enable the editor-indicator after printing (fixes bug 1790552).
|
|
@@ -2661,7 +2663,7 @@ class PDFSlick {
|
|
|
2661
2663
|
}
|
|
2662
2664
|
requestPresentationMode() {
|
|
2663
2665
|
var _a;
|
|
2664
|
-
(_a = this.pdfPresentationMode) === null || _a ===
|
|
2666
|
+
(_a = this.pdfPresentationMode) === null || _a === undefined ? undefined : _a.request();
|
|
2665
2667
|
}
|
|
2666
2668
|
triggerPrinting() {
|
|
2667
2669
|
if (!this.supportsPrinting) {
|
|
@@ -2796,9 +2798,9 @@ class PDFSlick {
|
|
|
2796
2798
|
}
|
|
2797
2799
|
_PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _PDFSlick_viewerContainer = new WeakMap(), _PDFSlick_thumbsContainer = new WeakMap(), _PDFSlick_annotationMode = new WeakMap(), _PDFSlick_annotationEditorMode = new WeakMap(), _PDFSlick_onError = new WeakMap(), _PDFSlick_instances = new WeakSet(), _PDFSlick_initializePageLabels = function _PDFSlick_initializePageLabels() {
|
|
2798
2800
|
var _a;
|
|
2799
|
-
return __awaiter(this,
|
|
2801
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2800
2802
|
const pdfDocument = this.document;
|
|
2801
|
-
const labels = (_a = (yield pdfDocument.getPageLabels())) !== null && _a !==
|
|
2803
|
+
const labels = (_a = (yield pdfDocument.getPageLabels())) !== null && _a !== undefined ? _a : [];
|
|
2802
2804
|
const numLabels = labels.length;
|
|
2803
2805
|
// Ignore page labels that correspond to standard page numbering,
|
|
2804
2806
|
// or page labels that are all empty.
|
|
@@ -2820,10 +2822,10 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2820
2822
|
}
|
|
2821
2823
|
const { viewer: pdfViewer, thumbnailViewer: pdfThumbnailViewer } = this;
|
|
2822
2824
|
pdfViewer.setPageLabels(labels);
|
|
2823
|
-
pdfThumbnailViewer === null || pdfThumbnailViewer ===
|
|
2825
|
+
pdfThumbnailViewer === null || pdfThumbnailViewer === undefined ? undefined : pdfThumbnailViewer.setPageLabels(labels);
|
|
2824
2826
|
});
|
|
2825
2827
|
}, _PDFSlick_parseDocumentInfo = function _PDFSlick_parseDocumentInfo() {
|
|
2826
|
-
return __awaiter(this,
|
|
2828
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2827
2829
|
const { info, contentLength } = (yield this.document.getMetadata());
|
|
2828
2830
|
const pageSize = yield this.document.getPage(this.store.getState().pageNumber).then((pdfPage) => {
|
|
2829
2831
|
return __classPrivateFieldGet(this, _PDFSlick_instances, "m", _PDFSlick_parsePageSize).call(this, getPageSizeInches(pdfPage), 0);
|
|
@@ -2844,7 +2846,7 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2844
2846
|
});
|
|
2845
2847
|
});
|
|
2846
2848
|
}, _PDFSlick_parsePageSize = function _PDFSlick_parsePageSize(pageSizeInches, pagesRotation) {
|
|
2847
|
-
return __awaiter(this,
|
|
2849
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2848
2850
|
if (!pageSizeInches) {
|
|
2849
2851
|
return undefined;
|
|
2850
2852
|
}
|
|
@@ -2929,8 +2931,8 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2929
2931
|
};
|
|
2930
2932
|
}, _PDFSlick_onDocumentReady = function _PDFSlick_onDocumentReady({ source }) {
|
|
2931
2933
|
var _a;
|
|
2932
|
-
return __awaiter(this,
|
|
2933
|
-
const documentOutline = (yield ((_a = this.document) === null || _a ===
|
|
2934
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
2935
|
+
const documentOutline = (yield ((_a = this.document) === null || _a === undefined ? undefined : _a.getOutline()));
|
|
2934
2936
|
const scaleValue = this.store.getState().scaleValue;
|
|
2935
2937
|
// source._setScale(scaleValue, {}); // page-fit, page-actual, auto, page-width
|
|
2936
2938
|
source.currentScale = 1;
|
|
@@ -2959,14 +2961,14 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2959
2961
|
this.viewer.update();
|
|
2960
2962
|
}, _PDFSlick_onPageChanging = function _PDFSlick_onPageChanging({ pageNumber }) {
|
|
2961
2963
|
var _a;
|
|
2962
|
-
(_a = this.thumbnailViewer) === null || _a ===
|
|
2964
|
+
(_a = this.thumbnailViewer) === null || _a === undefined ? undefined : _a.scrollThumbnailIntoView(pageNumber);
|
|
2963
2965
|
this.store.setState({ pageNumber });
|
|
2964
2966
|
}, _PDFSlick_onPageRendered = function _PDFSlick_onPageRendered({ pageNumber, error }) {
|
|
2965
2967
|
var _a;
|
|
2966
2968
|
// Use the rendered page to set the corresponding thumbnail image.
|
|
2967
2969
|
if (__classPrivateFieldGet(this, _PDFSlick_thumbsContainer, "f")) {
|
|
2968
2970
|
const pageView = this.viewer.getPageView(pageNumber - 1);
|
|
2969
|
-
const thumbnailView = (_a = this.thumbnailViewer) === null || _a ===
|
|
2971
|
+
const thumbnailView = (_a = this.thumbnailViewer) === null || _a === undefined ? undefined : _a.getThumbnail(pageNumber - 1);
|
|
2970
2972
|
if (pageView && thumbnailView) {
|
|
2971
2973
|
thumbnailView.setImage(pageView);
|
|
2972
2974
|
}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type OnProgressParameters } from "pdfjs-dist";
|
|
1
2
|
import { PDFViewer } from "pdfjs-dist/web/pdf_viewer.mjs";
|
|
2
3
|
import { StoreApi } from "zustand";
|
|
3
4
|
import { PDFSlick, type PDFException } from "./PDFSlick";
|
|
4
5
|
import { PDFThumbnailView } from "./lib";
|
|
6
|
+
import type { DocumentInitParameters } from "pdfjs-dist/types/src/display/api";
|
|
5
7
|
export type TPDFDocumentOutline = {
|
|
6
8
|
title: string;
|
|
7
9
|
bold: boolean;
|
|
@@ -96,6 +98,8 @@ export type PDFSlickOptions = {
|
|
|
96
98
|
thumbnailWidth?: number;
|
|
97
99
|
scaleValue?: string;
|
|
98
100
|
filename?: string;
|
|
101
|
+
getDocumentParams?: DocumentInitParameters;
|
|
102
|
+
onProgress?: (opts: OnProgressParameters) => void;
|
|
99
103
|
};
|
|
100
104
|
export type PDFSlickInputArgs = {
|
|
101
105
|
container: HTMLDivElement;
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,iBAAiB,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SA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,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,KAAK,IAAI,CAAC;AAE1E,MAAM,MAAM,WAAW,GAAG,CACxB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,gBAAgB,KACtB,IAAI,CAAC"}
|
package/dist/pdf_viewer.css
CHANGED
|
@@ -1829,7 +1829,6 @@
|
|
|
1829
1829
|
|
|
1830
1830
|
.annotationEditorLayer.inkEditing{
|
|
1831
1831
|
cursor:var(--editorInk-editing-cursor);
|
|
1832
|
-
touch-action:none;
|
|
1833
1832
|
}
|
|
1834
1833
|
|
|
1835
1834
|
.annotationEditorLayer .draw{
|
|
@@ -3150,21 +3149,16 @@
|
|
|
3150
3149
|
}
|
|
3151
3150
|
|
|
3152
3151
|
:is(.pdfViewer .canvasWrapper) canvas{
|
|
3152
|
+
position:absolute;
|
|
3153
|
+
top:0;
|
|
3154
|
+
left:0;
|
|
3153
3155
|
margin:0;
|
|
3154
3156
|
display:block;
|
|
3155
3157
|
width:100%;
|
|
3156
3158
|
height:100%;
|
|
3159
|
+
contain:content;
|
|
3157
3160
|
}
|
|
3158
3161
|
|
|
3159
|
-
[hidden]:is(:is(.pdfViewer .canvasWrapper) canvas){
|
|
3160
|
-
display:none;
|
|
3161
|
-
}
|
|
3162
|
-
|
|
3163
|
-
[zooming]:is(:is(.pdfViewer .canvasWrapper) canvas){
|
|
3164
|
-
width:100%;
|
|
3165
|
-
height:100%;
|
|
3166
|
-
}
|
|
3167
|
-
|
|
3168
3162
|
:is(:is(.pdfViewer .canvasWrapper) canvas) .structTree{
|
|
3169
3163
|
contain:strict;
|
|
3170
3164
|
}
|