@industry-theme/principal-view-panels 0.12.71 → 0.12.73

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.
@@ -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;AAkCrE;;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,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;I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AAU,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,CA6qD9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StoryboardListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/StoryboardListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AA2K9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAk1CvE,CAAC"}
1
+ {"version":3,"file":"StoryboardListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/StoryboardListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AA2K9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAu1CvE,CAAC"}
@@ -87945,7 +87945,8 @@ const CustomEdge = ({ id: id2, sourceX, sourceY, targetX, targetY, sourcePositio
87945
87945
  fontWeight: theme2.fontWeights.medium,
87946
87946
  fontFamily: theme2.fonts.body,
87947
87947
  border: `1px solid ${color2}`,
87948
- pointerEvents: "all"
87948
+ pointerEvents: "all",
87949
+ zIndex: 1e3
87949
87950
  }, className: "nodrag nopan", children: labelText }) }), tooltipsEnabled && isHovered && shiftKeyPressed && jsx(EdgeLabelRenderer, { children: jsx("div", { style: {
87950
87951
  position: "absolute",
87951
87952
  transform: `translate(-50%, -100%) translate(${labelX}px,${labelY - 12}px)`,
@@ -180557,7 +180558,7 @@ const CenterIndicator = ({ color: color2 }) => {
180557
180558
  zIndex: 5
180558
180559
  }, children: [jsx("line", { x1: screenX, y1: screenY - size, x2: screenX, y2: screenY + size, stroke: color2, strokeWidth, opacity: 0.7 }), jsx("line", { x1: screenX - size, y1: screenY, x2: screenX + size, y2: screenY, stroke: color2, strokeWidth, opacity: 0.7 }), jsx("circle", { cx: screenX, cy: screenY, r: 3, fill: color2, opacity: 0.7 })] });
180559
180560
  };
180560
- const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = "lines", backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, resetVisualStateRef, undoRedoFunctionsRef, pushHistory, clearHistory, undoFromStack, redoFromStack, onNodeClick: onNodeClickProp, fitViewToNodeIds, fitViewPadding = 0.2, draggableNodeIds, onNodeDragStop: onNodeDragStopProp, onCopy, initialViewport, elkLayout }) => {
180561
+ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = "lines", backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, resetVisualStateRef, undoRedoFunctionsRef, pushHistory, clearHistory, undoFromStack, redoFromStack, onNodeClick: onNodeClickProp, fitViewToNodeIds, fitViewPadding = 0.2, draggableNodeIds, onNodeDragStop: onNodeDragStopProp, onCopy, initialViewport, elkLayout, scenarioEdges, showSequenceLabels = true }) => {
180561
180562
  const { fitView: fitView2, fitBounds, getNodes } = useReactFlow();
180562
180563
  const updateNodeInternals2 = useUpdateNodeInternals();
180563
180564
  const { theme: theme2 } = useTheme();
@@ -181483,6 +181484,15 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
181483
181484
  });
181484
181485
  }
181485
181486
  }, [editable, updateEditState, selectedNodeIds, draggableNodeIds, pushHistory]);
