@basou/cli 0.74.1 → 0.75.0

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/dist/program.js CHANGED
@@ -14109,11 +14109,16 @@ var BOARD_HTML = `<!doctype html>
14109
14109
  ol.turns li { margin-bottom: 8px; }
14110
14110
  .foot { font-size: 13px; }
14111
14111
  #status.err { color: var(--err); }
14112
+ /* The request to copy breaks anywhere, so that a narrow screen keeps all of it in view. */
14113
+ .ask { font-size: 13px; color: var(--fg-2); margin-bottom: 8px; }
14114
+ .ask code { color: var(--fg); overflow-wrap: anywhere; padding: 0 3px; border-radius: 4px; background: var(--fill); }
14115
+ .ask button { font: inherit; margin: 0 6px; }
14112
14116
  </style>
14113
14117
  </head>
14114
14118
  <body>
14115
14119
  <div class="wrap">
14116
14120
  <nav class="records" id="records"></nav>
14121
+ <div class="ask" id="ask"></div>
14117
14122
  <div id="status"></div>
14118
14123
  <div id="board"></div>
14119
14124
  </div>
@@ -14331,6 +14336,59 @@ var BOARD_HTML = `<!doctype html>
14331
14336
  var list = page.records || [];
14332
14337
  if (list.length > 0) recordLinks(nav, page, list);
14333
14338
  nav.appendChild(el('a', { href: boardHref('live=1'), text: S.live.measureNow }));
14339
+ askToRecord(list.length > 0);
14340
+ }
14341
+
14342
+ // The page records nothing, measuring now included: an agent judges the
14343
+ // board and records it. show: whether the workspace has records, where the
14344
+ // page says so with the request to copy into a session of the workspace.
14345
+ function askToRecord(show) {
14346
+ var box = $('ask');
14347
+ clear(box);
14348
+ if (!show) return;
14349
+ var result = el('span', { role: 'status' });
14350
+ var copy = el('button', { type: 'button', text: S.ask.copy, onclick: function () { copyRequest(result); } });
14351
+ var lead = fill(S.ask.lead, { measureNow: S.live.measureNow }) + ' ';
14352
+ [document.createTextNode(lead), el('code', { text: S.ask.request }), copy, result]
14353
+ .forEach(function (node) { box.appendChild(node); });
14354
+ }
14355
+ // A browser gives the clipboard to a page of 127.0.0.1, which it counts as
14356
+ // secure, but it can refuse the permission to write to it, as a browser
14357
+ // built into an app does. Then the request is copied as a selection is,
14358
+ // which the click still allows. Where neither copies, say so: the request
14359
+ // stays on the page to select.
14360
+ function copyRequest(result) {
14361
+ var say = function (text) { result.textContent = text; };
14362
+ var bySelection = function () { say(copySelected(S.ask.request) ? S.ask.copied : S.ask.copyFailed); };
14363
+ var clip = typeof navigator !== 'undefined' && navigator.clipboard ? navigator.clipboard : null;
14364
+ if (clip === null) {
14365
+ bySelection();
14366
+ return;
14367
+ }
14368
+ try {
14369
+ clip.writeText(S.ask.request).then(function () { say(S.ask.copied); }, bySelection);
14370
+ } catch (err) {
14371
+ bySelection();
14372
+ }
14373
+ }
14374
+ // Copy text as a selection is copied, from a field put in for it and taken
14375
+ // out again. False where the browser does not say it copied.
14376
+ function copySelected(text) {
14377
+ if (typeof document.execCommand !== 'function' || !document.body) return false;
14378
+ var field = el('textarea', { readonly: '', 'aria-hidden': 'true' });
14379
+ field.value = text;
14380
+ field.style.position = 'fixed';
14381
+ field.style.opacity = '0';
14382
+ document.body.appendChild(field);
14383
+ var copied = false;
14384
+ try {
14385
+ field.select();
14386
+ copied = document.execCommand('copy') === true;
14387
+ } catch (err) {
14388
+ copied = false;
14389
+ }
14390
+ document.body.removeChild(field);
14391
+ return copied;
14334
14392
  }
14335
14393
 
14336
14394
  function recordLinks(nav, page, list) {
@@ -15130,6 +15188,7 @@ var BOARD_HTML = `<!doctype html>
15130
15188
  var drawn = ++liveDrawn;
15131
15189
  var nav = $('records');
15132
15190
  clear(nav);
15191
+ askToRecord(false);
15133
15192
  var root = $('board');
15134
15193
  clear(root);
15135
15194
  setStatus('', false);
@@ -15138,13 +15197,15 @@ var BOARD_HTML = `<!doctype html>
15138
15197
  [liveHeading(l, why), effort(l, true), liveRepos(l), liveTrail(l), liveComponents(l), foot]
15139
15198
  .forEach(function (node) { root.appendChild(node); });
15140
15199
  // Asked for with ?live=1: lead back to the records when there are any,
15141
- // and say how one comes to be drawn when there are none.
15200
+ // saying how to record the board again, and say how one comes to be
15201
+ // drawn when there are none.
15142
15202
  if (why === null) {
15143
15203
  getJson(apiPath('board')).then(function (b) {
15144
15204
  var list = b && b.page && b.page.records ? b.page.records : [];
15145
15205
  if (drawn !== liveDrawn) return;
15146
15206
  if (list.length > 0) {
15147
15207
  nav.appendChild(el('a', { href: boardHref(''), text: S.live.toRecords }));
15208
+ askToRecord(true);
15148
15209
  } else {
15149
15210
  root.removeChild(foot);
15150
15211
  root.appendChild(liveFootnotes(l, why, true));
@@ -16740,7 +16801,7 @@ function installExperimentalNotice(program, names = EXPERIMENTAL_COMMANDS, write
16740
16801
  function readBuildStamp() {
16741
16802
  if (false) return void 0;
16742
16803
  try {
16743
- return JSON.parse('{"version":"0.74.1","commit":"f08e08f","committedAt":"2026-10-23T19:05:22+09:00"}');
16804
+ return JSON.parse('{"version":"0.75.0","commit":"6de9730","committedAt":"2026-11-02T12:08:26+09:00"}');
16744
16805
  } catch {
16745
16806
  return void 0;
16746
16807
  }