@gemboss/ui 0.64.0 → 0.66.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +213 -1
  2. package/README.md +67 -5
  3. package/catalog/editor.html +21 -13
  4. package/catalog/index.html +4 -4
  5. package/gemboss-ui.css +3 -3
  6. package/package.json +8 -1
  7. package/parts/components.css +2 -2
  8. package/parts/core.css +1 -1
  9. package/parts/shell.css +1 -1
  10. package/src/auth.tsx +1 -15
  11. package/src/confirm-buttons.ts +35 -0
  12. package/src/confirm-dialog.css +1 -0
  13. package/src/confirm-dialog.tsx +124 -0
  14. package/src/create-shell.css +1 -1
  15. package/src/create-shell.tsx +7 -4
  16. package/src/dialog.css +1 -0
  17. package/src/dialog.tsx +46 -7
  18. package/src/editor/color-choices.ts +9 -0
  19. package/src/editor/controls.tsx +59 -19
  20. package/src/editor/field-control.tsx +456 -0
  21. package/src/editor/field-frame.tsx +192 -0
  22. package/src/editor/field-spec.ts +346 -0
  23. package/src/editor/index.ts +20 -2
  24. package/src/editor/label-side.ts +9 -3
  25. package/src/editor/panel.tsx +39 -12
  26. package/src/editor/secret-field.tsx +116 -0
  27. package/src/editor-color.css +1 -1
  28. package/src/editor-plain.js +1 -1
  29. package/src/editor.css +1 -1
  30. package/src/email-editor/editor.tsx +37 -9
  31. package/src/email-editor/model.ts +5 -1
  32. package/src/email-editor.css +1 -1
  33. package/src/eye-icon.tsx +14 -0
  34. package/src/gem-at-work.css +1 -1
  35. package/src/gem-at-work.ts +223 -11
  36. package/src/gemboss-field.css +1 -1
  37. package/src/icons-plain.js +1 -0
  38. package/src/icons.tsx +9 -0
  39. package/src/index.ts +4 -1
  40. package/src/kit-plain.css +1 -1
  41. package/src/list-page.css +1 -1
  42. package/src/list-page.tsx +181 -55
  43. package/src/list-toolbar.css +1 -0
  44. package/src/list-toolbar.tsx +85 -0
  45. package/src/menu-keys.ts +3 -1
  46. package/src/search-dialog.tsx +4 -1
  47. package/src/segmented.tsx +21 -5
  48. package/src/service-switcher.tsx +2 -2
  49. package/src/settings-dialog.tsx +2 -2
  50. package/src/ui.css +1 -1
@@ -54,8 +54,19 @@ export interface EmailEditorProps {
54
54
  dirty?: boolean;
55
55
  onSave: () => void;
56
56
  onSendTest: () => void;
57
- /** Words for "Send me a test" while it runs or after it ran ("Sent to you@store.com"). */
57
+ /** Words for "Send me a test" while it runs or after it ran ("Sent to you@store.com"); also what a save or an approval answered. */
58
58
  testNote?: React.ReactNode;
59
+ /**
60
+ * The surface's own buttons in the bar, between "Send me a test" and Save (GemBoss: "Approve v3", a Manager's). The editor holds no
61
+ * rule about who may press what: a button a person cannot use is not passed.
62
+ */
63
+ actions?: React.ReactNode;
64
+ /**
65
+ * The mail as the sender builds it (GemReach's preview route): its HTML, read-only. Given, the bar offers "As sent" beside Dark, and
66
+ * the stage shows that HTML in a sandboxed frame (no script, no access to the page) at the device's width. `loading` while it is
67
+ * being built again after a change; `error` when it could not be built (a variable with no value, a link that is not one).
68
+ */
69
+ sent?: { html: string | null; loading?: boolean; error?: React.ReactNode };
59
70
  /** Where the column's width is remembered in this browser. */
60
71
  widthKey?: string;
61
72
  }
