@treasure-ai/treasure-deck 2026.10.12 → 2026.10.13

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
@@ -62,7 +62,7 @@ A built deck reports anonymous access metrics to Treasure Data. It loads the TD
62
62
 
63
63
  - **`open`:** once per page load, with the page count.
64
64
  - **`slide`:** a slide viewed (`slide`, `slide_title`) and how long it was on screen (`dwell_ms`). It's sent when the viewer moves on or the page is hidden (another tab, closed, a phone locked). Slides passed in the overview don't count.
65
- - **`action`:** a feature used, and on which slide. The actions are `fullscreen`, `presenter`, `overview`, `notes`, `toc`, `share`, `copy_link`, `copy_slide`, `copy_embed`, `print`, `mode`, `laser`, and `help`.
65
+ - **`action`:** a feature used, and on which slide. The actions are `fullscreen`, `presenter`, `overview`, `notes`, `toc`, `share`, `copy_link`, `copy_slide`, `copy_embed`, `print`, `download`, `open_treasure_work`, `mode`, `laser`, and `help`.
66
66
 
67
67
  Every row also carries:
68
68
 
@@ -87,7 +87,7 @@ deck import https://script.google.com/a/macros/example.com/s/…/exec
87
87
 
88
88
  A deck published to Apps Script is read from `<url>?source=1`, which Treasure Work serves for decks it publishes. A deck shared within a domain, or only with you, needs a Google sign-in: `deck import` sends `DECK_GOOGLE_TOKEN`, or else the token `gcloud auth print-access-token` prints (sign in with `gcloud auth login --enable-gdrive-access`).
89
89
 
90
- Without the command line, the share panel's **Download source (.zip)** saves the same folder from the deck in the browser, ready for `deck editor`.
90
+ Without the command line, the share panel's **Download source (.zip)** saves the same folder from the deck in the browser, ready for `deck editor`. On a published deck, **Open in Treasure Work** hands its URL to Treasure Work (`treasure-work://deck/import?url=<page>`), which imports it there.
91
91
 
92
92
  `deck build --no-source` leaves the source out. Do that when the source shouldn't go with the page: it includes slides hidden with `{hide}`, which the page doesn't show, and the Markdown exactly as written. Speaker notes are in every page either way.
93
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasure-ai/treasure-deck",
3
- "version": "2026.10.12",
3
+ "version": "2026.10.13",
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",
@@ -67,9 +67,16 @@
67
67
  '<button data-act="embed">Copy embed snippet</button>' +
68
68
  '<button data-act="print">Print / save as PDF</button>' +
69
69
  '<button data-act="presenter">Open presenter window</button>' +
70
- (deckSource ? '<button data-act="download">Download source (.zip)</button>' : '') +
70
+ (deckSource ? '<button data-act="download">Download source (.zip)</button>' +
71
+ '<button data-act="open">Open in Treasure Work</button>' : '') +
71
72
  '<div class="deck-status"></div>');
72
73
  share.hidden = true;
74
+ // Treasure Work imports the deck from its published URL, so a page opened from a file can't offer it.
75
+ function offerOpen() {
76
+ var b = share.querySelector('[data-act="open"]');
77
+ if (b) b.hidden = !/^https?:/.test(host.baseUrl());
78
+ }
79
+ offerOpen();
73
80
  var notesPanel = el('div', 'deck-panel deck-notes-panel');
74
81
  notesPanel.hidden = true;
75
82
  [progress, black, laser, gotoBox, help, share, notesPanel].forEach(function (e) { deck.appendChild(e); });
@@ -178,6 +185,7 @@
178
185
  var open = panel.hidden;
179
186
  [help, share].forEach(function (p) { if (p !== panel) p.hidden = true; });
180
187
  panel.hidden = !open;
188
+ if (panel === share) offerOpen();
181
189
  if (open) used(panel === share ? 'share' : panel === help ? 'help' : 'notes');
182
190
  if (panel === notesPanel) renderNotes();
183
191
  }
@@ -332,6 +340,7 @@
332
340
  else if (act === 'print') { share.hidden = true; window.print(); }
333
341
  else if (act === 'presenter') { share.hidden = true; openPresenter(); }
334
342
  else if (act === 'download') { used('download'); downloadDeck(); }
343
+ else if (act === 'open') { used('open_treasure_work'); location.href = 'treasure-work://deck/import?url=' + encodeURIComponent(base); }
335
344
  });
336
345
 
337
346
  var typed = '';