vue-book-reader 1.2.6 → 1.2.7

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,6 +2806,17 @@ 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
+ }
2809
2820
  #emit(name, detail, cancelable) {
2810
2821
  return this.dispatchEvent(new CustomEvent(name, { detail, cancelable }));
2811
2822
  }
@@ -2813,6 +2813,17 @@
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
+ }
2816
2827
  #emit(name, detail, cancelable) {
2817
2828
  return this.dispatchEvent(new CustomEvent(name, { detail, cancelable }));
2818
2829
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-book-reader",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "type": "module",
5
5
  "main": "dist/vue-book-reader.umd.js",
6
6
  "module": "dist/vue-book-reader.es.js",