@principal-ai/principal-view-react 0.14.2 → 0.14.4
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/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +7 -4
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/nodes/CustomNode.d.ts +4 -0
- package/dist/nodes/CustomNode.d.ts.map +1 -1
- package/dist/nodes/CustomNode.js +30 -1
- package/dist/nodes/CustomNode.js.map +1 -1
- package/dist/nodes/otel/OtelBoundaryNode.d.ts +55 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.js +90 -0
- package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -0
- package/dist/nodes/otel/OtelEventNode.d.ts +59 -0
- package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelEventNode.js +90 -0
- package/dist/nodes/otel/OtelEventNode.js.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts +53 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.js +114 -0
- package/dist/nodes/otel/OtelResourceNode.js.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts +53 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.js +90 -0
- package/dist/nodes/otel/OtelScopeNode.js.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts +61 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js +143 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -0
- package/dist/nodes/otel/index.d.ts +17 -0
- package/dist/nodes/otel/index.d.ts.map +1 -0
- package/dist/nodes/otel/index.js +13 -0
- package/dist/nodes/otel/index.js.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.js +178 -0
- package/dist/nodes/otel/shared/NodeBadges.js.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.js +96 -0
- package/dist/nodes/otel/shared/NodeContent.js.map +1 -0
- package/dist/nodes/otel/shared/index.d.ts +8 -0
- package/dist/nodes/otel/shared/index.d.ts.map +1 -0
- package/dist/nodes/otel/shared/index.js +8 -0
- package/dist/nodes/otel/shared/index.js.map +1 -0
- package/dist/nodes/otel/shared/types.d.ts +129 -0
- package/dist/nodes/otel/shared/types.d.ts.map +1 -0
- package/dist/nodes/otel/shared/types.js +5 -0
- package/dist/nodes/otel/shared/types.js.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts +42 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js +61 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js.map +1 -0
- package/package.json +1 -1
- package/src/components/GraphRenderer.tsx +11 -5
- package/src/index.ts +17 -0
- package/src/nodes/CustomNode.tsx +40 -1
- package/src/nodes/otel/OtelBoundaryNode.tsx +234 -0
- package/src/nodes/otel/OtelEventNode.tsx +233 -0
- package/src/nodes/otel/OtelResourceNode.tsx +261 -0
- package/src/nodes/otel/OtelScopeNode.tsx +231 -0
- package/src/nodes/otel/OtelSpanConventionNode.tsx +309 -0
- package/src/nodes/otel/index.ts +23 -0
- package/src/nodes/otel/shared/NodeBadges.tsx +295 -0
- package/src/nodes/otel/shared/NodeContent.tsx +204 -0
- package/src/nodes/otel/shared/index.ts +8 -0
- package/src/nodes/otel/shared/types.ts +138 -0
- package/src/nodes/otel/shared/useNodeBehavior.ts +114 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTEL Boundary Node
|
|
3
|
+
*
|
|
4
|
+
* Renders boundary nodes as rounded rectangles with:
|
|
5
|
+
* - Direction identifier (inbound/outbound)
|
|
6
|
+
* - Direction badge (arrow indicating flow)
|
|
7
|
+
* - Status and references badges
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import type { NodeProps, Node } from '@xyflow/react';
|
|
11
|
+
import type { BoundaryData } from './shared/types';
|
|
12
|
+
export interface OtelBoundaryNodeData extends Record<string, unknown> {
|
|
13
|
+
name: string;
|
|
14
|
+
typeDefinition: {
|
|
15
|
+
color?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
states?: Record<string, {
|
|
18
|
+
color?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
state?: string;
|
|
24
|
+
hasViolations?: boolean;
|
|
25
|
+
data: {
|
|
26
|
+
color?: string;
|
|
27
|
+
scopeColor?: string;
|
|
28
|
+
spanColor?: string;
|
|
29
|
+
stroke?: string;
|
|
30
|
+
icon?: string;
|
|
31
|
+
status?: 'draft' | 'approved' | 'implemented';
|
|
32
|
+
description?: string;
|
|
33
|
+
sources?: string[];
|
|
34
|
+
references?: string[];
|
|
35
|
+
states?: Record<string, {
|
|
36
|
+
color?: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
icon?: string;
|
|
39
|
+
}>;
|
|
40
|
+
boundary?: BoundaryData;
|
|
41
|
+
otel?: {
|
|
42
|
+
files?: string[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
editable?: boolean;
|
|
46
|
+
tooltipsEnabled?: boolean;
|
|
47
|
+
shiftKeyPressed?: boolean;
|
|
48
|
+
isHighlighted?: boolean;
|
|
49
|
+
isActive?: boolean;
|
|
50
|
+
isHidden?: boolean;
|
|
51
|
+
animationType?: 'pulse' | 'flash' | 'shake' | 'entry' | null;
|
|
52
|
+
animationDuration?: number;
|
|
53
|
+
}
|
|
54
|
+
export declare const OtelBoundaryNode: React.FC<NodeProps<Node<OtelBoundaryNodeData>>>;
|
|
55
|
+
//# sourceMappingURL=OtelBoundaryNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelBoundaryNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/otel/OtelBoundaryNode.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAcnD,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC5E,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;QAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC3E,QAAQ,CAAC,EAAE,YAAY,CAAC;QACxB,IAAI,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;KAC7B,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IAC7D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAwK5E,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Handle, Position, NodeResizer } from '@xyflow/react';
|
|
3
|
+
import { useTheme } from '@principal-ade/industry-theme';
|
|
4
|
+
import { NodeTooltip } from '../../components/NodeTooltip';
|
|
5
|
+
import { NodeBadges } from './shared/NodeBadges';
|
|
6
|
+
import { NodeContent } from './shared/NodeContent';
|
|
7
|
+
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
8
|
+
function hexToLightColor(hexColor, lightness = 0.88) {
|
|
9
|
+
const hex = hexColor.replace('#', '');
|
|
10
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
11
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
12
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
13
|
+
const newR = Math.round(r + (255 - r) * lightness);
|
|
14
|
+
const newG = Math.round(g + (255 - g) * lightness);
|
|
15
|
+
const newB = Math.round(b + (255 - b) * lightness);
|
|
16
|
+
const toHex = (n) => n.toString(16).padStart(2, '0');
|
|
17
|
+
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
18
|
+
}
|
|
19
|
+
export const OtelBoundaryNode = ({ data, selected, dragging, }) => {
|
|
20
|
+
const { theme } = useTheme();
|
|
21
|
+
const nodeProps = data;
|
|
22
|
+
const { typeDefinition, state, hasViolations, data: nodeData, editable = false, tooltipsEnabled = true, shiftKeyPressed = false, isHighlighted = false, isActive = true, isHidden = false, animationType, animationDuration = 1000, } = nodeProps;
|
|
23
|
+
const { nodeRef, showTooltip, handleMouseDown, handleMouseEnter, handleMouseLeave, handleResizeEnd, } = useNodeBehavior({ editable, tooltipsEnabled, shiftKeyPressed, selected, dragging });
|
|
24
|
+
const nodeOpacity = isHidden ? 0.4 : isActive ? 1 : 0.1;
|
|
25
|
+
// Color resolution
|
|
26
|
+
const spanColor = nodeData.spanColor;
|
|
27
|
+
const nodeDataColor = nodeData.color;
|
|
28
|
+
const baseFillColor = spanColor || nodeDataColor || typeDefinition.color || '#06b6d4';
|
|
29
|
+
const fillColor = baseFillColor;
|
|
30
|
+
const scopeColor = nodeData.scopeColor;
|
|
31
|
+
const nodeDataStroke = nodeData.stroke;
|
|
32
|
+
const strokeColor = nodeDataStroke || scopeColor || fillColor;
|
|
33
|
+
// Display info
|
|
34
|
+
const displayName = nodeProps.name;
|
|
35
|
+
const boundaryData = nodeData.boundary;
|
|
36
|
+
const identifier = boundaryData?.direction;
|
|
37
|
+
// Badge data
|
|
38
|
+
const status = nodeData.status;
|
|
39
|
+
const sourceFiles = nodeData.otel?.files || nodeData.sources;
|
|
40
|
+
const references = nodeData.references;
|
|
41
|
+
const description = nodeData.description;
|
|
42
|
+
// Icon
|
|
43
|
+
const icon = nodeData.icon ||
|
|
44
|
+
(state && nodeData.states?.[state]?.icon) ||
|
|
45
|
+
typeDefinition.icon;
|
|
46
|
+
const stateDefinitions = nodeData.states || typeDefinition.states;
|
|
47
|
+
const getAnimationClass = () => {
|
|
48
|
+
switch (animationType) {
|
|
49
|
+
case 'pulse': return 'node-pulse';
|
|
50
|
+
case 'flash': return 'node-flash';
|
|
51
|
+
case 'shake': return 'node-shake';
|
|
52
|
+
case 'entry': return 'node-entry';
|
|
53
|
+
default: return '';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const borderStyle = status === 'draft' ? 'dotted' : status === 'approved' ? 'dashed' : 'solid';
|
|
57
|
+
const boundaryStyle = {
|
|
58
|
+
padding: '12px 16px',
|
|
59
|
+
backgroundColor: hexToLightColor(fillColor),
|
|
60
|
+
color: '#000',
|
|
61
|
+
border: `2px ${borderStyle} ${hasViolations ? '#D0021B' : strokeColor}`,
|
|
62
|
+
fontSize: theme.fontSizes[0],
|
|
63
|
+
fontWeight: theme.fontWeights.medium,
|
|
64
|
+
fontFamily: theme.fonts.body,
|
|
65
|
+
width: '100%',
|
|
66
|
+
height: '100%',
|
|
67
|
+
minWidth: 20,
|
|
68
|
+
minHeight: 20,
|
|
69
|
+
display: 'flex',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
gap: '4px',
|
|
74
|
+
boxShadow: isHighlighted
|
|
75
|
+
? '0 0 0 3px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.5)'
|
|
76
|
+
: selected
|
|
77
|
+
? `0 0 0 2px ${strokeColor}`
|
|
78
|
+
: '0 2px 4px rgba(0,0,0,0.1)',
|
|
79
|
+
opacity: nodeOpacity,
|
|
80
|
+
transition: 'box-shadow 0.2s ease, opacity 0.3s ease',
|
|
81
|
+
animationDuration: animationType ? `${animationDuration}ms` : undefined,
|
|
82
|
+
boxSizing: 'border-box',
|
|
83
|
+
borderRadius: '8px', // Rounded corners for boundary nodes
|
|
84
|
+
};
|
|
85
|
+
const handleStyle = editable
|
|
86
|
+
? { background: fillColor, width: 12, height: 12, border: '2px solid white', boxShadow: '0 0 0 1px ' + fillColor }
|
|
87
|
+
: { background: fillColor, width: 8, height: 8, opacity: 0, pointerEvents: 'none' };
|
|
88
|
+
return (_jsxs(_Fragment, { children: [editable && (_jsx(NodeResizer, { color: strokeColor, isVisible: selected, minWidth: 40, minHeight: 30, onResizeEnd: handleResizeEnd, handleStyle: { width: 8, height: 8, borderRadius: 2, zIndex: 20 }, lineStyle: { borderWidth: 1, zIndex: 20 } })), _jsx(Handle, { type: "target", position: Position.Top, id: "top", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Bottom, id: "bottom", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Left, id: "left", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Right, id: "right", style: handleStyle }), _jsxs("div", { ref: nodeRef, style: { position: 'relative', width: '100%', height: '100%' }, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsx(NodeBadges, { shape: "rectangle", status: status, sourceFiles: sourceFiles, references: references, boundary: boundaryData, opacity: nodeOpacity }), _jsx("div", { style: boundaryStyle, className: getAnimationClass(), children: _jsx(NodeContent, { displayName: displayName, identifier: identifier, icon: icon, state: state, stateDefinitions: stateDefinitions, hasViolations: hasViolations }) }), tooltipsEnabled && (_jsx(NodeTooltip, { description: description, otel: nodeData.otel, sources: nodeData.sources, references: references, visible: showTooltip, nodeRef: nodeRef }))] }), _jsx(Handle, { type: "source", position: Position.Top, id: "top-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Bottom, id: "bottom-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Left, id: "left-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Right, id: "right-out", style: handleStyle })] }));
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=OtelBoundaryNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelBoundaryNode.js","sourceRoot":"","sources":["../../../src/nodes/otel/OtelBoundaryNode.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,SAAS,eAAe,CAAC,QAAgB,EAAE,SAAS,GAAG,IAAI;IACzD,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACnD,MAAM,IAAI,GAA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AAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,GAAI,EACnF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,WAAW,GAAI,IACpF,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTEL Event Node
|
|
3
|
+
*
|
|
4
|
+
* Renders event nodes as rectangles with:
|
|
5
|
+
* - Event name identifier
|
|
6
|
+
* - Event attributes schema
|
|
7
|
+
* - Status, sources, and references badges
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import type { NodeProps, Node } from '@xyflow/react';
|
|
11
|
+
export interface OtelEventNodeData extends Record<string, unknown> {
|
|
12
|
+
name: string;
|
|
13
|
+
typeDefinition: {
|
|
14
|
+
color?: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
states?: Record<string, {
|
|
17
|
+
color?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
icon?: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
state?: string;
|
|
23
|
+
hasViolations?: boolean;
|
|
24
|
+
data: {
|
|
25
|
+
color?: string;
|
|
26
|
+
scopeColor?: string;
|
|
27
|
+
spanColor?: string;
|
|
28
|
+
stroke?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
status?: 'draft' | 'approved' | 'implemented';
|
|
31
|
+
description?: string;
|
|
32
|
+
sources?: string[];
|
|
33
|
+
references?: string[];
|
|
34
|
+
states?: Record<string, {
|
|
35
|
+
color?: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
icon?: string;
|
|
38
|
+
}>;
|
|
39
|
+
event?: {
|
|
40
|
+
name?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
attributes?: Record<string, unknown>;
|
|
43
|
+
};
|
|
44
|
+
eventRef?: string;
|
|
45
|
+
otel?: {
|
|
46
|
+
files?: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
editable?: boolean;
|
|
50
|
+
tooltipsEnabled?: boolean;
|
|
51
|
+
shiftKeyPressed?: boolean;
|
|
52
|
+
isHighlighted?: boolean;
|
|
53
|
+
isActive?: boolean;
|
|
54
|
+
isHidden?: boolean;
|
|
55
|
+
animationType?: 'pulse' | 'flash' | 'shake' | 'entry' | null;
|
|
56
|
+
animationDuration?: number;
|
|
57
|
+
}
|
|
58
|
+
export declare const OtelEventNode: React.FC<NodeProps<Node<OtelEventNodeData>>>;
|
|
59
|
+
//# sourceMappingURL=OtelEventNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelEventNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/otel/OtelEventNode.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAoBrD,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC5E,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MA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tE,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Handle, Position, NodeResizer } from '@xyflow/react';
|
|
3
|
+
import { useTheme } from '@principal-ade/industry-theme';
|
|
4
|
+
import { NodeTooltip } from '../../components/NodeTooltip';
|
|
5
|
+
import { NodeBadges } from './shared/NodeBadges';
|
|
6
|
+
import { NodeContent } from './shared/NodeContent';
|
|
7
|
+
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
8
|
+
function hexToLightColor(hexColor, lightness = 0.88) {
|
|
9
|
+
const hex = hexColor.replace('#', '');
|
|
10
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
11
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
12
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
13
|
+
const newR = Math.round(r + (255 - r) * lightness);
|
|
14
|
+
const newG = Math.round(g + (255 - g) * lightness);
|
|
15
|
+
const newB = Math.round(b + (255 - b) * lightness);
|
|
16
|
+
const toHex = (n) => n.toString(16).padStart(2, '0');
|
|
17
|
+
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
18
|
+
}
|
|
19
|
+
export const OtelEventNode = ({ data, selected, dragging, }) => {
|
|
20
|
+
const { theme } = useTheme();
|
|
21
|
+
const nodeProps = data;
|
|
22
|
+
const { typeDefinition, state, hasViolations, data: nodeData, editable = false, tooltipsEnabled = true, shiftKeyPressed = false, isHighlighted = false, isActive = true, isHidden = false, animationType, animationDuration = 1000, } = nodeProps;
|
|
23
|
+
const { nodeRef, showTooltip, handleMouseDown, handleMouseEnter, handleMouseLeave, handleResizeEnd, } = useNodeBehavior({ editable, tooltipsEnabled, shiftKeyPressed, selected, dragging });
|
|
24
|
+
const nodeOpacity = isHidden ? 0.4 : isActive ? 1 : 0.1;
|
|
25
|
+
// Color resolution
|
|
26
|
+
const spanColor = nodeData.spanColor;
|
|
27
|
+
const nodeDataColor = nodeData.color;
|
|
28
|
+
const baseFillColor = spanColor || nodeDataColor || typeDefinition.color || '#3b82f6';
|
|
29
|
+
const fillColor = baseFillColor;
|
|
30
|
+
const scopeColor = nodeData.scopeColor;
|
|
31
|
+
const nodeDataStroke = nodeData.stroke;
|
|
32
|
+
const strokeColor = nodeDataStroke || scopeColor || fillColor;
|
|
33
|
+
// Display info
|
|
34
|
+
const displayName = nodeProps.name;
|
|
35
|
+
const eventData = nodeData.event;
|
|
36
|
+
const identifier = eventData?.name || nodeData.eventRef;
|
|
37
|
+
// Badge data
|
|
38
|
+
const status = nodeData.status;
|
|
39
|
+
const sourceFiles = nodeData.otel?.files || nodeData.sources;
|
|
40
|
+
const references = nodeData.references;
|
|
41
|
+
const description = nodeData.description;
|
|
42
|
+
// Icon
|
|
43
|
+
const icon = nodeData.icon ||
|
|
44
|
+
(state && nodeData.states?.[state]?.icon) ||
|
|
45
|
+
typeDefinition.icon;
|
|
46
|
+
const stateDefinitions = nodeData.states || typeDefinition.states;
|
|
47
|
+
const getAnimationClass = () => {
|
|
48
|
+
switch (animationType) {
|
|
49
|
+
case 'pulse': return 'node-pulse';
|
|
50
|
+
case 'flash': return 'node-flash';
|
|
51
|
+
case 'shake': return 'node-shake';
|
|
52
|
+
case 'entry': return 'node-entry';
|
|
53
|
+
default: return '';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const borderStyle = status === 'draft' ? 'dotted' : status === 'approved' ? 'dashed' : 'solid';
|
|
57
|
+
const rectangleStyle = {
|
|
58
|
+
padding: '12px 16px',
|
|
59
|
+
backgroundColor: hexToLightColor(fillColor),
|
|
60
|
+
color: '#000',
|
|
61
|
+
border: `2px ${borderStyle} ${hasViolations ? '#D0021B' : strokeColor}`,
|
|
62
|
+
fontSize: theme.fontSizes[0],
|
|
63
|
+
fontWeight: theme.fontWeights.medium,
|
|
64
|
+
fontFamily: theme.fonts.body,
|
|
65
|
+
width: '100%',
|
|
66
|
+
height: '100%',
|
|
67
|
+
minWidth: 20,
|
|
68
|
+
minHeight: 20,
|
|
69
|
+
display: 'flex',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
gap: '4px',
|
|
74
|
+
boxShadow: isHighlighted
|
|
75
|
+
? '0 0 0 3px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.5)'
|
|
76
|
+
: selected
|
|
77
|
+
? `0 0 0 2px ${strokeColor}`
|
|
78
|
+
: '0 2px 4px rgba(0,0,0,0.1)',
|
|
79
|
+
opacity: nodeOpacity,
|
|
80
|
+
transition: 'box-shadow 0.2s ease, opacity 0.3s ease',
|
|
81
|
+
animationDuration: animationType ? `${animationDuration}ms` : undefined,
|
|
82
|
+
boxSizing: 'border-box',
|
|
83
|
+
borderRadius: 0,
|
|
84
|
+
};
|
|
85
|
+
const handleStyle = editable
|
|
86
|
+
? { background: fillColor, width: 12, height: 12, border: '2px solid white', boxShadow: '0 0 0 1px ' + fillColor }
|
|
87
|
+
: { background: fillColor, width: 8, height: 8, opacity: 0, pointerEvents: 'none' };
|
|
88
|
+
return (_jsxs(_Fragment, { children: [editable && (_jsx(NodeResizer, { color: strokeColor, isVisible: selected, minWidth: 40, minHeight: 30, onResizeEnd: handleResizeEnd, handleStyle: { width: 8, height: 8, borderRadius: 2, zIndex: 20 }, lineStyle: { borderWidth: 1, zIndex: 20 } })), _jsx(Handle, { type: "target", position: Position.Top, id: "top", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Bottom, id: "bottom", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Left, id: "left", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Right, id: "right", style: handleStyle }), _jsxs("div", { ref: nodeRef, style: { position: 'relative', width: '100%', height: '100%' }, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsx(NodeBadges, { shape: "rectangle", status: status, sourceFiles: sourceFiles, references: references, opacity: nodeOpacity }), _jsx("div", { style: rectangleStyle, className: getAnimationClass(), children: _jsx(NodeContent, { displayName: displayName, identifier: identifier, icon: icon, state: state, stateDefinitions: stateDefinitions, hasViolations: hasViolations }) }), tooltipsEnabled && (_jsx(NodeTooltip, { description: description, otel: nodeData.otel, sources: nodeData.sources, references: references, visible: showTooltip, nodeRef: nodeRef }))] }), _jsx(Handle, { type: "source", position: Position.Top, id: "top-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Bottom, id: "bottom-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Left, id: "left-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Right, id: "right-out", style: handleStyle })] }));
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=OtelEventNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelEventNode.js","sourceRoot":"","sources":["../../../src/nodes/otel/OtelEventNode.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,SAAS,eAAe,CAAC,QAAgB,EAAE,SAAS,GAAG,IAAI;IACzD,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC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M,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAC,SAAS,EAAC,KAAK,EAAE,WAAW,GAAI,EACjF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,WAAW,GAAI,EACvF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,GAAI,EACnF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,WAAW,GAAI,IACpF,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTEL Resource Node
|
|
3
|
+
*
|
|
4
|
+
* Renders resource nodes as diamonds with:
|
|
5
|
+
* - Resource match identifier (key: value)
|
|
6
|
+
* - Status, sources, and references badges
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { NodeProps, Node } from '@xyflow/react';
|
|
10
|
+
export interface OtelResourceNodeData extends Record<string, unknown> {
|
|
11
|
+
name: string;
|
|
12
|
+
typeDefinition: {
|
|
13
|
+
color?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
states?: Record<string, {
|
|
16
|
+
color?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
icon?: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
state?: string;
|
|
22
|
+
hasViolations?: boolean;
|
|
23
|
+
data: {
|
|
24
|
+
color?: string;
|
|
25
|
+
scopeColor?: string;
|
|
26
|
+
spanColor?: string;
|
|
27
|
+
stroke?: string;
|
|
28
|
+
icon?: string;
|
|
29
|
+
status?: 'draft' | 'approved' | 'implemented';
|
|
30
|
+
description?: string;
|
|
31
|
+
sources?: string[];
|
|
32
|
+
references?: string[];
|
|
33
|
+
states?: Record<string, {
|
|
34
|
+
color?: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
icon?: string;
|
|
37
|
+
}>;
|
|
38
|
+
otel?: {
|
|
39
|
+
resourceMatch?: Record<string, string | string[]>;
|
|
40
|
+
files?: string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
editable?: boolean;
|
|
44
|
+
tooltipsEnabled?: boolean;
|
|
45
|
+
shiftKeyPressed?: boolean;
|
|
46
|
+
isHighlighted?: boolean;
|
|
47
|
+
isActive?: boolean;
|
|
48
|
+
isHidden?: boolean;
|
|
49
|
+
animationType?: 'pulse' | 'flash' | 'shake' | 'entry' | null;
|
|
50
|
+
animationDuration?: number;
|
|
51
|
+
}
|
|
52
|
+
export declare const OtelResourceNode: React.FC<NodeProps<Node<OtelResourceNodeData>>>;
|
|
53
|
+
//# sourceMappingURL=OtelResourceNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelResourceNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/otel/OtelResourceNode.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAoBrD,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,E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,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAmM5E,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Handle, Position, NodeResizer } from '@xyflow/react';
|
|
3
|
+
import { useTheme } from '@principal-ade/industry-theme';
|
|
4
|
+
import { NodeTooltip } from '../../components/NodeTooltip';
|
|
5
|
+
import { NodeBadges } from './shared/NodeBadges';
|
|
6
|
+
import { NodeContent } from './shared/NodeContent';
|
|
7
|
+
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
8
|
+
function hexToLightColor(hexColor, lightness = 0.88) {
|
|
9
|
+
const hex = hexColor.replace('#', '');
|
|
10
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
11
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
12
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
13
|
+
const newR = Math.round(r + (255 - r) * lightness);
|
|
14
|
+
const newG = Math.round(g + (255 - g) * lightness);
|
|
15
|
+
const newB = Math.round(b + (255 - b) * lightness);
|
|
16
|
+
const toHex = (n) => n.toString(16).padStart(2, '0');
|
|
17
|
+
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
18
|
+
}
|
|
19
|
+
export const OtelResourceNode = ({ data, selected, dragging, }) => {
|
|
20
|
+
const { theme } = useTheme();
|
|
21
|
+
const nodeProps = data;
|
|
22
|
+
const { typeDefinition, state, hasViolations, data: nodeData, editable = false, tooltipsEnabled = true, shiftKeyPressed = false, isHighlighted = false, isActive = true, isHidden = false, animationType, animationDuration: _animationDuration = 1000, } = nodeProps;
|
|
23
|
+
const { nodeRef, showTooltip, handleMouseDown, handleMouseEnter, handleMouseLeave, handleResizeEnd, } = useNodeBehavior({ editable, tooltipsEnabled, shiftKeyPressed, selected, dragging });
|
|
24
|
+
const nodeOpacity = isHidden ? 0.4 : isActive ? 1 : 0.1;
|
|
25
|
+
// Color resolution
|
|
26
|
+
const spanColor = nodeData.spanColor;
|
|
27
|
+
const nodeDataColor = nodeData.color;
|
|
28
|
+
const baseFillColor = spanColor || nodeDataColor || typeDefinition.color || '#f97316';
|
|
29
|
+
const fillColor = baseFillColor;
|
|
30
|
+
const scopeColor = nodeData.scopeColor;
|
|
31
|
+
const nodeDataStroke = nodeData.stroke;
|
|
32
|
+
const strokeColor = nodeDataStroke || scopeColor || fillColor;
|
|
33
|
+
// Display info
|
|
34
|
+
const displayName = nodeProps.name;
|
|
35
|
+
const otelData = nodeData.otel;
|
|
36
|
+
// Get identifier from resourceMatch
|
|
37
|
+
let identifier;
|
|
38
|
+
if (otelData?.resourceMatch) {
|
|
39
|
+
const entries = Object.entries(otelData.resourceMatch);
|
|
40
|
+
if (entries.length > 0) {
|
|
41
|
+
const [key, value] = entries[0];
|
|
42
|
+
identifier = `${key}: ${Array.isArray(value) ? value[0] : value}`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Badge data
|
|
46
|
+
const status = nodeData.status;
|
|
47
|
+
const sourceFiles = otelData?.files || nodeData.sources;
|
|
48
|
+
const references = nodeData.references;
|
|
49
|
+
const description = nodeData.description;
|
|
50
|
+
// Icon
|
|
51
|
+
const icon = nodeData.icon ||
|
|
52
|
+
(state && nodeData.states?.[state]?.icon) ||
|
|
53
|
+
typeDefinition.icon;
|
|
54
|
+
const stateDefinitions = nodeData.states || typeDefinition.states;
|
|
55
|
+
const getAnimationClass = () => {
|
|
56
|
+
switch (animationType) {
|
|
57
|
+
case 'pulse': return 'node-pulse';
|
|
58
|
+
case 'flash': return 'node-flash';
|
|
59
|
+
case 'shake': return 'node-shake';
|
|
60
|
+
case 'entry': return 'node-entry';
|
|
61
|
+
default: return '';
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
// Diamond styles
|
|
65
|
+
const diamondClipPath = 'polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)';
|
|
66
|
+
const diamondBorderWidth = 2;
|
|
67
|
+
const diamondBorderStyle = {
|
|
68
|
+
position: 'relative',
|
|
69
|
+
clipPath: diamondClipPath,
|
|
70
|
+
backgroundColor: hasViolations ? '#D0021B' : strokeColor,
|
|
71
|
+
width: '100%',
|
|
72
|
+
height: '100%',
|
|
73
|
+
minWidth: 20,
|
|
74
|
+
minHeight: 20,
|
|
75
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
76
|
+
opacity: nodeOpacity,
|
|
77
|
+
transition: 'opacity 0.3s ease',
|
|
78
|
+
boxSizing: 'border-box',
|
|
79
|
+
};
|
|
80
|
+
const diamondInnerStyle = {
|
|
81
|
+
position: 'absolute',
|
|
82
|
+
top: diamondBorderWidth,
|
|
83
|
+
left: diamondBorderWidth,
|
|
84
|
+
right: diamondBorderWidth,
|
|
85
|
+
bottom: diamondBorderWidth,
|
|
86
|
+
clipPath: diamondClipPath,
|
|
87
|
+
backgroundColor: hexToLightColor(fillColor),
|
|
88
|
+
color: '#000',
|
|
89
|
+
display: 'flex',
|
|
90
|
+
flexDirection: 'column',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
fontSize: theme.fontSizes[0],
|
|
94
|
+
fontWeight: theme.fontWeights.medium,
|
|
95
|
+
fontFamily: theme.fonts.body,
|
|
96
|
+
gap: '4px',
|
|
97
|
+
padding: '8px 16px',
|
|
98
|
+
};
|
|
99
|
+
const handleStyle = editable
|
|
100
|
+
? { background: fillColor, width: 12, height: 12, border: '2px solid white', boxShadow: '0 0 0 1px ' + fillColor, zIndex: 10 }
|
|
101
|
+
: { background: fillColor, width: 8, height: 8, opacity: 0, pointerEvents: 'none', zIndex: 10 };
|
|
102
|
+
return (_jsxs(_Fragment, { children: [editable && (_jsx(NodeResizer, { color: strokeColor, isVisible: selected, minWidth: 40, minHeight: 30, onResizeEnd: handleResizeEnd, handleStyle: { width: 8, height: 8, borderRadius: 2, zIndex: 20 }, lineStyle: { borderWidth: 1, zIndex: 20 } })), _jsx(Handle, { type: "target", position: Position.Top, id: "top", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Bottom, id: "bottom", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Left, id: "left", style: handleStyle }), _jsx(Handle, { type: "target", position: Position.Right, id: "right", style: handleStyle }), _jsxs("div", { ref: nodeRef, style: {
|
|
103
|
+
position: 'relative',
|
|
104
|
+
width: '100%',
|
|
105
|
+
height: '100%',
|
|
106
|
+
boxShadow: isHighlighted
|
|
107
|
+
? '0 0 0 3px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.5)'
|
|
108
|
+
: selected
|
|
109
|
+
? `0 0 0 2px ${strokeColor}`
|
|
110
|
+
: 'none',
|
|
111
|
+
transition: 'box-shadow 0.2s ease',
|
|
112
|
+
}, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsx(NodeBadges, { shape: "diamond", status: status, sourceFiles: sourceFiles, references: references, opacity: nodeOpacity }), _jsx("div", { style: diamondBorderStyle, className: getAnimationClass(), children: _jsx("div", { style: diamondInnerStyle, children: _jsx(NodeContent, { displayName: displayName, identifier: identifier, icon: icon, state: state, stateDefinitions: stateDefinitions, hasViolations: hasViolations }) }) }), tooltipsEnabled && (_jsx(NodeTooltip, { description: description, otel: nodeData.otel, sources: nodeData.sources, references: references, visible: showTooltip, nodeRef: nodeRef }))] }), _jsx(Handle, { type: "source", position: Position.Top, id: "top-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Bottom, id: "bottom-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Left, id: "left-out", style: handleStyle }), _jsx(Handle, { type: "source", position: Position.Right, id: "right-out", style: handleStyle })] }));
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=OtelResourceNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelResourceNode.js","sourceRoot":"","sources":["../../../src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IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAC,SAAS,EAAC,KAAK,EAAE,WAAW,GAAI,EACjF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,WAAW,GAAI,EACvF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,GAAI,EACnF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,WAAW,GAAI,IACpF,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTEL Scope Node
|
|
3
|
+
*
|
|
4
|
+
* Renders scope nodes as circles with:
|
|
5
|
+
* - Scope name identifier
|
|
6
|
+
* - Status, sources, and references badges
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { NodeProps, Node } from '@xyflow/react';
|
|
10
|
+
export interface OtelScopeNodeData extends Record<string, unknown> {
|
|
11
|
+
name: string;
|
|
12
|
+
typeDefinition: {
|
|
13
|
+
color?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
states?: Record<string, {
|
|
16
|
+
color?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
icon?: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
state?: string;
|
|
22
|
+
hasViolations?: boolean;
|
|
23
|
+
data: {
|
|
24
|
+
color?: string;
|
|
25
|
+
scopeColor?: string;
|
|
26
|
+
spanColor?: string;
|
|
27
|
+
stroke?: string;
|
|
28
|
+
icon?: string;
|
|
29
|
+
status?: 'draft' | 'approved' | 'implemented';
|
|
30
|
+
description?: string;
|
|
31
|
+
sources?: string[];
|
|
32
|
+
references?: string[];
|
|
33
|
+
states?: Record<string, {
|
|
34
|
+
color?: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
icon?: string;
|
|
37
|
+
}>;
|
|
38
|
+
otel?: {
|
|
39
|
+
scope?: string;
|
|
40
|
+
files?: string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
editable?: boolean;
|
|
44
|
+
tooltipsEnabled?: boolean;
|
|
45
|
+
shiftKeyPressed?: boolean;
|
|
46
|
+
isHighlighted?: boolean;
|
|
47
|
+
isActive?: boolean;
|
|
48
|
+
isHidden?: boolean;
|
|
49
|
+
animationType?: 'pulse' | 'flash' | 'shake' | 'entry' | null;
|
|
50
|
+
animationDuration?: number;
|
|
51
|
+
}
|
|
52
|
+
export declare const OtelScopeNode: React.FC<NodeProps<Node<OtelScopeNodeData>>>;
|
|
53
|
+
//# sourceMappingURL=OtelScopeNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtelScopeNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/otel/OtelScopeNode.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAoBrD,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC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