@d-i-t-a/reader 2.4.5 → 2.4.6

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
@@ -46282,16 +46282,21 @@ var Popup = class {
46282
46282
  return;
46283
46283
  }
46284
46284
  let self2 = this;
46285
- win.onclick = function(ev) {
46286
- if (event.target !== ev.target) {
46287
- if (d2popover.parentElement) {
46288
- self2.hidePopover();
46289
- if (win) {
46290
- win.onclick = null;
46285
+ win.addEventListener(
46286
+ "click",
46287
+ function(ev) {
46288
+ if (event.target !== ev.target) {
46289
+ if (d2popover.parentElement) {
46290
+ self2.hidePopover();
46291
+ ev.stopImmediatePropagation();
46291
46292
  }
46292
46293
  }
46294
+ },
46295
+ {
46296
+ once: true,
46297
+ capture: true
46293
46298
  }
46294
- };
46299
+ );
46295
46300
  }
46296
46301
  } else if (src) {
46297
46302
  let absolute = getAbsoluteHref(src);
@@ -46330,16 +46335,21 @@ var Popup = class {
46330
46335
  return;
46331
46336
  }
46332
46337
  let self2 = this;
46333
- win.onclick = function(ev) {
46334
- if (event.target !== ev.target) {
46335
- if (d2popover.parentElement) {
46336
- self2.hidePopover();
46337
- if (win) {
46338
- win.onclick = null;
46338
+ win.addEventListener(
46339
+ "click",
46340
+ function(ev) {
46341
+ if (event.target !== ev.target) {
46342
+ if (d2popover.parentElement) {
46343
+ self2.hidePopover();
46344
+ ev.stopImmediatePropagation();
46339
46345
  }
46340
46346
  }
46347
+ },
46348
+ {
46349
+ once: true,
46350
+ capture: true
46341
46351
  }
46342
- };
46352
+ );
46343
46353
  }
46344
46354
  }
46345
46355
  }
@@ -46510,7 +46520,7 @@ var EventHandler = class {
46510
46520
  },
46511
46521
  true
46512
46522
  );
46513
- element.addEventListener("click", this.handleLinks.bind(this));
46523
+ element.addEventListener("click", this.handleLinks.bind(this), true);
46514
46524
  } else {
46515
46525
  throw "cannot setup events for null";
46516
46526
  }
@@ -58984,6 +58994,8 @@ var KeyboardEventHandler = class {
58984
58994
  };
58985
58995
  this.onForwardSwipe = () => {
58986
58996
  };
58997
+ this.onKeydown = () => {
58998
+ };
58987
58999
  this.setupEvents = (element) => {
58988
59000
  if (element) {
58989
59001
  this.focusin(element);
@@ -59035,20 +59047,22 @@ var KeyboardEventHandler = class {
59035
59047
  switch (key) {
59036
59048
  case "ArrowRight":
59037
59049
  self2.rtl ? self2.onBackwardSwipe(event) : self2.onForwardSwipe(event);
59038
- break;
59050
+ return;
59039
59051
  case "ArrowLeft":
59040
59052
  self2.rtl ? self2.onForwardSwipe(event) : self2.onBackwardSwipe(event);
59041
- break;
59053
+ return;
59042
59054
  }
59043
59055
  switch (event.code) {
59044
59056
  case "Space":
59045
59057
  if (event.ctrlKey) {
59046
59058
  self2.onBackwardSwipe(event);
59059
+ return;
59047
59060
  } else {
59048
59061
  self2.onForwardSwipe(event);
59062
+ return;
59049
59063
  }
59050
- break;
59051
59064
  }
59065
+ self2.onKeydown(event);
59052
59066
  });
59053
59067
  }
59054
59068
  };
@@ -62111,9 +62125,13 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
62111
62125
  this.nextChapterBottomAnchorElement.style.display = "none";
62112
62126
  if (this.previousChapterTopAnchorElement)
62113
62127
  this.previousChapterTopAnchorElement.style.display = "none";
62128
+ if (this.eventHandler) {
62129
+ this.eventHandler.onClickThrough = this.handleClickThrough.bind(this);
62130
+ }
62114
62131
  if (this.keyboardEventHandler) {
62115
62132
  this.keyboardEventHandler.onBackwardSwipe = this.handlePreviousChapterClick.bind(this);
62116
62133
  this.keyboardEventHandler.onForwardSwipe = this.handleNextChapterClick.bind(this);
62134
+ this.keyboardEventHandler.onKeydown = this.handleKeydownFallthrough.bind(this);
62117
62135
  }
62118
62136
  if (this.touchEventHandler) {
62119
62137
  this.touchEventHandler.onBackwardSwipe = this.handlePreviousPageClick.bind(this);
@@ -62153,6 +62171,7 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
62153
62171
  if (this.keyboardEventHandler) {
62154
62172
  this.keyboardEventHandler.onBackwardSwipe = this.handlePreviousPageClick.bind(this);
62155
62173
  this.keyboardEventHandler.onForwardSwipe = this.handleNextPageClick.bind(this);
62174
+ this.keyboardEventHandler.onKeydown = this.handleKeydownFallthrough.bind(this);
62156
62175
  }
62157
62176
  } else {
62158
62177
  if (this.infoBottom)
@@ -62256,6 +62275,7 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
62256
62275
  if (this.keyboardEventHandler) {
62257
62276
  this.keyboardEventHandler.onBackwardSwipe = this.handlePreviousPageClick.bind(this);
62258
62277
  this.keyboardEventHandler.onForwardSwipe = this.handleNextPageClick.bind(this);
62278
+ this.keyboardEventHandler.onKeydown = this.handleKeydownFallthrough.bind(this);
62259
62279
  }
62260
62280
  }
62261
62281
  });
@@ -63378,7 +63398,11 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
63378
63398
  }
63379
63399
  }
63380
63400
  }
63381
- handleClickThrough(_event) {
63401
+ handleClickThrough(event) {
63402
+ var _a, _b;
63403
+ if ((_a = this.api) == null ? void 0 : _a.clickThrough)
63404
+ (_b = this.api) == null ? void 0 : _b.clickThrough(event);
63405
+ this.emit("click", event);
63382
63406
  }
63383
63407
  handleInternalLink(event) {
63384
63408
  const element = event.target;
@@ -63659,6 +63683,12 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
63659
63683
  event.stopPropagation();
63660
63684
  }
63661
63685
  }
63686
+ handleKeydownFallthrough(event) {
63687
+ var _a, _b;
63688
+ if ((_a = this.api) == null ? void 0 : _a.keydownFallthrough)
63689
+ (_b = this.api) == null ? void 0 : _b.keydownFallthrough(event);
63690
+ this.emit("keydown", event);
63691
+ }
63662
63692
  hideView() {
63663
63693
  var _a, _b;
63664
63694
  if (((_a = this.view) == null ? void 0 : _a.layout) !== "fixed") {