@gbti/ryker 0.2.1 → 0.2.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/README.md CHANGED
@@ -78,7 +78,7 @@ it.
78
78
  Ryker requires Node.js 20 or newer for installation. The resulting HTML and
79
79
  classic browser script work offline and from `file://` without Node.js.
80
80
 
81
- This repository is at version `0.2.1`, and the npm `latest` tag serves it, so
81
+ This repository is at version `0.2.2`, and the npm `latest` tag serves it, so
82
82
  every `npx` command above installs this code.
83
83
 
84
84
  ## Privacy
package/bin/ryker.js CHANGED
@@ -4,7 +4,7 @@ import { copyFileSync, existsSync, mkdirSync, readFileSync, realpathSync, writeF
4
4
  import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
 
7
- const VERSION = '0.2.1';
7
+ const VERSION = '0.2.2';
8
8
  const BEGIN = '<!-- ryker:begin -->';
9
9
  const END = '<!-- ryker:end -->';
10
10
  const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Ryker 0.2.1
2
+ * Ryker 0.2.2
3
3
  * A drop-in editing layer for authored HTML reports.
4
4
  *
5
5
  * Generated bundle. Do not edit. Sources, in load order:
@@ -14,12 +14,13 @@
14
14
  * export/target.js (66 lines)
15
15
  * export/packager.js (277 lines)
16
16
  * ui/theme.js (61 lines)
17
- * ui/styles.js (405 lines)
17
+ * ui/styles.js (421 lines)
18
18
  * ui/shell.js (241 lines)
19
19
  * ui/icons.js (68 lines)
20
20
  * ui/tooltip.js (82 lines)
21
21
  * ui/dialog.js (138 lines)
22
22
  * ui/menu.js (104 lines)
23
+ * ui/about.js (77 lines)
23
24
  * export/dialog.js (213 lines)
24
25
  * editor/editable.js (596 lines)
25
26
  * editor/history.js (248 lines)
@@ -41,7 +42,7 @@
41
42
  * instructions/browser.js (296 lines)
42
43
  * ui/pane.js (292 lines)
43
44
  * storage/recover.js (335 lines)
44
- * bootstrap/boot.js (541 lines)
45
+ * bootstrap/boot.js (546 lines)
45
46
  *
46
47
  * Classic script by design: module scripts do not load from file:// URLs,
47
48
  * and a report handed over as a ZIP is opened from disk.
@@ -49,7 +50,7 @@
49
50
  (function () {
50
51
  'use strict';
51
52
  if (window.Ryker && window.Ryker.VERSION) return;
52
- var Ryker = { VERSION: "0.2.1", BUILD: "Ryker", SURFACE: "drop-in" };
53
+ var Ryker = { VERSION: "0.2.2", BUILD: "Ryker", SURFACE: "drop-in" };
53
54
  window.Ryker = Ryker;
54
55
 
55
56
  /* ---- utils/dom.js ---------------------------------------------- */
@@ -2659,6 +2660,22 @@
2659
2660
  '.filerow .sz{margin-left:auto;color:var(--rk-muted);font-size:11px;flex:none}',
2660
2661
  '.filerow .nm{overflow-wrap:anywhere}',
2661
2662
 
2663
+ // A label/value table, as a definition list rather than a <table>: these are
2664
+ // pairs and not a grid of data, and a dl says so to a screen reader. The
2665
+ // label column is sized to its longest label so every value starts on the
2666
+ // same edge, which is the whole point of reading it as a table.
2667
+ '.kv{display:grid;grid-template-columns:minmax(0,142px) minmax(0,1fr);',
2668
+ ' margin:0;border:1px solid var(--rk-line);border-radius:var(--rk-r-md);overflow:hidden}',
2669
+ '.kv dt{padding:8px 11px;font-size:10.5px;font-weight:600;color:var(--rk-muted);',
2670
+ ' text-transform:uppercase;letter-spacing:.06em;background:var(--rk-bg2);',
2671
+ ' border-bottom:1px solid var(--rk-line)}',
2672
+ '.kv dd{margin:0;padding:8px 11px;font-size:12px;line-height:1.5;color:var(--rk-fg2);',
2673
+ ' border-bottom:1px solid var(--rk-line);overflow-wrap:anywhere}',
2674
+ '.kv dt:last-of-type,.kv dd:last-of-type{border-bottom:none}',
2675
+ // The one row that asks for something rather than stating a fact.
2676
+ '.kv dt.cta,.kv dd.cta{background:var(--rk-accent-soft)}',
2677
+ '.kv dt.cta{color:var(--rk-accent)}',
2678
+
2662
2679
  '.muted{color:var(--rk-muted)}',
2663
2680
  '.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}',
2664
2681
 
@@ -3317,6 +3334,85 @@
3317
3334
  })();
3318
3335
 
3319
3336
 
3337
+ /* ---- ui/about.js ----------------------------------------------- */
3338
+ // About Ryker: what this build is, who maintains it, and the one thing we ask.
3339
+ //
3340
+ // LAST in the menu, after the divider that follows Clear document. An About
3341
+ // entry is conventionally last, and putting it below the one destructive action
3342
+ // means a mis-click at the very bottom of the menu opens a dialog rather than
3343
+ // emptying somebody's document.
3344
+ //
3345
+ // Its own module rather than another block in boot.js, which is at 540 of its
3346
+ // 600 line cap and is about starting Ryker rather than describing it. That cap
3347
+ // already forced the export dialog out once.
3348
+ Ryker.about = (function () {
3349
+ 'use strict';
3350
+
3351
+ // Named rather than inlined, so a link that moves is changed in one place.
3352
+ var LINKS = {
3353
+ home: 'https://gbti.network',
3354
+ membership: 'https://gbti.network/membership/',
3355
+ source: 'https://github.com/gbti-network/ryker',
3356
+ issues: 'https://github.com/gbti-network/ryker/issues',
3357
+ license: 'https://github.com/gbti-network/ryker/blob/main/LICENSE',
3358
+ privacy: 'https://github.com/gbti-network/ryker/blob/main/privacy.md'
3359
+ };
3360
+
3361
+ // rel is not decoration. target=_blank without noopener hands the opened page
3362
+ // a live window.opener back into the document being edited, and on the drop-in
3363
+ // surface that document is somebody's report on their own disk.
3364
+ function link(href, text) {
3365
+ return '<a href="' + href + '" target="_blank" rel="noopener noreferrer">' +
3366
+ text + '</a>';
3367
+ }
3368
+
3369
+ /** Which build this is, in the form a bug report needs. The surface matters
3370
+ * more than it looks: the same version behaves differently as an extension
3371
+ * and as a drop-in, and "Save Document is missing" is expected on one and a
3372
+ * defect on the other. */
3373
+ function build() {
3374
+ var version = String(Ryker.VERSION || 'unversioned');
3375
+ var surface = Ryker.SURFACE === 'extension' ? 'extension' : 'drop-in';
3376
+ return Ryker.dom.escapeHtml(version + ' (' + surface + ' build)');
3377
+ }
3378
+
3379
+ function row(label, value, cls) {
3380
+ var c = cls ? ' class="' + cls + '"' : '';
3381
+ return '<dt' + c + '>' + label + '</dt><dd' + c + '>' + value + '</dd>';
3382
+ }
3383
+
3384
+ function open() {
3385
+ Ryker.dialog.open({
3386
+ title: 'About Ryker',
3387
+ // A label/value table rather than prose. Somebody opens About to look one
3388
+ // fact up, usually the version, and a paragraph makes them read for it.
3389
+ body: '<dl class="kv">' +
3390
+ row('Version', build()) +
3391
+ row('Maintainer', link(LINKS.home, 'GBTI Network')) +
3392
+ // The link and nothing else. Summarising a licence in a table cell
3393
+ // invites somebody to rely on the summary, and the terms that actually
3394
+ // bind them are the ones in the file.
3395
+ row('License', link(LINKS.license, 'Source-available')) +
3396
+ row('Source', link(LINKS.source, 'github.com/gbti-network/ryker')) +
3397
+ row('Report a bug', link(LINKS.issues, 'Open an issue')) +
3398
+ row('Privacy', link(LINKS.privacy, 'Nothing is tracked')) +
3399
+ // The ask, and the only one. Last row on purpose: a tool that promises
3400
+ // no telemetry and then leads with a pitch has spent the promise.
3401
+ // The only break point is before the ampersand, so the label reads
3402
+ // "Contributions" then "& Gratuity" rather than stranding the & at the
3403
+ // end of the first line.
3404
+ row('Contributions &amp;\u00a0Gratuity',
3405
+ 'Join ' + link(LINKS.membership, 'our professional network') +
3406
+ ' to support Ryker and other projects developed and maintained by ' +
3407
+ 'GBTI Network.', 'cta') +
3408
+ '</dl>'
3409
+ });
3410
+ }
3411
+
3412
+ return { open: open, LINKS: LINKS, build: build };
3413
+ })();
3414
+
3415
+
3320
3416
  /* ---- export/dialog.js ------------------------------------------ */
3321
3417
  // The two ways a document leaves Ryker: over the top of itself, or beside it.
3322
3418
  //
@@ -10734,7 +10830,12 @@
10734
10830
  icon: 'note', run: function () { setSaveNotesEnabled(!saveNotesEnabled()); } },
10735
10831
  null,
10736
10832
  { label: 'Clear document', icon: 'trash', danger: true,
10737
- run: function () { Ryker.pane.confirmClear(); } }
10833
+ run: function () { Ryker.pane.confirmClear(); } },
10834
+ null,
10835
+ // Below the destructive entry on purpose. About is conventionally last,
10836
+ // and a mis-click at the very bottom of the menu should open a dialog
10837
+ // rather than empty the document.
10838
+ { label: 'About Ryker', icon: 'note', run: function () { Ryker.about.open(); } }
10738
10839
  ]);
10739
10840
  }
10740
10841
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gbti/ryker",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Add Ryker inline editing and prompt-ready change requests to authored HTML documents.",
5
5
  "type": "module",
6
6
  "bin": {