Remove support for the legacy ePub reader (#2287)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
Generated
+1
-271
@@ -27,7 +27,6 @@
|
|||||||
"chartjs-chart-matrix": "^3.0.0",
|
"chartjs-chart-matrix": "^3.0.0",
|
||||||
"chartjs-plugin-datalabels": "^2.2.0",
|
"chartjs-plugin-datalabels": "^2.2.0",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"epubjs": "^0.3.93",
|
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"ng-lazyload-image": "^9.1.3",
|
"ng-lazyload-image": "^9.1.3",
|
||||||
"ng2-charts": "^8.0.0",
|
"ng2-charts": "^8.0.0",
|
||||||
@@ -4573,16 +4572,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/localforage": {
|
|
||||||
"version": "0.0.34",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/localforage/-/localforage-0.0.34.tgz",
|
|
||||||
"integrity": "sha512-tJxahnjm9dEI1X+hQSC5f2BSd/coZaqbIl1m3TCl0q9SVuC52XcXfV0XmoCU1+PmjyucuVITwoTnN8OlTbEXXA==",
|
|
||||||
"deprecated": "This is a stub types definition for localforage (https://github.com/localForage/localForage). localforage provides its own type definitions, so you don't need @types/localforage installed!",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"localforage": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "25.0.9",
|
"version": "25.0.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.9.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.9.tgz",
|
||||||
@@ -4988,16 +4977,6 @@
|
|||||||
"url": "https://opencollective.com/vitest"
|
"url": "https://opencollective.com/vitest"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@xmldom/xmldom": {
|
|
||||||
"version": "0.7.13",
|
|
||||||
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.13.tgz",
|
|
||||||
"integrity": "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==",
|
|
||||||
"deprecated": "this version is no longer supported, please update to at least 0.8.*",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@yarnpkg/lockfile": {
|
"node_modules/@yarnpkg/lockfile": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz",
|
||||||
@@ -5940,23 +5919,6 @@
|
|||||||
"node": ">=6.6.0"
|
"node": ">=6.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/core-js": {
|
|
||||||
"version": "3.47.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.47.0.tgz",
|
|
||||||
"integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/core-js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/core-util-is": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/cors": {
|
"node_modules/cors": {
|
||||||
"version": "2.8.5",
|
"version": "2.8.5",
|
||||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
||||||
@@ -6068,19 +6030,6 @@
|
|||||||
"node": "20 || >=22"
|
"node": "20 || >=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/d": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"es5-ext": "^0.10.64",
|
|
||||||
"type": "^2.7.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/data-urls": {
|
"node_modules/data-urls": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-6.0.0.tgz",
|
||||||
@@ -6336,23 +6285,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/epubjs": {
|
|
||||||
"version": "0.3.93",
|
|
||||||
"resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz",
|
|
||||||
"integrity": "sha512-c06pNSdBxcXv3dZSbXAVLE1/pmleRhOT6mXNZo6INKmvuKpYB65MwU/lO7830czCtjIiK9i+KR+3S+p0wtljrw==",
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/localforage": "0.0.34",
|
|
||||||
"@xmldom/xmldom": "^0.7.5",
|
|
||||||
"core-js": "^3.18.3",
|
|
||||||
"event-emitter": "^0.3.5",
|
|
||||||
"jszip": "^3.7.1",
|
|
||||||
"localforage": "^1.10.0",
|
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"marks-pane": "^1.0.9",
|
|
||||||
"path-webpack": "0.0.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/err-code": {
|
"node_modules/err-code": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
|
||||||
@@ -6400,46 +6332,6 @@
|
|||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/es5-ext": {
|
|
||||||
"version": "0.10.64",
|
|
||||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz",
|
|
||||||
"integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"es6-iterator": "^2.0.3",
|
|
||||||
"es6-symbol": "^3.1.3",
|
|
||||||
"esniff": "^2.0.1",
|
|
||||||
"next-tick": "^1.1.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/es6-iterator": {
|
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
|
||||||
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"d": "1",
|
|
||||||
"es5-ext": "^0.10.35",
|
|
||||||
"es6-symbol": "^3.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/es6-symbol": {
|
|
||||||
"version": "3.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz",
|
|
||||||
"integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"d": "^1.0.2",
|
|
||||||
"ext": "^1.7.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/esbuild": {
|
"node_modules/esbuild": {
|
||||||
"version": "0.27.2",
|
"version": "0.27.2",
|
||||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",
|
||||||
@@ -6690,21 +6582,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/esniff": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"d": "^1.0.1",
|
|
||||||
"es5-ext": "^0.10.62",
|
|
||||||
"event-emitter": "^0.3.5",
|
|
||||||
"type": "^2.7.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/espree": {
|
"node_modules/espree": {
|
||||||
"version": "10.4.0",
|
"version": "10.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
|
||||||
@@ -6802,16 +6679,6 @@
|
|||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/event-emitter": {
|
|
||||||
"version": "0.3.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
|
|
||||||
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"d": "1",
|
|
||||||
"es5-ext": "~0.10.14"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/eventemitter3": {
|
"node_modules/eventemitter3": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||||
@@ -6918,15 +6785,6 @@
|
|||||||
"express": ">= 4.11"
|
"express": ">= 4.11"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ext": {
|
|
||||||
"version": "1.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
|
||||||
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"type": "^2.7.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-deep-equal": {
|
"node_modules/fast-deep-equal": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||||
@@ -7538,12 +7396,6 @@
|
|||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/immediate": {
|
|
||||||
"version": "3.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
|
||||||
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/immutable": {
|
"node_modules/immutable": {
|
||||||
"version": "5.1.4",
|
"version": "5.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.4.tgz",
|
||||||
@@ -7582,6 +7434,7 @@
|
|||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||||
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/ini": {
|
"node_modules/ini": {
|
||||||
@@ -7727,12 +7580,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/isarray": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/isexe": {
|
"node_modules/isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
@@ -7954,18 +7801,6 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/jszip": {
|
|
||||||
"version": "3.10.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
|
|
||||||
"integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
|
|
||||||
"license": "(MIT OR GPL-3.0-or-later)",
|
|
||||||
"dependencies": {
|
|
||||||
"lie": "~3.3.0",
|
|
||||||
"pako": "~1.0.2",
|
|
||||||
"readable-stream": "~2.3.6",
|
|
||||||
"setimmediate": "^1.0.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/jwt-decode": {
|
"node_modules/jwt-decode": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
|
||||||
@@ -7999,15 +7834,6 @@
|
|||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lie": {
|
|
||||||
"version": "3.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
|
||||||
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"immediate": "~3.0.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/lilconfig": {
|
"node_modules/lilconfig": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
|
||||||
@@ -8103,24 +7929,6 @@
|
|||||||
"@lmdb/lmdb-win32-x64": "3.4.4"
|
"@lmdb/lmdb-win32-x64": "3.4.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/localforage": {
|
|
||||||
"version": "1.10.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
|
|
||||||
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"lie": "3.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/localforage/node_modules/lie": {
|
|
||||||
"version": "3.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
|
|
||||||
"integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"immediate": "~3.0.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/locate-path": {
|
"node_modules/locate-path": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
||||||
@@ -8137,12 +7945,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lodash": {
|
|
||||||
"version": "4.17.21",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/lodash-es": {
|
"node_modules/lodash-es": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
|
||||||
@@ -8308,12 +8110,6 @@
|
|||||||
"node": "^20.17.0 || >=22.9.0"
|
"node": "^20.17.0 || >=22.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/marks-pane": {
|
|
||||||
"version": "1.0.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/marks-pane/-/marks-pane-1.0.9.tgz",
|
|
||||||
"integrity": "sha512-Ahs4oeG90tbdPWwAJkAAoHg2lRR8lAs9mZXETNPO9hYg3AkjUJBKi1NQ4aaIQZVGrig7c/3NUV1jANl8rFTeMg==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/math-intrinsics": {
|
"node_modules/math-intrinsics": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||||
@@ -8704,12 +8500,6 @@
|
|||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/next-tick": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==",
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/ng-lazyload-image": {
|
"node_modules/ng-lazyload-image": {
|
||||||
"version": "9.1.3",
|
"version": "9.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/ng-lazyload-image/-/ng-lazyload-image-9.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/ng-lazyload-image/-/ng-lazyload-image-9.1.3.tgz",
|
||||||
@@ -9241,12 +9031,6 @@
|
|||||||
"node": "^20.17.0 || >=22.9.0"
|
"node": "^20.17.0 || >=22.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/pako": {
|
|
||||||
"version": "1.0.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
|
||||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
|
|
||||||
"license": "(MIT AND Zlib)"
|
|
||||||
},
|
|
||||||
"node_modules/parchment": {
|
"node_modules/parchment": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz",
|
||||||
@@ -9405,12 +9189,6 @@
|
|||||||
"url": "https://opencollective.com/express"
|
"url": "https://opencollective.com/express"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-webpack": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/path-webpack/-/path-webpack-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-AmeDxedoo5svf7aB3FYqSAKqMxys014lVKBzy1o/5vv9CtU7U4wgGWL1dA2o6MOzcD53ScN4Jmiq6VbtLz1vIQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/pathe": {
|
"node_modules/pathe": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
|
||||||
@@ -9702,12 +9480,6 @@
|
|||||||
"node": "^20.17.0 || >=22.9.0"
|
"node": "^20.17.0 || >=22.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/process-nextick-args": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/promise-retry": {
|
"node_modules/promise-retry": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
|
||||||
@@ -9836,21 +9608,6 @@
|
|||||||
"pify": "^2.3.0"
|
"pify": "^2.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/readable-stream": {
|
|
||||||
"version": "2.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/readdirp": {
|
"node_modules/readdirp": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
|
||||||
@@ -10079,12 +9836,6 @@
|
|||||||
"tslib": "^2.1.0"
|
"tslib": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/safer-buffer": {
|
"node_modules/safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
@@ -10216,12 +9967,6 @@
|
|||||||
"url": "https://opencollective.com/express"
|
"url": "https://opencollective.com/express"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/setimmediate": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
|
||||||
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/setprototypeof": {
|
"node_modules/setprototypeof": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||||
@@ -10579,15 +10324,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/string-width": {
|
"node_modules/string-width": {
|
||||||
"version": "7.2.0",
|
"version": "7.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
|
||||||
@@ -11035,12 +10771,6 @@
|
|||||||
"node": "^20.17.0 || >=22.9.0"
|
"node": "^20.17.0 || >=22.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/type": {
|
|
||||||
"version": "2.7.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz",
|
|
||||||
"integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==",
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/type-check": {
|
"node_modules/type-check": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
"chartjs-chart-matrix": "^3.0.0",
|
"chartjs-chart-matrix": "^3.0.0",
|
||||||
"chartjs-plugin-datalabels": "^2.2.0",
|
"chartjs-plugin-datalabels": "^2.2.0",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"epubjs": "^0.3.93",
|
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"ng-lazyload-image": "^9.1.3",
|
"ng-lazyload-image": "^9.1.3",
|
||||||
"ng2-charts": "^8.0.0",
|
"ng2-charts": "^8.0.0",
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {MainDashboardComponent} from './features/dashboard/components/main-dashb
|
|||||||
import {SeriesPageComponent} from './features/book/components/series-page/series-page.component';
|
import {SeriesPageComponent} from './features/book/components/series-page/series-page.component';
|
||||||
import {MetadataManagerComponent} from './features/metadata/component/metadata-manager/metadata-manager.component';
|
import {MetadataManagerComponent} from './features/metadata/component/metadata-manager/metadata-manager.component';
|
||||||
import {StatsComponent} from './features/stats/component/stats-component';
|
import {StatsComponent} from './features/stats/component/stats-component';
|
||||||
import {EpubReaderComponent} from './features/readers/epub-reader/component/epub-reader.component';
|
|
||||||
import {PdfReaderComponent} from './features/readers/pdf-reader/pdf-reader.component';
|
import {PdfReaderComponent} from './features/readers/pdf-reader/pdf-reader.component';
|
||||||
import {BookdropFileReviewComponent} from './features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component';
|
import {BookdropFileReviewComponent} from './features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component';
|
||||||
import {LoginGuard} from './shared/components/setup/login.guard';
|
import {LoginGuard} from './shared/components/setup/login.guard';
|
||||||
@@ -64,11 +63,6 @@ export const routes: Routes = [
|
|||||||
component: PdfReaderComponent,
|
component: PdfReaderComponent,
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'epub-reader/book/:bookId',
|
|
||||||
component: EpubReaderComponent,
|
|
||||||
canActivate: [AuthGuard]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'ebook-reader/book/:bookId',
|
path: 'ebook-reader/book/:bookId',
|
||||||
component: EbookReaderComponent,
|
component: EbookReaderComponent,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {BookService} from '../../book/service/book.service';
|
|||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {BookMark, BookMarkService} from '../../../shared/service/book-mark.service';
|
import {BookMark, BookMarkService} from '../../../shared/service/book-mark.service';
|
||||||
import {BookPatchService} from '../../book/service/book-patch.service';
|
import {BookPatchService} from '../../book/service/book-patch.service';
|
||||||
import {EpubCustomFontService} from '../epub-reader/service/epub-custom-font.service';
|
|
||||||
import {Book, EbookViewerSetting} from '../../book/model/book.model';
|
import {Book, EbookViewerSetting} from '../../book/model/book.model';
|
||||||
import {ReaderHeaderComponent} from './reader-layout/header/reader-header.component';
|
import {ReaderHeaderComponent} from './reader-layout/header/reader-header.component';
|
||||||
import {ReaderSidebarComponent} from './reader-layout/sidebar/reader-sidebar.component';
|
import {ReaderSidebarComponent} from './reader-layout/sidebar/reader-sidebar.component';
|
||||||
@@ -22,6 +21,7 @@ import {ReadingSessionService} from '../../../shared/service/reading-session.ser
|
|||||||
import {TocItem} from 'epubjs';
|
import {TocItem} from 'epubjs';
|
||||||
import {PageInfo, ThemeInfo} from './utils/reader-header-footer.util';
|
import {PageInfo, ThemeInfo} from './utils/reader-header-footer.util';
|
||||||
import {ReaderHeaderFooterVisibilityManager} from './utils/reader-header-footer-visibility.util';
|
import {ReaderHeaderFooterVisibilityManager} from './utils/reader-header-footer-visibility.util';
|
||||||
|
import {EpubCustomFontService} from './services/epub-custom-font.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-ebook-reader',
|
selector: 'app-ebook-reader',
|
||||||
|
|||||||
+1
-1
@@ -3,8 +3,8 @@ import {DecimalPipe, DOCUMENT} from '@angular/common';
|
|||||||
import {ReaderStateService} from '../../services/reader-state.service';
|
import {ReaderStateService} from '../../services/reader-state.service';
|
||||||
import {ReaderViewManagerService} from '../../services/reader-view-manager.service';
|
import {ReaderViewManagerService} from '../../services/reader-view-manager.service';
|
||||||
import {BookService} from '../../../../book/service/book.service';
|
import {BookService} from '../../../../book/service/book.service';
|
||||||
import {EpubCustomFontService} from '../../../epub-reader/service/epub-custom-font.service';
|
|
||||||
import {EbookViewerSetting} from '../../../../book/model/book.model';
|
import {EbookViewerSetting} from '../../../../book/model/book.model';
|
||||||
|
import {EpubCustomFontService} from '../../services/epub-custom-font.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-settings-dialog',
|
selector: 'app-settings-dialog',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {map, tap} from 'rxjs/operators';
|
|||||||
import {Theme, themes} from './reader-themes';
|
import {Theme, themes} from './reader-themes';
|
||||||
import {BookService} from '../../../book/service/book.service';
|
import {BookService} from '../../../book/service/book.service';
|
||||||
import {UserService} from '../../../settings/user-management/user.service';
|
import {UserService} from '../../../settings/user-management/user.service';
|
||||||
import {EpubCustomFontService} from '../../epub-reader/service/epub-custom-font.service';
|
import {EpubCustomFontService} from './epub-custom-font.service';
|
||||||
|
|
||||||
export interface ReaderState {
|
export interface ReaderState {
|
||||||
lineHeight: number;
|
lineHeight: number;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {inject, Injectable} from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {ReaderState} from './reader-state.service';
|
import {ReaderState} from './reader-state.service';
|
||||||
import {EpubCustomFontService} from '../../epub-reader/service/epub-custom-font.service';
|
import {EpubCustomFontService} from './epub-custom-font.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|||||||
-191
@@ -1,191 +0,0 @@
|
|||||||
import { Component, EventEmitter, Input, Output, OnChanges, SimpleChanges } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
import { Dialog } from 'primeng/dialog';
|
|
||||||
import { InputText } from 'primeng/inputtext';
|
|
||||||
import { ColorPicker } from 'primeng/colorpicker';
|
|
||||||
import { Textarea } from 'primeng/textarea';
|
|
||||||
import { InputNumber } from 'primeng/inputnumber';
|
|
||||||
import { Button } from 'primeng/button';
|
|
||||||
import { BookMark, UpdateBookMarkRequest } from '../../../../shared/service/book-mark.service';
|
|
||||||
import { PrimeTemplate } from 'primeng/api';
|
|
||||||
|
|
||||||
export interface BookmarkFormData {
|
|
||||||
title: string;
|
|
||||||
color: string;
|
|
||||||
notes: string;
|
|
||||||
priority: number | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-bookmark-edit-dialog',
|
|
||||||
standalone: true,
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
FormsModule,
|
|
||||||
Dialog,
|
|
||||||
InputText,
|
|
||||||
ColorPicker,
|
|
||||||
Textarea,
|
|
||||||
InputNumber,
|
|
||||||
Button,
|
|
||||||
PrimeTemplate
|
|
||||||
],
|
|
||||||
template: `
|
|
||||||
<p-dialog
|
|
||||||
[(visible)]="visible"
|
|
||||||
[modal]="true"
|
|
||||||
[closable]="true"
|
|
||||||
[style]="{width: '500px'}"
|
|
||||||
[draggable]="false"
|
|
||||||
[resizable]="false"
|
|
||||||
[closeOnEscape]="true"
|
|
||||||
[appendTo]="'body'"
|
|
||||||
header="Edit Bookmark"
|
|
||||||
(onHide)="onDialogHide()">
|
|
||||||
|
|
||||||
@if (formData) {
|
|
||||||
<div class="p-4">
|
|
||||||
<div class="field mb-4">
|
|
||||||
<label for="title" class="block text-sm font-medium mb-2">Title <span class="text-red-500">*</span></label>
|
|
||||||
<input
|
|
||||||
pInputText
|
|
||||||
id="title"
|
|
||||||
type="text"
|
|
||||||
[(ngModel)]="formData.title"
|
|
||||||
class="w-full"
|
|
||||||
[class.ng-invalid]="titleError"
|
|
||||||
[class.ng-dirty]="titleError"
|
|
||||||
placeholder="Enter bookmark title"
|
|
||||||
[maxlength]="255"
|
|
||||||
(ngModelChange)="titleError = false">
|
|
||||||
@if (titleError) {
|
|
||||||
<small class="text-red-500">Title is required</small>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field mb-4">
|
|
||||||
<label for="color" class="block text-sm font-medium mb-2">Color</label>
|
|
||||||
<div class="flex align-items-center gap-2">
|
|
||||||
<p-colorPicker
|
|
||||||
[(ngModel)]="formData.color"
|
|
||||||
[appendTo]="'body'"
|
|
||||||
format="hex">
|
|
||||||
</p-colorPicker>
|
|
||||||
<input
|
|
||||||
pInputText
|
|
||||||
[(ngModel)]="formData.color"
|
|
||||||
class="w-8rem"
|
|
||||||
placeholder="#000000"
|
|
||||||
pattern="^#[0-9A-Fa-f]{6}$">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field mb-4">
|
|
||||||
<label for="notes" class="block text-sm font-medium mb-2">Notes</label>
|
|
||||||
<textarea
|
|
||||||
pInputTextarea
|
|
||||||
id="notes"
|
|
||||||
[(ngModel)]="formData.notes"
|
|
||||||
class="w-full"
|
|
||||||
rows="3"
|
|
||||||
placeholder="Add notes about this bookmark"
|
|
||||||
[maxlength]="2000">
|
|
||||||
</textarea>
|
|
||||||
<small class="text-muted">{{ formData.notes.length || 0 }}/2000</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field mb-4">
|
|
||||||
<label for="priority" class="block text-sm font-medium mb-2">Priority (1 = High, 5 = Low)</label>
|
|
||||||
<p-inputNumber
|
|
||||||
id="priority"
|
|
||||||
[(ngModel)]="formData.priority"
|
|
||||||
[min]="1"
|
|
||||||
[max]="5"
|
|
||||||
[showButtons]="true"
|
|
||||||
buttonLayout="horizontal"
|
|
||||||
spinnerMode="horizontal"
|
|
||||||
decrementButtonClass="p-button-secondary"
|
|
||||||
incrementButtonClass="p-button-secondary"
|
|
||||||
decrementButtonIcon="pi pi-minus"
|
|
||||||
incrementButtonIcon="pi pi-plus">
|
|
||||||
</p-inputNumber>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<ng-template pTemplate="footer">
|
|
||||||
<div class="flex justify-content-between">
|
|
||||||
<p-button
|
|
||||||
label="Cancel"
|
|
||||||
icon="pi pi-times"
|
|
||||||
(click)="onCancel()"
|
|
||||||
[text]="true"
|
|
||||||
severity="secondary">
|
|
||||||
</p-button>
|
|
||||||
<p-button
|
|
||||||
label="Save"
|
|
||||||
icon="pi pi-check"
|
|
||||||
(click)="onSave()"
|
|
||||||
[loading]="isSaving"
|
|
||||||
[disabled]="!formData || isSaving">
|
|
||||||
</p-button>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
</p-dialog>
|
|
||||||
`
|
|
||||||
})
|
|
||||||
export class BookmarkEditDialogComponent implements OnChanges {
|
|
||||||
@Input() visible = false;
|
|
||||||
@Input() bookmark: BookMark | null = null;
|
|
||||||
@Input() isSaving = false;
|
|
||||||
|
|
||||||
@Output() visibleChange = new EventEmitter<boolean>();
|
|
||||||
@Output() save = new EventEmitter<UpdateBookMarkRequest>();
|
|
||||||
@Output() cancelEdit = new EventEmitter<void>();
|
|
||||||
|
|
||||||
formData: BookmarkFormData | null = null;
|
|
||||||
titleError = false;
|
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
|
||||||
if (changes['bookmark'] && this.bookmark) {
|
|
||||||
this.titleError = false;
|
|
||||||
this.formData = {
|
|
||||||
title: this.bookmark.title || '',
|
|
||||||
color: this.bookmark.color || '#3B82F6',
|
|
||||||
notes: this.bookmark.notes || '',
|
|
||||||
priority: this.bookmark.priority ?? 3
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onSave(): void {
|
|
||||||
if (!this.formData) return;
|
|
||||||
|
|
||||||
if (!this.formData.title || !this.formData.title.trim()) {
|
|
||||||
this.titleError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const request: UpdateBookMarkRequest = {
|
|
||||||
title: this.formData.title.trim(),
|
|
||||||
color: this.formData.color || undefined,
|
|
||||||
notes: this.formData.notes || undefined,
|
|
||||||
priority: this.formData.priority ?? undefined
|
|
||||||
};
|
|
||||||
|
|
||||||
this.save.emit(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
onDialogHide(): void {
|
|
||||||
// When dialog is closed via X button, treat it as cancel
|
|
||||||
this.onCancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
onCancel(): void {
|
|
||||||
this.formData = null; // Clear form data
|
|
||||||
this.visible = false;
|
|
||||||
this.visibleChange.emit(false);
|
|
||||||
this.cancelEdit.emit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-198
@@ -1,198 +0,0 @@
|
|||||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { Dialog } from 'primeng/dialog';
|
|
||||||
import { Button } from 'primeng/button';
|
|
||||||
import { BookMark } from '../../../../shared/service/book-mark.service';
|
|
||||||
import { PrimeTemplate } from 'primeng/api';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-bookmark-view-dialog',
|
|
||||||
standalone: true,
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
Dialog,
|
|
||||||
Button,
|
|
||||||
PrimeTemplate
|
|
||||||
],
|
|
||||||
template: `
|
|
||||||
<p-dialog
|
|
||||||
[(visible)]="visible"
|
|
||||||
[modal]="true"
|
|
||||||
[closable]="true"
|
|
||||||
[style]="{width: '420px', maxWidth: '95vw'}"
|
|
||||||
[draggable]="false"
|
|
||||||
[resizable]="false"
|
|
||||||
[closeOnEscape]="true"
|
|
||||||
[appendTo]="'body'"
|
|
||||||
header="View Bookmark"
|
|
||||||
(onHide)="onClose()">
|
|
||||||
|
|
||||||
@if (bookmark) {
|
|
||||||
<div class="bookmark-view-content">
|
|
||||||
<div class="bookmark-view-header">
|
|
||||||
<span class="bookmark-view-color" [style.background-color]="bookmark.color || 'var(--primary-color)'"></span>
|
|
||||||
<h3 class="bookmark-view-title">{{ bookmark.title }}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="bookmark-view-details">
|
|
||||||
<div class="bookmark-view-row">
|
|
||||||
<span class="bookmark-view-label">Created</span>
|
|
||||||
<span class="bookmark-view-value">{{ bookmark.createdAt | date:'MMM d, y, h:mm a' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="bookmark-view-row">
|
|
||||||
<span class="bookmark-view-label">Priority</span>
|
|
||||||
<span class="bookmark-view-priority" [attr.data-priority]="bookmark.priority">
|
|
||||||
{{ getPriorityLabel(bookmark.priority) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="bookmark-view-notes">
|
|
||||||
<span class="bookmark-view-label">Notes</span>
|
|
||||||
@if (bookmark.notes) {
|
|
||||||
<p class="bookmark-view-notes-content">{{ bookmark.notes }}</p>
|
|
||||||
} @else {
|
|
||||||
<p class="bookmark-view-notes-empty">No notes added</p>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<ng-template pTemplate="footer">
|
|
||||||
<p-button
|
|
||||||
label="Close"
|
|
||||||
icon="pi pi-times"
|
|
||||||
(click)="onClose()"
|
|
||||||
[text]="true"
|
|
||||||
severity="secondary">
|
|
||||||
</p-button>
|
|
||||||
</ng-template>
|
|
||||||
</p-dialog>
|
|
||||||
`,
|
|
||||||
styles: [`
|
|
||||||
.bookmark-view-content {
|
|
||||||
padding: 0.5rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.75rem;
|
|
||||||
margin-bottom: 1.25rem;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
border-bottom: 1px solid var(--surface-border);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-color {
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-title {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 1.125rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-color);
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-details {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.75rem;
|
|
||||||
margin-bottom: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-label {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--text-color-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-value {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-priority {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 0.25rem 0.625rem;
|
|
||||||
border-radius: 1rem;
|
|
||||||
background: color-mix(in srgb, var(--primary-color) 15%, transparent);
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-priority[data-priority="1"] {
|
|
||||||
background: color-mix(in srgb, #ef4444 15%, transparent);
|
|
||||||
color: #ef4444;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-priority[data-priority="2"] {
|
|
||||||
background: color-mix(in srgb, #f97316 15%, transparent);
|
|
||||||
color: #f97316;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-priority[data-priority="3"] {
|
|
||||||
background: color-mix(in srgb, var(--primary-color) 15%, transparent);
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-priority[data-priority="4"],
|
|
||||||
.bookmark-view-priority[data-priority="5"] {
|
|
||||||
background: color-mix(in srgb, #6b7280 15%, transparent);
|
|
||||||
color: #6b7280;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-notes {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-notes-content {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0.875rem;
|
|
||||||
background: var(--surface-ground);
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--text-color);
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-break: break-word;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-view-notes-empty {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--text-color-secondary);
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
`]
|
|
||||||
})
|
|
||||||
export class BookmarkViewDialogComponent {
|
|
||||||
@Input() visible = false;
|
|
||||||
@Input() bookmark: BookMark | null = null;
|
|
||||||
@Output() visibleChange = new EventEmitter<boolean>();
|
|
||||||
|
|
||||||
onClose(): void {
|
|
||||||
this.visible = false;
|
|
||||||
this.visibleChange.emit(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
getPriorityLabel(priority: number | undefined): string {
|
|
||||||
if (priority === undefined) return 'Normal';
|
|
||||||
if (priority <= 1) return 'Highest';
|
|
||||||
if (priority === 2) return 'High';
|
|
||||||
if (priority === 3) return 'Normal';
|
|
||||||
if (priority === 4) return 'Low';
|
|
||||||
return 'Lowest';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-315
@@ -1,315 +0,0 @@
|
|||||||
<div class="epub-viewer-container">
|
|
||||||
@if (isLoading) {
|
|
||||||
<div class="spinner-wrapper">
|
|
||||||
<p-progressSpinner></p-progressSpinner>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
@if (isDrawerVisible) {
|
|
||||||
<div class="drawer-backdrop" (click)="isDrawerVisible = false; startHeaderAutoHide()"></div>
|
|
||||||
}
|
|
||||||
@if (isSettingsDrawerVisible) {
|
|
||||||
<div class="drawer-backdrop" (click)="isSettingsDrawerVisible = false; startHeaderAutoHide()"></div>
|
|
||||||
}
|
|
||||||
<div style="position: absolute; top: 0; left: 0; right: 0; height: 80px; z-index: 1000; pointer-events: auto;" (mouseenter)="onHeaderZoneEnter()" (mouseleave)="onHeaderZoneLeave()" (click)="onHeaderZoneClick($event)"></div>
|
|
||||||
<div class="epub-header" [class.hidden]="!showHeader" (click)="$event.stopPropagation()">
|
|
||||||
<div class="header-left">
|
|
||||||
<p-button size="small" class="menu-toggle-button" (click)="toggleDrawer(); $event.stopPropagation()" icon="pi pi-bars" severity="secondary"></p-button>
|
|
||||||
<div class="progress-info">
|
|
||||||
<span class="progress-percentage"><span class="progress-label">Progress: </span>{{ progressPercentage }}%</span>
|
|
||||||
</div>
|
|
||||||
<p-drawer [(visible)]="isDrawerVisible" [modal]="false" [position]="'left'" [style]="{ width: '320px' }" (click)="$event.stopPropagation()">
|
|
||||||
<ng-template pTemplate="header">
|
|
||||||
<div class="drawer-header">
|
|
||||||
<span class="drawer-title">Table of Contents</span>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<p-tabs value="0">
|
|
||||||
<p-tablist>
|
|
||||||
<p-tab value="0">
|
|
||||||
<div class="tab-header">
|
|
||||||
<i class="pi pi-book"></i>
|
|
||||||
<span>Chapters</span>
|
|
||||||
</div>
|
|
||||||
</p-tab>
|
|
||||||
<p-tab value="1">
|
|
||||||
<div class="tab-header">
|
|
||||||
<i class="pi pi-bookmark"></i>
|
|
||||||
<span>Bookmarks</span>
|
|
||||||
</div>
|
|
||||||
</p-tab>
|
|
||||||
</p-tablist>
|
|
||||||
<p-tabpanels>
|
|
||||||
<p-tabpanel value="0">
|
|
||||||
<div class="tab-content">
|
|
||||||
<ul class="chapter-list">
|
|
||||||
@for (chapter of chapters; track chapter) {
|
|
||||||
<li (click)="navigateToChapter(chapter); $event.stopPropagation()"
|
|
||||||
class="chapter-item"
|
|
||||||
[class.current-chapter]="chapter.href === currentChapterHref"
|
|
||||||
[style.padding-left.rem]="chapter.level * 1.5 + 0.75">
|
|
||||||
<i class="pi pi-chevron-right chapter-icon"></i>
|
|
||||||
<span class="chapter-label">{{ chapter.label }}</span>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</p-tabpanel>
|
|
||||||
<p-tabpanel value="1">
|
|
||||||
<div class="tab-content">
|
|
||||||
<div class="p-2 mb-2">
|
|
||||||
<p-iconfield class="w-full">
|
|
||||||
<p-inputicon class="pi pi-search"/>
|
|
||||||
<input
|
|
||||||
pInputText
|
|
||||||
type="text"
|
|
||||||
[(ngModel)]="filterText"
|
|
||||||
placeholder="Search bookmarks..."
|
|
||||||
class="w-full p-inputtext-sm"
|
|
||||||
(click)="$event.stopPropagation()">
|
|
||||||
</p-iconfield>
|
|
||||||
</div>
|
|
||||||
@if (filteredBookmarks.length === 0) {
|
|
||||||
<div class="empty-state">
|
|
||||||
<i class="pi pi-bookmark"></i>
|
|
||||||
<p>No bookmarks found</p>
|
|
||||||
<span>{{ filterText ? 'Try a different search term' : 'Tap the bookmark icon to save your place' }}</span>
|
|
||||||
</div>
|
|
||||||
} @else {
|
|
||||||
<ul class="bookmark-list">
|
|
||||||
@for (bookmark of filteredBookmarks; track bookmark.id) {
|
|
||||||
<li class="bookmark-item" (click)="navigateToBookmark(bookmark); $event.stopPropagation()">
|
|
||||||
<i class="pi pi-bookmark-fill bookmark-icon" [style.color]="bookmark.color || 'var(--primary-color)'"></i>
|
|
||||||
<span class="bookmark-label">{{ bookmark.title }}</span>
|
|
||||||
<div class="bookmark-actions">
|
|
||||||
<button
|
|
||||||
class="bookmark-action-btn"
|
|
||||||
(click)="openViewDialog(bookmark); $event.stopPropagation()"
|
|
||||||
pTooltip="View Details"
|
|
||||||
tooltipPosition="bottom">
|
|
||||||
<i class="pi pi-info-circle"></i>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="bookmark-action-btn"
|
|
||||||
(click)="openEditBookmarkDialog(bookmark); $event.stopPropagation()"
|
|
||||||
pTooltip="Edit"
|
|
||||||
tooltipPosition="bottom">
|
|
||||||
<i class="pi pi-pencil"></i>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="bookmark-action-btn delete"
|
|
||||||
(click)="deleteBookmark(bookmark.id); $event.stopPropagation()"
|
|
||||||
pTooltip="Delete"
|
|
||||||
tooltipPosition="bottom">
|
|
||||||
<i class="pi pi-trash"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</p-tabpanel>
|
|
||||||
</p-tabpanels>
|
|
||||||
</p-tabs>
|
|
||||||
</p-drawer>
|
|
||||||
</div>
|
|
||||||
<div class="header-center">
|
|
||||||
<p class="text font-medium">{{ currentChapter }}</p>
|
|
||||||
</div>
|
|
||||||
<div class="header-right">
|
|
||||||
<div class="flex gap-4">
|
|
||||||
@if (!locationsReady) {
|
|
||||||
<div class="location-indicator" pTooltip="Saving progress not ready yet">
|
|
||||||
<span class="dot"></span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
<p-button
|
|
||||||
size="small"
|
|
||||||
[icon]="isBookmarked ? 'pi pi-bookmark-fill' : 'pi pi-bookmark'"
|
|
||||||
(click)="addBookmark(); $event.stopPropagation()"
|
|
||||||
severity="secondary"
|
|
||||||
[disabled]="!currentCfi || isAddingBookmark">
|
|
||||||
</p-button>
|
|
||||||
<div>
|
|
||||||
<p-button size="small" class="settings-toggle-button" (click)="toggleSettingsDrawer(); $event.stopPropagation()" icon="pi pi-cog" severity="secondary"></p-button>
|
|
||||||
<p-drawer [(visible)]="isSettingsDrawerVisible" [modal]="false" [position]="'right'" [style]="{ width: '340px' }" (click)="$event.stopPropagation()">
|
|
||||||
<ng-template pTemplate="header">
|
|
||||||
<div class="drawer-header">
|
|
||||||
<span class="drawer-title">Reader Settings</span>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<div class="settings-container">
|
|
||||||
<div class="settings-card">
|
|
||||||
<div class="card-header">
|
|
||||||
<i class="pi pi-text-height"></i>
|
|
||||||
<span>Typography</span>
|
|
||||||
</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="setting-row">
|
|
||||||
<label>Font Size</label>
|
|
||||||
<div class="font-size-controls">
|
|
||||||
<button class="control-btn" (click)="decreaseFontSize()">
|
|
||||||
<i class="pi pi-minus"></i>
|
|
||||||
</button>
|
|
||||||
<span class="font-size-value">{{ fontSize }}%</span>
|
|
||||||
<button class="control-btn" (click)="increaseFontSize()">
|
|
||||||
<i class="pi pi-plus"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="setting-row">
|
|
||||||
<label for="font-type">Font Family</label>
|
|
||||||
<p-select
|
|
||||||
appendTo="body"
|
|
||||||
id="font-type"
|
|
||||||
[options]="fontTypes"
|
|
||||||
[(ngModel)]="selectedFontType"
|
|
||||||
(onChange)="changeFontType()"
|
|
||||||
[style]="{ width: '100%' }"
|
|
||||||
[loading]="!customFontsReady"
|
|
||||||
placeholder="Loading fonts...">
|
|
||||||
</p-select>
|
|
||||||
</div>
|
|
||||||
<div class="setting-row">
|
|
||||||
<label>Line Height</label>
|
|
||||||
<div class="slider-container">
|
|
||||||
<span class="slider-value">{{ lineHeight }}</span>
|
|
||||||
<p-slider
|
|
||||||
[(ngModel)]="lineHeight"
|
|
||||||
[min]="1"
|
|
||||||
[max]="2.5"
|
|
||||||
[step]="0.1"
|
|
||||||
(onSlideEnd)="updateThemeStyle()"
|
|
||||||
[style]="{ width: '100%' }">
|
|
||||||
</p-slider>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="setting-row">
|
|
||||||
<label>Letter Spacing</label>
|
|
||||||
<div class="slider-container">
|
|
||||||
<span class="slider-value">{{ letterSpacing ?? 0 }} em</span>
|
|
||||||
<p-slider
|
|
||||||
[(ngModel)]="letterSpacing"
|
|
||||||
[min]="0"
|
|
||||||
[max]="0.2"
|
|
||||||
[step]="0.01"
|
|
||||||
(onSlideEnd)="updateThemeStyle()"
|
|
||||||
[style]="{ width: '100%' }">
|
|
||||||
</p-slider>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="settings-card">
|
|
||||||
<div class="card-header">
|
|
||||||
<i class="pi pi-palette"></i>
|
|
||||||
<span>Appearance</span>
|
|
||||||
</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="setting-row">
|
|
||||||
<label>Theme</label>
|
|
||||||
<div class="theme-selector">
|
|
||||||
@for (theme of themes; track theme) {
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="theme-option"
|
|
||||||
[class.selected]="selectedTheme === theme.value"
|
|
||||||
[style.background-color]="getThemeColor(theme.value)"
|
|
||||||
(click)="selectTheme(theme.value)"
|
|
||||||
[attr.aria-label]="theme.label"
|
|
||||||
[pTooltip]="theme.label"
|
|
||||||
tooltipPosition="bottom">
|
|
||||||
@if (selectedTheme === theme.value) {
|
|
||||||
<i class="pi pi-check"></i>
|
|
||||||
}
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="settings-card">
|
|
||||||
<div class="card-header">
|
|
||||||
<i class="pi pi-file"></i>
|
|
||||||
<span>Layout</span>
|
|
||||||
</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="setting-row">
|
|
||||||
<label>Reading Mode</label>
|
|
||||||
<div class="toggle-group">
|
|
||||||
<button
|
|
||||||
class="toggle-option"
|
|
||||||
[class.active]="selectedFlow === 'paginated'"
|
|
||||||
(click)="selectedFlow = 'paginated'; changeScrollMode()">
|
|
||||||
<i class="pi pi-book"></i>
|
|
||||||
<span>Paginated</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="toggle-option"
|
|
||||||
[class.active]="selectedFlow === 'scrolled'"
|
|
||||||
(click)="selectedFlow = 'scrolled'; changeScrollMode()">
|
|
||||||
<i class="pi pi-align-justify"></i>
|
|
||||||
<span>Scrolled</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@if (selectedFlow === 'paginated' && !isMobileDevice()) {
|
|
||||||
<div class="setting-row">
|
|
||||||
<label>Page Spread</label>
|
|
||||||
<div class="toggle-group">
|
|
||||||
<button
|
|
||||||
class="toggle-option"
|
|
||||||
[class.active]="selectedSpread === 'single'"
|
|
||||||
(click)="selectedSpread = 'single'; changeSpreadMode()">
|
|
||||||
<i class="pi pi-file"></i>
|
|
||||||
<span>Single</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="toggle-option"
|
|
||||||
[class.active]="selectedSpread === 'double'"
|
|
||||||
(click)="selectedSpread = 'double'; changeSpreadMode()">
|
|
||||||
<i class="pi pi-copy"></i>
|
|
||||||
<span>Double</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p-drawer>
|
|
||||||
</div>
|
|
||||||
<p-button
|
|
||||||
size="small"
|
|
||||||
icon="pi pi-times"
|
|
||||||
(click)="closeReader(); $event.stopPropagation()"
|
|
||||||
severity="secondary"
|
|
||||||
pTooltip="Close Reader"
|
|
||||||
tooltipPosition="bottom">
|
|
||||||
</p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="epubContainer"
|
|
||||||
#epubContainer
|
|
||||||
[class.paginated-mode]="selectedFlow === 'paginated'"
|
|
||||||
(click)="onBookClick($event)"
|
|
||||||
(mousemove)="onBookMouseMove($event)"></div>
|
|
||||||
@if (selectedFlow !== 'scrolled') {
|
|
||||||
<button class="epub-controls-left" [class.visible]="showControls" [class.dark-theme]="selectedTheme === 'black' || selectedTheme === 'grey'" (click)="prevPage(); onBookTouch()">←</button>
|
|
||||||
}
|
|
||||||
@if (selectedFlow !== 'scrolled') {
|
|
||||||
<button class="epub-controls-right" [class.visible]="showControls" [class.dark-theme]="selectedTheme === 'black' || selectedTheme === 'grey'" (click)="nextPage(); onBookTouch()">→</button>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<app-bookmark-edit-dialog
|
|
||||||
[(visible)]="showEditBookmarkDialog"
|
|
||||||
[bookmark]="editingBookmark"
|
|
||||||
[isSaving]="isEditingBookmark"
|
|
||||||
(save)="onBookmarkSave($event)"
|
|
||||||
(cancelEdit)="onBookmarkCancel()">
|
|
||||||
</app-bookmark-edit-dialog>
|
|
||||||
<app-bookmark-view-dialog
|
|
||||||
[(visible)]="viewDialogVisible"
|
|
||||||
[bookmark]="selectedBookmark">
|
|
||||||
</app-bookmark-view-dialog>
|
|
||||||
-799
@@ -1,799 +0,0 @@
|
|||||||
.epub-header {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-left: 1rem;
|
|
||||||
padding-right: 1rem;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 1001;
|
|
||||||
background: linear-gradient(180deg,
|
|
||||||
rgba(0, 0, 0, 0.85) 0%,
|
|
||||||
rgba(0, 0, 0, 0.75) 100%);
|
|
||||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
min-height: 3rem;
|
|
||||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
||||||
pointer-events: auto;
|
|
||||||
|
|
||||||
&.hidden {
|
|
||||||
transform: translateY(-100%);
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-center {
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
pointer-events: none;
|
|
||||||
max-width: 40%;
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
max-width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
max-width: 40%;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: rgba(255, 255, 255, 0.95);
|
|
||||||
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
|
|
||||||
font-weight: 500;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-info {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-percentage {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: rgba(255, 255, 255, 0.95);
|
|
||||||
font-weight: 600;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
|
||||||
padding: 0.375rem 0.75rem;
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-label {
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.epub-viewer-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100dvh;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner-wrapper {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: var(--ground-background);
|
|
||||||
z-index: 1002;
|
|
||||||
}
|
|
||||||
|
|
||||||
#epubContainer {
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
overflow: auto;
|
|
||||||
pointer-events: auto;
|
|
||||||
|
|
||||||
&.paginated-mode {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-toggle-button,
|
|
||||||
.settings-toggle-button {
|
|
||||||
top: 10px;
|
|
||||||
z-index: 1000;
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
&::ng-deep .p-button {
|
|
||||||
background: rgba(255, 255, 255, 0.1) !important;
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
|
||||||
color: rgba(255, 255, 255, 0.95) !important;
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
transition: all 0.2s ease !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: rgba(255, 255, 255, 0.2) !important;
|
|
||||||
border-color: rgba(255, 255, 255, 0.3) !important;
|
|
||||||
transform: scale(1.05);
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: scale(0.95);
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-button-icon {
|
|
||||||
color: rgba(255, 255, 255, 0.95) !important;
|
|
||||||
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-toggle-button {
|
|
||||||
left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-toggle-button {
|
|
||||||
right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.epub-controls-left,
|
|
||||||
.epub-controls-right {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
z-index: 10;
|
|
||||||
font-size: 30px;
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
cursor: pointer;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
padding: 10px;
|
|
||||||
transition: color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
|
|
||||||
|
|
||||||
&.dark-theme {
|
|
||||||
color: rgba(255, 255, 255, 0.7);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: rgba(255, 255, 255, 0.95);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
opacity: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
|
|
||||||
&.visible {
|
|
||||||
opacity: 1;
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.epub-controls-left {
|
|
||||||
left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.epub-controls-right {
|
|
||||||
right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.epub-controls-left:hover,
|
|
||||||
.epub-controls-right:hover {
|
|
||||||
color: rgba(0, 0, 0, 0.8);
|
|
||||||
transform: scale(1.1) translateY(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.epub-controls-left:focus,
|
|
||||||
.epub-controls-right:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter-list {
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter-item {
|
|
||||||
padding: 0.4rem 0.25rem;
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
background-color: transparent;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 0.25rem;
|
|
||||||
|
|
||||||
.chapter-icon {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
color: var(--primary-color);
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter-label {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
|
|
||||||
transform: translateX(4px);
|
|
||||||
|
|
||||||
.chapter-icon {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.current-chapter {
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: 600;
|
|
||||||
background: linear-gradient(135deg,
|
|
||||||
color-mix(in srgb, var(--primary-color) 15%, transparent),
|
|
||||||
color-mix(in srgb, var(--primary-color) 8%, transparent));
|
|
||||||
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-color) 25%, transparent);
|
|
||||||
|
|
||||||
.chapter-icon {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: linear-gradient(135deg,
|
|
||||||
color-mix(in srgb, var(--primary-color) 20%, transparent),
|
|
||||||
color-mix(in srgb, var(--primary-color) 12%, transparent));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-list {
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-item {
|
|
||||||
padding: 0.4rem 0.75rem;
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
background-color: transparent;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 0.25rem;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.bookmark-icon {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--primary-color);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-label {
|
|
||||||
flex: 1;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-actions {
|
|
||||||
opacity: 0;
|
|
||||||
display: flex;
|
|
||||||
gap: 0.25rem;
|
|
||||||
margin-left: auto;
|
|
||||||
transition: opacity 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-action-btn {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 0.375rem;
|
|
||||||
border-radius: 0.375rem;
|
|
||||||
color: color-mix(in srgb, var(--text-color) 60%, transparent);
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
flex-shrink: 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: color-mix(in srgb, var(--primary-color) 15%, transparent);
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.delete:hover {
|
|
||||||
background: color-mix(in srgb, #ef4444 15%, transparent);
|
|
||||||
color: #ef4444;
|
|
||||||
}
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
|
|
||||||
transform: translateX(4px);
|
|
||||||
|
|
||||||
.bookmark-actions {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.75rem;
|
|
||||||
cursor: pointer;
|
|
||||||
flex: 1;
|
|
||||||
color: var(--text-color);
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
i {
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmark-title {
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-state {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 2rem 1rem;
|
|
||||||
text-align: center;
|
|
||||||
color: color-mix(in srgb, var(--text-color) 50%, transparent);
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 2.5rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
font-weight: 500;
|
|
||||||
margin: 0 0 0.25rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-card {
|
|
||||||
background: color-mix(in srgb, var(--surface-card) 50%, var(--surface-ground));
|
|
||||||
border: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent);
|
|
||||||
border-radius: 0.75rem;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
||||||
border-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.625rem;
|
|
||||||
padding: 1rem 1.125rem;
|
|
||||||
background: linear-gradient(135deg,
|
|
||||||
color-mix(in srgb, var(--primary-color) 8%, transparent),
|
|
||||||
color-mix(in srgb, var(--primary-color) 4%, transparent));
|
|
||||||
border-bottom: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
|
|
||||||
|
|
||||||
i {
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 0.9375rem;
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-content {
|
|
||||||
padding: 1.5rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1.25rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-row {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.625rem;
|
|
||||||
|
|
||||||
> label {
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-color);
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.025em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-size-controls {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
background: color-mix(in srgb, var(--text-color) 5%, transparent);
|
|
||||||
padding: 0.5rem;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
width: fit-content;
|
|
||||||
|
|
||||||
.control-btn {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
width: 2rem;
|
|
||||||
height: 2rem;
|
|
||||||
border-radius: 0.375rem;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: scale(1.05);
|
|
||||||
box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color) 40%, transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: scale(0.95);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-size-value {
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-color);
|
|
||||||
min-width: 3rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.5rem;
|
|
||||||
padding: 0 0.75rem;
|
|
||||||
|
|
||||||
.slider-value {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--primary-color);
|
|
||||||
align-self: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.theme-selector {
|
|
||||||
display: flex;
|
|
||||||
gap: 0.75rem;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.theme-option {
|
|
||||||
width: 3rem;
|
|
||||||
height: 3rem;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
border: 2px solid transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
i {
|
|
||||||
color: white;
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: bold;
|
|
||||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: scale(1.1);
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.selected {
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 25%, transparent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle-group {
|
|
||||||
display: flex;
|
|
||||||
gap: 0.5rem;
|
|
||||||
background: color-mix(in srgb, var(--text-color) 5%, transparent);
|
|
||||||
padding: 0.375rem;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
|
|
||||||
.toggle-option {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
padding: 0.5rem 0.8rem;
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
border-radius: 0.375rem;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
color: color-mix(in srgb, var(--text-color) 70%, transparent);
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 0.95rem;
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 0.95rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: color-mix(in srgb, var(--text-color) 8%, transparent);
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: white;
|
|
||||||
box-shadow: 0 2px 6px color-mix(in srgb, var(--primary-color) 30%, transparent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .p-divider.p-divider-horizontal {
|
|
||||||
margin: 0.25rem 0 0.5rem 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.75rem;
|
|
||||||
|
|
||||||
i {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-title {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-section {
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
|
|
||||||
.section-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
border-bottom: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent);
|
|
||||||
|
|
||||||
i {
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-color);
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-content {
|
|
||||||
padding: 0 0.25rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-divider {
|
|
||||||
height: 1px;
|
|
||||||
background: linear-gradient(to right, transparent, color-mix(in srgb, var(--text-color) 20%, transparent), transparent);
|
|
||||||
margin: 1.5rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .p-drawer .p-tabs {
|
|
||||||
.p-tablist {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 2px solid color-mix(in srgb, var(--text-color) 10%, transparent);
|
|
||||||
padding: 0 1rem;
|
|
||||||
margin: 0 -1rem;
|
|
||||||
display: flex;
|
|
||||||
gap: 0;
|
|
||||||
|
|
||||||
.p-tab {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 2px solid transparent;
|
|
||||||
padding: 1rem 1.5rem;
|
|
||||||
margin-bottom: -2px;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: color-mix(in srgb, var(--primary-color) 5%, transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
&[aria-selected="true"] {
|
|
||||||
border-bottom-color: var(--primary-color);
|
|
||||||
|
|
||||||
.tab-header {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-tab:focus-visible {
|
|
||||||
box-shadow: none;
|
|
||||||
outline: 2px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-tabpanels {
|
|
||||||
background: transparent;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
.p-tabpanel {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .p-drawer-left {
|
|
||||||
.p-drawer-content {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
font-size: 0.9375rem;
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-content {
|
|
||||||
padding: 1.25rem 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .header-right {
|
|
||||||
.p-button {
|
|
||||||
background: rgba(255, 255, 255, 0.1) !important;
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
|
||||||
color: rgba(255, 255, 255, 0.95) !important;
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
transition: all 0.2s ease !important;
|
|
||||||
|
|
||||||
&:hover:not(:disabled) {
|
|
||||||
background: rgba(255, 255, 255, 0.2) !important;
|
|
||||||
border-color: rgba(255, 255, 255, 0.3) !important;
|
|
||||||
transform: scale(1.05);
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active:not(:disabled) {
|
|
||||||
transform: scale(0.95);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:disabled {
|
|
||||||
opacity: 0.5;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-button-icon {
|
|
||||||
color: rgba(255, 255, 255, 0.95) !important;
|
|
||||||
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
|
||||||
|
|
||||||
&.pi-bookmark-fill {
|
|
||||||
color: #fbbf24 !important;
|
|
||||||
filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.5));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-indicator {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 0.5rem;
|
|
||||||
|
|
||||||
.dot {
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #fbbf24;
|
|
||||||
box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
|
|
||||||
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes pulse {
|
|
||||||
0%, 100% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-backdrop {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
z-index: 999;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,47 +0,0 @@
|
|||||||
import { Book, EpubCFI, Location, TocItem } from 'epubjs';
|
|
||||||
|
|
||||||
export const FALLBACK_EPUB_SETTINGS = {
|
|
||||||
maxFontSize: 300,
|
|
||||||
minFontSize: 50
|
|
||||||
};
|
|
||||||
|
|
||||||
export function flatten(chapters: TocItem[]): TocItem[] {
|
|
||||||
if (!chapters || !Array.isArray(chapters)) return [];
|
|
||||||
return chapters.flatMap((chapter: TocItem) => [chapter, ...flatten(chapter.subitems || [])]);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getCfiFromHref(book: Book, href: string): string | null {
|
|
||||||
const [_, id] = href.split('#');
|
|
||||||
const section = book.spine.get(href);
|
|
||||||
|
|
||||||
if (!section || !section.document) {
|
|
||||||
console.debug('Section or section.document is undefined for href:', href);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const el = id ? section.document.getElementById(id) : section.document.body;
|
|
||||||
if (!el) {
|
|
||||||
console.debug('Element not found in section.document for href:', href);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return section.cfiFromElement(el);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getChapter(book: Book, location: Location): TocItem | null {
|
|
||||||
const locationHref = location.start.href;
|
|
||||||
return flatten(book.navigation.toc || [])
|
|
||||||
.filter((chapter: TocItem) => {
|
|
||||||
return chapter.href && book.canonical && typeof book.canonical === 'function' &&
|
|
||||||
book.canonical(chapter.href).includes(book.canonical(locationHref));
|
|
||||||
})
|
|
||||||
.reduce((result: TocItem | null, chapter: TocItem) => {
|
|
||||||
if (!chapter.href) return result;
|
|
||||||
const chapterCfi = getCfiFromHref(book, chapter.href);
|
|
||||||
if (!chapterCfi) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
const locationAfterChapter = (EpubCFI.prototype as any).compare(location.start.cfi, chapterCfi) > 0;
|
|
||||||
return locationAfterChapter ? chapter : result;
|
|
||||||
}, null);
|
|
||||||
}
|
|
||||||
@@ -1,226 +0,0 @@
|
|||||||
interface EpubThemeObject {
|
|
||||||
body?: Record<string, string>;
|
|
||||||
p?: Record<string, string>;
|
|
||||||
'h1, h2, h3, h4, h5, h6'?: Record<string, string>;
|
|
||||||
a?: Record<string, string>;
|
|
||||||
img?: Record<string, string>;
|
|
||||||
code?: Record<string, string>;
|
|
||||||
'*'?: Record<string, string>;
|
|
||||||
[key: string]: Record<string, string> | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EpubRenditionThemes {
|
|
||||||
register(name: string, theme: EpubThemeObject): void;
|
|
||||||
select(name: string): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EpubRenditionMinimal {
|
|
||||||
themes: {
|
|
||||||
register(name: string, theme: Record<string, Record<string, string>>): void;
|
|
||||||
select(name: string): void;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EpubTheme {
|
|
||||||
WHITE = 'white',
|
|
||||||
BLACK = 'black',
|
|
||||||
GREY = 'grey',
|
|
||||||
SEPIA = 'sepia',
|
|
||||||
GREEN = 'green',
|
|
||||||
LAVENDER = 'lavender',
|
|
||||||
CREAM = 'cream',
|
|
||||||
LIGHT_BLUE = 'light-blue',
|
|
||||||
PEACH = 'peach',
|
|
||||||
MINT = 'mint',
|
|
||||||
DARK_SLATE = 'dark-slate',
|
|
||||||
DARK_OLIVE = 'dark-olive',
|
|
||||||
DARK_PURPLE = 'dark-purple',
|
|
||||||
DARK_TEAL = 'dark-teal',
|
|
||||||
DARK_BROWN = 'dark-brown'
|
|
||||||
}
|
|
||||||
|
|
||||||
export class EpubThemeUtil {
|
|
||||||
static readonly themesMap = new Map<string, EpubThemeObject>([
|
|
||||||
[EpubTheme.BLACK, {
|
|
||||||
"body": {"background-color": "#000000", "color": "#f9f9f9"},
|
|
||||||
"p": {"color": "#f9f9f9"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#f9f9f9"},
|
|
||||||
"a": {"color": "#f9f9f9"},
|
|
||||||
"img": {"-webkit-filter": "none", "filter": "none"},
|
|
||||||
"code": {"color": "#00ff00", "background-color": "black"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.SEPIA, {
|
|
||||||
"body": {"background-color": "#f4ecd8", "color": "#6e4b3a"},
|
|
||||||
"p": {"color": "#6e4b3a"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#6e4b3a"},
|
|
||||||
"a": {"color": "#8b4513"},
|
|
||||||
"img": {"-webkit-filter": "none", "filter": "none"},
|
|
||||||
"code": {"color": "#8b0000", "background-color": "#f4ecd8"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.WHITE, {
|
|
||||||
"body": {"background-color": "#ffffff", "color": "#000000"},
|
|
||||||
"p": {"color": "#000000"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#000000"},
|
|
||||||
"a": {"color": "#000000"},
|
|
||||||
"img": {"-webkit-filter": "none", "filter": "none"},
|
|
||||||
"code": {"color": "#d14", "background-color": "#f5f5f5"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.GREY, {
|
|
||||||
"body": {"background-color": "#404040", "color": "#d3d3d3"},
|
|
||||||
"p": {"color": "#d3d3d3"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#d3d3d3"},
|
|
||||||
"a": {"color": "#1e90ff"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#d14", "background-color": "#585858"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.GREEN, {
|
|
||||||
"body": {"background-color": "rgb(232, 245, 233)", "color": "#1b5e20"},
|
|
||||||
"p": {"color": "#1b5e20"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#1b5e20"},
|
|
||||||
"a": {"color": "#2e7d32"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#c62828", "background-color": "#e8f5e9"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.LAVENDER, {
|
|
||||||
"body": {"background-color": "rgb(243, 237, 247)", "color": "#4a148c"},
|
|
||||||
"p": {"color": "#4a148c"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#4a148c"},
|
|
||||||
"a": {"color": "#6a1b9a"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#c62828", "background-color": "#f3e5f5"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.CREAM, {
|
|
||||||
"body": {"background-color": "rgb(255, 253, 245)", "color": "#3e2723"},
|
|
||||||
"p": {"color": "#3e2723"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#3e2723"},
|
|
||||||
"a": {"color": "#5d4037"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#d84315", "background-color": "#fff8e1"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.LIGHT_BLUE, {
|
|
||||||
"body": {"background-color": "rgb(232, 244, 253)", "color": "#01579b"},
|
|
||||||
"p": {"color": "#01579b"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#01579b"},
|
|
||||||
"a": {"color": "#0277bd"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#c62828", "background-color": "#e1f5fe"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.PEACH, {
|
|
||||||
"body": {"background-color": "rgb(255, 243, 238)", "color": "#bf360c"},
|
|
||||||
"p": {"color": "#bf360c"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#bf360c"},
|
|
||||||
"a": {"color": "#d84315"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#c62828", "background-color": "#fbe9e7"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.MINT, {
|
|
||||||
"body": {"background-color": "rgb(224, 247, 250)", "color": "#004d40"},
|
|
||||||
"p": {"color": "#004d40"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#004d40"},
|
|
||||||
"a": {"color": "#00695c"},
|
|
||||||
"img": {"filter": "none"},
|
|
||||||
"code": {"color": "#c62828", "background-color": "#e0f2f1"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.DARK_SLATE, {
|
|
||||||
"body": {"background-color": "rgb(47, 55, 66)", "color": "#e4e7eb"},
|
|
||||||
"p": {"color": "#e4e7eb"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#f0f3f7"},
|
|
||||||
"a": {"color": "#7dd3fc"},
|
|
||||||
"img": {"filter": "brightness(0.9)"},
|
|
||||||
"code": {"color": "#fbbf24", "background-color": "#374151"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.DARK_OLIVE, {
|
|
||||||
"body": {"background-color": "rgb(56, 61, 47)", "color": "#e8ecd7"},
|
|
||||||
"p": {"color": "#e8ecd7"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#f4f7e3"},
|
|
||||||
"a": {"color": "#bef264"},
|
|
||||||
"img": {"filter": "brightness(0.9)"},
|
|
||||||
"code": {"color": "#fde047", "background-color": "#3f4536"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.DARK_PURPLE, {
|
|
||||||
"body": {"background-color": "rgb(49, 39, 67)", "color": "#e9d5ff"},
|
|
||||||
"p": {"color": "#e9d5ff"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#f3e8ff"},
|
|
||||||
"a": {"color": "#d8b4fe"},
|
|
||||||
"img": {"filter": "brightness(0.9)"},
|
|
||||||
"code": {"color": "#fde047", "background-color": "#3b2d4f"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.DARK_TEAL, {
|
|
||||||
"body": {"background-color": "rgb(29, 53, 56)", "color": "#ccfbf1"},
|
|
||||||
"p": {"color": "#ccfbf1"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#e0fdf8"},
|
|
||||||
"a": {"color": "#5eead4"},
|
|
||||||
"img": {"filter": "brightness(0.9)"},
|
|
||||||
"code": {"color": "#fde047", "background-color": "#204145"}
|
|
||||||
}],
|
|
||||||
[EpubTheme.DARK_BROWN, {
|
|
||||||
"body": {"background-color": "rgb(54, 42, 36)", "color": "#f5e6d3"},
|
|
||||||
"p": {"color": "#f5e6d3"},
|
|
||||||
"h1, h2, h3, h4, h5, h6": {"color": "#fef3e2"},
|
|
||||||
"a": {"color": "#fcd34d"},
|
|
||||||
"img": {"filter": "brightness(0.9)"},
|
|
||||||
"code": {"color": "#fde047", "background-color": "#42332d"}
|
|
||||||
}]
|
|
||||||
]);
|
|
||||||
|
|
||||||
static getThemeColor(themeKey: string | undefined): string {
|
|
||||||
switch (themeKey) {
|
|
||||||
case EpubTheme.WHITE:
|
|
||||||
return '#ffffff';
|
|
||||||
case EpubTheme.BLACK:
|
|
||||||
return '#000000';
|
|
||||||
case EpubTheme.GREY:
|
|
||||||
return '#808080';
|
|
||||||
case EpubTheme.SEPIA:
|
|
||||||
return '#704214';
|
|
||||||
case EpubTheme.GREEN:
|
|
||||||
return 'rgb(232, 245, 233)';
|
|
||||||
case EpubTheme.LAVENDER:
|
|
||||||
return 'rgb(243, 237, 247)';
|
|
||||||
case EpubTheme.CREAM:
|
|
||||||
return 'rgb(255, 253, 245)';
|
|
||||||
case EpubTheme.LIGHT_BLUE:
|
|
||||||
return 'rgb(232, 244, 253)';
|
|
||||||
case EpubTheme.PEACH:
|
|
||||||
return 'rgb(255, 243, 238)';
|
|
||||||
case EpubTheme.MINT:
|
|
||||||
return 'rgb(224, 247, 250)';
|
|
||||||
case EpubTheme.DARK_SLATE:
|
|
||||||
return 'rgb(47, 55, 66)';
|
|
||||||
case EpubTheme.DARK_OLIVE:
|
|
||||||
return 'rgb(56, 61, 47)';
|
|
||||||
case EpubTheme.DARK_PURPLE:
|
|
||||||
return 'rgb(49, 39, 67)';
|
|
||||||
case EpubTheme.DARK_TEAL:
|
|
||||||
return 'rgb(29, 53, 56)';
|
|
||||||
case EpubTheme.DARK_BROWN:
|
|
||||||
return 'rgb(54, 42, 36)';
|
|
||||||
default:
|
|
||||||
return '#ffffff';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static applyTheme(rendition: EpubRenditionMinimal, themeKey: string, fontFamily?: string, fontSize?: number, lineHeight?: number, letterSpacing?: number): void {
|
|
||||||
if (!rendition) return;
|
|
||||||
|
|
||||||
const baseTheme = this.themesMap.get(themeKey ?? 'black') as EpubThemeObject ?? {};
|
|
||||||
const combined: EpubThemeObject = {
|
|
||||||
...baseTheme,
|
|
||||||
body: {
|
|
||||||
...(baseTheme.body || {}),
|
|
||||||
...(fontFamily && { 'font-family': fontFamily }),
|
|
||||||
'font-size': `${fontSize ?? 100}%`,
|
|
||||||
...(lineHeight && { 'line-height': lineHeight.toString() }),
|
|
||||||
'letter-spacing': `${letterSpacing ?? 0}em`
|
|
||||||
},
|
|
||||||
'*': {
|
|
||||||
...(baseTheme['*'] || {}),
|
|
||||||
...(lineHeight && { 'line-height': lineHeight.toString() }),
|
|
||||||
'letter-spacing': `${letterSpacing ?? 0}em`
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
rendition.themes.register('custom', combined as Record<string, Record<string, string>>);
|
|
||||||
rendition.themes.select('custom');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user