@vibes.diy/base 14.3.359 → 14.3.361

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.
@@ -6,7 +6,7 @@ export declare const CODE_DRILL_TITLES: Readonly<{
6
6
  readonly details: "App details";
7
7
  readonly help: "Help";
8
8
  }>;
9
- export declare const CODE_CARD_CSS = "\n[data-vibe-menu] .vm-prompt-request { margin: 0 0 var(--space-14); font: 400 16px/1.3 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }\n/* The first build's request (PromptRequest, #7660) clamps to three lines so the\n status and expected-time bar stay on the first phone screen; \"Show all\" opens it. */\n[data-vibe-menu] .vm-prompt-request.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n[data-vibe-menu] .vm-prompt-more { display: block; margin: calc(var(--space-12) * -1) 0 var(--space-14); padding: 0; font: 700 12px/1.6 var(--font-tab); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); cursor: pointer; }\n[data-vibe-menu] .vm-prompt-more:hover { color: var(--ink); }\n[data-vibe-menu] .vm-prompt-files { display: grid; gap: var(--space-12); margin-top: var(--space-16); }\n[data-vibe-menu] .vm-prompt-attached { margin-top: var(--space-2); font: 400 13px/1.4 var(--font-display); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }\n[data-vibe-menu] .vm-prompt-detail { font: 400 13px/1.4 var(--font-display); color: var(--muted); margin: var(--space-12) 0; overflow-wrap: anywhere; }\n[data-vibe-menu] .vm-prompt .vm-prompt-stop { flex: none; width: auto; height: 28px; margin-top: 0; }\n[data-vibe-menu] .vm-prompt-status { display: flex; align-items: center; gap: var(--space-12); border-top: var(--stroke-rule) solid var(--line-card); padding-top: var(--space-16); margin-bottom: var(--space-16); font: 400 14px/1.4 var(--font-display); color: var(--muted); }\n[data-vibe-menu] .vm-code .vm-moments { margin-bottom: var(--space-14); }\n/* The guest's Keep this app line (#7789): one quiet line in the card's flow\n above the composer, its button an inline text link. */\n[data-vibe-menu] .vm-keep-app { margin: 0 0 var(--space-12); line-height: 1.4; }\n[data-vibe-menu] .vm-keep-app > strong { color: var(--ink); font-weight: 700; }\n[data-vibe-menu] .vm-guest-build { margin: var(--space-8) 0 var(--space-12); line-height: 1.4; }\n[data-vibe-menu] .vm-guest-build > strong { color: var(--ink); font-weight: 700; }\n/* A guest's first build (#9462): the note and the build ask that later takes its\n place share one grid cell, the note kept as an invisible spacer under the ask,\n so the slot is always the taller of the two and the swap moves no line above it. */\n[data-vibe-menu] .vm-guest-slot { display: grid; }\n[data-vibe-menu] .vm-guest-slot > * { grid-area: 1 / 1; }\n/* An account's first build (#9641): the build ask's own room, held the same way. */\n[data-vibe-menu] .vm-ask-slot { display: grid; }\n[data-vibe-menu] .vm-ask-slot > * { grid-area: 1 / 1; }\n[data-vibe-menu] .vm-keep-app-cta { display: inline; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }\n[data-vibe-menu] .vm-code .vm-suggestions { margin-bottom: var(--space-14); }\n[data-vibe-menu] .vm-codemode { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; }\n[data-vibe-menu] .vm-codemode[data-fill] { flex: 1 1 auto; }\n/* The pinned top (kicker, composer, moment) keeps to half the Code mode card\n (80cqh) and scrolls on its own past that, so on a short frame (phone\n landscape) a multi-line composer stays reachable and the tab strip stays in\n the card. At normal sizes it never reaches the cap: only the tab body scrolls. */\n[data-vibe-menu] .vm-codemode-top { flex: none; max-height: 40cqh; overflow-y: auto; overscroll-behavior: contain; }\n[data-vibe-menu] .vm-codemode .vm-composer,\n[data-vibe-menu] .vm-codemode .vm-moments { margin-bottom: 10px; }\n\n/* The build ask (#8951): the agent's one question under the first build's live\n line, in the live line's own type. The card's composer below takes the answer;\n nothing is focused until a tap, so the keyboard stays closed while the first\n look plays. */\n[data-vibe-menu] .vm-build-ask { display: flex; align-items: flex-start; gap: var(--space-8); margin: var(--space-8) 0 var(--space-10); }\n[data-vibe-menu] .vm-build-ask-q { flex: 1; min-width: 0; margin: 0; padding: 0; text-align: left; font: 400 16px/1.3 var(--font-display); color: var(--ink); text-wrap: pretty; cursor: text; }\n[data-vibe-menu] .vm-build-ask-x { flex: none; width: 28px; height: 28px; padding: 0; font: 400 18px/1 var(--font-tab); color: var(--muted); cursor: pointer; }\n";
9
+ export declare const CODE_CARD_CSS = "\n[data-vibe-menu] .vm-prompt-request { margin: 0 0 var(--space-14); font: 400 16px/1.3 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }\n/* The first build's request (PromptRequest, #7660) clamps to three lines so the\n status and expected-time bar stay on the first phone screen; \"Show all\" opens it. */\n[data-vibe-menu] .vm-prompt-request.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n[data-vibe-menu] .vm-prompt-more { display: block; margin: calc(var(--space-12) * -1) 0 var(--space-14); padding: 0; font: 700 12px/1.6 var(--font-tab); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); cursor: pointer; }\n[data-vibe-menu] .vm-prompt-more:hover { color: var(--ink); }\n[data-vibe-menu] .vm-prompt-files { display: grid; gap: var(--space-12); margin-top: var(--space-16); }\n[data-vibe-menu] .vm-prompt-attached { margin-top: var(--space-2); font: 400 13px/1.4 var(--font-display); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }\n[data-vibe-menu] .vm-prompt-detail { font: 400 13px/1.4 var(--font-display); color: var(--muted); margin: var(--space-12) 0; overflow-wrap: anywhere; }\n[data-vibe-menu] .vm-prompt .vm-prompt-stop { flex: none; width: auto; height: 28px; margin-top: 0; }\n[data-vibe-menu] .vm-prompt-status { display: flex; align-items: center; gap: var(--space-12); border-top: var(--stroke-rule) solid var(--line-card); padding-top: var(--space-16); margin-bottom: var(--space-16); font: 400 14px/1.4 var(--font-display); color: var(--muted); }\n[data-vibe-menu] .vm-code .vm-moments { margin-bottom: var(--space-14); }\n/* The guest's Keep this app line (#7789): one quiet line in the card's flow\n above the composer, its button an inline text link. */\n[data-vibe-menu] .vm-keep-app { margin: 0 0 var(--space-12); line-height: 1.4; }\n[data-vibe-menu] .vm-keep-app > strong { color: var(--ink); font-weight: 700; }\n[data-vibe-menu] .vm-guest-build { margin: var(--space-8) 0 var(--space-12); line-height: 1.4; }\n[data-vibe-menu] .vm-guest-build > strong { color: var(--ink); font-weight: 700; }\n/* A guest's first build (#9462): the note and the build ask that later takes its\n place share one grid cell, the note kept as an invisible spacer under the ask,\n so the slot is always the taller of the two and the swap moves no line above it. */\n[data-vibe-menu] .vm-guest-slot { display: grid; }\n[data-vibe-menu] .vm-guest-slot > * { grid-area: 1 / 1; }\n/* An account's first build (#9641): the build ask's own room, held the same way. */\n[data-vibe-menu] .vm-ask-slot { display: grid; }\n[data-vibe-menu] .vm-ask-slot > * { grid-area: 1 / 1; }\n[data-vibe-menu] .vm-keep-app-cta { display: inline; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }\n/* The owner's check row (#9245): a muted line with a glyph, its button an inline\n text link kept on one line with its separator. */\n[data-vibe-menu] .vm-check { margin: 0 0 var(--space-14); }\n[data-vibe-menu] p.vm-check-row { display: flex; align-items: center; margin: 0; min-width: 0; white-space: nowrap; font: 400 14px/1.4 var(--font-display); color: var(--muted); }\n[data-vibe-menu] p.vm-check-row .vm-glyph { display: inline-block; flex: none; width: 14px; height: 14px; margin-right: var(--space-8); }\n[data-vibe-menu] .vm-check strong { color: var(--ink); font-weight: 700; }\n[data-vibe-menu] .vm-check.is-clear p.vm-check-row .vm-glyph { color: var(--ink); }\n/* One line at rest: the verdict gives way (ellipsis) before the button ever wraps. */\n[data-vibe-menu] .vm-check-sum { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n[data-vibe-menu] button.vm-check-toggle { padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; background: none; border: 0; }\n[data-vibe-menu] .vm-check-act-wrap { flex: none; white-space: nowrap; }\n[data-vibe-menu] button.vm-check-act { display: inline; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; }\n[data-vibe-menu] .vm-check-detail { margin: var(--space-6) 0 0 calc(14px + var(--space-8)); font: 400 13px/1.45 var(--font-display); color: var(--muted); }\n[data-vibe-menu] .vm-check-detail ul { margin: 0; padding: 0; list-style: none; }\n[data-vibe-menu] .vm-check-detail li { overflow-wrap: anywhere; }\n[data-vibe-menu] p.vm-check-covers { margin: var(--space-6) 0 0; }\n[data-vibe-menu] p.vm-check-row[aria-busy=\"true\"] .vm-glyph { animation: vm-check-spin 1.4s linear infinite; }\n@keyframes vm-check-spin { to { transform: rotate(360deg); } }\n@media (prefers-reduced-motion: reduce) { [data-vibe-menu] p.vm-check-row[aria-busy=\"true\"] .vm-glyph { animation: none; } }\n[data-vibe-menu] .vm-code .vm-suggestions { margin-bottom: var(--space-14); }\n[data-vibe-menu] .vm-codemode { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; }\n[data-vibe-menu] .vm-codemode[data-fill] { flex: 1 1 auto; }\n/* The pinned top (kicker, composer, moment) keeps to half the Code mode card\n (80cqh) and scrolls on its own past that, so on a short frame (phone\n landscape) a multi-line composer stays reachable and the tab strip stays in\n the card. At normal sizes it never reaches the cap: only the tab body scrolls. */\n[data-vibe-menu] .vm-codemode-top { flex: none; max-height: 40cqh; overflow-y: auto; overscroll-behavior: contain; }\n[data-vibe-menu] .vm-codemode .vm-composer,\n[data-vibe-menu] .vm-codemode .vm-moments { margin-bottom: 10px; }\n\n/* The build ask (#8951): the agent's one question under the first build's live\n line, in the live line's own type. The card's composer below takes the answer;\n nothing is focused until a tap, so the keyboard stays closed while the first\n look plays. */\n[data-vibe-menu] .vm-build-ask { display: flex; align-items: flex-start; gap: var(--space-8); margin: var(--space-8) 0 var(--space-10); }\n[data-vibe-menu] .vm-build-ask-q { flex: 1; min-width: 0; margin: 0; padding: 0; text-align: left; font: 400 16px/1.3 var(--font-display); color: var(--ink); text-wrap: pretty; cursor: text; }\n[data-vibe-menu] .vm-build-ask-x { flex: none; width: 28px; height: 28px; padding: 0; font: 400 18px/1 var(--font-tab); color: var(--muted); cursor: pointer; }\n";
10
10
  export declare const CODE_SUMMARY_LINE_CSS = "\n[data-vibe-menu] .vm-code.vm-ctab .vm-moment.is-summary > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n";
