@d-i-t-a/reader 2.4.6 → 2.4.8
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 +15 -8
- package/dist/esm/index.js.map +2 -2
- package/dist/reader.js +2 -2
- package/dist/reader.js.map +2 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -46467,6 +46467,7 @@ var EventHandler = class {
|
|
|
46467
46467
|
return isEpubInternal;
|
|
46468
46468
|
};
|
|
46469
46469
|
this.handleLinks = async (event) => {
|
|
46470
|
+
var _a;
|
|
46470
46471
|
import_loglevel.default.log("R2 Click Handler");
|
|
46471
46472
|
const link = this.checkForLink(event);
|
|
46472
46473
|
if (link) {
|
|
@@ -46502,7 +46503,9 @@ var EventHandler = class {
|
|
|
46502
46503
|
}
|
|
46503
46504
|
}
|
|
46504
46505
|
} else {
|
|
46505
|
-
this.
|
|
46506
|
+
if (!((_a = this.navigator.highlighter) == null ? void 0 : _a.isSelectionMenuOpen)) {
|
|
46507
|
+
this.onClickThrough(event);
|
|
46508
|
+
}
|
|
46506
46509
|
}
|
|
46507
46510
|
};
|
|
46508
46511
|
this.navigator = navigator2;
|
|
@@ -63067,7 +63070,7 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
|
|
|
63067
63070
|
if (doc && doc.body) {
|
|
63068
63071
|
height = getComputedStyle(doc.body).height;
|
|
63069
63072
|
width = getComputedStyle(doc.body).width;
|
|
63070
|
-
if (parseInt(height
|
|
63073
|
+
if (parseInt(height.toString().replace("px", "")) === 0 || parseInt(width.toString().replace("px", "")) === 0) {
|
|
63071
63074
|
const head = findIframeElement(
|
|
63072
63075
|
doc,
|
|
63073
63076
|
"head"
|
|
@@ -63092,8 +63095,8 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
|
|
|
63092
63095
|
}
|
|
63093
63096
|
var iframeParent = index2 === 0 && this.iframes.length === 2 ? (_b2 = this.iframes[1].parentElement) == null ? void 0 : _b2.parentElement : (_c2 = this.iframes[0].parentElement) == null ? void 0 : _c2.parentElement;
|
|
63094
63097
|
if (iframeParent && width) {
|
|
63095
|
-
var widthRatio = (parseInt(getComputedStyle(iframeParent).width) - 100) / (this.iframes.length === 2 ? parseInt(width
|
|
63096
|
-
var heightRatio = (parseInt(getComputedStyle(iframeParent).height) - 100) / parseInt(height
|
|
63098
|
+
var widthRatio = (parseInt(getComputedStyle(iframeParent).width) - 100) / (this.iframes.length === 2 ? parseInt(width.toString().replace("px", "")) * 2 + 200 : parseInt(width.toString().replace("px", "")));
|
|
63099
|
+
var heightRatio = (parseInt(getComputedStyle(iframeParent).height) - 100) / parseInt(height.toString().replace("px", ""));
|
|
63097
63100
|
var scale = Math.min(widthRatio, heightRatio);
|
|
63098
63101
|
iframeParent.style.transform = "scale(" + scale + ")";
|
|
63099
63102
|
for (const iframe of this.iframes) {
|
|
@@ -63502,13 +63505,17 @@ var IFrameNavigator = class _IFrameNavigator extends eventemitter3_default {
|
|
|
63502
63505
|
return obj2;
|
|
63503
63506
|
}, {});
|
|
63504
63507
|
if (parseInt(obj["height"]) !== 0 || parseInt(obj["width"]) !== 0) {
|
|
63505
|
-
height = obj["height"].endsWith("px") ? obj["height"] : obj["height"] + "px";
|
|
63506
|
-
width = obj["width"].endsWith("px") ? obj["width"] : obj["width"] + "px";
|
|
63508
|
+
height = obj["height"].toString().endsWith("px") ? obj["height"] : obj["height"] + "px";
|
|
63509
|
+
width = obj["width"].toString().endsWith("px") ? obj["width"] : obj["width"] + "px";
|
|
63507
63510
|
}
|
|
63508
63511
|
}
|
|
63509
63512
|
}
|
|
63510
|
-
var widthRatio = (parseInt(getComputedStyle(iframeParent).width) - 100) / (this.iframes.length === 2 ? parseInt(
|
|
63511
|
-
|
|
63513
|
+
var widthRatio = (parseInt(getComputedStyle(iframeParent).width) - 100) / (this.iframes.length === 2 ? parseInt(
|
|
63514
|
+
width.toString().endsWith("px") ? width == null ? void 0 : width.replace("px", "") : width
|
|
63515
|
+
) * 2 + 200 : parseInt(
|
|
63516
|
+
width.toString().endsWith("px") ? width == null ? void 0 : width.replace("px", "") : width
|
|
63517
|
+
));
|
|
63518
|
+
var heightRatio = (parseInt(getComputedStyle(iframeParent).height) - 100) / parseInt(height.toString().replace("px", ""));
|
|
63512
63519
|
var scale = Math.min(widthRatio, heightRatio);
|
|
63513
63520
|
iframeParent.style.transform = "scale(" + scale + ")";
|
|
63514
63521
|
for (const iframe of this.iframes) {
|