mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-05 13:46:21 +02:00
Fix EPUB.js CFI navigation bug
- Add patch-package to client dependencies - Add postinstall script to apply patches automatically - Add patch for EPUB.js v0.3.93 to fix CFI navigation - Changes scrollBy to scrollTo in continuous manager for proper absolute positioning - Fixes issue where CFI navigation loads content but target is outside viewport This resolves CFI-based features like bookmarks, highlights, and reading position sync.
This commit is contained in:
parent
0107cb4782
commit
a498fdf17d
@ -12,7 +12,8 @@
|
|||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"test": "npm run compile-tailwind && cypress run --component --browser chrome",
|
"test": "npm run compile-tailwind && cypress run --component --browser chrome",
|
||||||
"test-visually": "npm run compile-tailwind && cypress open --component --browser chrome",
|
"test-visually": "npm run compile-tailwind && cypress open --component --browser chrome",
|
||||||
"compile-tailwind": "npx @tailwindcss/cli -i ./assets/tailwind.css -o ./cypress/support/tailwind.compiled.css"
|
"compile-tailwind": "npx @tailwindcss/cli -i ./assets/tailwind.css -o ./cypress/support/tailwind.compiled.css",
|
||||||
|
"postinstall": "patch-package"
|
||||||
},
|
},
|
||||||
"author": "advplyr",
|
"author": "advplyr",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
@ -38,6 +39,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxtjs/pwa": "^3.3.5",
|
"@nuxtjs/pwa": "^3.3.5",
|
||||||
"@tailwindcss/cli": "^4.0.14",
|
"@tailwindcss/cli": "^4.0.14",
|
||||||
|
"patch-package": "^8.0.0",
|
||||||
"postcss": "^8.3.6",
|
"postcss": "^8.3.6",
|
||||||
"tailwindcss": "^4.0.13"
|
"tailwindcss": "^4.0.13"
|
||||||
},
|
},
|
||||||
|
37
client/patches/epubjs+0.3.93.patch
Normal file
37
client/patches/epubjs+0.3.93.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
diff --git a/node_modules/epubjs/lib/managers/continuous/index.js b/node_modules/epubjs/lib/managers/continuous/index.js
|
||||||
|
index 4912876..a27dec2 100644
|
||||||
|
--- a/node_modules/epubjs/lib/managers/continuous/index.js
|
||||||
|
+++ b/node_modules/epubjs/lib/managers/continuous/index.js
|
||||||
|
@@ -91,14 +91,12 @@ class ContinuousViewManager extends _default2.default {
|
||||||
|
} else {
|
||||||
|
distX = Math.floor(offset.left / this.layout.delta) * this.layout.delta;
|
||||||
|
offsetX = distX + this.settings.offsetDelta;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (distX > 0 || distY > 0) {
|
||||||
|
- this.scrollBy(distX, distY, true);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- afterResized(view) {
|
||||||
|
+ if (distX > 0 || distY > 0) {
|
||||||
|
+ this.scrollTo(distX, distY, true);
|
||||||
|
+ }
|
||||||
|
+ } afterResized(view) {
|
||||||
|
this.emit(_constants.EVENTS.MANAGERS.RESIZE, view.section);
|
||||||
|
} // Remove Previous Listeners if present
|
||||||
|
|
||||||
|
diff --git a/node_modules/epubjs/src/managers/continuous/index.js b/node_modules/epubjs/src/managers/continuous/index.js
|
||||||
|
index d61f8f7..0743938 100644
|
||||||
|
--- a/node_modules/epubjs/src/managers/continuous/index.js
|
||||||
|
+++ b/node_modules/epubjs/src/managers/continuous/index.js
|
||||||
|
@@ -90,7 +90,7 @@ class ContinuousViewManager extends DefaultViewManager {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (distX > 0 || distY > 0) {
|
||||||
|
- this.scrollBy(distX, distY, true);
|
||||||
|
+ this.scrollTo(distX, distY, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user