@treasure-ai/treasure-deck 2026.12.0 → 2026.12.2
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 +1 -1
- package/package.json +1 -1
- package/runtime/base.css +8 -6
- package/runtime/runtime.js +37 -10
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:
|
|
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.
|
|
3
|
+
"version": "2026.12.2",
|
|
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
|
@@ -194,20 +194,20 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
|
|
|
194
194
|
.slide .center { text-align: center; }
|
|
195
195
|
.slide .right { text-align: right; }
|
|
196
196
|
/* The lead: a standfirst, the casual sentence that frames a slide. Larger than body but a step down in contrast and
|
|
197
|
-
regular weight,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
is
|
|
197
|
+
regular weight, so it reads as an intro paragraph rather than a second title; its **bold** words keep full
|
|
198
|
+
contrast. It spans the content width like body text: a narrower measure looks cramped between a full-width title
|
|
199
|
+
and body. Its color (--deck-lead-color) is an accent ink on light slides, and a soft grey on dark ones, where the
|
|
200
|
+
accent ink is too loud. A lead alone on a slide (a statement) keeps full contrast, with balanced lines. */
|
|
201
201
|
.slide { --deck-lead-color: color-mix(in oklab, var(--deck-accent) 60%, var(--deck-fg)); }
|
|
202
202
|
.deck[data-mode="dark"] .slide:not([data-mode="light"]), .deck .slide[data-mode="dark"] {
|
|
203
203
|
--deck-lead-color: color-mix(in oklab, var(--deck-fg) 72%, var(--deck-bg));
|
|
204
204
|
}
|
|
205
205
|
.slide .lead {
|
|
206
|
-
font-size: 1.2em; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-wrap:
|
|
206
|
+
font-size: 1.2em; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-wrap: pretty;
|
|
207
207
|
color: var(--deck-lead-color);
|
|
208
208
|
}
|
|
209
209
|
.deck .slide .slide-body .lead strong { color: var(--deck-fg); font-weight: 600; }
|
|
210
|
-
.slide .slide-content > .lead:only-child { font-size: 1.6em; line-height: 1.3;
|
|
210
|
+
.slide .slide-content > .lead:only-child { font-size: 1.6em; line-height: 1.3; text-wrap: balance; color: var(--deck-strong); }
|
|
211
211
|
.slide .lead.center { margin-inline: auto; }
|
|
212
212
|
/* The takeaway: the slide's "so what", in the flow (not pinned). An accent-outlined box with a stroked arrow, unlike a
|
|
213
213
|
callout's side rule or fill, and its **bold** words (the claim) in the accent. A lead stays plain: it is the casual
|
|
@@ -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); }
|
package/runtime/runtime.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
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;
|