@treasuryspatial/viewer-ui-kit 0.1.42 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminLayout.js +1 -1
- package/dist/AdminShell.d.ts +6 -1
- package/dist/AdminShell.d.ts.map +1 -1
- package/dist/AdminShell.js +45 -3
- package/dist/ChooserActionCard.d.ts +10 -0
- package/dist/ChooserActionCard.d.ts.map +1 -0
- package/dist/ChooserActionCard.js +39 -0
- package/dist/ComposerRightRail.d.ts +3 -1
- package/dist/ComposerRightRail.d.ts.map +1 -1
- package/dist/ComposerRightRail.js +11 -43
- package/dist/ConfiguratorShell.js +1 -1
- package/dist/LandingShell.d.ts +2 -1
- package/dist/LandingShell.d.ts.map +1 -1
- package/dist/LandingShell.js +133 -33
- package/dist/LoginShell.d.ts +2 -1
- package/dist/LoginShell.d.ts.map +1 -1
- package/dist/LoginShell.js +26 -3
- package/dist/ManifestTopBar.d.ts +7 -1
- package/dist/ManifestTopBar.d.ts.map +1 -1
- package/dist/ManifestTopBar.js +249 -38
- package/dist/MetricsPanel.d.ts +1 -1
- package/dist/MetricsPanel.d.ts.map +1 -1
- package/dist/MetricsPanel.js +19 -29
- package/dist/MetricsPanelContent.d.ts +38 -17
- package/dist/MetricsPanelContent.d.ts.map +1 -1
- package/dist/MetricsPanelContent.js +84 -90
- package/dist/ModeBar.d.ts +6 -2
- package/dist/ModeBar.d.ts.map +1 -1
- package/dist/ModeBar.js +49 -82
- package/dist/ModuleSelectorPanel.d.ts +2 -1
- package/dist/ModuleSelectorPanel.d.ts.map +1 -1
- package/dist/ModuleSelectorPanel.js +47 -49
- package/dist/PanelSkin.d.ts.map +1 -1
- package/dist/PanelSkin.js +1598 -312
- package/dist/PanelSystem.d.ts +45 -0
- package/dist/PanelSystem.d.ts.map +1 -0
- package/dist/PanelSystem.js +450 -0
- package/dist/PanelTabs.d.ts.map +1 -1
- package/dist/PanelTabs.js +8 -34
- package/dist/PanelToggleDock.d.ts +10 -0
- package/dist/PanelToggleDock.d.ts.map +1 -0
- package/dist/PanelToggleDock.js +40 -0
- package/dist/PromptPackChooserPanel.d.ts +12 -11
- package/dist/PromptPackChooserPanel.d.ts.map +1 -1
- package/dist/PromptPackChooserPanel.js +103 -63
- package/dist/SceneInspectorPanel.d.ts +42 -0
- package/dist/SceneInspectorPanel.d.ts.map +1 -0
- package/dist/SceneInspectorPanel.js +135 -0
- package/dist/ScienceDataPanelContent.d.ts +16 -0
- package/dist/ScienceDataPanelContent.d.ts.map +1 -0
- package/dist/ScienceDataPanelContent.js +31 -0
- package/dist/ScienceMetricsPanelContent.d.ts +53 -0
- package/dist/ScienceMetricsPanelContent.d.ts.map +1 -0
- package/dist/ScienceMetricsPanelContent.js +415 -0
- package/dist/SpatialHud.d.ts +18 -0
- package/dist/SpatialHud.d.ts.map +1 -0
- package/dist/SpatialHud.js +120 -0
- package/dist/StreetviewModeSurface.d.ts +40 -0
- package/dist/StreetviewModeSurface.d.ts.map +1 -0
- package/dist/StreetviewModeSurface.js +358 -0
- package/dist/SurfaceSwitcher.d.ts +11 -0
- package/dist/SurfaceSwitcher.d.ts.map +1 -0
- package/dist/SurfaceSwitcher.js +46 -0
- package/dist/TopBar.d.ts +2 -0
- package/dist/TopBar.d.ts.map +1 -1
- package/dist/TopBar.js +3 -1
- package/dist/UnknownModeSurface.d.ts +6 -0
- package/dist/UnknownModeSurface.d.ts.map +1 -0
- package/dist/UnknownModeSurface.js +41 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/landingTokens.d.ts +7 -0
- package/dist/landingTokens.d.ts.map +1 -0
- package/dist/landingTokens.js +6 -0
- package/dist/layout.d.ts +27 -27
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +33 -27
- package/dist/mapMetrics.d.ts +88 -0
- package/dist/mapMetrics.d.ts.map +1 -0
- package/dist/mapMetrics.js +1 -0
- package/dist/panelPrimitives.d.ts +11 -0
- package/dist/panelPrimitives.d.ts.map +1 -0
- package/dist/panelPrimitives.js +41 -0
- package/dist/topbarLogoPolicy.d.ts +14 -0
- package/dist/topbarLogoPolicy.d.ts.map +1 -0
- package/dist/topbarLogoPolicy.js +41 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -5
|
@@ -1,89 +1,129 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { panelSystemActionCardCss, panelSystemBodyTextCss, panelSystemCardCss, panelSystemFeatureToggleCss, panelSystemLabelCss, panelSystemSectionHeadingCss, panelSystemSubheadingCss, } from './PanelSystem.js';
|
|
5
|
+
const SPATIAL_RENDER_PROMPT_PACK_ID = 'vanilla';
|
|
6
|
+
const SPATIAL_RENDER_PROMPT_PACK_LABEL = 'Spatial Render';
|
|
7
|
+
const SPATIAL_RENDER_PROMPT_PACK_DESCRIPTION = 'Default spatial render prompt kit for active Composer modes.';
|
|
8
|
+
const normalizePackLabel = (entry) => {
|
|
9
|
+
const id = entry?.id?.trim() || '';
|
|
10
|
+
const label = entry?.chooserLabel?.trim() || entry?.label?.trim() || id;
|
|
11
|
+
if (id === SPATIAL_RENDER_PROMPT_PACK_ID || label.toLowerCase() === SPATIAL_RENDER_PROMPT_PACK_ID) {
|
|
12
|
+
return SPATIAL_RENDER_PROMPT_PACK_LABEL;
|
|
13
|
+
}
|
|
14
|
+
return label;
|
|
15
|
+
};
|
|
16
|
+
const normalizeActiveLabel = (label, activePackId) => {
|
|
17
|
+
const trimmed = label.trim();
|
|
18
|
+
if (activePackId?.trim() === SPATIAL_RENDER_PROMPT_PACK_ID || trimmed.toLowerCase() === SPATIAL_RENDER_PROMPT_PACK_ID) {
|
|
19
|
+
return SPATIAL_RENDER_PROMPT_PACK_LABEL;
|
|
20
|
+
}
|
|
21
|
+
return trimmed;
|
|
22
|
+
};
|
|
23
|
+
const normalizePackDescription = (entry) => {
|
|
24
|
+
const description = entry?.description?.trim() || '';
|
|
25
|
+
if (entry?.id?.trim() === SPATIAL_RENDER_PROMPT_PACK_ID &&
|
|
26
|
+
(!description || description.toLowerCase().includes('canonical shared fallback'))) {
|
|
27
|
+
return SPATIAL_RENDER_PROMPT_PACK_DESCRIPTION;
|
|
28
|
+
}
|
|
29
|
+
return description;
|
|
30
|
+
};
|
|
31
|
+
const normalizeActiveDescription = (description, activePackId) => {
|
|
32
|
+
const trimmed = description?.trim() || '';
|
|
33
|
+
if (activePackId?.trim() === SPATIAL_RENDER_PROMPT_PACK_ID &&
|
|
34
|
+
(!trimmed || trimmed.toLowerCase().includes('canonical shared fallback'))) {
|
|
35
|
+
return SPATIAL_RENDER_PROMPT_PACK_DESCRIPTION;
|
|
36
|
+
}
|
|
37
|
+
return trimmed;
|
|
38
|
+
};
|
|
4
39
|
const Root = styled.div `
|
|
5
40
|
display: flex;
|
|
6
41
|
flex-direction: column;
|
|
7
|
-
gap:
|
|
8
|
-
border-radius: 16px;
|
|
9
|
-
border: 1px solid var(--viewer-ui-color-panel-border);
|
|
10
|
-
background: var(--viewer-ui-color-surface);
|
|
11
|
-
padding: 14px;
|
|
12
|
-
`;
|
|
13
|
-
const Intro = styled.div `
|
|
14
|
-
font-size: 11px;
|
|
15
|
-
text-transform: lowercase;
|
|
16
|
-
color: var(--viewer-ui-color-text-muted);
|
|
42
|
+
gap: 14px;
|
|
17
43
|
`;
|
|
18
44
|
const Title = styled.div `
|
|
19
|
-
|
|
20
|
-
text-transform: uppercase;
|
|
21
|
-
letter-spacing: 0.2em;
|
|
22
|
-
color: var(--viewer-ui-color-text-muted);
|
|
45
|
+
${panelSystemSectionHeadingCss}
|
|
23
46
|
`;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
const PackGrid = styled.div `
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 12px;
|
|
28
51
|
`;
|
|
29
|
-
const
|
|
52
|
+
const PackCard = styled.button `
|
|
53
|
+
${panelSystemActionCardCss}
|
|
54
|
+
min-height: 0;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
align-items: stretch;
|
|
57
|
+
border: 1px solid
|
|
58
|
+
${(props) => props.$warning
|
|
59
|
+
? 'rgba(217, 119, 6, 0.35)'
|
|
60
|
+
: props.$selected
|
|
61
|
+
? 'var(--viewer-ui-color-button-primary)'
|
|
62
|
+
: 'var(--viewer-ui-color-panel-border-subtle)'};
|
|
63
|
+
background: ${(props) => props.$warning
|
|
64
|
+
? 'rgba(255, 251, 235, 0.96)'
|
|
65
|
+
: props.$selected
|
|
66
|
+
? 'color-mix(in srgb, var(--viewer-ui-color-button-primary) 10%, var(--viewer-ui-color-surface))'
|
|
67
|
+
: 'var(--viewer-ui-color-surface)'};
|
|
68
|
+
color: var(--viewer-ui-color-text-strong);
|
|
69
|
+
padding: 16px 18px;
|
|
70
|
+
text-align: left;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
|
|
73
|
+
&:disabled {
|
|
74
|
+
cursor: default;
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
const PackHead = styled.div `
|
|
30
78
|
display: flex;
|
|
31
79
|
align-items: center;
|
|
32
80
|
justify-content: space-between;
|
|
33
81
|
gap: 8px;
|
|
34
82
|
`;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
83
|
+
const PackLabel = styled.span `
|
|
84
|
+
${panelSystemSubheadingCss}
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
`;
|
|
87
|
+
const PackStatus = styled.span `
|
|
88
|
+
${panelSystemLabelCss}
|
|
39
89
|
color: var(--viewer-ui-color-text-muted);
|
|
40
90
|
`;
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
color: var(--viewer-ui-color-text);
|
|
91
|
+
const PackDescription = styled.div `
|
|
92
|
+
${panelSystemBodyTextCss}
|
|
93
|
+
color: ${(props) => (props.$warning ? 'rgb(146 64 14)' : 'var(--viewer-ui-color-text-muted)')};
|
|
44
94
|
`;
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
font-size: 11px;
|
|
54
|
-
text-transform: lowercase;
|
|
95
|
+
const ModeList = styled.div `
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
gap: 6px;
|
|
99
|
+
`;
|
|
100
|
+
const ModePill = styled.span `
|
|
101
|
+
${panelSystemFeatureToggleCss}
|
|
102
|
+
pointer-events: none;
|
|
55
103
|
`;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
104
|
+
const EmptyState = styled.div `
|
|
105
|
+
${panelSystemCardCss}
|
|
106
|
+
${panelSystemBodyTextCss}
|
|
107
|
+
border: 1px dashed var(--viewer-ui-color-panel-border-subtle);
|
|
59
108
|
padding: 10px 12px;
|
|
60
|
-
font-size: 11px;
|
|
61
|
-
text-transform: lowercase;
|
|
62
109
|
color: var(--viewer-ui-color-text-muted);
|
|
63
110
|
`;
|
|
64
|
-
const ActiveTitle = styled.div `
|
|
65
|
-
color: var(--viewer-ui-color-text-strong);
|
|
66
|
-
`;
|
|
67
111
|
const ResetButton = styled.button `
|
|
112
|
+
${panelSystemFeatureToggleCss}
|
|
68
113
|
align-self: flex-start;
|
|
69
|
-
border-radius: 999px;
|
|
70
|
-
border: 1px solid var(--viewer-ui-color-panel-border);
|
|
71
|
-
padding: 6px 10px;
|
|
72
|
-
font-size: 10px;
|
|
73
|
-
text-transform: uppercase;
|
|
74
|
-
letter-spacing: 0.2em;
|
|
75
|
-
color: var(--viewer-ui-color-text-muted);
|
|
76
|
-
background: transparent;
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
|
|
79
|
-
&:hover {
|
|
80
|
-
border-color: var(--viewer-ui-color-button-primary);
|
|
81
|
-
color: var(--viewer-ui-color-text-strong);
|
|
82
|
-
}
|
|
83
114
|
`;
|
|
84
|
-
export default function PromptPackChooserPanel({ modes, labelsByMode,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
115
|
+
export default function PromptPackChooserPanel({ modes, labelsByMode = {}, noteByMode = {}, activePackId, selectedPackId = '', catalog, onSelect, onReset, status = 'ready', error, activeLabel, activeDescription, activeWarning = false, }) {
|
|
116
|
+
void labelsByMode;
|
|
117
|
+
void noteByMode;
|
|
118
|
+
const resolvedModes = modes && modes.length > 0 ? modes : [];
|
|
119
|
+
const selectable = Boolean(catalog && onSelect);
|
|
120
|
+
const hasSelection = Boolean(selectedPackId.trim() && selectedPackId.trim() !== SPATIAL_RENDER_PROMPT_PACK_ID);
|
|
121
|
+
const displayActiveLabel = normalizeActiveLabel(activeLabel || activePackId || '', activePackId);
|
|
122
|
+
const displayActiveDescription = normalizeActiveDescription(activeDescription, activePackId);
|
|
123
|
+
return (_jsxs(Root, { children: [_jsx(Title, { children: "prompt kits" }), selectable ? (status === 'ready' ? (catalog && catalog.length > 0 ? (_jsx(PackGrid, { children: catalog.map((entry) => {
|
|
124
|
+
const selected = entry.id === selectedPackId || entry.id === activePackId;
|
|
125
|
+
const warning = activeWarning && entry.id === activePackId;
|
|
126
|
+
const description = warning && displayActiveDescription ? displayActiveDescription : normalizePackDescription(entry);
|
|
127
|
+
return (_jsxs(PackCard, { type: "button", "$selected": selected, "$warning": warning, onClick: () => onSelect?.(entry.id), children: [_jsxs(PackHead, { children: [_jsx(PackLabel, { children: normalizePackLabel(entry) }), selected ? _jsx(PackStatus, { children: "selected" }) : null] }), description ? (_jsx(PackDescription, { "$warning": warning, children: description })) : null, entry.modes?.length ? (_jsx(ModeList, { children: entry.modes.map((mode) => (_jsx(ModePill, { children: mode }, mode))) })) : null] }, entry.id));
|
|
128
|
+
}) })) : (_jsx(EmptyState, { children: "No prompt kits are published yet." }))) : (_jsx(EmptyState, { children: error || (status === 'loading' ? 'Loading prompt kit registry…' : 'Prompt kit registry unavailable.') }))) : displayActiveLabel ? (_jsxs(PackCard, { type: "button", "$selected": true, "$warning": activeWarning, disabled: true, children: [_jsxs(PackHead, { children: [_jsx(PackLabel, { children: displayActiveLabel }), _jsx(PackStatus, { children: "selected" })] }), displayActiveDescription ? (_jsx(PackDescription, { "$warning": activeWarning, children: displayActiveDescription })) : null, resolvedModes.length ? (_jsx(ModeList, { children: resolvedModes.map((mode) => (_jsx(ModePill, { children: mode }, mode))) })) : null] })) : null, selectable && onReset && hasSelection ? (_jsx(ResetButton, { type: "button", onClick: onReset, children: "reset prompt kit" })) : null] }));
|
|
89
129
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface SceneInspectorPanelProps {
|
|
2
|
+
topOffsetPx?: number;
|
|
3
|
+
open: boolean;
|
|
4
|
+
modeLabel?: string;
|
|
5
|
+
meshCount?: number;
|
|
6
|
+
triangleCount?: number;
|
|
7
|
+
boundsLabel?: string;
|
|
8
|
+
statusRows?: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
tone?: 'default' | 'ok' | 'warning' | 'error';
|
|
13
|
+
detail?: string;
|
|
14
|
+
}>;
|
|
15
|
+
diagnostics?: string[];
|
|
16
|
+
semanticSummary?: {
|
|
17
|
+
objectCount: number;
|
|
18
|
+
surfaceDomainCount: number;
|
|
19
|
+
cellCount: number;
|
|
20
|
+
surfaceClassCount?: number;
|
|
21
|
+
dataKeyCount?: number;
|
|
22
|
+
} | null;
|
|
23
|
+
selectedObject?: {
|
|
24
|
+
label: string;
|
|
25
|
+
rows: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
detail?: string;
|
|
30
|
+
tone?: 'default' | 'ok' | 'warning' | 'error';
|
|
31
|
+
}>;
|
|
32
|
+
} | null;
|
|
33
|
+
toggles: Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
active: boolean;
|
|
37
|
+
onToggle: () => void;
|
|
38
|
+
}>;
|
|
39
|
+
onToggleOpen: (next: boolean) => void;
|
|
40
|
+
}
|
|
41
|
+
export default function SceneInspectorPanel({ topOffsetPx, open, modeLabel, meshCount, triangleCount, boundsLabel, statusRows, diagnostics, semanticSummary, selectedObject, toggles, onToggleOpen, }: SceneInspectorPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=SceneInspectorPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneInspectorPanel.d.ts","sourceRoot":"","sources":["../src/SceneInspectorPanel.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;QAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,IAAI,CAAC;IACT,cAAc,CAAC,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,KAAK,CAAC;YACV,EAAE,EAAE,MAAM,CAAC;YACX,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;SAC/C,CAAC,CAAC;KACJ,GAAG,IAAI,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC,CAAC;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AA0HD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,WAAgB,EAChB,IAAI,EACJ,SAAS,EACT,SAAa,EACb,aAAiB,EACjB,WAAiB,EACjB,UAAe,EACf,WAAgB,EAChB,eAAsB,EACtB,cAAqB,EACrB,OAAO,EACP,YAAY,GACb,EAAE,wBAAwB,2CAyL1B"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { InspectorBody, InspectorCard, InspectorCollapse, InspectorHeader, InspectorRow, InspectorTitle, InspectorToggle, InspectorToggleRow, InspectorWrapper, } from './layout.js';
|
|
6
|
+
const DEBUG_TIMING_IDS = new Set([
|
|
7
|
+
'change-to-paint',
|
|
8
|
+
'change-to-generate',
|
|
9
|
+
'generate-to-response',
|
|
10
|
+
'response-to-scene',
|
|
11
|
+
'scene-to-paint',
|
|
12
|
+
]);
|
|
13
|
+
const SHADOW_DIAGNOSTIC_IDS = new Set(['shadow-lights', 'casters', 'receivers']);
|
|
14
|
+
const Section = styled.div `
|
|
15
|
+
display: grid;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
padding-top: 8px;
|
|
18
|
+
border-top: 1px solid rgba(148, 163, 184, 0.18);
|
|
19
|
+
`;
|
|
20
|
+
const SectionTitle = styled.div `
|
|
21
|
+
font-size: 10px;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
letter-spacing: 0.14em;
|
|
24
|
+
color: rgba(226, 232, 240, 0.72);
|
|
25
|
+
`;
|
|
26
|
+
const StatusValue = styled.span `
|
|
27
|
+
color: ${(props) => props.$tone === 'error'
|
|
28
|
+
? '#fda4af'
|
|
29
|
+
: props.$tone === 'warning'
|
|
30
|
+
? '#fde68a'
|
|
31
|
+
: props.$tone === 'ok'
|
|
32
|
+
? '#86efac'
|
|
33
|
+
: '#e2e8f0'};
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
text-align: right;
|
|
36
|
+
`;
|
|
37
|
+
const RowValue = styled.span `
|
|
38
|
+
color: ${(props) => props.$tone === 'error'
|
|
39
|
+
? '#fda4af'
|
|
40
|
+
: props.$tone === 'warning'
|
|
41
|
+
? '#fde68a'
|
|
42
|
+
: props.$tone === 'ok'
|
|
43
|
+
? '#86efac'
|
|
44
|
+
: '#e2e8f0'};
|
|
45
|
+
max-width: 210px;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-align: right;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
`;
|
|
51
|
+
const DiagnosticList = styled.div `
|
|
52
|
+
display: grid;
|
|
53
|
+
gap: 6px;
|
|
54
|
+
`;
|
|
55
|
+
const DiagnosticItem = styled.div `
|
|
56
|
+
font-size: 11px;
|
|
57
|
+
line-height: 1.45;
|
|
58
|
+
color: #fecaca;
|
|
59
|
+
background: rgba(127, 29, 29, 0.22);
|
|
60
|
+
border: 1px solid rgba(248, 113, 113, 0.28);
|
|
61
|
+
border-radius: 10px;
|
|
62
|
+
padding: 8px 10px;
|
|
63
|
+
`;
|
|
64
|
+
const InspectorMeta = styled.span `
|
|
65
|
+
font-size: 10px;
|
|
66
|
+
text-transform: uppercase;
|
|
67
|
+
letter-spacing: 0.12em;
|
|
68
|
+
color: rgba(226, 232, 240, 0.56);
|
|
69
|
+
`;
|
|
70
|
+
const TabRow = styled.div `
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-wrap: wrap;
|
|
73
|
+
gap: 6px;
|
|
74
|
+
padding-bottom: 4px;
|
|
75
|
+
`;
|
|
76
|
+
const TabButton = styled.button `
|
|
77
|
+
border: 1px solid rgba(148, 163, 184, 0.22);
|
|
78
|
+
border-radius: 999px;
|
|
79
|
+
background: rgba(15, 23, 42, 0.32);
|
|
80
|
+
color: rgba(226, 232, 240, 0.76);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
font: inherit;
|
|
83
|
+
font-size: 10px;
|
|
84
|
+
letter-spacing: 0.1em;
|
|
85
|
+
padding: 5px 8px;
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
|
|
88
|
+
&[data-active='true'] {
|
|
89
|
+
background: rgba(226, 232, 240, 0.16);
|
|
90
|
+
color: rgba(248, 250, 252, 1);
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
const EmptyState = styled.div `
|
|
94
|
+
border: 1px dashed rgba(148, 163, 184, 0.22);
|
|
95
|
+
border-radius: 10px;
|
|
96
|
+
color: rgba(226, 232, 240, 0.62);
|
|
97
|
+
font-size: 11px;
|
|
98
|
+
line-height: 1.45;
|
|
99
|
+
padding: 9px 10px;
|
|
100
|
+
`;
|
|
101
|
+
const renderRows = (rows) => rows.map((row) => (_jsxs(InspectorRow, { title: row.detail, children: [_jsx("span", { children: row.label }), _jsx(StatusValue, { "$tone": row.tone, children: row.value })] }, row.id)));
|
|
102
|
+
export default function SceneInspectorPanel({ topOffsetPx = 24, open, modeLabel, meshCount = 0, triangleCount = 0, boundsLabel = '-', statusRows = [], diagnostics = [], semanticSummary = null, selectedObject = null, toggles, onToggleOpen, }) {
|
|
103
|
+
const [activeTab, setActiveTab] = useState('health');
|
|
104
|
+
const { healthRows, registryStatusRows, shadowRows, timingRows } = useMemo(() => {
|
|
105
|
+
const rowGroups = {
|
|
106
|
+
healthRows: [],
|
|
107
|
+
registryStatusRows: [],
|
|
108
|
+
shadowRows: [],
|
|
109
|
+
timingRows: [],
|
|
110
|
+
};
|
|
111
|
+
statusRows.forEach((row) => {
|
|
112
|
+
if (DEBUG_TIMING_IDS.has(row.id)) {
|
|
113
|
+
rowGroups.timingRows.push(row);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (SHADOW_DIAGNOSTIC_IDS.has(row.id)) {
|
|
117
|
+
rowGroups.shadowRows.push(row);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (row.id === 'semantic-registry') {
|
|
121
|
+
rowGroups.registryStatusRows.push(row);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
rowGroups.healthRows.push(row);
|
|
125
|
+
});
|
|
126
|
+
return rowGroups;
|
|
127
|
+
}, [statusRows]);
|
|
128
|
+
const tabs = [
|
|
129
|
+
{ id: 'health', label: 'health' },
|
|
130
|
+
{ id: 'registry', label: 'registry' },
|
|
131
|
+
{ id: 'selection', label: 'selection' },
|
|
132
|
+
{ id: 'debug', label: 'debug' },
|
|
133
|
+
];
|
|
134
|
+
return (_jsx(InspectorWrapper, { "$topOffset": topOffsetPx, children: open ? (_jsxs(InspectorCard, { children: [_jsxs(InspectorHeader, { children: [_jsxs("div", { children: [_jsx(InspectorTitle, { children: "scene inspector" }), modeLabel ? _jsx(InspectorMeta, { children: modeLabel }) : null] }), _jsx(InspectorCollapse, { onClick: () => onToggleOpen(false), children: "hide" })] }), _jsxs(InspectorBody, { children: [_jsx(TabRow, { children: tabs.map((tab) => (_jsx(TabButton, { type: "button", "data-active": activeTab === tab.id, onClick: () => setActiveTab(tab.id), children: tab.label }, tab.id))) }), activeTab === 'health' ? (_jsxs(_Fragment, { children: [_jsxs(Section, { children: [_jsx(SectionTitle, { children: "runtime health" }), healthRows.length ? renderRows(healthRows) : _jsx(EmptyState, { children: "No runtime health rows are active for this mode." })] }), diagnostics.length ? (_jsxs(Section, { children: [_jsx(SectionTitle, { children: "contract diagnostics" }), _jsx(DiagnosticList, { children: diagnostics.map((message) => (_jsx(DiagnosticItem, { children: message }, message))) })] })) : null] })) : null, activeTab === 'registry' ? (_jsxs(_Fragment, { children: [_jsxs(Section, { children: [_jsx(SectionTitle, { children: "scene" }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "meshes" }), _jsx("span", { children: meshCount })] }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "triangles" }), _jsx("span", { children: triangleCount })] }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "bounds" }), _jsx("span", { children: boundsLabel })] }), registryStatusRows.length ? renderRows(registryStatusRows) : null] }), semanticSummary ? (_jsxs(Section, { children: [_jsx(SectionTitle, { children: "semantic registry" }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "objects" }), _jsx("span", { children: semanticSummary.objectCount })] }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "domains" }), _jsx("span", { children: semanticSummary.surfaceDomainCount })] }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "cells" }), _jsx("span", { children: semanticSummary.cellCount })] }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "surface classes" }), _jsx("span", { children: semanticSummary.surfaceClassCount ?? 0 })] }), _jsxs(InspectorRow, { children: [_jsx("span", { children: "data keys" }), _jsx("span", { children: semanticSummary.dataKeyCount ?? 0 })] })] })) : (_jsx(EmptyState, { children: "No render-side semantic registry is mounted yet." }))] })) : null, activeTab === 'selection' ? (selectedObject ? (_jsxs(Section, { children: [_jsx(SectionTitle, { children: "selected mesh" }), _jsxs(InspectorRow, { title: selectedObject.label, children: [_jsx("span", { children: "id" }), _jsx(RowValue, { "$tone": "ok", children: selectedObject.label })] }), selectedObject.rows.map((row) => (_jsxs(InspectorRow, { title: row.detail ?? row.value, children: [_jsx("span", { children: row.label }), _jsx(RowValue, { "$tone": row.tone, children: row.value })] }, row.id)))] })) : (_jsx(EmptyState, { children: "Click a registered mesh to populate this tab. The inspector stays closed unless opened explicitly." }))) : null, activeTab === 'debug' ? (_jsxs(_Fragment, { children: [_jsxs(Section, { children: [_jsx(SectionTitle, { children: "shadow diagnostics" }), shadowRows.length ? renderRows(shadowRows) : _jsx(EmptyState, { children: "No shadow diagnostics are active for this scene." })] }), _jsxs(Section, { children: [_jsx(SectionTitle, { children: "roundtrip timings" }), timingRows.length ? renderRows(timingRows) : _jsx(EmptyState, { children: "No roundtrip timings have been sampled yet." })] }), _jsxs(Section, { children: [_jsx(SectionTitle, { children: "viewer toggles" }), _jsx(InspectorToggleRow, { children: toggles.map((toggle) => (_jsx(InspectorToggle, { type: "button", "data-active": toggle.active, onClick: toggle.onToggle, children: toggle.label }, toggle.id))) })] })] })) : null] })] })) : (_jsx(InspectorCard, { children: _jsxs(InspectorHeader, { children: [_jsx(InspectorTitle, { children: "scene inspector" }), _jsx(InspectorCollapse, { onClick: () => onToggleOpen(true), children: "show" })] }) })) }));
|
|
135
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type SceneDataRow = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
tone?: 'default' | 'ok' | 'warning' | 'error';
|
|
6
|
+
detail?: string;
|
|
7
|
+
};
|
|
8
|
+
interface ScienceDataPanelContentProps {
|
|
9
|
+
modeLabel: string;
|
|
10
|
+
moduleLabel?: string | null;
|
|
11
|
+
promptPackLabel?: string | null;
|
|
12
|
+
sceneRows?: SceneDataRow[];
|
|
13
|
+
}
|
|
14
|
+
export default function ScienceDataPanelContent({ modeLabel, moduleLabel, promptPackLabel, sceneRows, }: ScienceDataPanelContentProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=ScienceDataPanelContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScienceDataPanelContent.d.ts","sourceRoot":"","sources":["../src/ScienceDataPanelContent.tsx"],"names":[],"mappings":"AAQA,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,UAAU,4BAA4B;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AAgCD,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,SAAS,EACT,WAAW,EACX,eAAe,EACf,SAAc,GACf,EAAE,4BAA4B,2CA0C9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { panelBodyTextCss, } from './panelPrimitives.js';
|
|
5
|
+
const Root = styled.div.attrs({ className: 'viewer-ui-panel-sections' }) ``;
|
|
6
|
+
const Summary = styled.p `
|
|
7
|
+
${panelBodyTextCss}
|
|
8
|
+
margin: 0;
|
|
9
|
+
`;
|
|
10
|
+
const Section = styled.section.attrs({ className: 'panel-section' }) ``;
|
|
11
|
+
const SectionHeader = styled.div.attrs({ className: 'panel-section-header' }) ``;
|
|
12
|
+
const SectionHeaderCopy = styled.div `
|
|
13
|
+
min-width: 0;
|
|
14
|
+
`;
|
|
15
|
+
const SectionList = styled.div.attrs({ className: 'panel-section-list' }) ``;
|
|
16
|
+
const DataRow = styled.div.attrs((props) => ({
|
|
17
|
+
className: 'panel-section-row',
|
|
18
|
+
'data-tone': props.$tone,
|
|
19
|
+
})) ``;
|
|
20
|
+
const DataMeta = styled.div.attrs({ className: 'panel-section-row-copy' }) ``;
|
|
21
|
+
const DataLabel = styled.span.attrs({ className: 'panel-section-row-label' }) ``;
|
|
22
|
+
const DataHelp = styled.span.attrs({ className: 'panel-section-row-help' }) ``;
|
|
23
|
+
const DataValue = styled.span.attrs({ className: 'panel-section-row-value' }) ``;
|
|
24
|
+
export default function ScienceDataPanelContent({ modeLabel, moduleLabel, promptPackLabel, sceneRows = [], }) {
|
|
25
|
+
const coreRows = [
|
|
26
|
+
{ id: 'mode', label: 'mode', value: modeLabel },
|
|
27
|
+
{ id: 'module', label: 'module', value: moduleLabel?.trim() || 'none' },
|
|
28
|
+
{ id: 'prompt-kit', label: 'prompt kit', value: promptPackLabel?.trim() || 'default' },
|
|
29
|
+
];
|
|
30
|
+
return (_jsxs(Root, { children: [_jsx(Section, { "data-panel-id": "science-data-overview", children: _jsx(SectionHeader, { children: _jsxs(SectionHeaderCopy, { children: [_jsx("h3", { children: "science data" }), _jsx("p", { children: "scene state + runtime records" }), _jsx(Summary, { children: "This tab is for live scene and runtime records. Science indicators belong in the metrics tab and should be manifest or plugin driven." })] }) }) }), _jsxs(Section, { "data-panel-id": "science-data-context", children: [_jsx(SectionHeader, { children: _jsx(SectionHeaderCopy, { children: _jsx("h3", { children: "scene context" }) }) }), _jsx(SectionList, { children: [...coreRows, ...sceneRows].map((row) => (_jsxs(DataRow, { "$tone": row.tone, children: [_jsxs(DataMeta, { children: [_jsx(DataLabel, { children: row.label }), row.detail ? _jsx(DataHelp, { children: row.detail }) : null] }), _jsx(DataValue, { children: row.value })] }, row.id))) })] })] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
type MetricsFeedKind = 'runtime' | 'viewer' | 'geometry' | 'render' | 'map';
|
|
2
|
+
type ToolMetricDefinition = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
summary?: string;
|
|
6
|
+
source: {
|
|
7
|
+
kind: MetricsFeedKind;
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
format?: 'text' | 'number' | 'count';
|
|
11
|
+
digits?: number;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
emptyLabel?: string;
|
|
15
|
+
};
|
|
16
|
+
type ToolMetricGroupDefinition = {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
summary?: string;
|
|
20
|
+
metrics: ToolMetricDefinition[];
|
|
21
|
+
};
|
|
22
|
+
type ToolMetricsDefinition = {
|
|
23
|
+
title?: string;
|
|
24
|
+
summary?: string;
|
|
25
|
+
groups: ToolMetricGroupDefinition[];
|
|
26
|
+
};
|
|
27
|
+
type ToolMetricsFeeds = Partial<Record<MetricsFeedKind, Record<string, unknown>>>;
|
|
28
|
+
export type ScienceMetricsRenderState = {
|
|
29
|
+
surfaceId?: string | null;
|
|
30
|
+
geometryStatus?: string | null;
|
|
31
|
+
lightingId?: string | null;
|
|
32
|
+
lightingLabel?: string | null;
|
|
33
|
+
materialsId?: string | null;
|
|
34
|
+
materialsLabel?: string | null;
|
|
35
|
+
skyLabel?: string | null;
|
|
36
|
+
renderCount?: number;
|
|
37
|
+
imageSetCount?: number;
|
|
38
|
+
};
|
|
39
|
+
interface ScienceMetricsPanelContentProps {
|
|
40
|
+
modeId: string;
|
|
41
|
+
modeLabel: string;
|
|
42
|
+
moduleLabel?: string | null;
|
|
43
|
+
moduleSummary?: string | null;
|
|
44
|
+
promptPackLabel?: string | null;
|
|
45
|
+
promptPackDescription?: string | null;
|
|
46
|
+
parameters?: Record<string, unknown> | null;
|
|
47
|
+
renderState?: ScienceMetricsRenderState | null;
|
|
48
|
+
toolMetrics?: ToolMetricsDefinition | null;
|
|
49
|
+
feeds?: ToolMetricsFeeds | null;
|
|
50
|
+
}
|
|
51
|
+
export default function ScienceMetricsPanelContent({ modeId, modeLabel, moduleLabel, moduleSummary, promptPackLabel, promptPackDescription, parameters, renderState, }: ScienceMetricsPanelContentProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=ScienceMetricsPanelContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScienceMetricsPanelContent.d.ts","sourceRoot":"","sources":["../src/ScienceMetricsPanelContent.tsx"],"names":[],"mappings":"AAUA,KAAK,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5E,KAAK,oBAAoB,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,eAAe,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,yBAAyB,EAAE,CAAC;CACrC,CAAC;AAEF,KAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AA6ClF,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,UAAU,+BAA+B;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACjC;AA2hBD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,MAAM,EACN,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,WAAW,GACZ,EAAE,+BAA+B,2CA4EjC"}
|