@treasure-ai/treasure-deck 2026.12.0 → 2026.12.1

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/docs/commands.md CHANGED
@@ -175,7 +175,7 @@ The built page, `deck dev`, and the editor's `/present` all present the same way
175
175
  | `i` | About this deck: title, author, date, and description |
176
176
  | `?` | Shortcut help |
177
177
 
178
- Moving the mouse shows a control bar at the bottom (‹ ›, the slide number, full screen, and a light/dark switch); it fades, with the cursor, once the mouse rests. Touch: swipe sideways to navigate, or tap to show the control bar. On portrait phones the deck becomes a vertical scroll of slides. `#/12` links to slide 12; under Apps Script this goes through `google.script.history`.
178
+ Moving the mouse shows a control bar at the bottom (‹ ›, the slide number, full screen, and a light/dark switch); it fades, with the cursor, once the mouse rests. Touch: tap the left third of the screen for the previous slide, the right third for the next, or the middle to show or hide the control bar; a sideways swipe works too (on iPhone and iPad, a swipe from the screen's edge is Safari's back and forward). On portrait phones the deck becomes a vertical scroll of slides. `#/12` links to slide 12; under Apps Script this goes through `google.script.history`.
179
179
 
180
180
  **Presenter window:** `P` (or the share panel) opens the deck in a second window for your screen: the current slide, the next one, the speaker notes, the elapsed time (`k` or Pause stops it and Resume goes on; `r` or Reset restarts it), and the clock. Put the first window on the projector. The windows follow each other: navigating, `b` (black screen), `d` (light/dark), and `t` in either one updates both.
181
181
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasure-ai/treasure-deck",
3
- "version": "2026.12.0",
3
+ "version": "2026.12.1",
4
4
  "description": "Markdown presentations without <div> markup: four layouts, themes, and a single-file HTML output that publishes to Apps Script",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://www.npmjs.com/package/@treasure-ai/treasure-deck",
package/runtime/base.css CHANGED
@@ -429,6 +429,8 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
429
429
  .deck.has-controls:not(.is-awake) .deck-embed-bar:not(:focus-within) { pointer-events: none; }
430
430
  .deck.has-controls:not(.is-awake):not(.is-overview):not(.is-scroll) { cursor: none; }
431
431
  .deck.has-controls .deck-panel { cursor: auto; }
432
+ /* (Quick taps to change slides aren't taken for a double-tap zoom; a pinch still zooms.) */
433
+ .deck { touch-action: manipulation; }
432
434
  .deck.has-controls.is-scroll .deck-embed-bar { display: none; }
433
435
  .deck-embed-bar button, .deck-embed-bar a { font: inherit; color: inherit; background: none; border: 0; border-radius: 999px; padding: 6px 10px; cursor: pointer; text-decoration: none; }
434
436
  .deck-embed-bar button:hover, .deck-embed-bar a:hover { background: rgba(255, 255, 255, .16); }
@@ -238,8 +238,8 @@
238
238
  deck.classList.add('is-embedded');
239
239
  embedBar.hidden = false;
240
240
  }
241
- // The full view shows the same bar (without Open ↗) while the mouse moves or after a tap, and hides it, with the
242
- // cursor, once the pointer rests. Not in the deck editor's preview (__DECK_EMBED__), which has its own controls.
241
+ // The full view shows the same bar (without Open ↗) while the mouse moves or after a tap in the middle of the page,
242
+ // and hides it, with the cursor, once the pointer rests. Not in the deck editor's preview (__DECK_EMBED__), which has its own controls.
243
243
  var awakeTimer = null, mouse = false, tappedAsleep = false;
