@principal-ai/principal-view-react 0.14.32 → 0.14.34

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.32",
3
+ "version": "0.14.34",
4
4
  "description": "React components for graph-based principal view framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -142,7 +142,7 @@ export const OtelEventNode: React.FC<NodeProps<Node<OtelEventNodeData>>> = ({
142
142
 
143
143
  const rectangleStyle: React.CSSProperties = {
144
144
  padding: '12px 16px',
145
- backgroundColor: hexToLightColor(fillColor),
145
+ backgroundColor: fillColor,
146
146
  color: '#000',
147
147
  border: `2px ${borderStyle} ${hasViolations ? '#D0021B' : strokeColor}`,
148
148
  fontSize: theme.fontSizes[0],
@@ -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
  );