Compare commits
89 Commits
0.9.0
...
ZXY101-pat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0b4e3edf0 | ||
|
|
683a456202 | ||
|
|
9a4c86870a | ||
|
|
bc5b9ccd16 | ||
|
|
6c16008aae | ||
|
|
b281052908 | ||
|
|
52619b1a9b | ||
|
|
a30c526a63 | ||
|
|
7fb55f5399 | ||
|
|
6220b6172e | ||
|
|
a9f7bca27c | ||
|
|
0ebeb46171 | ||
|
|
1fdbdf5185 | ||
|
|
109241e584 | ||
|
|
ec632b534b | ||
|
|
bc7cb721d3 | ||
|
|
5a5dc189fb | ||
|
|
7baf586d3b | ||
|
|
3e487caad9 | ||
|
|
44b8989f2e | ||
|
|
b4573fd955 | ||
|
|
08eee8f62c | ||
|
|
37c4aa1572 | ||
|
|
3b237e15f5 | ||
|
|
edea5aea08 | ||
|
|
940313310b | ||
|
|
6daeb966c5 | ||
|
|
8ecc96e92e | ||
|
|
cc3448f6ba | ||
|
|
491b9603af | ||
|
|
bec5e84067 | ||
|
|
8ef7f6447f | ||
|
|
d57de2ec56 | ||
|
|
1007b3e4ae | ||
|
|
39d4e0f072 | ||
|
|
5d3f17679b | ||
|
|
032d56a20e | ||
|
|
282cad6558 | ||
|
|
5bc486660c | ||
|
|
e511a0a39b | ||
|
|
18f5e3ae46 | ||
|
|
050228765e | ||
|
|
89acdddccb | ||
|
|
1946b12623 | ||
|
|
1df387526a | ||
|
|
491c4efab2 | ||
|
|
04dd68b242 | ||
|
|
83843ff5dd | ||
|
|
66e8dc6683 | ||
|
|
b1c4029345 | ||
|
|
49969caff7 | ||
|
|
34e3dbbe1b | ||
|
|
47228f2b96 | ||
|
|
87be518e02 | ||
|
|
a1a582f786 | ||
|
|
50ef5c9f40 | ||
|
|
28155496fc | ||
|
|
1c92a749be | ||
|
|
2e28843a07 | ||
|
|
159a6d50d4 | ||
|
|
28587e15c6 | ||
|
|
5226393eac | ||
|
|
3b2c0bedc3 | ||
|
|
6ecf57ccbe | ||
|
|
8757804140 | ||
|
|
dd881da036 | ||
|
|
14d0043bb7 | ||
|
|
5bb2a4033a | ||
|
|
692071eea0 | ||
|
|
eeef343027 | ||
|
|
487a591fb6 | ||
|
|
edbd443137 | ||
|
|
28201f5d88 | ||
|
|
c817cc8681 | ||
|
|
a18f66ca37 | ||
|
|
801ecf929e | ||
|
|
dffc3cbed0 | ||
|
|
b07d98a1c1 | ||
|
|
224f73d053 | ||
|
|
a2f59640af | ||
|
|
58a4b6be16 | ||
|
|
5e7ec34300 | ||
|
|
03370f1b9f | ||
|
|
a4e1e6f54a | ||
|
|
942d5d39f7 | ||
|
|
aa1f4703f1 | ||
|
|
137ea85d1a | ||
|
|
40deec881b | ||
|
|
a92828dde0 |
@@ -10,7 +10,7 @@ https://github.com/ZXY101/mokuro-reader/assets/39561296/45a214a8-3f69-461c-87d7-
|
|||||||
- Anki connect integration & image cropping
|
- Anki connect integration & image cropping
|
||||||
- Installation and offline support
|
- Installation and offline support
|
||||||
|
|
||||||
## Useage:
|
## Usage:
|
||||||
You can find the reader hosted [here](https://reader.mokuro.app/).
|
You can find the reader hosted [here](https://reader.mokuro.app/).
|
||||||
|
|
||||||
To import your manga, process it with mokuro and then upload your manga along with the generated `.mokuro` file.
|
To import your manga, process it with mokuro and then upload your manga along with the generated `.mokuro` file.
|
||||||
@@ -21,7 +21,7 @@ As of the moment base mokuro does not generate the `.mokuro` file, you need to i
|
|||||||
pip install git+https://github.com/kha-white/mokuro.git@web-reader
|
pip install git+https://github.com/kha-white/mokuro.git@web-reader
|
||||||
```
|
```
|
||||||
|
|
||||||
Once installed and your manga is processed, import it your manga to the reader.
|
Once installed and your manga is processed, import your manga into the reader.
|
||||||
|
|
||||||
## Development:
|
## Development:
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ cd mokuro-reader
|
|||||||
|
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
```bash
|
```bash
|
||||||
npm run install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the dev server:
|
Start the dev server:
|
||||||
|
|||||||
464
package-lock.json
generated
464
package-lock.json
generated
@@ -1,13 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "z-reader",
|
"name": "z-reader",
|
||||||
"version": "0.0.1",
|
"version": "0.9.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "z-reader",
|
"name": "z-reader",
|
||||||
"version": "0.0.1",
|
"version": "0.9.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/gapi": "^0.0.47",
|
||||||
|
"@types/google.accounts": "^0.0.14",
|
||||||
|
"@types/google.picker": "^0.0.42",
|
||||||
|
"@vercel/analytics": "^1.1.0",
|
||||||
"@zip.js/zip.js": "^2.7.20",
|
"@zip.js/zip.js": "^2.7.20",
|
||||||
"dexie": "^4.0.1-alpha.25",
|
"dexie": "^4.0.1-alpha.25",
|
||||||
"panzoom": "^9.4.3",
|
"panzoom": "^9.4.3",
|
||||||
@@ -16,6 +20,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "^2.0.0",
|
"@sveltejs/adapter-auto": "^2.0.0",
|
||||||
"@sveltejs/kit": "^1.20.4",
|
"@sveltejs/kit": "^1.20.4",
|
||||||
|
"@types/gapi.client.drive-v3": "^0.0.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||||
"@typescript-eslint/parser": "^5.45.0",
|
"@typescript-eslint/parser": "^5.45.0",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
@@ -479,6 +484,16 @@
|
|||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fastify/busboy": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@floating-ui/core": {
|
"node_modules/@floating-ui/core": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.4.1.tgz",
|
||||||
@@ -591,6 +606,26 @@
|
|||||||
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
|
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@maxim_mazurok/gapi.client.discovery-v1": {
|
||||||
|
"version": "0.1.20200806",
|
||||||
|
"resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.discovery-v1/-/gapi.client.discovery-v1-0.1.20200806.tgz",
|
||||||
|
"integrity": "sha512-Wl6UfmZVDdWbY3PUu8E2ULk9RPLjnMqp/iOA4tcK8Ne+U/GmlnWP/e34IaZNGArfl7iXJNOG+/3Rj9L9jQyF9Q==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/gapi.client": "*",
|
||||||
|
"@types/gapi.client.discovery-v1": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@maxim_mazurok/gapi.client.drive-v3": {
|
||||||
|
"version": "0.0.20240304",
|
||||||
|
"resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.drive-v3/-/gapi.client.drive-v3-0.0.20240304.tgz",
|
||||||
|
"integrity": "sha512-PuGvDvRE70XsyUqnQCq5M2VJ7/E7u5pDvHZfBXunVlf5mYmkyAdbZg+ygJDJ2243wWpUXjmEcuxLDY2yamIq4g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/gapi.client": "*",
|
||||||
|
"@types/gapi.client.discovery-v1": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nodelib/fs.scandir": {
|
"node_modules/@nodelib/fs.scandir": {
|
||||||
"version": "2.1.5",
|
"version": "2.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||||
@@ -655,24 +690,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/kit": {
|
"node_modules/@sveltejs/kit": {
|
||||||
"version": "1.22.3",
|
"version": "1.30.4",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.22.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.30.4.tgz",
|
||||||
"integrity": "sha512-IpHD5wvuoOIHYaHQUBJ1zERD2Iz+fB/rBXhXjl8InKw6X4VKE9BSus+ttHhE7Ke+Ie9ecfilzX8BnWE3FeQyng==",
|
"integrity": "sha512-JSQIQT6XvdchCRQEm7BABxPC56WP5RYVONAi+09S8tmzeP43fBsRlr95bFmsTQM2RHBldfgQk+jgdnsKI75daA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^2.4.1",
|
"@sveltejs/vite-plugin-svelte": "^2.5.0",
|
||||||
"@types/cookie": "^0.5.1",
|
"@types/cookie": "^0.5.1",
|
||||||
"cookie": "^0.5.0",
|
"cookie": "^0.5.0",
|
||||||
"devalue": "^4.3.1",
|
"devalue": "^4.3.1",
|
||||||
"esm-env": "^1.0.0",
|
"esm-env": "^1.0.0",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"magic-string": "^0.30.0",
|
"magic-string": "^0.30.0",
|
||||||
"mime": "^3.0.0",
|
"mrmime": "^1.0.1",
|
||||||
"sade": "^1.8.1",
|
"sade": "^1.8.1",
|
||||||
"set-cookie-parser": "^2.6.0",
|
"set-cookie-parser": "^2.6.0",
|
||||||
"sirv": "^2.0.2",
|
"sirv": "^2.0.2",
|
||||||
"undici": "~5.22.0"
|
"tiny-glob": "^0.2.9",
|
||||||
|
"undici": "^5.28.3"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"svelte-kit": "svelte-kit.js"
|
"svelte-kit": "svelte-kit.js"
|
||||||
@@ -681,36 +718,36 @@
|
|||||||
"node": "^16.14 || >=18"
|
"node": "^16.14 || >=18"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"svelte": "^3.54.0 || ^4.0.0-next.0",
|
"svelte": "^3.54.0 || ^4.0.0-next.0 || ^5.0.0-next.0",
|
||||||
"vite": "^4.0.0"
|
"vite": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/vite-plugin-svelte": {
|
"node_modules/@sveltejs/vite-plugin-svelte": {
|
||||||
"version": "2.4.3",
|
"version": "2.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.5.3.tgz",
|
||||||
"integrity": "sha512-NY2h+B54KHZO3kDURTdARqthn6D4YSIebtfW75NvZ/fwyk4G+AJw3V/i0OBjyN4406Ht9yZcnNWMuRUFnDNNiA==",
|
"integrity": "sha512-erhNtXxE5/6xGZz/M9eXsmI7Pxa6MS7jyTy06zN3Ck++ldrppOnOlJwHHTsMC7DHDQdgUp4NAc4cDNQ9eGdB/w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte-inspector": "^1.0.3",
|
"@sveltejs/vite-plugin-svelte-inspector": "^1.0.4",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"deepmerge": "^4.3.1",
|
"deepmerge": "^4.3.1",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"magic-string": "^0.30.1",
|
"magic-string": "^0.30.3",
|
||||||
"svelte-hmr": "^0.15.2",
|
"svelte-hmr": "^0.15.3",
|
||||||
"vitefu": "^0.2.4"
|
"vitefu": "^0.2.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14.18.0 || >= 16"
|
"node": "^14.18.0 || >= 16"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"svelte": "^3.54.0 || ^4.0.0",
|
"svelte": "^3.54.0 || ^4.0.0 || ^5.0.0-next.0",
|
||||||
"vite": "^4.0.0"
|
"vite": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/vite-plugin-svelte-inspector": {
|
"node_modules/@sveltejs/vite-plugin-svelte-inspector": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-1.0.4.tgz",
|
||||||
"integrity": "sha512-Khdl5jmmPN6SUsVuqSXatKpQTMIifoQPDanaxC84m9JxIibWvSABJyHpyys0Z+1yYrxY5TTEQm+6elh0XCMaOA==",
|
"integrity": "sha512-zjiuZ3yydBtwpF3bj0kQNV0YXe+iKE545QGZVTaylW3eAzFr+pJ/cwK8lZEaRp4JtaJXhD5DyWAV4AxLh6DgaQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
@@ -736,6 +773,45 @@
|
|||||||
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/gapi": {
|
||||||
|
"version": "0.0.47",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi/-/gapi-0.0.47.tgz",
|
||||||
|
"integrity": "sha512-/ZsLuq6BffMgbKMtZyDZ8vwQvTyKhKQ1G2K6VyWCgtHHhfSSXbk4+4JwImZiTjWNXfI2q1ZStAwFFHSkNoTkHA=="
|
||||||
|
},
|
||||||
|
"node_modules/@types/gapi.client": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.client/-/gapi.client-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-qJQUmmumbYym3Amax0S8CVzuSngcXsC1fJdwRS2zeW5lM63zXkw4wJFP+bG0jzgi0R6EsJKoHnGNVTDbOyG1ng==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/@types/gapi.client.discovery-v1": {
|
||||||
|
"version": "0.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.client.discovery-v1/-/gapi.client.discovery-v1-0.0.4.tgz",
|
||||||
|
"integrity": "sha512-uevhRumNE65F5mf2gABLaReOmbFSXONuzFZjNR3dYv6BmkHg+wciubHrfBAsp3554zNo3Dcg6dUAlwMqQfpwjQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@maxim_mazurok/gapi.client.discovery-v1": "latest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/gapi.client.drive-v3": {
|
||||||
|
"version": "0.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.client.drive-v3/-/gapi.client.drive-v3-0.0.4.tgz",
|
||||||
|
"integrity": "sha512-jE37dJ0EzAdY0aJPFOp20xmec/aO0P4HtUIA9k07RMPyedFDOcuMlSac1r0PklwQdgXF7BHaMoObNHNAnwSQUQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@maxim_mazurok/gapi.client.drive-v3": "latest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/google.accounts": {
|
||||||
|
"version": "0.0.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/google.accounts/-/google.accounts-0.0.14.tgz",
|
||||||
|
"integrity": "sha512-HqIVkVzpiLWhlajhQQd4rIV7czanFvXblJI2J1fSrL+VKQuQwwZ63m35D/mI0flsqKE6p/hNrAG0Yn4FD6JvNA=="
|
||||||
|
},
|
||||||
|
"node_modules/@types/google.picker": {
|
||||||
|
"version": "0.0.42",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/google.picker/-/google.picker-0.0.42.tgz",
|
||||||
|
"integrity": "sha512-7Ut1zDLCGNhyN+0fuIcncpBP9eUsIjLKz6qmVKvdkBUi1EzAskxTcIZcU/w2cO1ens/hEXlqeLd5qAKs/Kqqyw=="
|
||||||
|
},
|
||||||
"node_modules/@types/json-schema": {
|
"node_modules/@types/json-schema": {
|
||||||
"version": "7.0.12",
|
"version": "7.0.12",
|
||||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz",
|
||||||
@@ -942,6 +1018,14 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@vercel/analytics": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-k5ePYZPxitxxD1eJenPUUuH3qK+EtaA9OVD3oO0BRbyT/LarmZF0qdkptRSidip1arQxsTEIWvHbTuj1oksl+Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"server-only": "^0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@yr/monotone-cubic-spline": {
|
"node_modules/@yr/monotone-cubic-spline": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz",
|
||||||
@@ -1219,18 +1303,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/busboy": {
|
|
||||||
"version": "1.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
|
|
||||||
"integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"streamsearch": "^1.1.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.16.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/callsites": {
|
"node_modules/callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
@@ -1250,9 +1322,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001525",
|
"version": "1.0.30001597",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001525.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001597.tgz",
|
||||||
"integrity": "sha512-/3z+wB4icFt3r0USMwxujAqRvaD/B7rvGTsKhbhSQErVrJvkZCLhgNLJxU8MevahQVH6hCU9FsHdNUFbiwmE7Q==",
|
"integrity": "sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2105,6 +2177,12 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/globalyzer": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/globby": {
|
"node_modules/globby": {
|
||||||
"version": "11.1.0",
|
"version": "11.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
||||||
@@ -2125,6 +2203,12 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/globrex": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/graceful-fs": {
|
"node_modules/graceful-fs": {
|
||||||
"version": "4.2.11",
|
"version": "4.2.11",
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||||
@@ -2418,9 +2502,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/magic-string": {
|
"node_modules/magic-string": {
|
||||||
"version": "0.30.2",
|
"version": "0.30.5",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz",
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz",
|
||||||
"integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==",
|
"integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||||
@@ -2457,18 +2541,6 @@
|
|||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mime": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"mime": "cli.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/min-indent": {
|
"node_modules/min-indent": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
|
||||||
@@ -2556,9 +2628,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.6",
|
"version": "3.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
|
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2800,9 +2872,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.4.27",
|
"version": "8.4.33",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz",
|
||||||
"integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==",
|
"integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2819,7 +2891,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.6",
|
"nanoid": "^3.3.7",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"source-map-js": "^1.0.2"
|
"source-map-js": "^1.0.2"
|
||||||
},
|
},
|
||||||
@@ -3104,9 +3176,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rollup": {
|
"node_modules/rollup": {
|
||||||
"version": "3.27.0",
|
"version": "3.29.4",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz",
|
||||||
"integrity": "sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==",
|
"integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"rollup": "dist/bin/rollup"
|
"rollup": "dist/bin/rollup"
|
||||||
@@ -3210,6 +3282,11 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/server-only": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz",
|
||||||
|
"integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA=="
|
||||||
|
},
|
||||||
"node_modules/set-cookie-parser": {
|
"node_modules/set-cookie-parser": {
|
||||||
"version": "2.6.0",
|
"version": "2.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
|
||||||
@@ -3284,15 +3361,6 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/streamsearch": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/strip-ansi": {
|
"node_modules/strip-ansi": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
@@ -3499,15 +3567,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/svelte-hmr": {
|
"node_modules/svelte-hmr": {
|
||||||
"version": "0.15.2",
|
"version": "0.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz",
|
||||||
"integrity": "sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==",
|
"integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.20 || ^14.13.1 || >= 16"
|
"node": "^12.20 || ^14.13.1 || >= 16"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"svelte": "^3.19.0 || ^4.0.0-next.0"
|
"svelte": "^3.19.0 || ^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/svelte-preprocess": {
|
"node_modules/svelte-preprocess": {
|
||||||
@@ -3749,6 +3817,16 @@
|
|||||||
"node": ">=0.8"
|
"node": ">=0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tiny-glob": {
|
||||||
|
"version": "0.2.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
||||||
|
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"globalyzer": "0.1.0",
|
||||||
|
"globrex": "^0.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/to-regex-range": {
|
"node_modules/to-regex-range": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
@@ -3841,12 +3919,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
"node_modules/undici": {
|
||||||
"version": "5.22.1",
|
"version": "5.28.4",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
|
||||||
"integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==",
|
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"busboy": "^1.6.0"
|
"@fastify/busboy": "^2.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0"
|
"node": ">=14.0"
|
||||||
@@ -3898,14 +3977,15 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "4.4.7",
|
"version": "4.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz",
|
||||||
"integrity": "sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==",
|
"integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.18.10",
|
"esbuild": "^0.18.10",
|
||||||
"postcss": "^8.4.26",
|
"postcss": "^8.4.27",
|
||||||
"rollup": "^3.25.2"
|
"rollup": "^3.27.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"vite": "bin/vite.js"
|
"vite": "bin/vite.js"
|
||||||
@@ -3953,12 +4033,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vitefu": {
|
"node_modules/vitefu": {
|
||||||
"version": "0.2.4",
|
"version": "0.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz",
|
||||||
"integrity": "sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==",
|
"integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vite": "^3.0.0 || ^4.0.0"
|
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"vite": {
|
"vite": {
|
||||||
@@ -4235,6 +4315,12 @@
|
|||||||
"integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==",
|
"integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@fastify/busboy": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@floating-ui/core": {
|
"@floating-ui/core": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.4.1.tgz",
|
||||||
@@ -4330,6 +4416,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@maxim_mazurok/gapi.client.discovery-v1": {
|
||||||
|
"version": "0.1.20200806",
|
||||||
|
"resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.discovery-v1/-/gapi.client.discovery-v1-0.1.20200806.tgz",
|
||||||
|
"integrity": "sha512-Wl6UfmZVDdWbY3PUu8E2ULk9RPLjnMqp/iOA4tcK8Ne+U/GmlnWP/e34IaZNGArfl7iXJNOG+/3Rj9L9jQyF9Q==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/gapi.client": "*",
|
||||||
|
"@types/gapi.client.discovery-v1": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@maxim_mazurok/gapi.client.drive-v3": {
|
||||||
|
"version": "0.0.20240304",
|
||||||
|
"resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.drive-v3/-/gapi.client.drive-v3-0.0.20240304.tgz",
|
||||||
|
"integrity": "sha512-PuGvDvRE70XsyUqnQCq5M2VJ7/E7u5pDvHZfBXunVlf5mYmkyAdbZg+ygJDJ2243wWpUXjmEcuxLDY2yamIq4g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/gapi.client": "*",
|
||||||
|
"@types/gapi.client.discovery-v1": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@nodelib/fs.scandir": {
|
"@nodelib/fs.scandir": {
|
||||||
"version": "2.1.5",
|
"version": "2.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||||
@@ -4378,44 +4484,45 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@sveltejs/kit": {
|
"@sveltejs/kit": {
|
||||||
"version": "1.22.3",
|
"version": "1.30.4",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.22.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.30.4.tgz",
|
||||||
"integrity": "sha512-IpHD5wvuoOIHYaHQUBJ1zERD2Iz+fB/rBXhXjl8InKw6X4VKE9BSus+ttHhE7Ke+Ie9ecfilzX8BnWE3FeQyng==",
|
"integrity": "sha512-JSQIQT6XvdchCRQEm7BABxPC56WP5RYVONAi+09S8tmzeP43fBsRlr95bFmsTQM2RHBldfgQk+jgdnsKI75daA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^2.4.1",
|
"@sveltejs/vite-plugin-svelte": "^2.5.0",
|
||||||
"@types/cookie": "^0.5.1",
|
"@types/cookie": "^0.5.1",
|
||||||
"cookie": "^0.5.0",
|
"cookie": "^0.5.0",
|
||||||
"devalue": "^4.3.1",
|
"devalue": "^4.3.1",
|
||||||
"esm-env": "^1.0.0",
|
"esm-env": "^1.0.0",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"magic-string": "^0.30.0",
|
"magic-string": "^0.30.0",
|
||||||
"mime": "^3.0.0",
|
"mrmime": "^1.0.1",
|
||||||
"sade": "^1.8.1",
|
"sade": "^1.8.1",
|
||||||
"set-cookie-parser": "^2.6.0",
|
"set-cookie-parser": "^2.6.0",
|
||||||
"sirv": "^2.0.2",
|
"sirv": "^2.0.2",
|
||||||
"undici": "~5.22.0"
|
"tiny-glob": "^0.2.9",
|
||||||
|
"undici": "^5.28.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@sveltejs/vite-plugin-svelte": {
|
"@sveltejs/vite-plugin-svelte": {
|
||||||
"version": "2.4.3",
|
"version": "2.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.5.3.tgz",
|
||||||
"integrity": "sha512-NY2h+B54KHZO3kDURTdARqthn6D4YSIebtfW75NvZ/fwyk4G+AJw3V/i0OBjyN4406Ht9yZcnNWMuRUFnDNNiA==",
|
"integrity": "sha512-erhNtXxE5/6xGZz/M9eXsmI7Pxa6MS7jyTy06zN3Ck++ldrppOnOlJwHHTsMC7DHDQdgUp4NAc4cDNQ9eGdB/w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@sveltejs/vite-plugin-svelte-inspector": "^1.0.3",
|
"@sveltejs/vite-plugin-svelte-inspector": "^1.0.4",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"deepmerge": "^4.3.1",
|
"deepmerge": "^4.3.1",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"magic-string": "^0.30.1",
|
"magic-string": "^0.30.3",
|
||||||
"svelte-hmr": "^0.15.2",
|
"svelte-hmr": "^0.15.3",
|
||||||
"vitefu": "^0.2.4"
|
"vitefu": "^0.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@sveltejs/vite-plugin-svelte-inspector": {
|
"@sveltejs/vite-plugin-svelte-inspector": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-1.0.4.tgz",
|
||||||
"integrity": "sha512-Khdl5jmmPN6SUsVuqSXatKpQTMIifoQPDanaxC84m9JxIibWvSABJyHpyys0Z+1yYrxY5TTEQm+6elh0XCMaOA==",
|
"integrity": "sha512-zjiuZ3yydBtwpF3bj0kQNV0YXe+iKE545QGZVTaylW3eAzFr+pJ/cwK8lZEaRp4JtaJXhD5DyWAV4AxLh6DgaQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
@@ -4433,6 +4540,45 @@
|
|||||||
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/gapi": {
|
||||||
|
"version": "0.0.47",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi/-/gapi-0.0.47.tgz",
|
||||||
|
"integrity": "sha512-/ZsLuq6BffMgbKMtZyDZ8vwQvTyKhKQ1G2K6VyWCgtHHhfSSXbk4+4JwImZiTjWNXfI2q1ZStAwFFHSkNoTkHA=="
|
||||||
|
},
|
||||||
|
"@types/gapi.client": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.client/-/gapi.client-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-qJQUmmumbYym3Amax0S8CVzuSngcXsC1fJdwRS2zeW5lM63zXkw4wJFP+bG0jzgi0R6EsJKoHnGNVTDbOyG1ng==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/gapi.client.discovery-v1": {
|
||||||
|
"version": "0.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.client.discovery-v1/-/gapi.client.discovery-v1-0.0.4.tgz",
|
||||||
|
"integrity": "sha512-uevhRumNE65F5mf2gABLaReOmbFSXONuzFZjNR3dYv6BmkHg+wciubHrfBAsp3554zNo3Dcg6dUAlwMqQfpwjQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@maxim_mazurok/gapi.client.discovery-v1": "latest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/gapi.client.drive-v3": {
|
||||||
|
"version": "0.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.client.drive-v3/-/gapi.client.drive-v3-0.0.4.tgz",
|
||||||
|
"integrity": "sha512-jE37dJ0EzAdY0aJPFOp20xmec/aO0P4HtUIA9k07RMPyedFDOcuMlSac1r0PklwQdgXF7BHaMoObNHNAnwSQUQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@maxim_mazurok/gapi.client.drive-v3": "latest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/google.accounts": {
|
||||||
|
"version": "0.0.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/google.accounts/-/google.accounts-0.0.14.tgz",
|
||||||
|
"integrity": "sha512-HqIVkVzpiLWhlajhQQd4rIV7czanFvXblJI2J1fSrL+VKQuQwwZ63m35D/mI0flsqKE6p/hNrAG0Yn4FD6JvNA=="
|
||||||
|
},
|
||||||
|
"@types/google.picker": {
|
||||||
|
"version": "0.0.42",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/google.picker/-/google.picker-0.0.42.tgz",
|
||||||
|
"integrity": "sha512-7Ut1zDLCGNhyN+0fuIcncpBP9eUsIjLKz6qmVKvdkBUi1EzAskxTcIZcU/w2cO1ens/hEXlqeLd5qAKs/Kqqyw=="
|
||||||
|
},
|
||||||
"@types/json-schema": {
|
"@types/json-schema": {
|
||||||
"version": "7.0.12",
|
"version": "7.0.12",
|
||||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz",
|
||||||
@@ -4550,6 +4696,14 @@
|
|||||||
"eslint-visitor-keys": "^3.3.0"
|
"eslint-visitor-keys": "^3.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@vercel/analytics": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-k5ePYZPxitxxD1eJenPUUuH3qK+EtaA9OVD3oO0BRbyT/LarmZF0qdkptRSidip1arQxsTEIWvHbTuj1oksl+Q==",
|
||||||
|
"requires": {
|
||||||
|
"server-only": "^0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@yr/monotone-cubic-spline": {
|
"@yr/monotone-cubic-spline": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz",
|
||||||
@@ -4744,15 +4898,6 @@
|
|||||||
"integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
|
"integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"busboy": {
|
|
||||||
"version": "1.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
|
|
||||||
"integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"streamsearch": "^1.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"callsites": {
|
"callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
@@ -4766,9 +4911,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"caniuse-lite": {
|
"caniuse-lite": {
|
||||||
"version": "1.0.30001525",
|
"version": "1.0.30001597",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001525.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001597.tgz",
|
||||||
"integrity": "sha512-/3z+wB4icFt3r0USMwxujAqRvaD/B7rvGTsKhbhSQErVrJvkZCLhgNLJxU8MevahQVH6hCU9FsHdNUFbiwmE7Q==",
|
"integrity": "sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"chalk": {
|
"chalk": {
|
||||||
@@ -5385,6 +5530,12 @@
|
|||||||
"type-fest": "^0.20.2"
|
"type-fest": "^0.20.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"globalyzer": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"globby": {
|
"globby": {
|
||||||
"version": "11.1.0",
|
"version": "11.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
||||||
@@ -5399,6 +5550,12 @@
|
|||||||
"slash": "^3.0.0"
|
"slash": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"globrex": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"graceful-fs": {
|
"graceful-fs": {
|
||||||
"version": "4.2.11",
|
"version": "4.2.11",
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||||
@@ -5628,9 +5785,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"magic-string": {
|
"magic-string": {
|
||||||
"version": "0.30.2",
|
"version": "0.30.5",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz",
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz",
|
||||||
"integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==",
|
"integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||||
@@ -5658,12 +5815,6 @@
|
|||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mime": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"min-indent": {
|
"min-indent": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
|
||||||
@@ -5730,9 +5881,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nanoid": {
|
"nanoid": {
|
||||||
"version": "3.3.6",
|
"version": "3.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
|
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"natural-compare": {
|
"natural-compare": {
|
||||||
@@ -5908,12 +6059,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"postcss": {
|
"postcss": {
|
||||||
"version": "8.4.27",
|
"version": "8.4.33",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz",
|
||||||
"integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==",
|
"integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"nanoid": "^3.3.6",
|
"nanoid": "^3.3.7",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"source-map-js": "^1.0.2"
|
"source-map-js": "^1.0.2"
|
||||||
}
|
}
|
||||||
@@ -6069,9 +6220,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rollup": {
|
"rollup": {
|
||||||
"version": "3.27.0",
|
"version": "3.29.4",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz",
|
||||||
"integrity": "sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==",
|
"integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"fsevents": "~2.3.2"
|
"fsevents": "~2.3.2"
|
||||||
@@ -6138,6 +6289,11 @@
|
|||||||
"lru-cache": "^6.0.0"
|
"lru-cache": "^6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"server-only": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz",
|
||||||
|
"integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA=="
|
||||||
|
},
|
||||||
"set-cookie-parser": {
|
"set-cookie-parser": {
|
||||||
"version": "2.6.0",
|
"version": "2.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
|
||||||
@@ -6194,12 +6350,6 @@
|
|||||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"streamsearch": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
@@ -6344,9 +6494,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"svelte-hmr": {
|
"svelte-hmr": {
|
||||||
"version": "0.15.2",
|
"version": "0.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz",
|
||||||
"integrity": "sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==",
|
"integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@@ -6506,6 +6656,16 @@
|
|||||||
"thenify": ">= 3.1.0 < 4"
|
"thenify": ">= 3.1.0 < 4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tiny-glob": {
|
||||||
|
"version": "0.2.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
||||||
|
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"globalyzer": "0.1.0",
|
||||||
|
"globrex": "^0.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"to-regex-range": {
|
"to-regex-range": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
@@ -6572,12 +6732,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"undici": {
|
"undici": {
|
||||||
"version": "5.22.1",
|
"version": "5.28.4",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
|
||||||
"integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==",
|
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"busboy": "^1.6.0"
|
"@fastify/busboy": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"update-browserslist-db": {
|
"update-browserslist-db": {
|
||||||
@@ -6606,21 +6766,21 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"vite": {
|
"vite": {
|
||||||
"version": "4.4.7",
|
"version": "4.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz",
|
||||||
"integrity": "sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==",
|
"integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"esbuild": "^0.18.10",
|
"esbuild": "^0.18.10",
|
||||||
"fsevents": "~2.3.2",
|
"fsevents": "~2.3.2",
|
||||||
"postcss": "^8.4.26",
|
"postcss": "^8.4.27",
|
||||||
"rollup": "^3.25.2"
|
"rollup": "^3.27.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vitefu": {
|
"vitefu": {
|
||||||
"version": "0.2.4",
|
"version": "0.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz",
|
||||||
"integrity": "sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==",
|
"integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "z-reader",
|
"name": "z-reader",
|
||||||
"version": "0.9.0",
|
"version": "0.9.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "^2.0.0",
|
"@sveltejs/adapter-auto": "^2.0.0",
|
||||||
"@sveltejs/kit": "^1.20.4",
|
"@sveltejs/kit": "^1.20.4",
|
||||||
|
"@types/gapi.client.drive-v3": "^0.0.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||||
"@typescript-eslint/parser": "^5.45.0",
|
"@typescript-eslint/parser": "^5.45.0",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
@@ -36,6 +37,10 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/gapi": "^0.0.47",
|
||||||
|
"@types/google.accounts": "^0.0.14",
|
||||||
|
"@types/google.picker": "^0.0.42",
|
||||||
|
"@vercel/analytics": "^1.1.0",
|
||||||
"@zip.js/zip.js": "^2.7.20",
|
"@zip.js/zip.js": "^2.7.20",
|
||||||
"dexie": "^4.0.1-alpha.25",
|
"dexie": "^4.0.1-alpha.25",
|
||||||
"panzoom": "^9.4.3",
|
"panzoom": "^9.4.3",
|
||||||
|
|||||||
15
src/app.html
15
src/app.html
@@ -3,14 +3,25 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
<link rel="manifest" crossorigin="use-credentials" href="manifest.json">
|
<link rel="manifest" crossorigin="use-credentials" href="manifest.json" />
|
||||||
<meta
|
<meta
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, height=device-height,initial-scale=1, minimum-scale=1, user-scalable=no"
|
content="width=device-width, height=device-height,initial-scale=1, minimum-scale=1, user-scalable=no"
|
||||||
/>
|
/>
|
||||||
|
<script src="https://apis.google.com/js/api.js"></script>
|
||||||
|
<script src="https://accounts.google.com/gsi/client"></script>
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover" class="bg-white dark:bg-gray-950 dark:text-white">
|
<body data-sveltekit-preload-data="hover" class="bg-white dark:bg-gray-950 dark:text-white">
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div
|
||||||
|
id="popupAbout"
|
||||||
|
class="pageContainer"
|
||||||
|
style="
|
||||||
|
display: contents;
|
||||||
|
background-image: url('https://reader.mokuro.app/_app/immutable/assets/icon.06fcfdd6.webp');
|
||||||
|
"
|
||||||
|
>
|
||||||
|
%sveltekit.body%
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ type CropperModal = {
|
|||||||
|
|
||||||
export const cropperStore = writable<CropperModal | undefined>(undefined);
|
export const cropperStore = writable<CropperModal | undefined>(undefined);
|
||||||
|
|
||||||
export function showCropper(image: string, sentence: string) {
|
export function showCropper(image: string, sentence?: string) {
|
||||||
cropperStore.set({
|
cropperStore.set({
|
||||||
open: true,
|
open: true,
|
||||||
image,
|
image,
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export async function imageToWebp(source: File) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLastCard(imageData: string | null | undefined, sentence: string) {
|
export async function updateLastCard(imageData: string | null | undefined, sentence?: string) {
|
||||||
const {
|
const {
|
||||||
overwriteImage,
|
overwriteImage,
|
||||||
enabled,
|
enabled,
|
||||||
@@ -88,7 +88,7 @@ export async function updateLastCard(imageData: string | null | undefined, sente
|
|||||||
|
|
||||||
const fields: Record<string, any> = {};
|
const fields: Record<string, any> = {};
|
||||||
|
|
||||||
if (grabSentence) {
|
if (grabSentence && sentence) {
|
||||||
fields[sentenceField] = sentence;
|
fields[sentenceField] = sentence;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ export async function updateLastCard(imageData: string | null | undefined, sente
|
|||||||
id,
|
id,
|
||||||
fields,
|
fields,
|
||||||
picture: {
|
picture: {
|
||||||
filename: `_${id}.webp`,
|
filename: `mokuro_${id}.webp`,
|
||||||
data: imageData.split(';base64,')[1],
|
data: imageData.split(';base64,')[1],
|
||||||
fields: [pictureField],
|
fields: [pictureField],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,30 @@
|
|||||||
import { db } from '$lib/catalog/db';
|
import { page } from '$app/stores';
|
||||||
|
import { db, type Catalog } from '$lib/catalog/db';
|
||||||
|
import type { Volume } from '$lib/types';
|
||||||
import { liveQuery } from 'dexie';
|
import { liveQuery } from 'dexie';
|
||||||
|
import { derived, type Readable } from 'svelte/store';
|
||||||
|
|
||||||
export const catalog = liveQuery(() => db.catalog.toArray());
|
export const catalog = liveQuery(() => db.catalog.toArray());
|
||||||
|
|
||||||
|
function sortManga(a: Volume, b: Volume) {
|
||||||
|
if (a.volumeName < b.volumeName) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.volumeName > b.volumeName) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const manga = derived([page, catalog as unknown as Readable<Catalog[]>], ([$page, $catalog]) => {
|
||||||
|
if ($page && $catalog) {
|
||||||
|
return $catalog.find((item) => item.id === $page.params.manga)?.manga.sort(sortManga)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const volume = derived(([page, manga]), ([$page, $manga]) => {
|
||||||
|
if ($page && $manga) {
|
||||||
|
return $manga.find((item) => item.mokuroData.volume_uuid === $page.params.volume)
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,17 +1,78 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { catalog } from '$lib/catalog';
|
import { catalog } from '$lib/catalog';
|
||||||
|
import { Button, Search, Listgroup } from 'flowbite-svelte';
|
||||||
import CatalogItem from './CatalogItem.svelte';
|
import CatalogItem from './CatalogItem.svelte';
|
||||||
import Loader from './Loader.svelte';
|
import Loader from './Loader.svelte';
|
||||||
|
import { GridOutline, SortOutline, ListOutline } from 'flowbite-svelte-icons';
|
||||||
|
import { miscSettings, updateMiscSetting } from '$lib/settings';
|
||||||
|
import CatalogListItem from './CatalogListItem.svelte';
|
||||||
|
|
||||||
|
$: sortedCatalog = $catalog
|
||||||
|
?.sort((a, b) => {
|
||||||
|
if ($miscSettings.gallerySorting === 'ASC') {
|
||||||
|
return a.manga[0].mokuroData.title.localeCompare(b.manga[0].mokuroData.title);
|
||||||
|
} else {
|
||||||
|
return b.manga[0].mokuroData.title.localeCompare(a.manga[0].mokuroData.title);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.filter((item) => {
|
||||||
|
return item.manga[0].mokuroData.title.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
||||||
|
});
|
||||||
|
|
||||||
|
let search = '';
|
||||||
|
|
||||||
|
function onLayout() {
|
||||||
|
if ($miscSettings.galleryLayout === 'list') {
|
||||||
|
updateMiscSetting('galleryLayout', 'grid');
|
||||||
|
} else {
|
||||||
|
updateMiscSetting('galleryLayout', 'list');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onOrder() {
|
||||||
|
if ($miscSettings.gallerySorting === 'ASC') {
|
||||||
|
updateMiscSetting('gallerySorting', 'DESC');
|
||||||
|
} else {
|
||||||
|
updateMiscSetting('gallerySorting', 'ASC');
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $catalog}
|
{#if $catalog}
|
||||||
{#if $catalog.length > 0}
|
{#if $catalog.length > 0}
|
||||||
<div class="flex flex-col gap-5">
|
<div class="flex flex-col gap-5">
|
||||||
<div class="flex sm:flex-row flex-col gap-5 flex-wrap justify-center sm:justify-start">
|
<div class="flex gap-1 py-2">
|
||||||
{#each $catalog as { id } (id)}
|
<Search bind:value={search} />
|
||||||
<CatalogItem {id} />
|
<Button size="sm" color="alternative" on:click={onLayout}>
|
||||||
{/each}
|
{#if $miscSettings.galleryLayout === 'list'}
|
||||||
|
<GridOutline />
|
||||||
|
{:else}
|
||||||
|
<ListOutline />
|
||||||
|
{/if}
|
||||||
|
</Button>
|
||||||
|
<Button size="sm" color="alternative" on:click={onOrder}>
|
||||||
|
<SortOutline />
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
{#if search && sortedCatalog.length === 0}
|
||||||
|
<div class="text-center p-20">
|
||||||
|
<p>No results found.</p>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex sm:flex-row flex-col gap-5 flex-wrap justify-center sm:justify-start">
|
||||||
|
{#if $miscSettings.galleryLayout === 'grid'}
|
||||||
|
{#each sortedCatalog as { id } (id)}
|
||||||
|
<CatalogItem {id} />
|
||||||
|
{/each}
|
||||||
|
{:else}
|
||||||
|
<Listgroup active class="w-full">
|
||||||
|
{#each sortedCatalog as { id } (id)}
|
||||||
|
<CatalogListItem {id} />
|
||||||
|
{/each}
|
||||||
|
</Listgroup>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="text-center p-20">
|
<div class="text-center p-20">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { catalog } from '$lib/catalog';
|
import { catalog } from '$lib/catalog';
|
||||||
import { P } from 'flowbite-svelte';
|
|
||||||
|
|
||||||
export let id: string;
|
export let id: string;
|
||||||
|
|
||||||
@@ -19,7 +18,9 @@
|
|||||||
class="object-contain sm:w-[250px] sm:h-[350px] bg-black border-gray-900 border"
|
class="object-contain sm:w-[250px] sm:h-[350px] bg-black border-gray-900 border"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<p class="font-semibold">{manga.mokuroData.title}</p>
|
<p class="font-semibold sm:w-[250px] line-clamp-1">
|
||||||
|
{manga.mokuroData.title}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
25
src/lib/components/CatalogListItem.svelte
Normal file
25
src/lib/components/CatalogListItem.svelte
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { catalog } from '$lib/catalog';
|
||||||
|
import { ListgroupItem } from 'flowbite-svelte';
|
||||||
|
|
||||||
|
export let id: string;
|
||||||
|
|
||||||
|
$: manga = $catalog?.find((item) => item.id === id)?.manga[0];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if manga}
|
||||||
|
<div>
|
||||||
|
<ListgroupItem>
|
||||||
|
<a href={id} class="h-full w-full">
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<p class="font-semibold text-white">{manga.mokuroData.title}</p>
|
||||||
|
<img
|
||||||
|
src={URL.createObjectURL(Object.values(manga.files)[0])}
|
||||||
|
alt="img"
|
||||||
|
class="object-contain w-[50px] h-[70px] bg-black border-gray-900 border"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</ListgroupItem>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Navbar, NavBrand } from 'flowbite-svelte';
|
import { Navbar, NavBrand } from 'flowbite-svelte';
|
||||||
import { UserSettingsSolid, UploadSolid } from 'flowbite-svelte-icons';
|
import { UserSettingsSolid, UploadSolid, CloudArrowUpOutline } from 'flowbite-svelte-icons';
|
||||||
import { afterNavigate } from '$app/navigation';
|
import { afterNavigate, goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import Settings from './Settings/Settings.svelte';
|
import Settings from './Settings/Settings.svelte';
|
||||||
import UploadModal from './UploadModal.svelte';
|
import UploadModal from './UploadModal.svelte';
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
<div class="flex md:order-2 gap-5">
|
<div class="flex md:order-2 gap-5">
|
||||||
<UserSettingsSolid class="hover:text-primary-700" on:click={openSettings} />
|
<UserSettingsSolid class="hover:text-primary-700" on:click={openSettings} />
|
||||||
<UploadSolid class="hover:text-primary-700" on:click={() => (uploadModalOpen = true)} />
|
<UploadSolid class="hover:text-primary-700" on:click={() => (uploadModalOpen = true)} />
|
||||||
|
<CloudArrowUpOutline class="hover:text-primary-700" on:click={() => goto('/cloud')} />
|
||||||
</div>
|
</div>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { afterNavigate } from '$app/navigation';
|
import { afterNavigate, beforeNavigate } from '$app/navigation';
|
||||||
import { cropperStore, getCroppedImg, updateLastCard, type Pixels } from '$lib/anki-connect';
|
import { cropperStore, getCroppedImg, updateLastCard, type Pixels } from '$lib/anki-connect';
|
||||||
|
import { settings } from '$lib/settings';
|
||||||
import { Button, Modal, Spinner } from 'flowbite-svelte';
|
import { Button, Modal, Spinner } from 'flowbite-svelte';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import Cropper from 'svelte-easy-crop';
|
import Cropper from 'svelte-easy-crop';
|
||||||
@@ -13,6 +14,13 @@
|
|||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
beforeNavigate((nav) => {
|
||||||
|
if (open) {
|
||||||
|
nav.cancel();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
cropperStore.subscribe((value) => {
|
cropperStore.subscribe((value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -27,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function onCrop() {
|
async function onCrop() {
|
||||||
if ($cropperStore?.image && $cropperStore?.sentence && pixels) {
|
if ($cropperStore?.image && pixels) {
|
||||||
loading = true;
|
loading = true;
|
||||||
const imageData = await getCroppedImg($cropperStore.image, pixels);
|
const imageData = await getCroppedImg($cropperStore.image, pixels);
|
||||||
updateLastCard(imageData, $cropperStore.sentence);
|
updateLastCard(imageData, $cropperStore.sentence);
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
<Modal title="Crop image" bind:open on:{close}>
|
<Modal title="Crop image" bind:open on:{close}>
|
||||||
{#if $cropperStore?.image && !loading}
|
{#if $cropperStore?.image && !loading}
|
||||||
<div class=" flex flex-col gap-2">
|
<div class=" flex flex-col gap-2">
|
||||||
<div class="relative w-full h-[55svh] sm:h-[70svh]">
|
<div class="relative w-full h-[55svh] sm:h-[65svh]">
|
||||||
<Cropper
|
<Cropper
|
||||||
zoomSpeed={0.5}
|
zoomSpeed={0.5}
|
||||||
maxZoom={10}
|
maxZoom={10}
|
||||||
@@ -51,6 +59,12 @@
|
|||||||
on:cropcomplete={onCropComplete}
|
on:cropcomplete={onCropComplete}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{#if $settings.ankiConnectSettings.grabSentence && $cropperStore?.sentence}
|
||||||
|
<p>
|
||||||
|
<b>Sentence:</b>
|
||||||
|
{$cropperStore?.sentence}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
<Button on:click={onCrop}>Crop</Button>
|
<Button on:click={onCrop}>Crop</Button>
|
||||||
<Button on:click={close} outline color="light">Close</Button>
|
<Button on:click={close} outline color="light">Close</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Page } from '$lib/types';
|
import type { Page } from '$lib/types';
|
||||||
import { onMount } from 'svelte';
|
import { afterUpdate, onMount, onDestroy } from 'svelte';
|
||||||
import TextBoxes from './TextBoxes.svelte';
|
import TextBoxes from './TextBoxes.svelte';
|
||||||
import { zoomDefault } from '$lib/panzoom';
|
import { zoomDefault } from '$lib/panzoom';
|
||||||
|
|
||||||
@@ -9,7 +9,26 @@
|
|||||||
|
|
||||||
$: url = src ? `url(${URL.createObjectURL(src)})` : '';
|
$: url = src ? `url(${URL.createObjectURL(src)})` : '';
|
||||||
|
|
||||||
|
let legacy: HTMLElement | null;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
legacy = document.getElementById('popupAbout');
|
||||||
|
zoomDefault();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
zoomDefault();
|
||||||
|
}, 10);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (legacy) {
|
||||||
|
legacy.style.backgroundImage = url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
afterUpdate(() => {
|
||||||
zoomDefault();
|
zoomDefault();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
83
src/lib/components/Reader/QuickActions.svelte
Normal file
83
src/lib/components/Reader/QuickActions.svelte
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { toggleFullScreen, zoomFitToScreen } from '$lib/panzoom';
|
||||||
|
import { SpeedDial, SpeedDialButton } from 'flowbite-svelte';
|
||||||
|
import { settings } from '$lib/settings';
|
||||||
|
import {
|
||||||
|
ArrowLeftOutline,
|
||||||
|
ArrowRightOutline,
|
||||||
|
CompressOutline,
|
||||||
|
ImageOutline,
|
||||||
|
ZoomOutOutline
|
||||||
|
} from 'flowbite-svelte-icons';
|
||||||
|
import { imageToWebp, showCropper, updateLastCard } from '$lib/anki-connect';
|
||||||
|
import { promptConfirmation } from '$lib/util';
|
||||||
|
|
||||||
|
export let left: (_e: any, ingoreTimeOut?: boolean) => void;
|
||||||
|
export let right: (_e: any, ingoreTimeOut?: boolean) => void;
|
||||||
|
export let src1: File;
|
||||||
|
export let src2: File | undefined;
|
||||||
|
|
||||||
|
let open = false;
|
||||||
|
|
||||||
|
function handleZoom() {
|
||||||
|
zoomFitToScreen();
|
||||||
|
open = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleLeft(_e: Event) {
|
||||||
|
left(_e, true);
|
||||||
|
open = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleRight(_e: Event) {
|
||||||
|
right(_e, true);
|
||||||
|
open = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onUpdateCard(src: File | undefined) {
|
||||||
|
if ($settings.ankiConnectSettings.enabled && src) {
|
||||||
|
if ($settings.ankiConnectSettings.cropImage) {
|
||||||
|
showCropper(URL.createObjectURL(src));
|
||||||
|
} else {
|
||||||
|
promptConfirmation('Add image to last created anki card?', async () => {
|
||||||
|
const imageData = await imageToWebp(src);
|
||||||
|
updateLastCard(imageData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if $settings.quickActions}
|
||||||
|
<SpeedDial
|
||||||
|
tooltip="none"
|
||||||
|
trigger="click"
|
||||||
|
defaultClass="absolute end-3 bottom-3 z-50"
|
||||||
|
color="transparent"
|
||||||
|
bind:open
|
||||||
|
>
|
||||||
|
{#if $settings.ankiConnectSettings.enabled}
|
||||||
|
<SpeedDialButton name={src2 ? '1' : undefined} on:click={() => onUpdateCard(src1)}>
|
||||||
|
<ImageOutline />
|
||||||
|
</SpeedDialButton>
|
||||||
|
{/if}
|
||||||
|
{#if $settings.ankiConnectSettings.enabled && src2}
|
||||||
|
<SpeedDialButton name="2" on:click={() => onUpdateCard(src2)}>
|
||||||
|
<ImageOutline />
|
||||||
|
</SpeedDialButton>
|
||||||
|
{/if}
|
||||||
|
<SpeedDialButton on:click={toggleFullScreen}>
|
||||||
|
<CompressOutline />
|
||||||
|
</SpeedDialButton>
|
||||||
|
<SpeedDialButton on:click={handleZoom}>
|
||||||
|
<ZoomOutOutline />
|
||||||
|
</SpeedDialButton>
|
||||||
|
<SpeedDialButton on:click={handleRight}>
|
||||||
|
<ArrowRightOutline />
|
||||||
|
</SpeedDialButton>
|
||||||
|
<SpeedDialButton on:click={handleLeft}>
|
||||||
|
<ArrowLeftOutline />
|
||||||
|
</SpeedDialButton>
|
||||||
|
</SpeedDial>
|
||||||
|
{/if}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
zoomFitToScreen
|
zoomFitToScreen
|
||||||
} from '$lib/panzoom';
|
} from '$lib/panzoom';
|
||||||
import { progress, settings, updateProgress, type VolumeSettings } from '$lib/settings';
|
import { progress, settings, updateProgress, type VolumeSettings } from '$lib/settings';
|
||||||
import { clamp, debounce } from '$lib/util';
|
import { clamp, debounce, fireExstaticEvent } from '$lib/util';
|
||||||
import { Input, Popover, Range, Spinner } from 'flowbite-svelte';
|
import { Input, Popover, Range, Spinner } from 'flowbite-svelte';
|
||||||
import MangaPage from './MangaPage.svelte';
|
import MangaPage from './MangaPage.svelte';
|
||||||
import {
|
import {
|
||||||
@@ -21,6 +21,9 @@
|
|||||||
import { page as pageStore } from '$app/stores';
|
import { page as pageStore } from '$app/stores';
|
||||||
import SettingsButton from './SettingsButton.svelte';
|
import SettingsButton from './SettingsButton.svelte';
|
||||||
import { getCharCount } from '$lib/util/count-chars';
|
import { getCharCount } from '$lib/util/count-chars';
|
||||||
|
import QuickActions from './QuickActions.svelte';
|
||||||
|
import { beforeNavigate } from '$app/navigation';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
// TODO: Refactor this whole mess
|
// TODO: Refactor this whole mess
|
||||||
export let volumeSettings: VolumeSettings;
|
export let volumeSettings: VolumeSettings;
|
||||||
@@ -64,11 +67,13 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const pageClamped = clamp(newPage, 1, pages?.length);
|
const pageClamped = clamp(newPage, 1, pages?.length);
|
||||||
|
const { charCount } = getCharCount(pages, pageClamped);
|
||||||
|
|
||||||
updateProgress(
|
updateProgress(
|
||||||
volume.mokuroData.volume_uuid,
|
volume.mokuroData.volume_uuid,
|
||||||
pageClamped,
|
pageClamped,
|
||||||
getCharCount(pages, pageClamped) || 0,
|
charCount,
|
||||||
pageClamped === pages.length
|
pageClamped === pages.length || pageClamped === pages.length - 1
|
||||||
);
|
);
|
||||||
zoomDefault();
|
zoomDefault();
|
||||||
}
|
}
|
||||||
@@ -110,14 +115,19 @@
|
|||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
case 'ArrowUp':
|
|
||||||
case 'PageUp':
|
|
||||||
left(event, true);
|
left(event, true);
|
||||||
return;
|
return;
|
||||||
|
case 'ArrowUp':
|
||||||
|
case 'PageUp':
|
||||||
|
changePage(page - navAmount, true);
|
||||||
|
return;
|
||||||
case 'ArrowRight':
|
case 'ArrowRight':
|
||||||
|
right(event, true);
|
||||||
|
return;
|
||||||
case 'ArrowDown':
|
case 'ArrowDown':
|
||||||
case 'PageDown':
|
case 'PageDown':
|
||||||
right(event, true);
|
case 'Space':
|
||||||
|
changePage(page + navAmount, true);
|
||||||
return;
|
return;
|
||||||
case 'Home':
|
case 'Home':
|
||||||
changePage(1, true);
|
changePage(1, true);
|
||||||
@@ -127,11 +137,6 @@
|
|||||||
changePage(pages.length, true);
|
changePage(pages.length, true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 'Space':
|
|
||||||
if (pages && page + 1 <= pages.length) {
|
|
||||||
changePage(page + 1, true);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case 'KeyF':
|
case 'KeyF':
|
||||||
toggleFullScreen();
|
toggleFullScreen();
|
||||||
return;
|
return;
|
||||||
@@ -140,8 +145,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: charCount = $settings.charCount ? getCharCount(pages, page) : 0;
|
$: charCount = $settings.charCount ? getCharCount(pages, page).charCount : 0;
|
||||||
$: maxCharCount = getCharCount(pages);
|
$: maxCharCount = getCharCount(pages).charCount;
|
||||||
|
$: totalLineCount = getCharCount(pages).lineCount;
|
||||||
|
|
||||||
let startX = 0;
|
let startX = 0;
|
||||||
let startY = 0;
|
let startY = 0;
|
||||||
@@ -190,13 +196,57 @@
|
|||||||
const { clientX, clientY } = event;
|
const { clientX, clientY } = event;
|
||||||
const { scale } = $panzoomStore.getTransform();
|
const { scale } = $panzoomStore.getTransform();
|
||||||
|
|
||||||
if (scale < 0.5) {
|
if (scale < 1) {
|
||||||
$panzoomStore.zoomTo(clientX, clientY, 3);
|
$panzoomStore.zoomTo(clientX, clientY, 1.5);
|
||||||
} else {
|
} else {
|
||||||
zoomFitToScreen();
|
zoomFitToScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (volume) {
|
||||||
|
const { charCount, lineCount } = getCharCount(pages, page);
|
||||||
|
|
||||||
|
fireExstaticEvent('mokuro-reader:page.change', {
|
||||||
|
title: volume.mokuroData.title,
|
||||||
|
volumeName: volume.mokuroData.volume,
|
||||||
|
currentCharCount: charCount,
|
||||||
|
currentPage: page,
|
||||||
|
totalPages: pages.length,
|
||||||
|
totalCharCount: maxCharCount || 0,
|
||||||
|
currentLineCount: lineCount,
|
||||||
|
totalLineCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if ($settings.defaultFullscreen) {
|
||||||
|
document.documentElement.requestFullscreen();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeNavigate(() => {
|
||||||
|
if (document.exitFullscreen) {
|
||||||
|
document.exitFullscreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (volume) {
|
||||||
|
const { charCount, lineCount } = getCharCount(pages, page);
|
||||||
|
|
||||||
|
fireExstaticEvent('mokuro-reader:reader.closed', {
|
||||||
|
title: volume.mokuroData.title,
|
||||||
|
volumeName: volume.mokuroData.volume,
|
||||||
|
currentCharCount: charCount,
|
||||||
|
currentPage: page,
|
||||||
|
totalPages: pages.length,
|
||||||
|
totalCharCount: maxCharCount || 0,
|
||||||
|
currentLineCount: lineCount,
|
||||||
|
totalLineCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window
|
<svelte:window
|
||||||
@@ -208,8 +258,14 @@
|
|||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{volume?.mokuroData.volume || 'Volume'}</title>
|
<title>{volume?.mokuroData.volume || 'Volume'}</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
<SettingsButton />
|
|
||||||
{#if volume && pages}
|
{#if volume && pages}
|
||||||
|
<QuickActions
|
||||||
|
{left}
|
||||||
|
{right}
|
||||||
|
src1={Object.values(volume?.files)[index]}
|
||||||
|
src2={!volumeSettings.singlePageView ? Object.values(volume?.files)[index + 1] : undefined}
|
||||||
|
/>
|
||||||
|
<SettingsButton />
|
||||||
<Cropper />
|
<Cropper />
|
||||||
<Popover placement="bottom" trigger="click" triggeredBy="#page-num" class="z-20 w-full max-w-xs">
|
<Popover placement="bottom" trigger="click" triggeredBy="#page-num" class="z-20 w-full max-w-xs">
|
||||||
<div class="flex flex-col gap-3">
|
<div class="flex flex-col gap-3">
|
||||||
@@ -261,11 +317,13 @@
|
|||||||
<Panzoom>
|
<Panzoom>
|
||||||
<button
|
<button
|
||||||
class="h-full fixed -left-full z-10 w-full hover:bg-slate-400 opacity-[0.01]"
|
class="h-full fixed -left-full z-10 w-full hover:bg-slate-400 opacity-[0.01]"
|
||||||
|
style:margin-left={`${$settings.edgeButtonWidth}px`}
|
||||||
on:mousedown={mouseDown}
|
on:mousedown={mouseDown}
|
||||||
on:mouseup={left}
|
on:mouseup={left}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="h-full fixed -right-full z-10 w-full hover:bg-slate-400 opacity-[0.01]"
|
class="h-full fixed -right-full z-10 w-full hover:bg-slate-400 opacity-[0.01]"
|
||||||
|
style:margin-right={`${$settings.edgeButtonWidth}px`}
|
||||||
on:mousedown={mouseDown}
|
on:mousedown={mouseDown}
|
||||||
on:mouseup={right}
|
on:mouseup={right}
|
||||||
/>
|
/>
|
||||||
@@ -282,13 +340,17 @@
|
|||||||
<div
|
<div
|
||||||
class="flex flex-row"
|
class="flex flex-row"
|
||||||
class:flex-row-reverse={!volumeSettings.rightToLeft}
|
class:flex-row-reverse={!volumeSettings.rightToLeft}
|
||||||
|
style:filter={`invert(${$settings.invertColors ? 1 : 0})`}
|
||||||
on:dblclick={onDoubleTap}
|
on:dblclick={onDoubleTap}
|
||||||
role="none"
|
role="none"
|
||||||
|
id="manga-panel"
|
||||||
>
|
>
|
||||||
{#if showSecondPage()}
|
{#key page}
|
||||||
<MangaPage page={pages[index + 1]} src={Object.values(volume?.files)[index + 1]} />
|
{#if showSecondPage()}
|
||||||
{/if}
|
<MangaPage page={pages[index + 1]} src={Object.values(volume?.files)[index + 1]} />
|
||||||
<MangaPage page={pages[index]} src={Object.values(volume?.files)[index]} />
|
{/if}
|
||||||
|
<MangaPage page={pages[index]} src={Object.values(volume?.files)[index]} />
|
||||||
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
</Panzoom>
|
</Panzoom>
|
||||||
</div>
|
</div>
|
||||||
@@ -297,15 +359,17 @@
|
|||||||
on:mousedown={mouseDown}
|
on:mousedown={mouseDown}
|
||||||
on:mouseup={left}
|
on:mouseup={left}
|
||||||
class="left-0 top-0 absolute h-full w-16 hover:bg-slate-400 opacity-[0.01]"
|
class="left-0 top-0 absolute h-full w-16 hover:bg-slate-400 opacity-[0.01]"
|
||||||
|
style:width={`${$settings.edgeButtonWidth}px`}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
on:mousedown={mouseDown}
|
on:mousedown={mouseDown}
|
||||||
on:mouseup={right}
|
on:mouseup={right}
|
||||||
class="right-0 top-0 absolute h-full w-16 hover:bg-slate-400 opacity-[0.01]"
|
class="right-0 top-0 absolute h-full w-16 hover:bg-slate-400 opacity-[0.01]"
|
||||||
|
style:width={`${$settings.edgeButtonWidth}px`}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<div class="fixed z-50 left-1/2 top-1/2">
|
<div class="fixed z-50 left-1/2 top-1/2">
|
||||||
<Spinner />
|
<Spinner />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -7,38 +7,46 @@
|
|||||||
export let page: Page;
|
export let page: Page;
|
||||||
export let src: File;
|
export let src: File;
|
||||||
|
|
||||||
$: textBoxes = page.blocks.map((block) => {
|
$: textBoxes = page.blocks
|
||||||
const { img_height, img_width } = page;
|
.map((block) => {
|
||||||
const { box, font_size, lines, vertical } = block;
|
const { img_height, img_width } = page;
|
||||||
|
const { box, font_size, lines, vertical } = block;
|
||||||
|
|
||||||
let [_xmin, _ymin, _xmax, _ymax] = box;
|
let [_xmin, _ymin, _xmax, _ymax] = box;
|
||||||
|
|
||||||
const xmin = clamp(_xmin, 0, img_width);
|
const xmin = clamp(_xmin, 0, img_width);
|
||||||
const ymin = clamp(_ymin, 0, img_height);
|
const ymin = clamp(_ymin, 0, img_height);
|
||||||
const xmax = clamp(_xmax, 0, img_width);
|
const xmax = clamp(_xmax, 0, img_width);
|
||||||
const ymax = clamp(_ymax, 0, img_height);
|
const ymax = clamp(_ymax, 0, img_height);
|
||||||
|
|
||||||
const width = xmax - xmin;
|
const width = xmax - xmin;
|
||||||
const height = ymax - ymin;
|
const height = ymax - ymin;
|
||||||
|
const area = width * height;
|
||||||
|
|
||||||
const textBox = {
|
const textBox = {
|
||||||
left: `${xmin}px`,
|
left: `${xmin}px`,
|
||||||
top: `${ymin}px`,
|
top: `${ymin}px`,
|
||||||
width: `${width}px`,
|
width: `${width}px`,
|
||||||
height: `${height}px`,
|
height: `${height}px`,
|
||||||
fontSize: $settings.fontSize === 'auto' ? `${font_size}px` : `${$settings.fontSize}pt`,
|
fontSize: $settings.fontSize === 'auto' ? `${font_size}px` : `${$settings.fontSize}pt`,
|
||||||
writingMode: vertical ? 'vertical-rl' : 'horizontal-tb',
|
writingMode: vertical ? 'vertical-rl' : 'horizontal-tb',
|
||||||
lines
|
lines,
|
||||||
};
|
area
|
||||||
|
};
|
||||||
|
|
||||||
return textBox;
|
return textBox;
|
||||||
});
|
})
|
||||||
|
.sort(({ area: a }, { area: b }) => {
|
||||||
|
return b - a;
|
||||||
|
});
|
||||||
|
|
||||||
$: fontWeight = $settings.boldFont ? 'bold' : '400';
|
$: fontWeight = $settings.boldFont ? 'bold' : '400';
|
||||||
$: display = $settings.displayOCR ? 'block' : 'none';
|
$: display = $settings.displayOCR ? 'block' : 'none';
|
||||||
$: border = $settings.textBoxBorders ? '1px solid red' : 'none';
|
$: border = $settings.textBoxBorders ? '1px solid red' : 'none';
|
||||||
$: contenteditable = $settings.textEditable;
|
$: contenteditable = $settings.textEditable;
|
||||||
|
|
||||||
|
$: triggerMethod = $settings.ankiConnectSettings.triggerMethod || 'both';
|
||||||
|
|
||||||
async function onUpdateCard(lines: string[]) {
|
async function onUpdateCard(lines: string[]) {
|
||||||
if ($settings.ankiConnectSettings.enabled) {
|
if ($settings.ankiConnectSettings.enabled) {
|
||||||
const sentence = lines.join(' ');
|
const sentence = lines.join(' ');
|
||||||
@@ -54,16 +62,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onContextMenu(event: Event, lines: string[]) {
|
function onContextMenu(event: Event, lines: string[]) {
|
||||||
if ($settings.ankiConnectSettings.enabled) {
|
if (triggerMethod === 'both' || triggerMethod === 'rightClick') {
|
||||||
|
event.preventDefault();
|
||||||
|
onUpdateCard(lines);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDoubleTap(event: Event, lines: string[]) {
|
||||||
|
if (triggerMethod === 'both' || triggerMethod === 'doubleTap') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
onUpdateCard(lines);
|
onUpdateCard(lines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#each textBoxes as { fontSize, height, left, lines, top, width, writingMode }, index (`text-box-${index}`)}
|
{#each textBoxes as { fontSize, height, left, lines, top, width, writingMode }, index (`textBox-${index}`)}
|
||||||
<div
|
<div
|
||||||
class="text-box"
|
class="textBox"
|
||||||
style:width
|
style:width
|
||||||
style:height
|
style:height
|
||||||
style:left
|
style:left
|
||||||
@@ -75,7 +90,7 @@
|
|||||||
style:writing-mode={writingMode}
|
style:writing-mode={writingMode}
|
||||||
role="none"
|
role="none"
|
||||||
on:contextmenu={(e) => onContextMenu(e, lines)}
|
on:contextmenu={(e) => onContextMenu(e, lines)}
|
||||||
on:dblclick={() => onUpdateCard(lines)}
|
on:dblclick={(e) => onDoubleTap(e, lines)}
|
||||||
{contenteditable}
|
{contenteditable}
|
||||||
>
|
>
|
||||||
{#each lines as line}
|
{#each lines as line}
|
||||||
@@ -85,7 +100,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.text-box {
|
.textBox {
|
||||||
color: black;
|
color: black;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -96,13 +111,13 @@
|
|||||||
z-index: 11;
|
z-index: 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-box:focus,
|
.textBox:focus,
|
||||||
.text-box:hover {
|
.textBox:hover {
|
||||||
background: rgb(255, 255, 255);
|
background: rgb(255, 255, 255);
|
||||||
border: 1px solid rgba(0, 0, 0, 0);
|
border: 1px solid rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-box p {
|
.textBox p {
|
||||||
display: none;
|
display: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
@@ -113,8 +128,8 @@
|
|||||||
z-index: 11;
|
z-index: 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-box:focus p,
|
.textBox:focus p,
|
||||||
.text-box:hover p {
|
.textBox:hover p {
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
27
src/lib/components/Reader/Timer.svelte
Normal file
27
src/lib/components/Reader/Timer.svelte
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { startCount, volumeStats } from '$lib/settings';
|
||||||
|
|
||||||
|
export let count: number | undefined;
|
||||||
|
export let volumeId: string;
|
||||||
|
|
||||||
|
$: active = Boolean(count);
|
||||||
|
|
||||||
|
function onClick() {
|
||||||
|
if (count) {
|
||||||
|
clearInterval(count);
|
||||||
|
count = undefined;
|
||||||
|
} else {
|
||||||
|
count = startCount(volumeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class:text-primary-700={!active}
|
||||||
|
class="mix-blend-difference z-10 fixed opacity-50 right-20 top-5 p-10 m-[-2.5rem]"
|
||||||
|
on:click={onClick}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{active ? 'Active' : 'Paused'} | Minutes read: {$volumeStats?.timeReadInMinutes}
|
||||||
|
</p>
|
||||||
|
</button>
|
||||||
@@ -1,15 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { READER_VERSION } from '$lib/consts';
|
import { READER_VERSION } from '$lib/consts';
|
||||||
import { showSnackbar } from '$lib/util';
|
import { toClipboard } from '$lib/util';
|
||||||
import { A, AccordionItem, Badge, Helper, Span } from 'flowbite-svelte';
|
import { A, AccordionItem, Badge, Helper, Span } from 'flowbite-svelte';
|
||||||
import { GithubSolid } from 'flowbite-svelte-icons';
|
import { GithubSolid } from 'flowbite-svelte-icons';
|
||||||
|
|
||||||
function toClipboard() {
|
|
||||||
navigator.clipboard.writeText(
|
|
||||||
'pip install git+https://github.com/kha-white/mokuro.git@web-reader'
|
|
||||||
);
|
|
||||||
showSnackbar('Copied to clipboard');
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AccordionItem>
|
<AccordionItem>
|
||||||
@@ -38,7 +31,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<div role="none" on:click={toClipboard}>
|
<div role="none" on:click={toClipboard}>
|
||||||
<code class="text-primary-600 bg-slate-900"
|
<code class="text-primary-600 bg-slate-900"
|
||||||
>pip install git+https://github.com/kha-white/mokuro.git@web-reader</code
|
>pip3 install git+https://github.com/kha-white/mokuro.git@web-reader</code
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,7 +41,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<Helper
|
<Helper
|
||||||
>Created by <A href="https://github.com/ZXY101">ZXY101</A> & <A
|
>Created by <A href="https://github.com/ZXY101">ZXY101</A> & <A
|
||||||
class="https://github.com/kha-white/mokuro">kha-white</A
|
href="https://github.com/kha-white">kha-white</A
|
||||||
></Helper
|
></Helper
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { page } from '$app/stores';
|
||||||
import { settings, updateAnkiSetting } from '$lib/settings';
|
import { settings, updateAnkiSetting } from '$lib/settings';
|
||||||
import { AccordionItem, Label, Toggle, Input, Helper } from 'flowbite-svelte';
|
import { AccordionItem, Label, Toggle, Input, Helper, Select } from 'flowbite-svelte';
|
||||||
|
|
||||||
$: disabled = !$settings.ankiConnectSettings.enabled;
|
$: disabled = !$settings.ankiConnectSettings.enabled;
|
||||||
|
|
||||||
@@ -11,16 +12,29 @@
|
|||||||
|
|
||||||
let pictureField = $settings.ankiConnectSettings.pictureField;
|
let pictureField = $settings.ankiConnectSettings.pictureField;
|
||||||
let sentenceField = $settings.ankiConnectSettings.sentenceField;
|
let sentenceField = $settings.ankiConnectSettings.sentenceField;
|
||||||
|
|
||||||
|
let triggerMethod = $settings.ankiConnectSettings.triggerMethod;
|
||||||
|
|
||||||
|
const triggerOptions = [
|
||||||
|
{ value: 'rightClick', name: 'Right click (long press on mobile)' },
|
||||||
|
{ value: 'doubleTap', name: 'Double tap' },
|
||||||
|
{ value: 'both', name: 'Both' },
|
||||||
|
{ value: 'neither', name: 'Neither' }
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AccordionItem>
|
<AccordionItem>
|
||||||
<span slot="header">Anki Connect</span>
|
<span slot="header">Anki Connect</span>
|
||||||
<div class="flex flex-col gap-5">
|
<div class="flex flex-col gap-5">
|
||||||
<Helper
|
<Helper
|
||||||
>For anki connect integration to work, you must add the reader to your anki connect <code
|
>For anki connect integration to work, you must add the reader (<code class="text-primary-500"
|
||||||
class="text-primary-500">webCorsOriginList</code
|
>{$page.url.origin}</code
|
||||||
> list</Helper
|
>) to your anki connect <b class="text-primary-500">webCorsOriginList</b> list</Helper
|
||||||
>
|
>
|
||||||
|
<Helper>
|
||||||
|
To trigger the anki connect integration, double click or right click (long press on mobile)
|
||||||
|
any text box.
|
||||||
|
</Helper>
|
||||||
<div>
|
<div>
|
||||||
<Toggle bind:checked={enabled} on:change={() => updateAnkiSetting('enabled', enabled)}
|
<Toggle bind:checked={enabled} on:change={() => updateAnkiSetting('enabled', enabled)}
|
||||||
>AnkiConnect Integration Enabled</Toggle
|
>AnkiConnect Integration Enabled</Toggle
|
||||||
@@ -66,5 +80,15 @@
|
|||||||
on:change={() => updateAnkiSetting('grabSentence', grabSentence)}>Grab sentence</Toggle
|
on:change={() => updateAnkiSetting('grabSentence', grabSentence)}>Grab sentence</Toggle
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label>
|
||||||
|
Trigger method:
|
||||||
|
<Select
|
||||||
|
on:change={() => updateAnkiSetting('triggerMethod', triggerMethod)}
|
||||||
|
items={triggerOptions}
|
||||||
|
bind:value={triggerMethod}
|
||||||
|
/>
|
||||||
|
</Label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
renameProfile
|
renameProfile
|
||||||
} from '$lib/settings';
|
} from '$lib/settings';
|
||||||
import { promptConfirmation, showSnackbar } from '$lib/util';
|
import { promptConfirmation, showSnackbar } from '$lib/util';
|
||||||
import { Listgroup, ListgroupItem, Modal, Input, Popover } from 'flowbite-svelte';
|
import { Listgroup, ListgroupItem, Modal, Input } from 'flowbite-svelte';
|
||||||
import {
|
import {
|
||||||
CirclePlusSolid,
|
CirclePlusSolid,
|
||||||
CopySolid,
|
CopySolid,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { changeProfile, currentProfile, profiles } from '$lib/settings';
|
import { changeProfile, currentProfile, profiles } from '$lib/settings';
|
||||||
import { AccordionItem, Button, Select } from 'flowbite-svelte';
|
import { AccordionItem, Button, Select } from 'flowbite-svelte';
|
||||||
import ManageProfilesModal from './ManageProfilesModal.svelte';
|
import ManageProfilesModal from './ManageProfilesModal.svelte';
|
||||||
|
import { showSnackbar } from '$lib/util';
|
||||||
|
|
||||||
export let onClose: () => void;
|
export let onClose: () => void;
|
||||||
|
|
||||||
@@ -16,6 +17,37 @@
|
|||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportProfiles() {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
const json = localStorage.getItem('profiles') || '';
|
||||||
|
link.href = URL.createObjectURL(new Blob([json], { type: 'application/json' }));
|
||||||
|
link.download = 'profiles.json';
|
||||||
|
link.click();
|
||||||
|
showSnackbar('Profiles exported');
|
||||||
|
}
|
||||||
|
|
||||||
|
let files: FileList;
|
||||||
|
function importProfile() {
|
||||||
|
const [file] = files;
|
||||||
|
const reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onloadend = () => {
|
||||||
|
const imported = JSON.parse(reader.result?.toString() || '');
|
||||||
|
profiles.update((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
...imported
|
||||||
|
};
|
||||||
|
});
|
||||||
|
onClose();
|
||||||
|
showSnackbar('Profiles imported');
|
||||||
|
};
|
||||||
|
|
||||||
|
if (file) {
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let manageModalOpen = false;
|
let manageModalOpen = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -30,5 +62,13 @@
|
|||||||
>Manage profiles</Button
|
>Manage profiles</Button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<hr class="border-gray-100 opacity-10" />
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<input class="border border-slate-700 rounded-lg" type="file" accept=".json" bind:files />
|
||||||
|
<Button on:click={importProfile} disabled={!files} size="sm" outline color="blue"
|
||||||
|
>Import profiles</Button
|
||||||
|
>
|
||||||
|
<Button on:click={exportProfiles} size="sm" color="light">Export profiles</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|||||||
20
src/lib/components/Settings/QuickAccess.svelte
Normal file
20
src/lib/components/Settings/QuickAccess.svelte
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { toggleFullScreen } from '$lib/panzoom';
|
||||||
|
import { isReader } from '$lib/util';
|
||||||
|
|
||||||
|
import { Button } from 'flowbite-svelte';
|
||||||
|
|
||||||
|
export let hidden = false;
|
||||||
|
|
||||||
|
function onClose() {
|
||||||
|
hidden = true;
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if isReader()}
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<Button color="alternative" on:click={toggleFullScreen}>Toggle fullscreen</Button>
|
||||||
|
<Button color="alternative" on:click={onClose}>Close reader</Button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
@@ -4,9 +4,14 @@
|
|||||||
import ReaderToggles from './ReaderToggles.svelte';
|
import ReaderToggles from './ReaderToggles.svelte';
|
||||||
import { settings, updateSetting } from '$lib/settings';
|
import { settings, updateSetting } from '$lib/settings';
|
||||||
|
|
||||||
let value = $settings.swipeThreshold;
|
let swipeThresholdValue = $settings.swipeThreshold;
|
||||||
function onChange() {
|
let edgeButtonWidthValue = $settings.edgeButtonWidth;
|
||||||
updateSetting('swipeThreshold', value);
|
function onSwipeChange() {
|
||||||
|
updateSetting('swipeThreshold', swipeThresholdValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onWidthChange() {
|
||||||
|
updateSetting('edgeButtonWidth', edgeButtonWidthValue);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -18,7 +23,17 @@
|
|||||||
<ReaderToggles />
|
<ReaderToggles />
|
||||||
<div>
|
<div>
|
||||||
<Label>Swipe threshold</Label>
|
<Label>Swipe threshold</Label>
|
||||||
<Range on:change={onChange} min={20} max={90} disabled={!$settings.mobile} bind:value />
|
<Range
|
||||||
|
on:change={onSwipeChange}
|
||||||
|
min={20}
|
||||||
|
max={90}
|
||||||
|
disabled={!$settings.mobile}
|
||||||
|
bind:value={swipeThresholdValue}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label>Edge button width</Label>
|
||||||
|
<Range on:change={onWidthChange} min={1} max={100} bind:value={edgeButtonWidthValue} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|||||||
@@ -3,13 +3,18 @@
|
|||||||
import { Toggle } from 'flowbite-svelte';
|
import { Toggle } from 'flowbite-svelte';
|
||||||
|
|
||||||
$: toggles = [
|
$: toggles = [
|
||||||
|
{ key: 'defaultFullscreen', text: 'Open reader in fullscreen', value: $settings.defaultFullscreen },
|
||||||
{ key: 'textEditable', text: 'Editable text', value: $settings.textEditable },
|
{ key: 'textEditable', text: 'Editable text', value: $settings.textEditable },
|
||||||
{ key: 'textBoxBorders', text: 'Text box borders', value: $settings.textBoxBorders },
|
{ key: 'textBoxBorders', text: 'Text box borders', value: $settings.textBoxBorders },
|
||||||
{ key: 'displayOCR', text: 'OCR enabled', value: $settings.displayOCR },
|
{ key: 'displayOCR', text: 'OCR enabled', value: $settings.displayOCR },
|
||||||
{ key: 'boldFont', text: 'Bold font', value: $settings.boldFont },
|
{ key: 'boldFont', text: 'Bold font', value: $settings.boldFont },
|
||||||
{ key: 'pageNum', text: 'Show page number', value: $settings.pageNum },
|
{ key: 'pageNum', text: 'Show page number', value: $settings.pageNum },
|
||||||
{ key: 'charCount', text: 'Show character count', value: $settings.charCount },
|
{ key: 'charCount', text: 'Show character count', value: $settings.charCount },
|
||||||
{ key: 'mobile', text: 'Mobile', value: $settings.mobile }
|
{ key: 'bounds', text: 'Bounds', value: $settings.bounds },
|
||||||
|
{ key: 'mobile', text: 'Mobile', value: $settings.mobile },
|
||||||
|
{ key: 'showTimer', text: 'Show timer', value: $settings.showTimer },
|
||||||
|
{ key: 'quickActions', text: 'Show quick actions', value: $settings.quickActions },
|
||||||
|
{ key: 'invertColors', text: 'Invert colors of the images', value: $settings.invertColors }
|
||||||
] as { key: SettingsKey; text: string; value: any }[];
|
] as { key: SettingsKey; text: string; value: any }[];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
import VolumeDefaults from './Volume/VolumeDefaults.svelte';
|
import VolumeDefaults from './Volume/VolumeDefaults.svelte';
|
||||||
import VolumeSettings from './Volume/VolumeSettings.svelte';
|
import VolumeSettings from './Volume/VolumeSettings.svelte';
|
||||||
import About from './About.svelte';
|
import About from './About.svelte';
|
||||||
|
import QuickAccess from './QuickAccess.svelte';
|
||||||
|
import { beforeNavigate } from '$app/navigation';
|
||||||
|
|
||||||
let transitionParams = {
|
let transitionParams = {
|
||||||
x: 320,
|
x: 320,
|
||||||
@@ -29,6 +31,13 @@
|
|||||||
function onClose() {
|
function onClose() {
|
||||||
hidden = true;
|
hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforeNavigate((nav) => {
|
||||||
|
if (!hidden) {
|
||||||
|
nav.cancel();
|
||||||
|
hidden = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Drawer
|
<Drawer
|
||||||
@@ -47,6 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-5">
|
<div class="flex flex-col gap-5">
|
||||||
<Accordion flush>
|
<Accordion flush>
|
||||||
|
<QuickAccess bind:hidden />
|
||||||
{#if isReader()}
|
{#if isReader()}
|
||||||
<VolumeSettings />
|
<VolumeSettings />
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -1,44 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { volumes } from '$lib/settings';
|
import { totalStats } from '$lib/settings';
|
||||||
import { AccordionItem, P } from 'flowbite-svelte';
|
import { AccordionItem } from 'flowbite-svelte';
|
||||||
|
|
||||||
$: completed = $volumes
|
|
||||||
? Object.values($volumes).reduce((total: number, { completed }) => {
|
|
||||||
if (completed) {
|
|
||||||
total++;
|
|
||||||
}
|
|
||||||
return total;
|
|
||||||
}, 0)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
$: pagesRead = $volumes
|
|
||||||
? Object.values($volumes).reduce((total: number, { progress }) => {
|
|
||||||
total += progress;
|
|
||||||
return total;
|
|
||||||
}, 0)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
$: charsRead = $volumes
|
|
||||||
? Object.values($volumes).reduce((total: number, { chars }) => {
|
|
||||||
total += chars;
|
|
||||||
return total;
|
|
||||||
}, 0)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
$: minutesRead = $volumes
|
|
||||||
? Object.values($volumes).reduce((total: number, { timeReadInMinutes }) => {
|
|
||||||
total += timeReadInMinutes;
|
|
||||||
return total;
|
|
||||||
}, 0)
|
|
||||||
: 0;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AccordionItem>
|
<AccordionItem>
|
||||||
<span slot="header">Stats</span>
|
<span slot="header">Stats</span>
|
||||||
<div>
|
<div>
|
||||||
<p>Completed volumes: {completed}</p>
|
<p>Completed volumes: {$totalStats?.completed || 0}</p>
|
||||||
<p>Pages read: {pagesRead}</p>
|
<p>Pages read: {$totalStats?.pagesRead || 0}</p>
|
||||||
<p>Characters read: {charsRead}</p>
|
<p>Characters read: {$totalStats?.charsRead || 0}</p>
|
||||||
<p>Minutes read: {minutesRead}</p>
|
<p>Minutes read: {$totalStats?.minutesRead || 0}</p>
|
||||||
</div>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
import { AccordionItem, Helper, Toggle } from 'flowbite-svelte';
|
import { AccordionItem, Helper, Toggle } from 'flowbite-svelte';
|
||||||
|
|
||||||
$: toggles = [
|
$: toggles = [
|
||||||
{ key: 'rightToLeft', text: 'Right to left', value: $settings.volumeDefaults.rightToLeft },
|
{ key: 'rightToLeft', text: 'Right to left', value: $settings.volumeDefaults?.rightToLeft },
|
||||||
{
|
{
|
||||||
key: 'singlePageView',
|
key: 'singlePageView',
|
||||||
text: 'Single page view',
|
text: 'Single page view',
|
||||||
value: $settings.volumeDefaults.singlePageView
|
value: $settings.volumeDefaults?.singlePageView
|
||||||
},
|
},
|
||||||
{ key: 'hasCover', text: 'First page is cover', value: $settings.volumeDefaults.hasCover }
|
{ key: 'hasCover', text: 'First page is cover', value: $settings.volumeDefaults?.hasCover }
|
||||||
] as { key: VolumeDefaultsKey; text: string; value: any }[];
|
] as { key: VolumeDefaultsKey; text: string; value: any }[];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { toggleFullScreen, zoomDefault } from '$lib/panzoom';
|
import { zoomDefault } from '$lib/panzoom';
|
||||||
import {
|
import {
|
||||||
updateProgress,
|
updateProgress,
|
||||||
updateVolumeSetting,
|
updateVolumeSetting,
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
volumeSettings,
|
volumeSettings,
|
||||||
type VolumeSettingsKey
|
type VolumeSettingsKey
|
||||||
} from '$lib/settings';
|
} from '$lib/settings';
|
||||||
import { AccordionItem, Button, Helper, Toggle } from 'flowbite-svelte';
|
import { AccordionItem, Helper, Toggle } from 'flowbite-svelte';
|
||||||
|
|
||||||
const volumeId = $page.params.volume;
|
const volumeId = $page.params.volume;
|
||||||
|
|
||||||
@@ -37,6 +37,5 @@
|
|||||||
{#each toggles as { key, text, value }}
|
{#each toggles as { key, text, value }}
|
||||||
<Toggle size="small" checked={value} on:change={() => onChange(key, value)}>{text}</Toggle>
|
<Toggle size="small" checked={value} on:change={() => onChange(key, value)}>{text}</Toggle>
|
||||||
{/each}
|
{/each}
|
||||||
<Button color="alternative" on:click={toggleFullScreen}>Toggle fullscreen</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Button, Dropzone, Modal, Spinner } from 'flowbite-svelte';
|
import { Button, Dropzone, Modal, Spinner, Accordion, AccordionItem } from 'flowbite-svelte';
|
||||||
import FileUpload from './FileUpload.svelte';
|
import FileUpload from './FileUpload.svelte';
|
||||||
import { processFiles } from '$lib/upload';
|
import { processFiles } from '$lib/upload';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { scanFiles } from '$lib/upload';
|
import { scanFiles } from '$lib/upload';
|
||||||
import { formatBytes } from '$lib/util/upload';
|
import { formatBytes } from '$lib/util/upload';
|
||||||
|
import { toClipboard } from '$lib/util';
|
||||||
|
|
||||||
export let open = false;
|
export let open = false;
|
||||||
|
|
||||||
@@ -90,6 +91,33 @@
|
|||||||
<h2 class="justify-center flex">Loading...</h2>
|
<h2 class="justify-center flex">Loading...</h2>
|
||||||
<div class="text-center"><Spinner /></div>
|
<div class="text-center"><Spinner /></div>
|
||||||
{:then}
|
{:then}
|
||||||
|
<Accordion flush>
|
||||||
|
<AccordionItem>
|
||||||
|
<span slot="header">What to upload?</span>
|
||||||
|
<div class="flex flex-col gap-5">
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Firstly, ensure that you process your manga with the <b>0.2.0-beta.6</b> of mokuro, you
|
||||||
|
can install it by running the following command:
|
||||||
|
</p>
|
||||||
|
<div role="none" on:click={toClipboard}>
|
||||||
|
<code class="text-primary-600 bg-slate-900"
|
||||||
|
>pip3 install git+https://github.com/kha-white/mokuro.git@web-reader</code
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
This will generate a <code>.mokuro</code> file for each volume processed, upload your
|
||||||
|
manga along with the <code>.mokuro</code> files.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
On mobile, uploading via directory is not supported so you will need to zip your manga
|
||||||
|
first and then upload it via
|
||||||
|
<code class="text-primary-600 bg-slate-900">choose files</code>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</AccordionItem>
|
||||||
|
</Accordion>
|
||||||
<Dropzone
|
<Dropzone
|
||||||
id="dropzone"
|
id="dropzone"
|
||||||
on:drop={dropHandle}
|
on:drop={dropHandle}
|
||||||
@@ -141,7 +169,6 @@
|
|||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
</Dropzone>
|
</Dropzone>
|
||||||
|
|
||||||
<p class=" text-sm text-gray-500 dark:text-gray-400 text-center">{storageSpace}</p>
|
<p class=" text-sm text-gray-500 dark:text-gray-400 text-center">{storageSpace}</p>
|
||||||
<div class="flex flex-1 flex-col gap-2">
|
<div class="flex flex-1 flex-col gap-2">
|
||||||
<Button outline on:click={reset} {disabled} color="dark">Reset</Button>
|
<Button outline on:click={reset} {disabled} color="dark">Reset</Button>
|
||||||
|
|||||||
@@ -1,34 +1,72 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { progress } from '$lib/settings';
|
import { deleteVolume, progress } from '$lib/settings';
|
||||||
import type { Volume } from '$lib/types';
|
import type { Volume } from '$lib/types';
|
||||||
import { ListgroupItem } from 'flowbite-svelte';
|
import { promptConfirmation } from '$lib/util';
|
||||||
import { CheckCircleSolid } from 'flowbite-svelte-icons';
|
import { ListgroupItem, Frame } from 'flowbite-svelte';
|
||||||
import type { ListGroupItemType } from 'flowbite-svelte/dist/types';
|
import { CheckCircleSolid, TrashBinSolid } from 'flowbite-svelte-icons';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
import { db } from '$lib/catalog/db';
|
||||||
|
|
||||||
export let item: string | ListGroupItemType;
|
export let volume: Volume;
|
||||||
const volume = item as Volume;
|
|
||||||
|
|
||||||
const { volumeName, mokuroData } = volume as Volume;
|
const { volumeName, mokuroData } = volume as Volume;
|
||||||
|
const { title_uuid, volume_uuid } = mokuroData;
|
||||||
|
const volName = decodeURI(volumeName);
|
||||||
|
|
||||||
$: currentPage = $progress?.[volume?.mokuroData.volume_uuid || 0] || 1;
|
$: currentPage = $progress?.[volume_uuid || 0] || 1;
|
||||||
$: progressDisplay = `${currentPage} / ${volume.mokuroData.pages.length}`;
|
$: progressDisplay = `${
|
||||||
$: isComplete = currentPage === volume.mokuroData.pages.length;
|
currentPage === volume.mokuroData.pages.length - 1 ? currentPage + 1 : currentPage
|
||||||
|
} / ${volume.mokuroData.pages.length}`;
|
||||||
|
$: isComplete =
|
||||||
|
currentPage === volume.mokuroData.pages.length ||
|
||||||
|
currentPage === volume.mokuroData.pages.length - 1;
|
||||||
|
|
||||||
|
async function onDeleteClicked(e: Event) {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
promptConfirmation(`Delete ${volName}?`, async () => {
|
||||||
|
const existingCatalog = await db.catalog.get(title_uuid);
|
||||||
|
const updated = existingCatalog?.manga.filter(({ mokuroData }) => {
|
||||||
|
return mokuroData.volume_uuid !== volume_uuid;
|
||||||
|
});
|
||||||
|
|
||||||
|
deleteVolume(volume_uuid);
|
||||||
|
if (updated && updated.length > 0) {
|
||||||
|
await db.catalog.update(title_uuid, { manga: updated });
|
||||||
|
goto(`/${$page.params.manga}`);
|
||||||
|
} else {
|
||||||
|
db.catalog.delete(title_uuid);
|
||||||
|
goto('/');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a href={`${$page.params.manga}/${mokuroData.volume_uuid}`} class="h-full w-full">
|
{#if $page.params.manga}
|
||||||
<ListgroupItem>
|
<Frame rounded border class="divide-y divide-gray-200 dark:divide-gray-600">
|
||||||
<div
|
<ListgroupItem
|
||||||
class:text-green-400={isComplete}
|
on:click={() => goto(`/${$page.params.manga}/${volume_uuid}`)}
|
||||||
class="flex flex-row gap-5 items-center justify-between w-full"
|
normalClass="py-4"
|
||||||
>
|
>
|
||||||
<div>
|
<div
|
||||||
<p class="font-semibold" class:text-white={!isComplete}>{decodeURI(volumeName)}</p>
|
class:text-green-400={isComplete}
|
||||||
<p>{progressDisplay}</p>
|
class="flex flex-row gap-5 items-center justify-between w-full"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<p class="font-semibold" class:text-white={!isComplete}>{volName}</p>
|
||||||
|
<p>{progressDisplay}</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<TrashBinSolid
|
||||||
|
class="text-red-400 hover:text-red-500 z-10 poin"
|
||||||
|
on:click={onDeleteClicked}
|
||||||
|
/>
|
||||||
|
{#if isComplete}
|
||||||
|
<CheckCircleSolid />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#if isComplete}
|
</ListgroupItem>
|
||||||
<CheckCircleSolid />
|
</Frame>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
|
||||||
</ListgroupItem>
|
|
||||||
</a>
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export const READER_VERSION = '0.9.0'
|
export const READER_VERSION = '0.9.1'
|
||||||
@@ -147,9 +147,9 @@ export function keepInBounds() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const { mobile } = get(settings)
|
const { mobile, bounds } = get(settings)
|
||||||
|
|
||||||
if (!mobile) {
|
if (!mobile && !bounds) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ export function keepInBounds() {
|
|||||||
const width = container.offsetWidth * scale;
|
const width = container.offsetWidth * scale;
|
||||||
const height = container.offsetHeight * scale;
|
const height = container.offsetHeight * scale;
|
||||||
|
|
||||||
const marginX = innerWidth * 0.01;
|
const marginX = innerWidth * 0.001;
|
||||||
const marginY = innerHeight * 0.01;
|
const marginY = innerHeight * 0.01;
|
||||||
|
|
||||||
let minX = innerWidth - width - marginX;
|
let minX = innerWidth - width - marginX;
|
||||||
@@ -190,7 +190,6 @@ export function keepInBounds() {
|
|||||||
|
|
||||||
if (x < minX) {
|
if (x < minX) {
|
||||||
transform.x = minX;
|
transform.x = minX;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (x > maxX) {
|
if (x > maxX) {
|
||||||
transform.x = maxX;
|
transform.x = maxX;
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export * from './volume-data'
|
export * from './volume-data'
|
||||||
export * from './settings'
|
export * from './settings'
|
||||||
|
export * from './misc'
|
||||||
33
src/lib/settings/misc.ts
Normal file
33
src/lib/settings/misc.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { browser } from '$app/environment';
|
||||||
|
import { writable } from 'svelte/store';
|
||||||
|
|
||||||
|
export type MiscSettings = {
|
||||||
|
galleryLayout: 'grid' | 'list';
|
||||||
|
gallerySorting: 'ASC' | 'DESC';
|
||||||
|
};
|
||||||
|
|
||||||
|
export type MiscSettingsKey = keyof MiscSettings;
|
||||||
|
|
||||||
|
const defaultSettings: MiscSettings = {
|
||||||
|
galleryLayout: 'grid',
|
||||||
|
gallerySorting: 'ASC',
|
||||||
|
}
|
||||||
|
|
||||||
|
const stored = browser ? window.localStorage.getItem('miscSettings') : undefined;
|
||||||
|
|
||||||
|
export const miscSettings = writable<MiscSettings>(stored ? JSON.parse(stored) : defaultSettings);
|
||||||
|
|
||||||
|
miscSettings.subscribe((miscSettings) => {
|
||||||
|
if (browser) {
|
||||||
|
window.localStorage.setItem('miscSettings', JSON.stringify(miscSettings));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export function updateMiscSetting(key: MiscSettingsKey, value: any) {
|
||||||
|
miscSettings.update((miscSettings) => {
|
||||||
|
return {
|
||||||
|
...miscSettings,
|
||||||
|
[key]: value
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { zoomDefault } from '$lib/panzoom';
|
|
||||||
import { derived, get, writable } from 'svelte/store';
|
import { derived, get, writable } from 'svelte/store';
|
||||||
|
|
||||||
export type FontSize =
|
export type FontSize =
|
||||||
@@ -32,6 +31,7 @@ export type AnkiConnectSettings = {
|
|||||||
cropImage: boolean;
|
cropImage: boolean;
|
||||||
overwriteImage: boolean;
|
overwriteImage: boolean;
|
||||||
grabSentence: boolean;
|
grabSentence: boolean;
|
||||||
|
triggerMethod: 'rightClick' | 'doubleTap' | 'both'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type VolumeDefaults = {
|
export type VolumeDefaults = {
|
||||||
@@ -41,17 +41,23 @@ export type VolumeDefaults = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type Settings = {
|
export type Settings = {
|
||||||
|
defaultFullscreen: boolean;
|
||||||
textEditable: boolean;
|
textEditable: boolean;
|
||||||
textBoxBorders: boolean;
|
textBoxBorders: boolean;
|
||||||
displayOCR: boolean;
|
displayOCR: boolean;
|
||||||
boldFont: boolean;
|
boldFont: boolean;
|
||||||
pageNum: boolean;
|
pageNum: boolean;
|
||||||
charCount: boolean;
|
charCount: boolean;
|
||||||
|
bounds: boolean;
|
||||||
mobile: boolean;
|
mobile: boolean;
|
||||||
backgroundColor: string;
|
backgroundColor: string;
|
||||||
swipeThreshold: number;
|
swipeThreshold: number;
|
||||||
|
edgeButtonWidth: number;
|
||||||
|
showTimer: boolean;
|
||||||
|
quickActions: boolean;
|
||||||
fontSize: FontSize;
|
fontSize: FontSize;
|
||||||
zoomDefault: ZoomModes;
|
zoomDefault: ZoomModes;
|
||||||
|
invertColors: boolean;
|
||||||
volumeDefaults: VolumeDefaults;
|
volumeDefaults: VolumeDefaults;
|
||||||
ankiConnectSettings: AnkiConnectSettings;
|
ankiConnectSettings: AnkiConnectSettings;
|
||||||
};
|
};
|
||||||
@@ -63,6 +69,7 @@ export type AnkiSettingsKey = keyof AnkiConnectSettings;
|
|||||||
export type VolumeDefaultsKey = keyof VolumeDefaults;
|
export type VolumeDefaultsKey = keyof VolumeDefaults;
|
||||||
|
|
||||||
const defaultSettings: Settings = {
|
const defaultSettings: Settings = {
|
||||||
|
defaultFullscreen: false,
|
||||||
displayOCR: true,
|
displayOCR: true,
|
||||||
textEditable: false,
|
textEditable: false,
|
||||||
textBoxBorders: false,
|
textBoxBorders: false,
|
||||||
@@ -70,10 +77,15 @@ const defaultSettings: Settings = {
|
|||||||
pageNum: true,
|
pageNum: true,
|
||||||
charCount: false,
|
charCount: false,
|
||||||
mobile: false,
|
mobile: false,
|
||||||
|
bounds: false,
|
||||||
backgroundColor: '#030712',
|
backgroundColor: '#030712',
|
||||||
swipeThreshold: 50,
|
swipeThreshold: 50,
|
||||||
|
edgeButtonWidth: 40,
|
||||||
|
showTimer: false,
|
||||||
|
quickActions: true,
|
||||||
fontSize: 'auto',
|
fontSize: 'auto',
|
||||||
zoomDefault: 'zoomFitToScreen',
|
zoomDefault: 'zoomFitToScreen',
|
||||||
|
invertColors: false,
|
||||||
volumeDefaults: {
|
volumeDefaults: {
|
||||||
singlePageView: false,
|
singlePageView: false,
|
||||||
rightToLeft: true,
|
rightToLeft: true,
|
||||||
@@ -85,7 +97,8 @@ const defaultSettings: Settings = {
|
|||||||
grabSentence: false,
|
grabSentence: false,
|
||||||
overwriteImage: true,
|
overwriteImage: true,
|
||||||
pictureField: 'Picture',
|
pictureField: 'Picture',
|
||||||
sentenceField: 'Sentence'
|
sentenceField: 'Sentence',
|
||||||
|
triggerMethod: 'both'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -216,4 +229,4 @@ export function copyProfile(profileToCopy: string, newName: string) {
|
|||||||
|
|
||||||
export function changeProfile(profileId: string) {
|
export function changeProfile(profileId: string) {
|
||||||
currentProfile.set(profileId)
|
currentProfile.set(profileId)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { derived, get, writable } from 'svelte/store';
|
import { derived, get, writable } from 'svelte/store';
|
||||||
import { settings } from './settings';
|
import { settings, updateSetting, } from './settings';
|
||||||
import { zoomDefault } from '$lib/panzoom';
|
import { zoomDefault } from '$lib/panzoom';
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
import { manga, volume } from '$lib/catalog';
|
||||||
|
|
||||||
export type VolumeSettings = {
|
export type VolumeSettings = {
|
||||||
rightToLeft: boolean;
|
rightToLeft: boolean;
|
||||||
@@ -21,6 +23,13 @@ type VolumeData = {
|
|||||||
settings: VolumeSettings;
|
settings: VolumeSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TotalStats = {
|
||||||
|
completed: number;
|
||||||
|
pagesRead: number;
|
||||||
|
charsRead: number;
|
||||||
|
minutesRead: number;
|
||||||
|
}
|
||||||
|
|
||||||
type Volumes = Record<string, VolumeData>;
|
type Volumes = Record<string, VolumeData>;
|
||||||
|
|
||||||
|
|
||||||
@@ -30,7 +39,17 @@ const initial: Volumes = stored && browser ? JSON.parse(stored) : {};
|
|||||||
export const volumes = writable<Volumes>(initial);
|
export const volumes = writable<Volumes>(initial);
|
||||||
|
|
||||||
export function initializeVolume(volume: string) {
|
export function initializeVolume(volume: string) {
|
||||||
const { hasCover, rightToLeft, singlePageView } = get(settings).volumeDefaults
|
const volumeDefaults = get(settings).volumeDefaults;
|
||||||
|
|
||||||
|
if (!volumeDefaults) {
|
||||||
|
updateSetting('volumeDefaults', {
|
||||||
|
singlePageView: false,
|
||||||
|
rightToLeft: true,
|
||||||
|
hasCover: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const { hasCover, rightToLeft, singlePageView } = volumeDefaults
|
||||||
volumes.update((prev) => {
|
volumes.update((prev) => {
|
||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
@@ -132,4 +151,51 @@ export function updateVolumeSetting(volume: string, key: VolumeSettingsKey, valu
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
zoomDefault();
|
zoomDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const totalStats = derived([volumes, page], ([$volumes, $page]) => {
|
||||||
|
if ($page && $volumes) {
|
||||||
|
return Object.values($volumes).reduce<TotalStats>((stats, { chars, completed, timeReadInMinutes, progress }) => {
|
||||||
|
if (completed) {
|
||||||
|
stats.completed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
stats.pagesRead += progress;
|
||||||
|
stats.minutesRead += timeReadInMinutes;
|
||||||
|
stats.charsRead += chars
|
||||||
|
|
||||||
|
return stats;
|
||||||
|
}, {
|
||||||
|
charsRead: 0,
|
||||||
|
completed: 0,
|
||||||
|
pagesRead: 0,
|
||||||
|
minutesRead: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export const mangaStats = derived([manga, volumes], ([$manga, $volumes]) => {
|
||||||
|
if ($manga && $volumes) {
|
||||||
|
return $manga.map((vol) => vol.mokuroData.volume_uuid).reduce(
|
||||||
|
(stats: any, volumeId) => {
|
||||||
|
const timeReadInMinutes = $volumes[volumeId]?.timeReadInMinutes || 0;
|
||||||
|
const chars = $volumes[volumeId]?.chars || 0;
|
||||||
|
const completed = $volumes[volumeId]?.completed || 0;
|
||||||
|
|
||||||
|
stats.timeReadInMinutes = stats.timeReadInMinutes + timeReadInMinutes;
|
||||||
|
stats.chars = stats.chars + chars;
|
||||||
|
stats.completed = stats.completed + completed;
|
||||||
|
|
||||||
|
return stats;
|
||||||
|
},
|
||||||
|
{ timeReadInMinutes: 0, chars: 0, completed: 0 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const volumeStats = derived([volume, volumes], ([$volume, $volumes]) => {
|
||||||
|
if ($volume && $volumes) {
|
||||||
|
const { chars, completed, timeReadInMinutes, progress } = $volumes[$volume.mokuroData.volume_uuid]
|
||||||
|
return { chars, completed, timeReadInMinutes, progress }
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -2,27 +2,41 @@ import { db } from '$lib/catalog/db';
|
|||||||
import type { Volume } from '$lib/types';
|
import type { Volume } from '$lib/types';
|
||||||
import { showSnackbar } from '$lib/util/snackbar';
|
import { showSnackbar } from '$lib/util/snackbar';
|
||||||
import { requestPersistentStorage } from '$lib/util/upload';
|
import { requestPersistentStorage } from '$lib/util/upload';
|
||||||
import { BlobReader, ZipReader, BlobWriter, getMimeType } from '@zip.js/zip.js';
|
import { ZipReader, BlobWriter, getMimeType, Uint8ArrayReader } from '@zip.js/zip.js';
|
||||||
|
|
||||||
export * from './web-import'
|
export * from './web-import'
|
||||||
|
|
||||||
const zipTypes = ['zip', 'cbz', 'ZIP', 'CBZ'];
|
const zipTypes = ['zip', 'cbz', 'ZIP', 'CBZ'];
|
||||||
const imageTypes = ['image/jpeg', 'image/png', 'image/webp'];
|
const imageTypes = ['image/jpeg', 'image/png', 'image/webp'];
|
||||||
|
|
||||||
|
|
||||||
export async function unzipManga(file: File) {
|
export async function unzipManga(file: File) {
|
||||||
const zipFileReader = new BlobReader(file);
|
const zipFileReader = new Uint8ArrayReader(new Uint8Array(await file.arrayBuffer()));
|
||||||
const zipReader = new ZipReader(zipFileReader);
|
const zipReader = new ZipReader(zipFileReader);
|
||||||
|
|
||||||
const entries = await zipReader.getEntries();
|
const entries = await zipReader.getEntries();
|
||||||
const unzippedFiles: Record<string, File> = {};
|
const unzippedFiles: Record<string, File> = {};
|
||||||
|
|
||||||
for (const entry of entries) {
|
const sortedEntries = entries.sort((a, b) => {
|
||||||
|
return a.filename.localeCompare(b.filename, undefined, {
|
||||||
|
numeric: true,
|
||||||
|
sensitivity: 'base'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const entry of sortedEntries) {
|
||||||
const mime = getMimeType(entry.filename);
|
const mime = getMimeType(entry.filename);
|
||||||
if (imageTypes.includes(mime)) {
|
const isMokuroFile = entry.filename.split('.').pop() === 'mokuro'
|
||||||
|
|
||||||
|
if (imageTypes.includes(mime) || isMokuroFile) {
|
||||||
const blob = await entry.getData?.(new BlobWriter(mime));
|
const blob = await entry.getData?.(new BlobWriter(mime));
|
||||||
if (blob) {
|
if (blob) {
|
||||||
const file = new File([blob], entry.filename, { type: mime });
|
const fileName = entry.filename.split('/').pop() || entry.filename;
|
||||||
|
const file = new File([blob], fileName, { type: mime });
|
||||||
|
if (!file.webkitRelativePath) {
|
||||||
|
Object.defineProperty(file, 'webkitRelativePath', {
|
||||||
|
value: entry.filename
|
||||||
|
})
|
||||||
|
}
|
||||||
unzippedFiles[entry.filename] = file;
|
unzippedFiles[entry.filename] = file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,10 +104,17 @@ export async function scanFiles(item: FileSystemEntry, files: Promise<File | und
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function processFiles(files: File[]) {
|
export async function processFiles(_files: File[]) {
|
||||||
const volumes: Record<string, Volume> = {};
|
const volumes: Record<string, Volume> = {};
|
||||||
const mangas: string[] = [];
|
const mangas: string[] = [];
|
||||||
|
|
||||||
|
const files = _files.sort((a, b) => {
|
||||||
|
return decodeURI(a.name).localeCompare(decodeURI(b.name), undefined, {
|
||||||
|
numeric: true,
|
||||||
|
sensitivity: 'base'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const { ext, filename, path } = getDetails(file);
|
const { ext, filename, path } = getDetails(file);
|
||||||
|
|
||||||
@@ -148,6 +169,11 @@ export async function processFiles(files: File[]) {
|
|||||||
if (ext && zipTypes.includes(ext)) {
|
if (ext && zipTypes.includes(ext)) {
|
||||||
const unzippedFiles = await unzipManga(file);
|
const unzippedFiles = await unzipManga(file);
|
||||||
|
|
||||||
|
if (files.length === 1) {
|
||||||
|
processFiles(Object.values(unzippedFiles))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
volumes[path] = {
|
volumes[path] = {
|
||||||
...volumes[path],
|
...volumes[path],
|
||||||
files: unzippedFiles
|
files: unzippedFiles
|
||||||
|
|||||||
32
src/lib/util/cloud.ts
Normal file
32
src/lib/util/cloud.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
type FileInfo = {
|
||||||
|
accessToken: string;
|
||||||
|
metadata: any;
|
||||||
|
fileId?: string;
|
||||||
|
localStorageId: string;
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const FILES_API_URL = 'https://www.googleapis.com/upload/drive/v3/files';
|
||||||
|
|
||||||
|
export async function uploadFile({ accessToken, fileId, localStorageId, metadata, type }: FileInfo) {
|
||||||
|
const json = localStorage.getItem(localStorageId) || '';
|
||||||
|
const blob = new Blob([json], { type });
|
||||||
|
|
||||||
|
const form = new FormData();
|
||||||
|
|
||||||
|
form.append('resource', new Blob([JSON.stringify(metadata)], { type }));
|
||||||
|
form.append('file', blob);
|
||||||
|
|
||||||
|
|
||||||
|
const res = await fetch(
|
||||||
|
`${FILES_API_URL}${fileId ? `/${fileId}` : ''}?uploadType=multipart`,
|
||||||
|
{
|
||||||
|
method: fileId ? 'PATCH' : 'POST',
|
||||||
|
headers: new Headers({ Authorization: 'Bearer ' + accessToken }),
|
||||||
|
body: form
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return await res.json()
|
||||||
|
}
|
||||||
|
|
||||||
@@ -12,24 +12,28 @@ import type { Page } from "$lib/types";
|
|||||||
export function countChars(line: string) {
|
export function countChars(line: string) {
|
||||||
const isNotJapaneseRegex = /[^0-9A-Z○◯々-〇〻ぁ-ゖゝ-ゞァ-ヺー0-9A-Zヲ-ン\p{Radical}\p{Unified_Ideograph}]+/gimu
|
const isNotJapaneseRegex = /[^0-9A-Z○◯々-〇〻ぁ-ゖゝ-ゞァ-ヺー0-9A-Zヲ-ン\p{Radical}\p{Unified_Ideograph}]+/gimu
|
||||||
const cleaned = line.replace(isNotJapaneseRegex, '')
|
const cleaned = line.replace(isNotJapaneseRegex, '')
|
||||||
return cleaned.length;
|
|
||||||
|
return Array.from(cleaned).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCharCount(pages: Page[], currentPage?: number) {
|
export function getCharCount(pages: Page[], currentPage?: number) {
|
||||||
|
let charCount = 0;
|
||||||
|
let lineCount = 0;
|
||||||
|
|
||||||
if (pages && pages.length > 0) {
|
if (pages && pages.length > 0) {
|
||||||
const max = currentPage || pages.length
|
const max = currentPage || pages.length
|
||||||
let charCount = 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < max; i++) {
|
for (let i = 0; i < max; i++) {
|
||||||
const blocks = pages[i].blocks;
|
const blocks = pages[i].blocks;
|
||||||
|
|
||||||
blocks.forEach((block) => {
|
blocks.forEach((block) => {
|
||||||
|
lineCount += block.lines.length;
|
||||||
block.lines.forEach((line) => {
|
block.lines.forEach((line) => {
|
||||||
charCount += countChars(line);
|
charCount += countChars(line);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return charCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return { charCount, lineCount };
|
||||||
}
|
}
|
||||||
@@ -2,3 +2,5 @@ export * from './snackbar';
|
|||||||
export * from './upload';
|
export * from './upload';
|
||||||
export * from './misc';
|
export * from './misc';
|
||||||
export * from './modals';
|
export * from './modals';
|
||||||
|
export * from './zip'
|
||||||
|
export * from './cloud'
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import { page } from "$app/stores";
|
import { page } from "$app/stores";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
import { showSnackbar } from "./snackbar";
|
||||||
|
import { browser } from "$app/environment";
|
||||||
|
|
||||||
export function clamp(num: number, min: number, max: number) {
|
export function clamp(num: number, min: number, max: number) {
|
||||||
return Math.min(Math.max(num, min), max);
|
return Math.min(Math.max(num, min), max);
|
||||||
@@ -22,4 +24,30 @@ export function debounce(func: () => void, timeout = 50) {
|
|||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = undefined;
|
timer = undefined;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toClipboard() {
|
||||||
|
navigator.clipboard.writeText(
|
||||||
|
'pip3 install git+https://github.com/kha-white/mokuro.git@web-reader'
|
||||||
|
);
|
||||||
|
showSnackbar('Copied to clipboard');
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExtaticPayload = {
|
||||||
|
title: string;
|
||||||
|
volumeName: string;
|
||||||
|
currentCharCount: number;
|
||||||
|
totalCharCount: number;
|
||||||
|
currentPage: number;
|
||||||
|
totalPages: number;
|
||||||
|
currentLineCount: number;
|
||||||
|
totalLineCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExtaticEvent = 'mokuro-reader:page.change' | 'mokuro-reader:reader.closed'
|
||||||
|
|
||||||
|
export function fireExstaticEvent(event: ExtaticEvent, payload: ExtaticPayload) {
|
||||||
|
if (browser) {
|
||||||
|
document.dispatchEvent(new CustomEvent(event, { detail: payload }))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
33
src/lib/util/zip.ts
Normal file
33
src/lib/util/zip.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import type { Volume } from "$lib/types";
|
||||||
|
import {
|
||||||
|
BlobReader,
|
||||||
|
BlobWriter,
|
||||||
|
TextReader,
|
||||||
|
ZipWriter,
|
||||||
|
} from "@zip.js/zip.js";
|
||||||
|
|
||||||
|
export async function zipManga(manga: Volume[]) {
|
||||||
|
const zipWriter = new ZipWriter(new BlobWriter("application/zip"));
|
||||||
|
|
||||||
|
const promises = manga.map((volume) => {
|
||||||
|
const imagePromises = Object.values(volume.files).map((file) => {
|
||||||
|
return zipWriter.add(`${volume.volumeName}/${file.name}`, new BlobReader(file))
|
||||||
|
})
|
||||||
|
|
||||||
|
return [
|
||||||
|
zipWriter.add(`${volume.volumeName}.mokuro`, new TextReader(JSON.stringify(volume.mokuroData))),
|
||||||
|
...imagePromises,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
await Promise.all(promises);
|
||||||
|
|
||||||
|
const zipFileBlob = await zipWriter.close();
|
||||||
|
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = URL.createObjectURL(zipFileBlob);
|
||||||
|
link.download = `${manga[0].mokuroData.title}.zip`;
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '../app.postcss';
|
import '../app.postcss';
|
||||||
|
import { dev } from '$app/environment';
|
||||||
|
import { inject } from '@vercel/analytics';
|
||||||
|
|
||||||
import NavBar from '$lib/components/NavBar.svelte';
|
import NavBar from '$lib/components/NavBar.svelte';
|
||||||
import Snackbar from '$lib/components/Snackbar.svelte';
|
import Snackbar from '$lib/components/Snackbar.svelte';
|
||||||
import ConfirmationPopup from '$lib/components/ConfirmationPopup.svelte';
|
import ConfirmationPopup from '$lib/components/ConfirmationPopup.svelte';
|
||||||
import { settings } from '$lib/settings';
|
|
||||||
|
inject({ mode: dev ? 'development' : 'production' });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class=" h-full min-h-[100svh] text-white">
|
<div class=" h-full min-h-[100svh] text-white">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Catalog from '$lib/components/Catalog.svelte';
|
import Catalog from '$lib/components/Catalog.svelte';
|
||||||
import { createProfile, deleteProfile } from '$lib/settings';
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -4,39 +4,21 @@
|
|||||||
import VolumeItem from '$lib/components/VolumeItem.svelte';
|
import VolumeItem from '$lib/components/VolumeItem.svelte';
|
||||||
import { Button, Listgroup } from 'flowbite-svelte';
|
import { Button, Listgroup } from 'flowbite-svelte';
|
||||||
import { db } from '$lib/catalog/db';
|
import { db } from '$lib/catalog/db';
|
||||||
import { promptConfirmation } from '$lib/util';
|
import { promptConfirmation, zipManga } from '$lib/util';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import type { Volume } from '$lib/types';
|
import type { Volume } from '$lib/types';
|
||||||
import { deleteVolume, volumes } from '$lib/settings';
|
import { deleteVolume, mangaStats, volumes } from '$lib/settings';
|
||||||
|
|
||||||
function sortManga(a: Volume, b: Volume) {
|
function sortManga(a: Volume, b: Volume) {
|
||||||
if (a.volumeName < b.volumeName) {
|
return a.mokuroData.volume.localeCompare(b.mokuroData.volume, undefined, {
|
||||||
return -1;
|
numeric: true,
|
||||||
}
|
sensitivity: 'base'
|
||||||
if (a.volumeName > b.volumeName) {
|
});
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: manga = $catalog?.find((item) => item.id === $page.params.manga)?.manga.sort(sortManga);
|
$: manga = $catalog?.find((item) => item.id === $page.params.manga)?.manga.sort(sortManga);
|
||||||
|
|
||||||
$: stats = manga
|
$: loading = false;
|
||||||
?.map((vol) => vol.mokuroData.volume_uuid)
|
|
||||||
?.reduce(
|
|
||||||
(stats: any, volumeId) => {
|
|
||||||
const timeReadInMinutes = $volumes[volumeId]?.timeReadInMinutes || 0;
|
|
||||||
const chars = $volumes[volumeId]?.chars || 0;
|
|
||||||
const completed = $volumes[volumeId]?.completed || 0;
|
|
||||||
|
|
||||||
stats.timeReadInMinutes = stats.timeReadInMinutes + timeReadInMinutes;
|
|
||||||
stats.chars = stats.chars + chars;
|
|
||||||
stats.completed = stats.completed + completed;
|
|
||||||
|
|
||||||
return stats;
|
|
||||||
},
|
|
||||||
{ timeReadInMinutes: 0, chars: 0, completed: 0 }
|
|
||||||
);
|
|
||||||
|
|
||||||
async function confirmDelete() {
|
async function confirmDelete() {
|
||||||
const title = manga?.[0].mokuroData.title_uuid;
|
const title = manga?.[0].mokuroData.title_uuid;
|
||||||
@@ -52,28 +34,40 @@
|
|||||||
function onDelete() {
|
function onDelete() {
|
||||||
promptConfirmation('Are you sure you want to delete this manga?', confirmDelete);
|
promptConfirmation('Are you sure you want to delete this manga?', confirmDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onExtract() {
|
||||||
|
if (manga) {
|
||||||
|
loading = true;
|
||||||
|
loading = await zipManga(manga);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{manga?.[0].mokuroData.title || 'Manga'}</title>
|
<title>{manga?.[0].mokuroData.title || 'Manga'}</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
{#if manga}
|
{#if manga && $mangaStats}
|
||||||
<div class="p-2 flex flex-col gap-5">
|
<div class="p-2 flex flex-col gap-5">
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row justify-between">
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<h3 class="font-bold">{manga[0].mokuroData.title}</h3>
|
<h3 class="font-bold">{manga[0].mokuroData.title}</h3>
|
||||||
<div class="flex flex-col gap-0 sm:flex-row sm:gap-5">
|
<div class="flex flex-col gap-0 sm:flex-row sm:gap-5">
|
||||||
<p>Volumes: {stats.completed} / {manga.length}</p>
|
<p>Volumes: {$mangaStats.completed} / {manga.length}</p>
|
||||||
<p>Characters read: {stats.chars}</p>
|
<p>Characters read: {$mangaStats.chars}</p>
|
||||||
<p>Minutes read: {stats.timeReadInMinutes}</p>
|
<p>Minutes read: {$mangaStats.timeReadInMinutes}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="sm:block flex-col flex gap-2">
|
||||||
<Button color="alternative" on:click={onDelete}>Remove manga</Button>
|
<Button color="alternative" on:click={onDelete}>Remove manga</Button>
|
||||||
|
<Button color="light" on:click={onExtract} disabled={loading}>
|
||||||
|
{loading ? 'Extracting...' : 'Extract manga'}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Listgroup items={manga} let:item active class="flex-1 h-full w-full">
|
<Listgroup active class="flex-1 h-full w-full">
|
||||||
<VolumeItem {item} />
|
{#each manga as volume (volume.mokuroData.volume_uuid)}
|
||||||
|
<VolumeItem {volume} />
|
||||||
|
{/each}
|
||||||
</Listgroup>
|
</Listgroup>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
<style>
|
<style>
|
||||||
:global(body.reader) {
|
:global(body.reader) {
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
|
overscroll-behavior: contain;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,24 +1,30 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import Reader from '$lib/components/Reader/Reader.svelte';
|
import Reader from '$lib/components/Reader/Reader.svelte';
|
||||||
import { initializeVolume, startCount, volumeSettings, volumes } from '$lib/settings';
|
import Timer from '$lib/components/Reader/Timer.svelte';
|
||||||
|
import { initializeVolume, settings, startCount, volumeSettings, volumes } from '$lib/settings';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
const volumeId = $page.params.volume;
|
const volumeId = $page.params.volume;
|
||||||
|
let count: undefined | number = undefined;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (!$volumes?.[volumeId]) {
|
if (!$volumes?.[volumeId]) {
|
||||||
initializeVolume(volumeId);
|
initializeVolume(volumeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const count = startCount(volumeId);
|
count = startCount(volumeId);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
clearInterval(count);
|
clearInterval(count);
|
||||||
|
count = undefined;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $volumeSettings[volumeId]}
|
{#if $volumeSettings[volumeId]}
|
||||||
|
{#if $settings.showTimer}
|
||||||
|
<Timer bind:count {volumeId} />
|
||||||
|
{/if}
|
||||||
<Reader volumeSettings={$volumeSettings[volumeId]} />
|
<Reader volumeSettings={$volumeSettings[volumeId]} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
363
src/routes/cloud/+page.svelte
Normal file
363
src/routes/cloud/+page.svelte
Normal file
@@ -0,0 +1,363 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { processFiles } from '$lib/upload';
|
||||||
|
import Loader from '$lib/components/Loader.svelte';
|
||||||
|
import { formatBytes, showSnackbar, uploadFile } from '$lib/util';
|
||||||
|
import { Button, P, Progressbar } from 'flowbite-svelte';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
import { promptConfirmation } from '$lib/util';
|
||||||
|
import { GoogleSolid } from 'flowbite-svelte-icons';
|
||||||
|
import { profiles, volumes } from '$lib/settings';
|
||||||
|
|
||||||
|
const CLIENT_ID = import.meta.env.VITE_GDRIVE_CLIENT_ID;
|
||||||
|
const API_KEY = import.meta.env.VITE_GDRIVE_API_KEY;
|
||||||
|
|
||||||
|
const DISCOVERY_DOC = 'https://www.googleapis.com/discovery/v1/apis/drive/v3/rest';
|
||||||
|
const SCOPES = 'https://www.googleapis.com/auth/drive.file';
|
||||||
|
|
||||||
|
const FOLDER_MIME_TYPE = 'application/vnd.google-apps.folder';
|
||||||
|
const READER_FOLDER = 'mokuro-reader';
|
||||||
|
const VOLUME_DATA_FILE = 'volume-data.json';
|
||||||
|
const PROFILES_FILE = 'profiles.json';
|
||||||
|
|
||||||
|
const type = 'application/json';
|
||||||
|
|
||||||
|
let tokenClient: any;
|
||||||
|
let accessToken = '';
|
||||||
|
|
||||||
|
let readerFolderId = '';
|
||||||
|
let volumeDataId = '';
|
||||||
|
let profilesId = '';
|
||||||
|
|
||||||
|
let loadingMessage = '';
|
||||||
|
|
||||||
|
let completed = 0;
|
||||||
|
let totalSize = 0;
|
||||||
|
$: progress = Math.floor((completed / totalSize) * 100).toString();
|
||||||
|
|
||||||
|
function xhrDownloadFileId(fileId: string) {
|
||||||
|
return new Promise<Blob>((resolve, reject) => {
|
||||||
|
const { access_token } = gapi.auth.getToken();
|
||||||
|
const xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
completed = 0;
|
||||||
|
totalSize = 0;
|
||||||
|
|
||||||
|
xhr.open('GET', `https://www.googleapis.com/drive/v3/files/${fileId}?alt=media`);
|
||||||
|
xhr.setRequestHeader('Authorization', `Bearer ${access_token}`);
|
||||||
|
xhr.responseType = 'blob';
|
||||||
|
|
||||||
|
xhr.onprogress = ({ loaded, total }) => {
|
||||||
|
loadingMessage = '';
|
||||||
|
completed = loaded;
|
||||||
|
totalSize = total;
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onabort = (event) => {
|
||||||
|
console.warn(`xhr ${fileId}: download aborted at ${event.loaded} of ${event.total}`);
|
||||||
|
showSnackbar('Download failed');
|
||||||
|
reject(new Error('Download aborted'));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onerror = (event) => {
|
||||||
|
console.error(`xhr ${fileId}: download error at ${event.loaded} of ${event.total}`);
|
||||||
|
showSnackbar('Download failed');
|
||||||
|
reject(new Error('Error downloading file'));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onload = () => {
|
||||||
|
completed = 0;
|
||||||
|
totalSize = 0;
|
||||||
|
resolve(xhr.response);
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.ontimeout = (event) => {
|
||||||
|
console.warn(`xhr ${fileId}: download timeout after ${event.loaded} of ${event.total}`);
|
||||||
|
showSnackbar('Download timed out');
|
||||||
|
reject(new Error('Timout downloading file'));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function connectDrive(resp?: any) {
|
||||||
|
if (resp?.error !== undefined) {
|
||||||
|
throw resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
accessToken = resp?.access_token;
|
||||||
|
loadingMessage = 'Connecting to drive';
|
||||||
|
|
||||||
|
const { result: readerFolderRes } = await gapi.client.drive.files.list({
|
||||||
|
q: `mimeType='application/vnd.google-apps.folder' and name='${READER_FOLDER}'`,
|
||||||
|
fields: 'files(id)'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (readerFolderRes.files?.length === 0) {
|
||||||
|
const { result: createReaderFolderRes } = await gapi.client.drive.files.create({
|
||||||
|
resource: { mimeType: FOLDER_MIME_TYPE, name: READER_FOLDER },
|
||||||
|
fields: 'id'
|
||||||
|
});
|
||||||
|
|
||||||
|
readerFolderId = createReaderFolderRes.id || '';
|
||||||
|
} else {
|
||||||
|
const id = readerFolderRes.files?.[0]?.id || '';
|
||||||
|
|
||||||
|
readerFolderId = id || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
const { result: volumeDataRes } = await gapi.client.drive.files.list({
|
||||||
|
q: `'${readerFolderId}' in parents and name='${VOLUME_DATA_FILE}'`,
|
||||||
|
fields: 'files(id, name)'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (volumeDataRes.files?.length !== 0) {
|
||||||
|
volumeDataId = volumeDataRes.files?.[0].id || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
const { result: profilesRes } = await gapi.client.drive.files.list({
|
||||||
|
q: `'${readerFolderId}' in parents and name='${PROFILES_FILE}'`,
|
||||||
|
fields: 'files(id, name)'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (profilesRes.files?.length !== 0) {
|
||||||
|
profilesId = profilesRes.files?.[0].id || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
loadingMessage = '';
|
||||||
|
|
||||||
|
if (accessToken) {
|
||||||
|
showSnackbar('Connected to Google Drive');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function signIn() {
|
||||||
|
if (gapi.client.getToken() === null) {
|
||||||
|
tokenClient.requestAccessToken({ prompt: 'consent' });
|
||||||
|
} else {
|
||||||
|
tokenClient.requestAccessToken({ prompt: '' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
gapi.load('client', async () => {
|
||||||
|
await gapi.client.init({
|
||||||
|
apiKey: API_KEY,
|
||||||
|
discoveryDocs: [DISCOVERY_DOC]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
gapi.load('picker', () => {});
|
||||||
|
|
||||||
|
tokenClient = google.accounts.oauth2.initTokenClient({
|
||||||
|
client_id: CLIENT_ID,
|
||||||
|
scope: SCOPES,
|
||||||
|
callback: connectDrive
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function createPicker() {
|
||||||
|
const docsView = new google.picker.DocsView(google.picker.ViewId.DOCS)
|
||||||
|
.setMimeTypes('application/zip,application/x-zip-compressed')
|
||||||
|
.setMode(google.picker.DocsViewMode.LIST)
|
||||||
|
.setIncludeFolders(true)
|
||||||
|
.setParent(readerFolderId);
|
||||||
|
|
||||||
|
const picker = new google.picker.PickerBuilder()
|
||||||
|
.addView(docsView)
|
||||||
|
.setOAuthToken(accessToken)
|
||||||
|
.setAppId(CLIENT_ID)
|
||||||
|
.setDeveloperKey(API_KEY)
|
||||||
|
.enableFeature(google.picker.Feature.NAV_HIDDEN)
|
||||||
|
.setCallback(pickerCallback)
|
||||||
|
.build();
|
||||||
|
picker.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function pickerCallback(data: google.picker.ResponseObject) {
|
||||||
|
try {
|
||||||
|
if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) {
|
||||||
|
loadingMessage = 'Downloading from drive...';
|
||||||
|
const docs = data[google.picker.Response.DOCUMENTS];
|
||||||
|
const blob = await xhrDownloadFileId(docs[0].id);
|
||||||
|
|
||||||
|
loadingMessage = 'Adding to catalog...';
|
||||||
|
|
||||||
|
const file = new File([blob], docs[0].name);
|
||||||
|
|
||||||
|
await processFiles([file]);
|
||||||
|
loadingMessage = '';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showSnackbar('Something went wrong');
|
||||||
|
loadingMessage = '';
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onUploadVolumeData() {
|
||||||
|
const metadata = {
|
||||||
|
mimeType: type,
|
||||||
|
name: VOLUME_DATA_FILE,
|
||||||
|
parents: [volumeDataId ? null : readerFolderId]
|
||||||
|
};
|
||||||
|
|
||||||
|
loadingMessage = 'Uploading volume data';
|
||||||
|
|
||||||
|
const res = await uploadFile({
|
||||||
|
accessToken,
|
||||||
|
fileId: volumeDataId,
|
||||||
|
metadata,
|
||||||
|
localStorageId: 'volumes',
|
||||||
|
type
|
||||||
|
});
|
||||||
|
|
||||||
|
volumeDataId = res.id;
|
||||||
|
loadingMessage = '';
|
||||||
|
|
||||||
|
if (volumeDataId) {
|
||||||
|
showSnackbar('Volume data uploaded');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onUploadProfiles() {
|
||||||
|
const metadata = {
|
||||||
|
mimeType: type,
|
||||||
|
name: PROFILES_FILE,
|
||||||
|
parents: [profilesId ? null : readerFolderId]
|
||||||
|
};
|
||||||
|
|
||||||
|
loadingMessage = 'Uploading profiles';
|
||||||
|
|
||||||
|
const res = await uploadFile({
|
||||||
|
accessToken,
|
||||||
|
fileId: profilesId,
|
||||||
|
metadata,
|
||||||
|
localStorageId: 'profiles',
|
||||||
|
type
|
||||||
|
});
|
||||||
|
|
||||||
|
profilesId = res.id;
|
||||||
|
loadingMessage = '';
|
||||||
|
|
||||||
|
if (profilesId) {
|
||||||
|
showSnackbar('Profiles uploaded');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onDownloadVolumeData() {
|
||||||
|
loadingMessage = 'Downloading volume data';
|
||||||
|
|
||||||
|
const { body } = await gapi.client.drive.files.get({
|
||||||
|
fileId: volumeDataId,
|
||||||
|
alt: 'media'
|
||||||
|
});
|
||||||
|
|
||||||
|
const downloaded = JSON.parse(body);
|
||||||
|
|
||||||
|
volumes.update((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
...downloaded
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
loadingMessage = '';
|
||||||
|
showSnackbar('Volume data downloaded');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onDownloadProfiles() {
|
||||||
|
loadingMessage = 'Downloading profiles';
|
||||||
|
|
||||||
|
const { body } = await gapi.client.drive.files.get({
|
||||||
|
fileId: profilesId,
|
||||||
|
alt: 'media'
|
||||||
|
});
|
||||||
|
|
||||||
|
const downloaded = JSON.parse(body);
|
||||||
|
|
||||||
|
profiles.update((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
...downloaded
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
loadingMessage = '';
|
||||||
|
showSnackbar('Profiles downloaded');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>Cloud</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<div class="p-2 h-[90svh]">
|
||||||
|
{#if loadingMessage || completed > 0}
|
||||||
|
<Loader>
|
||||||
|
{#if completed > 0}
|
||||||
|
<P>{formatBytes(completed)} / {formatBytes(totalSize)}</P>
|
||||||
|
<Progressbar {progress} />
|
||||||
|
{:else}
|
||||||
|
{loadingMessage}
|
||||||
|
{/if}
|
||||||
|
</Loader>
|
||||||
|
{:else if accessToken}
|
||||||
|
<div class="flex justify-between items-center gap-6 flex-col">
|
||||||
|
<h2 class="text-3xl font-semibold text-center pt-2">Google Drive:</h2>
|
||||||
|
<p class="text-center">
|
||||||
|
Add your zipped manga files to the <span class="text-primary-700">{READER_FOLDER}</span> folder
|
||||||
|
in your Google Drive.
|
||||||
|
</p>
|
||||||
|
<div class="flex flex-col gap-4 w-full max-w-3xl">
|
||||||
|
<Button color="blue" on:click={createPicker}>Download manga</Button>
|
||||||
|
<div class="flex-col gap-2 flex">
|
||||||
|
<Button
|
||||||
|
color="dark"
|
||||||
|
on:click={() => promptConfirmation('Upload volume data?', onUploadVolumeData)}
|
||||||
|
>
|
||||||
|
Upload volume data
|
||||||
|
</Button>
|
||||||
|
{#if volumeDataId}
|
||||||
|
<Button
|
||||||
|
color="alternative"
|
||||||
|
on:click={() =>
|
||||||
|
promptConfirmation('Download and overwrite volume data?', onDownloadVolumeData)}
|
||||||
|
>
|
||||||
|
Download volume data
|
||||||
|
</Button>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div class="flex-col gap-2 flex">
|
||||||
|
<Button
|
||||||
|
color="dark"
|
||||||
|
on:click={() => promptConfirmation('Upload profiles?', onUploadProfiles)}
|
||||||
|
>
|
||||||
|
Upload profiles
|
||||||
|
</Button>
|
||||||
|
{#if profilesId}
|
||||||
|
<Button
|
||||||
|
color="alternative"
|
||||||
|
on:click={() =>
|
||||||
|
promptConfirmation('Download and overwrite profiles?', onDownloadProfiles)}
|
||||||
|
>
|
||||||
|
Download profiles
|
||||||
|
</Button>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex justify-center pt-0 sm:pt-32">
|
||||||
|
<button
|
||||||
|
class="w-full border rounded-lg border-slate-600 p-10 border-opacity-50 hover:bg-slate-800 max-w-3xl"
|
||||||
|
on:click={signIn}
|
||||||
|
>
|
||||||
|
<div class="flex sm:flex-row flex-col gap-2 items-center justify-center">
|
||||||
|
<GoogleSolid size="lg" />
|
||||||
|
<h2 class="text-lg">Connect to Google Drive</h2>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
import { promptConfirmation, showSnackbar } from '$lib/util';
|
import { promptConfirmation, showSnackbar } from '$lib/util';
|
||||||
import { P, Progressbar } from 'flowbite-svelte';
|
import { P, Progressbar } from 'flowbite-svelte';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
export const BASE_URL = 'https://www.mokuro.moe/manga';
|
export const BASE_URL = $page.url.searchParams.get('source') || 'https://mokuro.moe/manga';
|
||||||
|
|
||||||
const manga = $page.url.searchParams.get('manga');
|
const manga = $page.url.searchParams.get('manga');
|
||||||
const volume = $page.url.searchParams.get('volume');
|
const volume = $page.url.searchParams.get('volume');
|
||||||
@@ -41,7 +41,8 @@
|
|||||||
max = items.length;
|
max = items.length;
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
if (imageTypes.includes('.' + item.pathname.split('.').at(-1) || '')) {
|
const itemFileExtension = ('.' + item.pathname.split('.').at(-1)).toLowerCase();
|
||||||
|
if (imageTypes.includes(itemFileExtension || '')) {
|
||||||
const image = await fetch(url + item.pathname);
|
const image = await fetch(url + item.pathname);
|
||||||
const blob = await image.blob();
|
const blob = await image.blob();
|
||||||
const file = new File([blob], item.pathname.substring(1));
|
const file = new File([blob], item.pathname.substring(1));
|
||||||
|
|||||||
Reference in New Issue
Block a user