@d-i-t-a/reader 2.2.0-beta.4 → 2.2.0-beta.5

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
@@ -64320,24 +64320,30 @@ var HistoryModule = class {
64320
64320
  addEventListenerOptional(this.historyBackAnchorElement, "click", this.handleHistoryBackClick.bind(this));
64321
64321
  }
64322
64322
  async handleHistoryForwardClick(event) {
64323
+ await this.historyForward();
64324
+ event.preventDefault();
64325
+ event.stopPropagation();
64326
+ }
64327
+ async historyForward() {
64323
64328
  if (this.history.length > 0) {
64324
64329
  if (this.historyCurrentIndex + 1 < this.history.length) {
64325
64330
  this.historyCurrentIndex = this.historyCurrentIndex + 1;
64326
64331
  await this.delegate.navigate(this.history[this.historyCurrentIndex], false);
64327
64332
  }
64328
64333
  }
64334
+ }
64335
+ async handleHistoryBackClick(event) {
64336
+ await this.historyBack();
64329
64337
  event.preventDefault();
64330
64338
  event.stopPropagation();
64331
64339
  }
64332
- async handleHistoryBackClick(event) {
64340
+ async historyBack() {
64333
64341
  if (this.history.length > 0) {
64334
64342
  if (this.historyCurrentIndex > 0) {
64335
64343
  this.historyCurrentIndex = this.historyCurrentIndex - 1;
64336
64344
  await this.delegate.navigate(this.history[this.historyCurrentIndex], false);
64337
64345
  }
64338
64346
  }
64339
- event.preventDefault();
64340
- event.stopPropagation();
64341
64347
  }
64342
64348
  };
64343
64349
 
@@ -64813,6 +64819,9 @@ var PDFNavigator = class extends import_eventemitter32.default {
64813
64819
  } else {
64814
64820
  document.getElementById(String(num))?.scrollIntoView();
64815
64821
  pdfload.style.display = "none";
64822
+ if (self2.api?.resourceReady)
64823
+ self2.api?.resourceReady();
64824
+ self2.emit("resource.ready");
64816
64825
  }
64817
64826
  });
64818
64827
  }
@@ -65054,6 +65063,12 @@ var D2Reader = class {
65054
65063
  this.addDefinition = async (definition) => {
65055
65064
  await this.definitionsModule?.addDefinition(definition);
65056
65065
  };
65066
+ this.historyBack = async () => {
65067
+ return this.historyModule?.historyBack();
65068
+ };
65069
+ this.historyForward = async () => {
65070
+ return this.historyModule?.historyForward();
65071
+ };
65057
65072
  this.search = async (term, current) => {
65058
65073
  return await this.searchModule?.search(term, current) ?? [];
65059
65074
  };
@@ -65427,6 +65442,12 @@ var D2Reader = class {
65427
65442
  get annotations() {
65428
65443
  return this.annotationModule?.getAnnotations();
65429
65444
  }
65445
+ get history() {
65446
+ return this.historyModule?.history;
65447
+ }
65448
+ get historyCurrentIndex() {
65449
+ return this.historyModule?.historyCurrentIndex;
65450
+ }
65430
65451
  get currentResource() {
65431
65452
  return this.navigator.currentResource();
65432
65453
  }