@principal-ai/principal-view-react 0.14.36 → 0.14.38
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/nodes/CustomNode.d.ts.map +1 -1
- package/dist/nodes/CustomNode.js +3 -25
- package/dist/nodes/CustomNode.js.map +1 -1
- package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -1
- package/dist/nodes/otel/OtelBoundaryNode.js +1 -12
- package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -1
- package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -1
- package/dist/nodes/otel/OtelEventNode.js +1 -12
- package/dist/nodes/otel/OtelEventNode.js.map +1 -1
- package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -1
- package/dist/nodes/otel/OtelResourceNode.js +1 -12
- package/dist/nodes/otel/OtelResourceNode.js.map +1 -1
- package/dist/nodes/otel/OtelScopeNode.d.ts +1 -1
- package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -1
- package/dist/nodes/otel/OtelScopeNode.js +3 -14
- package/dist/nodes/otel/OtelScopeNode.js.map +1 -1
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -1
- package/dist/nodes/otel/OtelSpanConventionNode.js +1 -15
- package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -1
- package/package.json +3 -3
- package/src/nodes/CustomNode.tsx +0 -26
- package/src/nodes/otel/OtelBoundaryNode.tsx +1 -13
- package/src/nodes/otel/OtelEventNode.tsx +0 -12
- package/src/nodes/otel/OtelResourceNode.tsx +1 -13
- package/src/nodes/otel/OtelScopeNode.tsx +5 -17
- package/src/nodes/otel/OtelSpanConventionNode.tsx +1 -16
- package/src/stories/BacklogMdCanvases.stories.tsx +721 -0
- package/src/stories/OtelNodeTypesPrototype.stories.tsx +1 -1
- package/src/stories/ValidationEventsCanvas.stories.tsx +2 -2
package/src/nodes/CustomNode.tsx
CHANGED
|
@@ -17,32 +17,6 @@ import {
|
|
|
17
17
|
OtelBoundaryNode,
|
|
18
18
|
} from './otel';
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Converts a hex color to a lighter/tinted version (opaque, not transparent)
|
|
22
|
-
* @param hexColor - Hex color string (e.g., "#FF5733" or "#888")
|
|
23
|
-
* @param lightness - How much to lighten (0-1), defaults to 0.88 (88% white mixed in)
|
|
24
|
-
* @returns hex color string
|
|
25
|
-
*/
|
|
26
|
-
function hexToLightColor(hexColor: string, lightness = 0.88): string {
|
|
27
|
-
// Remove # if present
|
|
28
|
-
const hex = hexColor.replace('#', '');
|
|
29
|
-
|
|
30
|
-
// Parse hex to RGB
|
|
31
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
32
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
33
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
34
|
-
|
|
35
|
-
// Mix with white based on lightness factor
|
|
36
|
-
// lightness of 0.88 means 88% white + 12% original color
|
|
37
|
-
const newR = Math.round(r + (255 - r) * lightness);
|
|
38
|
-
const newG = Math.round(g + (255 - g) * lightness);
|
|
39
|
-
const newB = Math.round(b + (255 - b) * lightness);
|
|
40
|
-
|
|
41
|
-
// Convert back to hex
|
|
42
|
-
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
43
|
-
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
20
|
export interface CustomNodeData extends Record<string, unknown> {
|
|
47
21
|
name: string;
|
|
48
22
|
typeDefinition: NodeTypeDefinition;
|
|
@@ -18,18 +18,6 @@ import { NodeContent } from './shared/NodeContent';
|
|
|
18
18
|
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
19
19
|
import type { BoundaryData } from './shared/types';
|
|
20
20
|
|
|
21
|
-
function hexToLightColor(hexColor: string, lightness = 0.88): string {
|
|
22
|
-
const hex = hexColor.replace('#', '');
|
|
23
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
24
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
25
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
26
|
-
const newR = Math.round(r + (255 - r) * lightness);
|
|
27
|
-
const newG = Math.round(g + (255 - g) * lightness);
|
|
28
|
-
const newB = Math.round(b + (255 - b) * lightness);
|
|
29
|
-
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
30
|
-
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
21
|
export interface OtelBoundaryNodeData extends Record<string, unknown> {
|
|
34
22
|
name: string;
|
|
35
23
|
typeDefinition: {
|
|
@@ -140,7 +128,7 @@ export const OtelBoundaryNode: React.FC<NodeProps<Node<OtelBoundaryNodeData>>> =
|
|
|
140
128
|
|
|
141
129
|
const boundaryStyle: React.CSSProperties = {
|
|
142
130
|
padding: '12px 16px',
|
|
143
|
-
backgroundColor:
|
|
131
|
+
backgroundColor: fillColor,
|
|
144
132
|
color: '#000',
|
|
145
133
|
border: `2px ${borderStyle} ${hasViolations ? '#D0021B' : strokeColor}`,
|
|
146
134
|
fontSize: theme.fontSizes[0],
|
|
@@ -17,18 +17,6 @@ import { NodeBadges } from './shared/NodeBadges';
|
|
|
17
17
|
import { NodeContent } from './shared/NodeContent';
|
|
18
18
|
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
19
19
|
|
|
20
|
-
function hexToLightColor(hexColor: string, lightness = 0.88): string {
|
|
21
|
-
const hex = hexColor.replace('#', '');
|
|
22
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
23
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
24
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
25
|
-
const newR = Math.round(r + (255 - r) * lightness);
|
|
26
|
-
const newG = Math.round(g + (255 - g) * lightness);
|
|
27
|
-
const newB = Math.round(b + (255 - b) * lightness);
|
|
28
|
-
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
29
|
-
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
20
|
export interface OtelEventNodeData extends Record<string, unknown> {
|
|
33
21
|
name: string;
|
|
34
22
|
typeDefinition: {
|
|
@@ -16,18 +16,6 @@ import { NodeBadges } from './shared/NodeBadges';
|
|
|
16
16
|
import { NodeContent } from './shared/NodeContent';
|
|
17
17
|
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
18
18
|
|
|
19
|
-
function hexToLightColor(hexColor: string, lightness = 0.88): string {
|
|
20
|
-
const hex = hexColor.replace('#', '');
|
|
21
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
22
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
23
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
24
|
-
const newR = Math.round(r + (255 - r) * lightness);
|
|
25
|
-
const newG = Math.round(g + (255 - g) * lightness);
|
|
26
|
-
const newB = Math.round(b + (255 - b) * lightness);
|
|
27
|
-
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
28
|
-
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
19
|
export interface OtelResourceNodeData extends Record<string, unknown> {
|
|
32
20
|
name: string;
|
|
33
21
|
typeDefinition: {
|
|
@@ -170,7 +158,7 @@ export const OtelResourceNode: React.FC<NodeProps<Node<OtelResourceNodeData>>> =
|
|
|
170
158
|
right: diamondBorderWidth,
|
|
171
159
|
bottom: diamondBorderWidth,
|
|
172
160
|
clipPath: diamondClipPath,
|
|
173
|
-
backgroundColor:
|
|
161
|
+
backgroundColor: fillColor,
|
|
174
162
|
color: '#000',
|
|
175
163
|
display: 'flex',
|
|
176
164
|
flexDirection: 'column',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OTEL Scope Node
|
|
3
3
|
*
|
|
4
|
-
* Renders scope nodes as
|
|
4
|
+
* Renders scope nodes as rounded rectangles with:
|
|
5
5
|
* - Scope name identifier
|
|
6
6
|
* - Status, sources, and references badges
|
|
7
7
|
*/
|
|
@@ -16,18 +16,6 @@ import { NodeBadges } from './shared/NodeBadges';
|
|
|
16
16
|
import { NodeContent } from './shared/NodeContent';
|
|
17
17
|
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
18
18
|
|
|
19
|
-
function hexToLightColor(hexColor: string, lightness = 0.88): string {
|
|
20
|
-
const hex = hexColor.replace('#', '');
|
|
21
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
22
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
23
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
24
|
-
const newR = Math.round(r + (255 - r) * lightness);
|
|
25
|
-
const newG = Math.round(g + (255 - g) * lightness);
|
|
26
|
-
const newB = Math.round(b + (255 - b) * lightness);
|
|
27
|
-
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
28
|
-
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
19
|
export interface OtelScopeNodeData extends Record<string, unknown> {
|
|
32
20
|
name: string;
|
|
33
21
|
typeDefinition: {
|
|
@@ -137,7 +125,7 @@ export const OtelScopeNode: React.FC<NodeProps<Node<OtelScopeNodeData>>> = ({
|
|
|
137
125
|
|
|
138
126
|
const circleStyle: React.CSSProperties = {
|
|
139
127
|
padding: '8px',
|
|
140
|
-
backgroundColor:
|
|
128
|
+
backgroundColor: fillColor,
|
|
141
129
|
color: '#000',
|
|
142
130
|
border: `2px ${borderStyle} ${hasViolations ? '#D0021B' : strokeColor}`,
|
|
143
131
|
fontSize: theme.fontSizes[0],
|
|
@@ -161,7 +149,7 @@ export const OtelScopeNode: React.FC<NodeProps<Node<OtelScopeNodeData>>> = ({
|
|
|
161
149
|
transition: 'box-shadow 0.2s ease, opacity 0.3s ease',
|
|
162
150
|
animationDuration: animationType ? `${animationDuration}ms` : undefined,
|
|
163
151
|
boxSizing: 'border-box',
|
|
164
|
-
borderRadius: '
|
|
152
|
+
borderRadius: '12px',
|
|
165
153
|
};
|
|
166
154
|
|
|
167
155
|
const handleStyle = editable
|
|
@@ -176,7 +164,7 @@ export const OtelScopeNode: React.FC<NodeProps<Node<OtelScopeNodeData>>> = ({
|
|
|
176
164
|
isVisible={selected}
|
|
177
165
|
minWidth={40}
|
|
178
166
|
minHeight={40}
|
|
179
|
-
keepAspectRatio={
|
|
167
|
+
keepAspectRatio={false}
|
|
180
168
|
onResizeEnd={handleResizeEnd}
|
|
181
169
|
handleStyle={{ width: 8, height: 8, borderRadius: 2, zIndex: 20 }}
|
|
182
170
|
lineStyle={{ borderWidth: 1, zIndex: 20 }}
|
|
@@ -196,7 +184,7 @@ export const OtelScopeNode: React.FC<NodeProps<Node<OtelScopeNodeData>>> = ({
|
|
|
196
184
|
onMouseLeave={handleMouseLeave}
|
|
197
185
|
>
|
|
198
186
|
<NodeBadges
|
|
199
|
-
shape="
|
|
187
|
+
shape="rectangle"
|
|
200
188
|
status={status}
|
|
201
189
|
sourceFiles={sourceFiles}
|
|
202
190
|
references={references}
|
|
@@ -18,21 +18,6 @@ import { NodeContent } from './shared/NodeContent';
|
|
|
18
18
|
import { useNodeBehavior } from './shared/useNodeBehavior';
|
|
19
19
|
import type { WorkflowChip } from './shared/types';
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Converts a hex color to a lighter/tinted version
|
|
23
|
-
*/
|
|
24
|
-
function hexToLightColor(hexColor: string, lightness = 0.88): string {
|
|
25
|
-
const hex = hexColor.replace('#', '');
|
|
26
|
-
const r = parseInt(hex.substring(0, 2), 16);
|
|
27
|
-
const g = parseInt(hex.substring(2, 4), 16);
|
|
28
|
-
const b = parseInt(hex.substring(4, 6), 16);
|
|
29
|
-
const newR = Math.round(r + (255 - r) * lightness);
|
|
30
|
-
const newG = Math.round(g + (255 - g) * lightness);
|
|
31
|
-
const newB = Math.round(b + (255 - b) * lightness);
|
|
32
|
-
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
33
|
-
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
21
|
export interface OtelSpanConventionNodeData extends Record<string, unknown> {
|
|
37
22
|
name: string;
|
|
38
23
|
typeDefinition: {
|
|
@@ -190,7 +175,7 @@ export const OtelSpanConventionNode: React.FC<
|
|
|
190
175
|
right: hexagonBorderWidth,
|
|
191
176
|
bottom: hexagonBorderWidth,
|
|
192
177
|
clipPath: hexagonClipPath,
|
|
193
|
-
backgroundColor:
|
|
178
|
+
backgroundColor: fillColor,
|
|
194
179
|
color: '#000',
|
|
195
180
|
display: 'flex',
|
|
196
181
|
flexDirection: 'column',
|