@d-i-t-a/reader 2.4.3 → 2.4.4

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
@@ -47082,7 +47082,9 @@ var _UserSettings = class _UserSettings {
47082
47082
  import_loglevel2.default.log(settings.verticalScroll);
47083
47083
  }
47084
47084
  if (initialUserSettings.appearance) {
47085
- settings.appearance = _UserSettings.parseAppearanceSetting(initialUserSettings.appearance);
47085
+ settings.appearance = _UserSettings.parseAppearanceSetting(
47086
+ initialUserSettings.appearance
47087
+ );
47086
47088
  let prop = settings.userProperties.getByRef(ReadiumCSS.APPEARANCE_REF);
47087
47089
  if (prop) {
47088
47090
  prop.value = settings.appearance;
@@ -47634,8 +47636,9 @@ var _UserSettings = class _UserSettings {
47634
47636
  return ((_a = await this.getProperty(key)) == null ? void 0 : _a.value) ?? this[name];
47635
47637
  }
47636
47638
  async resetUserSettings() {
47637
- await this.store.remove(this.USERSETTINGS);
47639
+ this.store.remove(this.USERSETTINGS);
47638
47640
  await this.reset();
47641
+ this.viewChangeCallback();
47639
47642
  this.settingsChangeCallback();
47640
47643
  }
47641
47644
  get currentSettings() {
@@ -47660,7 +47663,9 @@ var _UserSettings = class _UserSettings {
47660
47663
  async applyUserSettings(userSettings) {
47661
47664
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
47662
47665
  if (userSettings.appearance) {
47663
- this.appearance = _UserSettings.parseAppearanceSetting(userSettings.appearance);
47666
+ this.appearance = _UserSettings.parseAppearanceSetting(
47667
+ userSettings.appearance
47668
+ );
47664
47669
  let prop = (_a = this.userProperties) == null ? void 0 : _a.getByRef(ReadiumCSS.APPEARANCE_REF);
47665
47670
  if (prop) {
47666
47671
  prop.value = this.appearance;
@@ -47785,9 +47790,7 @@ var _UserSettings = class _UserSettings {
47785
47790
  } else {
47786
47791
  a = inputSetting;
47787
47792
  }
47788
- return _UserSettings.appearanceValues.findIndex(
47789
- (el) => el === a
47790
- );
47793
+ return _UserSettings.appearanceValues.findIndex((el) => el === a);
47791
47794
  }
47792
47795
  async scroll(scroll) {
47793
47796
  var _a, _b, _c, _d, _e;
@@ -47809,7 +47812,9 @@ var _UserSettings = class _UserSettings {
47809
47812
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
47810
47813
  if (incremental === "fontSize") {
47811
47814
  ((_a = this.userProperties) == null ? void 0 : _a.getByRef(ReadiumCSS.FONT_SIZE_REF)).increment();
47812
- this.fontSize = (_c = (_b = this.userProperties) == null ? void 0 : _b.getByRef(ReadiumCSS.FONT_SIZE_REF)) == null ? void 0 : _c.value;
47815
+ this.fontSize = (_c = (_b = this.userProperties) == null ? void 0 : _b.getByRef(
47816
+ ReadiumCSS.FONT_SIZE_REF
47817
+ )) == null ? void 0 : _c.value;
47813
47818
  let prop = (_d = this.userProperties) == null ? void 0 : _d.getByRef(ReadiumCSS.FONT_SIZE_REF);
47814
47819
  if (prop) {
47815
47820
  await this.storeProperty(prop);
@@ -47853,7 +47858,9 @@ var _UserSettings = class _UserSettings {
47853
47858
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
47854
47859
  if (incremental === "fontSize") {
47855
47860
  ((_a = this.userProperties) == null ? void 0 : _a.getByRef(ReadiumCSS.FONT_SIZE_REF)).decrement();
47856
- this.fontSize = (_c = (_b = this.userProperties) == null ? void 0 : _b.getByRef(ReadiumCSS.FONT_SIZE_REF)) == null ? void 0 : _c.value;
47861
+ this.fontSize = (_c = (_b = this.userProperties) == null ? void 0 : _b.getByRef(
47862
+ ReadiumCSS.FONT_SIZE_REF
47863
+ )) == null ? void 0 : _c.value;
47857
47864
  let prop = (_d = this.userProperties) == null ? void 0 : _d.getByRef(ReadiumCSS.FONT_SIZE_REF);
47858
47865
  if (prop) {
47859
47866
  await this.storeProperty(prop);
@@ -57489,8 +57496,18 @@ var ContentProtectionModule = class {
57489
57496
  const windowRight = windowLeft + this.wrapper.clientWidth;
57490
57497
  const right = rect.left + rect.width;
57491
57498
  const bottom = rect.top + rect.height;
57492
- const windowTop = this.wrapper.scrollTop;
57493
- const windowBottom = windowTop + this.wrapper.clientHeight;
57499
+ const windowTop = this.wrapper.scrollTop - (rect.node.parentElement ? parseInt(
57500
+ getComputedStyle(rect.node.parentElement).lineHeight.replace(
57501
+ "px",
57502
+ ""
57503
+ )
57504
+ ) : 10);
57505
+ const windowBottom = windowTop + this.wrapper.clientHeight + (rect.node.parentElement ? parseInt(
57506
+ getComputedStyle(rect.node.parentElement).lineHeight.replace(
57507
+ "px",
57508
+ ""
57509
+ )
57510
+ ) : 10);
57494
57511
  const isAbove = bottom < windowTop;
57495
57512
  const isBelow = rect.top > windowBottom;
57496
57513
  const isLeft = right < windowLeft - window.innerWidth;