@d-i-t-a/reader 2.2.0 → 2.2.2
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/index.js +11 -25
- package/dist/esm/index.js.map +2 -2
- package/dist/injectables/click/click.js +1 -1
- package/dist/injectables/click/click.js.map +1 -1
- package/dist/reader.js +79 -65732
- package/dist/reader.js.map +2 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -12262,7 +12262,7 @@ var require_parse = __commonJS({
|
|
|
12262
12262
|
try {
|
|
12263
12263
|
parser.parse();
|
|
12264
12264
|
} catch (e) {
|
|
12265
|
-
if (
|
|
12265
|
+
if (false) {
|
|
12266
12266
|
if (e.name === "CssSyntaxError" && opts && opts.from) {
|
|
12267
12267
|
if (/\.scss$/i.test(opts.from)) {
|
|
12268
12268
|
e.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser";
|
|
@@ -12456,7 +12456,7 @@ var require_lazy_result = __commonJS({
|
|
|
12456
12456
|
return this.css;
|
|
12457
12457
|
}
|
|
12458
12458
|
then(onFulfilled, onRejected) {
|
|
12459
|
-
if (
|
|
12459
|
+
if (false) {
|
|
12460
12460
|
if (!("from" in this.opts)) {
|
|
12461
12461
|
warnOnce("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");
|
|
12462
12462
|
}
|
|
@@ -12603,7 +12603,7 @@ var require_lazy_result = __commonJS({
|
|
|
12603
12603
|
error.plugin = plugin.postcssPlugin;
|
|
12604
12604
|
error.setMessage();
|
|
12605
12605
|
} else if (plugin.postcssVersion) {
|
|
12606
|
-
if (
|
|
12606
|
+
if (false) {
|
|
12607
12607
|
let pluginName = plugin.postcssPlugin;
|
|
12608
12608
|
let pluginVer = plugin.postcssVersion;
|
|
12609
12609
|
let runtimeVer = this.result.processor.version;
|
|
@@ -12849,7 +12849,7 @@ var require_no_work_result = __commonJS({
|
|
|
12849
12849
|
return this._css;
|
|
12850
12850
|
}
|
|
12851
12851
|
then(onFulfilled, onRejected) {
|
|
12852
|
-
if (
|
|
12852
|
+
if (false) {
|
|
12853
12853
|
if (!("from" in this._opts)) {
|
|
12854
12854
|
warnOnce("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");
|
|
12855
12855
|
}
|
|
@@ -12918,7 +12918,7 @@ var require_processor = __commonJS({
|
|
|
12918
12918
|
} else if (typeof i === "function") {
|
|
12919
12919
|
normalized.push(i);
|
|
12920
12920
|
} else if (typeof i === "object" && (i.parse || i.stringify)) {
|
|
12921
|
-
if (
|
|
12921
|
+
if (false) {
|
|
12922
12922
|
throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");
|
|
12923
12923
|
}
|
|
12924
12924
|
} else {
|
|
@@ -55723,7 +55723,7 @@ var ConsumptionModule = class {
|
|
|
55723
55723
|
}
|
|
55724
55724
|
async stop() {
|
|
55725
55725
|
import_loglevel7.default.log("Consumption module stop");
|
|
55726
|
-
this.
|
|
55726
|
+
this.endResearchSession();
|
|
55727
55727
|
}
|
|
55728
55728
|
initialize() {
|
|
55729
55729
|
let win = this.delegate.iframes[0].contentWindow;
|
|
@@ -55757,7 +55757,6 @@ var ConsumptionModule = class {
|
|
|
55757
55757
|
this.startReadingTimer = new Date();
|
|
55758
55758
|
}
|
|
55759
55759
|
continueReadingSession(locator) {
|
|
55760
|
-
console.log("continueReadingSession", locator);
|
|
55761
55760
|
if (this.properties.enableTrackingSession) {
|
|
55762
55761
|
if (this.startResearchTimer === void 0) {
|
|
55763
55762
|
this.startResearchSession();
|
|
@@ -55774,7 +55773,6 @@ var ConsumptionModule = class {
|
|
|
55774
55773
|
}
|
|
55775
55774
|
}
|
|
55776
55775
|
startResearchSession() {
|
|
55777
|
-
console.log("startResearchSession");
|
|
55778
55776
|
if (this.properties.enableTrackingSession) {
|
|
55779
55777
|
this.startResearchTimer = new Date();
|
|
55780
55778
|
this.readingSessions = [];
|
|
@@ -55788,14 +55786,12 @@ var ConsumptionModule = class {
|
|
|
55788
55786
|
}
|
|
55789
55787
|
}
|
|
55790
55788
|
updateResearchSession() {
|
|
55791
|
-
console.log("updateResearchSession");
|
|
55792
55789
|
if (this.properties.enableTrackingSession) {
|
|
55793
55790
|
let timeElapsed = (new Date().getTime() - this.startResearchTimer.getTime()) / 1e3;
|
|
55794
55791
|
this.api?.updateResearchSession(this.researchSessionId, this.readingSessions, Math.round(timeElapsed));
|
|
55795
55792
|
}
|
|
55796
55793
|
}
|
|
55797
55794
|
endResearchSession() {
|
|
55798
|
-
console.log("endResearchSession");
|
|
55799
55795
|
if (this.properties.enableTrackingSession) {
|
|
55800
55796
|
let timeElapsed = (new Date().getTime() - this.startResearchTimer.getTime()) / 1e3;
|
|
55801
55797
|
this.api?.updateResearchSession(this.researchSessionId, this.readingSessions, Math.round(timeElapsed));
|
|
@@ -56234,7 +56230,7 @@ var AnnotationModule = class {
|
|
|
56234
56230
|
} else {
|
|
56235
56231
|
this.commentGutter?.style.setProperty("display", "none");
|
|
56236
56232
|
}
|
|
56237
|
-
if (this.commentGutter && this.delegate.view?.isScrollMode()) {
|
|
56233
|
+
if (this.commentGutter && this.delegate.view?.isScrollMode() && this.properties?.enableComments) {
|
|
56238
56234
|
this.commentGutter.innerHTML = "";
|
|
56239
56235
|
let highlights = [];
|
|
56240
56236
|
if (this.annotator) {
|
|
@@ -58037,7 +58033,7 @@ function delay(t, v) {
|
|
|
58037
58033
|
setTimeout(resolve.bind(null, v), t);
|
|
58038
58034
|
});
|
|
58039
58035
|
}
|
|
58040
|
-
var IS_DEV =
|
|
58036
|
+
var IS_DEV = false;
|
|
58041
58037
|
import_loglevel13.default.setLevel(IS_DEV ? "trace" : "warn", true);
|
|
58042
58038
|
|
|
58043
58039
|
// src/modules/protection/ContentProtectionModule.ts
|
|
@@ -58113,7 +58109,9 @@ var ContentProtectionModule = class {
|
|
|
58113
58109
|
}
|
|
58114
58110
|
async stop() {
|
|
58115
58111
|
import_loglevel14.default.log("Protection module stop");
|
|
58116
|
-
this.
|
|
58112
|
+
if (this.properties?.enableObfuscation) {
|
|
58113
|
+
this.mutationObserver.disconnect();
|
|
58114
|
+
}
|
|
58117
58115
|
if (this.properties?.disableKeys) {
|
|
58118
58116
|
removeEventListenerOptional(this.delegate.mainElement, "keydown", this.disableSave);
|
|
58119
58117
|
removeEventListenerOptional(this.delegate.headerMenu, "keydown", this.disableSave);
|
|
@@ -64909,8 +64907,6 @@ var PDFNavigator = class extends import_eventemitter32.default {
|
|
|
64909
64907
|
this.mainElement = mainElement;
|
|
64910
64908
|
this.resourceIndex = 0;
|
|
64911
64909
|
this.resource = this.publication.readingOrder[this.resourceIndex];
|
|
64912
|
-
console.log(this.resource);
|
|
64913
|
-
console.log(this.resource.Href1);
|
|
64914
64910
|
import_pdfjs_dist.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.worker.js`;
|
|
64915
64911
|
this.wrapper = findRequiredElement(this.mainElement, "main#iframe-wrapper");
|
|
64916
64912
|
this.pdfContainer = findRequiredElement(this.mainElement, "#pdf-container");
|
|
@@ -64962,7 +64958,6 @@ var PDFNavigator = class extends import_eventemitter32.default {
|
|
|
64962
64958
|
if (self2.scale === 1) {
|
|
64963
64959
|
const fitPage = self2.wrapper.clientHeight / viewport.height;
|
|
64964
64960
|
const fitWidth = self2.wrapper.clientWidth / viewport.width;
|
|
64965
|
-
console.log(fitPage, fitWidth);
|
|
64966
64961
|
if (self2.scaleType === 0) {
|
|
64967
64962
|
viewport = page.getViewport({
|
|
64968
64963
|
scale: fitPage < fitWidth ? fitPage : fitWidth
|
|
@@ -65044,13 +65039,11 @@ var PDFNavigator = class extends import_eventemitter32.default {
|
|
|
65044
65039
|
}
|
|
65045
65040
|
nextResource() {
|
|
65046
65041
|
const self2 = this;
|
|
65047
|
-
console.log(self2.resourceIndex, this.publication.readingOrder.length - 1);
|
|
65048
65042
|
if (this.resourceIndex >= this.publication.readingOrder.length - 1) {
|
|
65049
65043
|
return;
|
|
65050
65044
|
}
|
|
65051
65045
|
self2.resourceIndex++;
|
|
65052
65046
|
self2.resource = this.publication.readingOrder[self2.resourceIndex];
|
|
65053
|
-
console.log(this.resource.Href1);
|
|
65054
65047
|
(0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
|
|
65055
65048
|
self2.pdfDoc = pdfDoc_;
|
|
65056
65049
|
self2.pageNum = 1;
|
|
@@ -65059,13 +65052,11 @@ var PDFNavigator = class extends import_eventemitter32.default {
|
|
|
65059
65052
|
}
|
|
65060
65053
|
previousResource() {
|
|
65061
65054
|
const self2 = this;
|
|
65062
|
-
console.log(self2.resourceIndex, this.publication.readingOrder.length - 1);
|
|
65063
65055
|
if (this.resourceIndex === 0) {
|
|
65064
65056
|
return;
|
|
65065
65057
|
}
|
|
65066
65058
|
self2.resourceIndex--;
|
|
65067
65059
|
self2.resource = this.publication.readingOrder[self2.resourceIndex];
|
|
65068
|
-
console.log(this.resource.Href1);
|
|
65069
65060
|
(0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
|
|
65070
65061
|
self2.pdfDoc = pdfDoc_;
|
|
65071
65062
|
self2.pageNum = self2.pdfDoc.numPages;
|
|
@@ -65073,7 +65064,6 @@ var PDFNavigator = class extends import_eventemitter32.default {
|
|
|
65073
65064
|
});
|
|
65074
65065
|
}
|
|
65075
65066
|
goTo(locator) {
|
|
65076
|
-
console.log(locator);
|
|
65077
65067
|
const url = new URL(locator.href);
|
|
65078
65068
|
if (url.searchParams.has("start")) {
|
|
65079
65069
|
const page = url.searchParams.get("start");
|
|
@@ -65085,21 +65075,17 @@ var PDFNavigator = class extends import_eventemitter32.default {
|
|
|
65085
65075
|
}
|
|
65086
65076
|
}
|
|
65087
65077
|
goToPosition(value) {
|
|
65088
|
-
console.log(value);
|
|
65089
65078
|
this.queueRenderPage(value);
|
|
65090
65079
|
}
|
|
65091
65080
|
async goToPage(page) {
|
|
65092
|
-
console.log(page);
|
|
65093
65081
|
this.queueRenderPage(page);
|
|
65094
65082
|
}
|
|
65095
65083
|
fitToWidth() {
|
|
65096
|
-
console.log("fit to width", this.pageNum);
|
|
65097
65084
|
this.scale = 1;
|
|
65098
65085
|
this.scaleType = 1;
|
|
65099
65086
|
this.loadPDFJS(this.pageNum);
|
|
65100
65087
|
}
|
|
65101
65088
|
fitToPage() {
|
|
65102
|
-
console.log("fit to page", this.pageNum);
|
|
65103
65089
|
this.scale = 1;
|
|
65104
65090
|
this.scaleType = 0;
|
|
65105
65091
|
this.loadPDFJS(this.pageNum);
|