@pdfslick/core 2.1.4-next.0 → 2.3.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.map +1 -1
- package/dist/esm/index.js +81 -78
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +7 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PDFSlick.d.ts","sourceRoot":"","sources":["../PDFSlick.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EAMzB,gBAAgB,EAEhB,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,EAElB,mBAAmB,EACtB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAa3C,MAAM,MAAM,YAAY,GAClB,cAAc,GACd,mBAAmB,GACnB,mBAAmB,GACnB,2BAA2B,GAC3B,2BAA2B,CAAC;AA2BlC,qBAAa,QAAQ;;IAOjB,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,E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YAAY,CAAC,GAAG,EAAE,MAAM,EAE3B;IAED,WAAW,CAAC,EAAE,EAAE,MAAM,GACoB,WAAW;IAGrD;;;;;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,5 +1,5 @@
|
|
|
1
1
|
import { RenderingCancelledException, PixelsPerInch, getXfaPageViewport, AnnotationMode, AnnotationEditorType, GlobalWorkerOptions, AnnotationEditorParamsType, getPdfFilenameFromUrl, getDocument, PDFDateString } from 'pdfjs-dist';
|
|
2
|
-
import { SimpleLinkService, XfaLayerBuilder, GenericL10n, DownloadManager, EventBus, PDFLinkService, PDFSinglePageViewer, PDFViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
|
|
2
|
+
import { SimpleLinkService, XfaLayerBuilder, GenericL10n, DownloadManager, EventBus, PDFLinkService, PDFFindController, PDFSinglePageViewer, PDFViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
|
|
3
3
|
import { createStore } from 'zustand/vanilla';
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
@@ -226,7 +226,7 @@ function watchScroll(viewAreaElement, callback, abortSignal = undefined) {
|
|
|
226
226
|
useCapture: true,
|
|
227
227
|
signal: abortSignal,
|
|
228
228
|
});
|
|
229
|
-
abortSignal === null || abortSignal ===
|
|
229
|
+
abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", () => window.cancelAnimationFrame(rAF), { once: true });
|
|
230
230
|
return state;
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
@@ -622,10 +622,10 @@ function clamp(v, min, max) {
|
|
|
622
622
|
}
|
|
623
623
|
class ProgressBar {
|
|
624
624
|
constructor(bar) {
|
|
625
|
-
_ProgressBar_classList.set(this,
|
|
625
|
+
_ProgressBar_classList.set(this, void 0);
|
|
626
626
|
_ProgressBar_disableAutoFetchTimeout.set(this, null);
|
|
627
627
|
_ProgressBar_percent.set(this, 0);
|
|
628
|
-
_ProgressBar_style.set(this,
|
|
628
|
+
_ProgressBar_style.set(this, void 0);
|
|
629
629
|
_ProgressBar_visible.set(this, true);
|
|
630
630
|
__classPrivateFieldSet(this, _ProgressBar_classList, bar.classList, "f");
|
|
631
631
|
__classPrivateFieldSet(this, _ProgressBar_style, bar.style, "f");
|
|
@@ -692,7 +692,7 @@ _ProgressBar_classList = new WeakMap(), _ProgressBar_disableAutoFetchTimeout = n
|
|
|
692
692
|
function getActiveOrFocusedElement() {
|
|
693
693
|
let curRoot = document;
|
|
694
694
|
let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
|
|
695
|
-
while (curActiveOrFocused === null || curActiveOrFocused ===
|
|
695
|
+
while (curActiveOrFocused === null || curActiveOrFocused === void 0 ? void 0 : curActiveOrFocused.shadowRoot) {
|
|
696
696
|
curRoot = curActiveOrFocused.shadowRoot;
|
|
697
697
|
curActiveOrFocused =
|
|
698
698
|
curRoot.activeElement || curRoot.querySelector(":focus");
|
|
@@ -753,12 +753,12 @@ function apiPageModeToSidebarView(mode) {
|
|
|
753
753
|
function toggleCheckedBtn(button, toggle, view = null) {
|
|
754
754
|
button.classList.toggle("toggled", toggle);
|
|
755
755
|
button.setAttribute("aria-checked", String(toggle));
|
|
756
|
-
view === null || view ===
|
|
756
|
+
view === null || view === void 0 ? void 0 : view.classList.toggle("hidden", !toggle);
|
|
757
757
|
}
|
|
758
758
|
function toggleExpandedBtn(button, toggle, view = null) {
|
|
759
759
|
button.classList.toggle("toggled", toggle);
|
|
760
760
|
button.setAttribute("aria-expanded", String(toggle));
|
|
761
|
-
view === null || view ===
|
|
761
|
+
view === null || view === void 0 ? void 0 : view.classList.toggle("hidden", !toggle);
|
|
762
762
|
}
|
|
763
763
|
// In Firefox, the css calc function uses f32 precision but the Chrome or Safari
|
|
764
764
|
// are using f64 one. So in order to have the same rendering in all browsers, we
|
|
@@ -841,7 +841,7 @@ class PDFRenderingQueue {
|
|
|
841
841
|
}
|
|
842
842
|
// No pages needed rendering, so check thumbnails.
|
|
843
843
|
if (this.isThumbnailViewEnabled &&
|
|
844
|
-
((_a = this.pdfThumbnailViewer) === null || _a ===
|
|
844
|
+
((_a = this.pdfThumbnailViewer) === null || _a === void 0 ? void 0 : _a.forceRendering())) {
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
847
|
if (this.printing) {
|
|
@@ -1120,7 +1120,7 @@ class PDFThumbnailView {
|
|
|
1120
1120
|
this.resume = null;
|
|
1121
1121
|
}
|
|
1122
1122
|
draw() {
|
|
1123
|
-
return __awaiter(this,
|
|
1123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1124
1124
|
if (this.renderingState !== RenderingStates.INITIAL) {
|
|
1125
1125
|
console.error("Must be in new state before drawing");
|
|
1126
1126
|
return undefined;
|
|
@@ -1256,7 +1256,7 @@ _PDFThumbnailView_instances = new WeakSet(), _PDFThumbnailView_updateDims = func
|
|
|
1256
1256
|
reducedCanvas.width = 0;
|
|
1257
1257
|
reducedCanvas.height = 0;
|
|
1258
1258
|
}, _PDFThumbnailView_finishRenderTask = function _PDFThumbnailView_finishRenderTask(renderTask_1, canvas_1) {
|
|
1259
|
-
return __awaiter(this, arguments,
|
|
1259
|
+
return __awaiter(this, arguments, void 0, function* (renderTask, canvas, error = null) {
|
|
1260
1260
|
// The renderTask may have been replaced by a new one, so only remove
|
|
1261
1261
|
// the reference to the renderTask if it matches the one that is
|
|
1262
1262
|
// triggering this callback.
|
|
@@ -1443,7 +1443,7 @@ class PDFThumbnailViewer {
|
|
|
1443
1443
|
// Set the first `pdfPage` immediately, since it's already loaded,
|
|
1444
1444
|
// rather than having to repeat the `PDFDocumentProxy.getPage` call in
|
|
1445
1445
|
// the `this.#ensurePdfPageLoaded` method before rendering can start.
|
|
1446
|
-
(_a = this._thumbnails[0]) === null || _a ===
|
|
1446
|
+
(_a = this._thumbnails[0]) === null || _a === void 0 ? void 0 : _a.setPdfPage(firstPdfPage);
|
|
1447
1447
|
// Ensure that the current thumbnail is always highlighted on load.
|
|
1448
1448
|
const thumbnailView = this._thumbnails[this._currentPageNumber - 1];
|
|
1449
1449
|
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
|
|
@@ -1475,7 +1475,7 @@ class PDFThumbnailViewer {
|
|
|
1475
1475
|
}
|
|
1476
1476
|
// Update all the `PDFThumbnailView` instances.
|
|
1477
1477
|
for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
|
|
1478
|
-
this._thumbnails[i].setPageLabel((_b = (_a = this._pageLabels) === null || _a ===
|
|
1478
|
+
this._thumbnails[i].setPageLabel((_b = (_a = this._pageLabels) === null || _a === void 0 ? void 0 : _a[i]) !== null && _b !== void 0 ? _b : null);
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
1481
|
forceRendering() {
|
|
@@ -1510,7 +1510,7 @@ _PDFThumbnailViewer_instances = new WeakSet(), _PDFThumbnailViewer_scrollUpdated
|
|
|
1510
1510
|
thumbnail.cancelRendering();
|
|
1511
1511
|
}
|
|
1512
1512
|
}, _PDFThumbnailViewer_ensurePdfPageLoaded = function _PDFThumbnailViewer_ensurePdfPageLoaded(thumbView) {
|
|
1513
|
-
return __awaiter(this,
|
|
1513
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1514
1514
|
if (thumbView.pdfPage) {
|
|
1515
1515
|
return thumbView.pdfPage;
|
|
1516
1516
|
}
|
|
@@ -1528,10 +1528,10 @@ _PDFThumbnailViewer_instances = new WeakSet(), _PDFThumbnailViewer_scrollUpdated
|
|
|
1528
1528
|
});
|
|
1529
1529
|
}, _PDFThumbnailViewer_getScrollAhead = function _PDFThumbnailViewer_getScrollAhead(visible) {
|
|
1530
1530
|
var _a, _b;
|
|
1531
|
-
if (((_a = visible.first) === null || _a ===
|
|
1531
|
+
if (((_a = visible.first) === null || _a === void 0 ? void 0 : _a.id) === 1) {
|
|
1532
1532
|
return true;
|
|
1533
1533
|
}
|
|
1534
|
-
else if (((_b = visible.last) === null || _b ===
|
|
1534
|
+
else if (((_b = visible.last) === null || _b === void 0 ? void 0 : _b.id) === this._thumbnails.length) {
|
|
1535
1535
|
return false;
|
|
1536
1536
|
}
|
|
1537
1537
|
return this.scroll.down;
|
|
@@ -1558,7 +1558,7 @@ function getXfaHtmlForPrinting(printContainer, pdfDocument) {
|
|
|
1558
1558
|
const xfaHtml = pdfDocument.allXfaHtml;
|
|
1559
1559
|
const linkService = new SimpleLinkService();
|
|
1560
1560
|
const scale = Math.round(PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100;
|
|
1561
|
-
for (const xfaPage of xfaHtml === null || xfaHtml ===
|
|
1561
|
+
for (const xfaPage of xfaHtml === null || xfaHtml === void 0 ? void 0 : xfaHtml.children) {
|
|
1562
1562
|
const page = document.createElement("div");
|
|
1563
1563
|
page.className = "xfaPrintedPage";
|
|
1564
1564
|
printContainer.append(page);
|
|
@@ -1804,7 +1804,7 @@ class PDFPresentationMode {
|
|
|
1804
1804
|
* @returns {Promise<boolean>} Indicating if the request was successful.
|
|
1805
1805
|
*/
|
|
1806
1806
|
request() {
|
|
1807
|
-
return __awaiter(this,
|
|
1807
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1808
1808
|
const { container, pdfViewer } = this;
|
|
1809
1809
|
if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) {
|
|
1810
1810
|
return false;
|
|
@@ -1902,7 +1902,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
1902
1902
|
// Text selection is disabled in Presentation Mode, thus it's not possible
|
|
1903
1903
|
// for the user to deselect text that is selected (e.g. with "Select all")
|
|
1904
1904
|
// when entering Presentation Mode, hence we remove any active selection.
|
|
1905
|
-
(_a = document.getSelection()) === null || _a ===
|
|
1905
|
+
(_a = document.getSelection()) === null || _a === void 0 ? void 0 : _a.empty();
|
|
1906
1906
|
}, _PDFPresentationMode_exit = function _PDFPresentationMode_exit() {
|
|
1907
1907
|
const pageNumber = this.pdfViewer.currentPageNumber;
|
|
1908
1908
|
this.container.classList.remove(ACTIVE_SELECTOR);
|
|
@@ -1941,7 +1941,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
1941
1941
|
// Enable clicking of links in presentation mode. Note: only links
|
|
1942
1942
|
// pointing to destinations in the current PDF document work.
|
|
1943
1943
|
if (evt.target.href &&
|
|
1944
|
-
((_a = evt.target.parentNode) === null || _a ===
|
|
1944
|
+
((_a = evt.target.parentNode) === null || _a === void 0 ? void 0 : _a.hasAttribute("data-internal-link"))) {
|
|
1945
1945
|
return;
|
|
1946
1946
|
}
|
|
1947
1947
|
// Unless an internal link was clicked, advance one page.
|
|
@@ -2058,7 +2058,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
2058
2058
|
window.addEventListener("touchend", touchSwipeBind, { signal });
|
|
2059
2059
|
}, _PDFPresentationMode_removeWindowListeners = function _PDFPresentationMode_removeWindowListeners() {
|
|
2060
2060
|
var _a;
|
|
2061
|
-
(_a = __classPrivateFieldGet(this, _PDFPresentationMode_windowAbortController, "f")) === null || _a ===
|
|
2061
|
+
(_a = __classPrivateFieldGet(this, _PDFPresentationMode_windowAbortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
|
2062
2062
|
__classPrivateFieldSet(this, _PDFPresentationMode_windowAbortController, null, "f");
|
|
2063
2063
|
}, _PDFPresentationMode_addFullscreenChangeListeners = function _PDFPresentationMode_addFullscreenChangeListeners() {
|
|
2064
2064
|
if (__classPrivateFieldGet(this, _PDFPresentationMode_fullscreenChangeAbortController, "f")) {
|
|
@@ -2075,7 +2075,7 @@ _PDFPresentationMode_state = new WeakMap(), _PDFPresentationMode_args = new Weak
|
|
|
2075
2075
|
}, { signal: __classPrivateFieldGet(this, _PDFPresentationMode_fullscreenChangeAbortController, "f").signal });
|
|
2076
2076
|
}, _PDFPresentationMode_removeFullscreenChangeListeners = function _PDFPresentationMode_removeFullscreenChangeListeners() {
|
|
2077
2077
|
var _a;
|
|
2078
|
-
(_a = __classPrivateFieldGet(this, _PDFPresentationMode_fullscreenChangeAbortController, "f")) === null || _a ===
|
|
2078
|
+
(_a = __classPrivateFieldGet(this, _PDFPresentationMode_fullscreenChangeAbortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
|
2079
2079
|
__classPrivateFieldSet(this, _PDFPresentationMode_fullscreenChangeAbortController, null, "f");
|
|
2080
2080
|
};
|
|
2081
2081
|
|
|
@@ -2143,7 +2143,7 @@ class PDFSlickPrintService {
|
|
|
2143
2143
|
_PDFSlickPrintService_printContainer.set(this, null);
|
|
2144
2144
|
this.eventBus = eventBus;
|
|
2145
2145
|
this.slick = slick;
|
|
2146
|
-
this.printDialog = printDialog !== null && printDialog !==
|
|
2146
|
+
this.printDialog = printDialog !== null && printDialog !== void 0 ? printDialog : null;
|
|
2147
2147
|
this.bindEvents();
|
|
2148
2148
|
}
|
|
2149
2149
|
get supportsPrinting() {
|
|
@@ -2153,7 +2153,7 @@ class PDFSlickPrintService {
|
|
|
2153
2153
|
return !!__classPrivateFieldGet(this, _PDFSlickPrintService_printService, "f");
|
|
2154
2154
|
}
|
|
2155
2155
|
print() {
|
|
2156
|
-
return __awaiter(this,
|
|
2156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2157
2157
|
var _a, _b;
|
|
2158
2158
|
if (!this.supportsPrinting) {
|
|
2159
2159
|
return;
|
|
@@ -2162,7 +2162,7 @@ class PDFSlickPrintService {
|
|
|
2162
2162
|
console.warn("Ignored pdf print because of a pending print job.");
|
|
2163
2163
|
return;
|
|
2164
2164
|
}
|
|
2165
|
-
yield ((_a = this.printDialog) === null || _a ===
|
|
2165
|
+
yield ((_a = this.printDialog) === null || _a === void 0 ? void 0 : _a.open({
|
|
2166
2166
|
close: () => this.abort()
|
|
2167
2167
|
}));
|
|
2168
2168
|
try {
|
|
@@ -2171,12 +2171,12 @@ class PDFSlickPrintService {
|
|
|
2171
2171
|
finally {
|
|
2172
2172
|
if (!this.printing) {
|
|
2173
2173
|
console.error("Expected print service to be initialized.");
|
|
2174
|
-
(_b = this.printDialog) === null || _b ===
|
|
2174
|
+
(_b = this.printDialog) === null || _b === void 0 ? void 0 : _b.close();
|
|
2175
2175
|
}
|
|
2176
2176
|
else {
|
|
2177
2177
|
const printService = __classPrivateFieldGet(this, _PDFSlickPrintService_printService, "f");
|
|
2178
2178
|
yield printService
|
|
2179
|
-
.renderPages(x => { var _a; return (_a = this.printDialog) === null || _a ===
|
|
2179
|
+
.renderPages(x => { var _a; return (_a = this.printDialog) === null || _a === void 0 ? void 0 : _a.progress(x); })
|
|
2180
2180
|
.then(() => printService.performPrint())
|
|
2181
2181
|
.catch(() => {
|
|
2182
2182
|
// Ignore any error messages.
|
|
@@ -2200,7 +2200,7 @@ class PDFSlickPrintService {
|
|
|
2200
2200
|
var _a;
|
|
2201
2201
|
if (__classPrivateFieldGet(this, _PDFSlickPrintService_printService, "f")) {
|
|
2202
2202
|
__classPrivateFieldGet(this, _PDFSlickPrintService_printService, "f").destroy();
|
|
2203
|
-
(_a = this.printDialog) === null || _a ===
|
|
2203
|
+
(_a = this.printDialog) === null || _a === void 0 ? void 0 : _a.close();
|
|
2204
2204
|
this.eventBus.dispatch("afterprint", { source: this });
|
|
2205
2205
|
}
|
|
2206
2206
|
}
|
|
@@ -2227,7 +2227,7 @@ class PDFSlickPrintService {
|
|
|
2227
2227
|
}
|
|
2228
2228
|
unbindEvents() {
|
|
2229
2229
|
var _a;
|
|
2230
|
-
(_a = __classPrivateFieldGet(this, _PDFSlickPrintService_eventAbortController, "f")) === null || _a ===
|
|
2230
|
+
(_a = __classPrivateFieldGet(this, _PDFSlickPrintService_eventAbortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
|
2231
2231
|
__classPrivateFieldSet(this, _PDFSlickPrintService_eventAbortController, null, "f");
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
@@ -2269,10 +2269,10 @@ _PDFSlickPrintService_printService = new WeakMap(), _PDFSlickPrintService_eventA
|
|
|
2269
2269
|
if (__classPrivateFieldGet(this, _PDFSlickPrintService_printService, "f")) {
|
|
2270
2270
|
__classPrivateFieldGet(this, _PDFSlickPrintService_printService, "f").destroy();
|
|
2271
2271
|
__classPrivateFieldSet(this, _PDFSlickPrintService_printService, null, "f");
|
|
2272
|
-
(_a = this.printDialog) === null || _a ===
|
|
2273
|
-
(_b = __classPrivateFieldGet(this, _PDFSlickPrintService_printContainer, "f")) === null || _b ===
|
|
2272
|
+
(_a = this.printDialog) === null || _a === void 0 ? void 0 : _a.close();
|
|
2273
|
+
(_b = __classPrivateFieldGet(this, _PDFSlickPrintService_printContainer, "f")) === null || _b === void 0 ? void 0 : _b.remove();
|
|
2274
2274
|
__classPrivateFieldSet(this, _PDFSlickPrintService_printContainer, null, "f");
|
|
2275
|
-
(_c = this.slick.document) === null || _c ===
|
|
2275
|
+
(_c = this.slick.document) === null || _c === void 0 ? void 0 : _c.annotationStorage.resetModified();
|
|
2276
2276
|
}
|
|
2277
2277
|
this.slick.forceRendering();
|
|
2278
2278
|
};
|
|
@@ -2388,19 +2388,19 @@ class PDFSlickPrintDialog {
|
|
|
2388
2388
|
this.dialog = dialog;
|
|
2389
2389
|
}
|
|
2390
2390
|
open(options) {
|
|
2391
|
-
return __awaiter(this,
|
|
2391
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2392
2392
|
const btnClose = this.dialog.querySelector('#printCancel');
|
|
2393
2393
|
const cancelHandler = () => {
|
|
2394
2394
|
var _a;
|
|
2395
2395
|
this.dialog.removeEventListener("close", cancelHandler);
|
|
2396
2396
|
this.dialog.removeEventListener("cancel", cancelHandler);
|
|
2397
|
-
btnClose === null || btnClose ===
|
|
2398
|
-
(_a = options === null || options ===
|
|
2397
|
+
btnClose === null || btnClose === void 0 ? void 0 : btnClose.removeEventListener("click", cancelHandler);
|
|
2398
|
+
(_a = options === null || options === void 0 ? void 0 : options.close) === null || _a === void 0 ? void 0 : _a.call(options);
|
|
2399
2399
|
this.close();
|
|
2400
2400
|
};
|
|
2401
2401
|
this.dialog.addEventListener("close", cancelHandler);
|
|
2402
2402
|
this.dialog.addEventListener("cancel", cancelHandler);
|
|
2403
|
-
btnClose === null || btnClose ===
|
|
2403
|
+
btnClose === null || btnClose === void 0 ? void 0 : btnClose.addEventListener("click", cancelHandler);
|
|
2404
2404
|
this.dialog.showModal();
|
|
2405
2405
|
});
|
|
2406
2406
|
}
|
|
@@ -2435,39 +2435,39 @@ class PDFSlick {
|
|
|
2435
2435
|
constructor({ container, viewer, thumbs, store = create(), options, onError, printDialog, }) {
|
|
2436
2436
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2437
2437
|
_PDFSlick_instances.add(this);
|
|
2438
|
-
_PDFSlick_renderingQueue.set(this,
|
|
2439
|
-
_PDFSlick_container.set(this,
|
|
2440
|
-
_PDFSlick_viewerContainer.set(this,
|
|
2441
|
-
_PDFSlick_thumbsContainer.set(this,
|
|
2442
|
-
_PDFSlick_printService.set(this,
|
|
2438
|
+
_PDFSlick_renderingQueue.set(this, void 0);
|
|
2439
|
+
_PDFSlick_container.set(this, void 0);
|
|
2440
|
+
_PDFSlick_viewerContainer.set(this, void 0);
|
|
2441
|
+
_PDFSlick_thumbsContainer.set(this, void 0);
|
|
2442
|
+
_PDFSlick_printService.set(this, void 0);
|
|
2443
2443
|
this.downloadManager = null;
|
|
2444
2444
|
this.findController = null;
|
|
2445
2445
|
this.pdfPresentationMode = null;
|
|
2446
2446
|
this.document = null;
|
|
2447
2447
|
// options
|
|
2448
|
-
_PDFSlick_annotationMode.set(this,
|
|
2449
|
-
_PDFSlick_annotationEditorMode.set(this,
|
|
2450
|
-
_PDFSlick_onError.set(this,
|
|
2451
|
-
_PDFSlick_eventAbortController.set(this,
|
|
2448
|
+
_PDFSlick_annotationMode.set(this, void 0);
|
|
2449
|
+
_PDFSlick_annotationEditorMode.set(this, void 0);
|
|
2450
|
+
_PDFSlick_onError.set(this, void 0);
|
|
2451
|
+
_PDFSlick_eventAbortController.set(this, void 0);
|
|
2452
2452
|
__classPrivateFieldSet(this, _PDFSlick_container, container, "f");
|
|
2453
2453
|
__classPrivateFieldSet(this, _PDFSlick_viewerContainer, viewer, "f");
|
|
2454
2454
|
__classPrivateFieldSet(this, _PDFSlick_thumbsContainer, thumbs, "f");
|
|
2455
2455
|
__classPrivateFieldSet(this, _PDFSlick_onError, onError, "f");
|
|
2456
|
-
this.l10n = (_a = options === null || options ===
|
|
2456
|
+
this.l10n = (_a = options === null || options === void 0 ? void 0 : options.l10n) !== null && _a !== void 0 ? _a : new GenericL10n(navigator.language);
|
|
2457
2457
|
this.downloadManager = new DownloadManager();
|
|
2458
|
-
this.textLayerMode = (_b = options === null || options ===
|
|
2459
|
-
__classPrivateFieldSet(this, _PDFSlick_annotationMode, (_c = options === null || options ===
|
|
2460
|
-
__classPrivateFieldSet(this, _PDFSlick_annotationEditorMode, (_d = options === null || options ===
|
|
2461
|
-
this.annotationEditorHighlightColors = (_e = options === null || options ===
|
|
2462
|
-
this.removePageBorders = (_f = options === null || options ===
|
|
2463
|
-
this.singlePageViewer = (_g = options === null || options ===
|
|
2464
|
-
this.enablePrintAutoRotate = (_h = options === null || options ===
|
|
2465
|
-
this.useOnlyCssZoom = (_j = options === null || options ===
|
|
2466
|
-
this.pageColors = (_k = options === null || options ===
|
|
2467
|
-
this.maxCanvasPixels = (_l = options === null || options ===
|
|
2468
|
-
this.printResolution = (_m = options === null || options ===
|
|
2469
|
-
this.thumbnailWidth = (_o = options === null || options ===
|
|
2470
|
-
this.getDocumentParams = (_p = options === null || options ===
|
|
2458
|
+
this.textLayerMode = (_b = options === null || options === void 0 ? void 0 : options.textLayerMode) !== null && _b !== void 0 ? _b : TextLayerMode.ENABLE;
|
|
2459
|
+
__classPrivateFieldSet(this, _PDFSlick_annotationMode, (_c = options === null || options === void 0 ? void 0 : options.annotationMode) !== null && _c !== void 0 ? _c : AnnotationMode.ENABLE_FORMS, "f");
|
|
2460
|
+
__classPrivateFieldSet(this, _PDFSlick_annotationEditorMode, (_d = options === null || options === void 0 ? void 0 : options.annotationEditorMode) !== null && _d !== void 0 ? _d : AnnotationEditorType.NONE, "f");
|
|
2461
|
+
this.annotationEditorHighlightColors = (_e = options === null || options === void 0 ? void 0 : options.annotationEditorHighlightColors) !== null && _e !== void 0 ? _e : "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F";
|
|
2462
|
+
this.removePageBorders = (_f = options === null || options === void 0 ? void 0 : options.removePageBorders) !== null && _f !== void 0 ? _f : false;
|
|
2463
|
+
this.singlePageViewer = (_g = options === null || options === void 0 ? void 0 : options.singlePageViewer) !== null && _g !== void 0 ? _g : false;
|
|
2464
|
+
this.enablePrintAutoRotate = (_h = options === null || options === void 0 ? void 0 : options.enablePrintAutoRotate) !== null && _h !== void 0 ? _h : false;
|
|
2465
|
+
this.useOnlyCssZoom = (_j = options === null || options === void 0 ? void 0 : options.useOnlyCssZoom) !== null && _j !== void 0 ? _j : false;
|
|
2466
|
+
this.pageColors = (_k = options === null || options === void 0 ? void 0 : options.pageColors) !== null && _k !== void 0 ? _k : null;
|
|
2467
|
+
this.maxCanvasPixels = (_l = options === null || options === void 0 ? void 0 : options.maxCanvasPixels) !== null && _l !== void 0 ? _l : 16777216;
|
|
2468
|
+
this.printResolution = (_m = options === null || options === void 0 ? void 0 : options.printResolution) !== null && _m !== void 0 ? _m : 96;
|
|
2469
|
+
this.thumbnailWidth = (_o = options === null || options === void 0 ? void 0 : options.thumbnailWidth) !== null && _o !== void 0 ? _o : 125;
|
|
2470
|
+
this.getDocumentParams = (_p = options === null || options === void 0 ? void 0 : options.getDocumentParams) !== null && _p !== void 0 ? _p : {};
|
|
2471
2471
|
if (this.pageColors &&
|
|
2472
2472
|
!(CSS.supports("color", this.pageColors.background) &&
|
|
2473
2473
|
CSS.supports("color", this.pageColors.foreground))) {
|
|
@@ -2488,8 +2488,10 @@ class PDFSlick {
|
|
|
2488
2488
|
externalLinkRel: "noopener noreferrer nofollow",
|
|
2489
2489
|
ignoreDestinationZoom: false,
|
|
2490
2490
|
});
|
|
2491
|
+
const findController = new PDFFindController({ eventBus, linkService });
|
|
2491
2492
|
const viewerOptions = Object.assign(Object.assign({ container }, (viewer && { viewer })), { eventBus,
|
|
2492
|
-
linkService,
|
|
2493
|
+
linkService,
|
|
2494
|
+
findController, renderingQueue: renderingQueue, textLayerMode: this.textLayerMode, annotationEditorHighlightColors: this.annotationEditorHighlightColors, l10n: this.l10n, annotationMode: __classPrivateFieldGet(this, _PDFSlick_annotationMode, "f"), annotationEditorMode: __classPrivateFieldGet(this, _PDFSlick_annotationEditorMode, "f"), removePageBorders: this.removePageBorders, imageResourcesPath: "/images/" });
|
|
2493
2495
|
const pdfViewer = this.singlePageViewer
|
|
2494
2496
|
? new PDFSinglePageViewer(viewerOptions)
|
|
2495
2497
|
: new PDFViewer(viewerOptions);
|
|
@@ -2516,18 +2518,19 @@ class PDFSlick {
|
|
|
2516
2518
|
}
|
|
2517
2519
|
this.eventBus = eventBus;
|
|
2518
2520
|
this.linkService = linkService;
|
|
2521
|
+
this.findController = findController;
|
|
2519
2522
|
this.viewer = pdfViewer;
|
|
2520
2523
|
this.linkService.setViewer(pdfViewer);
|
|
2521
2524
|
__classPrivateFieldSet(this, _PDFSlick_printService, new PDFSlickPrintService({
|
|
2522
2525
|
eventBus,
|
|
2523
2526
|
slick: this,
|
|
2524
|
-
printDialog: printDialog !== null && printDialog !==
|
|
2527
|
+
printDialog: printDialog !== null && printDialog !== void 0 ? printDialog : PDFSlickPrintDialog.create(),
|
|
2525
2528
|
}), "f");
|
|
2526
|
-
const scaleValue = (_q = options === null || options ===
|
|
2529
|
+
const scaleValue = (_q = options === null || options === void 0 ? void 0 : options.scaleValue) !== null && _q !== void 0 ? _q : "auto";
|
|
2527
2530
|
this.store.setState({ scaleValue });
|
|
2528
2531
|
}
|
|
2529
2532
|
loadDocument(url, options) {
|
|
2530
|
-
return __awaiter(this,
|
|
2533
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2531
2534
|
var _a, _b, _c, _d, _e;
|
|
2532
2535
|
if (this.url && typeof this.url === "string") {
|
|
2533
2536
|
try {
|
|
@@ -2594,10 +2597,10 @@ class PDFSlick {
|
|
|
2594
2597
|
}
|
|
2595
2598
|
openOrDownloadData(data, filename) {
|
|
2596
2599
|
var _a;
|
|
2597
|
-
(_a = this.downloadManager) === null || _a ===
|
|
2600
|
+
(_a = this.downloadManager) === null || _a === void 0 ? void 0 : _a.openOrDownloadData(data, filename);
|
|
2598
2601
|
}
|
|
2599
2602
|
download() {
|
|
2600
|
-
return __awaiter(this,
|
|
2603
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2601
2604
|
var _a, _b;
|
|
2602
2605
|
const url = this.url;
|
|
2603
2606
|
const { filename } = this;
|
|
@@ -2610,12 +2613,12 @@ class PDFSlick {
|
|
|
2610
2613
|
catch (reason) {
|
|
2611
2614
|
// When the PDF document isn't ready, or the PDF file is still
|
|
2612
2615
|
// downloading, simply download using the URL.
|
|
2613
|
-
yield ((_b = this.downloadManager) === null || _b ===
|
|
2616
|
+
yield ((_b = this.downloadManager) === null || _b === void 0 ? void 0 : _b.download(null, url, filename));
|
|
2614
2617
|
}
|
|
2615
2618
|
});
|
|
2616
2619
|
}
|
|
2617
2620
|
save() {
|
|
2618
|
-
return __awaiter(this,
|
|
2621
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2619
2622
|
// if (this._saveInProgress) return;
|
|
2620
2623
|
// this._saveInProgress = true;
|
|
2621
2624
|
// await this.pdfScriptingManager.dispatchWillSave();
|
|
@@ -2648,7 +2651,7 @@ class PDFSlick {
|
|
|
2648
2651
|
}
|
|
2649
2652
|
downloadOrSave() {
|
|
2650
2653
|
var _a;
|
|
2651
|
-
const { annotationStorage } = (_a = this.document) !== null && _a !==
|
|
2654
|
+
const { annotationStorage } = (_a = this.document) !== null && _a !== void 0 ? _a : {};
|
|
2652
2655
|
if (annotationStorage && annotationStorage.size > 0) {
|
|
2653
2656
|
this.save();
|
|
2654
2657
|
}
|
|
@@ -2661,14 +2664,14 @@ class PDFSlick {
|
|
|
2661
2664
|
}
|
|
2662
2665
|
requestPresentationMode() {
|
|
2663
2666
|
var _a;
|
|
2664
|
-
(_a = this.pdfPresentationMode) === null || _a ===
|
|
2667
|
+
(_a = this.pdfPresentationMode) === null || _a === void 0 ? void 0 : _a.request();
|
|
2665
2668
|
}
|
|
2666
2669
|
triggerPrinting() {
|
|
2667
2670
|
__classPrivateFieldGet(this, _PDFSlick_printService, "f").print();
|
|
2668
2671
|
}
|
|
2669
2672
|
unbindEvents() {
|
|
2670
2673
|
var _a;
|
|
2671
|
-
(_a = __classPrivateFieldGet(this, _PDFSlick_eventAbortController, "f")) === null || _a ===
|
|
2674
|
+
(_a = __classPrivateFieldGet(this, _PDFSlick_eventAbortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
|
2672
2675
|
__classPrivateFieldSet(this, _PDFSlick_eventAbortController, null, "f");
|
|
2673
2676
|
__classPrivateFieldGet(this, _PDFSlick_printService, "f").unbindEvents();
|
|
2674
2677
|
}
|
|
@@ -2798,10 +2801,10 @@ class PDFSlick {
|
|
|
2798
2801
|
}
|
|
2799
2802
|
}
|
|
2800
2803
|
_PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _PDFSlick_viewerContainer = new WeakMap(), _PDFSlick_thumbsContainer = new WeakMap(), _PDFSlick_printService = new WeakMap(), _PDFSlick_annotationMode = new WeakMap(), _PDFSlick_annotationEditorMode = new WeakMap(), _PDFSlick_onError = new WeakMap(), _PDFSlick_eventAbortController = new WeakMap(), _PDFSlick_instances = new WeakSet(), _PDFSlick_initializePageLabels = function _PDFSlick_initializePageLabels() {
|
|
2801
|
-
return __awaiter(this,
|
|
2804
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2802
2805
|
var _a;
|
|
2803
2806
|
const pdfDocument = this.document;
|
|
2804
|
-
const labels = (_a = (yield pdfDocument.getPageLabels())) !== null && _a !==
|
|
2807
|
+
const labels = (_a = (yield pdfDocument.getPageLabels())) !== null && _a !== void 0 ? _a : [];
|
|
2805
2808
|
const numLabels = labels.length;
|
|
2806
2809
|
// Ignore page labels that correspond to standard page numbering,
|
|
2807
2810
|
// or page labels that are all empty.
|
|
@@ -2823,10 +2826,10 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2823
2826
|
}
|
|
2824
2827
|
const { viewer: pdfViewer, thumbnailViewer: pdfThumbnailViewer } = this;
|
|
2825
2828
|
pdfViewer.setPageLabels(labels);
|
|
2826
|
-
pdfThumbnailViewer === null || pdfThumbnailViewer ===
|
|
2829
|
+
pdfThumbnailViewer === null || pdfThumbnailViewer === void 0 ? void 0 : pdfThumbnailViewer.setPageLabels(labels);
|
|
2827
2830
|
});
|
|
2828
2831
|
}, _PDFSlick_parseDocumentInfo = function _PDFSlick_parseDocumentInfo() {
|
|
2829
|
-
return __awaiter(this,
|
|
2832
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2830
2833
|
const { info, contentLength } = (yield this.document.getMetadata());
|
|
2831
2834
|
const pageSize = yield this.document.getPage(this.store.getState().pageNumber).then((pdfPage) => {
|
|
2832
2835
|
return __classPrivateFieldGet(this, _PDFSlick_instances, "m", _PDFSlick_parsePageSize).call(this, getPageSizeInches(pdfPage), 0);
|
|
@@ -2847,7 +2850,7 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2847
2850
|
});
|
|
2848
2851
|
});
|
|
2849
2852
|
}, _PDFSlick_parsePageSize = function _PDFSlick_parsePageSize(pageSizeInches, pagesRotation) {
|
|
2850
|
-
return __awaiter(this,
|
|
2853
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2851
2854
|
if (!pageSizeInches) {
|
|
2852
2855
|
return undefined;
|
|
2853
2856
|
}
|
|
@@ -2926,9 +2929,9 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2926
2929
|
this.eventBus._on("switchspreadmode", __classPrivateFieldGet(this, _PDFSlick_instances, "m", _PDFSlick_onSwitchSpreadMode).bind(this), opts);
|
|
2927
2930
|
this.eventBus._on("switchscrollmode", __classPrivateFieldGet(this, _PDFSlick_instances, "m", _PDFSlick_onSwitchScrollMode).bind(this), opts);
|
|
2928
2931
|
}, _PDFSlick_onDocumentReady = function _PDFSlick_onDocumentReady(_a) {
|
|
2929
|
-
return __awaiter(this, arguments,
|
|
2932
|
+
return __awaiter(this, arguments, void 0, function* ({ source }) {
|
|
2930
2933
|
var _b;
|
|
2931
|
-
const documentOutline = (yield ((_b = this.document) === null || _b ===
|
|
2934
|
+
const documentOutline = (yield ((_b = this.document) === null || _b === void 0 ? void 0 : _b.getOutline()));
|
|
2932
2935
|
const scaleValue = this.store.getState().scaleValue;
|
|
2933
2936
|
// source._setScale(scaleValue, {}); // page-fit, page-actual, auto, page-width
|
|
2934
2937
|
source.currentScale = 1;
|
|
@@ -2957,14 +2960,14 @@ _PDFSlick_renderingQueue = new WeakMap(), _PDFSlick_container = new WeakMap(), _
|
|
|
2957
2960
|
this.viewer.update();
|
|
2958
2961
|
}, _PDFSlick_onPageChanging = function _PDFSlick_onPageChanging({ pageNumber }) {
|
|
2959
2962
|
var _a;
|
|
2960
|
-
(_a = this.thumbnailViewer) === null || _a ===
|
|
2963
|
+
(_a = this.thumbnailViewer) === null || _a === void 0 ? void 0 : _a.scrollThumbnailIntoView(pageNumber);
|
|
2961
2964
|
this.store.setState({ pageNumber });
|
|
2962
2965
|
}, _PDFSlick_onPageRendered = function _PDFSlick_onPageRendered({ pageNumber, error }) {
|
|
2963
2966
|
var _a;
|
|
2964
2967
|
// Use the rendered page to set the corresponding thumbnail image.
|
|
2965
2968
|
if (__classPrivateFieldGet(this, _PDFSlick_thumbsContainer, "f")) {
|
|
2966
2969
|
const pageView = this.viewer.getPageView(pageNumber - 1);
|
|
2967
|
-
const thumbnailView = (_a = this.thumbnailViewer) === null || _a ===
|
|
2970
|
+
const thumbnailView = (_a = this.thumbnailViewer) === null || _a === void 0 ? void 0 : _a.getThumbnail(pageNumber - 1);
|
|
2968
2971
|
if (pageView && thumbnailView) {
|
|
2969
2972
|
thumbnailView.setImage(pageView);
|
|
2970
2973
|
}
|