181487
+ const scenarioEdgeSequenceMap = useMemo(() => {
181488
+ const map2 = /* @__PURE__ */ new Map();
181489
+ if (scenarioEdges && showSequenceLabels) {
181490
+ for (const se2 of scenarioEdges) {
181491
+ map2.set(`${se2.fromSpan}->${se2.toSpan}`, se2.sequenceNumber);
181492
+ }
181493
+ }
181494
+ return map2;
181495
+ }, [scenarioEdges, showSequenceLabels]);
181486
181496
  const xyflowEdgesBase = useMemo(() => {
181487
181497
  const converted = convertToXYFlowEdges(edges, configuration, violations);
181488
181498
  const filtered = converted.filter((edge) => {
@@ -181499,12 +181509,30 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
181499
181509
  return true;
181500
181510
  });
181501
181511
  const mappedEdges = filtered.map((edge) => {
181512
+ var _a2, _b;
181502
181513
  const animation = animationState.edgeAnimations[edge.id];
181503
181514
  const isSelected = selectedEdgeIds.has(edge.id);
181515
+ const edgeKey = `${edge.source}->${edge.target}`;
181516
+ const sequenceNumber = scenarioEdgeSequenceMap.get(edgeKey);
181504
181517
  return {
181505
181518
  ...edge,
181506
181519
  data: {
181507
181520
  ...edge.data,
181521
+ // Inject sequence number into edge data for label rendering
181522
+ ...sequenceNumber !== void 0 ? {
181523
+ data: {
181524
+ ...(_a2 = edge.data) == null ? void 0 : _a2.data,
181525
+ sequenceNumber
181526
+ },
181527
+ // Configure label to show sequence number
181528
+ typeDefinition: {
181529
+ ...(_b = edge.data) == null ? void 0 : _b.typeDefinition,
181530
+ label: {
181531
+ field: "sequenceNumber",
181532
+ position: "middle"
181533
+ }
181534
+ }
181535
+ } : {},
181508
181536
  tooltipsEnabled: showTooltips,
181509
181537
  shiftKeyPressed,
181510
181538
  ...animation ? {
@@ -181527,7 +181555,7 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
181527
181555
  return -1;
181528
181556
  return 0;
181529
181557
  });
181530
- }, [edges, configuration, violations, animationState.edgeAnimations, showTooltips, selectedEdgeIds, shiftKeyPressed, activeNodeIds, hiddenNodeIds]);
181558
+ }, [edges, configuration, violations, animationState.edgeAnimations, showTooltips, selectedEdgeIds, shiftKeyPressed, activeNodeIds, hiddenNodeIds, scenarioEdgeSequenceMap]);
181531
181559
  const { edgePaths: elkEdgePaths, edgeLabelPositions: elkLabelPositions } = useElkLayout(xyflowNodesBase, xyflowEdgesBase, {
181532
181560
  enabled: (elkLayout == null ? void 0 : elkLayout.enabled) ?? false,
181533
181561
  routingStyle: (elkLayout == null ? void 0 : elkLayout.routingStyle) ?? "orthogonal",
@@ -181802,7 +181830,7 @@ function useCanvasToLegacy(canvas, library, spansCanvas, workflowSpanPattern) {
181802
181830
  }, [canvas, library, spansCanvas, workflowSpanPattern]);
181803
181831
  }
181804
181832
  const GraphRenderer = forwardRef((props, ref) => {
181805
- const { canvas, library, spansCanvas, workflowSpanPattern, className, width = "100%", height = "100%", containerWidth, containerHeight, elkLayout } = props;
181833
+ const { canvas, library, spansCanvas, workflowSpanPattern, className, width = "100%", height = "100%", containerWidth, containerHeight, elkLayout, scenarioEdges, showSequenceLabels } = props;
181806
181834
  const { theme: theme2 } = useTheme();
181807
181835
  const containerRef = useRef(null);
181808
181836
  const [portalTarget, setPortalTarget] = useState(null);
@@ -181891,7 +181919,7 @@ const GraphRenderer = forwardRef((props, ref) => {
181891
181919
  if (isWaitingForViewport) {
181892
181920
  return jsx("div", { ref: containerRef, className, style: { width, height, position: "relative" } });
181893
181921
  }
181894
- 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, elkLayout }) }) }) });
181922
+ 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, elkLayout, scenarioEdges, showSequenceLabels }) }) }) });
181895
181923
  });
181896
181924
  GraphRenderer.displayName = "GraphRenderer";
181897
181925
  const DEFAULT_NODE_WIDTH = 200;
@@ -188987,7 +189015,7 @@ const CanvasEditorPanel = ({
188987
189015
  spansCanvasPath,
188988
189016
  workflowSpanPattern
188989
189017
  }) => {
188990
- var _a2, _b, _c;
189018
+ var _a2, _b, _c, _d, _e3;
188991
189019
  const { theme: theme2 } = useTheme();
188992
189020
  const graphRef = useRef(null);
188993
189021
  const canvasContainerRef = useRef(null);
@@ -189460,6 +189488,52 @@ const CanvasEditorPanel = ({
189460
189488
  }
189461
189489
  return null;
189462
189490
  }, [state.canvas, state.hoveredScenarioEventNames, state.selectedScenario, workflowTemplate, getNodeEventName, state.isSearchOpen, searchMatchedNodeIds]);
