@principal-ai/principal-view-react 0.7.15 → 0.7.17
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 +9 -24
- package/dist/components/ConfigurationSelector.d.ts +1 -1
- package/dist/components/ConfigurationSelector.d.ts.map +1 -1
- package/dist/components/ConfigurationSelector.js +6 -10
- package/dist/components/ConfigurationSelector.js.map +1 -1
- package/dist/components/EdgeInfoPanel.d.ts +1 -1
- package/dist/components/EdgeInfoPanel.d.ts.map +1 -1
- package/dist/components/EdgeInfoPanel.js +14 -18
- package/dist/components/EdgeInfoPanel.js.map +1 -1
- package/dist/components/GraphRenderer.d.ts +1 -1
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +89 -92
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/NarrativeRenderer.d.ts +19 -0
- package/dist/components/NarrativeRenderer.d.ts.map +1 -0
- package/dist/components/NarrativeRenderer.js +103 -0
- package/dist/components/NarrativeRenderer.js.map +1 -0
- package/dist/components/NodeInfoPanel.d.ts +1 -1
- package/dist/components/NodeInfoPanel.d.ts.map +1 -1
- package/dist/components/NodeInfoPanel.js +33 -37
- package/dist/components/NodeInfoPanel.js.map +1 -1
- package/dist/components/NodeTooltip.js +15 -19
- package/dist/components/NodeTooltip.js.map +1 -1
- package/dist/components/SelectionSidebar.d.ts +1 -1
- package/dist/components/SelectionSidebar.d.ts.map +1 -1
- package/dist/components/SelectionSidebar.js +26 -30
- package/dist/components/SelectionSidebar.js.map +1 -1
- package/dist/components/TestEventPanel.d.ts +6 -0
- package/dist/components/TestEventPanel.d.ts.map +1 -1
- package/dist/components/TestEventPanel.js +157 -161
- package/dist/components/TestEventPanel.js.map +1 -1
- package/dist/edges/CustomEdge.d.ts +1 -1
- package/dist/edges/CustomEdge.d.ts.map +1 -1
- package/dist/edges/CustomEdge.js +18 -22
- package/dist/edges/CustomEdge.js.map +1 -1
- package/dist/edges/GenericEdge.d.ts +1 -1
- package/dist/edges/GenericEdge.d.ts.map +1 -1
- package/dist/edges/GenericEdge.js +3 -7
- package/dist/edges/GenericEdge.js.map +1 -1
- package/dist/hooks/usePathBasedEvents.d.ts +1 -1
- package/dist/hooks/usePathBasedEvents.d.ts.map +1 -1
- package/dist/hooks/usePathBasedEvents.js +14 -18
- package/dist/hooks/usePathBasedEvents.js.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -33
- package/dist/index.js.map +1 -1
- package/dist/nodes/CustomNode.d.ts +1 -1
- package/dist/nodes/CustomNode.d.ts.map +1 -1
- package/dist/nodes/CustomNode.js +22 -26
- package/dist/nodes/CustomNode.js.map +1 -1
- package/dist/nodes/GenericNode.d.ts +1 -1
- package/dist/nodes/GenericNode.d.ts.map +1 -1
- package/dist/nodes/GenericNode.js +4 -8
- package/dist/nodes/GenericNode.js.map +1 -1
- package/dist/utils/animationMapping.d.ts +1 -1
- package/dist/utils/animationMapping.d.ts.map +1 -1
- package/dist/utils/animationMapping.js +6 -13
- package/dist/utils/animationMapping.js.map +1 -1
- package/dist/utils/graphConverter.d.ts +1 -1
- package/dist/utils/graphConverter.d.ts.map +1 -1
- package/dist/utils/graphConverter.js +4 -8
- package/dist/utils/graphConverter.js.map +1 -1
- package/dist/utils/iconResolver.js +7 -45
- package/dist/utils/iconResolver.js.map +1 -1
- package/dist/utils/narrative-converter.d.ts +45 -0
- package/dist/utils/narrative-converter.d.ts.map +1 -0
- package/dist/utils/narrative-converter.js +113 -0
- package/dist/utils/narrative-converter.js.map +1 -0
- package/dist/utils/narrative-loader.d.ts +53 -0
- package/dist/utils/narrative-loader.d.ts.map +1 -0
- package/dist/utils/narrative-loader.js +163 -0
- package/dist/utils/narrative-loader.js.map +1 -0
- package/package.json +22 -25
- package/src/components/ConfigurationSelector.tsx +1 -1
- package/src/components/EdgeInfoPanel.tsx +1 -1
- package/src/components/GraphRenderer.test.tsx +1 -1
- package/src/components/GraphRenderer.tsx +2 -2
- package/src/components/NarrativeRenderer.tsx +171 -0
- package/src/components/NodeInfoPanel.tsx +1 -1
- package/src/components/NodeTooltip.tsx +3 -3
- package/src/components/PendingChanges.test.tsx +1 -1
- package/src/components/SelectionSidebar.tsx +1 -1
- package/src/components/TestEventPanel.tsx +140 -117
- package/src/edges/CustomEdge.tsx +1 -1
- package/src/edges/GenericEdge.tsx +1 -1
- package/src/hooks/usePathBasedEvents.ts +1 -1
- package/src/index.ts +1 -7
- package/src/nodes/CustomNode.tsx +1 -1
- package/src/nodes/GenericNode.tsx +1 -1
- package/src/stories/AnimationWorkshop.stories.tsx +1 -1
- package/src/stories/CanvasEdgeTypes.stories.tsx +1 -1
- package/src/stories/CanvasNodeTypes.stories.tsx +1 -1
- package/src/stories/ColorPriority.stories.tsx +1 -1
- package/src/stories/EventDrivenAnimations.stories.tsx +1 -1
- package/src/stories/GraphRenderer.stories.tsx +1 -1
- package/src/stories/Introduction.mdx +4 -21
- package/src/stories/MultiConfig.stories.tsx +1 -1
- package/src/stories/MultiDirectionalConnections.stories.tsx +1 -1
- package/src/stories/NodeFieldsAudit.stories.tsx +1 -1
- package/src/stories/NodeShapes.stories.tsx +1 -1
- package/src/stories/OtelComponents.stories.tsx +1 -1
- package/src/stories/RealTestExecution.stories.tsx +111 -1
- package/src/stories/TraceViewer.stories.tsx +1 -1
- package/src/stories/ValidatedExecution.stories.tsx +1 -1
- package/src/stories/data/graph-converter-test-execution.json +204 -326
- package/src/stories/data/graph-converter-test.narrative.json +106 -0
- package/src/stories/data/graph-converter-validated-execution.json +6 -6
- package/src/utils/animationMapping.ts +1 -1
- package/src/utils/graphConverter.ts +1 -1
- package/src/utils/narrative-converter.ts +147 -0
- package/src/utils/narrative-loader.ts +172 -0
- package/dist/components/EventLog.d.ts +0 -20
- package/dist/components/EventLog.d.ts.map +0 -1
- package/dist/components/EventLog.js +0 -13
- package/dist/components/EventLog.js.map +0 -1
- package/dist/components/EventLog.test.d.ts +0 -2
- package/dist/components/EventLog.test.d.ts.map +0 -1
- package/dist/components/EventLog.test.js +0 -73
- package/dist/components/EventLog.test.js.map +0 -1
- package/dist/components/GraphRenderer.test.d.ts +0 -2
- package/dist/components/GraphRenderer.test.d.ts.map +0 -1
- package/dist/components/GraphRenderer.test.js +0 -88
- package/dist/components/GraphRenderer.test.js.map +0 -1
- package/dist/components/LayerPanel.d.ts +0 -31
- package/dist/components/LayerPanel.d.ts.map +0 -1
- package/dist/components/LayerPanel.js +0 -207
- package/dist/components/LayerPanel.js.map +0 -1
- package/dist/components/MetricsDashboard.d.ts +0 -14
- package/dist/components/MetricsDashboard.d.ts.map +0 -1
- package/dist/components/MetricsDashboard.js +0 -13
- package/dist/components/MetricsDashboard.js.map +0 -1
- package/src/components/EventLog.test.tsx +0 -85
- package/src/components/EventLog.tsx +0 -51
- package/src/components/MetricsDashboard.tsx +0 -40
- package/src/stories/EventLog.stories.tsx +0 -161
- package/src/stories/IndustryThemes.stories.tsx +0 -483
- package/src/stories/MetricsDashboard.stories.tsx +0 -227
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LayerPanel = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const industry_theme_1 = require("@principal-ade/industry-theme");
|
|
7
|
-
const iconResolver_1 = require("../utils/iconResolver");
|
|
8
|
-
/**
|
|
9
|
-
* Panel that displays and controls layer visibility and organization
|
|
10
|
-
*/
|
|
11
|
-
const LayerPanel = ({ layers, onToggleLayer, onFocusLayer, showNarrativeMode = false, narrativeMode = false, onToggleNarrativeMode, position = 'left', }) => {
|
|
12
|
-
const { theme } = (0, industry_theme_1.useTheme)();
|
|
13
|
-
const [isCollapsed, setIsCollapsed] = (0, react_1.useState)(false);
|
|
14
|
-
const [expandedLayers, setExpandedLayers] = (0, react_1.useState)(new Set());
|
|
15
|
-
const toggleLayerExpanded = (layerId) => {
|
|
16
|
-
const newExpanded = new Set(expandedLayers);
|
|
17
|
-
if (newExpanded.has(layerId)) {
|
|
18
|
-
newExpanded.delete(layerId);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
newExpanded.add(layerId);
|
|
22
|
-
}
|
|
23
|
-
setExpandedLayers(newExpanded);
|
|
24
|
-
};
|
|
25
|
-
const sortedLayers = [...layers].sort((a, b) => a.order - b.order);
|
|
26
|
-
if (isCollapsed) {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
28
|
-
position: 'absolute',
|
|
29
|
-
top: '60px',
|
|
30
|
-
[position]: '20px',
|
|
31
|
-
backgroundColor: theme.colors.background,
|
|
32
|
-
borderRadius: '8px',
|
|
33
|
-
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
34
|
-
border: `1px solid ${theme.colors.border}`,
|
|
35
|
-
zIndex: 900,
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)("button", { onClick: () => setIsCollapsed(false), style: {
|
|
37
|
-
padding: '12px',
|
|
38
|
-
border: 'none',
|
|
39
|
-
background: 'none',
|
|
40
|
-
cursor: 'pointer',
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
justifyContent: 'center',
|
|
44
|
-
color: theme.colors.text,
|
|
45
|
-
}, title: "Expand Layers Panel", children: (0, iconResolver_1.resolveIcon)('Layers', 20) }) }));
|
|
46
|
-
}
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
48
|
-
position: 'absolute',
|
|
49
|
-
top: '60px',
|
|
50
|
-
[position]: '20px',
|
|
51
|
-
backgroundColor: theme.colors.background,
|
|
52
|
-
color: theme.colors.text,
|
|
53
|
-
borderRadius: '8px',
|
|
54
|
-
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
55
|
-
padding: '16px',
|
|
56
|
-
minWidth: '280px',
|
|
57
|
-
maxWidth: '320px',
|
|
58
|
-
maxHeight: 'calc(100vh - 120px)',
|
|
59
|
-
overflowY: 'auto',
|
|
60
|
-
zIndex: 900,
|
|
61
|
-
border: `1px solid ${theme.colors.border}`,
|
|
62
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
63
|
-
display: 'flex',
|
|
64
|
-
justifyContent: 'space-between',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
marginBottom: '16px',
|
|
67
|
-
paddingBottom: '12px',
|
|
68
|
-
borderBottom: `2px solid ${theme.colors.primary}`,
|
|
69
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
70
|
-
display: 'flex',
|
|
71
|
-
alignItems: 'center',
|
|
72
|
-
gap: '8px',
|
|
73
|
-
fontWeight: 'bold',
|
|
74
|
-
fontSize: '14px',
|
|
75
|
-
}, children: [(0, iconResolver_1.resolveIcon)('Layers', 18), (0, jsx_runtime_1.jsx)("span", { children: "Layers" })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setIsCollapsed(true), style: {
|
|
76
|
-
border: 'none',
|
|
77
|
-
background: 'none',
|
|
78
|
-
cursor: 'pointer',
|
|
79
|
-
fontSize: '16px',
|
|
80
|
-
color: theme.colors.textSecondary,
|
|
81
|
-
padding: '0',
|
|
82
|
-
width: '24px',
|
|
83
|
-
height: '24px',
|
|
84
|
-
display: 'flex',
|
|
85
|
-
alignItems: 'center',
|
|
86
|
-
justifyContent: 'center',
|
|
87
|
-
}, title: "Collapse Panel", children: "\u2039" })] }), showNarrativeMode && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
88
|
-
marginBottom: '16px',
|
|
89
|
-
padding: '10px',
|
|
90
|
-
backgroundColor: narrativeMode ? theme.colors.highlight : theme.colors.surface,
|
|
91
|
-
borderRadius: '6px',
|
|
92
|
-
border: narrativeMode
|
|
93
|
-
? `2px solid ${theme.colors.primary}`
|
|
94
|
-
: `1px solid ${theme.colors.border}`,
|
|
95
|
-
cursor: 'pointer',
|
|
96
|
-
transition: 'all 0.2s',
|
|
97
|
-
}, onClick: () => onToggleNarrativeMode?.(!narrativeMode), children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
98
|
-
display: 'flex',
|
|
99
|
-
alignItems: 'center',
|
|
100
|
-
justifyContent: 'space-between',
|
|
101
|
-
marginBottom: '6px',
|
|
102
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: '6px', fontSize: '12px' }, children: [(0, iconResolver_1.resolveIcon)('GitBranch', 14), (0, jsx_runtime_1.jsx)("span", { style: { fontWeight: '600' }, children: "Narrative Mode" })] }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
103
|
-
width: '40px',
|
|
104
|
-
height: '20px',
|
|
105
|
-
borderRadius: '10px',
|
|
106
|
-
backgroundColor: narrativeMode ? theme.colors.primary : theme.colors.border,
|
|
107
|
-
position: 'relative',
|
|
108
|
-
transition: 'background-color 0.2s',
|
|
109
|
-
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
110
|
-
position: 'absolute',
|
|
111
|
-
top: '2px',
|
|
112
|
-
left: narrativeMode ? '22px' : '2px',
|
|
113
|
-
width: '16px',
|
|
114
|
-
height: '16px',
|
|
115
|
-
borderRadius: '50%',
|
|
116
|
-
backgroundColor: theme.colors.background,
|
|
117
|
-
transition: 'left 0.2s',
|
|
118
|
-
} }) })] }), (0, jsx_runtime_1.jsx)("div", { style: { fontSize: '10px', color: theme.colors.textSecondary }, children: narrativeMode ? 'Show request flow through layers' : 'View all layers normally' })] })), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: sortedLayers.map((layer) => {
|
|
119
|
-
const isExpanded = expandedLayers.has(layer.id);
|
|
120
|
-
const isVisible = layer.visible ?? true;
|
|
121
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
122
|
-
backgroundColor: theme.colors.surface,
|
|
123
|
-
borderRadius: '6px',
|
|
124
|
-
border: `1px solid ${theme.colors.border}`,
|
|
125
|
-
overflow: 'hidden',
|
|
126
|
-
transition: 'all 0.2s',
|
|
127
|
-
}, onMouseEnter: (e) => {
|
|
128
|
-
e.currentTarget.style.borderColor = layer.color || theme.colors.primary;
|
|
129
|
-
}, onMouseLeave: (e) => {
|
|
130
|
-
e.currentTarget.style.borderColor = theme.colors.border;
|
|
131
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
132
|
-
padding: '10px 12px',
|
|
133
|
-
display: 'flex',
|
|
134
|
-
alignItems: 'center',
|
|
135
|
-
gap: '8px',
|
|
136
|
-
cursor: 'pointer',
|
|
137
|
-
borderLeft: `4px solid ${layer.color || theme.colors.primary}`,
|
|
138
|
-
}, onClick: () => onFocusLayer?.(layer.id), children: [(0, jsx_runtime_1.jsx)("button", { onClick: (e) => {
|
|
139
|
-
e.stopPropagation();
|
|
140
|
-
onToggleLayer?.(layer.id, !isVisible);
|
|
141
|
-
}, style: {
|
|
142
|
-
border: 'none',
|
|
143
|
-
background: 'none',
|
|
144
|
-
cursor: 'pointer',
|
|
145
|
-
padding: '2px',
|
|
146
|
-
display: 'flex',
|
|
147
|
-
alignItems: 'center',
|
|
148
|
-
color: isVisible ? theme.colors.text : theme.colors.textMuted,
|
|
149
|
-
opacity: isVisible ? 1 : 0.4,
|
|
150
|
-
}, title: isVisible ? 'Hide layer' : 'Show layer', children: (0, iconResolver_1.resolveIcon)(isVisible ? 'Eye' : 'EyeOff', 16) }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
151
|
-
fontSize: '12px',
|
|
152
|
-
fontWeight: '600',
|
|
153
|
-
color: theme.colors.text,
|
|
154
|
-
marginBottom: '2px',
|
|
155
|
-
overflow: 'hidden',
|
|
156
|
-
textOverflow: 'ellipsis',
|
|
157
|
-
whiteSpace: 'nowrap',
|
|
158
|
-
}, children: layer.label }), layer.nodeCount !== undefined && ((0, jsx_runtime_1.jsxs)("div", { style: { fontSize: '10px', color: theme.colors.textSecondary }, children: [layer.nodeCount, " ", layer.nodeCount === 1 ? 'node' : 'nodes'] }))] }), (layer.description || layer.narrative) && ((0, jsx_runtime_1.jsx)("button", { onClick: (e) => {
|
|
159
|
-
e.stopPropagation();
|
|
160
|
-
toggleLayerExpanded(layer.id);
|
|
161
|
-
}, style: {
|
|
162
|
-
border: 'none',
|
|
163
|
-
background: 'none',
|
|
164
|
-
cursor: 'pointer',
|
|
165
|
-
padding: '2px',
|
|
166
|
-
display: 'flex',
|
|
167
|
-
alignItems: 'center',
|
|
168
|
-
color: theme.colors.textSecondary,
|
|
169
|
-
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
170
|
-
transition: 'transform 0.2s',
|
|
171
|
-
}, children: (0, iconResolver_1.resolveIcon)('ChevronDown', 14) }))] }), isExpanded && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
172
|
-
padding: '12px',
|
|
173
|
-
paddingTop: '8px',
|
|
174
|
-
backgroundColor: theme.colors.background,
|
|
175
|
-
borderTop: `1px solid ${theme.colors.border}`,
|
|
176
|
-
}, children: [layer.description && ((0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: layer.narrative ? '10px' : '0' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
177
|
-
fontSize: '9px',
|
|
178
|
-
color: theme.colors.textMuted,
|
|
179
|
-
textTransform: 'uppercase',
|
|
180
|
-
marginBottom: '4px',
|
|
181
|
-
fontWeight: '600',
|
|
182
|
-
}, children: "Description" }), (0, jsx_runtime_1.jsx)("div", { style: { fontSize: '11px', color: theme.colors.textSecondary }, children: layer.description })] })), layer.narrative && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
183
|
-
fontSize: '9px',
|
|
184
|
-
color: theme.colors.textMuted,
|
|
185
|
-
textTransform: 'uppercase',
|
|
186
|
-
marginBottom: '4px',
|
|
187
|
-
fontWeight: '600',
|
|
188
|
-
}, children: "Narrative" }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
189
|
-
fontSize: '11px',
|
|
190
|
-
color: theme.colors.text,
|
|
191
|
-
fontStyle: 'italic',
|
|
192
|
-
padding: '8px',
|
|
193
|
-
backgroundColor: theme.colors.surface,
|
|
194
|
-
borderRadius: '4px',
|
|
195
|
-
borderLeft: `2px solid ${layer.color || theme.colors.primary}`,
|
|
196
|
-
}, children: layer.narrative })] }))] }))] }, layer.id));
|
|
197
|
-
}) }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
198
|
-
marginTop: '16px',
|
|
199
|
-
paddingTop: '12px',
|
|
200
|
-
borderTop: `1px solid ${theme.colors.border}`,
|
|
201
|
-
fontSize: '10px',
|
|
202
|
-
color: theme.colors.textMuted,
|
|
203
|
-
textAlign: 'center',
|
|
204
|
-
}, children: [sortedLayers.filter((l) => l.visible !== false).length, " of ", sortedLayers.length, " visible"] })] }));
|
|
205
|
-
};
|
|
206
|
-
exports.LayerPanel = LayerPanel;
|
|
207
|
-
//# sourceMappingURL=LayerPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayerPanel.js","sourceRoot":"","sources":["../../src/components/LayerPanel.tsx"],"names":[],"mappings":";;;;AAAA,iCAAwC;AACxC,kEAAyD;AACzD,wDAAoD;AA6BpD;;GAEG;AACI,MAAM,UAAU,GAA8B,CAAC,EACpD,MAAM,EACN,aAAa,EACb,YAAY,EACZ,iBAAiB,GAAG,KAAK,EACzB,aAAa,GAAG,KAAK,EACrB,qBAAqB,EACrB,QAAQ,GAAG,MAAM,GAClB,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,yBAAQ,GAAE,CAAC;IAC7B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,cAAc,EAAE,iBAAiB,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,YAAY,EAAE,KAAK;oDACnB,UAAU,EAAE,aAAa,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;iDAC/D,YAEA,KAAK,CAAC,SAAS,GACZ,IACF,CACP,IACG,CACP,KAxJI,KAAK,CAAC,EAAE,CAyJT,CACP,CAAC;gBACJ,CAAC,CAAC,GACE,EAGN,iCACE,KAAK,EAAE;oBACL,SAAS,EAAE,MAAM;oBACjB,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE,aAAa,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC7C,QAAQ,EAAE,MAAM;oBAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;oBAC7B,SAAS,EAAE,QAAQ;iBACpB,aAEA,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,MAAM,UAAM,YAAY,CAAC,MAAM,gBAC5E,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAzWW,QAAA,UAAU,cAyWrB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { GraphMetrics } from '@principal-ai/principal-view-core';
|
|
3
|
-
export interface MetricsDashboardProps {
|
|
4
|
-
/** Current metrics */
|
|
5
|
-
metrics: GraphMetrics;
|
|
6
|
-
/** Optional class name */
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Metrics dashboard component for displaying graph statistics
|
|
11
|
-
* TODO: Implement full metrics visualization
|
|
12
|
-
*/
|
|
13
|
-
export declare const MetricsDashboard: React.FC<MetricsDashboardProps>;
|
|
14
|
-
//# sourceMappingURL=MetricsDashboard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsDashboard.d.ts","sourceRoot":"","sources":["../../src/components/MetricsDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,WAAW,qBAAqB;IACpC,sBAAsB;IACtB,OAAO,EAAE,YAAY,CAAC;IAEtB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwB5D,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MetricsDashboard = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
* Metrics dashboard component for displaying graph statistics
|
|
7
|
-
* TODO: Implement full metrics visualization
|
|
8
|
-
*/
|
|
9
|
-
const MetricsDashboard = ({ metrics, className }) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: className, style: { padding: '20px', border: '1px solid #ccc' }, children: [(0, jsx_runtime_1.jsx)("h3", { children: "Metrics Dashboard (TODO)" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Total Nodes: ", metrics.nodes.total] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Total Edges: ", metrics.edges.total] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Total Events: ", metrics.events.total] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Violations: ", metrics.validation.violations] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Health Score: ", metrics.validation.healthScore] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "TODO:" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "Add visual charts/graphs" }), (0, jsx_runtime_1.jsx)("li", { children: "Show breakdown by node type" }), (0, jsx_runtime_1.jsx)("li", { children: "Show breakdown by edge type" }), (0, jsx_runtime_1.jsx)("li", { children: "Show event rate over time" }), (0, jsx_runtime_1.jsx)("li", { children: "Add health score indicator" }), (0, jsx_runtime_1.jsx)("li", { children: "Add performance metrics" })] })] })] }));
|
|
11
|
-
};
|
|
12
|
-
exports.MetricsDashboard = MetricsDashboard;
|
|
13
|
-
//# sourceMappingURL=MetricsDashboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsDashboard.js","sourceRoot":"","sources":["../../src/components/MetricsDashboard.tsx"],"names":[],"mappings":";;;;AAWA;;;GAGG;AACI,MAAM,gBAAgB,GAAoC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;IAC1F,OAAO,CACL,iCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAC7E,sEAAiC,EACjC,4CACE,2DAAiB,OAAO,CAAC,KAAK,CAAC,KAAK,IAAK,EACzC,2DAAiB,OAAO,CAAC,KAAK,CAAC,KAAK,IAAK,EACzC,4DAAkB,OAAO,CAAC,MAAM,CAAC,KAAK,IAAK,EAC3C,0DAAgB,OAAO,CAAC,UAAU,CAAC,UAAU,IAAK,EAClD,4DAAkB,OAAO,CAAC,UAAU,CAAC,WAAW,IAAK,IACjD,EACN,4CACE,uDAAsB,EACtB,2CACE,sEAAiC,EACjC,yEAAoC,EACpC,yEAAoC,EACpC,uEAAkC,EAClC,wEAAmC,EACnC,qEAAgC,IAC7B,IACD,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,gBAAgB,oBAwB3B"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { EventLog } from './EventLog';
|
|
4
|
-
import type { GraphEvent, Violation } from '@principal-ai/principal-view-core';
|
|
5
|
-
|
|
6
|
-
describe('EventLog', () => {
|
|
7
|
-
const testEvents: GraphEvent[] = [
|
|
8
|
-
{
|
|
9
|
-
id: 'evt-1',
|
|
10
|
-
type: 'node_created',
|
|
11
|
-
timestamp: Date.now(),
|
|
12
|
-
category: 'node',
|
|
13
|
-
operation: 'create',
|
|
14
|
-
payload: {
|
|
15
|
-
operation: 'create',
|
|
16
|
-
nodeId: 'user-1',
|
|
17
|
-
nodeType: 'user',
|
|
18
|
-
data: { userId: 'alice' },
|
|
19
|
-
},
|
|
20
|
-
expected: true,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'evt-2',
|
|
24
|
-
type: 'edge_created',
|
|
25
|
-
timestamp: Date.now(),
|
|
26
|
-
category: 'edge',
|
|
27
|
-
operation: 'create',
|
|
28
|
-
payload: {
|
|
29
|
-
operation: 'create',
|
|
30
|
-
edgeId: 'conn-1',
|
|
31
|
-
edgeType: 'connection',
|
|
32
|
-
from: 'user-1',
|
|
33
|
-
to: 'user-2',
|
|
34
|
-
},
|
|
35
|
-
expected: true,
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
const testViolations: Violation[] = [
|
|
40
|
-
{
|
|
41
|
-
id: 'violation-1',
|
|
42
|
-
severity: 'error',
|
|
43
|
-
type: 'connection',
|
|
44
|
-
description: 'Invalid connection',
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
it('should render without crashing', () => {
|
|
49
|
-
render(<EventLog events={testEvents} />);
|
|
50
|
-
|
|
51
|
-
expect(screen.getByText(/Event Log/i)).toBeDefined();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should display event count', () => {
|
|
55
|
-
render(<EventLog events={testEvents} />);
|
|
56
|
-
|
|
57
|
-
expect(screen.getByText(/Events: 2/i)).toBeDefined();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('should display violation count', () => {
|
|
61
|
-
render(<EventLog events={testEvents} violations={testViolations} />);
|
|
62
|
-
|
|
63
|
-
expect(screen.getByText(/Violations: 1/i)).toBeDefined();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should render with empty events', () => {
|
|
67
|
-
render(<EventLog events={[]} />);
|
|
68
|
-
|
|
69
|
-
expect(screen.getByText(/Events: 0/i)).toBeDefined();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should apply custom className', () => {
|
|
73
|
-
const { container } = render(<EventLog events={testEvents} className="custom-log" />);
|
|
74
|
-
|
|
75
|
-
const element = container.querySelector('.custom-log');
|
|
76
|
-
expect(element).toBeDefined();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should apply custom maxHeight', () => {
|
|
80
|
-
const { container } = render(<EventLog events={testEvents} maxHeight="300px" />);
|
|
81
|
-
|
|
82
|
-
const element = container.querySelector('div');
|
|
83
|
-
expect(element?.style.maxHeight).toBe('300px');
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { GraphEvent, Violation } from '@principal-ai/principal-view-core';
|
|
3
|
-
|
|
4
|
-
export interface EventLogProps {
|
|
5
|
-
/** List of events to display */
|
|
6
|
-
events: GraphEvent[];
|
|
7
|
-
|
|
8
|
-
/** Optional violations to highlight */
|
|
9
|
-
violations?: Violation[];
|
|
10
|
-
|
|
11
|
-
/** Callback when an event is clicked */
|
|
12
|
-
onEventClick?: (event: GraphEvent) => void;
|
|
13
|
-
|
|
14
|
-
/** Optional class name */
|
|
15
|
-
className?: string;
|
|
16
|
-
|
|
17
|
-
/** Optional max height */
|
|
18
|
-
maxHeight?: number | string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Event log component for displaying graph events
|
|
23
|
-
* TODO: Implement filtering, search, and severity indicators
|
|
24
|
-
*/
|
|
25
|
-
export const EventLog: React.FC<EventLogProps> = ({
|
|
26
|
-
events,
|
|
27
|
-
violations = [],
|
|
28
|
-
className,
|
|
29
|
-
maxHeight = '400px',
|
|
30
|
-
}) => {
|
|
31
|
-
return (
|
|
32
|
-
<div className={className} style={{ maxHeight, overflowY: 'auto', border: '1px solid #ccc' }}>
|
|
33
|
-
<div style={{ padding: '10px' }}>
|
|
34
|
-
<h3>Event Log (TODO)</h3>
|
|
35
|
-
<p>Events: {events.length}</p>
|
|
36
|
-
<p>Violations: {violations.length}</p>
|
|
37
|
-
<div>
|
|
38
|
-
<strong>TODO:</strong>
|
|
39
|
-
<ul>
|
|
40
|
-
<li>Display events in chronological order</li>
|
|
41
|
-
<li>Show event type, category, operation</li>
|
|
42
|
-
<li>Highlight violations with color coding</li>
|
|
43
|
-
<li>Add filtering by category, type, severity</li>
|
|
44
|
-
<li>Add text search</li>
|
|
45
|
-
<li>Add timestamp formatting</li>
|
|
46
|
-
</ul>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { GraphMetrics } from '@principal-ai/principal-view-core';
|
|
3
|
-
|
|
4
|
-
export interface MetricsDashboardProps {
|
|
5
|
-
/** Current metrics */
|
|
6
|
-
metrics: GraphMetrics;
|
|
7
|
-
|
|
8
|
-
/** Optional class name */
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Metrics dashboard component for displaying graph statistics
|
|
14
|
-
* TODO: Implement full metrics visualization
|
|
15
|
-
*/
|
|
16
|
-
export const MetricsDashboard: React.FC<MetricsDashboardProps> = ({ metrics, className }) => {
|
|
17
|
-
return (
|
|
18
|
-
<div className={className} style={{ padding: '20px', border: '1px solid #ccc' }}>
|
|
19
|
-
<h3>Metrics Dashboard (TODO)</h3>
|
|
20
|
-
<div>
|
|
21
|
-
<p>Total Nodes: {metrics.nodes.total}</p>
|
|
22
|
-
<p>Total Edges: {metrics.edges.total}</p>
|
|
23
|
-
<p>Total Events: {metrics.events.total}</p>
|
|
24
|
-
<p>Violations: {metrics.validation.violations}</p>
|
|
25
|
-
<p>Health Score: {metrics.validation.healthScore}</p>
|
|
26
|
-
</div>
|
|
27
|
-
<div>
|
|
28
|
-
<strong>TODO:</strong>
|
|
29
|
-
<ul>
|
|
30
|
-
<li>Add visual charts/graphs</li>
|
|
31
|
-
<li>Show breakdown by node type</li>
|
|
32
|
-
<li>Show breakdown by edge type</li>
|
|
33
|
-
<li>Show event rate over time</li>
|
|
34
|
-
<li>Add health score indicator</li>
|
|
35
|
-
<li>Add performance metrics</li>
|
|
36
|
-
</ul>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { EventLog } from '../components/EventLog';
|
|
3
|
-
import type { GraphEvent, Violation } from '@principal-ai/principal-view-core';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/EventLog',
|
|
7
|
-
component: EventLog,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
} satisfies Meta<typeof EventLog>;
|
|
13
|
-
|
|
14
|
-
export default meta;
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
|
|
17
|
-
// Sample events
|
|
18
|
-
const sampleEvents: GraphEvent[] = [
|
|
19
|
-
{
|
|
20
|
-
id: 'evt-1',
|
|
21
|
-
timestamp: Date.now() - 5000,
|
|
22
|
-
type: 'node_added',
|
|
23
|
-
category: 'node',
|
|
24
|
-
operation: 'create',
|
|
25
|
-
data: {
|
|
26
|
-
nodeId: 'node-1',
|
|
27
|
-
nodeType: 'process',
|
|
28
|
-
},
|
|
29
|
-
metadata: {},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: 'evt-2',
|
|
33
|
-
timestamp: Date.now() - 4000,
|
|
34
|
-
type: 'node_added',
|
|
35
|
-
category: 'node',
|
|
36
|
-
operation: 'create',
|
|
37
|
-
data: {
|
|
38
|
-
nodeId: 'node-2',
|
|
39
|
-
nodeType: 'data',
|
|
40
|
-
},
|
|
41
|
-
metadata: {},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: 'evt-3',
|
|
45
|
-
timestamp: Date.now() - 3000,
|
|
46
|
-
type: 'edge_added',
|
|
47
|
-
category: 'edge',
|
|
48
|
-
operation: 'create',
|
|
49
|
-
data: {
|
|
50
|
-
edgeId: 'edge-1',
|
|
51
|
-
source: 'node-1',
|
|
52
|
-
target: 'node-2',
|
|
53
|
-
},
|
|
54
|
-
metadata: {},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: 'evt-4',
|
|
58
|
-
timestamp: Date.now() - 2000,
|
|
59
|
-
type: 'node_updated',
|
|
60
|
-
category: 'node',
|
|
61
|
-
operation: 'update',
|
|
62
|
-
data: {
|
|
63
|
-
nodeId: 'node-1',
|
|
64
|
-
changes: { label: 'Updated Processor' },
|
|
65
|
-
},
|
|
66
|
-
metadata: {},
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'evt-5',
|
|
70
|
-
timestamp: Date.now() - 1000,
|
|
71
|
-
type: 'validation_run',
|
|
72
|
-
category: 'validation',
|
|
73
|
-
operation: 'read',
|
|
74
|
-
data: {
|
|
75
|
-
violations: 2,
|
|
76
|
-
warnings: 1,
|
|
77
|
-
},
|
|
78
|
-
metadata: {},
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
|
|
82
|
-
// Sample violations
|
|
83
|
-
const sampleViolations: Violation[] = [
|
|
84
|
-
{
|
|
85
|
-
id: 'viol-1',
|
|
86
|
-
type: 'connection',
|
|
87
|
-
severity: 'error',
|
|
88
|
-
message: 'Invalid connection between incompatible node types',
|
|
89
|
-
context: {
|
|
90
|
-
nodeId: 'node-1',
|
|
91
|
-
edgeId: 'edge-1',
|
|
92
|
-
},
|
|
93
|
-
ruleId: 'conn-rule-1',
|
|
94
|
-
timestamp: Date.now() - 1000,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 'viol-2',
|
|
98
|
-
type: 'structure',
|
|
99
|
-
severity: 'warning',
|
|
100
|
-
message: 'Node exceeds maximum connection limit',
|
|
101
|
-
context: {
|
|
102
|
-
nodeId: 'node-2',
|
|
103
|
-
},
|
|
104
|
-
ruleId: 'struct-rule-1',
|
|
105
|
-
timestamp: Date.now() - 500,
|
|
106
|
-
},
|
|
107
|
-
];
|
|
108
|
-
|
|
109
|
-
export const Default: Story = {
|
|
110
|
-
args: {
|
|
111
|
-
events: sampleEvents,
|
|
112
|
-
violations: sampleViolations,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const EventsOnly: Story = {
|
|
117
|
-
args: {
|
|
118
|
-
events: sampleEvents,
|
|
119
|
-
violations: [],
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const EmptyLog: Story = {
|
|
124
|
-
args: {
|
|
125
|
-
events: [],
|
|
126
|
-
violations: [],
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const ManyEvents: Story = {
|
|
131
|
-
args: {
|
|
132
|
-
events: [
|
|
133
|
-
...sampleEvents,
|
|
134
|
-
...Array.from({ length: 20 }, (_, i) => ({
|
|
135
|
-
id: `evt-gen-${i}`,
|
|
136
|
-
timestamp: Date.now() - i * 500,
|
|
137
|
-
type: 'node_updated',
|
|
138
|
-
category: 'node' as const,
|
|
139
|
-
operation: 'update' as const,
|
|
140
|
-
data: {
|
|
141
|
-
nodeId: `node-${i}`,
|
|
142
|
-
changes: {},
|
|
143
|
-
},
|
|
144
|
-
metadata: {},
|
|
145
|
-
})),
|
|
146
|
-
],
|
|
147
|
-
violations: sampleViolations,
|
|
148
|
-
maxHeight: '500px',
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export const WithClickHandler: Story = {
|
|
153
|
-
args: {
|
|
154
|
-
events: sampleEvents,
|
|
155
|
-
violations: sampleViolations,
|
|
156
|
-
onEventClick: (event) => {
|
|
157
|
-
console.log('Event clicked:', event);
|
|
158
|
-
alert(`Event clicked: ${event.type}`);
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
};
|