@principal-ai/principal-view-react 0.14.33 → 0.14.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principal-ai/principal-view-react",
3
- "version": "0.14.33",
3
+ "version": "0.14.35",
4
4
  "description": "React components for graph-based principal view framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -579,7 +579,7 @@ export const CustomNode: React.FC<NodeProps<Node<CustomNodeData>>> = (props) =>
579
579
  const borderStyle = status === 'draft' ? 'dotted' : status === 'approved' ? 'dashed' : 'solid';
580
580
  const baseStyles = {
581
581
  padding: '12px 16px',
582
- backgroundColor: isGroup ? 'rgba(255, 255, 255, 0.7)' : hexToLightColor(fillColor),
582
+ backgroundColor: isGroup ? 'rgba(255, 255, 255, 0.7)' : fillColor,
583
583
  color: '#000',
584
584
  border: `2px ${borderStyle} ${hasViolations ? '#D0021B' : strokeColor}`,
585
585
  fontSize: theme.fontSizes[0],
@@ -696,7 +696,7 @@ export const CustomNode: React.FC<NodeProps<Node<CustomNodeData>>> = (props) =>
696
696
  right: hexagonBorderWidth,
697
697
  bottom: hexagonBorderWidth,
698
698
  clipPath: hexagonClipPath,
699
- backgroundColor: hexToLightColor(fillColor),
699
+ backgroundColor: fillColor,
700
700
  color: '#000',
701
701
  display: 'flex',
702
702
  flexDirection: 'column',
@@ -742,7 +742,7 @@ export const CustomNode: React.FC<NodeProps<Node<CustomNodeData>>> = (props) =>
742
742
  right: diamondBorderWidth,
743
743
  bottom: diamondBorderWidth,
744
744
  clipPath: diamondClipPath,
745
- backgroundColor: hexToLightColor(fillColor),
745
+ backgroundColor: fillColor,
746
746
  color: '#000',
747
747
  display: 'flex',
748
748
  flexDirection: 'column',
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import React from 'react';
3
3
  import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
4
4
  import { GraphRenderer } from '../components/GraphRenderer';
5
- import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
5
+ import type { ExtendedCanvas, ComponentLibrary } from '@principal-ai/principal-view-core';
6
6
 
7
7
  /**
8
8
  * =============================================================================
@@ -145,6 +145,24 @@ const proposedNewFormat = {
145
145
  },
146
146
  };
147
147
 
148
+ // =============================================================================
149
+ // LIBRARY: Define scopes for scope-based coloring
150
+ // =============================================================================
151
+
152
+ const libraryWithScopes: ComponentLibrary = {
153
+ version: '1.0.0',
154
+ name: 'OTEL Node Types Library',
155
+ description: 'Scope definitions for OTEL node types',
156
+ scopes: {
157
+ validation: {
158
+ description: 'Validation instrumentation scope',
159
+ color: '#8b5cf6', // purple - matches otel-scope node type
160
+ },
161
+ },
162
+ nodeComponents: {},
163
+ edgeComponents: {},
164
+ };
165
+
148
166
  // =============================================================================
149
167
  // ADAPTER: Convert new format to current format for rendering
150
168
  // =============================================================================
@@ -413,7 +431,7 @@ export const AllNodeTypes: StoryObj = {
413
431
  return (
414
432
  <ThemeProvider theme={defaultEditorTheme}>
415
433
  <div style={{ width: '100%', height: '800px' }}>
416
- <GraphRenderer canvas={canvas} initialViewport={{ x: 50, y: 20, zoom: 1 }} />
434
+ <GraphRenderer canvas={canvas} library={libraryWithScopes} initialViewport={{ x: 50, y: 20, zoom: 1 }} />
417
435
  </div>
418
436
  </ThemeProvider>
419
437
  );
@@ -780,7 +798,7 @@ export const WorkflowExample: StoryObj = {
780
798
  return (
781
799
  <ThemeProvider theme={defaultEditorTheme}>
782
800
  <div style={{ width: '100%', height: '400px' }}>
783
- <GraphRenderer canvas={workflowCanvas} initialViewport={{ x: 20, y: 50, zoom: 1 }} />
801
+ <GraphRenderer canvas={workflowCanvas} library={libraryWithScopes} initialViewport={{ x: 20, y: 50, zoom: 1 }} />
784
802
  </div>
785
803
  </ThemeProvider>
786
804
  );