narrarium-astro-reader 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-dist/lib/content-crypto.d.ts.map +1 -1
- package/cli-dist/lib/content-crypto.js +1 -0
- package/cli-dist/lib/content-crypto.js.map +1 -1
- package/package.json +1 -1
- package/src/layouts/BaseLayout.astro +3 -0
- package/src/lib/content-crypto.ts +1 -0
- package/src/pages/chapters/[chapter].astro +18 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-crypto.d.ts","sourceRoot":"","sources":["../../src/lib/content-crypto.ts"],"names":[],"mappings":"AAcA,mFAAmF;AACnF,wBAAgB,YAAY,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"content-crypto.d.ts","sourceRoot":"","sources":["../../src/lib/content-crypto.ts"],"names":[],"mappings":"AAcA,mFAAmF;AACnF,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAMD,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAWjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-crypto.js","sourceRoot":"","sources":["../../src/lib/content-crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtE;;;;;;;;GAQG;AAEH,IAAI,UAAU,GAAkB,IAAI,CAAC;AAErC,mFAAmF;AACnF,MAAM,UAAU,YAAY;IAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,UAAU,GAAG,WAAW,CAAC,E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AAE,CAAC,CAAC,8BAA8B;IAC/D,OAAO;QACL,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -32,6 +32,9 @@ const readerChapters = await listChapters(getBookRoot()).catch(() => []);
|
|
|
32
32
|
const fullCanonMode = isFullCanonMode();
|
|
33
33
|
const passwordHash = getReaderPasswordHash();
|
|
34
34
|
const cryptoSalt = getReaderPassword() ? getBuildSaltBase64() : null;
|
|
35
|
+
if (!cryptoSalt) {
|
|
36
|
+
console.info("[narrarium-reader] NARRARIUM_READER_PASSWORD not set — building without encryption.");
|
|
37
|
+
}
|
|
35
38
|
const isChapterPage = Number.isFinite(currentChapterNumber);
|
|
36
39
|
---
|
|
37
40
|
|
|
@@ -253,11 +253,11 @@ const renderedParagraphs = await Promise.all(
|
|
|
253
253
|
|
|
254
254
|
window.addEventListener("scroll", scheduleSceneRefresh, { passive: true });
|
|
255
255
|
window.addEventListener("resize", scheduleSceneRefresh);
|
|
256
|
-
document.addEventListener("dblclick",
|
|
256
|
+
document.addEventListener("dblclick", handleFocusRailToggle);
|
|
257
257
|
document.addEventListener("touchend", (event) => {
|
|
258
258
|
const now = Date.now();
|
|
259
259
|
if (now - lastTapTime < doubleTapThresholdMs) {
|
|
260
|
-
|
|
260
|
+
handleFocusRailToggle();
|
|
261
261
|
lastTapTime = 0;
|
|
262
262
|
} else {
|
|
263
263
|
lastTapTime = now;
|
|
@@ -349,7 +349,8 @@ const renderedParagraphs = await Promise.all(
|
|
|
349
349
|
});
|
|
350
350
|
if (enabled) {
|
|
351
351
|
resetFocusHintSession();
|
|
352
|
-
|
|
352
|
+
focusRail?.classList.add("is-hidden");
|
|
353
|
+
showFocusHintOnce();
|
|
353
354
|
} else {
|
|
354
355
|
clearFocusRailHideTimer();
|
|
355
356
|
clearFocusHintHideTimer();
|
|
@@ -367,6 +368,20 @@ const renderedParagraphs = await Promise.all(
|
|
|
367
368
|
}
|
|
368
369
|
}
|
|
369
370
|
|
|
371
|
+
function handleFocusRailToggle() {
|
|
372
|
+
if (!root.classList.contains("is-focus-mode")) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
hideFocusHint();
|
|
377
|
+
if (focusRail?.classList.contains("is-hidden")) {
|
|
378
|
+
showFocusRailTemporarily();
|
|
379
|
+
} else {
|
|
380
|
+
clearFocusRailHideTimer();
|
|
381
|
+
focusRail?.classList.add("is-hidden");
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
370
385
|
function handleFocusRailWake() {
|
|
371
386
|
if (!root.classList.contains("is-focus-mode")) {
|
|
372
387
|
return;
|