@flanksource/clicky-ui 0.3.82 → 0.3.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DateField.cjs.map +1 -1
- package/dist/components/DateField.d.ts +3 -2
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.js.map +1 -1
- package/dist/components/DatePicker.cjs +9 -61
- package/dist/components/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker.d.ts +5 -19
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +11 -63
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DateTimePicker.cjs +9 -78
- package/dist/components/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker.d.ts +5 -19
- package/dist/components/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker.js +11 -80
- package/dist/components/DateTimePicker.js.map +1 -1
- package/dist/components/calendar-grid.cjs +83 -0
- package/dist/components/calendar-grid.cjs.map +1 -0
- package/dist/components/calendar-grid.d.ts +9 -0
- package/dist/components/calendar-grid.d.ts.map +1 -0
- package/dist/components/calendar-grid.js +83 -0
- package/dist/components/calendar-grid.js.map +1 -0
- package/dist/components/date-input-field.cjs +88 -0
- package/dist/components/date-input-field.cjs.map +1 -0
- package/dist/components/date-input-field.d.ts +37 -0
- package/dist/components/date-input-field.d.ts.map +1 -0
- package/dist/components/date-input-field.js +88 -0
- package/dist/components/date-input-field.js.map +1 -0
- package/dist/components/date-math.cjs +67 -0
- package/dist/components/date-math.cjs.map +1 -0
- package/dist/components/date-math.d.ts +33 -0
- package/dist/components/date-math.d.ts.map +1 -0
- package/dist/components/date-math.js +60 -0
- package/dist/components/date-math.js.map +1 -0
- package/dist/components/date-picker-menu.cjs +129 -0
- package/dist/components/date-picker-menu.cjs.map +1 -0
- package/dist/components/date-picker-menu.d.ts +18 -0
- package/dist/components/date-picker-menu.d.ts.map +1 -0
- package/dist/components/date-picker-menu.js +129 -0
- package/dist/components/date-picker-menu.js.map +1 -0
- package/dist/components/json-schema-form-date-math.cjs +15 -11
- package/dist/components/json-schema-form-date-math.cjs.map +1 -1
- package/dist/components/json-schema-form-date-math.d.ts +3 -0
- package/dist/components/json-schema-form-date-math.d.ts.map +1 -1
- package/dist/components/json-schema-form-date-math.js +15 -12
- package/dist/components/json-schema-form-date-math.js.map +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/data/PromptDialog.cjs +19 -5
- package/dist/data/PromptDialog.cjs.map +1 -1
- package/dist/data/PromptDialog.d.ts +15 -1
- package/dist/data/PromptDialog.d.ts.map +1 -1
- package/dist/data/PromptDialog.js +19 -5
- package/dist/data/PromptDialog.js.map +1 -1
- package/dist/data/PromptIndicator.cjs +3 -2
- package/dist/data/PromptIndicator.cjs.map +1 -1
- package/dist/data/PromptIndicator.d.ts +4 -1
- package/dist/data/PromptIndicator.d.ts.map +1 -1
- package/dist/data/PromptIndicator.js +3 -2
- package/dist/data/PromptIndicator.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +155 -110
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +155 -110
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.cjs +109 -46
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +110 -47
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +84 -63
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +84 -63
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/adapter.cjs.map +1 -1
- package/dist/data/test-runner/adapter.d.ts +2 -2
- package/dist/data/test-runner/adapter.d.ts.map +1 -1
- package/dist/data/test-runner/adapter.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +62 -10
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts +52 -9
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +60 -11
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +1 -1
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/verification/StepFilesView.cjs +90 -0
- package/dist/data/verification/StepFilesView.cjs.map +1 -0
- package/dist/data/verification/StepFilesView.d.ts +9 -0
- package/dist/data/verification/StepFilesView.d.ts.map +1 -0
- package/dist/data/verification/StepFilesView.js +90 -0
- package/dist/data/verification/StepFilesView.js.map +1 -0
- package/dist/data/verification/adapterViews.cjs +129 -69
- package/dist/data/verification/adapterViews.cjs.map +1 -1
- package/dist/data/verification/adapterViews.d.ts +3 -1
- package/dist/data/verification/adapterViews.d.ts.map +1 -1
- package/dist/data/verification/adapterViews.js +130 -70
- package/dist/data/verification/adapterViews.js.map +1 -1
- package/dist/data/verification/adapters.cjs +9 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts +2 -0
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +11 -2
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/verification/index.d.ts +2 -1
- package/dist/data/verification/index.d.ts.map +1 -1
- package/dist/data/verification/stepKind.cjs +63 -7
- package/dist/data/verification/stepKind.cjs.map +1 -1
- package/dist/data/verification/stepKind.d.ts +55 -6
- package/dist/data/verification/stepKind.d.ts.map +1 -1
- package/dist/data/verification/stepKind.js +62 -8
- package/dist/data/verification/stepKind.js.map +1 -1
- package/dist/data/verification/stepKindViews.cjs +318 -106
- package/dist/data/verification/stepKindViews.cjs.map +1 -1
- package/dist/data/verification/stepKindViews.d.ts +17 -6
- package/dist/data/verification/stepKindViews.d.ts.map +1 -1
- package/dist/data/verification/stepKindViews.js +319 -108
- package/dist/data/verification/stepKindViews.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +4 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +3 -2
- package/dist/hooks/use-prompts.cjs +52 -30
- package/dist/hooks/use-prompts.cjs.map +1 -1
- package/dist/hooks/use-prompts.d.ts +6 -0
- package/dist/hooks/use-prompts.d.ts.map +1 -1
- package/dist/hooks/use-prompts.js +52 -30
- package/dist/hooks/use-prompts.js.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.js +4 -3
- package/dist/runtime/barrels.json +5874 -5867
- package/dist/runtime/importmap.json +2175 -2170
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const require_UiDownload = require("../../icons/components/UiDownload.cjs");
|
|
2
|
+
const require_UiExternalLink = require("../../icons/components/UiExternalLink.cjs");
|
|
3
|
+
const require_stepKind = require("./stepKind.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
// src/data/verification/StepFilesView.tsx
|
|
6
|
+
var PREVIEW_HEIGHT = "h-[calc(100cqh-4.5rem)] min-h-96";
|
|
7
|
+
var LINK = "inline-flex items-center gap-1 text-xs text-primary hover:underline";
|
|
8
|
+
function FilePreview({ file, url, preview }) {
|
|
9
|
+
const label = file.title ?? file.name;
|
|
10
|
+
switch (preview) {
|
|
11
|
+
case "html": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
12
|
+
src: url,
|
|
13
|
+
title: label,
|
|
14
|
+
sandbox: "allow-scripts",
|
|
15
|
+
className: `${PREVIEW_HEIGHT} w-full rounded border border-border bg-white`
|
|
16
|
+
});
|
|
17
|
+
case "pdf": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("object", {
|
|
18
|
+
data: url,
|
|
19
|
+
type: "application/pdf",
|
|
20
|
+
"aria-label": label,
|
|
21
|
+
className: `${PREVIEW_HEIGHT} w-full rounded border border-border`,
|
|
22
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
23
|
+
className: "text-xs text-muted-foreground",
|
|
24
|
+
children: "This browser cannot preview PDFs; use the download link."
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
case "image": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
28
|
+
src: url,
|
|
29
|
+
alt: label,
|
|
30
|
+
className: "max-h-96 max-w-full rounded border border-border object-contain"
|
|
31
|
+
});
|
|
32
|
+
case "none": return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Every attached file, previewed by mime type, each with a download link (and an open link for HTML). */
|
|
36
|
+
function StepFilesView({ files, fileUrl }) {
|
|
37
|
+
if (files.length === 0) return null;
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
39
|
+
className: "min-w-0 space-y-3",
|
|
40
|
+
"data-step-files": "",
|
|
41
|
+
children: files.map((file) => {
|
|
42
|
+
const url = fileUrl(file.path);
|
|
43
|
+
const preview = require_stepKind.previewKind(file.mime);
|
|
44
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("figure", {
|
|
45
|
+
className: "min-w-0 space-y-1.5",
|
|
46
|
+
"data-step-file": file.name,
|
|
47
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("figcaption", {
|
|
48
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
51
|
+
className: "text-sm font-medium",
|
|
52
|
+
"data-file-title": "",
|
|
53
|
+
children: file.title ?? file.name
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
56
|
+
className: "text-[11px] text-muted-foreground",
|
|
57
|
+
children: [
|
|
58
|
+
file.name,
|
|
59
|
+
" · ",
|
|
60
|
+
file.mime
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
preview === "html" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
64
|
+
className: LINK,
|
|
65
|
+
href: url,
|
|
66
|
+
target: "_blank",
|
|
67
|
+
rel: "noopener noreferrer",
|
|
68
|
+
"data-file-open": "",
|
|
69
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UiExternalLink.UiExternalLink, { "aria-hidden": true }), " Open"]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
72
|
+
className: LINK,
|
|
73
|
+
href: url,
|
|
74
|
+
download: file.name,
|
|
75
|
+
"data-file-download": "",
|
|
76
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UiDownload.UiDownload, { "aria-hidden": true }), " Download"]
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePreview, {
|
|
80
|
+
file,
|
|
81
|
+
url,
|
|
82
|
+
preview
|
|
83
|
+
})]
|
|
84
|
+
}, file.path);
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
exports.StepFilesView = StepFilesView;
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=StepFilesView.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepFilesView.cjs","names":["previewKind","UiExternalLink","UiDownload"],"sources":["../../../src/data/verification/StepFilesView.tsx"],"sourcesContent":["// Previews of the files a step attached (StepContext.AttachFile): a facet\n// step's html/pdf/png reports, or anything else a kind produced. The host owns\n// where the bytes live, so it passes `fileUrl(path)`; the view only decides how\n// each mime type is shown. HTML is untrusted output, so it runs in an iframe\n// sandboxed to scripts alone — no same-origin, forms, popups or top navigation.\n\nimport { UiDownload, UiExternalLink } from \"../../icons\";\nimport { previewKind, type FilePreview as Preview, type StepFile } from \"./stepKind\";\n\nexport type StepFilesViewProps = {\n files: StepFile[];\n /** The URL the host serves an attached file's `path` at, e.g. `/api/step-files?path=…`. */\n fileUrl: (path: string) => string;\n};\n\n// A report is the step's main evidence, so its preview fills the detail pane's\n// height (TestDetailPanel's size container, 100cqh) less the tab padding and the\n// file's caption row; outside a size container cqh falls back to the viewport.\nconst PREVIEW_HEIGHT = \"h-[calc(100cqh-4.5rem)] min-h-96\";\nconst LINK = \"inline-flex items-center gap-1 text-xs text-primary hover:underline\";\n\nfunction FilePreview({ file, url, preview }: { file: StepFile; url: string; preview: Preview }) {\n const label = file.title ?? file.name;\n switch (preview) {\n case \"html\":\n return <iframe src={url} title={label} sandbox=\"allow-scripts\" className={`${PREVIEW_HEIGHT} w-full rounded border border-border bg-white`} />;\n case \"pdf\":\n return (\n <object data={url} type=\"application/pdf\" aria-label={label} className={`${PREVIEW_HEIGHT} w-full rounded border border-border`}>\n <span className=\"text-xs text-muted-foreground\">This browser cannot preview PDFs; use the download link.</span>\n </object>\n );\n case \"image\":\n return <img src={url} alt={label} className=\"max-h-96 max-w-full rounded border border-border object-contain\" />;\n case \"none\":\n return null;\n }\n}\n\n/** Every attached file, previewed by mime type, each with a download link (and an open link for HTML). */\nexport function StepFilesView({ files, fileUrl }: StepFilesViewProps) {\n if (files.length === 0) return null;\n return (\n <div className=\"min-w-0 space-y-3\" data-step-files=\"\">\n {files.map((file) => {\n const url = fileUrl(file.path);\n const preview = previewKind(file.mime);\n return (\n <figure key={file.path} className=\"min-w-0 space-y-1.5\" data-step-file={file.name}>\n <figcaption className=\"flex flex-wrap items-center gap-x-3 gap-y-1\">\n <span className=\"text-sm font-medium\" data-file-title=\"\">{file.title ?? file.name}</span>\n <span className=\"text-[11px] text-muted-foreground\">{file.name} · {file.mime}</span>\n {preview === \"html\" && (\n <a className={LINK} href={url} target=\"_blank\" rel=\"noopener noreferrer\" data-file-open=\"\">\n <UiExternalLink aria-hidden /> Open\n </a>\n )}\n <a className={LINK} href={url} download={file.name} data-file-download=\"\">\n <UiDownload aria-hidden /> Download\n </a>\n </figcaption>\n <FilePreview file={file} url={url} preview={preview} />\n </figure>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;AAkBA,IAAM,iBAAiB;AACvB,IAAM,OAAO;AAEb,SAAS,YAAY,EAAE,MAAM,KAAK,WAA8D;CAC9F,MAAM,QAAQ,KAAK,SAAS,KAAK;CACjC,QAAQ,SAAR;EACE,KAAK,QACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GAAQ,KAAK;GAAK,OAAO;GAAO,SAAQ;GAAgB,WAAW,GAAG,eAAe;EAAiD,CAAA;EAC/I,KAAK,OACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GAAQ,MAAM;GAAK,MAAK;GAAkB,cAAY;GAAO,WAAW,GAAG,eAAe;GACxF,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAU;IAAgC,UAAA;GAA8D,CAAA;EACxG,CAAA;EAEZ,KAAK,SACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,KAAK;GAAK,KAAK;GAAO,WAAU;EAAmE,CAAA;EACjH,KAAK,QACH,OAAO;CACX;AACF;;AAGA,SAAgB,cAAc,EAAE,OAAO,WAA+B;CACpE,IAAI,MAAM,WAAW,GAAG,OAAO;CAC/B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EAAoB,mBAAgB;EAChD,UAAA,MAAM,KAAK,SAAS;GACnB,MAAM,MAAM,QAAQ,KAAK,IAAI;GAC7B,MAAM,UAAUA,iBAAAA,YAAY,KAAK,IAAI;GACrC,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;IAAwB,WAAU;IAAsB,kBAAgB,KAAK;IAA7E,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,cAAD;KAAY,WAAU;KAAtB,UAAA;MACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OAAM,WAAU;OAAsB,mBAAgB;OAAI,UAAA,KAAK,SAAS,KAAK;MAAW,CAAA;MACxF,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;OAAM,WAAU;OAAhB,UAAA;QAAqD,KAAK;QAAK;QAAI,KAAK;OAAW;;MAClF,YAAY,UACX,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;OAAG,WAAW;OAAM,MAAM;OAAK,QAAO;OAAS,KAAI;OAAsB,kBAAe;OAAxF,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD,EAAgB,eAAA,KAAa,CAAA,GAAC,OAC7B;;MAEL,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;OAAG,WAAW;OAAM,MAAM;OAAK,UAAU,KAAK;OAAM,sBAAmB;OAAvE,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD,EAAY,eAAA,KAAa,CAAA,GAAC,WACzB;;KACO;IACZ,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;KAAmB;KAAW;KAAc;IAAU,CAAA,CAChD;GAdK,GAAA,KAAK,IAcV;EAEZ,CAAC;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StepFile } from './stepKind.js';
|
|
2
|
+
export type StepFilesViewProps = {
|
|
3
|
+
files: StepFile[];
|
|
4
|
+
/** The URL the host serves an attached file's `path` at, e.g. `/api/step-files?path=…`. */
|
|
5
|
+
fileUrl: (path: string) => string;
|
|
6
|
+
};
|
|
7
|
+
/** Every attached file, previewed by mime type, each with a download link (and an open link for HTML). */
|
|
8
|
+
export declare function StepFilesView({ files, fileUrl }: StepFilesViewProps): import("react").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=StepFilesView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepFilesView.d.ts","sourceRoot":"","sources":["../../../src/data/verification/StepFilesView.tsx"],"names":[],"mappings":"AAOA,OAAO,EAA4C,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,2FAA2F;IAC3F,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACnC,CAAC;AA0BF,0GAA0G;AAC1G,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kBAAkB,sCA2BnE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { UiDownload } from "../../icons/components/UiDownload.js";
|
|
2
|
+
import { UiExternalLink } from "../../icons/components/UiExternalLink.js";
|
|
3
|
+
import { previewKind } from "./stepKind.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/data/verification/StepFilesView.tsx
|
|
6
|
+
var PREVIEW_HEIGHT = "h-[calc(100cqh-4.5rem)] min-h-96";
|
|
7
|
+
var LINK = "inline-flex items-center gap-1 text-xs text-primary hover:underline";
|
|
8
|
+
function FilePreview({ file, url, preview }) {
|
|
9
|
+
const label = file.title ?? file.name;
|
|
10
|
+
switch (preview) {
|
|
11
|
+
case "html": return /* @__PURE__ */ jsx("iframe", {
|
|
12
|
+
src: url,
|
|
13
|
+
title: label,
|
|
14
|
+
sandbox: "allow-scripts",
|
|
15
|
+
className: `${PREVIEW_HEIGHT} w-full rounded border border-border bg-white`
|
|
16
|
+
});
|
|
17
|
+
case "pdf": return /* @__PURE__ */ jsx("object", {
|
|
18
|
+
data: url,
|
|
19
|
+
type: "application/pdf",
|
|
20
|
+
"aria-label": label,
|
|
21
|
+
className: `${PREVIEW_HEIGHT} w-full rounded border border-border`,
|
|
22
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: "text-xs text-muted-foreground",
|
|
24
|
+
children: "This browser cannot preview PDFs; use the download link."
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
case "image": return /* @__PURE__ */ jsx("img", {
|
|
28
|
+
src: url,
|
|
29
|
+
alt: label,
|
|
30
|
+
className: "max-h-96 max-w-full rounded border border-border object-contain"
|
|
31
|
+
});
|
|
32
|
+
case "none": return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Every attached file, previewed by mime type, each with a download link (and an open link for HTML). */
|
|
36
|
+
function StepFilesView({ files, fileUrl }) {
|
|
37
|
+
if (files.length === 0) return null;
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: "min-w-0 space-y-3",
|
|
40
|
+
"data-step-files": "",
|
|
41
|
+
children: files.map((file) => {
|
|
42
|
+
const url = fileUrl(file.path);
|
|
43
|
+
const preview = previewKind(file.mime);
|
|
44
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
45
|
+
className: "min-w-0 space-y-1.5",
|
|
46
|
+
"data-step-file": file.name,
|
|
47
|
+
children: [/* @__PURE__ */ jsxs("figcaption", {
|
|
48
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx("span", {
|
|
51
|
+
className: "text-sm font-medium",
|
|
52
|
+
"data-file-title": "",
|
|
53
|
+
children: file.title ?? file.name
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsxs("span", {
|
|
56
|
+
className: "text-[11px] text-muted-foreground",
|
|
57
|
+
children: [
|
|
58
|
+
file.name,
|
|
59
|
+
" · ",
|
|
60
|
+
file.mime
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
preview === "html" && /* @__PURE__ */ jsxs("a", {
|
|
64
|
+
className: LINK,
|
|
65
|
+
href: url,
|
|
66
|
+
target: "_blank",
|
|
67
|
+
rel: "noopener noreferrer",
|
|
68
|
+
"data-file-open": "",
|
|
69
|
+
children: [/* @__PURE__ */ jsx(UiExternalLink, { "aria-hidden": true }), " Open"]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsxs("a", {
|
|
72
|
+
className: LINK,
|
|
73
|
+
href: url,
|
|
74
|
+
download: file.name,
|
|
75
|
+
"data-file-download": "",
|
|
76
|
+
children: [/* @__PURE__ */ jsx(UiDownload, { "aria-hidden": true }), " Download"]
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}), /* @__PURE__ */ jsx(FilePreview, {
|
|
80
|
+
file,
|
|
81
|
+
url,
|
|
82
|
+
preview
|
|
83
|
+
})]
|
|
84
|
+
}, file.path);
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { StepFilesView };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=StepFilesView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepFilesView.js","names":[],"sources":["../../../src/data/verification/StepFilesView.tsx"],"sourcesContent":["// Previews of the files a step attached (StepContext.AttachFile): a facet\n// step's html/pdf/png reports, or anything else a kind produced. The host owns\n// where the bytes live, so it passes `fileUrl(path)`; the view only decides how\n// each mime type is shown. HTML is untrusted output, so it runs in an iframe\n// sandboxed to scripts alone — no same-origin, forms, popups or top navigation.\n\nimport { UiDownload, UiExternalLink } from \"../../icons\";\nimport { previewKind, type FilePreview as Preview, type StepFile } from \"./stepKind\";\n\nexport type StepFilesViewProps = {\n files: StepFile[];\n /** The URL the host serves an attached file's `path` at, e.g. `/api/step-files?path=…`. */\n fileUrl: (path: string) => string;\n};\n\n// A report is the step's main evidence, so its preview fills the detail pane's\n// height (TestDetailPanel's size container, 100cqh) less the tab padding and the\n// file's caption row; outside a size container cqh falls back to the viewport.\nconst PREVIEW_HEIGHT = \"h-[calc(100cqh-4.5rem)] min-h-96\";\nconst LINK = \"inline-flex items-center gap-1 text-xs text-primary hover:underline\";\n\nfunction FilePreview({ file, url, preview }: { file: StepFile; url: string; preview: Preview }) {\n const label = file.title ?? file.name;\n switch (preview) {\n case \"html\":\n return <iframe src={url} title={label} sandbox=\"allow-scripts\" className={`${PREVIEW_HEIGHT} w-full rounded border border-border bg-white`} />;\n case \"pdf\":\n return (\n <object data={url} type=\"application/pdf\" aria-label={label} className={`${PREVIEW_HEIGHT} w-full rounded border border-border`}>\n <span className=\"text-xs text-muted-foreground\">This browser cannot preview PDFs; use the download link.</span>\n </object>\n );\n case \"image\":\n return <img src={url} alt={label} className=\"max-h-96 max-w-full rounded border border-border object-contain\" />;\n case \"none\":\n return null;\n }\n}\n\n/** Every attached file, previewed by mime type, each with a download link (and an open link for HTML). */\nexport function StepFilesView({ files, fileUrl }: StepFilesViewProps) {\n if (files.length === 0) return null;\n return (\n <div className=\"min-w-0 space-y-3\" data-step-files=\"\">\n {files.map((file) => {\n const url = fileUrl(file.path);\n const preview = previewKind(file.mime);\n return (\n <figure key={file.path} className=\"min-w-0 space-y-1.5\" data-step-file={file.name}>\n <figcaption className=\"flex flex-wrap items-center gap-x-3 gap-y-1\">\n <span className=\"text-sm font-medium\" data-file-title=\"\">{file.title ?? file.name}</span>\n <span className=\"text-[11px] text-muted-foreground\">{file.name} · {file.mime}</span>\n {preview === \"html\" && (\n <a className={LINK} href={url} target=\"_blank\" rel=\"noopener noreferrer\" data-file-open=\"\">\n <UiExternalLink aria-hidden /> Open\n </a>\n )}\n <a className={LINK} href={url} download={file.name} data-file-download=\"\">\n <UiDownload aria-hidden /> Download\n </a>\n </figcaption>\n <FilePreview file={file} url={url} preview={preview} />\n </figure>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;AAkBA,IAAM,iBAAiB;AACvB,IAAM,OAAO;AAEb,SAAS,YAAY,EAAE,MAAM,KAAK,WAA8D;CAC9F,MAAM,QAAQ,KAAK,SAAS,KAAK;CACjC,QAAQ,SAAR;EACE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ACO;IACZ,CAAA,GAAA,oBAAC,aAAD;KAAmB;KAAW;KAAc;IAAU,CAAA,CAChD;GAdK,GAAA,KAAK,IAcV;EAEZ,CAAC;CACE,CAAA;AAET"}
|
|
@@ -4,9 +4,11 @@ const require_ViolationLocations = require("../lint/ViolationLocations.cjs");
|
|
|
4
4
|
const require_stepKind = require("./stepKind.cjs");
|
|
5
5
|
const require_stepKindViews = require("./stepKindViews.cjs");
|
|
6
6
|
const require_stepSource = require("./stepSource.cjs");
|
|
7
|
+
const require_copy = require("../test-runner/copy.cjs");
|
|
7
8
|
const require_Expectation = require("../test-runner/Expectation.cjs");
|
|
8
9
|
const require_MarkIcons = require("../test-runner/MarkIcons.cjs");
|
|
9
10
|
const require_TestFailureDetail = require("../test-runner/TestFailureDetail.cjs");
|
|
11
|
+
const require_context = require("../test-runner/context.cjs");
|
|
10
12
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
13
|
// src/data/verification/adapterViews.tsx
|
|
12
14
|
function checklistItemOutcome(item) {
|
|
@@ -36,6 +38,18 @@ function ChecklistItemRow({ item }) {
|
|
|
36
38
|
})]
|
|
37
39
|
});
|
|
38
40
|
}
|
|
41
|
+
function keyChecklistItems(items) {
|
|
42
|
+
const seen = /* @__PURE__ */ new Map();
|
|
43
|
+
return items.map((item) => {
|
|
44
|
+
const base = item.task_id ?? `${item.name}:${item.message ?? ""}`;
|
|
45
|
+
const occurrence = seen.get(base) ?? 0;
|
|
46
|
+
seen.set(base, occurrence + 1);
|
|
47
|
+
return {
|
|
48
|
+
key: `${base}#${occurrence}`,
|
|
49
|
+
item
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
39
53
|
/** Renders every checklist item for the "Acceptance criteria" parent, or the
|
|
40
54
|
* single item itself when a leaf criterion is selected directly. */
|
|
41
55
|
function ChecklistDetail({ node }) {
|
|
@@ -48,7 +62,7 @@ function ChecklistDetail({ node }) {
|
|
|
48
62
|
className: "w-full border-collapse text-xs",
|
|
49
63
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
|
|
50
64
|
className: "divide-y divide-border/60",
|
|
51
|
-
children: items.map((
|
|
65
|
+
children: keyChecklistItems(items).map(({ key, item }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChecklistItemRow, { item }, key))
|
|
52
66
|
})
|
|
53
67
|
})
|
|
54
68
|
})
|
|
@@ -66,17 +80,24 @@ function comparisonValue(hasCelGate, value) {
|
|
|
66
80
|
if (value !== null && typeof value === "object" && !Array.isArray(value)) return void 0;
|
|
67
81
|
return value;
|
|
68
82
|
}
|
|
83
|
+
function varsShownInTabs(node, stepDetail) {
|
|
84
|
+
const shown = /* @__PURE__ */ new Set();
|
|
85
|
+
if (stepDetail.kind === "step" && stepDetail.step.outputs !== void 0) shown.add("outputs");
|
|
86
|
+
if (node.log || node.stdout || node.stderr) for (const name of ["stdout", "stderr"]) shown.add(name);
|
|
87
|
+
return shown;
|
|
88
|
+
}
|
|
69
89
|
function CelDetails({ node }) {
|
|
70
90
|
if (node.passed) return null;
|
|
71
91
|
const context = node.context;
|
|
72
|
-
const
|
|
92
|
+
const stepDetail = require_stepKind.readStepDetail(node.detail);
|
|
93
|
+
const shown = varsShownInTabs(node, stepDetail);
|
|
94
|
+
const vars = Object.fromEntries(Object.entries(context?.cel_vars ?? {}).filter(([name]) => !shown.has(name)));
|
|
73
95
|
const expression = readCelTrace(node.detail) || context?.cel_expression;
|
|
74
96
|
const hasCelGate = !!expression;
|
|
75
97
|
const expected = comparisonValue(hasCelGate, context?.expected);
|
|
76
98
|
const actual = comparisonValue(hasCelGate, context?.actual);
|
|
77
99
|
const hasComparison = expected !== void 0 || actual !== void 0;
|
|
78
100
|
if (!expression && Object.keys(vars).length === 0 && !hasComparison) return null;
|
|
79
|
-
const stepDetail = require_stepKind.readStepDetail(node.detail);
|
|
80
101
|
const wait = stepDetail.kind === "step" ? stepDetail.step.wait : void 0;
|
|
81
102
|
const checkLabel = wait && wait.outcome !== "satisfied" ? require_stepKind.waitDecidedBy(wait) : "expression";
|
|
82
103
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Expectation.Expectation, {
|
|
@@ -92,26 +113,105 @@ function failureTexts(...candidates) {
|
|
|
92
113
|
return texts.filter((text, i) => !texts.some((other, j) => j !== i && other.includes(text) && (other.length > text.length || j < i)));
|
|
93
114
|
}
|
|
94
115
|
function FailureMessage({ node, cause, error }) {
|
|
116
|
+
const runner = require_context.useTestRunner();
|
|
95
117
|
const texts = failureTexts(cause, node.message, error);
|
|
96
118
|
if (texts.length === 0) return null;
|
|
97
119
|
if (!(node.failed || node.timed_out || cause)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
98
120
|
className: "whitespace-pre-wrap break-words text-sm",
|
|
99
121
|
children: texts.join("\n")
|
|
100
122
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
const references = require_copy.copyReferences(runner.adapters.resolveCopy(node, runner));
|
|
124
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.FailureCallout, {
|
|
125
|
+
title: node.timed_out ? "Step timed out" : "Step failed",
|
|
126
|
+
texts,
|
|
127
|
+
references
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function CommandSection({ command, cwd, exitCode }) {
|
|
131
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
132
|
+
className: "min-w-0 space-y-1",
|
|
133
|
+
"data-step-section": "command",
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
136
|
+
className: "text-[10px] uppercase tracking-wide text-muted-foreground",
|
|
137
|
+
children: "Command"
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
140
|
+
className: "block overflow-x-auto whitespace-pre rounded bg-muted px-2 py-1.5 text-xs",
|
|
141
|
+
children: command
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
144
|
+
className: "flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",
|
|
145
|
+
children: [cwd && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["in ", cwd] }), typeof exitCode === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
146
|
+
className: exitCode === 0 ? void 0 : "text-red-600",
|
|
147
|
+
children: ["exit ", exitCode]
|
|
148
|
+
})]
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function QueryDetailSections({ query }) {
|
|
154
|
+
if (query.kind === "query") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepQuerySection, { query: query.query });
|
|
155
|
+
if (query.kind === "invalid") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.MalformedStepDetail, { error: query.error });
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
function ViolationDetailSections({ violation, workDir }) {
|
|
159
|
+
if (violation.kind === "invalid") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.MalformedStepDetail, { error: violation.error });
|
|
160
|
+
if (violation.kind !== "violation" || violation.violation.locations.length === 0) return null;
|
|
161
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
162
|
+
className: "min-w-0",
|
|
163
|
+
"data-step-section": "locations",
|
|
164
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ViolationLocations.ViolationLocations, {
|
|
165
|
+
locations: violation.violation.locations,
|
|
166
|
+
workDir
|
|
167
|
+
})
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** The typed step's response view and form. */
|
|
171
|
+
function StepResponseSections({ stepDetail }) {
|
|
172
|
+
if (stepDetail.kind !== "step") return null;
|
|
173
|
+
const { view, form } = stepDetail.step;
|
|
174
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [view && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
175
|
+
className: "min-w-0 space-y-1",
|
|
176
|
+
"data-step-section": "view",
|
|
177
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
178
|
+
className: "text-[10px] uppercase tracking-wide text-muted-foreground",
|
|
179
|
+
children: "Response"
|
|
180
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Clicky.Clicky, { data: view })]
|
|
181
|
+
}), form && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepFormSection, { form })] });
|
|
182
|
+
}
|
|
183
|
+
/** The step-kind specific sections, or the notice that the step detail was malformed. */
|
|
184
|
+
function StepKindDetail({ stepDetail, renderWait, fileUrl }) {
|
|
185
|
+
if (stepDetail.kind === "invalid") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.MalformedStepDetail, { error: stepDetail.error });
|
|
186
|
+
if (stepDetail.kind !== "step") return null;
|
|
187
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepKindSections, {
|
|
188
|
+
step: stepDetail.step,
|
|
189
|
+
...renderWait ? { renderWait } : {},
|
|
190
|
+
...fileUrl ? { fileUrl } : {}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function RawDetail({ data }) {
|
|
194
|
+
if (data == null) return null;
|
|
195
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
196
|
+
className: "text-muted-foreground",
|
|
197
|
+
"data-raw-detail": "",
|
|
198
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
199
|
+
className: "cursor-pointer text-[10px] uppercase tracking-wide",
|
|
200
|
+
children: "Raw detail"
|
|
201
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
202
|
+
className: "mt-1 text-foreground",
|
|
203
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_JsonView.JsonView, { data })
|
|
204
|
+
})]
|
|
205
|
+
});
|
|
105
206
|
}
|
|
106
|
-
function FixtureDetail({ node, renderWait, renderPendingPrompt }) {
|
|
207
|
+
function FixtureDetail({ node, renderWait, renderPendingPrompt, fileUrl }) {
|
|
107
208
|
const context = node.context;
|
|
108
|
-
const command = context?.command ?? node.command;
|
|
109
|
-
const cwd = context?.cwd ?? node.work_dir;
|
|
110
209
|
const stepDetail = require_stepKind.readStepDetail(node.detail);
|
|
111
|
-
const
|
|
210
|
+
const step = stepDetail.kind === "step" ? stepDetail.step : void 0;
|
|
112
211
|
const query = require_stepKind.readQuery(node.detail);
|
|
113
212
|
const { header, rest } = require_stepKind.splitExecutionDetail(node.detail);
|
|
114
|
-
const
|
|
213
|
+
const command = context?.command ?? node.command;
|
|
214
|
+
const rawDetail = require_stepKind.withoutQuery(require_stepKind.withoutViolation(require_stepSource.withoutSource(step ? require_stepKind.splitExecutionDetail(step.rest).rest : rest)));
|
|
115
215
|
const pendingForm = node.waiting === true && renderPendingPrompt ? renderPendingPrompt(node) : null;
|
|
116
216
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
117
217
|
className: "space-y-4 p-density-4",
|
|
@@ -119,75 +219,35 @@ function FixtureDetail({ node, renderWait, renderPendingPrompt }) {
|
|
|
119
219
|
children: [
|
|
120
220
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.ExecutionHeaderView, {
|
|
121
221
|
header,
|
|
122
|
-
...
|
|
222
|
+
...step ? { stepKind: step.step.kind } : {}
|
|
123
223
|
}),
|
|
124
224
|
pendingForm != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepPendingFormSection, { children: pendingForm }),
|
|
125
225
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailureMessage, {
|
|
126
226
|
node,
|
|
127
|
-
cause:
|
|
227
|
+
cause: step?.wait?.cause,
|
|
128
228
|
error: header.error
|
|
129
229
|
}),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
query.kind
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
children: [
|
|
137
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
138
|
-
className: "text-[10px] uppercase tracking-wide text-muted-foreground",
|
|
139
|
-
children: "Command"
|
|
140
|
-
}),
|
|
141
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
142
|
-
className: "block overflow-x-auto whitespace-pre rounded bg-muted px-2 py-1.5 text-xs",
|
|
143
|
-
children: command
|
|
144
|
-
}),
|
|
145
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
146
|
-
className: "flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",
|
|
147
|
-
children: [cwd && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: ["in ", cwd] }), typeof context?.exit_code === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
148
|
-
className: context.exit_code === 0 ? void 0 : "text-red-600",
|
|
149
|
-
children: ["exit ", context.exit_code]
|
|
150
|
-
})]
|
|
151
|
-
})
|
|
152
|
-
]
|
|
230
|
+
step?.step.kind === "test" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepFailedTestsSection, { node }),
|
|
231
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(QueryDetailSections, { query }),
|
|
232
|
+
command && query.kind !== "query" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandSection, {
|
|
233
|
+
command,
|
|
234
|
+
cwd: context?.cwd ?? node.work_dir,
|
|
235
|
+
exitCode: context?.exit_code
|
|
153
236
|
}),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
className: "text-[10px] uppercase tracking-wide text-muted-foreground",
|
|
159
|
-
children: "Response"
|
|
160
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Clicky.Clicky, { data: stepDetail.step.view })]
|
|
237
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepResponseSections, { stepDetail }),
|
|
238
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ViolationDetailSections, {
|
|
239
|
+
violation: require_stepKind.readViolation(node.detail),
|
|
240
|
+
workDir: node.work_dir
|
|
161
241
|
}),
|
|
162
|
-
stepDetail.kind === "step" && stepDetail.step.form && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepFormSection, { form: stepDetail.step.form }),
|
|
163
|
-
violation.kind === "violation" && violation.violation.locations.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
164
|
-
className: "min-w-0",
|
|
165
|
-
"data-step-section": "locations",
|
|
166
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ViolationLocations.ViolationLocations, {
|
|
167
|
-
locations: violation.violation.locations,
|
|
168
|
-
workDir: node.work_dir
|
|
169
|
-
})
|
|
170
|
-
}),
|
|
171
|
-
violation.kind === "invalid" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.MalformedStepDetail, { error: violation.error }),
|
|
172
242
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TestFailureDetail.TestOutput, { node }),
|
|
173
243
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CelDetails, { node }),
|
|
174
244
|
(node.failed || node.pending) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_stepKindViews.StepSourceSection, { result: require_stepSource.readStepSource(node.detail) }),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
245
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepKindDetail, {
|
|
246
|
+
stepDetail,
|
|
247
|
+
renderWait,
|
|
248
|
+
fileUrl
|
|
178
249
|
}),
|
|
179
|
-
|
|
180
|
-
rawDetail != null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
181
|
-
className: "text-muted-foreground",
|
|
182
|
-
"data-raw-detail": "",
|
|
183
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
184
|
-
className: "cursor-pointer text-[10px] uppercase tracking-wide",
|
|
185
|
-
children: "Raw detail"
|
|
186
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
187
|
-
className: "mt-1 text-foreground",
|
|
188
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_JsonView.JsonView, { data: rawDetail })
|
|
189
|
-
})]
|
|
190
|
-
})
|
|
250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RawDetail, { data: rawDetail })
|
|
191
251
|
]
|
|
192
252
|
});
|
|
193
253
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapterViews.cjs","names":["OutcomeIcon","readStepDetail","waitDecidedBy","Expectation","FailureCallout","readViolation","readQuery","splitExecutionDetail","withoutQuery","withoutViolation","withoutSource","ExecutionHeaderView","StepPendingFormSection","StepFailedTestsSection","StepQuerySection","MalformedStepDetail","Clicky","StepFormSection","ViolationLocations","TestOutput","StepSourceSection","readStepSource","StepKindSections","JsonView"],"sources":["../../../src/data/verification/adapterViews.tsx"],"sourcesContent":["// Detail-body components for the verification node adapters. Split from\n// adapters.ts (react/only-export-components: a file mixing component\n// declarations with the plain TestNodeAdapter/registry exports loses Fast\n// Refresh). Ported from gavel's VerificationStepOutput.tsx (the checklist list\n// and the CelDetails block).\n\nimport type { ReactNode } from \"react\";\nimport { Clicky } from \"../Clicky\";\nimport { JsonView } from \"../JsonView\";\nimport { ViolationLocations } from \"../lint/ViolationLocations\";\nimport { readQuery, readStepDetail, readViolation, splitExecutionDetail, waitDecidedBy, withoutQuery, withoutViolation, type WaitDetail } from \"./stepKind\";\nimport {\n ExecutionHeaderView,\n FailureCallout,\n MalformedStepDetail,\n StepFailedTestsSection,\n StepFormSection,\n StepKindSections,\n StepPendingFormSection,\n StepQuerySection,\n StepSourceSection,\n} from \"./stepKindViews\";\nimport { readStepSource, withoutSource } from \"./stepSource\";\nimport {\n Expectation,\n OutcomeIcon,\n TestOutput,\n type FixtureContext,\n type Test,\n type TestOutcome,\n} from \"../test-runner\";\n\n// ── Checklist: the synthesized \"Acceptance criteria\" node and its items ────\n\nfunction checklistItemOutcome(item: Test): TestOutcome {\n if (item.failed) return \"failed\";\n if (item.passed) return \"passed\";\n return \"pending\";\n}\n\nfunction ChecklistItemRow({ item }: { item: Test }) {\n return (\n <tr className=\"align-top\" data-checklist-item=\"\">\n <td className=\"px-2 py-1.5\">\n <span className=\"flex items-start gap-1.5\">\n <OutcomeIcon outcome={checklistItemOutcome(item)} className=\"mt-0.5 text-sm\" />\n <span className=\"min-w-0\">{item.name}</span>\n </span>\n </td>\n <td className=\"px-2 py-1.5 text-muted-foreground\">{item.message}</td>\n </tr>\n );\n}\n\n/** Renders every checklist item for the \"Acceptance criteria\" parent, or the\n * single item itself when a leaf criterion is selected directly. */\nexport function ChecklistDetail({ node }: { node: Test }) {\n const items = node.children && node.children.length > 0 ? node.children : [node];\n return (\n <div className=\"p-density-4\">\n <div className=\"overflow-hidden rounded-md border border-border/60\">\n <table className=\"w-full border-collapse text-xs\">\n <tbody className=\"divide-y divide-border/60\">\n {items.map((item, index) => (\n <ChecklistItemRow key={item.task_id ?? index} item={item} />\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n}\n\n// ── Fixture / CEL: the failing-step detail (command + CelDetails) ──────────\n\nfunction readCelTrace(detail: unknown): string | undefined {\n if (detail && typeof detail === \"object\" && !Array.isArray(detail)) {\n const value = (detail as Record<string, unknown>).cel_trace;\n if (typeof value === \"string\" && value.length > 0) return value;\n }\n return undefined;\n}\n\n// A command step with no CEL assertion stores the whole command result object\n// in `actual` — the command/output is already rendered above, so dumping it\n// again as JSON is noise. Anything a CEL expression compared is shown as-is,\n// structured values included. `hasCelGate` mirrors gavel's own gate: a plain\n// `context.cel_expression`, or a trace recorded in `node.detail` when the\n// expression itself wasn't preserved on `context`.\nfunction comparisonValue(hasCelGate: boolean, value: unknown): unknown {\n if (value === undefined) return undefined;\n if (hasCelGate) return value;\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) return undefined;\n return value;\n}\n\n// CEL detail is rendered only for a failing node: the expression and the\n// values it saw are what explain the verdict.\nexport function CelDetails({ node }: { node: Test }) {\n if (node.passed) return null;\n const context = node.context as FixtureContext | undefined;\n const vars = context?.cel_vars ?? {};\n const expression = readCelTrace(node.detail) || context?.cel_expression;\n const hasCelGate = !!expression;\n const expected = comparisonValue(hasCelGate, context?.expected);\n const actual = comparisonValue(hasCelGate, context?.actual);\n const hasComparison = expected !== undefined || actual !== undefined;\n if (!expression && Object.keys(vars).length === 0 && !hasComparison) return null;\n const stepDetail = readStepDetail(node.detail);\n const wait = stepDetail.kind === \"step\" ? stepDetail.step.wait : undefined;\n const checkLabel = wait && wait.outcome !== \"satisfied\" ? waitDecidedBy(wait) : \"expression\";\n return (\n <Expectation\n check={expression}\n checkLabel={checkLabel}\n vars={vars}\n expected={expected}\n actual={actual}\n />\n );\n}\n\n// The texts explaining a failure, most specific first. A text already contained\n// in another (a wait cause that the result message embeds) is not repeated.\nfunction failureTexts(...candidates: (string | undefined)[]): string[] {\n const texts = candidates.filter((text): text is string => !!text);\n return texts.filter((text, i) => !texts.some((other, j) => j !== i && other.includes(text) && (other.length > text.length || j < i)));\n}\n\nfunction FailureMessage({ node, cause, error }: { node: Test; cause: string | undefined; error: string | undefined }) {\n const texts = failureTexts(cause, node.message, error);\n if (texts.length === 0) return null;\n if (!(node.failed || node.timed_out || cause)) return <p className=\"whitespace-pre-wrap break-words text-sm\">{texts.join(\"\\n\")}</p>;\n return (\n <FailureCallout>\n {texts.map((text, i) => <div key={i} className={i > 0 ? \"mt-1 text-xs opacity-90\" : undefined}>{text}</div>)}\n </FailureCallout>\n );\n}\n\nexport type FixtureDetailProps = {\n node: Test;\n renderWait?: (wait: WaitDetail) => ReactNode;\n /** The answerable form of a step waiting on a person (`node.waiting`); the host owns the prompt it answers. */\n renderPendingPrompt?: (node: Test) => ReactNode;\n};\n\nexport function FixtureDetail({ node, renderWait, renderPendingPrompt }: FixtureDetailProps) {\n const context = node.context as FixtureContext | undefined;\n const command = context?.command ?? node.command;\n const cwd = context?.cwd ?? node.work_dir;\n const stepDetail = readStepDetail(node.detail);\n const violation = readViolation(node.detail);\n const query = readQuery(node.detail);\n const { header, rest } = splitExecutionDetail(node.detail);\n // A typed step shows its own sections, so the raw block keeps only what they don't cover.\n const rawDetail = withoutQuery(withoutViolation(withoutSource(stepDetail.kind === \"step\" ? splitExecutionDetail(stepDetail.step.rest).rest : rest)));\n const pendingForm = node.waiting === true && renderPendingPrompt ? renderPendingPrompt(node) : null;\n return (\n <div className=\"space-y-4 p-density-4\" data-fixture-detail=\"\">\n <ExecutionHeaderView header={header} {...(stepDetail.kind === \"step\" ? { stepKind: stepDetail.step.step.kind } : {})} />\n {pendingForm != null && <StepPendingFormSection>{pendingForm}</StepPendingFormSection>}\n <FailureMessage node={node} cause={stepDetail.kind === \"step\" ? stepDetail.step.wait?.cause : undefined} error={header.error} />\n {stepDetail.kind === \"step\" && stepDetail.step.step.kind === \"test\" && <StepFailedTestsSection node={node} />}\n {query.kind === \"query\" && <StepQuerySection query={query.query} />}\n {query.kind === \"invalid\" && <MalformedStepDetail error={query.error} />}\n {command && query.kind !== \"query\" && (\n <div className=\"min-w-0 space-y-1\" data-step-section=\"command\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Command</div>\n <code className=\"block overflow-x-auto whitespace-pre rounded bg-muted px-2 py-1.5 text-xs\">\n {command}\n </code>\n <div className=\"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground\">\n {cwd && <span>in {cwd}</span>}\n {typeof context?.exit_code === \"number\" && (\n <span className={context.exit_code === 0 ? undefined : \"text-red-600\"}>\n exit {context.exit_code}\n </span>\n )}\n </div>\n </div>\n )}\n {stepDetail.kind === \"step\" && stepDetail.step.view && (\n <div className=\"min-w-0 space-y-1\" data-step-section=\"view\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Response</div>\n <Clicky data={stepDetail.step.view} />\n </div>\n )}\n {stepDetail.kind === \"step\" && stepDetail.step.form && <StepFormSection form={stepDetail.step.form} />}\n {violation.kind === \"violation\" && violation.violation.locations.length > 0 && (\n <div className=\"min-w-0\" data-step-section=\"locations\">\n <ViolationLocations locations={violation.violation.locations} workDir={node.work_dir} />\n </div>\n )}\n {violation.kind === \"invalid\" && <MalformedStepDetail error={violation.error} />}\n <TestOutput node={node} />\n <CelDetails node={node} />\n {(node.failed || node.pending) && <StepSourceSection result={readStepSource(node.detail)} />}\n {stepDetail.kind === \"step\" && <StepKindSections step={stepDetail.step} {...(renderWait ? { renderWait } : {})} />}\n {stepDetail.kind === \"invalid\" && <MalformedStepDetail error={stepDetail.error} />}\n {rawDetail != null && (\n <details className=\"text-muted-foreground\" data-raw-detail=\"\">\n <summary className=\"cursor-pointer text-[10px] uppercase tracking-wide\">Raw detail</summary>\n <div className=\"mt-1 text-foreground\">\n <JsonView data={rawDetail} />\n </div>\n </details>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAkCA,SAAS,qBAAqB,MAAyB;CACrD,IAAI,KAAK,QAAQ,OAAO;CACxB,IAAI,KAAK,QAAQ,OAAO;CACxB,OAAO;AACT;AAEA,SAAS,iBAAiB,EAAE,QAAwB;CAClD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,MAAD;EAAI,WAAU;EAAY,uBAAoB;EAA9C,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAI,WAAU;GACZ,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,kBAAAA,aA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KAAK,WAAU;KACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACQ,iBAAAA,UAAD,EAAU,MAAM,UAAY,CAAA;IACzB,CAAA,CACE;;EAER;;AAET"}
|
|
1
|
+
{"version":3,"file":"adapterViews.cjs","names":["OutcomeIcon","readStepDetail","waitDecidedBy","Expectation","useTestRunner","copyReferences","FailureCallout","StepQuerySection","MalformedStepDetail","ViolationLocations","_Fragment","Clicky","StepFormSection","StepKindSections","JsonView","readQuery","splitExecutionDetail","withoutQuery","withoutViolation","withoutSource","ExecutionHeaderView","StepPendingFormSection","StepFailedTestsSection","readViolation","TestOutput","StepSourceSection","readStepSource"],"sources":["../../../src/data/verification/adapterViews.tsx"],"sourcesContent":["// Detail-body components for the verification node adapters. Split from\n// adapters.ts (react/only-export-components: a file mixing component\n// declarations with the plain TestNodeAdapter/registry exports loses Fast\n// Refresh). Ported from gavel's VerificationStepOutput.tsx (the checklist list\n// and the CelDetails block).\n\nimport type { ReactNode } from \"react\";\nimport { Clicky } from \"../Clicky\";\nimport { JsonView } from \"../JsonView\";\nimport { ViolationLocations } from \"../lint/ViolationLocations\";\nimport { readQuery, readStepDetail, readViolation, splitExecutionDetail, waitDecidedBy, withoutQuery, withoutViolation, type WaitDetail } from \"./stepKind\";\nimport {\n ExecutionHeaderView,\n FailureCallout,\n MalformedStepDetail,\n StepFailedTestsSection,\n StepFormSection,\n StepKindSections,\n StepPendingFormSection,\n StepQuerySection,\n StepSourceSection,\n} from \"./stepKindViews\";\nimport { readStepSource, withoutSource } from \"./stepSource\";\nimport {\n copyReferences,\n Expectation,\n OutcomeIcon,\n TestOutput,\n useTestRunner,\n type FixtureContext,\n type Test,\n type TestOutcome,\n} from \"../test-runner\";\n\n// ── Checklist: the synthesized \"Acceptance criteria\" node and its items ────\n\nfunction checklistItemOutcome(item: Test): TestOutcome {\n if (item.failed) return \"failed\";\n if (item.passed) return \"passed\";\n return \"pending\";\n}\n\nfunction ChecklistItemRow({ item }: { item: Test }) {\n return (\n <tr className=\"align-top\" data-checklist-item=\"\">\n <td className=\"px-2 py-1.5\">\n <span className=\"flex items-start gap-1.5\">\n <OutcomeIcon outcome={checklistItemOutcome(item)} className=\"mt-0.5 text-sm\" />\n <span className=\"min-w-0\">{item.name}</span>\n </span>\n </td>\n <td className=\"px-2 py-1.5 text-muted-foreground\">{item.message}</td>\n </tr>\n );\n}\n\n// Items without a task id (or with a repeated one) are keyed by name plus occurrence count, never the array index.\nfunction keyChecklistItems(items: Test[]) {\n const seen = new Map<string, number>();\n return items.map((item) => {\n const base = item.task_id ?? `${item.name}:${item.message ?? \"\"}`;\n const occurrence = seen.get(base) ?? 0;\n seen.set(base, occurrence + 1);\n return { key: `${base}#${occurrence}`, item };\n });\n}\n\n/** Renders every checklist item for the \"Acceptance criteria\" parent, or the\n * single item itself when a leaf criterion is selected directly. */\nexport function ChecklistDetail({ node }: { node: Test }) {\n const items = node.children && node.children.length > 0 ? node.children : [node];\n return (\n <div className=\"p-density-4\">\n <div className=\"overflow-hidden rounded-md border border-border/60\">\n <table className=\"w-full border-collapse text-xs\">\n <tbody className=\"divide-y divide-border/60\">\n {keyChecklistItems(items).map(({ key, item }) => (\n <ChecklistItemRow key={key} item={item} />\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n}\n\n// ── Fixture / CEL: the failing-step detail (command + CelDetails) ──────────\n\nfunction readCelTrace(detail: unknown): string | undefined {\n if (detail && typeof detail === \"object\" && !Array.isArray(detail)) {\n const value = (detail as Record<string, unknown>).cel_trace;\n if (typeof value === \"string\" && value.length > 0) return value;\n }\n return undefined;\n}\n\n// A command step with no CEL assertion stores the whole command result object\n// in `actual` — the command/output is already rendered above, so dumping it\n// again as JSON is noise. Anything a CEL expression compared is shown as-is,\n// structured values included. `hasCelGate` mirrors gavel's own gate: a plain\n// `context.cel_expression`, or a trace recorded in `node.detail` when the\n// expression itself wasn't preserved on `context`.\nfunction comparisonValue(hasCelGate: boolean, value: unknown): unknown {\n if (value === undefined) return undefined;\n if (hasCelGate) return value;\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) return undefined;\n return value;\n}\n\n// The CEL variables a detail tab already shows in full: the step's outputs (the\n// Outputs tab) and its captured streams (the Stdout tab), so the variables grid\n// does not repeat them.\nfunction varsShownInTabs(node: Test, stepDetail: ReturnType<typeof readStepDetail>): Set<string> {\n const shown = new Set<string>();\n if (stepDetail.kind === \"step\" && stepDetail.step.outputs !== undefined) shown.add(\"outputs\");\n if (node.log || node.stdout || node.stderr) for (const name of [\"stdout\", \"stderr\"]) shown.add(name);\n return shown;\n}\n\n// CEL detail is rendered only for a failing node: the expression and the\n// values it saw are what explain the verdict.\nexport function CelDetails({ node }: { node: Test }) {\n if (node.passed) return null;\n const context = node.context as FixtureContext | undefined;\n const stepDetail = readStepDetail(node.detail);\n const shown = varsShownInTabs(node, stepDetail);\n const vars = Object.fromEntries(Object.entries(context?.cel_vars ?? {}).filter(([name]) => !shown.has(name)));\n const expression = readCelTrace(node.detail) || context?.cel_expression;\n const hasCelGate = !!expression;\n const expected = comparisonValue(hasCelGate, context?.expected);\n const actual = comparisonValue(hasCelGate, context?.actual);\n const hasComparison = expected !== undefined || actual !== undefined;\n if (!expression && Object.keys(vars).length === 0 && !hasComparison) return null;\n const wait = stepDetail.kind === \"step\" ? stepDetail.step.wait : undefined;\n const checkLabel = wait && wait.outcome !== \"satisfied\" ? waitDecidedBy(wait) : \"expression\";\n return (\n <Expectation\n check={expression}\n checkLabel={checkLabel}\n vars={vars}\n expected={expected}\n actual={actual}\n />\n );\n}\n\n// The texts explaining a failure, most specific first. A text already contained\n// in another (a wait cause that the result message embeds) is not repeated.\nfunction failureTexts(...candidates: (string | undefined)[]): string[] {\n const texts = candidates.filter((text): text is string => !!text);\n return texts.filter((text, i) => !texts.some((other, j) => j !== i && other.includes(text) && (other.length > text.length || j < i)));\n}\n\nfunction FailureMessage({ node, cause, error }: { node: Test; cause: string | undefined; error: string | undefined }) {\n const runner = useTestRunner();\n const texts = failureTexts(cause, node.message, error);\n if (texts.length === 0) return null;\n if (!(node.failed || node.timed_out || cause)) return <p className=\"whitespace-pre-wrap break-words text-sm\">{texts.join(\"\\n\")}</p>;\n // The same places on disk the Copy details brief cites, so the copied failure points at its evidence too.\n const references = copyReferences(runner.adapters.resolveCopy(node, runner));\n return <FailureCallout title={node.timed_out ? \"Step timed out\" : \"Step failed\"} texts={texts} references={references} />;\n}\n\nexport type FixtureDetailProps = {\n node: Test;\n renderWait?: (wait: WaitDetail) => ReactNode;\n /** The answerable form of a step waiting on a person (`node.waiting`); the host owns the prompt it answers. */\n renderPendingPrompt?: (node: Test) => ReactNode;\n /** Where the host serves a file the step attached (`detail.files[].path`); required to preview them. */\n fileUrl?: (path: string) => string;\n};\n\ntype StepDetailResult = ReturnType<typeof readStepDetail>;\ntype QueryResult = ReturnType<typeof readQuery>;\ntype ViolationResult = ReturnType<typeof readViolation>;\n\nfunction CommandSection({ command, cwd, exitCode }: { command: string; cwd: string | undefined; exitCode: unknown }) {\n return (\n <div className=\"min-w-0 space-y-1\" data-step-section=\"command\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Command</div>\n <code className=\"block overflow-x-auto whitespace-pre rounded bg-muted px-2 py-1.5 text-xs\">\n {command}\n </code>\n <div className=\"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground\">\n {cwd && <span>in {cwd}</span>}\n {typeof exitCode === \"number\" && (\n <span className={exitCode === 0 ? undefined : \"text-red-600\"}>\n exit {exitCode}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nfunction QueryDetailSections({ query }: { query: QueryResult }) {\n if (query.kind === \"query\") return <StepQuerySection query={query.query} />;\n if (query.kind === \"invalid\") return <MalformedStepDetail error={query.error} />;\n return null;\n}\n\nfunction ViolationDetailSections({ violation, workDir }: { violation: ViolationResult; workDir: Test[\"work_dir\"] }) {\n if (violation.kind === \"invalid\") return <MalformedStepDetail error={violation.error} />;\n if (violation.kind !== \"violation\" || violation.violation.locations.length === 0) return null;\n return (\n <div className=\"min-w-0\" data-step-section=\"locations\">\n <ViolationLocations locations={violation.violation.locations} workDir={workDir} />\n </div>\n );\n}\n\n/** The typed step's response view and form. */\nfunction StepResponseSections({ stepDetail }: { stepDetail: StepDetailResult }) {\n if (stepDetail.kind !== \"step\") return null;\n const { view, form } = stepDetail.step;\n return (\n <>\n {view && (\n <div className=\"min-w-0 space-y-1\" data-step-section=\"view\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Response</div>\n <Clicky data={view} />\n </div>\n )}\n {form && <StepFormSection form={form} />}\n </>\n );\n}\n\n/** The step-kind specific sections, or the notice that the step detail was malformed. */\nfunction StepKindDetail({ stepDetail, renderWait, fileUrl }: { stepDetail: StepDetailResult; renderWait: FixtureDetailProps[\"renderWait\"] | undefined; fileUrl: FixtureDetailProps[\"fileUrl\"] | undefined }) {\n if (stepDetail.kind === \"invalid\") return <MalformedStepDetail error={stepDetail.error} />;\n if (stepDetail.kind !== \"step\") return null;\n return <StepKindSections step={stepDetail.step} {...(renderWait ? { renderWait } : {})} {...(fileUrl ? { fileUrl } : {})} />;\n}\n\nfunction RawDetail({ data }: { data: unknown }) {\n if (data == null) return null;\n return (\n <details className=\"text-muted-foreground\" data-raw-detail=\"\">\n <summary className=\"cursor-pointer text-[10px] uppercase tracking-wide\">Raw detail</summary>\n <div className=\"mt-1 text-foreground\">\n <JsonView data={data} />\n </div>\n </details>\n );\n}\n\nexport function FixtureDetail({ node, renderWait, renderPendingPrompt, fileUrl }: FixtureDetailProps) {\n const context = node.context as FixtureContext | undefined;\n const stepDetail = readStepDetail(node.detail);\n const step = stepDetail.kind === \"step\" ? stepDetail.step : undefined;\n const query = readQuery(node.detail);\n const { header, rest } = splitExecutionDetail(node.detail);\n const command = context?.command ?? node.command;\n // A typed step shows its own sections, so the raw block keeps only what they don't cover.\n const rawDetail = withoutQuery(withoutViolation(withoutSource(step ? splitExecutionDetail(step.rest).rest : rest)));\n const pendingForm = node.waiting === true && renderPendingPrompt ? renderPendingPrompt(node) : null;\n return (\n <div className=\"space-y-4 p-density-4\" data-fixture-detail=\"\">\n <ExecutionHeaderView header={header} {...(step ? { stepKind: step.step.kind } : {})} />\n {pendingForm != null && <StepPendingFormSection>{pendingForm}</StepPendingFormSection>}\n <FailureMessage node={node} cause={step?.wait?.cause} error={header.error} />\n {step?.step.kind === \"test\" && <StepFailedTestsSection node={node} />}\n <QueryDetailSections query={query} />\n {command && query.kind !== \"query\" && <CommandSection command={command} cwd={context?.cwd ?? node.work_dir} exitCode={context?.exit_code} />}\n <StepResponseSections stepDetail={stepDetail} />\n <ViolationDetailSections violation={readViolation(node.detail)} workDir={node.work_dir} />\n <TestOutput node={node} />\n <CelDetails node={node} />\n {(node.failed || node.pending) && <StepSourceSection result={readStepSource(node.detail)} />}\n <StepKindDetail stepDetail={stepDetail} renderWait={renderWait} fileUrl={fileUrl} />\n <RawDetail data={rawDetail} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,SAAS,qBAAqB,MAAyB;CACrD,IAAI,KAAK,QAAQ,OAAO;CACxB,IAAI,KAAK,QAAQ,OAAO;CACxB,OAAO;AACT;AAEA,SAAS,iBAAiB,EAAE,QAAwB;CAClD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,MAAD;EAAI,WAAU;EAAY,uBAAoB;EAA9C,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAI,WAAU;GACZ,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,kBAAAA,aAAD;KAAa,SAAS,qBAAqB,IAAI;KAAG,WAAU;IAAkB,CAAA,GAC9E,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KAAW,UAAA,KAAK;IAAW,CAAA,CACvC;;EACJ,CAAA,GACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAI,WAAU;G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AA;IACvB,KAAK,UAAU,KAAK,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,mBAAD,EAAmB,QAAQC,mBAAAA,eAAe,KAAK,MAAM,EAAI,CAAA;GAC3F,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;IAA4B;IAAwB;IAAqB;GAAU,CAAA;GACnF,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,EAAW,MAAM,UAAY,CAAA;EAC1B;;AAET"}
|
|
@@ -14,6 +14,8 @@ export type FixtureDetailProps = {
|
|
|
14
14
|
renderWait?: (wait: WaitDetail) => ReactNode;
|
|
15
15
|
/** The answerable form of a step waiting on a person (`node.waiting`); the host owns the prompt it answers. */
|
|
16
16
|
renderPendingPrompt?: (node: Test) => ReactNode;
|
|
17
|
+
/** Where the host serves a file the step attached (`detail.files[].path`); required to preview them. */
|
|
18
|
+
fileUrl?: (path: string) => string;
|
|
17
19
|
};
|
|
18
|
-
export declare function FixtureDetail({ node, renderWait, renderPendingPrompt }: FixtureDetailProps): import("react").JSX.Element;
|
|
20
|
+
export declare function FixtureDetail({ node, renderWait, renderPendingPrompt, fileUrl }: FixtureDetailProps): import("react").JSX.Element;
|
|
19
21
|
//# sourceMappingURL=adapterViews.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapterViews.d.ts","sourceRoot":"","sources":["../../../src/data/verification/adapterViews.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAiH,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAa5J,OAAO,
|
|
1
|
+
{"version":3,"file":"adapterViews.d.ts","sourceRoot":"","sources":["../../../src/data/verification/adapterViews.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAiH,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAa5J,OAAO,EAOL,KAAK,IAAI,EAEV,MAAM,gBAAgB,CAAC;AAmCxB;qEACqE;AACrE,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,+BAevD;AAqCD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,sCAuBlD;AAmBD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,CAAC;IAC7C,+GAA+G;IAC/G,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC;IAChD,wGAAwG;IACxG,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC,CAAC;AA6EF,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,kBAAkB,+BA2BnG"}
|