189491
+ const eventNameToNodeId = useMemo(() => {
189492
+ var _a3;
189493
+ const map2 = /* @__PURE__ */ new Map();
189494
+ if (!((_a3 = state.canvas) == null ? void 0 : _a3.nodes)) return map2;
189495
+ for (const node2 of state.canvas.nodes) {
189496
+ const eventName = getNodeEventName(node2);
189497
+ if (eventName) {
189498
+ map2.set(eventName, node2.id);
189499
+ }
189500
+ }
189501
+ return map2;
189502
+ }, [(_b = state.canvas) == null ? void 0 : _b.nodes, getNodeEventName]);
189503
+ const scenarioEdges = useMemo(() => {
189504
+ var _a3, _b2, _c2;
189505
+ if (!((_b2 = (_a3 = state.selectedScenario) == null ? void 0 : _a3.template) == null ? void 0 : _b2.events) || !((_c2 = state.canvas) == null ? void 0 : _c2.nodes)) return void 0;
189506
+ try {
189507
+ const eventNames = Object.keys(state.selectedScenario.template.events);
189508
+ if (eventNames.length < 2) return void 0;
189509
+ const edges = [];
189510
+ const seenEdges = /* @__PURE__ */ new Set();
189511
+ let sequenceNumber = 0;
189512
+ for (let i = 0; i < eventNames.length - 1; i++) {
189513
+ const fromEventName = eventNames[i];
189514
+ const toEventName = eventNames[i + 1];
189515
+ const fromNodeId = eventNameToNodeId.get(fromEventName);
189516
+ const toNodeId = eventNameToNodeId.get(toEventName);
189517
+ if (fromNodeId && toNodeId && fromNodeId !== toNodeId) {
189518
+ const edgeKey = `${fromNodeId}->${toNodeId}`;
189519
+ if (!seenEdges.has(edgeKey)) {
189520
+ seenEdges.add(edgeKey);
189521
+ sequenceNumber++;
189522
+ edges.push({
189523
+ fromSpan: fromNodeId,
189524
+ // GraphRenderer expects these as node IDs
189525
+ toSpan: toNodeId,
189526
+ sequenceNumber
189527
+ });
189528
+ }
189529
+ }
189530
+ }
189531
+ return edges.length > 0 ? edges : void 0;
189532
+ } catch (error) {
189533
+ console.warn("[CanvasEditorPanel] Failed to derive scenario edges:", error);
189534
+ return void 0;
189535
+ }
189536
+ }, [state.selectedScenario, (_c = state.canvas) == null ? void 0 : _c.nodes, eventNameToNodeId]);
189463
189537
  const fitViewToNodeIds = useMemo(() => {
189464
189538
  var _a3;
189465
189539
  if (state.focusedNodeId && state.selectedScenario) {
@@ -189923,7 +189997,8 @@ const CanvasEditorPanel = ({
189923
189997
  fitViewToNodeIds,
189924
189998
  fitViewPadding: 0.15,
189925
189999
  containerWidth: containerDimensions == null ? void 0 : containerDimensions.width,
189926
- containerHeight: containerDimensions == null ? void 0 : containerDimensions.height
190000
+ containerHeight: containerDimensions == null ? void 0 : containerDimensions.height,
190001
+ scenarioEdges
189927
190002
  }
189928
190003
  ) : null,
189929
190004
  state.isEditMode && state.hasUnsavedChanges && /* @__PURE__ */ jsxs("div", { style: {
@@ -190028,7 +190103,7 @@ const CanvasEditorPanel = ({
190028
190103
  color: theme2.colors.textMuted,
190029
190104
  flexShrink: 0
190030
190105
  }, children: "Edges:" }),
190031
- ((_c = (_b = state.canvas) == null ? void 0 : _b.pv) == null ? void 0 : _c.edgeTypes) && Object.keys(state.canvas.pv.edgeTypes).length > 0 ? /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: theme2.space[4], flexWrap: "wrap" }, children: Object.entries(state.canvas.pv.edgeTypes).map(([typeName, edgeType]) => /* @__PURE__ */ jsxs(
190106
+ ((_e3 = (_d = state.canvas) == null ? void 0 : _d.pv) == null ? void 0 : _e3.edgeTypes) && Object.keys(state.canvas.pv.edgeTypes).length > 0 ? /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: theme2.space[4], flexWrap: "wrap" }, children: Object.entries(state.canvas.pv.edgeTypes).map(([typeName, edgeType]) => /* @__PURE__ */ jsxs(
190032
190107
  "div",
190033
190108
  {
190034
190109
  style: {
@@ -191832,11 +191907,14 @@ const StoryboardListPanel = ({
191832
191907
  }
191833
191908
  }, [getNodeFilePath]);
191834
191909
  const handleCopyPath = useCallback(async () => {
191910
+ var _a2;
191835
191911
  if (!contextMenu) return;
191836
- const path2 = getNodeFilePath(contextMenu.node);
191837
- if (path2) {
191912
+ const relativePath = getNodeFilePath(contextMenu.node);
191913
+ if (relativePath) {
191838
191914
  try {
191839
- await navigator.clipboard.writeText(path2);
191915
+ const rootPath = ((_a2 = fileTreeData == null ? void 0 : fileTreeData.root) == null ? void 0 : _a2.path) ?? "";
191916
+ const absolutePath = rootPath && !relativePath.startsWith("/") ? `${rootPath}/${relativePath}` : relativePath;
191917
+ await navigator.clipboard.writeText(absolutePath);
191840
191918
  setContextMenuCopied(true);
191841
191919
  setTimeout(() => {
191842
191920
  setContextMenu(null);
@@ -191847,7 +191925,7 @@ const StoryboardListPanel = ({
191847
191925
  setContextMenu(null);
191848
191926
  }
191849
191927
  }
191850
- }, [contextMenu, getNodeFilePath]);
191928
+ }, [contextMenu, getNodeFilePath, fileTreeData]);
191851
191929
  useEffect(() => {
191852
191930
  if (!contextMenu) return;
191853
191931
  const handleClickOutside = (e) => {