244
244
  function startControls() {
245
245
  if (window.__DECK_EMBED__) return;
@@ -247,14 +247,12 @@
247
247
  embedBar.hidden = false;
248
248
  embedBar.querySelector('[data-act="open"]').remove();
249
249
  renderEmbedBar();
250
- // A mouse wakes it by moving (not while it aims the laser), a finger or pen by a tap: that's how a phone or tablet
251
- // reader finds it. The tap that wakes it doesn't also press the button under it (see the bar's click handler).
250
+ // A mouse wakes it by moving (not while it aims the laser), a finger or pen by a tap (see the tap zones below).
252
251
  document.addEventListener('pointermove', function (e) { if (e.pointerType === 'mouse') wake(true); });
253
- document.addEventListener('pointerdown', function (e) {
254
- if (e.pointerType === 'mouse') return;
255
- tappedAsleep = !deck.classList.contains('is-awake');
256
- wake(false);
257
- }, true);
252
+ }
253
+ function sleep() {
254
+ clearTimeout(awakeTimer);
255
+ deck.classList.remove('is-awake');
258
256
  }
259
257
  function wake(byMouse) {
260
258
  if (byMouse && deck.classList.contains('is-laser')) return;
@@ -266,7 +264,7 @@
266
264
  // (Not while the mouse is on the bar or a key has focused one of its buttons. A touch screen's :hover sticks after
267
265
  // a tap, so it doesn't count there.)
268
266
  if ((mouse && embedBar.matches(':hover')) || embedBar.matches(':focus-within')) { awakeTimer = setTimeout(rest, 2500); return; }
269
- deck.classList.remove('is-awake');
267
+ sleep();
270
268
  }, 2500);
271
269
  }
272
270
  function renderEmbedBar() {
@@ -552,6 +550,35 @@
552
550
  show(slides.indexOf(s));
553
551
  });
554
552
 
553
+ // On a touch screen, a tap on the left third of the page goes back, on the right third forward, and in the middle
554
+ // shows or hides the control bar (full view). iOS keeps an edge swipe for the browser's back and forward, so a swipe
555
+ // alone isn't enough there. A tap on something that takes taps itself (a link, a video, a component, the bar, a
556
+ // panel) is left to it, and one while a panel is open only closes the panel. The tap that wakes the bar doesn't also
557
+ // press the button under it (tappedAsleep, in the bar's click handler).
558
+ var tap = null;
559
+ var TAPPABLE = 'a, button, input, select, textarea, label, summary, video, audio, iframe, [contenteditable], [tabindex], ' +
560
+ '.deck-component-root, .deck-embed-bar, .deck-panel';
561
+ document.addEventListener('pointerdown', function (e) {
562
+ if (e.pointerType === 'mouse') { tap = null; return; }
563
+ tappedAsleep = deck.classList.contains('has-controls') && !deck.classList.contains('is-awake');
564
+ // (A second finger, as in a pinch, makes it no tap.)
565
+ tap = e.isPrimary ? { x: e.clientX, y: e.clientY, at: Date.now(), target: e.target } : null;
566
+ }, true);
567
+ document.addEventListener('pointercancel', function () { tap = null; });
568
+ document.addEventListener('pointerup', function (e) {
569
+ var t = tap;
570
+ tap = null;
571
+ if (!t || e.pointerType === 'mouse' || Date.now() - t.at > 500 || Math.abs(e.clientX - t.x) > 10 || Math.abs(e.clientY - t.y) > 10) return;
572
+ if (window.__DECK_EMBED__ || presenter || deck.classList.contains('is-overview') || deck.classList.contains('is-scroll')) return;
573
+ if ((t.target.closest && t.target.closest(TAPPABLE)) || !help.hidden || !about.hidden || !share.hidden) return;
574
+ var third = window.innerWidth / 3;
575
+ if (e.clientX < third) show(current - 1);
576
+ else if (e.clientX > 2 * third) show(current + 1);
577
+ else if (!deck.classList.contains('has-controls')) return;
578
+ else if (deck.classList.contains('is-awake')) sleep();
579
+ else wake(false);
580
+ });
581
+
555
582
  // A sideways swipe changes slides: one finger, mostly horizontal, and not one that starts on the controls or a panel
556
583
  // (or a pinch to zoom, or a scroll up and down).
557
584
  var touchStart = null;