@industry-theme/principal-view-panels 0.12.63 → 0.12.65

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.
@@ -62,6 +62,18 @@ export interface CanvasEditorPanelProps extends CanvasEditorPanelPropsTyped {
62
62
  * When provided, displays a close button (X) in the header.
63
63
  */
64
64
  onClosePanel?: () => void;
65
+ /**
66
+ * Path to a .spans.canvas file (relative to repository root).
67
+ * When provided, span colors from this file are used to color event nodes.
68
+ * Span colors become the FILL color for nodes.
69
+ */
70
+ spansCanvasPath?: string | null;
71
+ /**
72
+ * Span pattern to use for coloring event nodes.
73
+ * Should match a spanPattern defined in the spansCanvas.
74
+ * When provided with spansCanvasPath, events are colored with the span's color.
75
+ */
76
+ workflowSpanPattern?: string | null;
65
77
  }
66
78
  /**
67
79
  * Principal View Graph Panel
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,OAAO,KAAK,EAAyE,gBAAgB,EAA+C,MAAM,mCAAmC,CAAC;AAC9L,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAKxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAiCrE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,2BAA2B;IACzE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EA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,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IAEH;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAEvC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmkD9D,CAAC"}
@@ -88803,6 +88803,10 @@ const GraphRenderer = forwardRef((props2, ref) => {
88803
88803
  }
88804
88804
  const { configuration, nodes, edges } = canvasData;
88805
88805
  const { violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, onNodeClick, fitViewToNodeIds, fitViewPadding, draggableNodeIds, onNodeDragStop, onCopy } = props2;
88806
+ const isWaitingForViewport = (containerWidth !== void 0 || containerHeight !== void 0) && !initialViewport;
88807
+ if (isWaitingForViewport) {
88808
+ return jsx("div", { ref: containerRef, className, style: { width, height, position: "relative" } });
88809
+ }
88806
88810
  return jsx("div", { ref: containerRef, className, style: { width, height, position: "relative" }, children: jsx(TooltipPortalContext.Provider, { value: portalTarget, children: jsx(ReactFlowProvider, { children: jsx(GraphRendererInner, { configuration, nodes, edges, violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, editStateRef, resetVisualStateRef, undoRedoFunctionsRef, pushHistory, clearHistory, undoFromStack, redoFromStack, onNodeClick, fitViewToNodeIds, fitViewPadding, draggableNodeIds, onNodeDragStop, onCopy, initialViewport }) }) }) });
88807
88811
  });
88808
88812
  GraphRenderer.displayName = "GraphRenderer";
@@ -95115,7 +95119,9 @@ const CanvasEditorPanel = ({
95115
95119
  traceMatchInfo,
95116
95120
  selectedScenarioId: selectedScenarioIdProp,
95117
95121
  selectedTrace,
95118
- onClosePanel
95122
+ onClosePanel,
95123
+ spansCanvasPath,
95124
+ workflowSpanPattern
95119
95125
  }) => {
95120
95126
  var _a, _b, _c, _d;
95121
95127
  const { theme: theme2 } = useTheme();
@@ -95125,6 +95131,7 @@ const CanvasEditorPanel = ({
95125
95131
  const [state, setState] = useState({
95126
95132
  canvas: null,
95127
95133
  library: null,
95134
+ spansCanvas: null,
95128
95135
  loading: true,
95129
95136
  error: null,
95130
95137
  showLegend: false,
@@ -95179,7 +95186,7 @@ const CanvasEditorPanel = ({
95179
95186
  const [currentSearchIndex, setCurrentSearchIndex] = useState(0);
95180
95187
  const loadConfiguration = useCallback(async () => {
95181
95188
  if (!canvasPath) {
95182
- setState((prev) => ({ ...prev, canvas: null, library: null, loading: false, error: null }));
95189
+ setState((prev) => ({ ...prev, canvas: null, library: null, spansCanvas: null, loading: false, error: null }));
95183
95190
  return;
95184
95191
  }
95185
95192
  setState((prev) => ({ ...prev, loading: true, error: null }));
@@ -95219,10 +95226,23 @@ const CanvasEditorPanel = ({
95219
95226
  }
95220
95227
  }
95221
95228
  }
95229
+ let spansCanvas = null;
95230
+ if (spansCanvasPath) {
95231
+ try {
95232
+ const spansFullPath = `${repositoryPath}/${spansCanvasPath}`;
95233
+ const spansContent = await readFile(spansFullPath);
95234
+ if (spansContent && typeof spansContent === "string") {
95235
+ spansCanvas = ConfigLoader.parseCanvas(spansContent);
95236
+ }
95237
+ } catch (spansError) {
95238
+ console.warn("[PrincipalView] Failed to load spans canvas:", spansError);
95239
+ }
95240
+ }
95222
95241
  setState((prev) => ({
95223
95242
  ...prev,
95224
95243
  canvas,
95225
95244
  library,
95245
+ spansCanvas,
95226
95246
  loading: false,
95227
95247
  error: null,
95228
95248
  hasUnsavedChanges: false
@@ -95233,11 +95253,12 @@ const CanvasEditorPanel = ({
95233
95253
  ...prev,
95234
95254
  canvas: null,
95235
95255
  library: null,
95256
+ spansCanvas: null,
95236
95257
  loading: false,
95237
95258
  error: error.message
95238
95259
  }));
95239
95260
  }
95240
- }, [canvasPath]);
95261
+ }, [canvasPath, spansCanvasPath]);
95241
95262
  const toggleLegend = useCallback(() => {
95242
95263
  setState((prev) => ({ ...prev, showLegend: !prev.showLegend }));
95243
95264
  }, []);
@@ -95996,6 +96017,8 @@ const CanvasEditorPanel = ({
95996
96017
  ref: graphRef,
95997
96018
  canvas: state.canvas,
95998
96019
  library: state.library ?? void 0,
96020
+ spansCanvas: state.spansCanvas ?? void 0,
96021
+ workflowSpanPattern: workflowSpanPattern ?? void 0,
95999
96022
  width: "100%",
96000
96023
  height: "100%",
96001
96024
  editable: state.isEditMode,