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