@astra-spec/ui 0.0.1
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/LICENSE +29 -0
- package/README.md +261 -0
- package/TOKENS.md +93 -0
- package/blocks.css +7 -0
- package/components.css +13 -0
- package/dist/blocks/analysis-tree.d.ts +13 -0
- package/dist/blocks/analysis-tree.d.ts.map +1 -0
- package/dist/blocks/analysis-tree.js +19 -0
- package/dist/blocks/analysis-tree.js.map +1 -0
- package/dist/blocks/decisions-list.d.ts +17 -0
- package/dist/blocks/decisions-list.d.ts.map +1 -0
- package/dist/blocks/decisions-list.js +56 -0
- package/dist/blocks/decisions-list.js.map +1 -0
- package/dist/blocks/findings-list.d.ts +9 -0
- package/dist/blocks/findings-list.d.ts.map +1 -0
- package/dist/blocks/findings-list.js +35 -0
- package/dist/blocks/findings-list.js.map +1 -0
- package/dist/blocks/index.d.ts +18 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +10 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/inputs-list.d.ts +9 -0
- package/dist/blocks/inputs-list.d.ts.map +1 -0
- package/dist/blocks/inputs-list.js +32 -0
- package/dist/blocks/inputs-list.js.map +1 -0
- package/dist/blocks/outputs-list.d.ts +18 -0
- package/dist/blocks/outputs-list.d.ts.map +1 -0
- package/dist/blocks/outputs-list.js +47 -0
- package/dist/blocks/outputs-list.js.map +1 -0
- package/dist/blocks/papers-list.d.ts +16 -0
- package/dist/blocks/papers-list.d.ts.map +1 -0
- package/dist/blocks/papers-list.js +20 -0
- package/dist/blocks/papers-list.js.map +1 -0
- package/dist/blocks/prior-insights-list.d.ts +9 -0
- package/dist/blocks/prior-insights-list.d.ts.map +1 -0
- package/dist/blocks/prior-insights-list.js +29 -0
- package/dist/blocks/prior-insights-list.js.map +1 -0
- package/dist/blocks/section.d.ts +36 -0
- package/dist/blocks/section.d.ts.map +1 -0
- package/dist/blocks/section.js +30 -0
- package/dist/blocks/section.js.map +1 -0
- package/dist/components/artifact-preview.d.ts +71 -0
- package/dist/components/artifact-preview.d.ts.map +1 -0
- package/dist/components/artifact-preview.js +170 -0
- package/dist/components/artifact-preview.js.map +1 -0
- package/dist/components/decision-detail.d.ts +17 -0
- package/dist/components/decision-detail.d.ts.map +1 -0
- package/dist/components/decision-detail.js +21 -0
- package/dist/components/decision-detail.js.map +1 -0
- package/dist/components/detail-entry.d.ts +15 -0
- package/dist/components/detail-entry.d.ts.map +1 -0
- package/dist/components/detail-entry.js +14 -0
- package/dist/components/detail-entry.js.map +1 -0
- package/dist/components/finding-detail.d.ts +19 -0
- package/dist/components/finding-detail.d.ts.map +1 -0
- package/dist/components/finding-detail.js +39 -0
- package/dist/components/finding-detail.js.map +1 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +15 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input-detail.d.ts +15 -0
- package/dist/components/input-detail.d.ts.map +1 -0
- package/dist/components/input-detail.js +21 -0
- package/dist/components/input-detail.js.map +1 -0
- package/dist/components/insight-detail.d.ts +25 -0
- package/dist/components/insight-detail.d.ts.map +1 -0
- package/dist/components/insight-detail.js +30 -0
- package/dist/components/insight-detail.js.map +1 -0
- package/dist/components/insight-trigger.d.ts +20 -0
- package/dist/components/insight-trigger.d.ts.map +1 -0
- package/dist/components/insight-trigger.js +32 -0
- package/dist/components/insight-trigger.js.map +1 -0
- package/dist/components/output-detail.d.ts +39 -0
- package/dist/components/output-detail.d.ts.map +1 -0
- package/dist/components/output-detail.js +124 -0
- package/dist/components/output-detail.js.map +1 -0
- package/dist/components/output-dialog.d.ts +18 -0
- package/dist/components/output-dialog.d.ts.map +1 -0
- package/dist/components/output-dialog.js +11 -0
- package/dist/components/output-dialog.js.map +1 -0
- package/dist/components/paper-detail.d.ts +34 -0
- package/dist/components/paper-detail.d.ts.map +1 -0
- package/dist/components/paper-detail.js +60 -0
- package/dist/components/paper-detail.js.map +1 -0
- package/dist/components/record-dialog.d.ts +33 -0
- package/dist/components/record-dialog.d.ts.map +1 -0
- package/dist/components/record-dialog.js +114 -0
- package/dist/components/record-dialog.js.map +1 -0
- package/dist/components/relation-items.d.ts +9 -0
- package/dist/components/relation-items.d.ts.map +1 -0
- package/dist/components/relation-items.js +20 -0
- package/dist/components/relation-items.js.map +1 -0
- package/dist/components/use-detail-stack.d.ts +31 -0
- package/dist/components/use-detail-stack.d.ts.map +1 -0
- package/dist/components/use-detail-stack.js +49 -0
- package/dist/components/use-detail-stack.js.map +1 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +6 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/labels.d.ts +61 -0
- package/dist/lib/labels.d.ts.map +1 -0
- package/dist/lib/labels.js +79 -0
- package/dist/lib/labels.js.map +1 -0
- package/dist/lib/slot.d.ts +11 -0
- package/dist/lib/slot.d.ts.map +1 -0
- package/dist/lib/slot.js +83 -0
- package/dist/lib/slot.js.map +1 -0
- package/dist/model/doi.d.ts +2 -0
- package/dist/model/doi.d.ts.map +1 -0
- package/dist/model/doi.js +5 -0
- package/dist/model/doi.js.map +1 -0
- package/dist/model/index.d.ts +10 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +7 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/locate-record.d.ts +8 -0
- package/dist/model/locate-record.d.ts.map +1 -0
- package/dist/model/locate-record.js +7 -0
- package/dist/model/locate-record.js.map +1 -0
- package/dist/model/papers.d.ts +38 -0
- package/dist/model/papers.d.ts.map +1 -0
- package/dist/model/papers.js +91 -0
- package/dist/model/papers.js.map +1 -0
- package/dist/model/records.d.ts +10 -0
- package/dist/model/records.d.ts.map +1 -0
- package/dist/model/records.js +32 -0
- package/dist/model/records.js.map +1 -0
- package/dist/model/relations.d.ts +45 -0
- package/dist/model/relations.d.ts.map +1 -0
- package/dist/model/relations.js +98 -0
- package/dist/model/relations.js.map +1 -0
- package/dist/primitives/badge.d.ts +11 -0
- package/dist/primitives/badge.d.ts.map +1 -0
- package/dist/primitives/badge.js +7 -0
- package/dist/primitives/badge.js.map +1 -0
- package/dist/primitives/button.d.ts +18 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +12 -0
- package/dist/primitives/button.js.map +1 -0
- package/dist/primitives/detail-layout.d.ts +26 -0
- package/dist/primitives/detail-layout.d.ts.map +1 -0
- package/dist/primitives/detail-layout.js +21 -0
- package/dist/primitives/detail-layout.js.map +1 -0
- package/dist/primitives/dialog.d.ts +133 -0
- package/dist/primitives/dialog.d.ts.map +1 -0
- package/dist/primitives/dialog.js +266 -0
- package/dist/primitives/dialog.js.map +1 -0
- package/dist/primitives/index.d.ts +25 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +14 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/kind.d.ts +6 -0
- package/dist/primitives/kind.d.ts.map +1 -0
- package/dist/primitives/kind.js +14 -0
- package/dist/primitives/kind.js.map +1 -0
- package/dist/primitives/prose.d.ts +36 -0
- package/dist/primitives/prose.d.ts.map +1 -0
- package/dist/primitives/prose.js +57 -0
- package/dist/primitives/prose.js.map +1 -0
- package/dist/primitives/record-list.d.ts +31 -0
- package/dist/primitives/record-list.d.ts.map +1 -0
- package/dist/primitives/record-list.js +17 -0
- package/dist/primitives/record-list.js.map +1 -0
- package/dist/primitives/relation-list.d.ts +22 -0
- package/dist/primitives/relation-list.d.ts.map +1 -0
- package/dist/primitives/relation-list.js +13 -0
- package/dist/primitives/relation-list.js.map +1 -0
- package/dist/primitives/surface-header.d.ts +31 -0
- package/dist/primitives/surface-header.d.ts.map +1 -0
- package/dist/primitives/surface-header.js +13 -0
- package/dist/primitives/surface-header.js.map +1 -0
- package/dist/views/index.d.ts +4 -0
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/index.js +3 -0
- package/dist/views/index.js.map +1 -0
- package/dist/views/inventory.d.ts +46 -0
- package/dist/views/inventory.d.ts.map +1 -0
- package/dist/views/inventory.js +101 -0
- package/dist/views/inventory.js.map +1 -0
- package/package.json +127 -0
- package/primitives.css +15 -0
- package/src/blocks/analysis-tree.tsx +109 -0
- package/src/blocks/decisions-list.tsx +113 -0
- package/src/blocks/findings-list.tsx +61 -0
- package/src/blocks/index.ts +23 -0
- package/src/blocks/inputs-list.tsx +51 -0
- package/src/blocks/outputs-list.tsx +143 -0
- package/src/blocks/papers-list.tsx +65 -0
- package/src/blocks/prior-insights-list.tsx +52 -0
- package/src/blocks/section.tsx +113 -0
- package/src/components/artifact-preview.tsx +314 -0
- package/src/components/decision-detail.tsx +93 -0
- package/src/components/detail-entry.ts +19 -0
- package/src/components/finding-detail.tsx +99 -0
- package/src/components/index.ts +44 -0
- package/src/components/input-detail.tsx +67 -0
- package/src/components/insight-detail.tsx +120 -0
- package/src/components/insight-trigger.tsx +102 -0
- package/src/components/output-detail.tsx +258 -0
- package/src/components/output-dialog.tsx +63 -0
- package/src/components/paper-detail.tsx +216 -0
- package/src/components/record-dialog.tsx +232 -0
- package/src/components/relation-items.ts +31 -0
- package/src/components/use-detail-stack.ts +78 -0
- package/src/lib/cn.ts +5 -0
- package/src/lib/labels.tsx +145 -0
- package/src/lib/slot.tsx +87 -0
- package/src/model/doi.ts +5 -0
- package/src/model/index.ts +32 -0
- package/src/model/locate-record.ts +13 -0
- package/src/model/papers.ts +146 -0
- package/src/model/records.ts +43 -0
- package/src/model/relations.ts +134 -0
- package/src/primitives/badge.tsx +32 -0
- package/src/primitives/button.tsx +58 -0
- package/src/primitives/detail-layout.tsx +84 -0
- package/src/primitives/dialog.tsx +555 -0
- package/src/primitives/index.ts +48 -0
- package/src/primitives/kind.ts +19 -0
- package/src/primitives/prose.tsx +74 -0
- package/src/primitives/record-list.tsx +103 -0
- package/src/primitives/relation-list.tsx +95 -0
- package/src/primitives/surface-header.tsx +87 -0
- package/src/views/index.ts +3 -0
- package/src/views/inventory.tsx +224 -0
- package/styles/base.css +49 -0
- package/styles/blocks/analysis-tree.css +64 -0
- package/styles/blocks/decisions-list.css +73 -0
- package/styles/blocks/outputs-list.css +349 -0
- package/styles/blocks/papers-list.css +98 -0
- package/styles/blocks/records.css +72 -0
- package/styles/components/artifact-preview.css +242 -0
- package/styles/components/decision-detail.css +159 -0
- package/styles/components/evidence.css +79 -0
- package/styles/components/finding-detail.css +63 -0
- package/styles/components/input-detail.css +95 -0
- package/styles/components/insight-detail.css +138 -0
- package/styles/components/insight-list.css +46 -0
- package/styles/components/insight-trigger.css +54 -0
- package/styles/components/output-detail.css +732 -0
- package/styles/components/paper-detail.css +249 -0
- package/styles/components/paper-doi.css +36 -0
- package/styles/primitives/badge.css +107 -0
- package/styles/primitives/button.css +116 -0
- package/styles/primitives/count-heading.css +27 -0
- package/styles/primitives/detail-layout.css +225 -0
- package/styles/primitives/dialog.css +634 -0
- package/styles/primitives/empty-state.css +10 -0
- package/styles/primitives/kind.css +41 -0
- package/styles/primitives/prose.css +15 -0
- package/styles/primitives/record-list.css +425 -0
- package/styles/primitives/relation-list.css +184 -0
- package/styles/primitives/surface-header.css +183 -0
- package/styles/tokens.css +119 -0
- package/styles/views/inventory.css +186 -0
- package/styles.css +2 -0
- package/views.css +3 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResolvedDecision, ResolvedInsight } from '@astra-spec/sdk';
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import { type DetailDialogProps } from '../primitives/dialog.js';
|
|
4
|
+
import { type TextRenderer } from '../primitives/prose.js';
|
|
5
|
+
export interface DecisionDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6
|
+
record: ResolvedDecision;
|
|
7
|
+
/** Insights cited by the decision's options; see `decisionInsights()`. */
|
|
8
|
+
insights: ResolvedInsight[];
|
|
9
|
+
renderText?: TextRenderer | undefined;
|
|
10
|
+
onOpenInsight?: ((insight: ResolvedInsight) => void) | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** Rationale, options with the selected one marked, and the insights that informed the decision. */
|
|
13
|
+
export declare const DecisionDetail: import("react").ForwardRefExoticComponent<DecisionDetailProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export interface DecisionDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'>, Omit<DecisionDetailProps, 'className'> {
|
|
15
|
+
}
|
|
16
|
+
export declare function DecisionDialog({ record, insights, renderText, onOpenInsight, ...dialog }: DecisionDialogProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=decision-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-detail.d.ts","sourceRoot":"","sources":["../../src/components/decision-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGlE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,MAAM,EAAE,gBAAgB,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAClE;AAED,oGAAoG;AACpG,eAAO,MAAM,cAAc,gHAyDzB,CAAC;AAEH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC;CAAG;AAEzK,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE,mBAAmB,+BAa7G"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId } from 'react';
|
|
3
|
+
import { recordTitle } from '../model/records.js';
|
|
4
|
+
import { useLabels } from '../lib/labels.js';
|
|
5
|
+
import { CountHeading, DetailLayout, DetailMain, DetailSection } from '../primitives/detail-layout.js';
|
|
6
|
+
import { DetailDialog } from '../primitives/dialog.js';
|
|
7
|
+
import { Prose } from '../primitives/prose.js';
|
|
8
|
+
import { InsightTrigger } from './insight-trigger.js';
|
|
9
|
+
/** Rationale, options with the selected one marked, and the insights that informed the decision. */
|
|
10
|
+
export const DecisionDetail = forwardRef(function DecisionDetail({ record, insights, renderText, onOpenInsight, className, ...props }, ref) {
|
|
11
|
+
const optionsId = useId();
|
|
12
|
+
return (_jsx(DetailLayout, { "data-slot": "decision-detail", ...props, ref: ref, layout: "single", className: className, children: _jsxs(DetailMain, { children: [record.rationale ? (_jsx(DetailSection, { label: "Rationale", heading: "section", children: _jsx(Prose, { text: record.rationale, field: "rationale", renderText: renderText }) })) : null, _jsxs("section", { className: "astra-decision-options", "aria-labelledby": optionsId, children: [_jsx("h4", { id: optionsId, children: "Options" }), _jsx("ul", { children: record.options.map((option) => {
|
|
13
|
+
const selected = option.id === record.selectedOptionId;
|
|
14
|
+
return (_jsxs("li", { ...(selected ? { 'data-selected': '' } : {}), children: [_jsx("span", { className: "astra-decision-options__marker", "aria-hidden": "true", children: selected ? '●' : '○' }), _jsxs("span", { children: [_jsx("strong", { children: option.label }), _jsx("code", { children: option.id })] }), selected ? _jsx("small", { children: "Selected" }) : null] }, option.id));
|
|
15
|
+
}) })] }), _jsxs("section", { className: "astra-insight-list", children: [_jsx(CountHeading, { title: "Insights that informed this", count: insights.length }), insights.length ? (_jsx("ul", { className: "astra-decision-insights", children: insights.map((insight) => (_jsx("li", { children: _jsx(InsightTrigger, { insight: insight, variant: "claim", renderText: renderText, onOpen: () => onOpenInsight?.(insight) }) }, insight.canonicalPath))) })) : _jsx("p", { children: "No prior insights are linked to this decision." })] })] }) }));
|
|
16
|
+
});
|
|
17
|
+
export function DecisionDialog({ record, insights, renderText, onOpenInsight, ...dialog }) {
|
|
18
|
+
const labels = useLabels();
|
|
19
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "decision", kindLabel: labels.kinds.decision, title: recordTitle(record), closeLabel: labels.closeRecord(labels.kinds.decision), children: _jsx(DecisionDetail, { record: record, insights: insights, renderText: renderText, onOpenInsight: onOpenInsight }) }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=decision-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-detail.js","sourceRoot":"","sources":["../../src/components/decision-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAuB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,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,EAAqB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUtD,oGAAoG;AACpG,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAsC,SAAS,cAAc,CAAC,EACpG,MAAM,EACN,QAAQ,EACR,UAAU,EACV,a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AAC,KAAK,EAAC,6BAA6B,EAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAI,EAC3E,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CACjB,aAAI,SAAS,EAAC,yBAAyB,YACpC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACzB,uBACE,KAAC,cAAc,IACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAC,OAAO,EACf,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,GACtC,IANK,OAAO,CAAC,aAAa,CAOzB,CACN,CAAC,GACC,CACN,CAAC,CAAC,CAAC,yEAAqD,IACjD,IACC,GACA,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAIH,MAAM,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,EAAuB;IAC5G,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,OACP,MAAM,EACV,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAChC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,YAErD,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,GAAI,GAC/F,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What a detail surface is showing: a record, or a paper (optionally focused on an insight). */
|
|
2
|
+
export type DetailEntry = {
|
|
3
|
+
kind: 'record';
|
|
4
|
+
canonicalPath: string;
|
|
5
|
+
analysisPath: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'paper';
|
|
8
|
+
doi: string;
|
|
9
|
+
analysisPath: string;
|
|
10
|
+
focusInsightPath?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function recordEntry(canonicalPath: string, analysisPath: string): DetailEntry;
|
|
13
|
+
export declare function paperEntry(doi: string, analysisPath: string, focusInsightPath?: string): DetailEntry;
|
|
14
|
+
export declare function sameEntry(left: DetailEntry, right: DetailEntry): boolean;
|
|
15
|
+
//# sourceMappingURL=detail-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-entry.d.ts","sourceRoot":"","sources":["../../src/components/detail-entry.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEhG,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,WAAW,CAEpF;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,WAAW,CAEpG;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAKxE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function recordEntry(canonicalPath, analysisPath) {
|
|
2
|
+
return { kind: 'record', canonicalPath, analysisPath };
|
|
3
|
+
}
|
|
4
|
+
export function paperEntry(doi, analysisPath, focusInsightPath) {
|
|
5
|
+
return { kind: 'paper', doi, analysisPath, ...(focusInsightPath ? { focusInsightPath } : {}) };
|
|
6
|
+
}
|
|
7
|
+
export function sameEntry(left, right) {
|
|
8
|
+
if (left.kind !== right.kind || left.analysisPath !== right.analysisPath)
|
|
9
|
+
return false;
|
|
10
|
+
return left.kind === 'record'
|
|
11
|
+
? left.canonicalPath === right.canonicalPath
|
|
12
|
+
: left.doi === right.doi;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=detail-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-entry.js","sourceRoot":"","sources":["../../src/components/detail-entry.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,WAAW,CAAC,aAAqB,EAAE,YAAoB;IACrE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,YAAoB,EAAE,gBAAyB;IACrF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACjG,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAiB,EAAE,KAAkB;IAC7D,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IACvF,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;QAC3B,CAAC,CAAC,IAAI,CAAC,aAAa,KAAM,KAAkD,CAAC,aAAa;QAC1F,CAAC,CAAC,IAAI,CAAC,GAAG,KAAM,KAAiD,CAAC,GAAG,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ResolvedInsight } from '@astra-spec/sdk';
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import { type FindingEvidenceLink } from '../model/relations.js';
|
|
4
|
+
import { type DetailDialogProps } from '../primitives/dialog.js';
|
|
5
|
+
import { type TextRenderer } from '../primitives/prose.js';
|
|
6
|
+
import type { OpenRecordHandler } from './relation-items.js';
|
|
7
|
+
export interface FindingDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
8
|
+
record: ResolvedInsight;
|
|
9
|
+
/** Artifact-backed evidence resolved to outputs; see `findingEvidence()`. */
|
|
10
|
+
evidence: FindingEvidenceLink[];
|
|
11
|
+
renderText?: TextRenderer | undefined;
|
|
12
|
+
onOpenRecord?: OpenRecordHandler | undefined;
|
|
13
|
+
}
|
|
14
|
+
/** Notes, the supporting results a finding cites, and its literature sources. */
|
|
15
|
+
export declare const FindingDetail: import("react").ForwardRefExoticComponent<FindingDetailProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export interface FindingDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'>, Omit<FindingDetailProps, 'className'> {
|
|
17
|
+
}
|
|
18
|
+
export declare function FindingDialog({ record, evidence, renderText, onOpenRecord, ...dialog }: FindingDialogProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=finding-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finding-detail.d.ts","sourceRoot":"","sources":["../../src/components/finding-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIpF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC1F,MAAM,EAAE,eAAe,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;CAC9C;AAED,iFAAiF;AACjF,eAAO,MAAM,aAAa,+GA2DxB,CAAC;AAEH,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;CAAG;AAEvK,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,EAAE,kBAAkB,+BAa1G"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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';
|
|
4
|
+
import { doiHref } from '../model/doi.js';
|
|
5
|
+
import { findingLiterature } from '../model/relations.js';
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { useLabels } from '../lib/labels.js';
|
|
8
|
+
import { DetailLayout, DetailMain } from '../primitives/detail-layout.js';
|
|
9
|
+
import { DetailDialog } from '../primitives/dialog.js';
|
|
10
|
+
import { Prose } from '../primitives/prose.js';
|
|
11
|
+
import { RelationList } from '../primitives/relation-list.js';
|
|
12
|
+
/** Notes, the supporting results a finding cites, and its literature sources. */
|
|
13
|
+
export const FindingDetail = forwardRef(function FindingDetail({ record, evidence, renderText, onOpenRecord, className, ...props }, ref) {
|
|
14
|
+
const literature = findingLiterature(record);
|
|
15
|
+
return (_jsx(DetailLayout, { "data-slot": "finding-detail", ...props, ref: ref, layout: "single", className: cn('astra-finding-detail', className), children: _jsxs(DetailMain, { children: [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, _jsx(RelationList, { className: "astra-finding-detail__results", title: "Supporting results", empty: "No supporting results are linked to this finding.", items: evidence.map((item, index) => {
|
|
16
|
+
const title = item.output
|
|
17
|
+
? recordTitle(item.output)
|
|
18
|
+
: item.evidence.artifact ?? `Result ${index + 1}`;
|
|
19
|
+
const { output, analysis } = item;
|
|
20
|
+
return {
|
|
21
|
+
key: `${item.evidence.resolvedOutputPath ?? item.evidence.artifact ?? 'result'}-${index}`,
|
|
22
|
+
label: title,
|
|
23
|
+
identifier: output?.canonicalPath ?? item.evidence.artifact,
|
|
24
|
+
detail: output?.type ?? 'Unavailable',
|
|
25
|
+
kind: 'output',
|
|
26
|
+
accessibleLabel: output ? `View supporting result: ${title}` : undefined,
|
|
27
|
+
onOpen: output && analysis && onOpenRecord ? () => { onOpenRecord(output, analysis); } : undefined,
|
|
28
|
+
};
|
|
29
|
+
}) }), literature.map((source, index) => {
|
|
30
|
+
const doi = source.doi ?? '';
|
|
31
|
+
const location = source.location?.page ? ` · page ${source.location.page}` : '';
|
|
32
|
+
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
|
+
})] }) }));
|
|
34
|
+
});
|
|
35
|
+
export function FindingDialog({ record, evidence, renderText, onOpenRecord, ...dialog }) {
|
|
36
|
+
const labels = useLabels();
|
|
37
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "finding", kindLabel: labels.kinds.finding, title: record.claim, closeLabel: labels.closeRecord(labels.kinds.finding), children: _jsx(FindingDetail, { record: record, evidence: evidence, renderText: renderText, onOpenRecord: onOpenRecord }) }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=finding-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finding-detail.js","sourceRoot":"","sources":["../../src/components/finding-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAA4B,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAqB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAW9D,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAqC,SAAS,aAAa,CAAC,EACjG,MAAM,EACN,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,CACL,KAAC,YAAY,iBAAW,gBAAgB,KAAK,KAAK,E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,EACV,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAC/B,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,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,YAAY,EAAE,YAAY,GAAI,GAC5F,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** ASTRA-aware components: one detail body and one dialog per record kind (input, output, decision, finding, prior insight) plus papers, the RecordDialog router, and the detail stack. */
|
|
2
|
+
export { recordEntry, paperEntry, sameEntry } from './detail-entry.js';
|
|
3
|
+
export type { DetailEntry } from './detail-entry.js';
|
|
4
|
+
export { useDetailStack } from './use-detail-stack.js';
|
|
5
|
+
export type { DetailStack, DetailStackOptions } from './use-detail-stack.js';
|
|
6
|
+
export { relationItemForRecord, relationItemsForLinks } from './relation-items.js';
|
|
7
|
+
export type { OpenRecordHandler } from './relation-items.js';
|
|
8
|
+
export { OutputDetail, OutputDialogActions, OutputPreview, useOutputExpanded } from './output-detail.js';
|
|
9
|
+
export type { OutputDetailProps, OutputDialogActionsProps, OutputPreviewProps } from './output-detail.js';
|
|
10
|
+
export { OutputDialog } from './output-dialog.js';
|
|
11
|
+
export type { OutputDialogProps } from './output-dialog.js';
|
|
12
|
+
export { DecisionDetail, DecisionDialog } from './decision-detail.js';
|
|
13
|
+
export type { DecisionDetailProps, DecisionDialogProps } from './decision-detail.js';
|
|
14
|
+
export { FindingDetail, FindingDialog } from './finding-detail.js';
|
|
15
|
+
export type { FindingDetailProps, FindingDialogProps } from './finding-detail.js';
|
|
16
|
+
export { InputDetail, InputDialog, inputSourceLabel } from './input-detail.js';
|
|
17
|
+
export type { InputDetailProps, InputDialogProps } from './input-detail.js';
|
|
18
|
+
export { InsightDetail, InsightDialog, primaryLiteratureEvidence } from './insight-detail.js';
|
|
19
|
+
export type { InsightDetailProps, InsightDialogProps } from './insight-detail.js';
|
|
20
|
+
export { InsightEvidenceTitle, InsightTrigger } from './insight-trigger.js';
|
|
21
|
+
export type { InsightEvidenceTitleProps, InsightTriggerProps } from './insight-trigger.js';
|
|
22
|
+
export { PaperDetail, PaperDialog, PaperDialogActions } from './paper-detail.js';
|
|
23
|
+
export type { PaperDetailProps, PaperDialogActionsProps, PaperDialogProps, PaperRenderOptions, PaperRenderer } from './paper-detail.js';
|
|
24
|
+
export { RecordDialog } from './record-dialog.js';
|
|
25
|
+
export type { RecordDialogProps } from './record-dialog.js';
|
|
26
|
+
export { ArtifactPreview, metricPreviewFromJson, tablePreviewFromDelimited, tablePreviewFromRows, } from './artifact-preview.js';
|
|
27
|
+
export type { ArtifactPreviewData, ArtifactPreviewProps, ArtifactRenderOptions, ArtifactRenderer, DelimitedPreviewOptions, ImagePreviewData, LoadingPreviewData, MetricPreviewData, TablePreviewData, TextPreviewData, UnavailablePreviewData, } from './artifact-preview.js';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,2LAA2L;AAC3L,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,mBAAm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EACL,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,GACvB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** ASTRA-aware components: one detail body and one dialog per record kind (input, output, decision, finding, prior insight) plus papers, the RecordDialog router, and the detail stack. */
|
|
2
|
+
export { recordEntry, paperEntry, sameEntry } from './detail-entry.js';
|
|
3
|
+
export { useDetailStack } from './use-detail-stack.js';
|
|
4
|
+
export { relationItemForRecord, relationItemsForLinks } from './relation-items.js';
|
|
5
|
+
export { OutputDetail, OutputDialogActions, OutputPreview, useOutputExpanded } from './output-detail.js';
|
|
6
|
+
export { OutputDialog } from './output-dialog.js';
|
|
7
|
+
export { DecisionDetail, DecisionDialog } from './decision-detail.js';
|
|
8
|
+
export { FindingDetail, FindingDialog } from './finding-detail.js';
|
|
9
|
+
export { InputDetail, InputDialog, inputSourceLabel } from './input-detail.js';
|
|
10
|
+
export { InsightDetail, InsightDialog, primaryLiteratureEvidence } from './insight-detail.js';
|
|
11
|
+
export { InsightEvidenceTitle, InsightTrigger } from './insight-trigger.js';
|
|
12
|
+
export { PaperDetail, PaperDialog, PaperDialogActions } from './paper-detail.js';
|
|
13
|
+
export { RecordDialog } from './record-dialog.js';
|
|
14
|
+
export { ArtifactPreview, metricPreviewFromJson, tablePreviewFromDelimited, tablePreviewFromRows, } from './artifact-preview.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,2LAA2L;AAC3L,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEzG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAE9F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ResolvedInput } from '@astra-spec/sdk';
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import { type DetailDialogProps } from '../primitives/dialog.js';
|
|
4
|
+
import { type TextRenderer } from '../primitives/prose.js';
|
|
5
|
+
export declare function inputSourceLabel(record: ResolvedInput): string;
|
|
6
|
+
export interface InputDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
|
+
record: ResolvedInput;
|
|
8
|
+
renderText?: TextRenderer | undefined;
|
|
9
|
+
}
|
|
10
|
+
/** Description, the record an alias resolves from, and the declared source of an input. */
|
|
11
|
+
export declare const InputDetail: import("react").ForwardRefExoticComponent<InputDetailProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export interface InputDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'>, Omit<InputDetailProps, 'className'> {
|
|
13
|
+
}
|
|
14
|
+
export declare function InputDialog({ record, renderText, ...dialog }: InputDialogProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=input-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-detail.d.ts","sourceRoot":"","sources":["../../src/components/input-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIxD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE9D;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxF,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACvC;AAED,2FAA2F;AAC3F,eAAO,MAAM,WAAW,6GA+BtB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC;CAAG;AAEnK,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,EAAE,gBAAgB,+BAa9E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { recordTitle } from '../model/records.js';
|
|
4
|
+
import { useLabels } from '../lib/labels.js';
|
|
5
|
+
import { DetailLayout, DetailMain, DetailSection } from '../primitives/detail-layout.js';
|
|
6
|
+
import { DetailDialog } from '../primitives/dialog.js';
|
|
7
|
+
import { Prose } from '../primitives/prose.js';
|
|
8
|
+
export function inputSourceLabel(record) {
|
|
9
|
+
return record.source ?? record.ref ?? record.resolvedFrom ?? 'Source not declared';
|
|
10
|
+
}
|
|
11
|
+
/** Description, the record an alias resolves from, and the declared source of an input. */
|
|
12
|
+
export const InputDetail = forwardRef(function InputDetail({ record, renderText, className, ...props }, ref) {
|
|
13
|
+
const declared = record.source ?? record.ref;
|
|
14
|
+
const primary = record.resolvedFrom ?? declared ?? 'Source not declared';
|
|
15
|
+
return (_jsx(DetailLayout, { "data-slot": "input-detail", ...props, ref: ref, layout: "single", className: className, children: _jsxs(DetailMain, { children: [record.description ? (_jsx(DetailSection, { label: "Description", heading: "section", children: _jsx(Prose, { text: record.description, field: "description", renderText: renderText }) })) : null, _jsxs("section", { className: "astra-input-source", children: [_jsx("h4", { children: record.resolvedFrom ? 'Resolved from' : 'Source' }), _jsx("code", { tabIndex: 0, title: primary, children: primary })] }), record.resolvedFrom && declared ? (_jsxs("section", { className: "astra-input-source", children: [_jsx("h4", { children: "Source" }), _jsx("code", { tabIndex: 0, title: declared, children: declared })] })) : null] }) }));
|
|
16
|
+
});
|
|
17
|
+
export function InputDialog({ record, renderText, ...dialog }) {
|
|
18
|
+
const labels = useLabels();
|
|
19
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "input", kindLabel: labels.kinds.input, title: recordTitle(record), closeLabel: labels.closeRecord(labels.kinds.input), children: _jsx(InputDetail, { record: record, renderText: renderText }) }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=input-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-detail.js","sourceRoot":"","sources":["../../src/components/input-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAqB,MAAM,wBAAwB,CAAC;AAElE,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,YAAY,IAAI,qBAAqB,CAAC;AACrF,CAAC;AAOD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAmC,SAAS,WAAW,CAAC,EAC3F,MAAM,EACN,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,IAAI,QAAQ,IAAI,qBAAqB,CAAC;IACzE,OAAO,CACL,KAAC,YAAY,iBAAW,cAAc,KAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,YAC9F,MAAC,UAAU,eACR,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CACpB,KAAC,aAAa,IAAC,KAAK,EAAC,aAAa,EAAC,OAAO,EAAC,SAAS,YAClD,KAAC,KAAK,IAAC,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,KAAK,EAAC,aAAa,EAAC,UAAU,EAAE,UAAU,GAAI,GACjE,CACjB,CAAC,CAAC,CAAC,IAAI,EACR,mBAAS,SAAS,EAAC,oBAAoB,aACrC,uBAAK,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,GAAM,EAE3D,eAAM,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,YAAG,OAAO,GAAQ,IAC3C,EACT,MAAM,CAAC,YAAY,IAAI,QAAQ,CAAC,CAAC,CAAC,CACjC,mBAAS,SAAS,EAAC,oBAAoB,aACrC,kCAAe,EAEf,eAAM,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,YAAG,QAAQ,GAAQ,IAC7C,CACX,CAAC,CAAC,CAAC,IAAI,IACG,GACA,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAIH,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,EAAoB;IAC7E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,OACP,MAAM,EACV,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAC7B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,YAElD,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAI,GAC1C,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ResolvedDecision, ResolvedInsight } from '@astra-spec/sdk';
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import { type DetailDialogProps } from '../primitives/dialog.js';
|
|
4
|
+
import { type TextRenderer } from '../primitives/prose.js';
|
|
5
|
+
/**
|
|
6
|
+
* The literature evidence an insight is presented against: the first entry
|
|
7
|
+
* with a DOI. A quote without a DOI names no paper to open, so it is skipped;
|
|
8
|
+
* the passage shown and the paper opened always belong to this one entry.
|
|
9
|
+
*/
|
|
10
|
+
export declare function primaryLiteratureEvidence(insight: ResolvedInsight): import("@astra-spec/sdk").ResolvedEvidence | undefined;
|
|
11
|
+
export interface InsightDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
12
|
+
record: ResolvedInsight;
|
|
13
|
+
/** Decisions that cite this insight; see `informedDecisions()`. */
|
|
14
|
+
decisions: ResolvedDecision[];
|
|
15
|
+
renderText?: TextRenderer | undefined;
|
|
16
|
+
/** Opens the source paper (with this insight focused) when the host can show it. */
|
|
17
|
+
onOpenSource?: (() => void) | undefined;
|
|
18
|
+
onOpenDecision?: ((decision: ResolvedDecision) => void) | undefined;
|
|
19
|
+
}
|
|
20
|
+
/** Claim, source paper and passage, notes, and the decisions an insight informs. */
|
|
21
|
+
export declare const InsightDetail: import("react").ForwardRefExoticComponent<InsightDetailProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export interface InsightDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'>, Omit<InsightDetailProps, 'className'> {
|
|
23
|
+
}
|
|
24
|
+
export declare function InsightDialog({ record, decisions, renderText, onOpenSource, onOpenDecision, ...dialog }: InsightDialogProps): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=insight-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-detail.d.ts","sourceRoot":"","sources":["../../src/components/insight-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAIlE;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,eAAe,0DAEjE;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC1F,MAAM,EAAE,eAAe,CAAC;IACxB,mEAAmE;IACnE,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC,oFAAoF;IACpF,YAAY,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACrE;AAED,oFAAoF;AACpF,eAAO,MAAM,aAAa,+GAgExB,CAAC;AAEH,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;CAAG;AAEvK,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,EAAE,kBAAkB,+BAmB3H"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { doiHref } from '../model/doi.js';
|
|
4
|
+
import { recordTitle } from '../model/records.js';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
import { useLabels } from '../lib/labels.js';
|
|
7
|
+
import { DetailLayout, DetailMain, DetailSection } from '../primitives/detail-layout.js';
|
|
8
|
+
import { DetailDialog } from '../primitives/dialog.js';
|
|
9
|
+
import { Prose } from '../primitives/prose.js';
|
|
10
|
+
import { RelationList } from '../primitives/relation-list.js';
|
|
11
|
+
import { relationItemForRecord } from './relation-items.js';
|
|
12
|
+
/**
|
|
13
|
+
* The literature evidence an insight is presented against: the first entry
|
|
14
|
+
* with a DOI. A quote without a DOI names no paper to open, so it is skipped;
|
|
15
|
+
* the passage shown and the paper opened always belong to this one entry.
|
|
16
|
+
*/
|
|
17
|
+
export function primaryLiteratureEvidence(insight) {
|
|
18
|
+
return insight.evidence.find((evidence) => Boolean(evidence.doi));
|
|
19
|
+
}
|
|
20
|
+
/** Claim, source paper and passage, notes, and the decisions an insight informs. */
|
|
21
|
+
export const InsightDetail = forwardRef(function InsightDetail({ record: insight, decisions, renderText, onOpenSource, onOpenDecision, className, ...props }, ref) {
|
|
22
|
+
const source = primaryLiteratureEvidence(insight);
|
|
23
|
+
const sourceLocation = source?.location?.page ? ` · page ${source.location.page}` : '';
|
|
24
|
+
return (_jsx(DetailLayout, { "data-slot": "insight-detail", ...props, ref: ref, layout: "single", className: cn('astra-insight-detail', className), children: _jsxs(DetailMain, { children: [insight.claim ? (_jsx(DetailSection, { label: "Claim", heading: "section", children: _jsx(Prose, { text: insight.claim, field: "claim", renderText: renderText }) })) : null, source?.doi ? (_jsxs("section", { className: "astra-insight-detail__paper astra-paper-doi", children: [_jsx("h4", { children: "Source paper" }), onOpenSource ? (_jsxs("button", { type: "button", onClick: onOpenSource, children: [source.doi, sourceLocation, " \u2197"] })) : (_jsxs("a", { href: doiHref(source.doi), target: "_blank", rel: "noreferrer", children: [source.doi, sourceLocation, " \u2197"] }))] })) : null, 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 }) }), source.doi && onOpenSource ? (_jsxs("button", { type: "button", className: "astra-insight-detail__open-source", onClick: onOpenSource, children: ["Locate passage in paper ", _jsx("span", { "aria-hidden": "true", children: "\u2192" })] })) : null] })) : null, insight.notes ? (_jsxs("section", { className: "astra-insight-detail__notes", children: [_jsx("h4", { children: "Notes" }), _jsx("div", { children: _jsx(Prose, { text: insight.notes, field: "notes", renderText: renderText }) })] })) : null, _jsx(RelationList, { className: "astra-detail__relations", title: "Informs decisions", items: decisions.map((decision) => relationItemForRecord(decision, undefined, undefined, { onOpen: onOpenDecision ? () => { onOpenDecision(decision); } : undefined })), empty: "No decisions cite this insight." })] }) }));
|
|
25
|
+
});
|
|
26
|
+
export function InsightDialog({ record, decisions, renderText, onOpenSource, onOpenDecision, ...dialog }) {
|
|
27
|
+
const labels = useLabels();
|
|
28
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "prior_insight", kindLabel: labels.kinds.prior_insight, title: recordTitle(record), closeLabel: labels.closeRecord(labels.kinds.prior_insight), children: _jsx(InsightDetail, { record: record, decisions: decisions, renderText: renderText, onOpenSource: onOpenSource, onOpenDecision: onOpenDecision }) }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=insight-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-detail.js","sourceRoot":"","sources":["../../src/components/insight-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAqB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,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AAC,CAAC,CAAC,GAAG,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAC7E,CAAC,EACF,KAAK,EAAC,iCAAiC,GACvC,IACS,GACA,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAIH,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,MAAM,EAAsB;IAC1H,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,OACP,MAAM,EACV,IAAI,EAAC,eAAe,EACpB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,aAAa,EACrC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,YAE1D,KAAC,aAAa,IACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC9B,GACW,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ResolvedInsight } from '@astra-spec/sdk';
|
|
2
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import { type TextRenderer } from '../primitives/prose.js';
|
|
4
|
+
export interface InsightEvidenceTitleProps {
|
|
5
|
+
name: string;
|
|
6
|
+
tag?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function InsightEvidenceTitle({ name, tag }: InsightEvidenceTitleProps): import("react").JSX.Element;
|
|
9
|
+
export interface InsightTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
10
|
+
insight: ResolvedInsight;
|
|
11
|
+
onOpen: () => void;
|
|
12
|
+
/** Tag shown after the name in the `title` variant; `null` hides it. */
|
|
13
|
+
tag?: string | null | undefined;
|
|
14
|
+
/** `title` shows the name; `claim` shows the full claim text. */
|
|
15
|
+
variant?: 'title' | 'claim' | undefined;
|
|
16
|
+
renderText?: TextRenderer | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** A clickable reference to an insight, as a title or as its claim. */
|
|
19
|
+
export declare const InsightTrigger: import("react").ForwardRefExoticComponent<InsightTriggerProps & import("react").RefAttributes<HTMLElement>>;
|
|
20
|
+
//# sourceMappingURL=insight-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-trigger.d.ts","sourceRoot":"","sources":["../../src/components/insight-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAEL,KAAK,oBAAoB,EAK1B,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,yBAAyB,+BAQ5E;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACpG,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACxC,UAAU,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACvC;AAED,uEAAuE;AACvE,eAAO,MAAM,cAAc,6GA8DzB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, } from 'react';
|
|
3
|
+
import { recordTitle } from '../model/records.js';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { Prose } from '../primitives/prose.js';
|
|
6
|
+
export function InsightEvidenceTitle({ name, tag }) {
|
|
7
|
+
return (_jsxs("span", { className: "astra-evidence__title", children: [_jsx("span", { className: "astra-evidence__glyph--insight", "aria-hidden": "true", children: "\u25C8" }), _jsx("span", { className: "astra-evidence__name", children: name }), tag ? _jsx("span", { className: "astra-evidence__tag", children: tag }) : null] }));
|
|
8
|
+
}
|
|
9
|
+
/** A clickable reference to an insight, as a title or as its claim. */
|
|
10
|
+
export const InsightTrigger = forwardRef(function InsightTrigger({ insight, onOpen, tag = 'prior insight', variant = 'title', renderText, className, onClick, onKeyDown, ...props }, ref) {
|
|
11
|
+
const title = recordTitle(insight);
|
|
12
|
+
const open = (event) => {
|
|
13
|
+
onClick?.(event);
|
|
14
|
+
onOpen();
|
|
15
|
+
};
|
|
16
|
+
const keyOpen = (event) => {
|
|
17
|
+
onKeyDown?.(event);
|
|
18
|
+
if (event.defaultPrevented)
|
|
19
|
+
return;
|
|
20
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
onOpen();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
if (variant === 'claim') {
|
|
26
|
+
// A div rather than a <button>: block prose inside a button would inherit
|
|
27
|
+
// UA control fonts and shift the layout.
|
|
28
|
+
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("span", { className: "astra-evidence__glyph--insight", "aria-hidden": "true", children: "\u25C8" }), _jsx("div", { className: "astra-insight-trigger__claim", children: _jsx(Prose, { text: insight.claim, field: "claim", renderText: renderText }) })] }));
|
|
29
|
+
}
|
|
30
|
+
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 }) }));
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=insight-trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-trigger.js","sourceRoot":"","sources":["../../src/components/insight-trigger.tsx"],"names":[],"mappings":";AACA,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,EAAqB,MAAM,wBAAwB,CAAC;AAOlE,MAAM,UAAU,oBAAoB,CAAC,EAAE,IAAI,EAAE,GAAG,EAA6B;IAC3E,OAAO,CACL,gBAAM,SAAS,EAAC,uBAAuB,aACrC,eAAM,SAAS,EAAC,gCAAgC,iBAAa,MAAM,uBAAS,EAC5E,eAAM,SAAS,EAAC,sBAAsB,YAAE,IAAI,GAAQ,EACnD,GAAG,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,qBAAqB,YAAE,GAAG,GAAQ,CAAC,CAAC,CAAC,IAAI,IAC3D,CACR,CAAC;AACJ,CAAC;AAYD,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAmC,SAAS,cAAc,CAAC,EACjG,OAAO,EACP,MAAM,EACN,GAAG,GAAG,eAAe,EACrB,OAAO,GAAG,OAAO,EACjB,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,GAAG;IACJ,MAAM,KAAK,GAAG,W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O,gBACR,KAAK,CAAC,YAAY,CAAC,IAAI,yBAAyB,KAAK,EAAE,EACnE,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,SAAS,YAEpB,KAAC,oBAAoB,IAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,SAAS,GAAI,GACrD,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ResolvedOutput } from '@astra-spec/sdk';
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import type { OutputRelations } from '../model/relations.js';
|
|
4
|
+
import { type ArtifactRenderer } from './artifact-preview.js';
|
|
5
|
+
import { type TextRenderer } from '../primitives/prose.js';
|
|
6
|
+
import { type OpenRecordHandler } from './relation-items.js';
|
|
7
|
+
export interface OutputPreviewProps {
|
|
8
|
+
output: ResolvedOutput;
|
|
9
|
+
compact?: boolean | undefined;
|
|
10
|
+
renderArtifact?: ArtifactRenderer | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** The host's artifact renderer, or the built-in placeholder preview. */
|
|
13
|
+
export declare function OutputPreview({ output, compact, renderArtifact }: OutputPreviewProps): import("react").JSX.Element;
|
|
14
|
+
export interface OutputDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
15
|
+
record: ResolvedOutput;
|
|
16
|
+
relations: OutputRelations;
|
|
17
|
+
renderArtifact?: ArtifactRenderer | undefined;
|
|
18
|
+
renderText?: TextRenderer | undefined;
|
|
19
|
+
onOpenRecord?: OpenRecordHandler | undefined;
|
|
20
|
+
/** Full-screen artifact state (controlled). */
|
|
21
|
+
expanded?: boolean | undefined;
|
|
22
|
+
onExpandedChange?: ((expanded: boolean) => void) | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** Artifact preview with provenance: description, recipe, alias, decisions, and inputs. */
|
|
25
|
+
export declare const OutputDetail: import("react").ForwardRefExoticComponent<OutputDetailProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export interface OutputDialogActionsProps {
|
|
27
|
+
record: ResolvedOutput;
|
|
28
|
+
onOpenArtifact?: ((output: ResolvedOutput) => void | Promise<void>) | undefined;
|
|
29
|
+
expanded: boolean;
|
|
30
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
/** Header actions for an output: open the artifact in the host, enter full screen. */
|
|
33
|
+
export declare function OutputDialogActions({ record: output, onOpenArtifact, expanded, onExpandedChange }: OutputDialogActionsProps): import("react").JSX.Element;
|
|
34
|
+
/** Full-screen state for an output, reset whenever the output changes (a controlled host is asked to reset). */
|
|
35
|
+
export declare function useOutputExpanded(output: ResolvedOutput, controlled?: {
|
|
36
|
+
expanded?: boolean | undefined;
|
|
37
|
+
onExpandedChange?: ((next: boolean) => void) | undefined;
|
|
38
|
+
}): readonly [boolean, (next: boolean) => void];
|
|
39
|
+
//# sourceMappingURL=output-detail.d.ts.map
|
|
@@ -0,0 +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,EAAwD,KAAK,cAAc,EAAkB,MAAM,OAAO,CAAC;AAClH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,cAAc,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC/C;AAED,yEAAyE;AACzE,wBAAgB,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