@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { forwardRef, type SVGAttributes } from 'react';
|
|
2
|
+
import type { OutputStatus } from '../model/output-status.js';
|
|
3
|
+
|
|
4
|
+
export interface OutputStatusGlyphProps extends SVGAttributes<SVGSVGElement> {
|
|
5
|
+
state: OutputStatus['state'];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** One 16×16 glyph per state, so every surface that draws a status draws the same mark. */
|
|
9
|
+
const paths: Record<OutputStatus['state'], string> = {
|
|
10
|
+
current: 'm3.5 8 3 3 6-6',
|
|
11
|
+
behind: 'M12.5 5A5 5 0 1 0 13 9M12.5 1.5V5H9',
|
|
12
|
+
stale: 'm4.5 4.5 7 7m0-7-7 7',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Decorative execution-state mark; the surface around it supplies colour and the accessible name. */
|
|
16
|
+
export const OutputStatusGlyph = forwardRef<SVGSVGElement, OutputStatusGlyphProps>(function OutputStatusGlyph({
|
|
17
|
+
state, ...props
|
|
18
|
+
}, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<svg
|
|
21
|
+
data-slot="output-status-glyph"
|
|
22
|
+
width="14"
|
|
23
|
+
height="14"
|
|
24
|
+
viewBox="0 0 16 16"
|
|
25
|
+
fill="none"
|
|
26
|
+
stroke="currentColor"
|
|
27
|
+
strokeWidth="1.5"
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
focusable="false"
|
|
30
|
+
{...props}
|
|
31
|
+
ref={ref}
|
|
32
|
+
data-state={state}
|
|
33
|
+
>
|
|
34
|
+
<path d={paths[state]} strokeLinecap="round" strokeLinejoin="round" />
|
|
35
|
+
</svg>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/refs, @typescript-eslint/unbound-method -- Floating UI uses callback refs during render. */
|
|
2
|
+
import {
|
|
3
|
+
FloatingPortal, autoUpdate, flip, offset, shift,
|
|
4
|
+
useDismiss, useFloating, useFocus, useHover, useInteractions, useRole,
|
|
5
|
+
} from '@floating-ui/react';
|
|
6
|
+
import { useCallback, useState, type ReactElement } from 'react';
|
|
7
|
+
import { Slot } from './slot.js';
|
|
8
|
+
|
|
9
|
+
/** A small, non-interactive explanation. Preserves the trigger's tab order. */
|
|
10
|
+
export function Tooltip({ children, content }: { children: ReactElement; content: string }) {
|
|
11
|
+
const [open, setOpen] = useState(false);
|
|
12
|
+
const [portalRoot, setPortalRoot] = useState<HTMLElement | null>(null);
|
|
13
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
14
|
+
open,
|
|
15
|
+
onOpenChange: setOpen,
|
|
16
|
+
placement: 'top',
|
|
17
|
+
strategy: 'fixed',
|
|
18
|
+
whileElementsMounted: autoUpdate,
|
|
19
|
+
middleware: [offset(6), flip({ padding: 8 }), shift({ padding: 8 })],
|
|
20
|
+
});
|
|
21
|
+
const hover = useHover(context, { move: false, delay: { open: 150, close: 100 } });
|
|
22
|
+
const focus = useFocus(context);
|
|
23
|
+
const dismiss = useDismiss(context);
|
|
24
|
+
const role = useRole(context, { role: 'tooltip' });
|
|
25
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([hover, focus, dismiss, role]);
|
|
26
|
+
const setFloatingReference = refs.setReference;
|
|
27
|
+
// Preserve host theme tokens and native-dialog stacking, outside clipped previews.
|
|
28
|
+
const setReference = useCallback((element: HTMLElement | null) => {
|
|
29
|
+
setFloatingReference(element);
|
|
30
|
+
setPortalRoot(element?.closest<HTMLElement>('dialog, .astra-ui') ?? null);
|
|
31
|
+
}, [setFloatingReference]);
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<Slot ref={setReference} {...getReferenceProps()}>{children}</Slot>
|
|
35
|
+
{open ? (
|
|
36
|
+
<FloatingPortal root={portalRoot ?? undefined}>
|
|
37
|
+
<div className={portalRoot ? undefined : 'astra-ui'}>
|
|
38
|
+
<div
|
|
39
|
+
{...getFloatingProps()}
|
|
40
|
+
ref={refs.setFloating}
|
|
41
|
+
style={floatingStyles}
|
|
42
|
+
className="astra-tooltip"
|
|
43
|
+
>
|
|
44
|
+
{content}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</FloatingPortal>
|
|
48
|
+
) : null}
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
package/src/views/inventory.tsx
CHANGED
|
@@ -6,42 +6,53 @@ import {
|
|
|
6
6
|
type ResolvedOutput,
|
|
7
7
|
type ResolvedRecord,
|
|
8
8
|
} from '@astra-spec/sdk';
|
|
9
|
-
import { forwardRef, useEffect, useMemo, useRef, type HTMLAttributes, type ReactNode } from 'react';
|
|
9
|
+
import { forwardRef, useEffect, useMemo, useRef, useState, type HTMLAttributes, type ReactNode } from 'react';
|
|
10
10
|
import { collectInventoryPapers, findPaper, paperForDoi, type InventoryPaper, type InventoryPaperMetadataMap } from '../model/papers.js';
|
|
11
11
|
import { locateRecord } from '../model/locate-record.js';
|
|
12
12
|
import { cn } from '../lib/cn.js';
|
|
13
13
|
import { LabelsProvider, useLabels, type AstraLabelOverrides } from '../lib/labels.js';
|
|
14
14
|
import type { OpenPaperFileHandler } from '../components/paper-detail.js';
|
|
15
15
|
import type { PdfJsLoader } from '../lib/pdf-runtime.js';
|
|
16
|
+
import type { OutputStatusLookup } from '../model/output-status.js';
|
|
16
17
|
import { RecordDialog } from '../components/record-dialog.js';
|
|
17
18
|
import { useDetailStack, type DetailEntry } from '../lib/detail-stack.js';
|
|
18
19
|
import type { ArtifactRenderer } from '../components/artifact-preview.js';
|
|
19
20
|
import { DialogProvider, type DialogMode } from '../primitives/dialog.js';
|
|
20
21
|
import type { TextRenderer } from '../lib/prose.js';
|
|
21
22
|
import { DecisionsList } from '../blocks/decisions-list.js';
|
|
23
|
+
import { AnalysisTree } from '../blocks/analysis-tree.js';
|
|
22
24
|
import { FindingsList } from '../blocks/findings-list.js';
|
|
23
25
|
import { InputsList } from '../blocks/inputs-list.js';
|
|
24
26
|
import { OutputsList } from '../blocks/outputs-list.js';
|
|
25
27
|
import { PapersList } from '../blocks/papers-list.js';
|
|
26
|
-
import { PriorInsightsList } from '../blocks/prior-insights-list.js';
|
|
27
28
|
import { InventoryOutline, InventorySection } from '../blocks/section.js';
|
|
28
29
|
import { sectionKind, type InventorySectionId } from '../model/kind.js';
|
|
29
30
|
|
|
30
|
-
export const DEFAULT_SECTIONS: readonly InventorySectionId[] = ['outputs', 'decisions', 'inputs', 'findings', '
|
|
31
|
+
export const DEFAULT_SECTIONS: readonly InventorySectionId[] = ['outputs', 'decisions', 'inputs', 'findings', 'papers'];
|
|
31
32
|
|
|
32
33
|
export interface InventoryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
33
34
|
document: ResolvedAnalysisDocument;
|
|
34
35
|
/** Pass a prebuilt index to share it with the host; otherwise one is derived from `document`. */
|
|
35
36
|
index?: AnalysisIndex | undefined;
|
|
36
|
-
/**
|
|
37
|
+
/** Controlled analysis selection; pair with `onSelectAnalysis`. Omit to let Inventory navigate internally. Unknown paths show the root. */
|
|
37
38
|
analysisPath?: string | undefined;
|
|
39
|
+
/** Observe navigation, or update `analysisPath` when controlling selection. */
|
|
40
|
+
onSelectAnalysis?: ((canonicalPath: string) => void) | undefined;
|
|
38
41
|
/** Which sections to show, in order. */
|
|
39
42
|
sections?: readonly InventorySectionId[] | undefined;
|
|
40
43
|
/** Prefix for section anchor ids, so several explorers can share a page. */
|
|
41
44
|
idPrefix?: string | undefined;
|
|
42
45
|
showOutline?: boolean | undefined;
|
|
46
|
+
/** Show project navigation below the outline (default true). Hosts controlling `analysisPath` must pair it with `onSelectAnalysis`. */
|
|
47
|
+
showHierarchy?: boolean | undefined;
|
|
43
48
|
labels?: AstraLabelOverrides | undefined;
|
|
44
49
|
renderArtifact?: ArtifactRenderer | undefined;
|
|
50
|
+
/** Host renderer for recorded output provenance, shown below Recipe. */
|
|
51
|
+
renderProvenance?: ((output: ResolvedOutput) => ReactNode) | undefined;
|
|
52
|
+
/** Optional execution status, keyed by the host to the selected universe. */
|
|
53
|
+
getOutputStatus?: OutputStatusLookup | undefined;
|
|
54
|
+
/** Host-provided link to the current code file, shown beside Recipe. */
|
|
55
|
+
renderCodeLink?: ((output: ResolvedOutput) => ReactNode) | undefined;
|
|
45
56
|
renderText?: TextRenderer | undefined;
|
|
46
57
|
loadPdfJs?: PdfJsLoader | undefined;
|
|
47
58
|
onOpenPaperFile?: OpenPaperFileHandler | undefined;
|
|
@@ -83,11 +94,16 @@ export const Inventory = forwardRef<HTMLDivElement, InventoryProps>(function Inv
|
|
|
83
94
|
const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(function ExplorerBody({
|
|
84
95
|
document,
|
|
85
96
|
index: providedIndex,
|
|
86
|
-
analysisPath
|
|
97
|
+
analysisPath,
|
|
98
|
+
onSelectAnalysis,
|
|
87
99
|
sections = DEFAULT_SECTIONS,
|
|
88
100
|
idPrefix = '',
|
|
89
101
|
showOutline = true,
|
|
102
|
+
showHierarchy = true,
|
|
90
103
|
renderArtifact,
|
|
104
|
+
renderProvenance,
|
|
105
|
+
getOutputStatus,
|
|
106
|
+
renderCodeLink,
|
|
91
107
|
renderText,
|
|
92
108
|
loadPdfJs,
|
|
93
109
|
onOpenPaperFile,
|
|
@@ -105,7 +121,16 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
|
|
|
105
121
|
}, ref) {
|
|
106
122
|
const labels = useLabels();
|
|
107
123
|
const index = useMemo(() => providedIndex ?? indexAnalysis(document), [document, providedIndex]);
|
|
108
|
-
const
|
|
124
|
+
const [internalAnalysisPath, setInternalAnalysisPath] = useState('$');
|
|
125
|
+
// Reset a removed selection so reintroducing that path does not navigate back.
|
|
126
|
+
if (analysisPath === undefined && internalAnalysisPath !== '$' && !index.analysisByPath.has(internalAnalysisPath)) {
|
|
127
|
+
setInternalAnalysisPath('$');
|
|
128
|
+
}
|
|
129
|
+
const analysis = index.analysisByPath.get(analysisPath ?? internalAnalysisPath) ?? document.analysis;
|
|
130
|
+
const selectAnalysis = (path: string) => {
|
|
131
|
+
if (analysisPath === undefined) setInternalAnalysisPath(path);
|
|
132
|
+
onSelectAnalysis?.(path);
|
|
133
|
+
};
|
|
109
134
|
const papers = useMemo(
|
|
110
135
|
() => collectInventoryPapers(document, index, analysis, paperMetadata),
|
|
111
136
|
[analysis, document, index, paperMetadata],
|
|
@@ -141,7 +166,7 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
|
|
|
141
166
|
const sectionContent: Record<InventorySectionId, { count: number; content: ReactNode }> = {
|
|
142
167
|
outputs: {
|
|
143
168
|
count: analysis.outputs.length,
|
|
144
|
-
content: <OutputsList analysis={analysis} renderArtifact={renderArtifact} onOpenRecord={openRecord} />,
|
|
169
|
+
content: <OutputsList analysis={analysis} getOutputStatus={getOutputStatus} renderArtifact={renderArtifact} onOpenRecord={openRecord} />,
|
|
145
170
|
},
|
|
146
171
|
decisions: {
|
|
147
172
|
count: analysis.decisions.length,
|
|
@@ -155,10 +180,6 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
|
|
|
155
180
|
count: analysis.findings.length,
|
|
156
181
|
content: <FindingsList analysis={analysis} onOpenRecord={openRecord} />,
|
|
157
182
|
},
|
|
158
|
-
prior_insights: {
|
|
159
|
-
count: analysis.prior_insights.length,
|
|
160
|
-
content: <PriorInsightsList analysis={analysis} onOpenRecord={openRecord} />,
|
|
161
|
-
},
|
|
162
183
|
papers: {
|
|
163
184
|
count: papers.length,
|
|
164
185
|
content: (
|
|
@@ -170,11 +191,11 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
|
|
|
170
191
|
),
|
|
171
192
|
},
|
|
172
193
|
};
|
|
173
|
-
const anchorId = (section: InventorySectionId) => `${idPrefix}${section
|
|
194
|
+
const anchorId = (section: InventorySectionId) => `${idPrefix}${section}`;
|
|
174
195
|
|
|
175
196
|
return (
|
|
176
197
|
<div data-slot="inventory" {...rest} ref={ref} className={cn('astra-inventory', className)}>
|
|
177
|
-
<div className="astra-inventory__layout">
|
|
198
|
+
<div className="astra-inventory__layout" data-sidebar={showOutline || showHierarchy ? '' : undefined}>
|
|
178
199
|
<div className="astra-inventory__sections">
|
|
179
200
|
{sections.map((section) => (
|
|
180
201
|
<InventorySection
|
|
@@ -190,15 +211,24 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
|
|
|
190
211
|
))}
|
|
191
212
|
{children}
|
|
192
213
|
</div>
|
|
193
|
-
{showOutline ? (
|
|
194
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
214
|
+
{showOutline || showHierarchy ? (
|
|
215
|
+
<div className="astra-inventory__sidebar" data-has-tree={showHierarchy ? '' : undefined}>
|
|
216
|
+
{showOutline ? <InventoryOutline
|
|
217
|
+
entries={sections.map((section) => ({
|
|
218
|
+
id: anchorId(section),
|
|
219
|
+
label: labels.sections[section],
|
|
220
|
+
count: sectionContent[section].count,
|
|
221
|
+
kind: sectionKind(section),
|
|
222
|
+
}))}
|
|
223
|
+
/> : null}
|
|
224
|
+
{showHierarchy ? (
|
|
225
|
+
<AnalysisTree
|
|
226
|
+
document={document}
|
|
227
|
+
analysisPath={analysis.canonicalPath}
|
|
228
|
+
onSelectAnalysis={selectAnalysis}
|
|
229
|
+
/>
|
|
230
|
+
) : null}
|
|
231
|
+
</div>
|
|
202
232
|
) : null}
|
|
203
233
|
</div>
|
|
204
234
|
{stack.active ? (
|
|
@@ -211,6 +241,8 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
|
|
|
211
241
|
papers={papers}
|
|
212
242
|
paperMetadata={paperMetadata}
|
|
213
243
|
renderArtifact={renderArtifact}
|
|
244
|
+
renderProvenance={renderProvenance}
|
|
245
|
+
renderCodeLink={renderCodeLink}
|
|
214
246
|
renderText={renderText}
|
|
215
247
|
loadPdfJs={loadPdfJs}
|
|
216
248
|
onOpenPaperFile={onOpenPaperFile}
|
package/styles/base.css
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@layer astra.tokens, astra.base, astra.components, astra.views;
|
|
3
3
|
@layer astra.views {
|
|
4
4
|
:where(.astra-ui) .astra-analysis-tree {
|
|
5
|
-
overflow: visible;
|
|
6
5
|
font-family: var(--astra-font-ui);
|
|
7
6
|
}
|
|
8
7
|
|
|
@@ -21,44 +20,42 @@
|
|
|
21
20
|
list-style: none;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
:where(.astra-ui) .astra-analysis-tree
|
|
25
|
-
|
|
23
|
+
:where(.astra-ui) .astra-analysis-tree ul ul {
|
|
24
|
+
margin-inline-start: 20px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Indent four levels at most, so deep projects keep room for their labels. */
|
|
28
|
+
:where(.astra-ui) .astra-analysis-tree ul ul ul ul ul ul {
|
|
29
|
+
margin-inline-start: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where(.astra-ui) .astra-analysis-tree__select {
|
|
33
|
+
display: block;
|
|
26
34
|
width: 100%;
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
min-width: 0;
|
|
36
|
+
padding: 7px 0;
|
|
29
37
|
cursor: pointer;
|
|
30
38
|
border: 0;
|
|
31
|
-
border-radius:
|
|
39
|
+
border-radius: 0;
|
|
32
40
|
background: transparent;
|
|
33
|
-
color: var(--astra-color-text-
|
|
34
|
-
padding: 6px 8px;
|
|
41
|
+
color: var(--astra-color-text-subtle);
|
|
35
42
|
font: inherit;
|
|
36
43
|
font-size: var(--astra-font-size-sm);
|
|
37
|
-
line-height: 1.
|
|
44
|
+
line-height: 1.4;
|
|
38
45
|
text-align: start;
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
:where(.astra-ui) .astra-analysis-
|
|
42
|
-
flex: 0 0 auto;
|
|
43
|
-
color: var(--astra-color-kind-analysis);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:where(.astra-ui) .astra-analysis-tree button span {
|
|
48
|
+
:where(.astra-ui) .astra-analysis-tree__select span {
|
|
47
49
|
min-width: 0;
|
|
48
|
-
overflow:
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
|
-
white-space: nowrap;
|
|
50
|
+
overflow-wrap: anywhere;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
:where(.astra-ui) .astra-analysis-
|
|
54
|
-
|
|
55
|
-
background: var(--astra-color-surface-muted);
|
|
56
|
-
color: var(--astra-color-text);
|
|
53
|
+
:where(.astra-ui) .astra-analysis-tree__select:where([aria-current="page"]) {
|
|
54
|
+
font-weight: 700;
|
|
57
55
|
}
|
|
58
56
|
|
|
59
|
-
:where(.astra-ui) .astra-analysis-
|
|
60
|
-
|
|
57
|
+
:where(.astra-ui) .astra-analysis-tree__select:hover,
|
|
58
|
+
:where(.astra-ui) .astra-analysis-tree__select:focus-visible {
|
|
61
59
|
color: var(--astra-color-text);
|
|
62
|
-
font-weight: 700;
|
|
63
60
|
}
|
|
64
61
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* findings-list — emitted by src/blocks/findings-list.tsx */
|
|
2
|
+
@layer astra.tokens, astra.base, astra.components, astra.views;
|
|
3
|
+
@layer astra.views {
|
|
4
|
+
/* A finding is a sentence, not a name: the row gives it the width to be
|
|
5
|
+
read, and hangs its identity and evidence count underneath. */
|
|
6
|
+
:where(.astra-ui) .astra-findings-list__entry {
|
|
7
|
+
align-items: start;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:where(.astra-ui) .astra-findings-list__copy {
|
|
11
|
+
display: grid;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
gap: 5px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:where(.astra-ui) .astra-findings-list__entry .astra-findings-list__claim {
|
|
17
|
+
overflow: visible;
|
|
18
|
+
color: var(--astra-color-text);
|
|
19
|
+
font: 400 var(--astra-font-size-sm)/1.45 var(--astra-font-body);
|
|
20
|
+
text-overflow: clip;
|
|
21
|
+
white-space: normal;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where(.astra-ui) .astra-findings-list__meta {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
align-items: baseline;
|
|
28
|
+
gap: 4px 10px;
|
|
29
|
+
color: var(--astra-color-text-subtle);
|
|
30
|
+
font: 400 var(--astra-font-size-2xs)/1.3 var(--astra-font-ui);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where(.astra-ui) .astra-findings-list__entry .astra-findings-list__name {
|
|
34
|
+
overflow: visible;
|
|
35
|
+
color: var(--astra-color-kind-finding);
|
|
36
|
+
font-family: var(--astra-font-mono);
|
|
37
|
+
text-overflow: clip;
|
|
38
|
+
white-space: normal;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* The evidence count now belongs to the metadata line, not a fixed column. */
|
|
42
|
+
:where(.astra-ui) .astra-findings-list__meta .astra-record-list__count {
|
|
43
|
+
overflow: visible;
|
|
44
|
+
color: inherit;
|
|
45
|
+
font: inherit;
|
|
46
|
+
text-overflow: clip;
|
|
47
|
+
white-space: normal;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|