@industry-theme/principal-view-panels 0.1.2 → 0.1.4

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":"vvfConfigs.d.ts","sourceRoot":"","sources":["../../src/mocks/vvfConfigs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE;;GAEG;AAEH,eAAO,MAAM,gBAAgB,EAAE,cA0F9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,cA8KpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cA+G/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,cA0JlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAwHrC,CAAC;AAGF,eAAO,MAAM,oBAAoB,QAA4C,CAAC;AAC9E,eAAO,MAAM,qBAAqB,QAA6C,CAAC;AAChF,eAAO,MAAM,0BAA0B,QAAkD,CAAC;AAC1F,eAAO,MAAM,wBAAwB,QAAgD,CAAC;AACtF,eAAO,MAAM,2BAA2B,QAAmD,CAAC;AAG5F,eAAO,MAAM,kBAAkB,GAAI,QAAQ,QAAQ,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,gBAAgB,GAAG,MAAM;;cAChG,MAAM;sBAAgB,MAAM;cAAQ,MAAM;kBAAY,MAAM;;CAgDxF,CAAC"}
1
+ {"version":3,"file":"vvfConfigs.d.ts","sourceRoot":"","sources":["../../src/mocks/vvfConfigs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE;;GAEG;AAEH,eAAO,MAAM,gBAAgB,EAAE,cA6F9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,cAqLpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAmH/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAiKlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,cA8HrC,CAAC;AAGF,eAAO,MAAM,oBAAoB,QAA4C,CAAC;AAC9E,eAAO,MAAM,qBAAqB,QAA6C,CAAC;AAChF,eAAO,MAAM,0BAA0B,QAAkD,CAAC;AAC1F,eAAO,MAAM,wBAAwB,QAAgD,CAAC;AACtF,eAAO,MAAM,2BAA2B,QAAmD,CAAC;AAG5F,eAAO,MAAM,kBAAkB,GAAI,QAAQ,QAAQ,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,gBAAgB,GAAG,MAAM;;cAChG,MAAM;sBAAgB,MAAM;cAAQ,MAAM;kBAAY,MAAM;;CAgDxF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ControlTowerIntegration.stories.d.ts","sourceRoot":"","sources":["../../src/panels/ControlTowerIntegration.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA+K5D,QAAA,MAAM,IAAI,EAAE,IASX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAyb7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA0I/B,CAAC"}
1
+ {"version":3,"file":"ControlTowerIntegration.stories.d.ts","sourceRoot":"","sources":["../../src/panels/ControlTowerIntegration.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAsL5D,QAAA,MAAM,IAAI,EAAE,IASX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAyb7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA0I/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EventControllerPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/EventControllerPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAGpF;;;;GAIG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;CAsBmC,CAAC;AAE9C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAiNnC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAuC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAUlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAmEjC,CAAC"}
1
+ {"version":3,"file":"EventControllerPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/EventControllerPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAGpF;;;;GAIG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;CAsBmC,CAAC;AAE9C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAoNnC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAuC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAUlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAmEjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EventRecordingIntegration.stories.d.ts","sourceRoot":"","sources":["../../src/panels/EventRecordingIntegration.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAqE5D,QAAA,MAAM,IAAI,EAAE,IASX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA0S/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,QAgFzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAgKlC,CAAC"}
1
+ {"version":3,"file":"EventRecordingIntegration.stories.d.ts","sourceRoot":"","sources":["../../src/panels/EventRecordingIntegration.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwE5D,QAAA,MAAM,IAAI,EAAE,IASX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA0S/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,QAgFzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAgKlC,CAAC"}
@@ -4454,12 +4454,14 @@ class EventProcessor {
4454
4454
  }
4455
4455
  }
4456
4456
  handleNodeEvent(event, timestamp2) {
4457
+ var _a;
4457
4458
  const payload = event.payload;
4458
4459
  switch (payload.operation) {
4459
4460
  case "create":
4460
4461
  this.state.nodes.set(payload.nodeId, {
4461
4462
  id: payload.nodeId,
4462
4463
  type: payload.nodeType,
4464
+ name: ((_a = payload.data) == null ? void 0 : _a.name) || payload.nodeId,
4463
4465
  data: payload.data || {},
4464
4466
  position: payload.position,
4465
4467
  createdAt: timestamp2,
@@ -5185,6 +5187,7 @@ class GraphConverter {
5185
5187
  nodes.push({
5186
5188
  id,
5187
5189
  type: id,
5190
+ name: id,
5188
5191
  data: {
5189
5192
  label: id,
5190
5193
  shape: nodeType.shape,
@@ -5304,8 +5307,23 @@ class CanvasConverter {
5304
5307
  var _a, _b;
5305
5308
  const pv = node.pv;
5306
5309
  const color = resolveCanvasColor(node.color);
5310
+ let nodeName;
5311
+ switch (node.type) {
5312
+ case "text":
5313
+ nodeName = node.text.split("\n")[0].replace(/^#+ /, "").substring(0, 50);
5314
+ break;
5315
+ case "file":
5316
+ nodeName = node.file.split("/").pop() || node.file;
5317
+ break;
5318
+ case "link":
5319
+ nodeName = node.url;
5320
+ break;
5321
+ case "group":
5322
+ nodeName = node.label || "Group";
5323
+ break;
5324
+ }
5307
5325
  const data = {
5308
- label: this.getNodeLabel(node),
5326
+ name: nodeName,
5309
5327
  nodeType: (pv == null ? void 0 : pv.nodeType) || node.id,
5310
5328
  canvasType: node.type,
5311
5329
  shape: (pv == null ? void 0 : pv.shape) || "rectangle",
@@ -5320,8 +5338,6 @@ class CanvasConverter {
5320
5338
  data.file = node.file;
5321
5339
  } else if (node.type === "link") {
5322
5340
  data.url = node.url;
5323
- } else if (node.type === "group") {
5324
- data.label = node.label || data.label;
5325
5341
  }
5326
5342
  if (pv) {
5327
5343
  data.states = pv.states;
@@ -5342,26 +5358,6 @@ class CanvasConverter {
5342
5358
  }
5343
5359
  };
5344
5360
  }
5345
- /**
5346
- * Get display label for a node
5347
- */
5348
- static getNodeLabel(node) {
5349
- var _a;
5350
- if ((_a = node.pv) == null ? void 0 : _a.nodeType) {
5351
- return node.pv.nodeType;
5352
- }
5353
- switch (node.type) {
5354
- case "text":
5355
- const firstLine = node.text.split("\n")[0];
5356
- return firstLine.replace(/^#+ /, "").substring(0, 50);
5357
- case "file":
5358
- return node.file.split("/").pop() || node.file;
5359
- case "link":
5360
- return node.url;
5361
- case "group":
5362
- return node.label || "Group";
5363
- }
5364
- }
5365
5361
  /**
5366
5362
  * Convert a single canvas edge to React Flow edge
5367
5363
  */
@@ -5411,11 +5407,27 @@ class CanvasConverter {
5411
5407
  if (canvas.nodes) {
5412
5408
  for (const node of canvas.nodes) {
5413
5409
  const pv = node.pv;
5410
+ let nodeName;
5411
+ switch (node.type) {
5412
+ case "text":
5413
+ nodeName = node.text.split("\n")[0].replace(/^#+ /, "").substring(0, 50);
5414
+ break;
5415
+ case "file":
5416
+ nodeName = node.file.split("/").pop() || node.file;
5417
+ break;
5418
+ case "link":
5419
+ nodeName = node.url;
5420
+ break;
5421
+ case "group":
5422
+ nodeName = node.label || "Group";
5423
+ break;
5424
+ }
5414
5425
  nodes.push({
5415
5426
  id: node.id,
5416
5427
  type: (pv == null ? void 0 : pv.nodeType) || node.type,
5428
+ name: nodeName,
5417
5429
  data: {
5418
- label: this.getNodeLabel(node),
5430
+ description: pv == null ? void 0 : pv.description,
5419
5431
  shape: (pv == null ? void 0 : pv.shape) || "rectangle",
5420
5432
  icon: pv == null ? void 0 : pv.icon,
5421
5433
  // Color priority: pv.fill > node.color
@@ -5498,6 +5510,7 @@ class CanvasConverter {
5498
5510
  if (node.data.nodeType || node.data.shape || ((_c = node.data.sources) == null ? void 0 : _c.length)) {
5499
5511
  canvasNode.pv = {
5500
5512
  nodeType: node.data.nodeType || node.id,
5513
+ description: node.data.description || `${node.data.nodeType || node.id} node`,
5501
5514
  shape: node.data.shape,
5502
5515
  icon: node.data.icon,
5503
5516
  states: node.data.states,
@@ -9188,6 +9201,7 @@ class LibraryConverter {
9188
9201
  const { id, x: x2, y: y2, label, data } = options;
9189
9202
  const pv = {
9190
9203
  nodeType: componentKey,
9204
+ description: component.description,
9191
9205
  shape: component.shape,
9192
9206
  icon: component.icon,
9193
9207
  states: component.states,
@@ -10066,6 +10080,18 @@ const validNodeTypes = {
10066
10080
  }
10067
10081
  for (const [typeId, nodeType] of Object.entries(configuration.nodeTypes)) {
10068
10082
  const basePath = `nodeTypes.${typeId}`;
10083
+ if (!nodeType.description) {
10084
+ violations.push({
10085
+ ruleId: "valid-node-types",
10086
+ severity: "error",
10087
+ file: configPath,
10088
+ path: `${basePath}.description`,
10089
+ message: `Node type "${typeId}" is missing required "description" field`,
10090
+ impact: "Node type must have a description explaining its purpose",
10091
+ suggestion: "Add a description field explaining what this node type represents",
10092
+ fixable: false
10093
+ });
10094
+ }
10069
10095
  if (!nodeType.shape) {
10070
10096
  violations.push({
10071
10097
  ruleId: "valid-node-types",
@@ -10463,6 +10489,7 @@ const ALLOWED_FIELDS = {
10463
10489
  root: ["metadata", "nodeTypes", "edgeTypes", "allowedConnections", "validation", "display"],
10464
10490
  metadata: ["name", "version", "description"],
10465
10491
  nodeType: [
10492
+ "description",
10466
10493
  "shape",
10467
10494
  "icon",
10468
10495
  "color",
@@ -45053,7 +45080,7 @@ function requireCustomNode() {
45053
45080
  const react_1 = /* @__PURE__ */ requireUmd();
45054
45081
  const iconResolver_1 = requireIconResolver();
45055
45082
  const CustomNode$1 = ({ data, selected }) => {
45056
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o2;
45083
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2;
45057
45084
  const nodeProps = data;
45058
45085
  const { typeDefinition, state, hasViolations, data: nodeData, animationType, animationDuration = 1e3, editable = false } = nodeProps;
45059
45086
  if (!typeDefinition) {
@@ -45067,9 +45094,8 @@ function requireCustomNode() {
45067
45094
  const nodeDataStroke = nodeData.stroke;
45068
45095
  const strokeColor = nodeDataStroke || typeDefinition.stroke || fillColor;
45069
45096
  const color = fillColor;
45070
- const labelField = (_d = Object.entries(typeDefinition.dataSchema).find(([, schema2]) => schema2.displayInLabel)) == null ? void 0 : _d[0];
45071
- const displayLabel = labelField && nodeData[labelField] ? String(nodeData[labelField]) : nodeProps.label;
45072
- const icon = nodeData.icon || state && (((_e2 = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _e2.icon) || ((_g = (_f = typeDefinition.states) == null ? void 0 : _f[state]) == null ? void 0 : _g.icon)) || typeDefinition.icon;
45097
+ const displayName = nodeProps.name;
45098
+ const icon = nodeData.icon || state && (((_d = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _d.icon) || ((_f = (_e2 = typeDefinition.states) == null ? void 0 : _e2[state]) == null ? void 0 : _f.icon)) || typeDefinition.icon;
45073
45099
  const getAnimationClass = () => {
45074
45100
  switch (animationType) {
45075
45101
  case "pulse":
@@ -45153,8 +45179,8 @@ function requireCustomNode() {
45153
45179
  position: "relative",
45154
45180
  clipPath: hexagonClipPath,
45155
45181
  backgroundColor: hasViolations ? "#D0021B" : strokeColor,
45156
- width: ((_h = typeDefinition.size) == null ? void 0 : _h.width) || 120,
45157
- height: ((_i = typeDefinition.size) == null ? void 0 : _i.height) || 120,
45182
+ width: ((_g = typeDefinition.size) == null ? void 0 : _g.width) || 120,
45183
+ height: ((_h = typeDefinition.size) == null ? void 0 : _h.height) || 120,
45158
45184
  boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
45159
45185
  transition: "all 0.2s ease"
45160
45186
  } : {};
@@ -45212,25 +45238,25 @@ function requireCustomNode() {
45212
45238
  }
45213
45239
  return offsetStyle;
45214
45240
  };
45215
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Top, id: "top", style: getHandleStyle("top") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Left, id: "left", style: getHandleStyle("left") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Right, id: "right", style: getHandleStyle("right") }), isHexagon ? (0, jsx_runtime_1.jsx)("div", { style: hexagonBorderStyle, className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: hexagonInnerStyle, children: [icon && (0, jsx_runtime_1.jsx)("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: (0, iconResolver_1.resolveIcon)(icon, 20) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: "center", wordBreak: "break-word" }, children: displayLabel }), state && (0, jsx_runtime_1.jsx)("div", { style: {
45241
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Top, id: "top", style: getHandleStyle("top") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Left, id: "left", style: getHandleStyle("left") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Right, id: "right", style: getHandleStyle("right") }), isHexagon ? (0, jsx_runtime_1.jsx)("div", { style: hexagonBorderStyle, className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: hexagonInnerStyle, children: [icon && (0, jsx_runtime_1.jsx)("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: (0, iconResolver_1.resolveIcon)(icon, 20) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: "center", wordBreak: "break-word" }, children: displayName }), state && (0, jsx_runtime_1.jsx)("div", { style: {
45216
45242
  fontSize: "10px",
45217
45243
  backgroundColor: color,
45218
45244
  color: "white",
45219
45245
  padding: "2px 6px",
45220
45246
  borderRadius: "4px",
45221
45247
  textAlign: "center"
45222
- }, children: ((_j = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _j.label) || ((_l = (_k = typeDefinition.states) == null ? void 0 : _k[state]) == null ? void 0 : _l.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
45248
+ }, children: ((_i = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _i.label) || ((_k = (_j = typeDefinition.states) == null ? void 0 : _j[state]) == null ? void 0 : _k.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
45223
45249
  fontSize: "10px",
45224
45250
  color: "#D0021B",
45225
45251
  fontWeight: "bold"
45226
- }, children: "⚠️" })] }) }) : (0, jsx_runtime_1.jsx)("div", { style: getShapeStyles(), className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: isDiamond ? { transform: "rotate(-45deg)" } : {}, children: [icon && (0, jsx_runtime_1.jsx)("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: (0, iconResolver_1.resolveIcon)(icon, 20) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: "center", wordBreak: "break-word" }, children: displayLabel }), state && (0, jsx_runtime_1.jsx)("div", { style: {
45252
+ }, children: "⚠️" })] }) }) : (0, jsx_runtime_1.jsx)("div", { style: getShapeStyles(), className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: isDiamond ? { transform: "rotate(-45deg)" } : {}, children: [icon && (0, jsx_runtime_1.jsx)("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: (0, iconResolver_1.resolveIcon)(icon, 20) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: "center", wordBreak: "break-word" }, children: displayName }), state && (0, jsx_runtime_1.jsx)("div", { style: {
45227
45253
  fontSize: "10px",
45228
45254
  backgroundColor: color,
45229
45255
  color: "white",
45230
45256
  padding: "2px 6px",
45231
45257
  borderRadius: "4px",
45232
45258
  textAlign: "center"
45233
- }, children: ((_m = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _m.label) || ((_o2 = (_n2 = typeDefinition.states) == null ? void 0 : _n2[state]) == null ? void 0 : _o2.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
45259
+ }, children: ((_l = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _l.label) || ((_n2 = (_m = typeDefinition.states) == null ? void 0 : _m[state]) == null ? void 0 : _n2.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
45234
45260
  fontSize: "10px",
45235
45261
  color: "#D0021B",
45236
45262
  fontWeight: "bold"
@@ -45540,7 +45566,7 @@ function requireGraphConverter() {
45540
45566
  type: "custom",
45541
45567
  position: node.position || { x: 0, y: 0 },
45542
45568
  data: {
45543
- label: node.id,
45569
+ name: node.data.name || node.id,
45544
45570
  typeDefinition,
45545
45571
  state: node.state,
45546
45572
  hasViolations,
@@ -45814,20 +45840,13 @@ function requireNodeInfoPanel() {
45814
45840
  "GitPullRequest"
45815
45841
  ];
45816
45842
  const NodeInfoPanel$1 = ({ node, typeDefinition, availableNodeTypes, onClose, onDelete, onUpdate }) => {
45817
- var _a, _b, _c, _d, _e2, _f, _g;
45843
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i;
45818
45844
  const color = (typeDefinition == null ? void 0 : typeDefinition.color) || "#888";
45819
45845
  const canEdit = Boolean(onUpdate);
45820
- const [editingName, setEditingName] = (0, react_1.useState)(false);
45821
- const [nameValue, setNameValue] = (0, react_1.useState)("");
45822
45846
  const [showIconPicker, setShowIconPicker] = (0, react_1.useState)(false);
45847
+ const [showDetails, setShowDetails] = (0, react_1.useState)(false);
45823
45848
  const currentIcon = ((_a = node.data) == null ? void 0 : _a.icon) || (typeDefinition == null ? void 0 : typeDefinition.icon);
45824
45849
  const nameField = (typeDefinition == null ? void 0 : typeDefinition.dataSchema) ? (_b = Object.entries(typeDefinition.dataSchema).find(([, schema2]) => schema2.displayInLabel)) == null ? void 0 : _b[0] : null;
45825
- (0, react_1.useEffect)(() => {
45826
- var _a2;
45827
- if (nameField && ((_a2 = node.data) == null ? void 0 : _a2[nameField])) {
45828
- setNameValue(String(node.data[nameField]));
45829
- }
45830
- }, [node.id, nameField, node.data]);
45831
45850
  const displayFields = (typeDefinition == null ? void 0 : typeDefinition.dataSchema) ? Object.entries(typeDefinition.dataSchema).filter(([, schema2]) => schema2.displayInLabel).map(([field]) => {
45832
45851
  var _a2;
45833
45852
  return {
@@ -45837,16 +45856,8 @@ function requireNodeInfoPanel() {
45837
45856
  };
45838
45857
  }) : [];
45839
45858
  const hasSchemaFields = displayFields.length > 0;
45840
- const nodeDataEntries = node.data ? Object.entries(node.data).filter(([key]) => key !== "icon") : [];
45841
- const handleNameSave = () => {
45842
- var _a2;
45843
- if (onUpdate && nameField && nameValue !== ((_a2 = node.data) == null ? void 0 : _a2[nameField])) {
45844
- onUpdate(node.id, {
45845
- data: { ...node.data, [nameField]: nameValue }
45846
- });
45847
- }
45848
- setEditingName(false);
45849
- };
45859
+ const nodeDataEntries = node.data ? Object.entries(node.data).filter(([key]) => !["icon", "name", "description", "sources"].includes(key)) : [];
45860
+ const sources = ((_c = node.data) == null ? void 0 : _c.sources) || [];
45850
45861
  const handleTypeChange = (newType) => {
45851
45862
  if (onUpdate && newType !== node.type) {
45852
45863
  onUpdate(node.id, { type: newType });
@@ -45878,7 +45889,7 @@ function requireNodeInfoPanel() {
45878
45889
  marginBottom: "12px",
45879
45890
  paddingBottom: "8px",
45880
45891
  borderBottom: `2px solid ${color}`
45881
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontWeight: "bold", fontSize: "14px" }, children: "Node Information" }), (0, jsx_runtime_1.jsx)("button", { onClick: onClose, style: {
45892
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontWeight: "bold", fontSize: "14px" }, children: ((_d = node.data) == null ? void 0 : _d.name) || node.id }), (0, jsx_runtime_1.jsx)("button", { onClick: onClose, style: {
45882
45893
  border: "none",
45883
45894
  background: "none",
45884
45895
  cursor: "pointer",
@@ -45890,7 +45901,30 @@ function requireNodeInfoPanel() {
45890
45901
  display: "flex",
45891
45902
  alignItems: "center",
45892
45903
  justifyContent: "center"
45893
- }, children: "×" })] }), (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "4px" }, children: "Icon" }), (0, jsx_runtime_1.jsxs)("div", { style: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => canEdit && setShowIconPicker(!showIconPicker), disabled: !canEdit, style: {
45904
+ }, children: "×" })] }), ((_e2 = node.data) == null ? void 0 : _e2.description) && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "4px" }, children: "Description" }), (0, jsx_runtime_1.jsx)("div", { style: {
45905
+ fontSize: "12px",
45906
+ color: "#333"
45907
+ }, children: String(node.data.description) })] }), sources.length > 0 && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "4px" }, children: "Sources" }), (0, jsx_runtime_1.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: sources.map((source, index2) => (0, jsx_runtime_1.jsx)("span", { style: {
45908
+ fontSize: "11px",
45909
+ padding: "2px 8px",
45910
+ backgroundColor: "#f0f0f0",
45911
+ borderRadius: "4px",
45912
+ color: "#555"
45913
+ }, children: source }, index2)) })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setShowDetails(!showDetails), style: {
45914
+ width: "100%",
45915
+ padding: "8px",
45916
+ backgroundColor: "#f5f5f5",
45917
+ border: "1px solid #ddd",
45918
+ borderRadius: "4px",
45919
+ cursor: "pointer",
45920
+ fontSize: "12px",
45921
+ color: "#666",
45922
+ display: "flex",
45923
+ alignItems: "center",
45924
+ justifyContent: "center",
45925
+ gap: "6px",
45926
+ marginBottom: showDetails ? "12px" : "0"
45927
+ }, children: [(0, jsx_runtime_1.jsx)("span", { style: { transform: showDetails ? "rotate(180deg)" : "rotate(0deg)", transition: "transform 0.2s" }, children: "▼" }), showDetails ? "Hide Details" : "Show Details"] }), showDetails && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "4px" }, children: "Icon" }), (0, jsx_runtime_1.jsxs)("div", { style: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => canEdit && setShowIconPicker(!showIconPicker), disabled: !canEdit, style: {
45894
45928
  display: "flex",
45895
45929
  alignItems: "center",
45896
45930
  gap: "8px",
@@ -45947,38 +45981,11 @@ function requireNodeInfoPanel() {
45947
45981
  }, children: node.type })] }), node.state && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "4px" }, children: "State" }), (0, jsx_runtime_1.jsx)("div", { style: {
45948
45982
  fontSize: "12px",
45949
45983
  padding: "4px 8px",
45950
- backgroundColor: ((_d = (_c = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _c[node.state]) == null ? void 0 : _d.color) || "#888",
45984
+ backgroundColor: ((_g = (_f = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _f[node.state]) == null ? void 0 : _g.color) || "#888",
45951
45985
  color: "white",
45952
45986
  borderRadius: "4px",
45953
45987
  display: "inline-block"
45954
- }, children: ((_f = (_e2 = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _e2[node.state]) == null ? void 0 : _f.label) || node.state })] }), nameField && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "4px" }, children: "Name" }), canEdit && editingName ? (0, jsx_runtime_1.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [(0, jsx_runtime_1.jsx)("input", { type: "text", value: nameValue, onChange: (e) => setNameValue(e.target.value), onKeyDown: (e) => {
45955
- if (e.key === "Enter")
45956
- handleNameSave();
45957
- if (e.key === "Escape")
45958
- setEditingName(false);
45959
- }, autoFocus: true, style: {
45960
- flex: 1,
45961
- fontSize: "12px",
45962
- padding: "4px 8px",
45963
- borderRadius: "4px",
45964
- border: "1px solid #4A90E2",
45965
- outline: "none"
45966
- } }), (0, jsx_runtime_1.jsx)("button", { onClick: handleNameSave, style: {
45967
- padding: "4px 8px",
45968
- backgroundColor: "#4A90E2",
45969
- color: "white",
45970
- border: "none",
45971
- borderRadius: "4px",
45972
- cursor: "pointer",
45973
- fontSize: "11px"
45974
- }, children: "Save" })] }) : (0, jsx_runtime_1.jsxs)("div", { onClick: () => canEdit && setEditingName(true), style: {
45975
- fontSize: "12px",
45976
- padding: "4px 8px",
45977
- backgroundColor: "#f5f5f5",
45978
- borderRadius: "4px",
45979
- cursor: canEdit ? "pointer" : "default",
45980
- border: canEdit ? "1px dashed #ccc" : "none"
45981
- }, title: canEdit ? "Click to edit" : void 0, children: [((_g = node.data) == null ? void 0 : _g[nameField]) ?? "-", canEdit && (0, jsx_runtime_1.jsx)("span", { style: { marginLeft: "8px", color: "#999", fontSize: "10px" }, children: "✎" })] })] }), hasSchemaFields && displayFields.filter((f) => f.field !== nameField).length > 0 && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "8px", fontWeight: "bold" }, children: "Properties" }), displayFields.filter((f) => f.field !== nameField).map(({ field, label, value }) => (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "8px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "2px" }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { fontSize: "12px", color: "#333" }, children: value !== void 0 && value !== null ? typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) : "-" })] }, field))] }), !hasSchemaFields && nodeDataEntries.length > 0 && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "8px", fontWeight: "bold" }, children: "Data" }), nodeDataEntries.map(([key, value]) => (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "8px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "2px" }, children: key }), (0, jsx_runtime_1.jsx)("div", { style: { fontSize: "12px", color: "#333", wordBreak: "break-word" }, children: value !== void 0 && value !== null ? typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) : "-" })] }, key))] }), (0, jsx_runtime_1.jsxs)("div", { style: { fontSize: "10px", color: "#999", marginTop: "12px", paddingTop: "8px", borderTop: "1px solid #eee" }, children: ["ID: ", node.id] }), onDelete && (0, jsx_runtime_1.jsx)("button", { onClick: () => {
45988
+ }, children: ((_i = (_h = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _h[node.state]) == null ? void 0 : _i.label) || node.state })] }), hasSchemaFields && displayFields.filter((f) => f.field !== nameField).length > 0 && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "8px", fontWeight: "bold" }, children: "Properties" }), displayFields.filter((f) => f.field !== nameField).map(({ field, label, value }) => (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "8px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "2px" }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { fontSize: "12px", color: "#333" }, children: value !== void 0 && value !== null ? typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) : "-" })] }, field))] }), !hasSchemaFields && nodeDataEntries.length > 0 && (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "12px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "8px", fontWeight: "bold" }, children: "Data" }), nodeDataEntries.map(([key, value]) => (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "8px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: "10px", color: "#666", marginBottom: "2px" }, children: key }), (0, jsx_runtime_1.jsx)("div", { style: { fontSize: "12px", color: "#333", wordBreak: "break-word" }, children: value !== void 0 && value !== null ? typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) : "-" })] }, key))] }), (0, jsx_runtime_1.jsxs)("div", { style: { fontSize: "10px", color: "#999", marginTop: "12px", paddingTop: "8px", borderTop: "1px solid #eee" }, children: ["ID: ", node.id] })] }), onDelete && (0, jsx_runtime_1.jsx)("button", { onClick: () => {
45982
45989
  onDelete(node.id);
45983
45990
  onClose();
45984
45991
  }, style: {
@@ -46515,6 +46522,7 @@ function requireGraphRenderer() {
46515
46522
  if (library == null ? void 0 : library.nodeComponents) {
46516
46523
  for (const [id, component] of Object.entries(library.nodeComponents)) {
46517
46524
  nodeTypes2[id] = {
46525
+ description: component.description,
46518
46526
  shape: component.shape || "rectangle",
46519
46527
  icon: component.icon,
46520
46528
  color: component.color,
@@ -46539,6 +46547,7 @@ function requireGraphRenderer() {
46539
46547
  if ((_a = canvas.pv) == null ? void 0 : _a.nodeTypes) {
46540
46548
  for (const [id, def] of Object.entries(canvas.pv.nodeTypes)) {
46541
46549
  nodeTypes2[id] = {
46550
+ description: def.description,
46542
46551
  shape: def.shape || "rectangle",
46543
46552
  icon: def.icon,
46544
46553
  color: def.color,
@@ -46552,6 +46561,7 @@ function requireGraphRenderer() {
46552
46561
  if (!nodeTypes2[nodeType]) {
46553
46562
  const fillColor = (vv == null ? void 0 : vv.fill) || (typeof node.color === "string" ? node.color : void 0) || ((_c = (_b = vv == null ? void 0 : vv.states) == null ? void 0 : _b.idle) == null ? void 0 : _c.color);
46554
46563
  nodeTypes2[nodeType] = {
46564
+ description: (vv == null ? void 0 : vv.description) || `${nodeType} node`,
46555
46565
  shape: (vv == null ? void 0 : vv.shape) || "rectangle",
46556
46566
  icon: vv == null ? void 0 : vv.icon,
46557
46567
  color: fillColor,