@industry-theme/principal-view-panels 0.1.1 → 0.1.3
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/dist/panels.bundle.js +108 -117
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +3 -3
package/dist/panels.bundle.js
CHANGED
|
@@ -5304,8 +5304,23 @@ class CanvasConverter {
|
|
|
5304
5304
|
var _a, _b;
|
|
5305
5305
|
const pv = node.pv;
|
|
5306
5306
|
const color = resolveCanvasColor(node.color);
|
|
5307
|
+
let nodeName;
|
|
5308
|
+
switch (node.type) {
|
|
5309
|
+
case "text":
|
|
5310
|
+
nodeName = node.text.split("\n")[0].replace(/^#+ /, "").substring(0, 50);
|
|
5311
|
+
break;
|
|
5312
|
+
case "file":
|
|
5313
|
+
nodeName = node.file.split("/").pop() || node.file;
|
|
5314
|
+
break;
|
|
5315
|
+
case "link":
|
|
5316
|
+
nodeName = node.url;
|
|
5317
|
+
break;
|
|
5318
|
+
case "group":
|
|
5319
|
+
nodeName = node.label || "Group";
|
|
5320
|
+
break;
|
|
5321
|
+
}
|
|
5307
5322
|
const data = {
|
|
5308
|
-
|
|
5323
|
+
name: nodeName,
|
|
5309
5324
|
nodeType: (pv == null ? void 0 : pv.nodeType) || node.id,
|
|
5310
5325
|
canvasType: node.type,
|
|
5311
5326
|
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
@@ -5320,8 +5335,6 @@ class CanvasConverter {
|
|
|
5320
5335
|
data.file = node.file;
|
|
5321
5336
|
} else if (node.type === "link") {
|
|
5322
5337
|
data.url = node.url;
|
|
5323
|
-
} else if (node.type === "group") {
|
|
5324
|
-
data.label = node.label || data.label;
|
|
5325
5338
|
}
|
|
5326
5339
|
if (pv) {
|
|
5327
5340
|
data.states = pv.states;
|
|
@@ -5342,26 +5355,6 @@ class CanvasConverter {
|
|
|
5342
5355
|
}
|
|
5343
5356
|
};
|
|
5344
5357
|
}
|
|
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
5358
|
/**
|
|
5366
5359
|
* Convert a single canvas edge to React Flow edge
|
|
5367
5360
|
*/
|
|
@@ -5411,11 +5404,27 @@ class CanvasConverter {
|
|
|
5411
5404
|
if (canvas.nodes) {
|
|
5412
5405
|
for (const node of canvas.nodes) {
|
|
5413
5406
|
const pv = node.pv;
|
|
5407
|
+
let nodeName;
|
|
5408
|
+
switch (node.type) {
|
|
5409
|
+
case "text":
|
|
5410
|
+
nodeName = node.text.split("\n")[0].replace(/^#+ /, "").substring(0, 50);
|
|
5411
|
+
break;
|
|
5412
|
+
case "file":
|
|
5413
|
+
nodeName = node.file.split("/").pop() || node.file;
|
|
5414
|
+
break;
|
|
5415
|
+
case "link":
|
|
5416
|
+
nodeName = node.url;
|
|
5417
|
+
break;
|
|
5418
|
+
case "group":
|
|
5419
|
+
nodeName = node.label || "Group";
|
|
5420
|
+
break;
|
|
5421
|
+
}
|
|
5414
5422
|
nodes.push({
|
|
5415
5423
|
id: node.id,
|
|
5416
5424
|
type: (pv == null ? void 0 : pv.nodeType) || node.type,
|
|
5417
5425
|
data: {
|
|
5418
|
-
|
|
5426
|
+
name: nodeName,
|
|
5427
|
+
description: pv == null ? void 0 : pv.description,
|
|
5419
5428
|
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
5420
5429
|
icon: pv == null ? void 0 : pv.icon,
|
|
5421
5430
|
// Color priority: pv.fill > node.color
|
|
@@ -8892,19 +8901,19 @@ class ConfigurationLoader {
|
|
|
8892
8901
|
this.fsAdapter = fsAdapter;
|
|
8893
8902
|
}
|
|
8894
8903
|
/**
|
|
8895
|
-
* Check if the .
|
|
8904
|
+
* Check if the .principal-views/ configuration directory exists
|
|
8896
8905
|
*
|
|
8897
8906
|
* @param baseDir - Base directory to search from
|
|
8898
|
-
* @returns True if .
|
|
8907
|
+
* @returns True if .principal-views/ directory exists
|
|
8899
8908
|
*/
|
|
8900
8909
|
hasConfigDirectory(baseDir) {
|
|
8901
8910
|
const configPath = this.fsAdapter.join(baseDir, ConfigurationLoader.CONFIG_DIR);
|
|
8902
8911
|
return this.fsAdapter.exists(configPath) && this.fsAdapter.isDirectory(configPath);
|
|
8903
8912
|
}
|
|
8904
8913
|
/**
|
|
8905
|
-
* List all available configuration names in .
|
|
8914
|
+
* List all available configuration names in .principal-views/ folder
|
|
8906
8915
|
*
|
|
8907
|
-
* @param baseDir - Base directory containing .
|
|
8916
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
8908
8917
|
* @returns Array of configuration names (without extensions)
|
|
8909
8918
|
*/
|
|
8910
8919
|
listConfigurations(baseDir) {
|
|
@@ -8919,7 +8928,7 @@ class ConfigurationLoader {
|
|
|
8919
8928
|
* Load a specific configuration by name
|
|
8920
8929
|
*
|
|
8921
8930
|
* @param name - Configuration name (without extension)
|
|
8922
|
-
* @param baseDir - Base directory containing .
|
|
8931
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
8923
8932
|
* @returns Configuration file or null if not found/invalid
|
|
8924
8933
|
*/
|
|
8925
8934
|
loadByName(name, baseDir) {
|
|
@@ -8949,9 +8958,9 @@ class ConfigurationLoader {
|
|
|
8949
8958
|
return null;
|
|
8950
8959
|
}
|
|
8951
8960
|
/**
|
|
8952
|
-
* Load all configurations from .
|
|
8961
|
+
* Load all configurations from .principal-views/ folder
|
|
8953
8962
|
*
|
|
8954
|
-
* @param baseDir - Base directory containing .
|
|
8963
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
8955
8964
|
* @returns Result containing all loaded configs and any errors
|
|
8956
8965
|
*/
|
|
8957
8966
|
loadAll(baseDir) {
|
|
@@ -8961,8 +8970,8 @@ class ConfigurationLoader {
|
|
|
8961
8970
|
};
|
|
8962
8971
|
if (!this.hasConfigDirectory(baseDir)) {
|
|
8963
8972
|
result.errors.push({
|
|
8964
|
-
file: ".
|
|
8965
|
-
error: "Configuration directory .
|
|
8973
|
+
file: ".principal-views",
|
|
8974
|
+
error: "Configuration directory .principal-views/ not found"
|
|
8966
8975
|
});
|
|
8967
8976
|
return result;
|
|
8968
8977
|
}
|
|
@@ -9004,25 +9013,25 @@ class ConfigurationLoader {
|
|
|
9004
9013
|
* Get the configuration directory path
|
|
9005
9014
|
*
|
|
9006
9015
|
* @param baseDir - Base directory
|
|
9007
|
-
* @returns Full path to .
|
|
9016
|
+
* @returns Full path to .principal-views/ directory
|
|
9008
9017
|
*/
|
|
9009
9018
|
getConfigDirectoryPath(baseDir) {
|
|
9010
9019
|
return this.fsAdapter.join(baseDir, ConfigurationLoader.CONFIG_DIR);
|
|
9011
9020
|
}
|
|
9012
9021
|
}
|
|
9013
|
-
ConfigurationLoader.CONFIG_DIR = ".
|
|
9022
|
+
ConfigurationLoader.CONFIG_DIR = ".principal-views";
|
|
9014
9023
|
const DEFAULT_LIBRARY_FILES = ["library.yaml", "library.yml", "library.json"];
|
|
9015
|
-
const CONFIG_DIR = ".
|
|
9024
|
+
const CONFIG_DIR = ".principal-views";
|
|
9016
9025
|
class LibraryLoader {
|
|
9017
9026
|
constructor(fsAdapter) {
|
|
9018
9027
|
this.fsAdapter = fsAdapter;
|
|
9019
9028
|
}
|
|
9020
9029
|
/**
|
|
9021
|
-
* Load the component library from the .
|
|
9030
|
+
* Load the component library from the .principal-views/ folder
|
|
9022
9031
|
*
|
|
9023
9032
|
* Searches for library.yaml, library.yml, or library.json (in that order).
|
|
9024
9033
|
*
|
|
9025
|
-
* @param baseDir - Base directory containing .
|
|
9034
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
9026
9035
|
* @returns Library load result
|
|
9027
9036
|
*/
|
|
9028
9037
|
load(baseDir) {
|
|
@@ -9030,7 +9039,7 @@ class LibraryLoader {
|
|
|
9030
9039
|
if (!this.fsAdapter.exists(configPath) || !this.fsAdapter.isDirectory(configPath)) {
|
|
9031
9040
|
return {
|
|
9032
9041
|
success: false,
|
|
9033
|
-
error: "Configuration directory .
|
|
9042
|
+
error: "Configuration directory .principal-views/ not found",
|
|
9034
9043
|
path: configPath
|
|
9035
9044
|
};
|
|
9036
9045
|
}
|
|
@@ -9080,9 +9089,9 @@ class LibraryLoader {
|
|
|
9080
9089
|
}
|
|
9081
9090
|
}
|
|
9082
9091
|
/**
|
|
9083
|
-
* Check if a library file exists in the .
|
|
9092
|
+
* Check if a library file exists in the .principal-views/ folder
|
|
9084
9093
|
*
|
|
9085
|
-
* @param baseDir - Base directory containing .
|
|
9094
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
9086
9095
|
* @returns True if a library file exists
|
|
9087
9096
|
*/
|
|
9088
9097
|
hasLibrary(baseDir) {
|
|
@@ -9679,14 +9688,11 @@ function createRulesEngine(rules) {
|
|
|
9679
9688
|
return engine;
|
|
9680
9689
|
}
|
|
9681
9690
|
const CONFIG_FILE_NAMES = [
|
|
9682
|
-
".
|
|
9683
|
-
".
|
|
9684
|
-
".
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
"vgc.config.yml"
|
|
9688
|
-
];
|
|
9689
|
-
const DEFAULT_INCLUDE_PATTERNS = [".vgc/**/*.yaml", ".vgc/**/*.yml", ".vgc/**/*.json"];
|
|
9691
|
+
".privurc.yaml",
|
|
9692
|
+
".privurc.yml",
|
|
9693
|
+
".privurc.json"
|
|
9694
|
+
];
|
|
9695
|
+
const DEFAULT_INCLUDE_PATTERNS = [".principal-views/**/*.yaml", ".principal-views/**/*.yml", ".principal-views/**/*.json"];
|
|
9690
9696
|
const DEFAULT_EXCLUDE_PATTERNS = ["**/node_modules/**", "**/*.test.*"];
|
|
9691
9697
|
const VALID_SEVERITIES = [
|
|
9692
9698
|
"off",
|
|
@@ -45056,7 +45062,7 @@ function requireCustomNode() {
|
|
|
45056
45062
|
const react_1 = /* @__PURE__ */ requireUmd();
|
|
45057
45063
|
const iconResolver_1 = requireIconResolver();
|
|
45058
45064
|
const CustomNode$1 = ({ data, selected }) => {
|
|
45059
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k;
|
|
45065
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2;
|
|
45060
45066
|
const nodeProps = data;
|
|
45061
45067
|
const { typeDefinition, state, hasViolations, data: nodeData, animationType, animationDuration = 1e3, editable = false } = nodeProps;
|
|
45062
45068
|
if (!typeDefinition) {
|
|
@@ -45064,14 +45070,14 @@ function requireCustomNode() {
|
|
|
45064
45070
|
}
|
|
45065
45071
|
const nodeDataColor = nodeData.color;
|
|
45066
45072
|
const baseColor = nodeDataColor || typeDefinition.color || "#888";
|
|
45067
|
-
const
|
|
45073
|
+
const nodeDataStates = nodeData.states;
|
|
45074
|
+
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));
|
|
45068
45075
|
const fillColor = stateColor || baseColor;
|
|
45069
45076
|
const nodeDataStroke = nodeData.stroke;
|
|
45070
45077
|
const strokeColor = nodeDataStroke || typeDefinition.stroke || fillColor;
|
|
45071
45078
|
const color = fillColor;
|
|
45072
|
-
const
|
|
45073
|
-
const
|
|
45074
|
-
const icon = nodeData.icon || state && ((_e2 = (_d = typeDefinition.states) == null ? void 0 : _d[state]) == null ? void 0 : _e2.icon) || typeDefinition.icon;
|
|
45079
|
+
const displayName = nodeProps.name;
|
|
45080
|
+
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;
|
|
45075
45081
|
const getAnimationClass = () => {
|
|
45076
45082
|
switch (animationType) {
|
|
45077
45083
|
case "pulse":
|
|
@@ -45155,8 +45161,8 @@ function requireCustomNode() {
|
|
|
45155
45161
|
position: "relative",
|
|
45156
45162
|
clipPath: hexagonClipPath,
|
|
45157
45163
|
backgroundColor: hasViolations ? "#D0021B" : strokeColor,
|
|
45158
|
-
width: ((
|
|
45159
|
-
height: ((
|
|
45164
|
+
width: ((_g = typeDefinition.size) == null ? void 0 : _g.width) || 120,
|
|
45165
|
+
height: ((_h = typeDefinition.size) == null ? void 0 : _h.height) || 120,
|
|
45160
45166
|
boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
|
|
45161
45167
|
transition: "all 0.2s ease"
|
|
45162
45168
|
} : {};
|
|
@@ -45214,25 +45220,25 @@ function requireCustomNode() {
|
|
|
45214
45220
|
}
|
|
45215
45221
|
return offsetStyle;
|
|
45216
45222
|
};
|
|
45217
|
-
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:
|
|
45223
|
+
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: {
|
|
45218
45224
|
fontSize: "10px",
|
|
45219
45225
|
backgroundColor: color,
|
|
45220
45226
|
color: "white",
|
|
45221
45227
|
padding: "2px 6px",
|
|
45222
45228
|
borderRadius: "4px",
|
|
45223
45229
|
textAlign: "center"
|
|
45224
|
-
}, children: ((_i = (
|
|
45230
|
+
}, 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: {
|
|
45225
45231
|
fontSize: "10px",
|
|
45226
45232
|
color: "#D0021B",
|
|
45227
45233
|
fontWeight: "bold"
|
|
45228
|
-
}, 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:
|
|
45234
|
+
}, 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: {
|
|
45229
45235
|
fontSize: "10px",
|
|
45230
45236
|
backgroundColor: color,
|
|
45231
45237
|
color: "white",
|
|
45232
45238
|
padding: "2px 6px",
|
|
45233
45239
|
borderRadius: "4px",
|
|
45234
45240
|
textAlign: "center"
|
|
45235
|
-
}, children: ((
|
|
45241
|
+
}, 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: {
|
|
45236
45242
|
fontSize: "10px",
|
|
45237
45243
|
color: "#D0021B",
|
|
45238
45244
|
fontWeight: "bold"
|
|
@@ -45358,7 +45364,8 @@ function requireCustomEdge() {
|
|
|
45358
45364
|
if (!typeDefinition) {
|
|
45359
45365
|
return null;
|
|
45360
45366
|
}
|
|
45361
|
-
const
|
|
45367
|
+
const edgeColor = edgeData == null ? void 0 : edgeData.color;
|
|
45368
|
+
const color = hasViolations ? "#D0021B" : edgeColor || typeDefinition.color || "#888";
|
|
45362
45369
|
const width = typeDefinition.width || 2;
|
|
45363
45370
|
const [edgePath, labelX, labelY] = (0, react_2.getBezierPath)({
|
|
45364
45371
|
sourceX,
|
|
@@ -45541,7 +45548,7 @@ function requireGraphConverter() {
|
|
|
45541
45548
|
type: "custom",
|
|
45542
45549
|
position: node.position || { x: 0, y: 0 },
|
|
45543
45550
|
data: {
|
|
45544
|
-
|
|
45551
|
+
name: node.data.name || node.id,
|
|
45545
45552
|
typeDefinition,
|
|
45546
45553
|
state: node.state,
|
|
45547
45554
|
hasViolations,
|
|
@@ -45552,18 +45559,20 @@ function requireGraphConverter() {
|
|
|
45552
45559
|
}
|
|
45553
45560
|
function convertToXYFlowEdges(edges, configuration, violations = []) {
|
|
45554
45561
|
return edges.map((edge) => {
|
|
45562
|
+
var _a;
|
|
45555
45563
|
const typeDefinition = configuration.edgeTypes[edge.type];
|
|
45556
45564
|
if (!typeDefinition) {
|
|
45557
45565
|
console.warn(`Edge type "${edge.type}" not found in configuration for edge "${edge.id}"`);
|
|
45558
45566
|
}
|
|
45559
45567
|
const hasViolations = violations.some((v) => {
|
|
45560
|
-
var
|
|
45561
|
-
return ((
|
|
45568
|
+
var _a2;
|
|
45569
|
+
return ((_a2 = v.context) == null ? void 0 : _a2.edgeId) === edge.id;
|
|
45562
45570
|
});
|
|
45563
45571
|
const edgeWithHandles = edge;
|
|
45572
|
+
const edgeColor = (_a = edge.data) == null ? void 0 : _a.color;
|
|
45564
45573
|
const markerEnd = (typeDefinition == null ? void 0 : typeDefinition.directed) !== false ? {
|
|
45565
45574
|
type: react_1.MarkerType.ArrowClosed,
|
|
45566
|
-
color: (typeDefinition == null ? void 0 : typeDefinition.color) || "#888",
|
|
45575
|
+
color: edgeColor || (typeDefinition == null ? void 0 : typeDefinition.color) || "#888",
|
|
45567
45576
|
width: 20,
|
|
45568
45577
|
height: 20
|
|
45569
45578
|
} : void 0;
|
|
@@ -45813,20 +45822,13 @@ function requireNodeInfoPanel() {
|
|
|
45813
45822
|
"GitPullRequest"
|
|
45814
45823
|
];
|
|
45815
45824
|
const NodeInfoPanel$1 = ({ node, typeDefinition, availableNodeTypes, onClose, onDelete, onUpdate }) => {
|
|
45816
|
-
var _a, _b, _c, _d, _e2, _f, _g;
|
|
45825
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i;
|
|
45817
45826
|
const color = (typeDefinition == null ? void 0 : typeDefinition.color) || "#888";
|
|
45818
45827
|
const canEdit = Boolean(onUpdate);
|
|
45819
|
-
const [editingName, setEditingName] = (0, react_1.useState)(false);
|
|
45820
|
-
const [nameValue, setNameValue] = (0, react_1.useState)("");
|
|
45821
45828
|
const [showIconPicker, setShowIconPicker] = (0, react_1.useState)(false);
|
|
45829
|
+
const [showDetails, setShowDetails] = (0, react_1.useState)(false);
|
|
45822
45830
|
const currentIcon = ((_a = node.data) == null ? void 0 : _a.icon) || (typeDefinition == null ? void 0 : typeDefinition.icon);
|
|
45823
45831
|
const nameField = (typeDefinition == null ? void 0 : typeDefinition.dataSchema) ? (_b = Object.entries(typeDefinition.dataSchema).find(([, schema2]) => schema2.displayInLabel)) == null ? void 0 : _b[0] : null;
|
|
45824
|
-
(0, react_1.useEffect)(() => {
|
|
45825
|
-
var _a2;
|
|
45826
|
-
if (nameField && ((_a2 = node.data) == null ? void 0 : _a2[nameField])) {
|
|
45827
|
-
setNameValue(String(node.data[nameField]));
|
|
45828
|
-
}
|
|
45829
|
-
}, [node.id, nameField, node.data]);
|
|
45830
45832
|
const displayFields = (typeDefinition == null ? void 0 : typeDefinition.dataSchema) ? Object.entries(typeDefinition.dataSchema).filter(([, schema2]) => schema2.displayInLabel).map(([field]) => {
|
|
45831
45833
|
var _a2;
|
|
45832
45834
|
return {
|
|
@@ -45836,16 +45838,8 @@ function requireNodeInfoPanel() {
|
|
|
45836
45838
|
};
|
|
45837
45839
|
}) : [];
|
|
45838
45840
|
const hasSchemaFields = displayFields.length > 0;
|
|
45839
|
-
const nodeDataEntries = node.data ? Object.entries(node.data).filter(([key]) =>
|
|
45840
|
-
const
|
|
45841
|
-
var _a2;
|
|
45842
|
-
if (onUpdate && nameField && nameValue !== ((_a2 = node.data) == null ? void 0 : _a2[nameField])) {
|
|
45843
|
-
onUpdate(node.id, {
|
|
45844
|
-
data: { ...node.data, [nameField]: nameValue }
|
|
45845
|
-
});
|
|
45846
|
-
}
|
|
45847
|
-
setEditingName(false);
|
|
45848
|
-
};
|
|
45841
|
+
const nodeDataEntries = node.data ? Object.entries(node.data).filter(([key]) => !["icon", "name", "description", "sources"].includes(key)) : [];
|
|
45842
|
+
const sources = ((_c = node.data) == null ? void 0 : _c.sources) || [];
|
|
45849
45843
|
const handleTypeChange = (newType) => {
|
|
45850
45844
|
if (onUpdate && newType !== node.type) {
|
|
45851
45845
|
onUpdate(node.id, { type: newType });
|
|
@@ -45877,7 +45871,7 @@ function requireNodeInfoPanel() {
|
|
|
45877
45871
|
marginBottom: "12px",
|
|
45878
45872
|
paddingBottom: "8px",
|
|
45879
45873
|
borderBottom: `2px solid ${color}`
|
|
45880
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontWeight: "bold", fontSize: "14px" }, children:
|
|
45874
|
+
}, 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: {
|
|
45881
45875
|
border: "none",
|
|
45882
45876
|
background: "none",
|
|
45883
45877
|
cursor: "pointer",
|
|
@@ -45889,7 +45883,30 @@ function requireNodeInfoPanel() {
|
|
|
45889
45883
|
display: "flex",
|
|
45890
45884
|
alignItems: "center",
|
|
45891
45885
|
justifyContent: "center"
|
|
45892
|
-
}, 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: "
|
|
45886
|
+
}, 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: {
|
|
45887
|
+
fontSize: "12px",
|
|
45888
|
+
color: "#333"
|
|
45889
|
+
}, 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: {
|
|
45890
|
+
fontSize: "11px",
|
|
45891
|
+
padding: "2px 8px",
|
|
45892
|
+
backgroundColor: "#f0f0f0",
|
|
45893
|
+
borderRadius: "4px",
|
|
45894
|
+
color: "#555"
|
|
45895
|
+
}, children: source }, index2)) })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setShowDetails(!showDetails), style: {
|
|
45896
|
+
width: "100%",
|
|
45897
|
+
padding: "8px",
|
|
45898
|
+
backgroundColor: "#f5f5f5",
|
|
45899
|
+
border: "1px solid #ddd",
|
|
45900
|
+
borderRadius: "4px",
|
|
45901
|
+
cursor: "pointer",
|
|
45902
|
+
fontSize: "12px",
|
|
45903
|
+
color: "#666",
|
|
45904
|
+
display: "flex",
|
|
45905
|
+
alignItems: "center",
|
|
45906
|
+
justifyContent: "center",
|
|
45907
|
+
gap: "6px",
|
|
45908
|
+
marginBottom: showDetails ? "12px" : "0"
|
|
45909
|
+
}, 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: {
|
|
45893
45910
|
display: "flex",
|
|
45894
45911
|
alignItems: "center",
|
|
45895
45912
|
gap: "8px",
|
|
@@ -45946,38 +45963,11 @@ function requireNodeInfoPanel() {
|
|
|
45946
45963
|
}, 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: {
|
|
45947
45964
|
fontSize: "12px",
|
|
45948
45965
|
padding: "4px 8px",
|
|
45949
|
-
backgroundColor: ((
|
|
45966
|
+
backgroundColor: ((_g = (_f = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _f[node.state]) == null ? void 0 : _g.color) || "#888",
|
|
45950
45967
|
color: "white",
|
|
45951
45968
|
borderRadius: "4px",
|
|
45952
45969
|
display: "inline-block"
|
|
45953
|
-
}, children: ((
|
|
45954
|
-
if (e.key === "Enter")
|
|
45955
|
-
handleNameSave();
|
|
45956
|
-
if (e.key === "Escape")
|
|
45957
|
-
setEditingName(false);
|
|
45958
|
-
}, autoFocus: true, style: {
|
|
45959
|
-
flex: 1,
|
|
45960
|
-
fontSize: "12px",
|
|
45961
|
-
padding: "4px 8px",
|
|
45962
|
-
borderRadius: "4px",
|
|
45963
|
-
border: "1px solid #4A90E2",
|
|
45964
|
-
outline: "none"
|
|
45965
|
-
} }), (0, jsx_runtime_1.jsx)("button", { onClick: handleNameSave, style: {
|
|
45966
|
-
padding: "4px 8px",
|
|
45967
|
-
backgroundColor: "#4A90E2",
|
|
45968
|
-
color: "white",
|
|
45969
|
-
border: "none",
|
|
45970
|
-
borderRadius: "4px",
|
|
45971
|
-
cursor: "pointer",
|
|
45972
|
-
fontSize: "11px"
|
|
45973
|
-
}, children: "Save" })] }) : (0, jsx_runtime_1.jsxs)("div", { onClick: () => canEdit && setEditingName(true), style: {
|
|
45974
|
-
fontSize: "12px",
|
|
45975
|
-
padding: "4px 8px",
|
|
45976
|
-
backgroundColor: "#f5f5f5",
|
|
45977
|
-
borderRadius: "4px",
|
|
45978
|
-
cursor: canEdit ? "pointer" : "default",
|
|
45979
|
-
border: canEdit ? "1px dashed #ccc" : "none"
|
|
45980
|
-
}, 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: () => {
|
|
45970
|
+
}, 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: () => {
|
|
45981
45971
|
onDelete(node.id);
|
|
45982
45972
|
onClose();
|
|
45983
45973
|
}, style: {
|
|
@@ -46051,7 +46041,7 @@ function requireGraphRenderer() {
|
|
|
46051
46041
|
onPendingChangesChange == null ? void 0 : onPendingChangesChange(false);
|
|
46052
46042
|
}
|
|
46053
46043
|
}, [propNodes, propEdges, editStateRef, onEditStateChange, onPendingChangesChange]);
|
|
46054
|
-
const nodes =
|
|
46044
|
+
const nodes = localNodes;
|
|
46055
46045
|
const edges = editable ? localEdges : propEdges;
|
|
46056
46046
|
const checkHasChanges = (0, react_1.useCallback)((state) => {
|
|
46057
46047
|
return state.positionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
|
|
@@ -46323,6 +46313,7 @@ function requireGraphRenderer() {
|
|
|
46323
46313
|
const nodeId = stateEvent.nodeId;
|
|
46324
46314
|
const newState = stateEvent.newState;
|
|
46325
46315
|
if (nodeId && newState) {
|
|
46316
|
+
setLocalNodes((prev) => prev.map((node) => node.id === nodeId ? { ...node, state: newState } : node));
|
|
46326
46317
|
const stateToAnimation = {
|
|
46327
46318
|
processing: "pulse",
|
|
46328
46319
|
completed: "flash",
|
|
@@ -46347,8 +46338,8 @@ function requireGraphRenderer() {
|
|
|
46347
46338
|
});
|
|
46348
46339
|
}, duration);
|
|
46349
46340
|
}
|
|
46350
|
-
onEventProcessed == null ? void 0 : onEventProcessed(latestEvent);
|
|
46351
46341
|
}
|
|
46342
|
+
onEventProcessed == null ? void 0 : onEventProcessed(latestEvent);
|
|
46352
46343
|
}
|
|
46353
46344
|
}
|
|
46354
46345
|
if (latestEvent.category === "node" && latestEvent.operation === "create") {
|