@industry-theme/principal-view-panels 0.10.31 → 0.10.33

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":"WorkflowTemplatePanel.d.ts","sourceRoot":"","sources":["../../../src/panels/execution-viewer/WorkflowTemplatePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACf,MAAM,mCAAmC,CAAC;AAE3C,UAAU,0BAA0B;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC5C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC5E;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA2KtE,CAAC"}
1
+ {"version":3,"file":"WorkflowTemplatePanel.d.ts","sourceRoot":"","sources":["../../../src/panels/execution-viewer/WorkflowTemplatePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACf,MAAM,mCAAmC,CAAC;AAE3C,UAAU,0BAA0B;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC5C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC5E;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAqItE,CAAC"}
@@ -86434,29 +86434,10 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86434
86434
  const otelInfo = nodeData == null ? void 0 : nodeData.otel;
86435
86435
  const description = nodeData == null ? void 0 : nodeData.description;
86436
86436
  const sources = nodeData == null ? void 0 : nodeData.sources;
86437
- const getOtelBadgeColor = (kind) => {
86438
- switch (kind) {
86439
- case "type":
86440
- return "#4A90E2";
86441
- // Blue
86442
- case "service":
86443
- return "#7ED321";
86444
- // Green
86445
- case "instance":
86446
- return "#9B59B6";
86447
- // Purple
86448
- case "event":
86449
- return "#F59E0B";
86450
- // Amber
86451
- default:
86452
- return "#888";
86453
- }
86454
- };
86455
- const renderOtelBadge = () => {
86456
- if (!(otelInfo == null ? void 0 : otelInfo.kind))
86437
+ const renderSourcesBadge = () => {
86438
+ const sources2 = nodeData == null ? void 0 : nodeData.sources;
86439
+ if (!sources2 || sources2.length === 0)
86457
86440
  return null;
86458
- const badgeColor = getOtelBadgeColor(otelInfo.kind);
86459
- const label = otelInfo.kind.charAt(0).toUpperCase();
86460
86441
  return jsx("div", { style: {
86461
86442
  position: "absolute",
86462
86443
  top: -6,
@@ -86464,7 +86445,7 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86464
86445
  width: 18,
86465
86446
  height: 18,
86466
86447
  borderRadius: "50%",
86467
- backgroundColor: badgeColor,
86448
+ backgroundColor: "#10b981",
86468
86449
  color: "white",
86469
86450
  fontSize: theme2.fontSizes[0],
86470
86451
  fontWeight: theme2.fontWeights.bold,
@@ -86475,12 +86456,28 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86475
86456
  boxShadow: "0 1px 3px rgba(0,0,0,0.3)",
86476
86457
  zIndex: 10,
86477
86458
  opacity: isActive ? 1 : 0.1
86478
- }, title: `${otelInfo.kind}${otelInfo.category ? ` (${otelInfo.category})` : ""}`, children: label });
86459
+ }, title: `Sources: ${sources2.join(", ")}`, children: "S" });
86479
86460
  };
86480
- const renderSourcesBadge = () => {
86481
- const sources2 = nodeData == null ? void 0 : nodeData.sources;
86482
- if (!sources2 || sources2.length === 0)
86461
+ const renderStatusBadge = () => {
86462
+ const status2 = nodeData == null ? void 0 : nodeData.status;
86463
+ if (!status2)
86483
86464
  return null;
86465
+ const statusColors = {
86466
+ draft: "#6b7280",
86467
+ approved: "#3b82f6",
86468
+ implemented: "#10b981"
86469
+ // Green
86470
+ };
86471
+ const statusLabels = {
86472
+ draft: "D",
86473
+ approved: "A",
86474
+ implemented: "I"
86475
+ };
86476
+ const statusTitles = {
86477
+ draft: "Draft - Design phase",
86478
+ approved: "Approved - Ready for implementation",
86479
+ implemented: "Implemented - Code exists"
86480
+ };
86484
86481
  return jsx("div", { style: {
86485
86482
  position: "absolute",
86486
86483
  top: -6,
@@ -86488,7 +86485,7 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86488
86485
  width: 18,
86489
86486
  height: 18,
86490
86487
  borderRadius: "50%",
86491
- backgroundColor: "#10b981",
86488
+ backgroundColor: statusColors[status2],
86492
86489
  color: "white",
86493
86490
  fontSize: theme2.fontSizes[0],
86494
86491
  fontWeight: theme2.fontWeights.bold,
@@ -86499,7 +86496,7 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86499
86496
  boxShadow: "0 1px 3px rgba(0,0,0,0.3)",
86500
86497
  zIndex: 10,
86501
86498
  opacity: isActive ? 1 : 0.1
86502
- }, title: `Sources: ${sources2.join(", ")}`, children: "S" });
86499
+ }, title: statusTitles[status2], children: statusLabels[status2] });
86503
86500
  };
