this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: update civility workers

+551 -85
-1
data/sources/scripts/group_subjects.js
··· 22 22 23 23 function push(lvl, char, toTranslate) { 24 24 const chars = toTranslate ? toTraditional(char) : char 25 - console.log(chars) 26 25 if (chars) all.push([lvl, chars]) 27 26 if (chars.length > 1) { 28 27 chars
+2 -1
deno.json
··· 1 1 { 2 - "version": "2.1.0", 2 + "version": "2.1.2", 3 3 "compilerOptions": { 4 4 "lib": [ 5 5 "deno.ns", ··· 43 43 }, 44 44 "imports": { 45 45 "$/": "./www/", 46 + "@bpev/civility": "jsr:@bpev/civility@^0.0.8", 46 47 "@bpev/sync-link": "jsr:@bpev/sync-link@0.0.17", 47 48 "@byojs/storage": "npm:@byojs/storage@^0.12.1", 48 49 "@inro/simple-tools": "jsr:@inro/simple-tools@0.5.2",
+486 -1
deno.lock
··· 1 1 { 2 2 "version": "5", 3 3 "specifiers": { 4 + "jsr:@bpev/civility@^0.0.8": "0.0.8", 4 5 "jsr:@bpev/sync-link@0.0.17": "0.0.17", 6 + "jsr:@cliffy/ansi@1.0.0": "1.0.0", 7 + "jsr:@cliffy/command@1.0.0": "1.0.0", 8 + "jsr:@cliffy/flags@1.0.0": "1.0.0", 9 + "jsr:@cliffy/internal@1.0.0": "1.0.0", 10 + "jsr:@cliffy/table@1.0.0": "1.0.0", 5 11 "jsr:@inro/simple-tools@0.5.2": "0.5.2", 12 + "jsr:@luca/esbuild-deno-loader@~0.11.1": "0.11.1", 6 13 "jsr:@paulmillr/qr@~0.5.2": "0.5.2", 14 + "jsr:@rodney/parsedown@^1.4.3": "1.4.3", 7 15 "jsr:@std/assert@^1.0.15": "1.0.16", 8 16 "jsr:@std/async@^1.0.15": "1.0.15", 17 + "jsr:@std/bytes@^1.0.2": "1.0.6", 9 18 "jsr:@std/bytes@^1.0.5": "1.0.6", 10 19 "jsr:@std/bytes@^1.0.6": "1.0.6", 20 + "jsr:@std/cli@^1.0.28": "1.0.28", 11 21 "jsr:@std/collections@^1.1.0": "1.1.3", 12 22 "jsr:@std/collections@^1.1.3": "1.1.3", 13 23 "jsr:@std/csv@^1.0.6": "1.0.6", 14 24 "jsr:@std/dotenv@~0.225.5": "0.225.5", 15 - "jsr:@std/fs@^1.0.17": "1.0.21", 25 + "jsr:@std/encoding@^1.0.10": "1.0.10", 26 + "jsr:@std/encoding@^1.0.5": "1.0.10", 27 + "jsr:@std/fmt@^1.0.9": "1.0.9", 28 + "jsr:@std/front-matter@^1.0.9": "1.0.9", 29 + "jsr:@std/fs@^1.0.17": "1.0.23", 16 30 "jsr:@std/fs@^1.0.19": "1.0.21", 31 + "jsr:@std/fs@^1.0.23": "1.0.23", 32 + "jsr:@std/html@^1.0.5": "1.0.5", 33 + "jsr:@std/http@^1.0.25": "1.0.25", 17 34 "jsr:@std/internal@^1.0.12": "1.0.12", 18 35 "jsr:@std/io@~0.225.2": "0.225.2", 36 + "jsr:@std/media-types@^1.1.0": "1.1.0", 37 + "jsr:@std/net@^1.0.6": "1.0.6", 38 + "jsr:@std/path@^1.0.6": "1.1.4", 19 39 "jsr:@std/path@^1.1.2": "1.1.4", 20 40 "jsr:@std/path@^1.1.4": "1.1.4", 21 41 "jsr:@std/semver@^1.0.6": "1.0.6", 22 42 "jsr:@std/streams@1.0.13": "1.0.13", 43 + "jsr:@std/streams@^1.0.17": "1.0.17", 23 44 "jsr:@std/streams@^1.0.9": "1.0.13", 45 + "jsr:@std/text@^1.0.17": "1.0.17", 46 + "jsr:@std/toml@^1.0.3": "1.0.11", 47 + "jsr:@std/yaml@^1.0.5": "1.0.12", 24 48 "npm:@byojs/storage@~0.12.1": "0.12.1", 25 49 "npm:@hono/zod-openapi@^1.1.0": "1.1.4_hono@4.10.4_zod@4.1.12", 26 50 "npm:@leeoniya/ufuzzy@^1.0.19": "1.0.19", 27 51 "npm:@tauri-apps/plugin-store@^2.2.0": "2.4.1", 28 52 "npm:@types/node@*": "24.2.0", 29 53 "npm:cc-cedict@^1.0.3": "1.0.3", 54 + "npm:cheerio@^1.2.0": "1.2.0", 30 55 "npm:chinese-to-pinyin@^1.3.1": "1.3.1", 56 + "npm:esbuild@~0.27.3": "0.27.3", 31 57 "npm:howler@^2.2.4": "2.2.4", 32 58 "npm:json-stringify-pretty-compact@4": "4.0.0", 59 + "npm:lit@^3.3.2": "3.3.2", 33 60 "npm:mithril@^2.3.8": "2.3.8", 34 61 "npm:native-file-system-adapter@^3.0.1": "3.0.1", 35 62 "npm:opencc-js@^1.0.5": "1.0.5", ··· 39 66 "npm:zod@^4.1.12": "4.1.12" 40 67 }, 41 68 "jsr": { 69 + "@bpev/civility@0.0.8": { 70 + "integrity": "a60ac3392e3850d7d1bb47cee5940a754052030cbb1988989bb207999676dd5e", 71 + "dependencies": [ 72 + "jsr:@cliffy/ansi", 73 + "jsr:@cliffy/command", 74 + "jsr:@luca/esbuild-deno-loader", 75 + "jsr:@rodney/parsedown", 76 + "jsr:@std/front-matter", 77 + "jsr:@std/fs@^1.0.23", 78 + "jsr:@std/http", 79 + "jsr:@std/path@^1.1.4", 80 + "npm:cheerio", 81 + "npm:esbuild", 82 + "npm:lit" 83 + ] 84 + }, 42 85 "@bpev/sync-link@0.0.17": { 43 86 "integrity": "a21a2994482b64a90da7061b113703e07f5af90498474103e3ce073118871ee6", 44 87 "dependencies": [ ··· 48 91 "npm:native-file-system-adapter" 49 92 ] 50 93 }, 94 + "@cliffy/ansi@1.0.0": { 95 + "integrity": "987008f74e50aa72cc1517ffccc769711734a14927bc4599e052efe1b9a840e2", 96 + "dependencies": [ 97 + "jsr:@std/fmt" 98 + ] 99 + }, 100 + "@cliffy/command@1.0.0": { 101 + "integrity": "c52a241ea68857fcdaff4f3173eb404f8017d7bc35553b6f533c592b89dde7d2", 102 + "dependencies": [ 103 + "jsr:@cliffy/flags", 104 + "jsr:@cliffy/internal", 105 + "jsr:@cliffy/table", 106 + "jsr:@std/fmt", 107 + "jsr:@std/text" 108 + ] 109 + }, 110 + "@cliffy/flags@1.0.0": { 111 + "integrity": "8b57698adc644da8f90422d58976362d41a4ebca39c312ca1c101585d0148feb", 112 + "dependencies": [ 113 + "jsr:@cliffy/internal", 114 + "jsr:@std/text" 115 + ] 116 + }, 117 + "@cliffy/internal@1.0.0": { 118 + "integrity": "1e17ccbcd5420093c0a93e5b3827bbdc9abac5195bacf187edc44665e54bdde6" 119 + }, 120 + "@cliffy/table@1.0.0": { 121 + "integrity": "3fdaa9e1ef1ea62022108adabd826932bdea8dd05497079896febcd41322907f", 122 + "dependencies": [ 123 + "jsr:@std/fmt" 124 + ] 125 + }, 51 126 "@inro/simple-tools@0.5.2": { 52 127 "integrity": "cc34cd0914b9e0576d9bed9a66a91994123b73f3fd87a4e8db76880181731ee5", 53 128 "dependencies": [ ··· 57 132 "npm:ts-fsrs" 58 133 ] 59 134 }, 135 + "@luca/esbuild-deno-loader@0.11.1": { 136 + "integrity": "dc020d16d75b591f679f6b9288b10f38bdb4f24345edb2f5732affa1d9885267", 137 + "dependencies": [ 138 + "jsr:@std/bytes@^1.0.2", 139 + "jsr:@std/encoding@^1.0.5", 140 + "jsr:@std/path@^1.0.6" 141 + ] 142 + }, 60 143 "@paulmillr/qr@0.5.2": { 61 144 "integrity": "dcaabde6e5125cabecd82f7f0044062dfc0439493c2945bd14c9368e5a3982f2" 62 145 }, 146 + "@rodney/parsedown@1.4.3": { 147 + "integrity": "fd5cbee4554286fc835a0157f7cb28d2c4de6ac82ed62b6b2f91291eaa9fbb2f" 148 + }, 63 149 "@std/assert@1.0.16": { 64 150 "integrity": "6a7272ed1eaa77defe76e5ff63ca705d9c495077e2d5fd0126d2b53fc5bd6532", 65 151 "dependencies": [ ··· 72 158 "@std/bytes@1.0.6": { 73 159 "integrity": "f6ac6adbd8ccd99314045f5703e23af0a68d7f7e58364b47d2c7f408aeb5820a" 74 160 }, 161 + "@std/cli@1.0.28": { 162 + "integrity": "74ef9b976db59ca6b23a5283469c9072be6276853807a83ec6c7ce412135c70a" 163 + }, 75 164 "@std/collections@1.1.3": { 76 165 "integrity": "bf8b0818886df6a32b64c7d3b037a425111f28278d69fd0995aeb62777c986b0" 77 166 }, ··· 84 173 "@std/dotenv@0.225.5": { 85 174 "integrity": "9ce6f9d0ec3311f74a32535aa1b8c62ed88b1ab91b7f0815797d77a6f60c922f" 86 175 }, 176 + "@std/encoding@1.0.10": { 177 + "integrity": "8783c6384a2d13abd5e9e87a7ae0520a30e9f56aeeaa3bdf910a3eaaf5c811a1" 178 + }, 179 + "@std/fmt@1.0.9": { 180 + "integrity": "2487343e8899fb2be5d0e3d35013e54477ada198854e52dd05ed0422eddcabe0" 181 + }, 182 + "@std/front-matter@1.0.9": { 183 + "integrity": "ee6201d06674cbef137dda2252f62477450b48249e7d8d9ab57a30f85ff6f051", 184 + "dependencies": [ 185 + "jsr:@std/toml", 186 + "jsr:@std/yaml" 187 + ] 188 + }, 87 189 "@std/fs@1.0.21": { 88 190 "integrity": "d720fe1056d78d43065a4d6e0eeb2b19f34adb8a0bc7caf3a4dbf1d4178252cd", 89 191 "dependencies": [ ··· 91 193 "jsr:@std/path@^1.1.4" 92 194 ] 93 195 }, 196 + "@std/fs@1.0.23": { 197 + "integrity": "3ecbae4ce4fee03b180fa710caff36bb5adb66631c46a6460aaad49515565a37", 198 + "dependencies": [ 199 + "jsr:@std/internal", 200 + "jsr:@std/path@^1.1.4" 201 + ] 202 + }, 203 + "@std/html@1.0.5": { 204 + "integrity": "4e2d693f474cae8c16a920fa5e15a3b72267b94b84667f11a50c6dd1cb18d35e" 205 + }, 206 + "@std/http@1.0.25": { 207 + "integrity": "577b4252290af1097132812b339fffdd55fb0f4aeb98ff11bdbf67998aa17193", 208 + "dependencies": [ 209 + "jsr:@std/cli", 210 + "jsr:@std/encoding@^1.0.10", 211 + "jsr:@std/fmt", 212 + "jsr:@std/fs@^1.0.23", 213 + "jsr:@std/html", 214 + "jsr:@std/media-types", 215 + "jsr:@std/net", 216 + "jsr:@std/path@^1.1.4", 217 + "jsr:@std/streams@^1.0.17" 218 + ] 219 + }, 94 220 "@std/internal@1.0.12": { 95 221 "integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027" 96 222 }, ··· 100 226 "jsr:@std/bytes@^1.0.5" 101 227 ] 102 228 }, 229 + "@std/media-types@1.1.0": { 230 + "integrity": "c9d093f0c05c3512932b330e3cc1fe1d627b301db33a4c2c2185c02471d6eaa4" 231 + }, 232 + "@std/net@1.0.6": { 233 + "integrity": "110735f93e95bb9feb95790a8b1d1bf69ec0dc74f3f97a00a76ea5efea25500c" 234 + }, 103 235 "@std/path@1.1.4": { 104 236 "integrity": "1d2d43f39efb1b42f0b1882a25486647cb851481862dc7313390b2bb044314b5", 105 237 "dependencies": [ ··· 114 246 "dependencies": [ 115 247 "jsr:@std/bytes@^1.0.6" 116 248 ] 249 + }, 250 + "@std/streams@1.0.17": { 251 + "integrity": "7859f3d9deed83cf4b41f19223d4a67661b3d3819e9fc117698f493bf5992140" 252 + }, 253 + "@std/text@1.0.17": { 254 + "integrity": "4b2c4ef67ae5b6c1dfd447c81c83a43718f52e3c7e748d8b33f694aba9895f95" 255 + }, 256 + "@std/toml@1.0.11": { 257 + "integrity": "e084988b872ca4bad6aedfb7350f6eeed0e8ba88e9ee5e1590621c5b5bb8f715", 258 + "dependencies": [ 259 + "jsr:@std/collections@^1.1.3" 260 + ] 261 + }, 262 + "@std/yaml@1.0.12": { 263 + "integrity": "7deabca4545bcedd07c5f69ea53acea71b8b4c67562f224e17b90d75944cb20c" 117 264 } 118 265 }, 119 266 "npm": { ··· 131 278 ], 132 279 "scripts": true 133 280 }, 281 + "@esbuild/aix-ppc64@0.27.3": { 282 + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", 283 + "os": ["aix"], 284 + "cpu": ["ppc64"] 285 + }, 286 + "@esbuild/android-arm64@0.27.3": { 287 + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", 288 + "os": ["android"], 289 + "cpu": ["arm64"] 290 + }, 291 + "@esbuild/android-arm@0.27.3": { 292 + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", 293 + "os": ["android"], 294 + "cpu": ["arm"] 295 + }, 296 + "@esbuild/android-x64@0.27.3": { 297 + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", 298 + "os": ["android"], 299 + "cpu": ["x64"] 300 + }, 301 + "@esbuild/darwin-arm64@0.27.3": { 302 + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", 303 + "os": ["darwin"], 304 + "cpu": ["arm64"] 305 + }, 306 + "@esbuild/darwin-x64@0.27.3": { 307 + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", 308 + "os": ["darwin"], 309 + "cpu": ["x64"] 310 + }, 311 + "@esbuild/freebsd-arm64@0.27.3": { 312 + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", 313 + "os": ["freebsd"], 314 + "cpu": ["arm64"] 315 + }, 316 + "@esbuild/freebsd-x64@0.27.3": { 317 + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", 318 + "os": ["freebsd"], 319 + "cpu": ["x64"] 320 + }, 321 + "@esbuild/linux-arm64@0.27.3": { 322 + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", 323 + "os": ["linux"], 324 + "cpu": ["arm64"] 325 + }, 326 + "@esbuild/linux-arm@0.27.3": { 327 + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", 328 + "os": ["linux"], 329 + "cpu": ["arm"] 330 + }, 331 + "@esbuild/linux-ia32@0.27.3": { 332 + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", 333 + "os": ["linux"], 334 + "cpu": ["ia32"] 335 + }, 336 + "@esbuild/linux-loong64@0.27.3": { 337 + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", 338 + "os": ["linux"], 339 + "cpu": ["loong64"] 340 + }, 341 + "@esbuild/linux-mips64el@0.27.3": { 342 + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", 343 + "os": ["linux"], 344 + "cpu": ["mips64el"] 345 + }, 346 + "@esbuild/linux-ppc64@0.27.3": { 347 + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", 348 + "os": ["linux"], 349 + "cpu": ["ppc64"] 350 + }, 351 + "@esbuild/linux-riscv64@0.27.3": { 352 + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", 353 + "os": ["linux"], 354 + "cpu": ["riscv64"] 355 + }, 356 + "@esbuild/linux-s390x@0.27.3": { 357 + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", 358 + "os": ["linux"], 359 + "cpu": ["s390x"] 360 + }, 361 + "@esbuild/linux-x64@0.27.3": { 362 + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", 363 + "os": ["linux"], 364 + "cpu": ["x64"] 365 + }, 366 + "@esbuild/netbsd-arm64@0.27.3": { 367 + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", 368 + "os": ["netbsd"], 369 + "cpu": ["arm64"] 370 + }, 371 + "@esbuild/netbsd-x64@0.27.3": { 372 + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", 373 + "os": ["netbsd"], 374 + "cpu": ["x64"] 375 + }, 376 + "@esbuild/openbsd-arm64@0.27.3": { 377 + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", 378 + "os": ["openbsd"], 379 + "cpu": ["arm64"] 380 + }, 381 + "@esbuild/openbsd-x64@0.27.3": { 382 + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", 383 + "os": ["openbsd"], 384 + "cpu": ["x64"] 385 + }, 386 + "@esbuild/openharmony-arm64@0.27.3": { 387 + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", 388 + "os": ["openharmony"], 389 + "cpu": ["arm64"] 390 + }, 391 + "@esbuild/sunos-x64@0.27.3": { 392 + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", 393 + "os": ["sunos"], 394 + "cpu": ["x64"] 395 + }, 396 + "@esbuild/win32-arm64@0.27.3": { 397 + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", 398 + "os": ["win32"], 399 + "cpu": ["arm64"] 400 + }, 401 + "@esbuild/win32-ia32@0.27.3": { 402 + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", 403 + "os": ["win32"], 404 + "cpu": ["ia32"] 405 + }, 406 + "@esbuild/win32-x64@0.27.3": { 407 + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", 408 + "os": ["win32"], 409 + "cpu": ["x64"] 410 + }, 134 411 "@hono/zod-openapi@1.1.4_hono@4.10.4_zod@4.1.12": { 135 412 "integrity": "sha512-4BbOtd6oKg20yo6HLluVbEycBLLIfdKX5o/gUSoKZ2uBmeP4Og/VDfIX3k9pbNEX5W3fRkuPeVjGA+zaQDVY1A==", 136 413 "dependencies": [ ··· 151 428 "@leeoniya/ufuzzy@1.0.19": { 152 429 "integrity": "sha512-0pikDeYt0IHEUPza5RTCDXc/17S1pTrYnReEMp8Aa6k1ovzw5QdZLwicW8TjljwEZRb6oYag0xmALohrcq/yOQ==" 153 430 }, 431 + "@lit-labs/ssr-dom-shim@1.5.1": { 432 + "integrity": "sha512-Aou5UdlSpr5whQe8AA/bZG0jMj96CoJIWbGfZ91qieWu5AWUMKw8VR/pAkQkJYvBNhmCcWnZlyyk5oze8JIqYA==" 433 + }, 434 + "@lit/reactive-element@2.1.2": { 435 + "integrity": "sha512-pbCDiVMnne1lYUIaYNN5wrwQXDtHaYtg7YEFPeW+hws6U47WeFvISGUWekPGKWOP1ygrs0ef0o1VJMk1exos5A==", 436 + "dependencies": [ 437 + "@lit-labs/ssr-dom-shim" 438 + ] 439 + }, 154 440 "@tauri-apps/api@2.9.0": { 155 441 "integrity": "sha512-qD5tMjh7utwBk9/5PrTA/aGr3i5QaJ/Mlt7p8NilQ45WgbifUNPyKWsA63iQ8YfQq6R8ajMapU+/Q8nMcPRLNw==" 156 442 }, ··· 166 452 "undici-types" 167 453 ] 168 454 }, 455 + "@types/trusted-types@2.0.7": { 456 + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" 457 + }, 169 458 "adm-zip@0.5.16": { 170 459 "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==" 460 + }, 461 + "boolbase@1.0.0": { 462 + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" 171 463 }, 172 464 "cc-cedict@1.0.3": { 173 465 "integrity": "sha512-e2uXs21mhNtRvRuXcfBq+NmavlVO6nxzLJLKfwH2igGnaRQCwbpBA+jtKX669NbGmAfCKGVI3hrUv5cORh2pyQ==", ··· 176 468 ], 177 469 "scripts": true 178 470 }, 471 + "cheerio-select@2.1.0": { 472 + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", 473 + "dependencies": [ 474 + "boolbase", 475 + "css-select", 476 + "css-what", 477 + "domelementtype", 478 + "domhandler", 479 + "domutils" 480 + ] 481 + }, 482 + "cheerio@1.2.0": { 483 + "integrity": "sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==", 484 + "dependencies": [ 485 + "cheerio-select", 486 + "dom-serializer", 487 + "domhandler", 488 + "domutils", 489 + "encoding-sniffer", 490 + "htmlparser2", 491 + "parse5", 492 + "parse5-htmlparser2-tree-adapter", 493 + "parse5-parser-stream", 494 + "undici", 495 + "whatwg-mimetype" 496 + ] 497 + }, 179 498 "chinese-to-pinyin@1.3.1": { 180 499 "integrity": "sha512-QGB9HmbMLh726Aj3QKB5NcjKDgKn5NCLMz8rmPfKuU5FgwmF4NT2ULh5/2G6Z0pWBcagtKBS08ymaJcYSvbbQg==" 181 500 }, 501 + "css-select@5.2.2": { 502 + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", 503 + "dependencies": [ 504 + "boolbase", 505 + "css-what", 506 + "domhandler", 507 + "domutils", 508 + "nth-check" 509 + ] 510 + }, 511 + "css-what@6.2.2": { 512 + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==" 513 + }, 514 + "dom-serializer@2.0.0": { 515 + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", 516 + "dependencies": [ 517 + "domelementtype", 518 + "domhandler", 519 + "entities@4.5.0" 520 + ] 521 + }, 522 + "domelementtype@2.3.0": { 523 + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==" 524 + }, 525 + "domhandler@5.0.3": { 526 + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", 527 + "dependencies": [ 528 + "domelementtype" 529 + ] 530 + }, 531 + "domutils@3.2.2": { 532 + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", 533 + "dependencies": [ 534 + "dom-serializer", 535 + "domelementtype", 536 + "domhandler" 537 + ] 538 + }, 539 + "encoding-sniffer@0.2.1": { 540 + "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", 541 + "dependencies": [ 542 + "iconv-lite", 543 + "whatwg-encoding" 544 + ] 545 + }, 546 + "entities@4.5.0": { 547 + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" 548 + }, 549 + "entities@6.0.1": { 550 + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==" 551 + }, 552 + "entities@7.0.1": { 553 + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==" 554 + }, 555 + "esbuild@0.27.3": { 556 + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", 557 + "optionalDependencies": [ 558 + "@esbuild/aix-ppc64", 559 + "@esbuild/android-arm", 560 + "@esbuild/android-arm64", 561 + "@esbuild/android-x64", 562 + "@esbuild/darwin-arm64", 563 + "@esbuild/darwin-x64", 564 + "@esbuild/freebsd-arm64", 565 + "@esbuild/freebsd-x64", 566 + "@esbuild/linux-arm", 567 + "@esbuild/linux-arm64", 568 + "@esbuild/linux-ia32", 569 + "@esbuild/linux-loong64", 570 + "@esbuild/linux-mips64el", 571 + "@esbuild/linux-ppc64", 572 + "@esbuild/linux-riscv64", 573 + "@esbuild/linux-s390x", 574 + "@esbuild/linux-x64", 575 + "@esbuild/netbsd-arm64", 576 + "@esbuild/netbsd-x64", 577 + "@esbuild/openbsd-arm64", 578 + "@esbuild/openbsd-x64", 579 + "@esbuild/openharmony-arm64", 580 + "@esbuild/sunos-x64", 581 + "@esbuild/win32-arm64", 582 + "@esbuild/win32-ia32", 583 + "@esbuild/win32-x64" 584 + ], 585 + "scripts": true, 586 + "bin": true 587 + }, 182 588 "fetch-blob@3.2.0": { 183 589 "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", 184 590 "dependencies": [ ··· 192 598 "howler@2.2.4": { 193 599 "integrity": "sha512-iARIBPgcQrwtEr+tALF+rapJ8qSc+Set2GJQl7xT1MQzWaVkFebdJhR3alVlSiUf5U7nAANKuj3aWpwerocD5w==" 194 600 }, 601 + "htmlparser2@10.1.0": { 602 + "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==", 603 + "dependencies": [ 604 + "domelementtype", 605 + "domhandler", 606 + "domutils", 607 + "entities@7.0.1" 608 + ] 609 + }, 610 + "iconv-lite@0.6.3": { 611 + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 612 + "dependencies": [ 613 + "safer-buffer" 614 + ] 615 + }, 195 616 "idb-keyval@6.2.2": { 196 617 "integrity": "sha512-yjD9nARJ/jb1g+CvD0tlhUHOrJ9Sy0P8T9MF3YaLlHnSRpwPfpTX0XIvpmw3gAJUmEu3FiICLBDPXVwyEvrleg==" 197 618 }, 198 619 "json-stringify-pretty-compact@4.0.0": { 199 620 "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==" 200 621 }, 622 + "lit-element@4.2.2": { 623 + "integrity": "sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w==", 624 + "dependencies": [ 625 + "@lit-labs/ssr-dom-shim", 626 + "@lit/reactive-element", 627 + "lit-html" 628 + ] 629 + }, 630 + "lit-html@3.3.2": { 631 + "integrity": "sha512-Qy9hU88zcmaxBXcc10ZpdK7cOLXvXpRoBxERdtqV9QOrfpMZZ6pSYP91LhpPtap3sFMUiL7Tw2RImbe0Al2/kw==", 632 + "dependencies": [ 633 + "@types/trusted-types" 634 + ] 635 + }, 636 + "lit@3.3.2": { 637 + "integrity": "sha512-NF9zbsP79l4ao2SNrH3NkfmFgN/hBYSQo90saIVI1o5GpjAdCPVstVzO1MrLOakHoEhYkrtRjPK6Ob521aoYWQ==", 638 + "dependencies": [ 639 + "@lit/reactive-element", 640 + "lit-element", 641 + "lit-html" 642 + ] 643 + }, 201 644 "mithril@2.3.8": { 202 645 "integrity": "sha512-za/Yo7qXEckjm5syrSfaaI9Utf4tCUT3T1IOIYqH6Lrj7G0OZuYYLAY9SV4ygoaAf0+CNqU92MBt+7pmo53JVQ==" 203 646 }, ··· 211 654 "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", 212 655 "deprecated": true 213 656 }, 657 + "nth-check@2.1.1": { 658 + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", 659 + "dependencies": [ 660 + "boolbase" 661 + ] 662 + }, 214 663 "openapi3-ts@4.5.0": { 215 664 "integrity": "sha512-jaL+HgTq2Gj5jRcfdutgRGLosCy/hT8sQf6VOy+P+g36cZOjI1iukdPnijC+4CmeRzg/jEllJUboEic2FhxhtQ==", 216 665 "dependencies": [ ··· 220 669 "opencc-js@1.0.5": { 221 670 "integrity": "sha512-LD+1SoNnZdlRwtYTjnQdFrSVCAaYpuDqL5CkmOaHOkKoKh7mFxUicLTRVNLU5C+Jmi1vXQ3QL4jWdgSaa4sKjg==" 222 671 }, 672 + "parse5-htmlparser2-tree-adapter@7.1.0": { 673 + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", 674 + "dependencies": [ 675 + "domhandler", 676 + "parse5" 677 + ] 678 + }, 679 + "parse5-parser-stream@7.1.2": { 680 + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", 681 + "dependencies": [ 682 + "parse5" 683 + ] 684 + }, 685 + "parse5@7.3.0": { 686 + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", 687 + "dependencies": [ 688 + "entities@6.0.1" 689 + ] 690 + }, 223 691 "pinyin-to-zhuyin@1.0.1": { 224 692 "integrity": "sha512-OCqOre/zS5aksip/gpTOb2ccDnY2puSbYEkhNUL3ggdmdRvva9oyKypouAnM2h6LZJw2VxxywnLCfrZT5TkZrA==", 225 693 "bin": true ··· 228 696 "integrity": "sha512-k5vWo0ZAct45urDf4XBsZKYz8Dp1sfe4iNr3fOOivxqYHax5WSMK1yJI5OlqpHXLFq/a9QdsJmaSpvrOBOgRgA==", 229 697 "bin": true 230 698 }, 699 + "safer-buffer@2.1.2": { 700 + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 701 + }, 231 702 "ts-fsrs@5.2.3": { 232 703 "integrity": "sha512-R3IjceC9WfnvUin6Nx+DwqEzh3Qil6Gg2yEHqvocUcC7Nbi+xDrFg/1fKaYBT0tJedDnDAguXMSX0hijhi859w==" 233 704 }, 234 705 "undici-types@7.10.0": { 235 706 "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==" 707 + }, 708 + "undici@7.22.0": { 709 + "integrity": "sha512-RqslV2Us5BrllB+JeiZnK4peryVTndy9Dnqq62S3yYRRTj0tFQCwEniUy2167skdGOy3vqRzEvl1Dm4sV2ReDg==" 236 710 }, 237 711 "web-streams-polyfill@3.3.3": { 238 712 "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==" 239 713 }, 714 + "whatwg-encoding@3.1.1": { 715 + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", 716 + "dependencies": [ 717 + "iconv-lite" 718 + ], 719 + "deprecated": true 720 + }, 721 + "whatwg-mimetype@4.0.0": { 722 + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==" 723 + }, 240 724 "yaml@2.8.1": { 241 725 "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", 242 726 "bin": true ··· 247 731 }, 248 732 "workspace": { 249 733 "dependencies": [ 734 + "jsr:@bpev/civility@^0.0.8", 250 735 "jsr:@bpev/sync-link@0.0.17", 251 736 "jsr:@inro/simple-tools@0.5.2", 252 737 "jsr:@std/assert@^1.0.15",
+6 -2
www/components/stats.ts
··· 52 52 export const Stats = (): Component => { 53 53 let list = HSK 54 54 let currLevel = 0 55 - 56 55 return { 57 - oninit: () => currLevel = app.userLevel, 56 + oninit: () => { 57 + currLevel = app.userLevel 58 + setTimeout(() => { 59 + currLevel = app.userLevel 60 + }, 0) 61 + }, 58 62 onbeforeupdate: () => { 59 63 if (!currLevel) currLevel = app.userLevel 60 64 },
-1
www/components/text_reading.ts
··· 13 13 view: ({ attrs }: Vnode<Attrs>) => { 14 14 const { audios, readings } = attrs as Attrs 15 15 const audio = audios.find((audio) => audio.locale === app.locale) 16 - console.log(readings, app.transliteration) 17 16 return m( 18 17 `span.flex.items-center.justify-center`, 19 18 { class: `font-${app.transliteration}` },
+3
www/index.ts
··· 1 1 import './models/schema/idb_migration.js' 2 + import '@bpev/civility' 2 3 3 4 import m from 'mithril' 5 + import { client } from '@bpev/civility/workers' 4 6 import Main from './routes/main.ts' 5 7 import ReferenceSubject from './routes/reference/subject.ts' 6 8 import Search from './routes/search.ts' ··· 25 27 26 28 console.debug('VERSION ', globalThis.__APP_VERSION__) 27 29 init() 30 + client.init() 28 31 29 32 globalThis.addEventListener('pageshow', (event) => { 30 33 // Page was loaded from cache
+4
www/routes/settings.ts
··· 240 240 str('button.f4.h3.mt2.w-100', 'about'), 241 241 ), 242 242 ), 243 + 244 + m('hr'), 245 + str('h2', 'Version'), 246 + m('ui-version'), 243 247 ]), 244 248 ], 245 249 }
+2
www/static/strings/en.json
··· 53 53 "study": "Study", 54 54 "study_group_size": "Study Group Size", 55 55 "study_group_size_hint": "The maximum number of items to study at a time.", 56 + "sync": "Sync", 57 + "sync_url": "Synclink Url", 56 58 "synonyms": "Synonyms", 57 59 "card_order": "Card Order", 58 60 "card_sort_method": "Sort Method",
+1
www/static/styles/civility.css
··· 1219 1219 1220 1220 .mh-auto { 1221 1221 margin-left: auto; 1222 + margin-right: auto; 1222 1223 }
-1
www/static/styles/theme.css
··· 734 734 735 735 main.study .done button { 736 736 font-size: var(--f4); 737 - margin: auto var(--s3); 738 737 width: 100%; 739 738 } 740 739
+11 -6
www/utils/check_answer.ts
··· 41 41 } 42 42 43 43 function checkReading(answer: string, subject: Subject): boolean { 44 - const whitelist: string[] = (subject.data.readings || []) 45 - .map(({ value }) => value) 46 - if (whitelist.includes(answer)) return true 44 + const isWhitelisted: boolean = (subject.data.readings || []) 45 + .map(({ value }) => normalize(value)) 46 + .includes(normalize(answer)) 47 + 48 + if (isWhitelisted) return true 47 49 48 50 const chars = (getCharsByLocale(app.locale, subject) || '').toLowerCase() 49 51 if (answer === chars) return true // Accept direct strings ··· 52 54 if (subject.data.type === SubjectType.Character) { 53 55 return answer === pinyin(chars, withTonesPinyinOptions) 54 56 } else if (subject.data.type === SubjectType.Vocabulary) { 55 - const answerNoSpaces = answer.replace(/\s/g, '').toLowerCase() 56 57 // If given tones, then be strict, and check the tones. 57 58 // If being lazy and no tones, then don't check. 58 59 return /\d/.test(answer) 59 - ? (answerNoSpaces === pinyin(chars, withTonesPinyinOptions)) 60 - : (answerNoSpaces === pinyin(chars, noTonesPinyinOptions)) 60 + ? (normalize(answer) === pinyin(chars, withTonesPinyinOptions)) 61 + : (normalize(answer) === pinyin(chars, noTonesPinyinOptions)) 61 62 } 62 63 } 63 64 64 65 return false 65 66 } 67 + 68 + function normalize(str: string) { 69 + return str.replace(/\s+/g, '').toLowerCase() 70 + }
+1
www/worker.js
··· 1 + import './dist/worker.js'
+35 -72
www/worker.ts
··· 1 - const CACHE_NAME = 'hanzi-v1' 2 - const urlsToCache = [ 3 - '/', 4 - '/static/civility.css', 5 - '/static/theme.css', 6 - '/dist/index.js', 7 - '/dist/icons/128x128.png', 8 - '/dist/icons/192x192.png', 9 - '/dist/icons/256x256.png', 10 - '/dist/icons/512x512.png', 11 - '/dist/icons/icon.png', 12 - '/dist/icons/icon.ico', 13 - '/manifest.json', 14 - ] 1 + import { 2 + init, 3 + withCleanup, 4 + withFetchStrategy, 5 + withPrecache, 6 + withUpdatePolling, 7 + } from '@bpev/civility/workers' 15 8 16 - self.addEventListener('install', (event) => { 17 - event.waitUntil( 18 - caches.open(CACHE_NAME) 19 - .then((cache) => { 20 - return cache.addAll(urlsToCache) 21 - }), 22 - ) 23 - }) 24 - 25 - self.addEventListener('fetch', (event) => { 26 - const url = new URL(event.request.url) 27 - 28 - // For critical JS files, use stale-while-revalidate 29 - if (url.pathname === '/dist/index.js') { 30 - event.respondWith( 31 - caches.match(event.request) 32 - .then((cachedResponse) => { 33 - const fetchPromise = fetch(event.request) 34 - .then((networkResponse) => { 35 - // Update cache in background 36 - if (networkResponse.ok) { 37 - const responseClone = networkResponse.clone() 38 - caches.open(CACHE_NAME).then((cache) => { 39 - cache.put(event.request, responseClone) 40 - }) 41 - } 42 - return networkResponse 43 - }) 44 - .catch(() => null) // Ignore network errors 45 - 46 - // Return cached version immediately, or network if no cache 47 - return cachedResponse || fetchPromise 48 - }), 49 - ) 50 - } else { 51 - // Cache-first for other resources 52 - event.respondWith( 53 - caches.match(event.request) 54 - .then((response) => { 55 - return response || fetch(event.request) 56 - }), 57 - ) 58 - } 59 - }) 60 - 61 - self.addEventListener('activate', (event) => { 62 - event.waitUntil( 63 - caches.keys().then((cacheNames) => { 64 - return Promise.all( 65 - cacheNames.map((cacheName) => { 66 - if (cacheName !== CACHE_NAME) { 67 - return caches.delete(cacheName) 68 - } 69 - }), 70 - ) 71 - }), 72 - ) 73 - }) 9 + init([ 10 + withPrecache([ 11 + '/', 12 + '/dist/index.js', 13 + '/dist/icons/128x128.png', 14 + '/dist/icons/192x192.png', 15 + '/dist/icons/256x256.png', 16 + '/dist/icons/512x512.png', 17 + '/dist/icons/icon.png', 18 + '/dist/icons/icon.ico', 19 + '/static/fonts/VF-Canto-OnlyJyutping.woff2', 20 + '/static/gen/characters.json', 21 + '/static/gen/hsk.json', 22 + '/static/gen/licenses.json', 23 + '/static/gen/tocfl.json', 24 + '/static/gen/vocabulary.json', 25 + '/static/strings/en.json', 26 + '/static/strings/zh_CN.json', 27 + '/static/strings/zh_HK.json', 28 + '/static/strings/zh_TW.json', 29 + '/static/styles/civility.css', 30 + '/static/styles/theme.css', 31 + '/manifest.json', 32 + ]), 33 + withCleanup(), 34 + withUpdatePolling(), 35 + withFetchStrategy(), 36 + ])