@@ -116,7 +127,7 @@ const glyph = (k: AddKind) => (
116
127
 
117
128
  export function EmailEditor({
118
129
  draft, onChange, brand, back, chat, people = [], productsFor, opens, checks: serverChecks, saveState = "idle", dirty = false,
119
- onSave, onSendTest, testNote, widthKey = "gb.email-editor.left",
130
+ onSave, onSendTest, testNote, actions, sent, widthKey = "gb.email-editor.left",
120
131
  }: EmailEditorProps) {
121
132
  const [tab, showTab] = useState<Tab>("sections");
122
133
  // Opened once, the chat stays mounted under the other tabs (below): said where the tab changes, never in an effect a render late.
@@ -125,6 +136,9 @@ export function EmailEditor({
125
136
  const [selected, setSelected] = useState<number | null>(null);
126
137
  const [device, setDevice] = useState<EmailDevice>("desktop");
127
138
  const [dark, setDark] = useState(false);
139
+ // "As sent": the sender's own HTML instead of the editable blocks (only when the surface gives it).
140
+ const [asSentOn, setAsSent] = useState(false);
141
+ const asSent = !!sent && asSentOn;
128
142
  const [adding, setAdding] = useState<number | null>(null);
129
143
  const [personId, setPersonId] = useState(people[0]?.id ?? "");
130
144
  const [pane, setPane] = useState<EditorPane>("preview");
@@ -262,12 +276,17 @@ export function EmailEditor({
262
276
  center={<span className="gb-emailed-view">
263
277
  <Segmented<EmailDevice> ariaLabel="Preview size" value={device} onChange={setDevice}
264
278
  options={[{ value: "desktop", label: "Desktop" }, { value: "mobile", label: "Mobile" }]} />
265
- <ToggleBar<"dark"> ariaLabel="Preview colours" pressed={dark ? ["dark"] : []} onToggle={() => setDark((v) => !v)}
266
- options={[{ value: "dark", label: "Dark", title: "How the email reads in a dark inbox" }]} />
279
+ <ToggleBar<"dark" | "sent"> ariaLabel="Preview colours" pressed={[...(dark && !asSent ? ["dark" as const] : []), ...(asSent ? ["sent" as const] : [])]}
280
+ onToggle={(v) => (v === "sent" ? setAsSent((x) => !x) : setDark((x) => !x))}
281
+ options={[
282
+ { value: "dark", label: "Dark", title: asSent ? "As sent shows the light version; a dark inbox applies its dark colours" : "How the email reads in a dark inbox", disabled: asSent },
283
+ ...(sent ? [{ value: "sent" as const, label: "As sent", title: "The email exactly as it is built to be sent, for this person" }] : []),
284
+ ]} />
267
285
  </span>}
268
286
  right={<>
269
287
  <EditorSaveState state={saveState} idleText={dirty ? "Not saved" : undefined} />
270
288
  <button type="button" className="ui-btn" onClick={onSendTest}>Send me a test</button>
289
+ {actions}
271
290
  <button type="button" className="ui-btn ui-btn--primary" onClick={onSave} disabled={saveState === "saving"}>Save</button>
272
291
  </>}
273
292
  />}
@@ -292,14 +311,23 @@ export function EmailEditor({
292
311
  {checksOpen ? (
293
312
  <div className="gb-emailed-checklist" onClick={(e) => e.stopPropagation()}>
294
313
  <StatusList label="Checks" items={[...checks].sort((a, b) => Number(a.ok) - Number(b.ok)).map((c) => ({
295
- key: c.id, label: c.label, text: c.ok ? "Passes" : c.detail ?? "Needs a look", tone: c.ok ? "ok" : "warning",
314
+ key: c.id, label: c.label, text: c.ok ? "Passes" : c.detail ?? "Needs a look", tone: c.ok ? "ok" : c.severity === "error" ? "critical" : "warning",
296
315
  }))} />
297
316
  </div>
298
317
  ) : null}
299
- {/* The envelope reads as picked only where its settings are shown (Settings, no block picked); -1 picks nothing. */}
300
- <EmailPreview draft={draft} brand={brand} data={data} products={products} device={device} dark={dark} selected={sel ?? (tab === "settings" ? null : -1)}
301
- onSelect={(i) => select(i)} onAddAfter={(i) => openAdd(i + 1)} />
302
- <button type="button" className="gb-emailed-addend gb-emailed-addmail" onClick={(e) => { e.stopPropagation(); openAdd(body.length); }}>+ Add a block at the end</button>
318
+ {asSent && sent ? (
319
+ // The sender's HTML, read-only: sandboxed with nothing allowed (no script, no forms, not this page's origin).
320
+ <div className={device === "mobile" ? "gb-emailed-sent is-mobile" : "gb-emailed-sent"} aria-busy={sent.loading ? "true" : undefined}>
321
+ {sent.error ? <p className="gb-emailed-sent-err" role="alert">{sent.error}</p> : null}
322
+ {sent.html ? <iframe className="gb-emailed-sent-frame" title="The email as it is sent" sandbox="" srcDoc={sent.html} /> : null}
323
+ {!sent.html && !sent.error ? <p className="gb-emailed-sent-err">{sent.loading ? "Building the email…" : "Not built yet."}</p> : null}
324
+ </div>
325
+ ) : <>
326
+ {/* The envelope reads as picked only where its settings are shown (Settings, no block picked); -1 picks nothing. */}
327
+ <EmailPreview draft={draft} brand={brand} data={data} products={products} device={device} dark={dark} selected={sel ?? (tab === "settings" ? null : -1)}
328
+ onSelect={(i) => select(i)} onAddAfter={(i) => openAdd(i + 1)} />
329
+ <button type="button" className="gb-emailed-addend gb-emailed-addmail" onClick={(e) => { e.stopPropagation(); openAdd(body.length); }}>+ Add a block at the end</button>
330
+ </>}
303
331
  </div>}
304
332
  >
305
333
  <EditorPaneTabs value={pane} onChange={setPane} labels={{ chat: "Edit", preview: "Email" }} />
@@ -284,7 +284,11 @@ export const BUILT_IN_VARIABLES: readonly string[] = ["unsubscribe_url", "prefer
284
284
  // ── checks ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
285
285
 
286
286
  /** One check, by GemReach's id and name (src/templates/check-ids.ts), so the pill and the server's report say the same thing. */
287
- export interface EmailCheck { id: string; label: string; ok: boolean; detail?: string }
287
+ export interface EmailCheck {
288
+ id: string; label: string; ok: boolean; detail?: string;
289
+ /** The sender's word (GemReach): `error` stops the approval, `warning` is a look. Absent: a look (the editor's own checks). */
290
+ severity?: "error" | "warning";
291
+ }
288
292
 
289
293
  /** Contrast between two #hex colours (WCAG, 1–21), GemReach's `contrast`. */
290
294
  export function contrast(a: string, b: string): number {
@@ -1 +1 @@
1
- .gb-emailed .gemboss-editor-tb-left{gap:8px;min-width:0}.gb-emailed-crumb{max-width:22ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-muted);font-weight:550}.gb-emailed-slash{color:var(--gemboss-divider)}.gb-emailed-name{max-width:28ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-strong)}.gb-emailed-chip,.gb-emailed-tag{flex:none;padding:1px 8px;border-radius:var(--gemboss-radius-sm);background:var(--gemboss-active-bg);font-size:var(--gemboss-fs-caption);font-weight:600;white-space:nowrap}.gb-emailed-tag{padding:1px 6px;background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong);font-size:var(--gemboss-fs-micro)}.gb-emailed-view{display:inline-flex;gap:6px}.gb-emailed-col{display:flex;flex-direction:column;min-height:0}.gb-emailed-chat{flex:1;min-height:0;display:flex;flex-direction:column}.gb-emailed-chat[hidden]{display:none}.gb-emailed-pane{flex:1;min-height:0;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.gb-emailed-pane>.gemboss-ei-head{margin:-12px -12px 4px}.gb-emailed-blocks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gb-emailed-row{display:flex;align-items:stretch;border-radius:10px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);background:var(--gemboss-surface)}.gb-emailed-row.is-sel{background:var(--gemboss-accent-soft);box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-emailed-row.is-hidden{opacity:.55}.gb-emailed-row-main{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:8px 10px;border:0;background:none;font:inherit;color:var(--gemboss-text);text-align:left;cursor:pointer;border-radius:10px}.gb-emailed-row-main:focus-visible,.gb-emailed-row-acts button:focus-visible,.gb-emailed-addend:focus-visible,.gb-emailed-checks:focus-visible,.gb-email-blk:focus-visible,.gb-email-env:focus-visible,.gb-email-add:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-emailed-row-t{flex:1;min-width:0;display:flex;flex-direction:column}.gb-emailed-row-t b{font-weight:550;color:var(--gemboss-text-strong)}.gb-emailed-row-t span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-row-acts{display:flex;align-items:center;gap:2px;padding-right:6px}.gb-emailed-row-acts button{width:26px;height:26px;border:0;border-radius:var(--gemboss-radius-sm);background:none;color:var(--gemboss-text-muted);font:inherit;cursor:pointer}.gb-emailed-row-acts button:hover:not(:disabled){background:var(--gemboss-hover);color:var(--gemboss-text)}.gb-emailed-row-acts button:disabled{opacity:.35;cursor:default}.gb-emailed-addend{min-height:36px;padding:0 12px;border:1.5px dashed var(--gemboss-divider);border-radius:10px;background:transparent;color:var(--gemboss-text);font:inherit;font-weight:550;cursor:pointer}.gb-emailed-addend:hover{border-color:var(--gemboss-accent);color:var(--gemboss-accent-strong)}.gb-emailed-addend span{color:var(--gemboss-text-muted);font-weight:450}.gb-emailed-sum{margin-top:4px;padding:12px;border-radius:10px;background:var(--gemboss-primary-soft);display:flex;flex-direction:column;gap:6px;align-items:flex-start}.gb-emailed-sum b{color:var(--gemboss-text-strong)}.gb-emailed-muted{margin:0;font-size:var(--gemboss-fs-caption);line-height:18px;color:var(--gemboss-text-muted)}.gb-emailed-pick{padding:10px;border-radius:12px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);display:flex;flex-direction:column;gap:8px}.gb-emailed-pick-head{display:flex;align-items:center;gap:8px}.gb-emailed-pick-head span{flex:1;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-emailed-form{display:flex;flex-direction:column;gap:12px;padding-top:4px}.gb-emailed-area{min-height:88px}.gb-emailed-vars{display:flex;flex-wrap:wrap;gap:4px;margin-top:-6px}.gb-emailed-personal{padding:10px 12px;border-radius:10px;background:var(--gemboss-accent-wash);box-shadow:inset 0 0 0 1px var(--gemboss-accent-tint);display:flex;flex-direction:column;align-items:flex-start;gap:4px;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-personal b{font-size:var(--gemboss-fs-body);color:var(--gemboss-text-strong)}.gb-emailed-from{color:var(--gemboss-text-muted)}.gb-emailed-stage{background:var(--gemboss-preview-canvas)}.gb-emailed-scroll{flex:1;min-width:0;overflow:auto;padding:24px}.gb-emailed-meta,.gb-emailed-checklist{max-width:640px;margin:0 auto 12px;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px}.gb-emailed-checklist{display:block;padding:12px;border-radius:12px;background:var(--gemboss-surface)}.gb-emailed-checks,.gb-emailed-as,.gb-emailed-note{padding:4px 10px;border:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-warning-soft);color:var(--gemboss-warning);font:inherit;font-size:var(--gemboss-fs-caption);font-weight:600}.gb-emailed-checks{cursor:pointer}.gb-emailed-checks.is-ok{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.gb-emailed-as,.gb-emailed-note{background:var(--gemboss-surface);color:var(--gemboss-text);font-weight:450}.gb-emailed-addmail{display:block;max-width:640px;width:100%;margin:12px auto 0;background:var(--gemboss-surface)}.gb-email-col{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:12px;color:var(--gemboss-text)}.gb-email-col.is-mobile{max-width:375px}.gb-email-env{padding:12px 16px;border-radius:12px;background:var(--gemboss-surface);display:flex;flex-direction:column;gap:2px;cursor:pointer}.gb-email-env[aria-pressed=true]{box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-email-env-k,.gb-email-env-pre{color:var(--gemboss-text-muted)}.gb-email-mail{--gb-ink: var(--gb-email-ink, var(--gemboss-text));--gb-muted: var(--gb-email-muted, var(--gemboss-text-muted));--gb-line: var(--gb-email-line, var(--gemboss-divider-soft));border-radius:12px;background:var(--gb-email-bg, var(--gemboss-surface));color:var(--gb-ink);overflow:hidden;display:flex;flex-direction:column}.is-dark>.gb-email-mail{--gb-ink: var(--gemboss-dark-text);--gb-muted: var(--gemboss-dark-muted);--gb-line: var(--gemboss-dark-divider);background:var(--gemboss-dark-surface)}.gb-email-blk{position:relative;cursor:pointer}.gb-email-blk:hover{box-shadow:inset 0 0 0 1px var(--gemboss-accent-mid)}.gb-email-blk.is-sel{box-shadow:inset 0 0 0 2px var(--gemboss-accent)}.gb-email-addrow{position:relative;height:0;display:flex;justify-content:center;z-index:1}.gb-email-add{position:absolute;top:-14px;width:28px;height:28px;border:0;border-radius:50%;background:var(--gemboss-accent);color:var(--gemboss-on-primary);font:inherit;font-size:18px;line-height:1;cursor:pointer;box-shadow:var(--gemboss-shadow-raised)}.gb-email-logo{height:56px;display:grid;place-items:center;border-bottom:1px solid var(--gb-line);font-weight:700;letter-spacing:.2em;color:var(--gb-ink)}.gb-email-logo img{max-height:32px}.gb-email-al-left{text-align:left;justify-content:flex-start}.gb-email-al-center{text-align:center;justify-content:center}.gb-email-al-right{text-align:right;justify-content:flex-end}.gb-email-img img{display:block;width:100%;height:auto}.gb-email-img.is-empty{height:150px;display:grid;place-items:center;background:var(--gemboss-warning-soft);color:var(--gb-muted);font-size:var(--gemboss-fs-caption)}.gb-email-text{padding:24px 32px 8px;display:flex;flex-direction:column;gap:8px}.gb-email-h{margin:0;font-size:22px;line-height:28px;font-weight:700;color:var(--gb-ink)}.gb-email-p{margin:0;line-height:20px;color:var(--gb-ink)}.gb-email-strong{font-weight:650}.gb-email-muted{color:var(--gb-muted)}.gb-email-link{text-decoration:underline}.gb-email-var{padding:0 2px;border-radius:3px;background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.gb-email-products,.gb-email-review,.gb-email-band{padding:8px 32px;display:flex;flex-direction:column;gap:10px}.gb-email-review{align-items:center;text-align:center;padding-block:16px}.gb-email-pgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.gb-email-pgrid[data-count="1"]{grid-template-columns:minmax(0,1fr)}.gb-email-pgrid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.is-mobile .gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-email-pcard{border:1px solid var(--gb-line);border-radius:10px;overflow:hidden}.gb-email-pcard.is-one{margin:8px 32px;display:flex}.gb-email-pimg{height:80px;background:var(--gemboss-warning-soft)}.gb-email-pimg img{width:100%;height:100%;object-fit:cover}.gb-email-pbody{padding:8px 10px;display:flex;flex-direction:column}.gb-email-pbody span{color:var(--gb-muted)}.gb-email-btnrow{padding:12px 32px 24px;display:flex;justify-content:center}.gb-email-products .gb-email-btnrow,.gb-email-review .gb-email-btnrow,.gb-email-text .gb-email-btnrow,.gb-email-band .gb-email-btnrow{padding:4px 0 8px}.gb-email-btn{padding:12px 24px;border-radius:8px;background:var(--gb-email-btn, var(--gemboss-primary));color:var(--gb-email-btn-ink, var(--gemboss-on-primary));font-weight:600}.gb-email-stars{display:inline-flex;gap:4px;fill:none;stroke:var(--gemboss-warning);stroke-width:1.4}.gb-email-foot{padding:12px 32px 20px;border-top:1px solid var(--gb-line);text-align:center;font-size:var(--gemboss-fs-caption);color:var(--gb-muted)}.gb-email-foot p{margin:0 0 4px}.gb-email-quote{margin:8px 32px;padding:16px;border-radius:8px;background:var(--gemboss-primary-soft);font-style:italic}.gb-email-quote cite{display:block;margin-top:8px;font-style:normal;font-weight:600}.gb-email-list{margin:0;padding:8px 32px 8px 54px}.gb-email-cols{padding:8px 32px;display:grid;grid-template-columns:1fr 1fr;gap:16px}.gb-email-rule{margin:8px 32px;border:0;border-top:1px solid var(--gb-line)}.is-mobile .gb-email-text,.is-mobile .gb-email-products,.is-mobile .gb-email-review,.is-mobile .gb-email-btnrow,.is-mobile .gb-email-foot{padding-inline:20px}@media (max-width: 47.9975em){.gb-emailed-crumb,.gb-emailed-slash{display:none}.gb-emailed-scroll{padding:12px}.gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-emailed-row-main,.gb-emailed-addend,.gb-emailed-row-acts button{min-height:44px}.gb-emailed-row-acts button{min-width:44px}}
1
+ .gb-emailed .gemboss-editor-tb-left{gap:8px;min-width:0}.gb-emailed-crumb{max-width:22ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-muted);font-weight:550}.gb-emailed-slash{color:var(--gemboss-divider)}.gb-emailed-name{max-width:28ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-strong)}.gb-emailed-chip,.gb-emailed-tag{flex:none;padding:1px 8px;border-radius:var(--gemboss-radius-sm);background:var(--gemboss-active-bg);font-size:var(--gemboss-fs-caption);font-weight:600;white-space:nowrap}.gb-emailed-tag{padding:1px 6px;background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong);font-size:var(--gemboss-fs-micro)}.gb-emailed-view{display:inline-flex;gap:6px}.gb-emailed-col{display:flex;flex-direction:column;min-height:0}.gb-emailed-chat{flex:1;min-height:0;display:flex;flex-direction:column}.gb-emailed-chat[hidden]{display:none}.gb-emailed-pane{flex:1;min-height:0;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.gb-emailed-pane>.gemboss-ei-head{margin:-12px -12px 4px}.gb-emailed-blocks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gb-emailed-row{display:flex;align-items:stretch;border-radius:10px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);background:var(--gemboss-surface)}.gb-emailed-row.is-sel{background:var(--gemboss-accent-soft);box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-emailed-row.is-hidden{opacity:.55}.gb-emailed-row-main{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:8px 10px;border:0;background:none;font:inherit;color:var(--gemboss-text);text-align:left;cursor:pointer;border-radius:10px}.gb-emailed-row-main:focus-visible,.gb-emailed-row-acts button:focus-visible,.gb-emailed-addend:focus-visible,.gb-emailed-checks:focus-visible,.gb-email-blk:focus-visible,.gb-email-env:focus-visible,.gb-email-add:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-emailed-row-t{flex:1;min-width:0;display:flex;flex-direction:column}.gb-emailed-row-t b{font-weight:550;color:var(--gemboss-text-strong)}.gb-emailed-row-t span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-row-acts{display:flex;align-items:center;gap:2px;padding-right:6px}.gb-emailed-row-acts button{width:26px;height:26px;border:0;border-radius:var(--gemboss-radius-sm);background:none;color:var(--gemboss-text-muted);font:inherit;cursor:pointer}.gb-emailed-row-acts button:hover:not(:disabled){background:var(--gemboss-hover);color:var(--gemboss-text)}.gb-emailed-row-acts button:disabled{opacity:.35;cursor:default}.gb-emailed-addend{min-height:36px;padding:0 12px;border:1.5px dashed var(--gemboss-divider);border-radius:10px;background:transparent;color:var(--gemboss-text);font:inherit;font-weight:550;cursor:pointer}.gb-emailed-addend:hover{border-color:var(--gemboss-accent);color:var(--gemboss-accent-strong)}.gb-emailed-addend span{color:var(--gemboss-text-muted);font-weight:450}.gb-emailed-sum{margin-top:4px;padding:12px;border-radius:10px;background:var(--gemboss-primary-soft);display:flex;flex-direction:column;gap:6px;align-items:flex-start}.gb-emailed-sum b{color:var(--gemboss-text-strong)}.gb-emailed-muted{margin:0;font-size:var(--gemboss-fs-caption);line-height:18px;color:var(--gemboss-text-muted)}.gb-emailed-pick{padding:10px;border-radius:12px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);display:flex;flex-direction:column;gap:8px}.gb-emailed-pick-head{display:flex;align-items:center;gap:8px}.gb-emailed-pick-head span{flex:1;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-emailed-form{display:flex;flex-direction:column;gap:12px;padding-top:4px}.gb-emailed-area{min-height:88px}.gb-emailed-vars{display:flex;flex-wrap:wrap;gap:4px;margin-top:-6px}.gb-emailed-personal{padding:10px 12px;border-radius:10px;background:var(--gemboss-accent-wash);box-shadow:inset 0 0 0 1px var(--gemboss-accent-tint);display:flex;flex-direction:column;align-items:flex-start;gap:4px;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-personal b{font-size:var(--gemboss-fs-body);color:var(--gemboss-text-strong)}.gb-emailed-from{color:var(--gemboss-text-muted)}.gb-emailed-stage{background:var(--gemboss-preview-canvas)}.gb-emailed-scroll{flex:1;min-width:0;overflow:auto;padding:24px}.gb-emailed-meta,.gb-emailed-checklist{max-width:640px;margin:0 auto 12px;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px}.gb-emailed-checklist{display:block;padding:12px;border-radius:12px;background:var(--gemboss-surface)}.gb-emailed-checks,.gb-emailed-as,.gb-emailed-note{padding:4px 10px;border:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-warning-soft);color:var(--gemboss-warning);font:inherit;font-size:var(--gemboss-fs-caption);font-weight:600}.gb-emailed-checks{cursor:pointer}.gb-emailed-checks.is-ok{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.gb-emailed-as,.gb-emailed-note{background:var(--gemboss-surface);color:var(--gemboss-text);font-weight:450}.gb-emailed-addmail{display:block;max-width:640px;width:100%;margin:12px auto 0;background:var(--gemboss-surface)}.gb-emailed-sent{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:8px}.gb-emailed-sent.is-mobile{max-width:375px}.gb-emailed-sent[aria-busy=true]{opacity:.6}.gb-emailed-sent-frame{display:block;width:100%;height:72vh;min-height:480px;border:0;border-radius:var(--gemboss-radius-md);background:var(--gemboss-surface)}.gb-emailed-sent-err{margin:0;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-email-col{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:12px;color:var(--gemboss-text)}.gb-email-col.is-mobile{max-width:375px}.gb-email-env{padding:12px 16px;border-radius:12px;background:var(--gemboss-surface);display:flex;flex-direction:column;gap:2px;cursor:pointer}.gb-email-env[aria-pressed=true]{box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-email-env-k,.gb-email-env-pre{color:var(--gemboss-text-muted)}.gb-email-mail{--gb-ink: var(--gb-email-ink, var(--gemboss-text));--gb-muted: var(--gb-email-muted, var(--gemboss-text-muted));--gb-line: var(--gb-email-line, var(--gemboss-divider-soft));border-radius:12px;background:var(--gb-email-bg, var(--gemboss-surface));color:var(--gb-ink);overflow:hidden;display:flex;flex-direction:column}.is-dark>.gb-email-mail{--gb-ink: var(--gemboss-dark-text);--gb-muted: var(--gemboss-dark-muted);--gb-line: var(--gemboss-dark-divider);background:var(--gemboss-dark-surface)}.gb-email-blk{position:relative;cursor:pointer}.gb-email-blk:hover{box-shadow:inset 0 0 0 1px var(--gemboss-accent-mid)}.gb-email-blk.is-sel{box-shadow:inset 0 0 0 2px var(--gemboss-accent)}.gb-email-addrow{position:relative;height:0;display:flex;justify-content:center;z-index:1}.gb-email-add{position:absolute;top:-14px;width:28px;height:28px;border:0;border-radius:50%;background:var(--gemboss-accent);color:var(--gemboss-on-primary);font:inherit;font-size:18px;line-height:1;cursor:pointer;box-shadow:var(--gemboss-shadow-raised)}.gb-email-logo{height:56px;display:grid;place-items:center;border-bottom:1px solid var(--gb-line);font-weight:700;letter-spacing:.2em;color:var(--gb-ink)}.gb-email-logo img{max-height:32px}.gb-email-al-left{text-align:left;justify-content:flex-start}.gb-email-al-center{text-align:center;justify-content:center}.gb-email-al-right{text-align:right;justify-content:flex-end}.gb-email-img img{display:block;width:100%;height:auto}.gb-email-img.is-empty{height:150px;display:grid;place-items:center;background:var(--gemboss-warning-soft);color:var(--gb-muted);font-size:var(--gemboss-fs-caption)}.gb-email-text{padding:24px 32px 8px;display:flex;flex-direction:column;gap:8px}.gb-email-h{margin:0;font-size:22px;line-height:28px;font-weight:700;color:var(--gb-ink)}.gb-email-p{margin:0;line-height:20px;color:var(--gb-ink)}.gb-email-strong{font-weight:650}.gb-email-muted{color:var(--gb-muted)}.gb-email-link{text-decoration:underline}.gb-email-var{padding:0 2px;border-radius:3px;background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.gb-email-products,.gb-email-review,.gb-email-band{padding:8px 32px;display:flex;flex-direction:column;gap:10px}.gb-email-review{align-items:center;text-align:center;padding-block:16px}.gb-email-pgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.gb-email-pgrid[data-count="1"]{grid-template-columns:minmax(0,1fr)}.gb-email-pgrid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.is-mobile .gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-email-pcard{border:1px solid var(--gb-line);border-radius:10px;overflow:hidden}.gb-email-pcard.is-one{margin:8px 32px;display:flex}.gb-email-pimg{height:80px;background:var(--gemboss-warning-soft)}.gb-email-pimg img{width:100%;height:100%;object-fit:cover}.gb-email-pbody{padding:8px 10px;display:flex;flex-direction:column}.gb-email-pbody span{color:var(--gb-muted)}.gb-email-btnrow{padding:12px 32px 24px;display:flex;justify-content:center}.gb-email-products .gb-email-btnrow,.gb-email-review .gb-email-btnrow,.gb-email-text .gb-email-btnrow,.gb-email-band .gb-email-btnrow{padding:4px 0 8px}.gb-email-btn{padding:12px 24px;border-radius:8px;background:var(--gb-email-btn, var(--gemboss-primary));color:var(--gb-email-btn-ink, var(--gemboss-on-primary));font-weight:600}.gb-email-stars{display:inline-flex;gap:4px;fill:none;stroke:var(--gemboss-warning);stroke-width:1.4}.gb-email-foot{padding:12px 32px 20px;border-top:1px solid var(--gb-line);text-align:center;font-size:var(--gemboss-fs-caption);color:var(--gb-muted)}.gb-email-foot p{margin:0 0 4px}.gb-email-quote{margin:8px 32px;padding:16px;border-radius:8px;background:var(--gemboss-primary-soft);font-style:italic}.gb-email-quote cite{display:block;margin-top:8px;font-style:normal;font-weight:600}.gb-email-list{margin:0;padding:8px 32px 8px 54px}.gb-email-cols{padding:8px 32px;display:grid;grid-template-columns:1fr 1fr;gap:16px}.gb-email-rule{margin:8px 32px;border:0;border-top:1px solid var(--gb-line)}.is-mobile .gb-email-text,.is-mobile .gb-email-products,.is-mobile .gb-email-review,.is-mobile .gb-email-btnrow,.is-mobile .gb-email-foot{padding-inline:20px}@media (max-width: 47.9975em){.gb-emailed-crumb,.gb-emailed-slash{display:none}.gb-emailed-scroll{padding:12px}.gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-emailed-row-main,.gb-emailed-addend,.gb-emailed-row-acts button{min-height:44px}.gb-emailed-row-acts button{min-width:44px}}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The eye every secret box has (PasswordField's, SecretField's: one glyph for the kit, 09/11/2026). `off` draws the struck-through eye: shown
3
+ * while the secret IS visible, because the button says what pressing it will do next.
4
+ */
5
+ export function EyeIcon({ off }: { off: boolean }) {
6
+ return (
7
+ <svg width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.6"
8
+ strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
9
+ <path d="M1.5 10S4.6 4.5 10 4.5 18.5 10 18.5 10 15.4 15.5 10 15.5 1.5 10 1.5 10Z" />
10
+ <circle cx="10" cy="10" r="2.6" />
11
+ {off && <path d="M3 17 17 3" />}
12
+ </svg>
13
+ );
14
+ }
@@ -1 +1 @@
1
- .gb-gaw{position:absolute;left:0;top:0;width:0;height:0;overflow:visible;pointer-events:none;z-index:2147483000;--gb-gaw-ring: var(--gemboss-accent, #5661f5);--gb-gaw-bad: var(--gemboss-danger, #d72c0d);font:600 11px/1 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.gb-gaw>*{position:absolute;box-sizing:border-box}.gb-gaw__cursor{left:0;top:0;width:14px;height:18px;z-index:2;will-change:transform}.gb-gaw__cursor svg{display:block;width:14px;height:18px;max-width:none;max-height:none;overflow:visible;filter:drop-shadow(0 1px 1px rgba(0,0,0,.28))}.gb-gaw__cursor path{fill:var(--c, var(--gb-gaw-ring));stroke:#fff;stroke-width:1.3;stroke-linejoin:round}.gb-gaw__tag{position:absolute;left:11px;top:15px;padding:4px 6px;border-radius:3px;background:var(--c, var(--gb-gaw-ring));color:var(--ink, #fff);white-space:nowrap;box-shadow:0 1px 2px #0003}.gb-gaw__cursor.is-failed path{fill:var(--gb-gaw-bad)}.gb-gaw__cursor.is-failed .gb-gaw__tag{background:var(--gb-gaw-bad);color:#fff}.gb-gaw__ring{border:1.5px solid var(--gb-gaw-ring);border-radius:2px}.gb-gaw__label{position:absolute;left:-2px;top:-21px;padding:5px 7px;border-radius:3px 3px 0 0;background:var(--gb-gaw-ring);color:#fff;white-space:nowrap}.gb-gaw__ring--slot{border-color:transparent}.gb-gaw__ring.is-applied .gb-gaw__label:after{content:" \2713"}.gb-gaw__ring.is-failed{border-color:var(--gb-gaw-bad)}.gb-gaw__ring.is-failed .gb-gaw__label{background:var(--gb-gaw-bad)}.gb-gaw__slot{min-height:120px;padding:18px 22px;border:1.5px dashed var(--gb-gaw-ring);border-radius:6px;background:var(--gemboss-accent-wash, #f7f8ff);box-shadow:0 6px 20px #1f1e1d14}.gb-gaw__slot--new{padding:26px 30px;border:0;border-radius:12px;background:var(--gemboss-accent-wash, #f7f8ff);box-shadow:0 1px 2px #1f1e1d0a,0 8px 24px #1f1e1d0f}.gb-gaw__ghost-h,.gb-gaw__ghost-p{width:fit-content;max-width:100%}.gb-gaw__ghost-h{margin:0 0 10px;color:#1b1c1e;font-size:28px;font-weight:600;line-height:1.2}.gb-gaw__ghost-p{margin:0 0 6px;color:#3d4250;font-size:16px;font-weight:400;line-height:1.5}.gb-gaw__sel{border:1px solid var(--gb-gaw-ring)}.gb-gaw__sel i{position:absolute;width:6px;height:6px;background:#fff;border:1px solid var(--gb-gaw-ring)}.gb-gaw__sel i:nth-child(1){left:-3.5px;top:-3.5px}.gb-gaw__sel i:nth-child(2){right:-3.5px;top:-3.5px}.gb-gaw__sel i:nth-child(3){left:-3.5px;bottom:-3.5px}.gb-gaw__sel i:nth-child(4){right:-3.5px;bottom:-3.5px}.gb-gaw__dim{position:absolute;left:-1px;top:calc(100% + 4px);padding:2px 4px;border-radius:2px;background:var(--gb-gaw-ring);color:#fff;font:600 9.5px/1 ui-monospace,SF Mono,Menlo,Consolas,monospace;white-space:nowrap}.gb-gaw__guide{background:var(--gb-gaw-ring);opacity:0}.gb-gaw__caret{background:var(--gb-gaw-ring)}.gb-gaw__caret--inline{position:static;display:inline-block;width:2px;height:.9em;margin-left:2px;vertical-align:-.1em}.gb-gaw__veil{background:#a9b1fb;opacity:.92}.gb-gaw__scan{background:var(--gb-gaw-ring);box-shadow:0 0 14px 4px #5661f559}.gb-gaw__glow{border:2px solid var(--gb-gaw-ring);border-radius:2px;box-shadow:0 0 0 4px #5661f52e;opacity:0}@media (prefers-reduced-motion: reduce){.gb-gaw__cursor,.gb-gaw__scan,.gb-gaw__guide{display:none}}.gb-gaw-skip{position:fixed;right:16px;bottom:16px;z-index:2147483001;padding:7px 12px;border:0;border-radius:999px;background:#16171adb;color:#fff;font:600 12px/1 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;cursor:pointer;box-shadow:0 2px 8px #0000002e}.gb-gaw-skip:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px}
1
+ .gb-gaw{position:absolute;left:0;top:0;width:0;height:0;overflow:visible;pointer-events:none;z-index:2147483000;--gb-gaw-ring: var(--gemboss-accent, #5661f5);--gb-gaw-bad: var(--gemboss-danger, #d72c0d);font:600 11px/1 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.gb-gaw>*{position:absolute;box-sizing:border-box}.gb-gaw__cursor{left:0;top:0;width:14px;height:18px;z-index:2;will-change:transform}.gb-gaw__cursor svg{display:block;width:14px;height:18px;max-width:none;max-height:none;overflow:visible;filter:drop-shadow(0 1px 1px rgba(0,0,0,.28))}.gb-gaw__cursor path{fill:var(--c, var(--gb-gaw-ring));stroke:#fff;stroke-width:1.3;stroke-linejoin:round}.gb-gaw__tag{position:absolute;left:11px;top:15px;padding:4px 6px;border-radius:3px;background:var(--c, var(--gb-gaw-ring));color:var(--ink, #fff);white-space:nowrap;box-shadow:0 1px 2px #0003}.gb-gaw__cursor.is-left .gb-gaw__tag{left:auto;right:6px}.gb-gaw__cursor.is-failed path{fill:var(--gb-gaw-bad)}.gb-gaw__cursor.is-failed .gb-gaw__tag{background:var(--gb-gaw-bad);color:#fff}.gb-gaw__ring{border:1.5px solid var(--gb-gaw-ring);border-radius:2px}.gb-gaw__label{position:absolute;left:-2px;top:-21px;padding:5px 7px;border-radius:3px 3px 0 0;background:var(--gb-gaw-ring);color:#fff;white-space:nowrap}.gb-gaw__ring--slot{border-color:transparent}.gb-gaw__ring.is-applied .gb-gaw__label:after{content:" \2713"}.gb-gaw__ring.is-failed{border-color:var(--gb-gaw-bad)}.gb-gaw__ring.is-failed .gb-gaw__label{background:var(--gb-gaw-bad)}.gb-gaw__slot{min-height:120px;padding:18px 22px;border:1.5px dashed var(--gb-gaw-ring);border-radius:6px;background:var(--gemboss-accent-wash, #f7f8ff);box-shadow:0 6px 20px #1f1e1d14}.gb-gaw__slot--new{padding:26px 30px;border:0;border-radius:12px;background:var(--gemboss-accent-wash, #f7f8ff);box-shadow:0 1px 2px #1f1e1d0a,0 8px 24px #1f1e1d0f}.gb-gaw__ghost-h,.gb-gaw__ghost-p{width:fit-content;max-width:100%}.gb-gaw__ghost-h{margin:0 0 10px;color:#1b1c1e;font-size:28px;font-weight:600;line-height:1.2}.gb-gaw__ghost-p{margin:0 0 6px;color:#3d4250;font-size:16px;font-weight:400;line-height:1.5}.gb-gaw__sel{border:1px solid var(--gb-gaw-ring)}.gb-gaw__sel i{position:absolute;width:6px;height:6px;background:#fff;border:1px solid var(--gb-gaw-ring)}.gb-gaw__sel i:nth-child(1){left:-3.5px;top:-3.5px}.gb-gaw__sel i:nth-child(2){right:-3.5px;top:-3.5px}.gb-gaw__sel i:nth-child(3){left:-3.5px;bottom:-3.5px}.gb-gaw__sel i:nth-child(4){right:-3.5px;bottom:-3.5px}.gb-gaw__dim{position:absolute;left:-1px;top:calc(100% + 4px);padding:2px 4px;border-radius:2px;background:var(--gb-gaw-ring);color:#fff;font:600 9.5px/1 ui-monospace,SF Mono,Menlo,Consolas,monospace;white-space:nowrap}.gb-gaw__guide{background:#ff7a45;opacity:.75}.gb-gaw__caret{background:var(--gb-gaw-ring)}.gb-gaw__caret--inline{position:static;display:inline-block;width:2px;height:.9em;margin-left:2px;vertical-align:-.1em}.gb-gaw__veil{background:#a9b1fb;opacity:.92}.gb-gaw__scan{background:var(--gb-gaw-ring);box-shadow:0 0 14px 4px #5661f559}.gb-gaw__glow{border:2px solid var(--gb-gaw-ring);border-radius:2px;box-shadow:0 0 0 4px #5661f52e;opacity:0}@media (prefers-reduced-motion: reduce){.gb-gaw__cursor,.gb-gaw__scan,.gb-gaw__guide{display:none}}.gb-gaw-skip{position:fixed;right:16px;bottom:16px;z-index:2147483001;padding:7px 12px;border:0;border-radius:999px;background:#16171adb;color:#fff;font:600 12px/1 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;cursor:pointer;box-shadow:0 2px 8px #0000002e}.gb-gaw-skip:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px}.gb-gaw__say,.gb-gaw-goal,.gb-gaw-count{z-index:2147483001;pointer-events:none;padding:6px 10px;border-radius:6px;background:#16171ae0;color:#fff;font:500 12px/1.35 system-ui,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px;box-shadow:0 2px 8px #0000002e}.gb-gaw__say{position:absolute;left:0;top:0}.gb-gaw-goal{position:fixed;left:16px;bottom:16px}.gb-gaw-goal i,.gb-gaw-count i{display:block;height:3px;margin-top:5px;border-radius:2px;background:var(--gemboss-accent, #5661f5);transform-origin:left}.gb-gaw__plus{color:#fff;background:var(--gb-gaw-ring);font:700 11px/12px monospace;text-align:center}.gb-gaw-ruler{position:fixed;left:0;right:0;height:14px;z-index:2147483000;pointer-events:none;background:repeating-linear-gradient(90deg,#fff 0 1px,transparent 1px 10px) bottom / 100% 4px no-repeat #16171a}.gb-gaw-ruler span{position:absolute;color:#fff;font:9px monospace}.gb-gaw-count{position:fixed;left:50%;bottom:16px;transform:translate(-50%)}.gb-gaw-count b{display:inline-block;width:8px;height:8px;border-radius:50%}
@@ -71,6 +71,12 @@ export interface GemActivity {
71
71
  * check (the reader's count of an edit's fields or a check's findings). The crew follows it: the trades with the most work walk
72
72
  * beside Gem and say what they fix. Optional, so a v1 reader that never says it still reads as v1. */
73
73
  trades?: Partial<Record<GemTrade, number>>;
74
+ /** What Gem is doing here, in one short line from the step itself ("Like the original: 61%", "Saved the page (revision 4)"),
75
+ * drawn by the work (Chris 08/11: a visual narration that shows what the system is doing, not effects to pass the time). */
76
+ say?: string;
77
+ /** How far the turn's goal is, measured, not guessed (a clone's likeness to its original, sections built): drawn as a meter
78
+ * with where it started this turn. `unit: "%"` reads `done` as a percent of `total`. */
79
+ goal?: { label: string; done: number; total: number; unit?: "%" };
74
80
  }
75
81
 
76
82
  /** The crew's trades, as an activity names them (`trades`). */
@@ -152,6 +158,14 @@ const BESIDE: Record<Role, string> = { lead: "working", copy: "reading", layout:
152
158
  * the work ahead of the usual pair, walks more often, and says what it fixes. */
153
159
  const HEAT_HALF_MS = 45_000;
154
160
  const HEAT_MIN = 0.75;
161
+ /** WHILE SECTIONS ARE BUILT, MANY HANDS (Chris 08/11, the reel "AI agents build my website": a couple of dozen cursors at once, a
162
+ * block in under a second, rulers, guides and "+" where the next goes). Up to this many blocks go at once, the extra hands are
163
+ * arrows in their trade's colour with no tag, and each block goes this much quicker than a calm build's. */
164
+ const BUILD_LANES = 8;
165
+ const HANDS_MAX = 6;
166
+ const BUILD_PACE = 1.6;
167
+ /** What one of the crew says while it goes over a block (`inspect`): its own trade's look at it (the copy expert reads the words). */
168
+ const LOOKING: Record<Role, string> = { lead: "working", copy: "reading", layout: "checking the spacing", image: "checking the picture", cro: "checking the button", check: "checking", style: "checking the look" };
155
169
  const FIXING: Record<Role, string> = { lead: "working", copy: "fixing the words", layout: "fixing the layout", image: "fixing the pictures", cro: "fixing the buttons", check: "checking again", style: "fixing the look" };
156
170
  /** The crew walks this long after Gem last said anything; past it a turn has gone silent (a tab left open), and it stands. */
157
171
  const STROLL_MS = 360_000;
@@ -304,6 +318,18 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
304
318
  const walked = new Map<Member, number>();
305
319
  /** How much work each trade has had lately (activities' `trades`), cooling by half every HEAT_HALF_MS. */
306
320
  const heat = new Map<Role, { v: number; at: number }>();
321
+ /** Who is going over a block, until when; and how far each trade has gone down its list of blocks. */
322
+ const inspecting = new Map<Member, number>();
323
+ /** The build's extra hands, its ruler, its counter (blocks built of how many), and the "+" where the next blocks go. */
324
+ let hands: Member[] = [];
325
+ let ruler: HTMLElement | null = null, counter: HTMLElement | null = null;
326
+ let built = { done: 0, total: 0 };
327
+ const plus = new Map<HTMLElement, HTMLElement>();
328
+ const looked = new Map<Role, number>();
329
+ /** The line by the work (`say`), and the goal's meter in the corner (`goal`) with what it read when the turn first said it. */
330
+ let sayEl: HTMLElement | null = null;
331
+ let goalEl: HTMLElement | null = null;
332
+ let goalAt: { label: string; from: number; frac: number } | null = null;
307
333
  /** The one at work on the stage now, and QA while it rides a sweep to its end. */
308
334
  let atWork: Member | undefined;
309
335
  let riding: Member | null = null;
@@ -471,6 +497,7 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
471
497
  m.anim?.cancel();
472
498
  const d = ms ?? Math.max(200, Math.min(560, 180 + Math.hypot(x - m.x, y - m.y) * 0.35));
473
499
  m.x = x; m.y = y;
500
+ faceIn(m);
474
501
  const to = `translate(${x}px,${y}px)`;
475
502
  m.anim = move(m.el, [{ transform: from === "none" ? to : from }, { transform: to }], d);
476
503
  }
@@ -492,7 +519,8 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
492
519
  beside.forEach((m, i) => {
493
520
  const p = waypoint(i, walked.get(m) ?? 0);
494
521
  say(m, heatOf(m.role) >= HEAT_MIN ? FIXING[m.role] : BESIDE[m.role]);
495
- if (m.resting) { m.anim?.cancel(); m.x = p.x; m.y = p.y; m.el.style.transform = `translate(${p.x}px,${p.y}px)`; wake(m); } else travel(m, p.x, p.y, 600);
522
+ // One coming on flies in from the middle of the screen, as the reel's crew does.
523
+ if (m.resting) { m.anim?.cancel(); const v = view(); m.x = v.x + v.w / 2; m.y = v.y + v.h / 2; m.el.style.transform = `translate(${m.x}px,${m.y}px)`; wake(m); travel(m, p.x, p.y, 520); } else travel(m, p.x, p.y, 600);
496
524
  });
497
525
  const lead = crew.find((m) => m.role === "lead");
498
526
  if (lead) { const p = waypoint(2, walked.get(lead) ?? 0); travel(lead, p.x, p.y, 500); }
@@ -509,7 +537,8 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
509
537
  if (i === 1) return { x: Math.min(roomRight, r.x + r.w + 12), y: top + (bottom - top) * along };
510
538
  return { x: Math.min(roomRight, r.x + r.w * (0.42 + 0.4 * (1 - along))), y: Math.max(r.y - 40, v.y + bar + 6) };
511
539
  }
512
- /** A beat: the next of them takes its next steps along its edge, an easy walk then a pause, never a jump. */
540
+ /** A beat: the next of them goes over a block of its trade where the work is (`inspect`), or, with none to look at, takes its
541
+ * next steps along its edge. Gem keeps above the work. */
513
542
  function strollNext() {
514
543
  if (!stage) return;
515
544
  const lead = crew.find((m) => m.role === "lead");
@@ -519,11 +548,77 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
519
548
  beat += 1;
520
549
  const m = walkers[beat % Math.max(1, walkers.length)];
521
550
  if (!m || onBlock.has(m)) return;
551
+ if (m !== lead && pace && !revealing && inspect(m)) return;
522
552
  const steps = (walked.get(m) ?? 0) + 1;
523
553
  walked.set(m, steps);
524
554
  const p = waypoint(m === lead ? 2 : beside.indexOf(m), steps);
525
555
  travel(m, p.x, p.y, 1500);
526
556
  }
557
+ /**
558
+ * ONE OF THE CREW GOES OVER A BLOCK OF ITS TRADE WHERE THE WORK IS (Chris 08/11: "chuột di chuyển lờ đờ sang ngang hoặc theo chiều
559
+ * dọc… không còn thú vị"; the first demos had them at the blocks, dragging boxes). The copy expert goes to the words, the image
560
+ * expert to the pictures, CRO to the buttons, layout and styling to the frames: along a curve to the block's corner, pressed, a
561
+ * box dragged round it with its four handles, held a moment, let go. It stands at the corners, never on the words; it says what
562
+ * it looks at, or what it fixes while its trade is warm. True while it is still at it.
563
+ */
564
+ function inspect(m: Member): boolean {
565
+ const t = now();
566
+ if ((inspecting.get(m) ?? 0) > t) return true;
567
+ const near = blocksAt(stage!);
568
+ // Its own kind of block first, then any it may take; QA checks whatever is there.
569
+ const own = near.filter((b) => TAKERS[b.kind][0] === m.role);
570
+ const list = m.role === "check" ? near : own.length ? own : near.filter((b) => TAKERS[b.kind].includes(m.role));
571
+ if (!list.length) return false;
572
+ const n = (looked.get(m.role) ?? -1) + 1;
573
+ looked.set(m.role, n);
574
+ const b = list[n % list.length]!, bx = box(b.el);
575
+ const go = 520 + ((beat * 37) % 5) * 70, drag = Math.max(420, Math.min(820, 240 + (bx.w + bx.h) * 0.3));
576
+ inspecting.set(m, t + (go + drag + 1100) * pace);
577
+ say(m, heatOf(m.role) >= HEAT_MIN ? FIXING[m.role] : m.role === "copy" && b.kind === "heading" ? "reading the headline" : LOOKING[m.role]);
578
+ arc(m, bx.x - 6, bx.y - 6, go);
579
+ later(() => {
580
+ if (!crew.includes(m) || m.resting || onBlock.has(m) || revealing || !b.el.isConnected) return;
581
+ m.el.querySelector("svg")?.animate([{ transform: "scale(1)" }, { transform: "scale(.82)", offset: 0.12 }, { transform: "scale(.82)", offset: 0.9 }, { transform: "scale(1)" }],
582
+ { duration: (drag + 160) * pace, easing: EASE });
583
+ travel(m, bx.x + bx.w + 6, bx.y + bx.h + 6, drag);
584
+ const sel = piece("gb-gaw__sel", bx);
585
+ sel.innerHTML = "<i></i><i></i><i></i><i></i>";
586
+ move(sel, [{ clipPath: "inset(-5px 100% 100% -5px)" }, { clipPath: "inset(-5px -5px -5px -5px)" }], drag);
587
+ later(() => gone(sel, 320), (drag + 650) * pace);
588
+ }, go * pace);
589
+ return true;
590
+ }
591
+ /** The blocks the screen shows in the sections where the work is: each block with no block inside, and a frame that paints. */
592
+ function blocksAt(r: Box): Array<{ el: HTMLElement; kind: BlockKind }> {
593
+ const v = view(), top = v.y + topBar(), out: Array<{ el: HTMLElement; kind: BlockKind }> = [];
594
+ for (const s of topSections()) {
595
+ const sb = box(s);
596
+ if (sb.y > r.y + r.h || sb.y + sb.h < r.y) continue;
597
+ for (const b of s.querySelectorAll<HTMLElement>("[data-gem-el-id]")) {
598
+ const holder = !!b.querySelector("[data-gem-el-id]");
599
+ if ((holder && !paints(b)) || !b.getClientRects().length) continue;
600
+ const bb = box(b);
601
+ if (bb.w < 24 || bb.h < 12 || bb.y < top || bb.y + bb.h > v.y + v.h - 40 || bb.x < v.x || bb.x + bb.w > v.x + v.w) continue;
602
+ out.push({ el: b, kind: holder ? "frame" : kindOfBlock(b) });
603
+ if (out.length >= 40) return out;
604
+ }
605
+ }
606
+ return out;
607
+ }
608
+ /** Near the right edge of the screen its tag goes on its left, so it is never cut off. */
609
+ function faceIn(m: Member) { const v = view(); m.el.classList.toggle("is-left", m.x > v.x + v.w - 240); }
610
+ /** A walk on a curve, bending one way then the other, as a hand moves a mouse. */
611
+ function arc(m: Member, x: number, y: number, ms: number) {
612
+ const fromX = m.x, fromY = m.y, dx = x - fromX, dy = y - fromY, len = Math.hypot(dx, dy) || 1;
613
+ const bend = Math.min(90, len * 0.22) * (beat % 2 ? 1 : -1);
614
+ const mx = (fromX + x) / 2 - (dy / len) * bend, my = (fromY + y) / 2 + (dx / len) * bend;
615
+ const from = getComputedStyle(m.el).transform;
616
+ m.anim?.cancel();
617
+ m.x = x; m.y = y;
618
+ faceIn(m);
619
+ m.anim = move(m.el, [{ transform: from === "none" ? `translate(${fromX}px,${fromY}px)` : from }, { transform: `translate(${mx}px,${my}px)`, offset: 0.5 },
620
+ { transform: `translate(${x}px,${y}px)` }], ms);
621
+ }
527
622
 
528
623
  function markFor(a: GemActivity): Mark | null {
529
624
  const t = a.target ?? (a.created ? {} : undefined);
@@ -789,6 +884,8 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
789
884
  stopTicker();
790
885
  step = "";
791
886
  if (!queue.length) hideSkip();
887
+ // The last line and the goal stay a moment past the light, then go with the crew.
888
+ unnarrate(1200);
792
889
  leave();
793
890
  }
794
891
  function leave() {
@@ -822,6 +919,10 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
822
919
  const was = sections.map((e) => ({ e, opacity: e.style.opacity, clip: e.style.clipPath }));
823
920
  revealing = was;
824
921
  for (const e of sections) e.style.opacity = "0";
922
+ // The build's ruler across the top, and its counter: the blocks it builds, as many as there are.
923
+ built = { done: 0, total: sections.reduce((t, e) => t + buildable(e).size, 0) };
924
+ if (pace && mode === "full") showRuler();
925
+ count(0);
825
926
  who("lead");
826
927
  tellStep("building the page");
827
928
  showSkip();
@@ -835,8 +936,7 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
835
936
  const all = [...e.querySelectorAll<HTMLElement>("[data-gem-el-id]")].filter((b) => b.getClientRects().length > 0);
836
937
  const leaves = all.filter((b) => !b.querySelector("[data-gem-el-id]"));
837
938
  const holders = all.filter((b) => b.querySelector("[data-gem-el-id]"));
838
- const kinds = new Map<HTMLElement, BlockKind>(leaves.map((b) => [b, kindOfBlock(b)]));
839
- for (const f of holders) if (paints(f)) kinds.set(f, "frame");
939
+ const kinds = buildable(e);
840
940
  const own = new Map<HTMLElement, string>();
841
941
  for (const b of all) { own.set(b, b.style.opacity); was.push({ e: b, opacity: b.style.opacity, clip: b.style.clipPath }); b.style.opacity = "0"; }
842
942
  for (const f of holders) if (!kinds.has(f)) f.style.opacity = own.get(f) ?? "";
@@ -849,8 +949,8 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
849
949
  }
850
950
  if (typeof e.animate === "function") e.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 300 / hurry, easing: EASE });
851
951
  await wait(360 / hurry);
852
- // A section of many blocks goes quicker per block (eight blocks' time at most at full pace).
853
- const quick = hurry * Math.max(1, kinds.size / 8);
952
+ // A section of many blocks goes quicker per block (eight blocks' time at most at full pace), and many hands quicker still.
953
+ const quick = hurry * BUILD_PACE * Math.max(1, kinds.size / 8);
854
954
  // A screenful at a time, each through the whole order, so the page only ever moves down.
855
955
  for (const band of bandsOf([...kinds.keys()])) {
856
956
  const area = bandBox(band);
@@ -864,16 +964,19 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
864
964
  // being as it is dragged out. The expert for this step at it, two trades beside it; the next block starts once this
865
965
  // one's box is out, one to three hands by how many there are.
866
966
  onStage(area, who(TAKERS[kind][0]));
867
- const lanes = Math.min(TAKERS[kind].length, group.length >= 6 ? 3 : group.length >= 3 ? 2 : 1);
967
+ // Many hands: a lane for every block, up to BUILD_LANES, each starting a moment after the last; the next few marked "+".
968
+ const lanes = Math.min(BUILD_LANES, group.length);
868
969
  const going = new Set<Promise<void>>();
869
- for (const b of group) {
970
+ for (const [at, b] of group.entries()) {
870
971
  if (revealing !== was) return;
972
+ for (const next of group.slice(at + 1, at + 4)) markNext(next);
973
+ plus.get(b)?.remove(); plus.delete(b);
871
974
  while (going.size >= lanes) await Promise.race(going);
872
975
  let out = () => {};
873
976
  const boxOut = new Promise<void>((done) => { out = done; });
874
- const job: Promise<void> = buildBlock(b, kind, own.get(b) ?? "", quick, () => out()).finally(() => { going.delete(job); out(); });
977
+ const job: Promise<void> = buildBlock(b, kind, own.get(b) ?? "", quick, () => out()).finally(() => { going.delete(job); out(); count(1); });
875
978
  going.add(job);
876
- await boxOut;
979
+ await Promise.race([boxOut, wait(140 / quick)]);
877
980
  }
878
981
  await Promise.all(going);
879
982
  }
@@ -886,12 +989,20 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
886
989
  if (revealing !== was) return;
887
990
  for (const { e, opacity, clip } of was) { e.style.opacity = opacity; e.style.clipPath = clip; }
888
991
  revealing = null;
992
+ unbuild();
889
993
  // More of the turn to draw: the crew stays on it.
890
994
  if (queue.length) return;
891
995
  stopTicker();
892
996
  hideSkip();
893
997
  leave();
894
998
  }
999
+ /** What a section's build draws, block by block: each block holding no block, by its kind, and each frame that paints. */
1000
+ function buildable(e: Element): Map<HTMLElement, BlockKind> {
1001
+ const all = [...e.querySelectorAll<HTMLElement>("[data-gem-el-id]")].filter((b) => b.getClientRects().length > 0);
1002
+ const kinds = new Map<HTMLElement, BlockKind>(all.filter((b) => !b.querySelector("[data-gem-el-id]")).map((b) => [b, kindOfBlock(b)]));
1003
+ for (const f of all) if (f.querySelector("[data-gem-el-id]") && paints(f)) kinds.set(f, "frame");
1004
+ return kinds;
1005
+ }
895
1006
  /** A section's blocks by the screenful, from the top: a section taller than the screen is built a part at a time. */
896
1007
  function bandsOf(blocks: HTMLElement[]): HTMLElement[][] {
897
1008
  const tall = Math.min(win.innerHeight, 1000) * 0.85, bands: HTMLElement[][] = [];
@@ -912,7 +1023,62 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
912
1023
  const m = free.find((x) => x.role === role);
913
1024
  if (m) { wake(m); return m; }
914
1025
  }
915
- return undefined;
1026
+ // The crew all busy: one of the trade's extra hands, a free one or a new one flown in from the middle of the screen.
1027
+ const role = TAKERS[kind][0];
1028
+ const spare = hands.find((h) => h.role === role && !onBlock.has(h));
1029
+ if (spare) { wake(spare); return spare; }
1030
+ if (!crew.length || !pace || hands.length >= HANDS_MAX) return undefined;
1031
+ const c = CREW.find((x) => x.role === role)!, v = view(), el = doc.createElement("div");
1032
+ el.className = "gb-gaw__cursor is-hand";
1033
+ el.style.setProperty("--c", c.c);
1034
+ el.innerHTML = ARROW;
1035
+ ensureLayer().append(el);
1036
+ const x = v.x + v.w / 2, y = v.y + v.h / 2;
1037
+ el.style.transform = `translate(${x}px,${y}px)`;
1038
+ move(el, [{ opacity: "0" }, { opacity: "1" }], 200);
1039
+ const m: Member = { ...c, el, tag: doc.createElement("span"), x, y, anim: null, fade: null, resting: false };
1040
+ hands.push(m);
1041
+ return m;
1042
+ }
1043
+ /** A "+" at the corner of a block whose turn is next: where it is about to go. */
1044
+ function markNext(b: HTMLElement) {
1045
+ if (plus.has(b) || !pace || mode !== "full") return;
1046
+ const bx = box(b), p = piece("gb-gaw__plus", { x: bx.x - 6, y: bx.y - 6, w: 12, h: 12 });
1047
+ p.textContent = "+";
1048
+ move(p, [{ opacity: "0" }, { opacity: "1" }], 160);
1049
+ plus.set(b, p);
1050
+ }
1051
+ /** The build's counter at the foot of the screen: its hands, in their trades' colours, and the blocks built of how many. */
1052
+ function count(k: number) {
1053
+ built.done += k;
1054
+ if (!built.total || mode !== "full") return;
1055
+ if (!counter) { counter = doc.createElement("div"); counter.className = "gb-gaw-count"; counter.setAttribute("aria-hidden", "true"); root.append(counter); }
1056
+ const at = [...crew.filter((m) => !m.resting), ...hands];
1057
+ const dots = at.slice(0, 8).map((m) => { const d = doc.createElement("b"); d.style.background = CREW.find((c) => c.role === m.role)!.c; return d; });
1058
+ const bar = doc.createElement("i");
1059
+ counter.replaceChildren(...dots, doc.createTextNode(` ${at.length} at work · ${Math.min(built.done, built.total)} / ${built.total} blocks`), bar);
1060
+ bar.style.transform = `scaleX(${Math.min(1, built.done / built.total)})`;
1061
+ }
1062
+ /** A pixel ruler across the top of the screen while sections are built, as a design tool has (under a bar that sticks to the top). */
1063
+ function showRuler() {
1064
+ if (ruler) return;
1065
+ ruler = doc.createElement("div");
1066
+ ruler.className = "gb-gaw-ruler";
1067
+ ruler.setAttribute("aria-hidden", "true");
1068
+ ruler.style.top = `${topBar()}px`;
1069
+ for (let x = 100; x < win.innerWidth; x += 100) { const t = doc.createElement("span"); t.textContent = String(x); t.style.left = `${x + 2}px`; ruler.append(t); }
1070
+ root.append(ruler);
1071
+ move(ruler, [{ opacity: "0" }, { opacity: "1" }], 240);
1072
+ }
1073
+ /** The build's extra hands, its ruler, counter and "+" go (its end, a skip). */
1074
+ function unbuild() {
1075
+ for (const h of hands) gone(h.el, 260);
1076
+ hands = [];
1077
+ for (const p of plus.values()) p.remove();
1078
+ plus.clear();
1079
+ ruler?.remove(); ruler = null;
1080
+ counter?.remove(); counter = null;
1081
+ built = { done: 0, total: 0 };
916
1082
  }
917
1083
  /** One block of the saved page, as the board draws it: the expert goes to its top-left corner, holds the mouse down and drags its
918
1084
  * box out to the bottom-right corner, its size shown once it is out; then its words wipe in from the left behind a caret, or,
@@ -936,6 +1102,11 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
936
1102
  }
937
1103
  const sel = piece("gb-gaw__sel", bx);
938
1104
  sel.innerHTML = "<i></i><i></i><i></i><i></i>";
1105
+ // The guides a design tool draws while a box is dragged: across the screen from its top edge and its left edge.
1106
+ if (mode === "full") {
1107
+ const v = view();
1108
+ for (const g of [piece("gb-gaw__guide", { x: v.x, y: bx.y, w: v.w, h: 1 }), piece("gb-gaw__guide", { x: bx.x, y: v.y, w: 1, h: v.h })]) later(() => gone(g, 240), drag + 200);
1109
+ }
939
1110
  const grow = [{ clipPath: "inset(-5px 100% 100% -5px)" }, { clipPath: "inset(-5px -5px -5px -5px)" }];
940
1111
  const tint = picture ? piece("gb-gaw__veil", bx) : null;
941
1112
  move(sel, grow, drag);
@@ -1032,6 +1203,40 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
1032
1203
  }
1033
1204
  }
1034
1205
  /** Gem's tag: the step it is on; quiet for a while, the step's real seconds ("Generating a picture · 12s"). */
1206
+ /** A line by the work: what Gem is doing there, in the step's own words. */
1207
+ function narrate(text: string) {
1208
+ if (!sayEl) { sayEl = doc.createElement("div"); sayEl.className = "gb-gaw__say"; ensureLayer().append(sayEl); }
1209
+ if (sayEl.textContent !== text) { sayEl.textContent = text; move(sayEl, [{ opacity: "0" }, { opacity: "1" }], 220); }
1210
+ placeSay();
1211
+ }
1212
+ /** Just above the work (or where the person is looking before there is any), inside the screen and under a sticky bar. */
1213
+ function placeSay() {
1214
+ if (!sayEl) return;
1215
+ const v = view(), bar = topBar(), r = stage ?? { x: v.x + 24, y: v.y + bar + 60, w: 0, h: 0 };
1216
+ const x = Math.max(v.x + 12, Math.min(r.x, v.x + v.w - Math.min(440, sayEl.offsetWidth + 12)));
1217
+ // Above the work; with no room above it, under the ring's own label at its top edge.
1218
+ const y = r.y - 34 >= v.y + bar + 8 ? r.y - 34 : Math.min(Math.max(r.y, v.y + bar) + 30, v.y + v.h - 96);
1219
+ sayEl.style.transform = `translate(${Math.round(x)}px,${Math.round(y)}px)`;
1220
+ }
1221
+ /** The goal's meter: its label, where it started this turn and where it is now, and a bar that moves from one to the other. */
1222
+ function showGoal(g: NonNullable<GemActivity["goal"]>) {
1223
+ if (!g || typeof g.label !== "string" || !g.label || !(g.total > 0) || !(g.done >= 0)) return;
1224
+ const frac = Math.max(0, Math.min(1, g.done / g.total)), pct = g.unit === "%";
1225
+ if (goalAt?.label !== g.label) goalAt = { label: g.label, from: g.done, frac };
1226
+ if (!goalEl) { goalEl = doc.createElement("div"); goalEl.className = "gb-gaw-goal"; goalEl.setAttribute("aria-hidden", "true"); root.append(goalEl); }
1227
+ const at = pct ? `${Math.round(g.done)}%` : `${g.done}/${g.total}`;
1228
+ const was = pct && Math.round(goalAt.from) !== Math.round(g.done) ? `${Math.round(goalAt.from)}% → ` : "";
1229
+ const bar = doc.createElement("i");
1230
+ goalEl.replaceChildren(doc.createTextNode(`${g.label} ${was}${at}`), bar);
1231
+ move(bar, [{ transform: `scaleX(${goalAt.frac})` }, { transform: `scaleX(${frac})` }], 700);
1232
+ goalAt.frac = frac;
1233
+ }
1234
+ /** The line and the meter go: with the turn (after the light) or at once (Skip). */
1235
+ function unnarrate(after = 0) {
1236
+ if (sayEl) { if (after) gone(sayEl, 300, after); else sayEl.remove(); sayEl = null; }
1237
+ if (goalEl) { if (after) gone(goalEl, 400, after + 1000); else goalEl.remove(); goalEl = null; }
1238
+ goalAt = null;
1239
+ }
1035
1240
  function tellStep(text: string) {
1036
1241
  step = text;
1037
1242
  const lead = crew.find((m) => m.role === "lead");
@@ -1092,6 +1297,11 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
1092
1297
  // A check, a save or a refusal that says where the work is changes who walks beside it now (the others move the stage
1093
1298
  // themselves; while a section is built its blocks have their own hands).
1094
1299
  if (a.trades && stage && !revealing && (a.kind === "check" || a.kind === "apply" || a.kind === "fail")) onStage(stage, atWork);
1300
+ // What the step says it is doing, by the work; how far the goal is, in the corner. A landing has its own way out (land).
1301
+ if (a.kind !== "land") {
1302
+ if (typeof a.say === "string" && a.say.trim()) narrate(a.say.trim().slice(0, 120)); else placeSay();
1303
+ if (a.goal) showGoal(a.goal);
1304
+ }
1095
1305
  } catch {
1096
1306
  // The bottom of the ladder: the page as it is.
1097
1307
  options.onFallback?.("page", a);
@@ -1104,6 +1314,8 @@ export function createGemAtWork(options: GemAtWorkOptions = {}): GemAtWork {
1104
1314
  timers.clear();
1105
1315
  stopTicker();
1106
1316
  hideSkip();
1317
+ unnarrate();
1318
+ unbuild();
1107
1319
  // The calm clock stops where it is: nothing queued is drawn, and whoever waits on it is let go.
1108
1320
  epoch += 1;
1109
1321
  draining = false;
@@ -1 +1 @@
1
- .gemboss-field,.gemboss-control{box-sizing:border-box;height:32px;min-width:0;padding:0 12px;font:inherit;font-size:var(--p-font-size-325, 13px);line-height:20px;color:var(--p-color-text, var(--gemboss-field-ink));background-color:var(--p-color-input-bg-surface, var(--gemboss-field-bg));border:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:var(--p-border-radius-200, 8px)}input[type=search]:is(.gemboss-field,.gemboss-field__bare){-webkit-appearance:none;appearance:none}.gemboss-field::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field--tall{min-height:44px}.gemboss-field--narrow{padding:0 6px;appearance:textfield;-moz-appearance:textfield}.gemboss-field--narrow::-webkit-outer-spin-button,.gemboss-field--narrow::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gemboss-field:hover:not(:disabled):not(:has(>.gemboss-field__bare:disabled)),.gemboss-control:hover:not(:disabled){border-color:var(--p-color-input-border-hover, var(--gemboss-field-line-hover));background-color:var(--p-color-input-bg-surface-hover, var(--gemboss-field-bg-hover))}.gemboss-field:focus-visible,.gemboss-control:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field:disabled,.gemboss-control:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 47.9975em){.gemboss-field,.gemboss-control{font-size:16px;min-height:44px}}textarea.gemboss-field{height:auto;padding:6px 12px;resize:vertical}.gemboss-field--group{display:flex;align-items:center;gap:6px;height:auto;min-height:32px;padding-right:0;overflow:hidden}@media (max-width: 47.9975em){.gemboss-field--group{min-height:44px}}.gemboss-field--group:focus-within{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field--group input[type=color]{flex:none;align-self:stretch;width:44px;min-width:44px;height:auto;min-height:0;margin:-1px 0 -1px -12px;padding:0;border:0;border-right:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:0;background:none;cursor:pointer}.gemboss-field--group input[type=color]::-webkit-color-swatch-wrapper{padding:0}.gemboss-field--group input[type=color]::-webkit-color-swatch{border:0;border-radius:0}.gemboss-field__bare{flex:1;min-width:0;align-self:stretch;margin-block:-1px;padding:0 12px 0 0;border:0;border-radius:0;outline:none;background:transparent;color:inherit;font:inherit}.gemboss-field__bare::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__suffix{flex:none;padding-right:12px;color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__bare:has(+.gemboss-field__suffix){padding-right:0}.gemboss-field--group:has(>.gemboss-field__bare:disabled){opacity:.5;cursor:not-allowed}.gemboss-field__bare:disabled{cursor:not-allowed}@media (pointer: coarse){.gemboss-field,.gemboss-control{height:auto;min-height:44px}}.gemboss-control{cursor:pointer}.gemboss-control.gemboss-control--icon{width:32px;flex:0 0 auto;padding:0}@media (pointer: coarse){.gemboss-control.gemboss-control--icon{width:44px;min-width:44px}}
1
+ .gemboss-field,.gemboss-control{box-sizing:border-box;height:32px;min-width:0;padding:0 12px;font:inherit;font-size:var(--p-font-size-325, 13px);line-height:20px;color:var(--p-color-text, var(--gemboss-field-ink));background-color:var(--p-color-input-bg-surface, var(--gemboss-field-bg));border:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:var(--p-border-radius-200, 8px)}input[type=search]:is(.gemboss-field,.gemboss-field__bare){-webkit-appearance:none;appearance:none}.gemboss-field::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field--tall{min-height:44px}.gemboss-field--narrow{padding:0 6px;appearance:textfield;-moz-appearance:textfield}.gemboss-field--narrow::-webkit-outer-spin-button,.gemboss-field--narrow::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gemboss-field:hover:not(:disabled):not(:has(.gemboss-field__bare:disabled)),.gemboss-control:hover:not(:disabled){border-color:var(--p-color-input-border-hover, var(--gemboss-field-line-hover));background-color:var(--p-color-input-bg-surface-hover, var(--gemboss-field-bg-hover))}.gemboss-field:focus-visible,.gemboss-control:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field:disabled,.gemboss-control:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 47.9975em){.gemboss-field,.gemboss-control{font-size:16px;min-height:44px}}textarea.gemboss-field{height:auto;padding:6px 12px;resize:vertical}.gemboss-field--group{display:flex;align-items:center;gap:6px;height:auto;min-height:32px;padding-right:0;overflow:hidden}@media (max-width: 47.9975em){.gemboss-field--group{min-height:44px}}.gemboss-field--group:focus-within{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field--group input[type=color]{flex:none;align-self:stretch;width:44px;min-width:44px;height:auto;min-height:0;margin:-1px 0 -1px -12px;padding:0;border:0;border-right:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:0;background:none;cursor:pointer}.gemboss-field--group input[type=color]::-webkit-color-swatch-wrapper{padding:0}.gemboss-field--group input[type=color]::-webkit-color-swatch{border:0;border-radius:0}.gemboss-field__bare{flex:1;min-width:0;align-self:stretch;margin-block:-1px;padding:0 12px 0 0;border:0;border-radius:0;outline:none;background:transparent;color:inherit;font:inherit}.gemboss-field__bare::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__suffix{flex:none;padding-right:12px;color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__bare:has(+.gemboss-field__suffix){padding-right:0}.gemboss-field--group:has(.gemboss-field__bare:disabled){opacity:.5;cursor:not-allowed}.gemboss-field__bare:disabled{cursor:not-allowed}@media (pointer: coarse){.gemboss-field,.gemboss-control{height:auto;min-height:44px}}.gemboss-control{cursor:pointer}.gemboss-control.gemboss-control--icon{width:32px;flex:0 0 auto;padding:0}@media (pointer: coarse){.gemboss-control.gemboss-control--icon{width:44px;min-width:44px}}
@@ -0,0 +1 @@
1
+ (function(d){"use strict";var t=d.gembossUI||(d.gembossUI={});if(t.icon)return;var r={reaction:'<path d="M16.5 10a6.5 6.5 0 1 1-6.5-6.5"/><path d="M7.5 11.8s.9 1.2 2.5 1.2 2.5-1.2 2.5-1.2"/><path d="M7.8 8.2h.01M12.2 8.2h.01"/><path d="M15 2.5v4M13 4.5h4"/>',home:'<path d="M3.5 9 10 3.5 16.5 9"/><path d="M5 7.8v8.7h10V7.8"/><path d="M8.5 16.5v-4h3v4"/>',dashboard:'<rect x="3" y="3" width="6" height="6" rx="1.3"/><rect x="11" y="3" width="6" height="6" rx="1.3"/><rect x="3" y="11" width="6" height="6" rx="1.3"/><rect x="11" y="11" width="6" height="6" rx="1.3"/>',board:'<rect x="3" y="3.5" width="4" height="13" rx="1.2"/><rect x="8" y="3.5" width="4" height="9" rx="1.2"/><rect x="13" y="3.5" width="4" height="6" rx="1.2"/>',layout:'<rect x="3.5" y="3" width="13" height="3.5" rx="1"/><rect x="3.5" y="8.25" width="13" height="3.5" rx="1"/><rect x="3.5" y="13.5" width="13" height="3.5" rx="1"/>',layers:'<path d="M10 3 17 6.8 10 10.6 3 6.8z"/><path d="M3 10.1l7 3.8 7-3.8"/><path d="M3 13.4l7 3.8 7-3.8"/>',document:'<path d="M5 2.8h6.8l3.2 3.2v11.2H5z"/><path d="M11.8 2.8V6H15M7.5 10h5M7.5 13h5"/>',article:'<rect x="3" y="3.5" width="14" height="13" rx="1.5"/><path d="M6 7h8M6 10h8M6 13h5"/>',page:'<rect x="2.5" y="3.5" width="15" height="13" rx="2"/><path d="M2.5 7.5h15M6 11h8M6 13.5h5"/>',image:'<rect x="3" y="3.5" width="14" height="13" rx="1.8"/><circle cx="7.3" cy="7.8" r="1.3"/><path d="M3.5 15l4.2-4.2 3 3 2.2-2.2 3.6 3.6"/>',folder:'<path d="M2.8 5.3c0-.8.6-1.3 1.3-1.3h3.4l1.8 2h6.6c.8 0 1.3.6 1.3 1.3v7.7c0 .8-.6 1.3-1.3 1.3H4.1c-.8 0-1.3-.6-1.3-1.3z"/>',list:'<path d="M8 5h9M8 10h9M8 15h9"/><circle cx="4" cy="5" r=".9"/><circle cx="4" cy="10" r=".9"/><circle cx="4" cy="15" r=".9"/>',activity:'<path d="M2.5 10h3l2-5 3 10 2-5h5"/>',funnel:'<path d="M3 4h14l-5.2 6.2v4.6l-3.6 1.7v-6.3z"/>',chart:'<path d="M3 16.5h14"/><rect x="4.5" y="9" width="2.8" height="5.5" rx=".7"/><rect x="8.6" y="5" width="2.8" height="9.5" rx=".7"/><rect x="12.7" y="11" width="2.8" height="3.5" rx=".7"/>',radar:'<circle cx="10" cy="10" r="7"/><circle cx="10" cy="10" r="3.5"/><path d="M10 10l5-5"/>',map:'<rect x="3" y="3" width="14" height="14" rx="2"/><path d="M3 7.7h14M3 12.3h14M7.7 3v14M12.3 3v14"/>',globe:'<circle cx="10" cy="10" r="7"/><path d="M3 10h14M10 3c2 2 2.8 4.3 2.8 7s-.8 5-2.8 7c-2-2-2.8-4.3-2.8-7s.8-5 2.8-7z"/>',megaphone:'<path d="M3 8v4h3l6 4V4L6 8H3z"/><path d="M15 7.5a3.5 3.5 0 0 1 0 5"/>',star:'<path d="M10 2.8l2.2 4.5 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5L2.8 8l5-.7z"/>',eye:'<path d="M1.8 10S4.7 4.8 10 4.8 18.2 10 18.2 10 15.3 15.2 10 15.2 1.8 10 1.8 10z"/><circle cx="10" cy="10" r="2.5"/>',inbox:'<path d="M3 11l2-7h10l2 7v5H3z"/><path d="M3 11h4l1 2h4l1-2h4"/>',bell:'<path d="M5 13.5V9a5 5 0 0 1 10 0v4.5l1.3 1.5H3.7z"/><path d="M8.3 17.2a1.9 1.9 0 0 0 3.4 0"/>',chat:'<path d="M3 4.5h14v9H8.5L5 16.5v-3H3z"/>',money:'<circle cx="10" cy="10" r="7"/><path d="M12 7.6c-.5-.7-1.2-1-2-1-1.1 0-2 .7-2 1.6 0 2.1 4 1.2 4 3.4 0 .9-.9 1.6-2 1.6-.8 0-1.6-.3-2.1-1M10 5v1.6M10 13.2V15"/>',store:'<path d="M3.2 7.5 4.5 3.5h11l1.3 4"/><path d="M3.2 7.5c0 1.3 1 2.2 2.3 2.2s2.2-1 2.2-2.2c0 1.3 1 2.2 2.3 2.2s2.3-1 2.3-2.2c0 1.3.9 2.2 2.2 2.2s2.3-.9 2.3-2.2"/><path d="M4.5 9.5v7h11v-7M8.5 16.5v-3.5h3v3.5"/>',user:'<circle cx="10" cy="7" r="3.2"/><path d="M3.8 16.5c.8-2.8 3.3-4.5 6.2-4.5s5.4 1.7 6.2 4.5"/>',users:'<circle cx="7.5" cy="7.3" r="2.8"/><path d="M2.5 16.3c.6-2.5 2.5-4 5-4s4.4 1.5 5 4"/><path d="M12.3 4.8a2.8 2.8 0 0 1 0 5.2M14.3 12.5c1.6.4 2.7 1.7 3.2 3.8"/>',calendar:'<rect x="3" y="4.5" width="14" height="12.5" rx="1.8"/><path d="M3 8.5h14M7 3v3M13 3v3"/>',clock:'<circle cx="10" cy="10" r="7"/><path d="M10 6v4l2.8 1.8"/>',search:'<circle cx="8.8" cy="8.8" r="5.3"/><path d="M12.8 12.8 17 17"/>',moon:'<path d="M15.6 12.4A6.2 6.2 0 0 1 7.6 4.4a6.2 6.2 0 1 0 8 8Z"/>',sun:'<circle cx="10" cy="10" r="3.2"/><path d="M10 2.6v1.8M10 15.6v1.8M2.6 10h1.8M15.6 10h1.8M4.8 4.8l1.3 1.3M13.9 13.9l1.3 1.3M4.8 15.2l1.3-1.3M13.9 6.1l1.3-1.3"/>',link:'<path d="M8.6 11.4a3 3 0 0 0 4.2 0l2.6-2.6a3 3 0 0 0-4.2-4.2l-1 1"/><path d="M11.4 8.6a3 3 0 0 0-4.2 0l-2.6 2.6a3 3 0 0 0 4.2 4.2l1-1"/>',eyedropper:'<path d="M10.4 6.4 13.6 9.6"/><path d="M12 4.8 13.4 3.4a2.1 2.1 0 0 1 3 3L15 7.8"/><path d="M12 8 5.6 14.4 4 16"/>',sliders:'<path d="M3 5h14M3 10h14M3 15h14"/><circle cx="7" cy="5" r="1.6"/><circle cx="13" cy="10" r="1.6"/><circle cx="9" cy="15" r="1.6"/>',settings:'<path d="M15.52 9.08 17.15 9.15 17.15 10.85 15.52 10.92 14.56 13.26 15.66 14.45 14.45 15.66 13.26 14.56 10.92 15.52 10.85 17.15 9.15 17.15 9.08 15.52 6.74 14.56 5.55 15.66 4.34 14.45 5.44 13.26 4.48 10.92 2.85 10.85 2.85 9.15 4.48 9.08 5.44 6.74 4.34 5.55 5.55 4.34 6.74 5.44 9.08 4.48 9.15 2.85 10.85 2.85 10.92 4.48 13.26 5.44 14.45 4.34 15.66 5.55 14.56 6.74Z"/><circle cx="10" cy="10" r="2.4"/>',alert:'<path d="M10 3.2 17.3 16H2.7z"/><path d="M10 8.2v3.6M10 13.9v.1"/>',info:'<circle cx="10" cy="10" r="7"/><path d="M10 9v4.5M10 6.4v.1"/>',check:'<path d="M4 10.5 8 14.5 16 5.5"/>',plus:'<path d="M10 4v12M4 10h12"/>',close:'<path d="M5 5l10 10M15 5 5 15"/>',more:'<circle cx="4.5" cy="10" r="1"/><circle cx="10" cy="10" r="1"/><circle cx="15.5" cy="10" r="1"/>',apps:'<circle cx="4.5" cy="4.5" r="1"/><circle cx="10" cy="4.5" r="1"/><circle cx="15.5" cy="4.5" r="1"/><circle cx="4.5" cy="10" r="1"/><circle cx="10" cy="10" r="1"/><circle cx="15.5" cy="10" r="1"/><circle cx="4.5" cy="15.5" r="1"/><circle cx="10" cy="15.5" r="1"/><circle cx="15.5" cy="15.5" r="1"/>',utensils:'<path d="M6 3v5a2 2 0 0 0 4 0V3M8 3v14"/><path d="M15 3c-1.6 1.4-2.5 3.6-2.5 6.5H15V17"/>',signOut:'<path d="M8 3.5H4v13h4M12.5 6.5 16 10l-3.5 3.5M16 10H8"/>',sparkle:'<path d="M9 3.5c.4 2.9 1.6 4.1 4.5 4.5-2.9.4-4.1 1.6-4.5 4.5-.4-2.9-1.6-4.1-4.5-4.5 2.9-.4 4.1-1.6 4.5-4.5z"/><path d="M14.5 12.5c.2 1.3.7 1.8 2 2-1.3.2-1.8.7-2 2-.2-1.3-.7-1.8-2-2 1.3-.2 1.8-.7 2-2z"/>',hash:'<path d="M8 3.5 6.5 16.5M13.5 3.5 12 16.5M4 7.5h12.5M3.5 12.5H16"/>',lock:'<rect x="4.5" y="9" width="11" height="8" rx="1.5"/><path d="M7 9V6.5a3 3 0 0 1 6 0V9"/>',reply:'<path d="M8 13.5 3.5 9 8 4.5M3.5 9h8a5 5 0 0 1 5 5v2"/>',thread:'<path d="M3 4.5h14v9H8.5L5 16.5v-3H3z"/><path d="M6.5 8h7M6.5 10.5h4.5"/>',paperclip:'<path d="M15.5 9.5 10 15a3.5 3.5 0 0 1-5-5l6-6a2.3 2.3 0 0 1 3.3 3.3l-6 6a1.2 1.2 0 0 1-1.7-1.7l5.3-5.3"/>',send:'<path d="M3.5 10 16.5 3.5 13 16.5 9.5 11z"/><path d="M9.5 11 16.5 3.5"/>',chevronLeft:'<path d="M12.5 4.5 7 10l5.5 5.5"/>',chevronRight:'<path d="M7.5 4.5 13 10l-5.5 5.5"/>',arrowLeft:'<path d="M16 10H4M9 5l-5 5 5 5"/>',chevronsDown:'<path d="M6 5.5l4 4 4-4M6 10.5l4 4 4-4"/>',chevronDown:'<path d="M6 8l4 4 4-4"/>',panelRight:'<rect x="3" y="3.5" width="14" height="13" rx="2"/><path d="M12.5 3.5v13"/>',emoji:'<circle cx="10" cy="10" r="6.5"/><path d="M7.5 11.8s.9 1.2 2.5 1.2 2.5-1.2 2.5-1.2"/><path d="M7.8 8.2h.01M12.2 8.2h.01"/>',chevronUp:'<path d="M6 12l4-4 4 4"/>',bookmark:'<path d="M5.5 3.5h9v13l-4.5-3.2-4.5 3.2z"/>',trophy:'<path d="M6.5 3.5h7v3.8a3.5 3.5 0 0 1-7 0z"/><path d="M6.5 5H4.5v1.2a2.3 2.3 0 0 0 2.6 2.3M13.5 5h2v1.2a2.3 2.3 0 0 1-2.6 2.3"/><path d="M10 10.8v2.7M7 16.5h6l-.6-3H7.6z"/>',flame:'<path d="M10 17c-2.9 0-5-2-5-4.9 0-2.5 1.7-3.9 2.6-5.8.5 1.3 1.2 2.1 2.1 2.4.1-2.3 1.2-4.2 2.4-5.7.7 2.6 2.9 4.5 2.9 8.7 0 3.1-2.1 5.3-5 5.3z"/><path d="M10 17c-1.2 0-2.1-.9-2.1-2.1 0-1.2.9-1.9 1.4-2.8.8 1 2.8 1.6 2.8 2.8 0 1.2-.9 2.1-2.1 2.1z"/>',grip:'<circle cx="7.5" cy="5" r="1"/><circle cx="12.5" cy="5" r="1"/><circle cx="7.5" cy="10" r="1"/><circle cx="12.5" cy="10" r="1"/><circle cx="7.5" cy="15" r="1"/><circle cx="12.5" cy="15" r="1"/>',timer:'<path d="M5.5 3h9M5.5 17h9"/><path d="M6.5 3c0 3.5 3.5 4.5 3.5 7s-3.5 3.5-3.5 7M13.5 3c0 3.5-3.5 4.5-3.5 7s3.5 3.5 3.5 7"/>',target:'<circle cx="10" cy="10" r="7"/><circle cx="10" cy="10" r="4"/><circle cx="10" cy="10" r="1"/>'},l=Object.keys(r);Object.freeze&&Object.freeze(l);function e(h){return String(h).replace(/[&<>"']/g,function(c){return c==="&"?"&amp;":c==="<"?"&lt;":c===">"?"&gt;":c==='"'?"&quot;":"&#x27;"})}function x(h,c){var p=typeof h=="string"&&Object.prototype.hasOwnProperty.call(r,h)?r[h]:"";if(!p)return"";var a=c&&typeof c=="object"?c:{},i=a.size===void 0?20:a.size,y=i===null?"":' width="'+e(i)+'" height="'+e(i)+'"',M=a.title;return'<svg viewBox="0 0 20 20"'+y+(M?' role="img"':' aria-hidden="true"')+' focusable="false">'+(M?"<title>"+e(M)+"</title>":"")+'<g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+p+"</g></svg>"}t.icon=x,t.ICON_NAMES=l})(typeof globalThis<"u"?globalThis:this);