@astra-spec/ui 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/blocks.css +1 -0
- package/components.css +6 -0
- package/dist/blocks/analysis-tree.d.ts.map +1 -1
- package/dist/blocks/analysis-tree.js +4 -7
- package/dist/blocks/analysis-tree.js.map +1 -1
- package/dist/blocks/decisions-list.d.ts.map +1 -1
- package/dist/blocks/decisions-list.js +1 -1
- package/dist/blocks/decisions-list.js.map +1 -1
- package/dist/blocks/findings-list.d.ts.map +1 -1
- package/dist/blocks/findings-list.js +2 -4
- package/dist/blocks/findings-list.js.map +1 -1
- package/dist/blocks/index.d.ts +2 -4
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +1 -2
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/outputs-list.d.ts +2 -7
- package/dist/blocks/outputs-list.d.ts.map +1 -1
- package/dist/blocks/outputs-list.js +11 -21
- package/dist/blocks/outputs-list.js.map +1 -1
- package/dist/blocks/papers-list.d.ts.map +1 -1
- package/dist/blocks/papers-list.js +3 -3
- package/dist/blocks/papers-list.js.map +1 -1
- package/dist/components/figure-zoom.d.ts +6 -0
- package/dist/components/figure-zoom.d.ts.map +1 -0
- package/dist/components/figure-zoom.js +28 -0
- package/dist/components/figure-zoom.js.map +1 -0
- package/dist/components/finding-detail.d.ts +4 -2
- package/dist/components/finding-detail.d.ts.map +1 -1
- package/dist/components/finding-detail.js +41 -25
- package/dist/components/finding-detail.js.map +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/insight-trigger.js +2 -2
- package/dist/components/insight-trigger.js.map +1 -1
- package/dist/components/output-card.d.ts +13 -0
- package/dist/components/output-card.d.ts.map +1 -0
- package/dist/components/output-card.js +12 -0
- package/dist/components/output-card.js.map +1 -0
- package/dist/components/output-detail.d.ts +6 -2
- package/dist/components/output-detail.d.ts.map +1 -1
- package/dist/components/output-detail.js +49 -13
- package/dist/components/output-detail.js.map +1 -1
- package/dist/components/output-dialog.d.ts +6 -1
- package/dist/components/output-dialog.d.ts.map +1 -1
- package/dist/components/output-dialog.js +2 -2
- package/dist/components/output-dialog.js.map +1 -1
- package/dist/components/output-entry.d.ts +17 -0
- package/dist/components/output-entry.d.ts.map +1 -0
- package/dist/components/output-entry.js +21 -0
- package/dist/components/output-entry.js.map +1 -0
- package/dist/components/output-provenance.d.ts +6 -0
- package/dist/components/output-provenance.d.ts.map +1 -0
- package/dist/components/output-provenance.js +16 -0
- package/dist/components/output-provenance.js.map +1 -0
- package/dist/components/output-status.d.ts +8 -0
- package/dist/components/output-status.d.ts.map +1 -0
- package/dist/components/output-status.js +17 -0
- package/dist/components/output-status.js.map +1 -0
- package/dist/components/paper-detail.d.ts.map +1 -1
- package/dist/components/paper-detail.js +11 -15
- package/dist/components/paper-detail.js.map +1 -1
- package/dist/components/paper-row.d.ts +9 -0
- package/dist/components/paper-row.d.ts.map +1 -0
- package/dist/components/paper-row.js +11 -0
- package/dist/components/paper-row.js.map +1 -0
- package/dist/components/record-dialog.d.ts +5 -1
- package/dist/components/record-dialog.d.ts.map +1 -1
- package/dist/components/record-dialog.js +7 -4
- package/dist/components/record-dialog.js.map +1 -1
- package/dist/lib/labels.d.ts +34 -2
- package/dist/lib/labels.d.ts.map +1 -1
- package/dist/lib/labels.js +35 -4
- package/dist/lib/labels.js.map +1 -1
- package/dist/model/index.d.ts +4 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/kind.d.ts +1 -1
- package/dist/model/kind.d.ts.map +1 -1
- package/dist/model/kind.js +0 -1
- package/dist/model/kind.js.map +1 -1
- package/dist/model/output-provenance.d.ts +17 -0
- package/dist/model/output-provenance.d.ts.map +1 -0
- package/dist/model/output-provenance.js +2 -0
- package/dist/model/output-provenance.js.map +1 -0
- package/dist/model/output-status.d.ts +17 -0
- package/dist/model/output-status.d.ts.map +1 -0
- package/dist/model/output-status.js +2 -0
- package/dist/model/output-status.js.map +1 -0
- package/dist/model/relations.d.ts +37 -12
- package/dist/model/relations.d.ts.map +1 -1
- package/dist/model/relations.js +76 -23
- package/dist/model/relations.js.map +1 -1
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +9 -1
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +1 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/output-status-glyph.d.ts +8 -0
- package/dist/primitives/output-status-glyph.d.ts.map +1 -0
- package/dist/primitives/output-status-glyph.js +13 -0
- package/dist/primitives/output-status-glyph.js.map +1 -0
- package/dist/primitives/tooltip.d.ts +7 -0
- package/dist/primitives/tooltip.d.ts.map +1 -0
- package/dist/primitives/tooltip.js +31 -0
- package/dist/primitives/tooltip.js.map +1 -0
- package/dist/views/inventory.d.ts +12 -1
- package/dist/views/inventory.d.ts.map +1 -1
- package/dist/views/inventory.js +23 -17
- package/dist/views/inventory.js.map +1 -1
- package/package.json +3 -2
- package/primitives.css +1 -0
- package/src/blocks/analysis-tree.tsx +4 -30
- package/src/blocks/decisions-list.tsx +5 -3
- package/src/blocks/findings-list.tsx +8 -7
- package/src/blocks/index.ts +2 -4
- package/src/blocks/outputs-list.tsx +43 -106
- package/src/blocks/papers-list.tsx +2 -18
- package/src/components/figure-zoom.tsx +72 -0
- package/src/components/finding-detail.tsx +106 -30
- package/src/components/index.ts +13 -0
- package/src/components/insight-trigger.tsx +2 -2
- package/src/components/output-card.tsx +51 -0
- package/src/components/output-detail.tsx +69 -21
- package/src/components/output-dialog.tsx +9 -0
- package/src/components/output-entry.tsx +61 -0
- package/src/components/output-provenance.tsx +86 -0
- package/src/components/output-status.tsx +38 -0
- package/src/components/paper-detail.tsx +52 -54
- package/src/components/paper-row.tsx +41 -0
- package/src/components/record-dialog.tsx +13 -1
- package/src/lib/labels.tsx +69 -6
- package/src/model/index.ts +6 -2
- package/src/model/kind.ts +1 -2
- package/src/model/output-provenance.ts +18 -0
- package/src/model/output-status.ts +18 -0
- package/src/model/relations.ts +92 -26
- package/src/primitives/dialog.tsx +7 -1
- package/src/primitives/index.ts +2 -0
- package/src/primitives/output-status-glyph.tsx +37 -0
- package/src/primitives/tooltip.tsx +51 -0
- package/src/views/inventory.tsx +54 -22
- package/styles/base.css +2 -1
- package/styles/blocks/analysis-tree.css +22 -25
- package/styles/blocks/findings-list.css +50 -0
- package/styles/blocks/outputs-list.css +0 -421
- package/styles/blocks/papers-list.css +4 -70
- package/styles/components/evidence.css +1 -18
- package/styles/components/figure-zoom.css +62 -0
- package/styles/components/finding-detail.css +62 -0
- package/styles/components/insight-list.css +0 -4
- package/styles/components/insight-trigger.css +8 -6
- package/styles/components/output-card.css +290 -0
- package/styles/components/output-detail.css +91 -3
- package/styles/components/output-entry.css +141 -0
- package/styles/components/output-provenance.css +94 -0
- package/styles/components/output-status.css +31 -0
- package/styles/components/paper-detail.css +112 -59
- package/styles/components/paper-row.css +72 -0
- package/styles/primitives/dialog.css +4 -22
- package/styles/primitives/tooltip.css +22 -0
- package/styles/views/inventory.css +35 -2
- package/dist/blocks/prior-insights-list.d.ts +0 -9
- package/dist/blocks/prior-insights-list.d.ts.map +0 -1
- package/dist/blocks/prior-insights-list.js +0 -29
- package/dist/blocks/prior-insights-list.js.map +0 -1
- package/src/blocks/prior-insights-list.tsx +0 -52
|
@@ -1,39 +1,55 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment, forwardRef } from 'react';
|
|
3
|
-
import { recordTitle } from '../model/records.js';
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, forwardRef, useId } from 'react';
|
|
4
3
|
import { doiHref } from '../model/doi.js';
|
|
5
|
-
import {
|
|
4
|
+
import { recordTitle } from '../model/records.js';
|
|
5
|
+
import { findingLiterature, groupFindingEvidence, } from '../model/relations.js';
|
|
6
6
|
import { cn } from '../lib/cn.js';
|
|
7
7
|
import { useLabels } from '../lib/labels.js';
|
|
8
|
-
import { DetailLayout, DetailMain } from '../primitives/detail-layout.js';
|
|
8
|
+
import { CountHeading, DetailLayout, DetailMain, DetailSection } from '../primitives/detail-layout.js';
|
|
9
9
|
import { DetailDialog } from '../primitives/dialog.js';
|
|
10
10
|
import { Prose } from '../primitives/prose.js';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import { OutputCard } from './output-card.js';
|
|
12
|
+
import { OutputEntry } from './output-entry.js';
|
|
13
|
+
const isResolved = (group) => Boolean(group.output && group.analysis);
|
|
14
|
+
/**
|
|
15
|
+
* One run of results of a kind. The label only earns its space when a finding
|
|
16
|
+
* rests on more than one kind: with a single run, what they are is evident.
|
|
17
|
+
*/
|
|
18
|
+
function ResultRun({ label, labelled, children }) {
|
|
19
|
+
const id = useId();
|
|
20
|
+
if (!labelled)
|
|
21
|
+
return _jsx(_Fragment, { children: children });
|
|
22
|
+
return (_jsxs("section", { "aria-labelledby": id, children: [_jsx("h5", { id: id, className: "astra-finding-detail__group-heading", children: label }), children] }));
|
|
23
|
+
}
|
|
24
|
+
/** The claim, the results it rests on, and the literature it cites. */
|
|
25
|
+
export const FindingDetail = forwardRef(function FindingDetail({ record, evidence, renderText, renderArtifact, onOpenRecord, className, ...props }, ref) {
|
|
14
26
|
const literature = findingLiterature(record);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const results = groupFindingEvidence(evidence);
|
|
28
|
+
// Grouped the way the inventory groups an analysis's outputs, so a result
|
|
29
|
+
// looks the same wherever it is met. Unresolved artifacts have no record to
|
|
30
|
+
// draw, so they keep their name and nothing more.
|
|
31
|
+
const resolved = results.filter(isResolved);
|
|
32
|
+
const ofType = (type) => resolved.filter(({ output }) => output.type === type);
|
|
33
|
+
const figures = ofType('figure');
|
|
34
|
+
const tables = ofType('table');
|
|
35
|
+
const metrics = ofType('metric');
|
|
36
|
+
const files = resolved.filter(({ output }) => !['figure', 'table', 'metric'].includes(output.type));
|
|
37
|
+
const unresolved = results.filter((group) => !isResolved(group));
|
|
38
|
+
// Labels only appear once a finding rests on more than one kind of result.
|
|
39
|
+
const runs = [figures.length, tables.length, metrics.length, files.length + unresolved.length];
|
|
40
|
+
const labelled = runs.filter(Boolean).length > 1;
|
|
41
|
+
const open = (group) => () => { onOpenRecord?.(group.output, group.analysis); };
|
|
42
|
+
// Say what the result is to this finding; the card's own name would only
|
|
43
|
+
// say what kind of artifact it is.
|
|
44
|
+
const resultLabel = (group) => `View supporting result: ${recordTitle(group.output)}`;
|
|
45
|
+
return (_jsx(DetailLayout, { "data-slot": "finding-detail", ...props, ref: ref, layout: "single", className: cn('astra-finding-detail', className), children: _jsxs(DetailMain, { children: [_jsx(DetailSection, { label: "Claim", heading: "section", children: _jsx(Prose, { text: record.claim, field: "claim", renderText: renderText }) }), record.notes ? (_jsxs("section", { className: "astra-finding-detail__notes", children: [_jsx("h4", { children: "Notes" }), _jsx("div", { children: _jsx(Prose, { text: record.notes, field: "notes", renderText: renderText }) })] })) : null, _jsxs("section", { className: "astra-finding-detail__results", children: [_jsx(CountHeading, { title: "Supporting results", count: results.length }), results.length ? (_jsxs(_Fragment, { children: [[['Figures', figures], ['Tables', tables]].map(([label, groups]) => (groups.length ? (_jsx(ResultRun, { label: label, labelled: labelled, children: _jsx("div", { className: "astra-finding-detail__gallery", children: groups.map((group) => (_jsx(OutputCard, { output: group.output, renderArtifact: renderArtifact, "aria-label": resultLabel(group), onOpen: open(group) }, group.key))) }) }, label)) : null)), metrics.length ? (_jsx(ResultRun, { label: "Metrics", labelled: labelled, children: _jsx("ul", { className: "astra-finding-detail__tiles", children: metrics.map((group) => (_jsx("li", { children: _jsx(OutputEntry, { output: group.output, renderArtifact: renderArtifact, "aria-label": resultLabel(group), onOpen: open(group) }) }, group.key))) }) })) : null, files.length || unresolved.length ? (_jsx(ResultRun, { label: "Output files", labelled: labelled, children: _jsxs("ul", { className: "astra-finding-detail__files", children: [files.map((group) => (_jsx("li", { children: _jsx(OutputEntry, { output: group.output, "aria-label": resultLabel(group), onOpen: open(group) }) }, group.key))), unresolved.map((group) => (_jsx("li", { className: "astra-finding-detail__unresolved", children: group.artifact ?? group.key }, group.key)))] }) })) : null] })) : _jsx("p", { children: "No supporting results are linked to this finding." })] }), literature.map((source, index) => {
|
|
30
46
|
const doi = source.doi ?? '';
|
|
31
47
|
const location = source.location?.page ? ` · page ${source.location.page}` : '';
|
|
32
48
|
return (_jsxs(Fragment, { children: [_jsxs("section", { className: "astra-insight-detail__paper astra-paper-doi", children: [_jsx("h4", { children: "Source paper" }), _jsxs("a", { href: doiHref(doi), target: "_blank", rel: "noreferrer", children: [doi, location, " \u2197"] })] }), source.quote ? (_jsxs("section", { className: "astra-insight-detail__source-quote", children: [_jsx("h4", { children: "Source passage" }), _jsx("blockquote", { children: _jsx(Prose, { text: source.quote.exact, field: "quote", renderText: renderText }) })] })) : null] }, `${doi}-${index}`));
|
|
33
49
|
})] }) }));
|
|
34
50
|
});
|
|
35
|
-
export function FindingDialog({ record, evidence, renderText, onOpenRecord, ...dialog }) {
|
|
51
|
+
export function FindingDialog({ record, evidence, renderText, renderArtifact, onOpenRecord, ...dialog }) {
|
|
36
52
|
const labels = useLabels();
|
|
37
|
-
return (_jsx(DetailDialog, { ...dialog, kind: "finding", kindLabel: labels.kinds.finding, title: record
|
|
53
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "finding", kindLabel: labels.kinds.finding, title: recordTitle(record), closeLabel: labels.closeRecord(labels.kinds.finding), children: _jsx(FindingDetail, { record: record, evidence: evidence, renderText: renderText, renderArtifact: renderArtifact, onOpenRecord: onOpenRecord }) }));
|
|
38
54
|
}
|
|
39
55
|
//# sourceMappingURL=finding-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finding-detail.js","sourceRoot":"","sources":["../../src/components/finding-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"finding-detail.js","sourceRoot":"","sources":["../../src/components/finding-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAuC,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACvG,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAehD,MAAM,UAAU,GAAG,CAAC,KAA2B,EAA0B,EAAE,CACzE,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;AAE1C;;;GAGG;AACH,SAAS,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ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AC,KAAK,CAAC,CAAC,CAAC,CACd,mBAAS,SAAS,EAAC,oCAAoC,aACrD,0CAAuB,EACvB,+BAAY,KAAC,KAAK,IAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,UAAU,EAAE,UAAU,GAAI,GAAa,IAC1F,CACX,CAAC,CAAC,CAAC,IAAI,KAVK,GAAG,GAAG,IAAI,KAAK,EAAE,CAWrB,CACZ,CAAC;gBACJ,CAAC,CAAC,IACS,GACA,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAIH,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,MAAM,EAAsB;IACzH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,OACP,MAAM,EACV,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAC/B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,YAEpD,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,GAAI,GAC5H,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -23,4 +23,13 @@ export { ArtifactPreview } from './artifact-preview.js';
|
|
|
23
23
|
export type { ArtifactPreviewProps, ArtifactRenderOptions, ArtifactRenderer } from './artifact-preview.js';
|
|
24
24
|
export { PaperPdfViewer } from './paper-pdf-viewer.js';
|
|
25
25
|
export type { PaperPdfViewerProps, PdfLoadState, PdfPassage } from './paper-pdf-viewer.js';
|
|
26
|
+
export { OutputCard } from './output-card.js';
|
|
27
|
+
export type { OutputCardProps } from './output-card.js';
|
|
28
|
+
export { OutputEntry } from './output-entry.js';
|
|
29
|
+
export type { OutputEntryProps } from './output-entry.js';
|
|
30
|
+
export { PaperRow } from './paper-row.js';
|
|
31
|
+
export type { PaperRowProps } from './paper-row.js';
|
|
32
|
+
export { OutputStatusIndicator } from './output-status.js';
|
|
33
|
+
export type { OutputStatusIndicatorProps } from './output-status.js';
|
|
34
|
+
export { OutputProvenance, type OutputProvenanceProps } from './output-provenance.js';
|
|
26
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,sJAAsJ;AACtJ,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACl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E,MAAM,uBAAuB,CAAC;AAE3G,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -11,4 +11,9 @@ export { RecordDialog } from './record-dialog.js';
|
|
|
11
11
|
export { RecordPreview } from './record-preview.js';
|
|
12
12
|
export { ArtifactPreview } from './artifact-preview.js';
|
|
13
13
|
export { PaperPdfViewer } from './paper-pdf-viewer.js';
|
|
14
|
+
export { OutputCard } from './output-card.js';
|
|
15
|
+
export { OutputEntry } from './output-entry.js';
|
|
16
|
+
export { PaperRow } from './paper-row.js';
|
|
17
|
+
export { OutputStatusIndicator } from './output-status.js';
|
|
18
|
+
export { OutputProvenance } from './output-provenance.js';
|
|
14
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,sJAAsJ;AACtJ,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CA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AAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAUpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAA8B,MAAM,wBAAwB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { recordTitle } from '../model/records.js';
|
|
|
5
5
|
import { cn } from '../lib/cn.js';
|
|
6
6
|
import { Prose } from '../primitives/prose.js';
|
|
7
7
|
export function InsightEvidenceTitle({ name, tag }) {
|
|
8
|
-
return (_jsxs("span", { className: "astra-evidence__title", children: [_jsx(KindGlyph, {
|
|
8
|
+
return (_jsxs("span", { className: "astra-evidence__title", children: [_jsx(KindGlyph, { kind: "prior_insight" }), _jsx("span", { className: "astra-evidence__name", children: name }), tag ? _jsx("span", { className: "astra-evidence__tag", children: tag }) : null] }));
|
|
9
9
|
}
|
|
10
10
|
/** A clickable reference to an insight, as a title or as its claim. */
|
|
11
11
|
export const InsightTrigger = forwardRef(function InsightTrigger({ insight, onOpen, tag = 'prior insight', variant = 'title', renderText, className, onClick, onKeyDown, ...props }, ref) {
|
|
@@ -26,7 +26,7 @@ export const InsightTrigger = forwardRef(function InsightTrigger({ insight, onOp
|
|
|
26
26
|
if (variant === 'claim') {
|
|
27
27
|
// A div rather than a <button>: block prose inside a button would inherit
|
|
28
28
|
// UA control fonts and shift the layout.
|
|
29
|
-
return (_jsxs("div", { ...props, ref: ref, "data-slot": "insight-trigger", className: cn('astra-insight-trigger', className), "data-variant": "claim", role: "button", tabIndex: 0, "aria-label": props['aria-label'] ?? `Open insight details: ${title}`, onClick: open, onKeyDown: keyOpen, children: [_jsx(KindGlyph, { className: "astra-
|
|
29
|
+
return (_jsxs("div", { ...props, ref: ref, "data-slot": "insight-trigger", className: cn('astra-insight-trigger', className), "data-variant": "claim", role: "button", tabIndex: 0, "aria-label": props['aria-label'] ?? `Open insight details: ${title}`, onClick: open, onKeyDown: keyOpen, children: [_jsx(KindGlyph, { className: "astra-insight-trigger__glyph", kind: "prior_insight" }), _jsx("div", { className: "astra-insight-trigger__claim", children: _jsx(Prose, { text: insight.claim, field: "claim", renderText: renderText }) })] }));
|
|
30
30
|
}
|
|
31
31
|
return (_jsx("button", { ...props, ref: ref, type: "button", "data-slot": "insight-trigger", className: cn('astra-insight-trigger', className), "data-variant": "title", "aria-label": props['aria-label'] ?? `Open insight details: ${title}`, onClick: open, onKeyDown: onKeyDown, children: _jsx(InsightEvidenceTitle, { name: title, tag: tag ?? undefined }) }));
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insight-trigger.js","sourceRoot":"","sources":["../../src/components/insight-trigger.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EACL,UAAU,GAMX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAQ/C,MAAM,UAAU,oBAAoB,CAAC,EAAE,IAAI,EAAE,GAAG,EAA6B;IAC3E,OAAO,CACL,gBAAM,SAAS,EAAC,uBAAuB,aACrC,KAAC,SAAS,IAAC,
|
|
1
|
+
{"version":3,"file":"insight-trigger.js","sourceRoot":"","sources":["../../src/components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
|
|
3
|
+
import type { OutputStatus } from '../model/output-status.js';
|
|
4
|
+
import type { ArtifactRenderer } from './artifact-preview.js';
|
|
5
|
+
export interface OutputCardProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
6
|
+
output: ResolvedOutput;
|
|
7
|
+
status?: OutputStatus | undefined;
|
|
8
|
+
renderArtifact?: ArtifactRenderer | undefined;
|
|
9
|
+
onOpen: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** A gallery card: compact preview and title, with a type label for non-figures. */
|
|
12
|
+
export declare const OutputCard: import("react").ForwardRefExoticComponent<OutputCardProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
//# sourceMappingURL=output-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-card.d.ts","sourceRoot":"","sources":["../../src/components/output-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC1F,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,cAAc,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,oFAAoF;AACpF,eAAO,MAAM,UAAU,+GAiCrB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { OutputStatusIndicator } from './output-status.js';
|
|
4
|
+
import { recordTitle } from '../model/records.js';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
import { OutputPreview } from './output-detail.js';
|
|
7
|
+
/** A gallery card: compact preview and title, with a type label for non-figures. */
|
|
8
|
+
export const OutputCard = forwardRef(function OutputCard({ output, status, renderArtifact, onOpen, className, onClick, 'aria-label': hostLabel, ...props }, ref) {
|
|
9
|
+
const title = recordTitle(output);
|
|
10
|
+
return (_jsxs("button", { "data-slot": "output-card", ...props, ref: ref, type: "button", className: cn('astra-output-card', className), "aria-label": hostLabel ?? `Open ${output.type}: ${title}`, onClick: (event) => { onClick?.(event); onOpen(); }, children: [_jsx(OutputStatusIndicator, { status: status }), _jsxs("span", { className: "astra-output-card__preview", children: [_jsx(OutputPreview, { output: output, compact: true, renderArtifact: renderArtifact }), _jsx("span", { className: "astra-output-card__open", "aria-hidden": "true", children: "Open \u2197" })] }), _jsxs("span", { className: "astra-output-card__body", children: [output.type !== 'figure' ? _jsx("span", { className: "astra-output-card__kind", children: output.type }) : null, _jsx("strong", { children: title }), output.label ? _jsx("code", { children: output.id }) : null] })] }));
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=output-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-card.js","sourceRoot":"","sources":["../../src/components/output-card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASnD,oFAAoF;AACpF,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAqC,SAAS,UAAU,CAAC,EAC3F,MAAM,EACN,MAAM,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,CACL,+BACY,aAAa,KACnB,KAAK,EACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,gBACjC,SAAS,IAAI,QAAQ,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,EACxD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,aAEnD,KAAC,qBAAqB,IAAC,MAAM,EAAE,MAAM,GAAI,EACzC,gBAAM,SAAS,EAAC,4BAA4B,aAC1C,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,QAAC,cAAc,EAAE,cAAc,GAAI,EACzE,eAAM,SAAS,EAAC,yBAAyB,iBAAa,MAAM,4BAAc,IACrE,EACP,gBAAM,SAAS,EAAC,yBAAyB,aACtC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,yBAAyB,YAAE,MAAM,CAAC,IAAI,GAAQ,CAAC,CAAC,CAAC,IAAI,EACjG,2BAAS,KAAK,GAAU,EACvB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAO,MAAM,CAAC,EAAE,GAAQ,CAAC,CAAC,CAAC,IAAI,IAC1C,IACA,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedOutput } from '@astra-spec/sdk';
|
|
2
|
-
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
3
3
|
import type { OutputRelations } from '../model/relations.js';
|
|
4
4
|
import { type ArtifactRenderer } from './artifact-preview.js';
|
|
5
5
|
import type { TextRenderer } from '../lib/prose.js';
|
|
@@ -15,6 +15,10 @@ export interface OutputDetailProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
15
15
|
record: ResolvedOutput;
|
|
16
16
|
relations: OutputRelations;
|
|
17
17
|
renderArtifact?: ArtifactRenderer | undefined;
|
|
18
|
+
/** Recorded execution information, shown below Recipe. */
|
|
19
|
+
renderProvenance?: ((output: ResolvedOutput) => ReactNode) | undefined;
|
|
20
|
+
/** Host-provided link to the current code file, shown beside Recipe. */
|
|
21
|
+
renderCodeLink?: ((output: ResolvedOutput) => ReactNode) | undefined;
|
|
18
22
|
renderText?: TextRenderer | undefined;
|
|
19
23
|
onOpenRecord?: OpenRecordHandler | undefined;
|
|
20
24
|
/** Full-screen artifact state (controlled). */
|
|
@@ -29,6 +33,6 @@ export interface OutputDialogActionsProps {
|
|
|
29
33
|
expanded: boolean;
|
|
30
34
|
onExpandedChange: (expanded: boolean) => void;
|
|
31
35
|
}
|
|
32
|
-
/** Header actions
|
|
36
|
+
/** Header actions: open the artifact in the host, or expand a table. */
|
|
33
37
|
export declare function OutputDialogActions({ record: output, onOpenArtifact, expanded, onExpandedChange }: OutputDialogActionsProps): import("react").JSX.Element;
|
|
34
38
|
//# sourceMappingURL=output-detail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-detail.d.ts","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAA8C,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"output-detail.d.ts","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAA8C,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM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AM,YAAY,8GAmKvB,CAAC;AAEH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EAAE,wBAAwB,+BAuB3H"}
|
|
@@ -8,6 +8,7 @@ import { DialogAction, useDialogDismissGuard, useOptionalDialog } from '../primi
|
|
|
8
8
|
import { Prose } from '../primitives/prose.js';
|
|
9
9
|
import { RelationList } from '../primitives/relation-list.js';
|
|
10
10
|
import { relationItemsForLinks } from './relation-items.js';
|
|
11
|
+
import { FigureZoom } from './figure-zoom.js';
|
|
11
12
|
/** The host's artifact renderer, or the built-in placeholder preview. */
|
|
12
13
|
export function OutputPreview({ output, compact = false, renderArtifact }) {
|
|
13
14
|
return renderArtifact
|
|
@@ -15,19 +16,52 @@ export function OutputPreview({ output, compact = false, renderArtifact }) {
|
|
|
15
16
|
: _jsx(ArtifactPreview, { output: output, compact: compact });
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
* What the detail shows in its artifact box:
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* What the detail shows in its artifact box: only a figure or a table has a
|
|
20
|
+
* picture to frame, rendered by the host when it supplies a renderer. A data
|
|
21
|
+
* file or a metric gets no box — an empty reader column is all whitespace —
|
|
22
|
+
* so the host renderer is not consulted for them here; `OutputPreview` still
|
|
23
|
+
* asks it for the compact preview of any type, and a metric's value is asked
|
|
24
|
+
* for as a compact rendering below.
|
|
21
25
|
*/
|
|
22
26
|
function artifactNode(output, renderArtifact) {
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
25
|
-
return
|
|
27
|
+
if (!isVisualOutput(output))
|
|
28
|
+
return null;
|
|
29
|
+
return renderArtifact
|
|
30
|
+
? renderArtifact(output, { compact: false })
|
|
31
|
+
: _jsx(ArtifactPreview, { output: output, compact: false });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One decision per row. A decision the output declares reads plainly; one it
|
|
35
|
+
* inherits says which upstream output carries it, so a list that mixes the two
|
|
36
|
+
* still shows where each came from.
|
|
37
|
+
*/
|
|
38
|
+
function decisionDependencyItems(relations, onOpenRecord) {
|
|
39
|
+
return relationItemsForLinks(relations.decisions, onOpenRecord).map((item, index) => {
|
|
40
|
+
const via = relations.decisions[index]?.via;
|
|
41
|
+
const origins = via?.map(({ record, canonicalPath }) => record ? recordTitle(record) : canonicalPath);
|
|
42
|
+
if (!origins?.length)
|
|
43
|
+
return item;
|
|
44
|
+
const detail = `via ${origins.join(', ')}`;
|
|
45
|
+
return {
|
|
46
|
+
...item,
|
|
47
|
+
// The truncated text is for sighted readers; assistive technology gets
|
|
48
|
+
// the full list, whether or not the row becomes a navigation trigger
|
|
49
|
+
// (only a trigger carries `accessibleLabel`).
|
|
50
|
+
detail: origins.length > 1
|
|
51
|
+
? (_jsxs("span", { title: detail, children: [_jsxs("span", { "aria-hidden": "true", children: ["via ", origins[0], " +", origins.length - 1, " more"] }), _jsx("span", { className: "astra-output-detail__visually-hidden", children: detail })] }))
|
|
52
|
+
: detail,
|
|
53
|
+
accessibleLabel: item.accessibleLabel ? `${item.accessibleLabel}, ${detail}` : undefined,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
26
56
|
}
|
|
27
57
|
/** Artifact preview with provenance: description, recipe, alias, decisions, and inputs. */
|
|
28
|
-
export const OutputDetail = forwardRef(function OutputDetail({ record: output, relations, renderArtifact, renderText, onOpenRecord, expanded = false, onExpandedChange, className, ...props }, ref) {
|
|
58
|
+
export const OutputDetail = forwardRef(function OutputDetail({ record: output, relations, renderArtifact, renderProvenance, renderCodeLink, renderText, onOpenRecord, expanded = false, onExpandedChange, className, ...props }, ref) {
|
|
29
59
|
const labels = useLabels();
|
|
30
60
|
const artifact = artifactNode(output, renderArtifact);
|
|
61
|
+
// A metric's whole artifact is one number: it reads as a pill at the head of
|
|
62
|
+
// the provenance, above the description, not as a figure stretched across a
|
|
63
|
+
// reader column.
|
|
64
|
+
const metric = output.type === 'metric' ? renderArtifact?.(output, { compact: true }) : null;
|
|
31
65
|
// Reader layout (artifact column + details rail) only when there is an
|
|
32
66
|
// artifact to frame: a host renderer may opt out of a figure or table by
|
|
33
67
|
// returning null, and the details then take the single column instead.
|
|
@@ -81,17 +115,19 @@ export const OutputDetail = forwardRef(function OutputDetail({ record: output, r
|
|
|
81
115
|
opener.focus();
|
|
82
116
|
};
|
|
83
117
|
}, [expanded]);
|
|
84
|
-
const supportingDetails = (_jsxs("aside", { className: "astra-output-detail__provenance", "aria-label": "Output provenance and dependencies", children: [output.description ? (_jsxs("section", { className: "astra-output-detail__description", children: [_jsx("h4", { children: "Description" }), _jsx("div", { className: "astra-output-detail__description-text", children: _jsx(Prose, { text: output.description, field: "description", renderText: renderText }) })] })) : null, output.resolvedFrom ? (_jsx(RelationList, { className: "astra-detail__relations", title: "Resolved alias", items: relationItemsForLinks([relations.alias ?? { canonicalPath: output.resolvedFrom }], onOpenRecord), empty: null })) : null, _jsx(RelationList, { className: "astra-detail__relations", title: "Decision dependencies", items:
|
|
118
|
+
const supportingDetails = (_jsxs("aside", { className: "astra-output-detail__provenance", "aria-label": "Output provenance and dependencies", children: [metric ? (_jsxs("section", { className: "astra-output-detail__metric", children: [_jsx("h4", { children: "Metric" }), _jsx("div", { className: "astra-output-detail__metric-pill", children: metric })] })) : null, output.description ? (_jsxs("section", { className: "astra-output-detail__description", children: [_jsx("h4", { children: "Description" }), _jsx("div", { className: "astra-output-detail__description-text", children: _jsx(Prose, { text: output.description, field: "description", renderText: renderText }) })] })) : null, output.resolvedFrom ? (_jsx(RelationList, { className: "astra-detail__relations", title: "Resolved alias", items: relationItemsForLinks([relations.alias ?? { canonicalPath: output.resolvedFrom }], onOpenRecord), empty: null })) : null, _jsx(RelationList, { className: "astra-detail__relations", title: "Decision dependencies", items: decisionDependencyItems(relations, onOpenRecord), empty: "No decisions affect this output." }), _jsx(RelationList, { className: "astra-detail__relations", title: "Inputs and upstream outputs", items: relationItemsForLinks(relations.inputs, onOpenRecord).map((item) => (item.kind === 'output' ? { ...item, detail: 'intermediate output' } : item)), empty: "No upstream dependencies are declared for this output." }), output.recipe?.command ? (_jsxs("section", { className: "astra-output-detail__recipe", children: [_jsxs("div", { className: "astra-output-detail__recipe-heading", children: [_jsx("h4", { children: "Recipe" }), renderCodeLink?.(output)] }), _jsx("pre", { children: _jsx("code", { children: output.recipe.command }) }), output.recipe.container
|
|
85
119
|
? _jsxs("p", { children: ["Container: ", _jsx("code", { children: output.recipe.container })] })
|
|
86
|
-
: null] })) : null] }));
|
|
120
|
+
: null] })) : null, renderProvenance?.(output)] }));
|
|
87
121
|
return (_jsxs("div", { "data-slot": "output-detail", ...props, ref: ref, className: cn('astra-output-detail__layout', className), "data-layout": visual ? 'reader' : 'single', children: [_jsxs("div", { className: "astra-output-detail__result", children: [artifact != null ? (_jsxs("div", { ref: layerRef, className: "astra-output-detail__artifact", "data-type": output.type, ...(expanded
|
|
88
122
|
? { 'data-expanded': '', role: 'dialog', 'aria-modal': 'true', 'aria-label': `Full-screen ${output.type}: ${recordTitle(output)}` }
|
|
89
|
-
: {}), children: [expanded ? (_jsxs("div", { className: "astra-output-detail__fullscreen-header", children: [_jsxs("span", { children: [_jsx("small", { children: labels.actions.fullScreen }), _jsx("strong", { children: recordTitle(output) })] }), _jsxs("button", { type: "button", onClick: () => onExpandedChange?.(false), children: [_jsx("span", { "aria-hidden": "true", children: "\u00D7" }), _jsx("span", { children: labels.actions.exitFullScreen })] })] })) : null, _jsx("div", { className: "astra-output-detail__preview", "data-type": output.type, children:
|
|
123
|
+
: {}), children: [expanded ? (_jsxs("div", { className: "astra-output-detail__fullscreen-header", children: [_jsxs("span", { children: [_jsx("small", { children: labels.actions.fullScreen }), _jsx("strong", { children: recordTitle(output) })] }), _jsxs("button", { type: "button", onClick: () => onExpandedChange?.(false), children: [_jsx("span", { "aria-hidden": "true", children: "\u00D7" }), _jsx("span", { children: labels.actions.exitFullScreen })] })] })) : null, _jsx("div", { className: "astra-output-detail__preview", "data-type": output.type, children: output.type === 'figure'
|
|
124
|
+
? _jsx(FigureZoom, { children: artifact }, output.canonicalPath)
|
|
125
|
+
: artifact })] })) : null, !visual ? supportingDetails : null] }), visual ? _jsx("div", { className: "astra-output-detail__provenance-slot", children: supportingDetails }) : null] }));
|
|
90
126
|
});
|
|
91
|
-
/** Header actions
|
|
127
|
+
/** Header actions: open the artifact in the host, or expand a table. */
|
|
92
128
|
export function OutputDialogActions({ record: output, onOpenArtifact, expanded, onExpandedChange }) {
|
|
93
129
|
const labels = useLabels();
|
|
94
|
-
const
|
|
95
|
-
return (_jsxs(_Fragment, { children: [onOpenArtifact && output.artifact ? (_jsxs(DialogAction, { onClick: () => { void onOpenArtifact(output); }, children: [_jsx("span", { "aria-hidden": "true", children: "\u2197" }), _jsx("span", { children: labels.actions.openArtifact })] })) : null,
|
|
130
|
+
const canExpand = output.type === 'table';
|
|
131
|
+
return (_jsxs(_Fragment, { children: [onOpenArtifact && output.artifact ? (_jsxs(DialogAction, { onClick: () => { void onOpenArtifact(output); }, children: [_jsx("span", { "aria-hidden": "true", children: "\u2197" }), _jsx("span", { children: labels.actions.openArtifact })] })) : null, canExpand ? (_jsxs(DialogAction, { "aria-label": `View ${output.type} full screen`, "aria-expanded": expanded, onClick: () => { onExpandedChange(true); }, children: [_jsx("span", { "aria-hidden": "true", children: "\u26F6" }), _jsx("span", { children: labels.actions.fullScreen })] })) : null] }));
|
|
96
132
|
}
|
|
97
133
|
//# sourceMappingURL=output-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-detail.js","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAuC,MAAM,OAAO,CAAC;AAExG,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAyB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"output-detail.js","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAuC,MAAM,OAAO,CAAC;AAExG,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAyB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,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AAU,GAAQ,IAC3B,CAChB,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { ResolvedOutput } from '@astra-spec/sdk';
|
|
2
3
|
import type { OutputRelations } from '../model/relations.js';
|
|
3
4
|
import type { ArtifactRenderer } from './artifact-preview.js';
|
|
@@ -8,11 +9,15 @@ export interface OutputDialogProps extends Pick<DetailDialogProps, 'mode' | 'bac
|
|
|
8
9
|
record: ResolvedOutput;
|
|
9
10
|
relations: OutputRelations;
|
|
10
11
|
renderArtifact?: ArtifactRenderer | undefined;
|
|
12
|
+
/** Host renderer for recorded output provenance, shown below Recipe. */
|
|
13
|
+
renderProvenance?: ((output: ResolvedOutput) => ReactNode) | undefined;
|
|
14
|
+
/** Host-provided link to the current code file, shown beside Recipe. */
|
|
15
|
+
renderCodeLink?: ((output: ResolvedOutput) => ReactNode) | undefined;
|
|
11
16
|
renderText?: TextRenderer | undefined;
|
|
12
17
|
onOpenArtifact?: ((output: ResolvedOutput) => void | Promise<void>) | undefined;
|
|
13
18
|
onOpenRecord?: OpenRecordHandler | undefined;
|
|
14
19
|
expanded?: boolean | undefined;
|
|
15
20
|
onExpandedChange?: ((expanded: boolean) => void) | undefined;
|
|
16
21
|
}
|
|
17
|
-
export declare function OutputDialog({ record: output, relations, renderArtifact, renderText, onOpenArtifact, onOpenRecord, expanded: controlledExpanded, onExpandedChange, ...dialog }: OutputDialogProps): import("react").JSX.Element;
|
|
22
|
+
export declare function OutputDialog({ record: output, relations, renderArtifact, renderProvenance, renderCodeLink, renderText, onOpenArtifact, onOpenRecord, expanded: controlledExpanded, onExpandedChange, ...dialog }: OutputDialogProps): import("react").JSX.Element;
|
|
18
23
|
//# sourceMappingURL=output-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-dialog.d.ts","sourceRoot":"","sources":["../../src/components/output-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AG,SAAS,CAAC;CAC9D;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,gBAAgB,EAChB,GAAG,MAAM,EACV,EAAE,iBAAiB,+BAiCnB"}
|
|
@@ -4,9 +4,9 @@ import { useLabels } from '../lib/labels.js';
|
|
|
4
4
|
import { DetailDialog } from '../primitives/dialog.js';
|
|
5
5
|
import { OutputDetail, OutputDialogActions } from './output-detail.js';
|
|
6
6
|
import { useOutputExpanded } from '../lib/use-output-expanded.js';
|
|
7
|
-
export function OutputDialog({ record: output, relations, renderArtifact, renderText, onOpenArtifact, onOpenRecord, expanded: controlledExpanded, onExpandedChange, ...dialog }) {
|
|
7
|
+
export function OutputDialog({ record: output, relations, renderArtifact, renderProvenance, renderCodeLink, renderText, onOpenArtifact, onOpenRecord, expanded: controlledExpanded, onExpandedChange, ...dialog }) {
|
|
8
8
|
const labels = useLabels();
|
|
9
9
|
const [expanded, setExpanded] = useOutputExpanded(output, { expanded: controlledExpanded, onExpandedChange });
|
|
10
|
-
return (_jsx(DetailDialog, { ...dialog, kind: "output", layout: isVisualOutput(output) ? 'reader' : undefined, kindLabel: output.type, title: recordTitle(output), closeLabel: labels.closeRecord(labels.kinds.output), actions: (_jsx(OutputDialogActions, { record: output, onOpenArtifact: onOpenArtifact, expanded: expanded, onExpandedChange: setExpanded })), children: _jsx(OutputDetail, { record: output, relations: relations, renderArtifact: renderArtifact, renderText: renderText, onOpenRecord: onOpenRecord, expanded: expanded, onExpandedChange: setExpanded }) }));
|
|
10
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "output", layout: isVisualOutput(output) ? 'reader' : undefined, kindLabel: output.type, title: recordTitle(output), closeLabel: labels.closeRecord(labels.kinds.output), actions: (_jsx(OutputDialogActions, { record: output, onOpenArtifact: onOpenArtifact, expanded: expanded, onExpandedChange: setExpanded })), children: _jsx(OutputDetail, { record: output, relations: relations, renderArtifact: renderArtifact, renderProvenance: renderProvenance, renderCodeLink: renderCodeLink, renderText: renderText, onOpenRecord: onOpenRecord, expanded: expanded, onExpandedChange: setExpanded }) }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=output-dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-dialog.js","sourceRoot":"","sources":["../../src/components/output-dialog.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"output-dialog.js","sourceRoot":"","sources":["../../src/components/output-dialog.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAkBlE,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,gBAAgB,EAChB,GAAG,MAAM,EACS;IAClB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC9G,OAAO,CACL,KAAC,YAAY,OACP,MAAM,EACV,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACrD,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EACnD,OAAO,EAAE,CACP,KAAC,mBAAmB,IAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,WAAW,GAC7B,CACH,YAED,KAAC,YAAY,IACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,WAAW,GAC7B,GACW,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResolvedOutput } from '@astra-spec/sdk';
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import type { OutputStatus } from '../model/output-status.js';
|
|
4
|
+
import type { ArtifactRenderer } from './artifact-preview.js';
|
|
5
|
+
export interface OutputEntryProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
6
|
+
output: ResolvedOutput;
|
|
7
|
+
status?: OutputStatus | undefined;
|
|
8
|
+
renderArtifact?: ArtifactRenderer | undefined;
|
|
9
|
+
onOpen: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One output at a glance, for the types a gallery card would waste space on: a
|
|
13
|
+
* metric reads as its value over its name, anything else as its name. The row
|
|
14
|
+
* it wraps in decides how a run of these is laid out.
|
|
15
|
+
*/
|
|
16
|
+
export declare const OutputEntry: import("react").ForwardRefExoticComponent<OutputEntryProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
//# sourceMappingURL=output-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-entry.d.ts","sourceRoot":"","sources":["../../src/components/output-entry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC3F,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,cAAc,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,gHAwCtB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { OutputStatusIndicator } from './output-status.js';
|
|
4
|
+
import { recordTitle } from '../model/records.js';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
/**
|
|
7
|
+
* One output at a glance, for the types a gallery card would waste space on: a
|
|
8
|
+
* metric reads as its value over its name, anything else as its name. The row
|
|
9
|
+
* it wraps in decides how a run of these is laid out.
|
|
10
|
+
*/
|
|
11
|
+
export const OutputEntry = forwardRef(function OutputEntry({ output, status, renderArtifact, onOpen, className, onClick, 'aria-label': hostLabel, ...props }, ref) {
|
|
12
|
+
const title = recordTitle(output);
|
|
13
|
+
const metric = output.type === 'metric';
|
|
14
|
+
// Why the document itself has nothing to show, before any host status.
|
|
15
|
+
const absenceNote = !output.active ? 'Inactive' : !output.artifact ? 'Not yet generated' : undefined;
|
|
16
|
+
return (_jsxs("button", { "data-slot": "output-entry", ...props, ref: ref, type: "button", className: cn('astra-output-entry', className), "data-kind": metric ? 'metric' : 'file', "aria-label": hostLabel ?? `Open ${output.type}: ${title}`, onClick: (event) => { onClick?.(event); onOpen(); }, children: [_jsx(OutputStatusIndicator, { status: status }), _jsxs("span", { className: "astra-output-entry__name", children: [title, !metric && absenceNote && !status ? _jsx("span", { className: "astra-output-entry__status", children: absenceNote }) : null] }), metric ? (_jsx("span", { className: "astra-output-entry__value", children: status?.state === 'stale' && !output.artifact
|
|
17
|
+
? _jsx("span", { className: "astra-artifact__metric-value", "aria-label": "No value", children: "\u2013" })
|
|
18
|
+
: renderArtifact?.(output, { compact: true })
|
|
19
|
+
?? _jsx("span", { className: "astra-output-entry__status", children: absenceNote ?? 'Preview unavailable' }) })) : null] }));
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=output-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-entry.js","sourceRoot":"","sources":["../../src/components/output-entry.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAUlC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAsC,SAAS,WAAW,CAAC,EAC9F,MAAM,EACN,MAAM,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,QA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AC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { OutputProvenanceData } from '../model/output-provenance.js';
|
|
3
|
+
export type OutputProvenanceProps = HTMLAttributes<HTMLDivElement> & OutputProvenanceData;
|
|
4
|
+
/** Compact run summary with the full execution metadata in a detail dialog. */
|
|
5
|
+
export declare const OutputProvenance: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & OutputProvenanceData & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
//# sourceMappingURL=output-provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-provenance.d.ts","sourceRoot":"","sources":["../../src/components/output-provenance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAI1E,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,oBAAoB,CAAC;AAE1F,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,kJA2E3B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState } from 'react';
|
|
3
|
+
import { cn } from '../lib/cn.js';
|
|
4
|
+
import { useLabels } from '../lib/labels.js';
|
|
5
|
+
import { DetailDialog } from '../primitives/dialog.js';
|
|
6
|
+
import { OutputStatusGlyph } from '../primitives/output-status-glyph.js';
|
|
7
|
+
/** Compact run summary with the full execution metadata in a detail dialog. */
|
|
8
|
+
export const OutputProvenance = forwardRef(function OutputProvenance({ status, run, error, className, ...props }, ref) {
|
|
9
|
+
const labels = useLabels();
|
|
10
|
+
const copy = labels.provenance;
|
|
11
|
+
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
12
|
+
const stateLabel = status ? labels.status[status.state] : copy.unknown;
|
|
13
|
+
const finished = run ? new Date(run.finishedAt) : null;
|
|
14
|
+
return (_jsxs("div", { "data-slot": "output-provenance", ...props, ref: ref, className: cn('astra-output-provenance', className), children: [_jsxs("div", { className: "astra-output-provenance__heading", children: [_jsx("h4", { children: copy.title }), run ? _jsx("button", { type: "button", "aria-haspopup": "dialog", onClick: () => { setDetailsOpen(true); }, children: copy.details }) : null] }), _jsxs("dl", { className: "astra-output-provenance__summary", children: [_jsxs("div", { children: [_jsx("dt", { children: copy.status }), _jsxs("dd", { children: [_jsxs("span", { className: "astra-output-provenance__status", children: [status ? (_jsx("span", { className: "astra-output-provenance__icon", "data-state": status.state, "aria-hidden": "true", children: _jsx(OutputStatusGlyph, { state: status.state }) })) : null, stateLabel] }), status?.detail ? _jsx("p", { className: "astra-output-provenance__reason", children: status.detail }) : null] })] }), run ? _jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("dt", { children: copy.lastRun }), _jsx("dd", { children: _jsx("time", { dateTime: run.finishedAt, children: finished && !Number.isNaN(finished.getTime()) ? finished.toLocaleString() : run.finishedAt }) })] }), _jsxs("div", { children: [_jsx("dt", { children: copy.revision }), _jsx("dd", { children: _jsx("code", { title: run.gitRevision, children: run.gitRevision.slice(0, 8) }) })] })] }) : null] }), error ? _jsx("p", { role: "alert", children: error }) : run === undefined ? _jsx("p", { role: "status", children: copy.loading }) : run === null ? _jsx("p", { children: copy.noRun }) : null, detailsOpen && run ? (_jsx(DetailDialog, { mode: "modal", title: copy.runDetails, closeLabel: copy.closeDetails, onClose: () => { setDetailsOpen(false); }, panelClassName: "astra-output-provenance__dialog-panel", children: _jsxs("div", { className: "astra-output-provenance__details", children: [_jsxs("section", { children: [_jsx("h4", { children: copy.recipe }), _jsx("pre", { children: _jsx("code", { children: run.recipe }) })] }), _jsxs("section", { children: [_jsx("h4", { children: copy.inputs }), Object.keys(run.inputVersions).length ? (_jsx("dl", { children: Object.entries(run.inputVersions).map(([name, version]) => (_jsxs("div", { children: [_jsx("dt", { children: name }), _jsx("dd", { children: _jsx("code", { children: version }) })] }, name))) })) : _jsx("p", { children: copy.noInputs })] }), _jsxs("section", { children: [_jsx("h4", { children: copy.environment }), _jsx("p", { children: _jsx("code", { children: run.environment }) })] }), _jsxs("section", { children: [_jsx("h4", { children: copy.cliVersion }), _jsx("p", { children: run.cliVersion })] })] }) })) : null] }));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=output-provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-provenance.js","sourceRoot":"","sources":["../../src/components/output-provenance.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAwC,SAAS,gBAAgB,CAAC,EAC1G,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EACxC,EAAE,GAAG;IACJ,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACvE,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,I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