@d-i-t-a/reader 2.2.0 → 2.2.1

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 CHANGED
@@ -12262,7 +12262,7 @@ var require_parse = __commonJS({
12262
12262
  try {
12263
12263
  parser.parse();
12264
12264
  } catch (e) {
12265
- if (true) {
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 (true) {
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 (true) {
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 (true) {
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 (true) {
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 {
@@ -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));
@@ -58037,7 +58033,7 @@ function delay(t, v) {
58037
58033
  setTimeout(resolve.bind(null, v), t);
58038
58034
  });
58039
58035
  }
58040
- var IS_DEV = true;
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
@@ -64909,8 +64905,6 @@ var PDFNavigator = class extends import_eventemitter32.default {
64909
64905
  this.mainElement = mainElement;
64910
64906
  this.resourceIndex = 0;
64911
64907
  this.resource = this.publication.readingOrder[this.resourceIndex];
64912
- console.log(this.resource);
64913
- console.log(this.resource.Href1);
64914
64908
  import_pdfjs_dist.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.worker.js`;
64915
64909
  this.wrapper = findRequiredElement(this.mainElement, "main#iframe-wrapper");
64916
64910
  this.pdfContainer = findRequiredElement(this.mainElement, "#pdf-container");
@@ -64962,7 +64956,6 @@ var PDFNavigator = class extends import_eventemitter32.default {
64962
64956
  if (self2.scale === 1) {
64963
64957
  const fitPage = self2.wrapper.clientHeight / viewport.height;
64964
64958
  const fitWidth = self2.wrapper.clientWidth / viewport.width;
64965
- console.log(fitPage, fitWidth);
64966
64959
  if (self2.scaleType === 0) {
64967
64960
  viewport = page.getViewport({
64968
64961
  scale: fitPage < fitWidth ? fitPage : fitWidth
@@ -65044,13 +65037,11 @@ var PDFNavigator = class extends import_eventemitter32.default {
65044
65037
  }
65045
65038
  nextResource() {
65046
65039
  const self2 = this;
65047
- console.log(self2.resourceIndex, this.publication.readingOrder.length - 1);
65048
65040
  if (this.resourceIndex >= this.publication.readingOrder.length - 1) {
65049
65041
  return;
65050
65042
  }
65051
65043
  self2.resourceIndex++;
65052
65044
  self2.resource = this.publication.readingOrder[self2.resourceIndex];
65053
- console.log(this.resource.Href1);
65054
65045
  (0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
65055
65046
  self2.pdfDoc = pdfDoc_;
65056
65047
  self2.pageNum = 1;
@@ -65059,13 +65050,11 @@ var PDFNavigator = class extends import_eventemitter32.default {
65059
65050
  }
65060
65051
  previousResource() {
65061
65052
  const self2 = this;
65062
- console.log(self2.resourceIndex, this.publication.readingOrder.length - 1);
65063
65053
  if (this.resourceIndex === 0) {
65064
65054
  return;
65065
65055
  }
65066
65056
  self2.resourceIndex--;
65067
65057
  self2.resource = this.publication.readingOrder[self2.resourceIndex];
65068
- console.log(this.resource.Href1);
65069
65058
  (0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
65070
65059
  self2.pdfDoc = pdfDoc_;
65071
65060
  self2.pageNum = self2.pdfDoc.numPages;
@@ -65073,7 +65062,6 @@ var PDFNavigator = class extends import_eventemitter32.default {
65073
65062
  });
65074
65063
  }
65075
65064
  goTo(locator) {
65076
- console.log(locator);
65077
65065
  const url = new URL(locator.href);
65078
65066
  if (url.searchParams.has("start")) {
65079
65067
  const page = url.searchParams.get("start");
@@ -65085,21 +65073,17 @@ var PDFNavigator = class extends import_eventemitter32.default {
65085
65073
  }
65086
65074
  }
65087
65075
  goToPosition(value) {
65088
- console.log(value);
65089
65076
  this.queueRenderPage(value);
65090
65077
  }
65091
65078
  async goToPage(page) {
65092
- console.log(page);
65093
65079
  this.queueRenderPage(page);
65094
65080
  }
65095
65081
  fitToWidth() {
65096
- console.log("fit to width", this.pageNum);
65097
65082
  this.scale = 1;
65098
65083
  this.scaleType = 1;
65099
65084
  this.loadPDFJS(this.pageNum);
65100
65085
  }
65101
65086
  fitToPage() {
65102
- console.log("fit to page", this.pageNum);
65103
65087
  this.scale = 1;
65104
65088
  this.scaleType = 0;
65105
65089
  this.loadPDFJS(this.pageNum);