vue-book-reader 1.2.8 → 1.2.9

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.
@@ -2949,6 +2949,12 @@ let View$1 = class View extends HTMLElement {
2949
2949
  await this.renderer.goTo({ index, anchor });
2950
2950
  this.history.pushState({ fraction: frac });
2951
2951
  }
2952
+ labelFromPercentage(frac) {
2953
+ if (!this.#sectionProgress || !this.#tocProgress) return null;
2954
+ const [index] = this.#sectionProgress.getSection(frac);
2955
+ const tocItem = this.#tocProgress.getProgress(index);
2956
+ return (tocItem == null ? void 0 : tocItem.label) ?? null;
2957
+ }
2952
2958
  async select(target) {
2953
2959
  try {
2954
2960
  const obj = await this.resolveNavigation(target);
@@ -2956,6 +2956,12 @@
2956
2956
  await this.renderer.goTo({ index, anchor });
2957
2957
  this.history.pushState({ fraction: frac });
2958
2958
  }
2959
+ labelFromPercentage(frac) {
2960
+ if (!this.#sectionProgress || !this.#tocProgress) return null;
2961
+ const [index] = this.#sectionProgress.getSection(frac);
2962
+ const tocItem = this.#tocProgress.getProgress(index);
2963
+ return (tocItem == null ? void 0 : tocItem.label) ?? null;
2964
+ }
2959
2965
  async select(target) {
2960
2966
  try {
2961
2967
  const obj = await this.resolveNavigation(target);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-book-reader",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "type": "module",
5
5
  "main": "dist/vue-book-reader.umd.js",
6
6
  "module": "dist/vue-book-reader.es.js",