11
11
  export interface CodeCardProps {
12
12
  readonly viewer: ViewerSlice;
@@ -9,6 +9,7 @@ import { Suggestions } from "../parts/Chip.js";
9
9
  import { Composer, latestStopArm } from "../parts/Composer.js";
10
10
  import { DoneButton } from "../parts/DoneButton.js";
11
11
  import { KeepAppLine } from "../parts/KeepAppLine.js";
12
+ import { CheckRowLine } from "../parts/CheckRowLine.js";
12
13
  import { BUILD_ASK_LINE_CSS, BuildAskLine, BuildAskRoom } from "../parts/BuildAskLine.js";
13
14
  import { AgentLog, MomentLine } from "../parts/MomentLine.js";
14
15
  import { PromptRequest } from "../parts/PromptRequest.js";
@@ -49,6 +50,25 @@ export const CODE_CARD_CSS = `
49
50
  [data-vibe-menu] .vm-ask-slot { display: grid; }
50
51
  [data-vibe-menu] .vm-ask-slot > * { grid-area: 1 / 1; }
51
52
  [data-vibe-menu] .vm-keep-app-cta { display: inline; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
53
+ /* The owner's check row (#9245): a muted line with a glyph, its button an inline
54
+ text link kept on one line with its separator. */
55
+ [data-vibe-menu] .vm-check { margin: 0 0 var(--space-14); }
56
+ [data-vibe-menu] p.vm-check-row { display: flex; align-items: center; margin: 0; min-width: 0; white-space: nowrap; font: 400 14px/1.4 var(--font-display); color: var(--muted); }
57
+ [data-vibe-menu] p.vm-check-row .vm-glyph { display: inline-block; flex: none; width: 14px; height: 14px; margin-right: var(--space-8); }
58
+ [data-vibe-menu] .vm-check strong { color: var(--ink); font-weight: 700; }
59
+ [data-vibe-menu] .vm-check.is-clear p.vm-check-row .vm-glyph { color: var(--ink); }
60
+ /* One line at rest: the verdict gives way (ellipsis) before the button ever wraps. */
61
+ [data-vibe-menu] .vm-check-sum { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
62
+ [data-vibe-menu] button.vm-check-toggle { padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; background: none; border: 0; }
63
+ [data-vibe-menu] .vm-check-act-wrap { flex: none; white-space: nowrap; }
64
+ [data-vibe-menu] button.vm-check-act { display: inline; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; }
65
+ [data-vibe-menu] .vm-check-detail { margin: var(--space-6) 0 0 calc(14px + var(--space-8)); font: 400 13px/1.45 var(--font-display); color: var(--muted); }
66
+ [data-vibe-menu] .vm-check-detail ul { margin: 0; padding: 0; list-style: none; }
67
+ [data-vibe-menu] .vm-check-detail li { overflow-wrap: anywhere; }
68
+ [data-vibe-menu] p.vm-check-covers { margin: var(--space-6) 0 0; }
69
+ [data-vibe-menu] p.vm-check-row[aria-busy="true"] .vm-glyph { animation: vm-check-spin 1.4s linear infinite; }
70
+ @keyframes vm-check-spin { to { transform: rotate(360deg); } }
71
+ @media (prefers-reduced-motion: reduce) { [data-vibe-menu] p.vm-check-row[aria-busy="true"] .vm-glyph { animation: none; } }
52
72
  [data-vibe-menu] .vm-code .vm-suggestions { margin-bottom: var(--space-14); }
53
73
  [data-vibe-menu] .vm-codemode { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; }
54
74
  [data-vibe-menu] .vm-codemode[data-fill] { flex: 1 1 auto; }
@@ -162,6 +182,8 @@ export function CodeCard(props) {
162
182
  React.createElement(PromptRequest, { text: request }))) : null;
163
183
  const composerNode = React.createElement(Composer, { composer: composer, draft: draft, placeholder: placeholder, fieldRef: composerField });
164
184
  const keepAppNode = code.keepApp !== undefined && code.keepApp !== null ? (React.createElement(KeepAppLine, { keepApp: code.keepApp, visible: props.open === true })) : null;
185
+ const checkRow = editor ? (code.checkRow ?? null) : null;
186
+ const checkRowNode = checkRow !== null ? React.createElement(CheckRowLine, { check: checkRow, visible: props.open === true }) : null;
165
187
  const buildAsk = editor ? (code.buildAsk ?? null) : null;
166
188
  const askOpen = buildAsk !== null;
167
189
  const buildAskNode = buildAsk !== null ? (React.createElement(BuildAskLine, { ask: buildAsk, visible: props.open === true, onAnswer: () => {
@@ -380,6 +402,7 @@ export function CodeCard(props) {
380
402
  askSlot,
381
403
  saveRow,
382
404
  showComposer ? keepAppNode : null,
405
+ checkRowNode !== null && showComposer && firstBuild === false ? checkRowNode : null,
383
406
  React.createElement("div", { className: "vm-ctab-foot" },
384
407
  mainAction,
385
408
  reserveRow ? React.createElement(CodeTabRow, { items: ["agentLog"], active: null, onPick: () => undefined, reserve: true }) : row)));
@@ -33,6 +33,50 @@ export declare const KEEP_APP_LINE: Readonly<{
33
33
  body: "create a free account to come back to it from any device and share it with your name on it.";
34
34
  action: "Create account";
35
35
  }>;
36
+ export declare const CHECK_ROW: Readonly<{
37
+ unchecked: "Check this version";
38
+ running: "Checking this version…";
39
+ failed: "No result yet";
40
+ check: "Check";
41
+ again: "Check again";
42
+ retry: "Try again";
43
+ checkThis: "Check this one";
44
+ allClear: "all clear";
45
+ seeThem: "See them";
46
+ notRun: "not checked this time";
47
+ covers: "Reads this version's code, rules and backend log. To see the whole path, try the app yourself.";
48
+ }>;
49
+ export interface CheckRowFindings {
50
+ readonly opens: {
51
+ readonly clean: boolean;
52
+ readonly findings: number;
53
+ readonly first?: {
54
+ readonly file: string;
55
+ readonly line: number;
56
+ };
57
+ };
58
+ readonly access: {
59
+ readonly admitted: number;
60
+ readonly total: number;
61
+ readonly thrown: number;
62
+ readonly truncated: boolean;
63
+ } | {
64
+ readonly unavailable: true;
65
+ } | null;
66
+ readonly backend: {
67
+ readonly errors: number;
68
+ readonly days: number;
69
+ } | null;
70
+ }
71
+ export interface CheckRowDetail {
72
+ readonly label: string;
73
+ readonly text: string;
74
+ readonly ran: boolean;
75
+ readonly clear: boolean;
76
+ }
77
+ export declare function checkRowDetails(found: CheckRowFindings): readonly CheckRowDetail[];
78
+ export declare function checkRowAllClear(found: CheckRowFindings): boolean;
79
+ export declare function checkRowVerdict(found: CheckRowFindings): string;
36
80
  export declare const GUEST_BUILD_NOTE: Readonly<{
37
81
  lead: "You’re building as a guest,";
38
82
  body: "and your first change is free too. A free account keeps it going with 1,000 credits every month.";
@@ -32,6 +32,72 @@ export const KEEP_APP_LINE = Object.freeze({
32
32
  body: "create a free account to come back to it from any device and share it with your name on it.",
33
33
  action: "Create account",
34
34
  });
35
+ export const CHECK_ROW = Object.freeze({
36
+ unchecked: "Check this version",
37
+ running: "Checking this version…",
38
+ failed: "No result yet",
39
+ check: "Check",
40
+ again: "Check again",
41
+ retry: "Try again",
42
+ checkThis: "Check this one",
43
+ allClear: "all clear",
44
+ seeThem: "See them",
45
+ notRun: "not checked this time",
46
+ covers: "Reads this version's code, rules and backend log. To see the whole path, try the app yourself.",
47
+ });
48
+ function plural(n, one, many) {
49
+ return `${n} ${n === 1 ? one : many}`;
50
+ }
51
+ export function checkRowDetails(found) {
52
+ const out = [];
53
+ const first = found.opens.first;
54
+ const where = first === undefined ? "" : ` in ${first.file.replace(/^\/+/, "")}:${first.line}`;
55
+ if (found.opens.clean && found.opens.findings === 0)
56
+ out.push({ label: "Start-up code", text: "clean", ran: true, clear: true });
57
+ else if (found.opens.findings <= 1)
58
+ out.push({ label: "Start-up code", text: `1 fix to make${where}`, ran: true, clear: false });
59
+ else
60
+ out.push({ label: "Start-up code", text: `${found.opens.findings} fixes to make, first${where}`, ran: true, clear: false });
61
+ const access = found.access;
62
+ if (access !== null) {
63
+ if ("unavailable" in access)
64
+ out.push({ label: "Rules", text: CHECK_ROW.notRun, ran: false, clear: false });
65
+ else if (access.total === 0)
66
+ out.push({ label: "Rules", text: "no records yet to run them over", ran: true, clear: true });
67
+ else {
68
+ const records = access.truncated ? "newest records" : "records";
69
+ if (access.thrown > 0)
70
+ out.push({ label: "Rules", text: `${access.thrown} of ${access.total} ${records} hit an error`, ran: true, clear: false });
71
+ else
72
+ out.push({ label: "Rules", text: `let in ${access.admitted} of ${access.total} ${records}`, ran: true, clear: true });
73
+ }
74
+ }
75
+ const backend = found.backend;
76
+ if (backend !== null) {
77
+ out.push(backend.errors === 0
78
+ ? { label: "Backend", text: `no errors in ${backend.days} days`, ran: true, clear: true }
79
+ : {
80
+ label: "Backend",
81
+ text: `${plural(backend.errors, "error", "errors")} in ${backend.days} days`,
82
+ ran: true,
83
+ clear: false,
84
+ });
85
+ }
86
+ return out;
87
+ }
88
+ export function checkRowAllClear(found) {
89
+ return checkRowDetails(found).every((d) => d.ran && d.clear);
90
+ }
91
+ export function checkRowVerdict(found) {
92
+ const details = checkRowDetails(found);
93
+ const toLookAt = details.filter((d) => d.ran && d.clear === false).length;
94
+ if (toLookAt > 0)
95
+ return `${toLookAt} to look at`;
96
+ const ran = details.filter((d) => d.ran).length;
97
+ if (ran < details.length)
98
+ return `${ran} of ${details.length} checked`;
99
+ return CHECK_ROW.allClear;
100
+ }
35
101
  export const GUEST_BUILD_NOTE = Object.freeze({
36
102
  lead: "You’re building as a guest,",
37
103
  body: "and your first change is free too. A free account keeps it going with 1,000 credits every month.",
@@ -30,6 +30,7 @@ export * from "./parts/GrantControls.js";
30
30
  export * from "./parts/MemberRow.js";
31
31
  export * from "./parts/SaveAskLine.js";
32
32
  export * from "./parts/KeepAppLine.js";
33
+ export * from "./parts/CheckRowLine.js";
33
34
  export * from "./parts/BuildAskLine.js";
34
35
  export * from "./shell/shell.styles.js";
35
36
  export * from "./parts/SectionStrip.js";
@@ -30,6 +30,7 @@ export * from "./parts/GrantControls.js";
30
30
  export * from "./parts/MemberRow.js";
31
31
  export * from "./parts/SaveAskLine.js";
32
32
  export * from "./parts/KeepAppLine.js";
33
+ export * from "./parts/CheckRowLine.js";
33
34
  export * from "./parts/BuildAskLine.js";
34
35
  export * from "./shell/shell.styles.js";
35
36
  export * from "./parts/SectionStrip.js";
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import type { CheckRowSlice } from "../slices.js";
3
+ export declare function CheckRowLine(props: {
4
+ readonly check: CheckRowSlice;
5
+ readonly visible: boolean;
6
+ }): React.ReactElement;
@@ -0,0 +1,85 @@
1
+ import * as React from "react";
2
+ import { CHECK_ROW, checkRowDetails, checkRowVerdict } from "../copy.js";
3
+ import { Glyph } from "./Glyph.js";
4
+ export function CheckRowLine(props) {
5
+ const { check } = props;
6
+ const onShownRef = React.useRef(check.onShown);
7
+ onShownRef.current = check.onShown;
8
+ const said = `${check.status}|${check.last?.version ?? ""}|${check.last?.current ?? ""}|${check.last?.when ?? ""}`;
9
+ React.useEffect(() => {
10
+ if (props.visible)
11
+ onShownRef.current?.();
12
+ }, [props.visible, said]);
13
+ const detailId = React.useId();
14
+ const last = check.last;
15
+ const result = check.status !== "running" && last !== null && last.current === true ? last : null;
16
+ const resultKey = result === null ? "" : result.id;
17
+ const [openFor, setOpenFor] = React.useState(null);
18
+ const open = result !== null && openFor === resultKey;
19
+ const toggle = () => {
20
+ const next = open === false;
21
+ setOpenFor(next ? resultKey : null);
22
+ if (next)
23
+ check.onDetails?.();
24
+ };
25
+ const act = (label, onPress, expands) => (React.createElement("span", { className: "vm-check-act-wrap" },
26
+ React.createElement("span", { "aria-hidden": "true" }, " · "),
27
+ React.createElement("button", { type: "button", className: "vm-check-act", onClick: onPress, ...(expands === true ? { "aria-expanded": open, "aria-controls": detailId } : {}) }, label)));
28
+ if (check.status === "running") {
29
+ return (React.createElement("div", { className: "vm-check", "data-check-row": "running" },
30
+ React.createElement("p", { className: "vm-sub vm-check-row", "aria-busy": "true" },
31
+ React.createElement(Glyph, { name: "refresh" }),
32
+ React.createElement("span", { className: "vm-check-sum" }, CHECK_ROW.running))));
33
+ }
34
+ if (last === null) {
35
+ const failed = check.status === "failed";
36
+ return (React.createElement("div", { className: "vm-check", "data-check-row": failed ? "failed" : "unchecked" },
37
+ React.createElement("p", { className: "vm-sub vm-check-row" },
38
+ React.createElement(Glyph, { name: "shield" }),
39
+ React.createElement("span", { className: "vm-check-sum" }, failed ? CHECK_ROW.failed : CHECK_ROW.unchecked),
40
+ act(failed ? CHECK_ROW.retry : CHECK_ROW.check, check.onCheck))));
41
+ }
42
+ if (result === null) {
43
+ return (React.createElement("div", { className: "vm-check", "data-check-row": "older" },
44
+ React.createElement("p", { className: "vm-sub vm-check-row" },
45
+ React.createElement(Glyph, { name: "shield" }),
46
+ React.createElement("span", { className: "vm-check-sum" },
47
+ React.createElement("strong", null,
48
+ "v",
49
+ last.version),
50
+ " checked ",
51
+ last.when),
52
+ act(CHECK_ROW.checkThis, check.onCheck))));
53
+ }
54
+ const verdict = checkRowVerdict(result);
55
+ const clear = verdict === CHECK_ROW.allClear;
56
+ const found = checkRowDetails(result).some((d) => d.ran && d.clear === false);
57
+ const rowState = clear ? "clear" : found ? "found" : "partial";
58
+ const failedAgain = check.status === "failed";
59
+ return (React.createElement("div", { className: `vm-check${clear ? " is-clear" : ""}`, "data-check-row": rowState, "data-open": open ? "" : undefined },
60
+ React.createElement("p", { className: "vm-sub vm-check-row" },
61
+ React.createElement(Glyph, { name: clear ? "check" : "shield" }),
62
+ React.createElement("button", { type: "button", className: "vm-check-sum vm-check-toggle", onClick: toggle, "aria-expanded": open, "aria-controls": detailId },
63
+ React.createElement("strong", null,
64
+ "v",
65
+ result.version),
66
+ React.createElement("span", { "aria-hidden": "true" }, " \u00B7 "),
67
+ verdict,
68
+ React.createElement("span", { "aria-hidden": "true" }, " \u00B7 "),
69
+ result.when),
70
+ found && failedAgain === false
71
+ ? act(CHECK_ROW.seeThem, toggle, true)
72
+ : act(failedAgain ? CHECK_ROW.retry : CHECK_ROW.again, check.onCheck)),
73
+ open ? (React.createElement("div", { className: "vm-check-detail", id: detailId, "data-check-detail": "" },
74
+ React.createElement("ul", null, checkRowDetails(result).map((d) => (React.createElement("li", { key: d.label, "data-clear": d.clear ? "" : undefined, "data-ran": d.ran ? "" : undefined },
75
+ React.createElement("strong", null,
76
+ d.label,
77
+ ":"),
78
+ " ",
79
+ d.text)))),
80
+ React.createElement("p", { className: "vm-check-covers" },
81
+ CHECK_ROW.covers,
82
+ found === false ? null : (React.createElement(React.Fragment, null,
83
+ " ",
84
+ React.createElement("button", { type: "button", className: "vm-check-act", onClick: check.onCheck }, CHECK_ROW.again)))))) : null));
85
+ }
@@ -4,6 +4,7 @@ import type { Banner, MenuEvent, MenuState, MenuView } from "./menu-state.js";
4
4
  import type { MomentItem } from "./moments.js";
5
5
  import type { ViewerRole } from "./open-resolver.js";
6
6
  import type { CodeTab } from "./code-tabs.js";
7
+ import type { CheckRowFindings } from "./copy.js";
7
8
  import type { AccessPosture, AccessToggleState } from "./parts/AccessToggle.js";
8
9
  import type { GrantData } from "./parts/GrantControls.js";
9
10
  import type { LabeledMenuVariant } from "./parts/LabeledChoices.js";
@@ -120,6 +121,7 @@ export interface CodeSlice {
120
121
  };
121
122
  readonly editText?: EditTextSlice | null;
122
123
  readonly keepApp?: KeepAppSlice | null;
124
+ readonly checkRow?: CheckRowSlice | null;
123
125
  readonly buildAsk?: BuildAskSlice | null;
124
126
  readonly guestBuild?: boolean;
125
127
  readonly firstBuildHandoff?: boolean;
@@ -294,6 +296,19 @@ export interface KeepAppSlice {
294
296
  onCreateAccount(): void;
295
297
  onShown?(): void;
296
298
  }
299
+ export interface CheckRowResult extends CheckRowFindings {
300
+ readonly id: string;
301
+ readonly version: number;
302
+ readonly when: string;
303
+ readonly current: boolean;
304
+ }
305
+ export interface CheckRowSlice {
306
+ readonly status: "idle" | "running" | "failed";
307
+ readonly last: CheckRowResult | null;
308
+ onCheck(): void;
309
+ onShown?(): void;
310
+ onDetails?(): void;
311
+ }
297
312
  export interface SaveAskSlice {
298
313
  level: "soft" | "strong";
299
314
  appName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/base",
3
- "version": "14.3.359",
3
+ "version": "14.3.361",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -10,10 +10,10 @@
10
10
  "dependencies": {
11
11
  "@adviser/cement": "~0.5.37",
12
12
  "@emotion/css": "~11.13.5",
13
- "@vibes.diy/api-types": "14.3.359",
14
- "@vibes.diy/use-vibes-types": "14.3.359",
15
- "@vibes.diy/vibe-runtime": "14.3.359",
16
- "@vibes.diy/vibe-types": "14.3.359",
13
+ "@vibes.diy/api-types": "14.3.361",
14
+ "@vibes.diy/use-vibes-types": "14.3.361",
15
+ "@vibes.diy/vibe-runtime": "14.3.361",
16
+ "@vibes.diy/vibe-types": "14.3.361",
17
17
  "arktype": "~2.2.9",
18
18
  "officeparser": "~8.7.1",
19
19
  "qrcode-generator": "~2.0.4",