vue-book-reader 1.2.7 → 1.2.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.
|
@@ -2806,17 +2806,6 @@ let View$1 = class View extends HTMLElement {
|
|
|
2806
2806
|
await this.next();
|
|
2807
2807
|
}
|
|
2808
2808
|
}
|
|
2809
|
-
getLabelByFraction(fraction) {
|
|
2810
|
-
if (!this.#sectionProgress || !this.#tocProgress) return null;
|
|
2811
|
-
try {
|
|
2812
|
-
const [index] = this.#sectionProgress.getSection(fraction);
|
|
2813
|
-
if (index == null) return null;
|
|
2814
|
-
const tocItem = this.#tocProgress.getProgress(index, null);
|
|
2815
|
-
return (tocItem == null ? void 0 : tocItem.label) || null;
|
|
2816
|
-
} catch (e2) {
|
|
2817
|
-
return null;
|
|
2818
|
-
}
|
|
2819
|
-
}
|
|
2820
2809
|
#emit(name, detail, cancelable) {
|
|
2821
2810
|
return this.dispatchEvent(new CustomEvent(name, { detail, cancelable }));
|
|
2822
2811
|
}
|
|
@@ -2850,7 +2839,7 @@ let View$1 = class View extends HTMLElement {
|
|
|
2850
2839
|
const href_ = a2.getAttribute("href");
|
|
2851
2840
|
const href = ((_a = section == null ? void 0 : section.resolveHref) == null ? void 0 : _a.call(section, href_)) ?? href_;
|
|
2852
2841
|
if ((_b = book == null ? void 0 : book.isExternal) == null ? void 0 : _b.call(book, href))
|
|
2853
|
-
Promise.resolve(this.#emit("external-link", { a: a2,
|
|
2842
|
+
Promise.resolve(this.#emit("external-link", { a: a2, href_ }, true)).then((x2) => x2 ? globalThis.open(href_, "_blank") : null).catch((e3) => console.error(e3));
|
|
2854
2843
|
else Promise.resolve(this.#emit("link", { a: a2, href }, true)).then((x2) => x2 ? this.goTo(href) : null).catch((e3) => console.error(e3));
|
|
2855
2844
|
});
|
|
2856
2845
|
}
|
|
@@ -5580,6 +5569,7 @@ const makeFB2 = async (blob) => {
|
|
|
5580
5569
|
return ((_a = href == null ? void 0 : href.split("#")) == null ? void 0 : _a.map((x2) => Number(x2))) ?? [];
|
|
5581
5570
|
};
|
|
5582
5571
|
book.getTOCFragment = (doc2, id) => doc2.querySelector(`[${dataID}="${id}"]`);
|
|
5572
|
+
book.isExternal = (uri) => /^\w+:/i.test(uri);
|
|
5583
5573
|
book.destroy = () => {
|
|
5584
5574
|
for (const url of urls) URL.revokeObjectURL(url);
|
|
5585
5575
|
};
|
|
@@ -6093,8 +6083,8 @@ const makePDF = async (file) => {
|
|
|
6093
6083
|
};
|
|
6094
6084
|
const pdf2 = await pdfjsLib.getDocument({
|
|
6095
6085
|
range: transport,
|
|
6096
|
-
cMapUrl: pdfjsPath(
|
|
6097
|
-
standardFontDataUrl: pdfjsPath(
|
|
6086
|
+
// cMapUrl: pdfjsPath('cmaps/'),
|
|
6087
|
+
// standardFontDataUrl: pdfjsPath('standard_fonts/'),
|
|
6098
6088
|
isEvalSupported: false
|
|
6099
6089
|
}).promise;
|
|
6100
6090
|
const book = { rendition: { layout: "pre-paginated" } };
|
|
@@ -2813,17 +2813,6 @@
|
|
|
2813
2813
|
await this.next();
|
|
2814
2814
|
}
|
|
2815
2815
|
}
|
|
2816
|
-
getLabelByFraction(fraction) {
|
|
2817
|
-
if (!this.#sectionProgress || !this.#tocProgress) return null;
|
|
2818
|
-
try {
|
|
2819
|
-
const [index] = this.#sectionProgress.getSection(fraction);
|
|
2820
|
-
if (index == null) return null;
|
|
2821
|
-
const tocItem = this.#tocProgress.getProgress(index, null);
|
|
2822
|
-
return (tocItem == null ? void 0 : tocItem.label) || null;
|
|
2823
|
-
} catch (e2) {
|
|
2824
|
-
return null;
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
2816
|
#emit(name, detail, cancelable) {
|
|
2828
2817
|
return this.dispatchEvent(new CustomEvent(name, { detail, cancelable }));
|
|
2829
2818
|
}
|
|
@@ -2857,7 +2846,7 @@
|
|
|
2857
2846
|
const href_ = a2.getAttribute("href");
|
|
2858
2847
|
const href = ((_a = section == null ? void 0 : section.resolveHref) == null ? void 0 : _a.call(section, href_)) ?? href_;
|
|
2859
2848
|
if ((_b = book == null ? void 0 : book.isExternal) == null ? void 0 : _b.call(book, href))
|
|
2860
|
-
Promise.resolve(this.#emit("external-link", { a: a2,
|
|
2849
|
+
Promise.resolve(this.#emit("external-link", { a: a2, href_ }, true)).then((x2) => x2 ? globalThis.open(href_, "_blank") : null).catch((e3) => console.error(e3));
|
|
2861
2850
|
else Promise.resolve(this.#emit("link", { a: a2, href }, true)).then((x2) => x2 ? this.goTo(href) : null).catch((e3) => console.error(e3));
|
|
2862
2851
|
});
|
|
2863
2852
|
}
|
|
@@ -5587,6 +5576,7 @@ body:not(.notesBodyType) > .title, body:not(.notesBodyType) > .epigraph {
|
|
|
5587
5576
|
return ((_a = href == null ? void 0 : href.split("#")) == null ? void 0 : _a.map((x2) => Number(x2))) ?? [];
|
|
5588
5577
|
};
|
|
5589
5578
|
book.getTOCFragment = (doc2, id) => doc2.querySelector(`[${dataID}="${id}"]`);
|
|
5579
|
+
book.isExternal = (uri) => /^\w+:/i.test(uri);
|
|
5590
5580
|
book.destroy = () => {
|
|
5591
5581
|
for (const url of urls) URL.revokeObjectURL(url);
|
|
5592
5582
|
};
|
|
@@ -6100,8 +6090,8 @@ body:not(.notesBodyType) > .title, body:not(.notesBodyType) > .epigraph {
|
|
|
6100
6090
|
};
|
|
6101
6091
|
const pdf2 = await pdfjsLib.getDocument({
|
|
6102
6092
|
range: transport,
|
|
6103
|
-
cMapUrl: pdfjsPath(
|
|
6104
|
-
standardFontDataUrl: pdfjsPath(
|
|
6093
|
+
// cMapUrl: pdfjsPath('cmaps/'),
|
|
6094
|
+
// standardFontDataUrl: pdfjsPath('standard_fonts/'),
|
|
6105
6095
|
isEvalSupported: false
|
|
6106
6096
|
}).promise;
|
|
6107
6097
|
const book = { rendition: { layout: "pre-paginated" } };
|