86504
86501
  if (!typeDefinition) {
86505
86502
  return jsx("div", { style: { padding: "10px", border: "2px solid red", borderRadius: "4px" }, children: jsx("div", { style: { fontSize: "12px", color: "red" }, children: "Error: Missing node type definition" }) });
@@ -86510,7 +86507,9 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86510
86507
  const stateColor = state && (((_a = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _a.color) || ((_c = (_b = typeDefinition.states) == null ? void 0 : _b[state]) == null ? void 0 : _c.color));
86511
86508
  const fillColor = stateColor || baseColor;
86512
86509
  const nodeDataStroke = nodeData.stroke;
86513
- const strokeColor = nodeDataStroke || typeDefinition.stroke || fillColor;
86510
+ const baseStrokeColor = nodeDataStroke || typeDefinition.stroke || fillColor;
86511
+ const status = nodeData == null ? void 0 : nodeData.status;
86512
+ const strokeColor = baseStrokeColor;
86514
86513
  const color2 = fillColor;
86515
86514
  const displayName = nodeProps.name;
86516
86515
  const eventData = nodeData == null ? void 0 : nodeData.event;
@@ -86540,11 +86539,12 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86540
86539
  const animationClass = getAnimationClass();
86541
86540
  const isGroup = nodeData.canvasType === "group";
86542
86541
  const getShapeStyles = () => {
86542
+ const borderStyle = status === "draft" ? "dotted" : status === "approved" ? "dashed" : "solid";
86543
86543
  const baseStyles = {
86544
86544
  padding: "12px 16px",
86545
86545
  backgroundColor: isGroup ? "rgba(255, 255, 255, 0.7)" : hexToLightColor(fillColor),
86546
86546
  color: "#000",
86547
- border: `2px solid ${hasViolations ? "#D0021B" : strokeColor}`,
86547
+ border: `2px ${borderStyle} ${hasViolations ? "#D0021B" : strokeColor}`,
86548
86548
  fontSize: theme2.fontSizes[0],
86549
86549
  fontWeight: theme2.fontWeights.medium,
86550
86550
  fontFamily: theme2.fonts.body,
@@ -86717,7 +86717,7 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86717
86717
  height: "100%",
86718
86718
  boxShadow: isHighlighted ? `0 0 0 3px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.5)` : selected2 ? `0 0 0 2px ${strokeColor}` : "none",
86719
86719
  transition: "box-shadow 0.2s ease"
86720
- }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [renderSourcesBadge(), renderOtelBadge(), jsx("div", { style: hexagonBorderStyle, className: animationClass, children: jsxs("div", { style: hexagonInnerStyle, children: [icon && jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: resolveIcon(icon, 20) }), renderNameWithEvent(), state && jsx("div", { style: {
86720
+ }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [renderStatusBadge(), renderSourcesBadge(), jsx("div", { style: hexagonBorderStyle, className: animationClass, children: jsxs("div", { style: hexagonInnerStyle, children: [icon && jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: resolveIcon(icon, 20) }), renderNameWithEvent(), state && jsx("div", { style: {
86721
86721
  fontSize: theme2.fontSizes[0],
86722
86722
  fontFamily: theme2.fonts.body,
86723
86723
  backgroundColor: color2,
@@ -86736,7 +86736,7 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86736
86736
  height: "100%",
86737
86737
  boxShadow: isHighlighted ? `0 0 0 3px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.5)` : selected2 ? `0 0 0 2px ${strokeColor}` : "none",
86738
86738
  transition: "box-shadow 0.2s ease"
86739
- }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [renderSourcesBadge(), renderOtelBadge(), jsx("div", { style: diamondBorderStyle, className: animationClass, children: jsxs("div", { style: diamondInnerStyle, children: [icon && jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: resolveIcon(icon, 20) }), renderNameWithEvent(), state && jsx("div", { style: {
86739
+ }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [renderStatusBadge(), renderSourcesBadge(), jsx("div", { style: diamondBorderStyle, className: animationClass, children: jsxs("div", { style: diamondInnerStyle, children: [icon && jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: resolveIcon(icon, 20) }), renderNameWithEvent(), state && jsx("div", { style: {
86740
86740
  fontSize: theme2.fontSizes[0],
86741
86741
  fontFamily: theme2.fonts.body,
86742
86742
  backgroundColor: color2,
@@ -86749,7 +86749,7 @@ const CustomNode = ({ data, selected: selected2, dragging }) => {
86749
86749
  fontFamily: theme2.fonts.body,
86750
86750
  color: "#D0021B",
86751
86751
  fontWeight: theme2.fontWeights.bold
86752
- }, children: "⚠️" })] }) }), tooltipsEnabled && jsx(NodeTooltip, { description, otel: otelInfo, sources, visible: showTooltip, nodeRef })] }) : jsxs("div", { ref: nodeRef, style: { position: "relative", width: "100%", height: "100%" }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [renderSourcesBadge(), renderOtelBadge(), jsx("div", { style: getShapeStyles(), className: animationClass, children: jsxs("div", { style: {
86752
+ }, children: "⚠️" })] }) }), tooltipsEnabled && jsx(NodeTooltip, { description, otel: otelInfo, sources, visible: showTooltip, nodeRef })] }) : jsxs("div", { ref: nodeRef, style: { position: "relative", width: "100%", height: "100%" }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [renderStatusBadge(), renderSourcesBadge(), jsx("div", { style: getShapeStyles(), className: animationClass, children: jsxs("div", { style: {
86753
86753
  ...isGroup ? { width: "100%" } : {}
86754
86754
  }, children: [isGroup ? jsxs("div", { style: {
86755
86755
  display: "flex",
@@ -97275,26 +97275,6 @@ const WorkflowTemplatePanel = ({
97275
97275
  }
97276
97276
  return eventNames;
97277
97277
  };
97278
- const getScenarioSources = (scenario) => {
97279
- if (!(canvas == null ? void 0 : canvas.nodes)) return [];
97280
- const eventNames = getScenarioEventNames(scenario);
97281
- const sources = /* @__PURE__ */ new Set();
97282
- canvas.nodes.forEach((node2) => {
97283
- var _a2, _b, _c, _d, _e2;
97284
- const eventName = ((_b = (_a2 = node2.pv) == null ? void 0 : _a2.event) == null ? void 0 : _b.name) || ("metadata" in node2 ? (_c = node2.metadata) == null ? void 0 : _c["pv.event"] : void 0);
97285
- if (eventName && typeof eventName === "string" && eventNames.includes(eventName)) {
97286
- const nodeSources = ((_d = node2.pv) == null ? void 0 : _d.sources) || ("metadata" in node2 ? (_e2 = node2.metadata) == null ? void 0 : _e2["pv.sources"] : void 0);
97287
- if (Array.isArray(nodeSources)) {
97288
- nodeSources.forEach((src) => {
97289
- if (typeof src === "string") {
97290
- sources.add(src);
97291
- }
97292
- });
97293
- }
97294
- }
97295
- });
97296
- return Array.from(sources).sort();
97297
- };
97298
97278
  return /* @__PURE__ */ jsxs(
97299
97279
  "div",
97300
97280
  {
@@ -97335,7 +97315,6 @@ const WorkflowTemplatePanel = ({
97335
97315
  const matchingExecutions = availableExecutions.filter(
97336
97316
  (exec) => executionScenarioMap[exec.id] === scenarioId
97337
97317
  );
97338
- const sources = getScenarioSources(scenario);
97339
97318
  return /* @__PURE__ */ jsx(
97340
97319
  "div",
97341
97320
  {
@@ -97374,15 +97353,12 @@ const WorkflowTemplatePanel = ({
97374
97353
  /* @__PURE__ */ jsx("h3", { style: { margin: 0, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: scenarioId.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ") }),
97375
97354
  matchingExecutions.length > 0 && /* @__PURE__ */ jsx(CircleCheck, { size: 14, style: { color: "#10b981", flexShrink: 0 } })
97376
97355
  ] }),
97377
- sources.length > 0 && /* @__PURE__ */ jsx("div", { style: {
97356
+ scenario.description && /* @__PURE__ */ jsx("div", { style: {
97378
97357
  marginTop: "6px",
97379
- fontSize: theme2.fontSizes[0],
97380
- color: theme2.colors.textTertiary || theme2.colors.textSecondary,
97381
- fontFamily: "monospace"
97382
- }, children: sources.map((source2) => /* @__PURE__ */ jsxs("div", { style: { marginTop: "2px", padding: "4px 0", display: "flex", alignItems: "center" }, children: [
97383
- /* @__PURE__ */ jsx(FileCode, { size: 14, style: { marginRight: "4px", flexShrink: 0 } }),
97384
- source2
97385
- ] }, source2)) })
97358
+ fontSize: theme2.fontSizes[1],
97359
+ color: theme2.colors.textSecondary,
97360
+ lineHeight: theme2.lineHeights.body
97361
+ }, children: scenario.description })
97386
97362
  ] })
97387
97363
  }
97388
97364
  )