narrarium-astro-reader 0.1.28 → 0.1.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrarium-astro-reader",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "type": "module",
5
5
  "description": "Astro reader and scaffolding CLI for Narrarium book repositories.",
6
6
  "license": "MIT",
@@ -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", handleFocusRailWake);
256
+ document.addEventListener("dblclick", handleFocusRailToggle);
257
257
  document.addEventListener("touchend", (event) => {
258
258
  const now = Date.now();
259
259
  if (now - lastTapTime < doubleTapThresholdMs) {
260
- handleFocusRailWake();
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
- showFocusRailTemporarily();
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;