@industry-theme/principal-view-panels 0.1.1 → 0.1.2
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 +41 -39
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +3 -3
package/dist/panels.bundle.js
CHANGED
|
@@ -8892,19 +8892,19 @@ class ConfigurationLoader {
|
|
|
8892
8892
|
this.fsAdapter = fsAdapter;
|
|
8893
8893
|
}
|
|
8894
8894
|
/**
|
|
8895
|
-
* Check if the .
|
|
8895
|
+
* Check if the .principal-views/ configuration directory exists
|
|
8896
8896
|
*
|
|
8897
8897
|
* @param baseDir - Base directory to search from
|
|
8898
|
-
* @returns True if .
|
|
8898
|
+
* @returns True if .principal-views/ directory exists
|
|
8899
8899
|
*/
|
|
8900
8900
|
hasConfigDirectory(baseDir) {
|
|
8901
8901
|
const configPath = this.fsAdapter.join(baseDir, ConfigurationLoader.CONFIG_DIR);
|
|
8902
8902
|
return this.fsAdapter.exists(configPath) && this.fsAdapter.isDirectory(configPath);
|
|
8903
8903
|
}
|
|
8904
8904
|
/**
|
|
8905
|
-
* List all available configuration names in .
|
|
8905
|
+
* List all available configuration names in .principal-views/ folder
|
|
8906
8906
|
*
|
|
8907
|
-
* @param baseDir - Base directory containing .
|
|
8907
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
8908
8908
|
* @returns Array of configuration names (without extensions)
|
|
8909
8909
|
*/
|
|
8910
8910
|
listConfigurations(baseDir) {
|
|
@@ -8919,7 +8919,7 @@ class ConfigurationLoader {
|
|
|
8919
8919
|
* Load a specific configuration by name
|
|
8920
8920
|
*
|
|
8921
8921
|
* @param name - Configuration name (without extension)
|
|
8922
|
-
* @param baseDir - Base directory containing .
|
|
8922
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
8923
8923
|
* @returns Configuration file or null if not found/invalid
|
|
8924
8924
|
*/
|
|
8925
8925
|
loadByName(name, baseDir) {
|
|
@@ -8949,9 +8949,9 @@ class ConfigurationLoader {
|
|
|
8949
8949
|
return null;
|
|
8950
8950
|
}
|
|
8951
8951
|
/**
|
|
8952
|
-
* Load all configurations from .
|
|
8952
|
+
* Load all configurations from .principal-views/ folder
|
|
8953
8953
|
*
|
|
8954
|
-
* @param baseDir - Base directory containing .
|
|
8954
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
8955
8955
|
* @returns Result containing all loaded configs and any errors
|
|
8956
8956
|
*/
|
|
8957
8957
|
loadAll(baseDir) {
|
|
@@ -8961,8 +8961,8 @@ class ConfigurationLoader {
|
|
|
8961
8961
|
};
|
|
8962
8962
|
if (!this.hasConfigDirectory(baseDir)) {
|
|
8963
8963
|
result.errors.push({
|
|
8964
|
-
file: ".
|
|
8965
|
-
error: "Configuration directory .
|
|
8964
|
+
file: ".principal-views",
|
|
8965
|
+
error: "Configuration directory .principal-views/ not found"
|
|
8966
8966
|
});
|
|
8967
8967
|
return result;
|
|
8968
8968
|
}
|
|
@@ -9004,25 +9004,25 @@ class ConfigurationLoader {
|
|
|
9004
9004
|
* Get the configuration directory path
|
|
9005
9005
|
*
|
|
9006
9006
|
* @param baseDir - Base directory
|
|
9007
|
-
* @returns Full path to .
|
|
9007
|
+
* @returns Full path to .principal-views/ directory
|
|
9008
9008
|
*/
|
|
9009
9009
|
getConfigDirectoryPath(baseDir) {
|
|
9010
9010
|
return this.fsAdapter.join(baseDir, ConfigurationLoader.CONFIG_DIR);
|
|
9011
9011
|
}
|
|
9012
9012
|
}
|
|
9013
|
-
ConfigurationLoader.CONFIG_DIR = ".
|
|
9013
|
+
ConfigurationLoader.CONFIG_DIR = ".principal-views";
|
|
9014
9014
|
const DEFAULT_LIBRARY_FILES = ["library.yaml", "library.yml", "library.json"];
|
|
9015
|
-
const CONFIG_DIR = ".
|
|
9015
|
+
const CONFIG_DIR = ".principal-views";
|
|
9016
9016
|
class LibraryLoader {
|
|
9017
9017
|
constructor(fsAdapter) {
|
|
9018
9018
|
this.fsAdapter = fsAdapter;
|
|
9019
9019
|
}
|
|
9020
9020
|
/**
|
|
9021
|
-
* Load the component library from the .
|
|
9021
|
+
* Load the component library from the .principal-views/ folder
|
|
9022
9022
|
*
|
|
9023
9023
|
* Searches for library.yaml, library.yml, or library.json (in that order).
|
|
9024
9024
|
*
|
|
9025
|
-
* @param baseDir - Base directory containing .
|
|
9025
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
9026
9026
|
* @returns Library load result
|
|
9027
9027
|
*/
|
|
9028
9028
|
load(baseDir) {
|
|
@@ -9030,7 +9030,7 @@ class LibraryLoader {
|
|
|
9030
9030
|
if (!this.fsAdapter.exists(configPath) || !this.fsAdapter.isDirectory(configPath)) {
|
|
9031
9031
|
return {
|
|
9032
9032
|
success: false,
|
|
9033
|
-
error: "Configuration directory .
|
|
9033
|
+
error: "Configuration directory .principal-views/ not found",
|
|
9034
9034
|
path: configPath
|
|
9035
9035
|
};
|
|
9036
9036
|
}
|
|
@@ -9080,9 +9080,9 @@ class LibraryLoader {
|
|
|
9080
9080
|
}
|
|
9081
9081
|
}
|
|
9082
9082
|
/**
|
|
9083
|
-
* Check if a library file exists in the .
|
|
9083
|
+
* Check if a library file exists in the .principal-views/ folder
|
|
9084
9084
|
*
|
|
9085
|
-
* @param baseDir - Base directory containing .
|
|
9085
|
+
* @param baseDir - Base directory containing .principal-views/ folder
|
|
9086
9086
|
* @returns True if a library file exists
|
|
9087
9087
|
*/
|
|
9088
9088
|
hasLibrary(baseDir) {
|
|
@@ -9679,14 +9679,11 @@ function createRulesEngine(rules) {
|
|
|
9679
9679
|
return engine;
|
|
9680
9680
|
}
|
|
9681
9681
|
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"];
|
|
9682
|
+
".privurc.yaml",
|
|
9683
|
+
".privurc.yml",
|
|
9684
|
+
".privurc.json"
|
|
9685
|
+
];
|
|
9686
|
+
const DEFAULT_INCLUDE_PATTERNS = [".principal-views/**/*.yaml", ".principal-views/**/*.yml", ".principal-views/**/*.json"];
|
|
9690
9687
|
const DEFAULT_EXCLUDE_PATTERNS = ["**/node_modules/**", "**/*.test.*"];
|
|
9691
9688
|
const VALID_SEVERITIES = [
|
|
9692
9689
|
"off",
|
|
@@ -45056,7 +45053,7 @@ function requireCustomNode() {
|
|
|
45056
45053
|
const react_1 = /* @__PURE__ */ requireUmd();
|
|
45057
45054
|
const iconResolver_1 = requireIconResolver();
|
|
45058
45055
|
const CustomNode$1 = ({ data, selected }) => {
|
|
45059
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k;
|
|
45056
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o2;
|
|
45060
45057
|
const nodeProps = data;
|
|
45061
45058
|
const { typeDefinition, state, hasViolations, data: nodeData, animationType, animationDuration = 1e3, editable = false } = nodeProps;
|
|
45062
45059
|
if (!typeDefinition) {
|
|
@@ -45064,14 +45061,15 @@ function requireCustomNode() {
|
|
|
45064
45061
|
}
|
|
45065
45062
|
const nodeDataColor = nodeData.color;
|
|
45066
45063
|
const baseColor = nodeDataColor || typeDefinition.color || "#888";
|
|
45067
|
-
const
|
|
45064
|
+
const nodeDataStates = nodeData.states;
|
|
45065
|
+
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
45066
|
const fillColor = stateColor || baseColor;
|
|
45069
45067
|
const nodeDataStroke = nodeData.stroke;
|
|
45070
45068
|
const strokeColor = nodeDataStroke || typeDefinition.stroke || fillColor;
|
|
45071
45069
|
const color = fillColor;
|
|
45072
|
-
const labelField = (
|
|
45070
|
+
const labelField = (_d = Object.entries(typeDefinition.dataSchema).find(([, schema2]) => schema2.displayInLabel)) == null ? void 0 : _d[0];
|
|
45073
45071
|
const displayLabel = labelField && nodeData[labelField] ? String(nodeData[labelField]) : nodeProps.label;
|
|
45074
|
-
const icon = nodeData.icon || state && ((_e2 = (
|
|
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;
|
|
45075
45073
|
const getAnimationClass = () => {
|
|
45076
45074
|
switch (animationType) {
|
|
45077
45075
|
case "pulse":
|
|
@@ -45155,8 +45153,8 @@ function requireCustomNode() {
|
|
|
45155
45153
|
position: "relative",
|
|
45156
45154
|
clipPath: hexagonClipPath,
|
|
45157
45155
|
backgroundColor: hasViolations ? "#D0021B" : strokeColor,
|
|
45158
|
-
width: ((
|
|
45159
|
-
height: ((
|
|
45156
|
+
width: ((_h = typeDefinition.size) == null ? void 0 : _h.width) || 120,
|
|
45157
|
+
height: ((_i = typeDefinition.size) == null ? void 0 : _i.height) || 120,
|
|
45160
45158
|
boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
|
|
45161
45159
|
transition: "all 0.2s ease"
|
|
45162
45160
|
} : {};
|
|
@@ -45221,7 +45219,7 @@ function requireCustomNode() {
|
|
|
45221
45219
|
padding: "2px 6px",
|
|
45222
45220
|
borderRadius: "4px",
|
|
45223
45221
|
textAlign: "center"
|
|
45224
|
-
}, children: ((
|
|
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: {
|
|
45225
45223
|
fontSize: "10px",
|
|
45226
45224
|
color: "#D0021B",
|
|
45227
45225
|
fontWeight: "bold"
|
|
@@ -45232,7 +45230,7 @@ function requireCustomNode() {
|
|
|
45232
45230
|
padding: "2px 6px",
|
|
45233
45231
|
borderRadius: "4px",
|
|
45234
45232
|
textAlign: "center"
|
|
45235
|
-
}, children: ((
|
|
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: {
|
|
45236
45234
|
fontSize: "10px",
|
|
45237
45235
|
color: "#D0021B",
|
|
45238
45236
|
fontWeight: "bold"
|
|
@@ -45358,7 +45356,8 @@ function requireCustomEdge() {
|
|
|
45358
45356
|
if (!typeDefinition) {
|
|
45359
45357
|
return null;
|
|
45360
45358
|
}
|
|
45361
|
-
const
|
|
45359
|
+
const edgeColor = edgeData == null ? void 0 : edgeData.color;
|
|
45360
|
+
const color = hasViolations ? "#D0021B" : edgeColor || typeDefinition.color || "#888";
|
|
45362
45361
|
const width = typeDefinition.width || 2;
|
|
45363
45362
|
const [edgePath, labelX, labelY] = (0, react_2.getBezierPath)({
|
|
45364
45363
|
sourceX,
|
|
@@ -45552,18 +45551,20 @@ function requireGraphConverter() {
|
|
|
45552
45551
|
}
|
|
45553
45552
|
function convertToXYFlowEdges(edges, configuration, violations = []) {
|
|
45554
45553
|
return edges.map((edge) => {
|
|
45554
|
+
var _a;
|
|
45555
45555
|
const typeDefinition = configuration.edgeTypes[edge.type];
|
|
45556
45556
|
if (!typeDefinition) {
|
|
45557
45557
|
console.warn(`Edge type "${edge.type}" not found in configuration for edge "${edge.id}"`);
|
|
45558
45558
|
}
|
|
45559
45559
|
const hasViolations = violations.some((v) => {
|
|
45560
|
-
var
|
|
45561
|
-
return ((
|
|
45560
|
+
var _a2;
|
|
45561
|
+
return ((_a2 = v.context) == null ? void 0 : _a2.edgeId) === edge.id;
|
|
45562
45562
|
});
|
|
45563
45563
|
const edgeWithHandles = edge;
|
|
45564
|
+
const edgeColor = (_a = edge.data) == null ? void 0 : _a.color;
|
|
45564
45565
|
const markerEnd = (typeDefinition == null ? void 0 : typeDefinition.directed) !== false ? {
|
|
45565
45566
|
type: react_1.MarkerType.ArrowClosed,
|
|
45566
|
-
color: (typeDefinition == null ? void 0 : typeDefinition.color) || "#888",
|
|
45567
|
+
color: edgeColor || (typeDefinition == null ? void 0 : typeDefinition.color) || "#888",
|
|
45567
45568
|
width: 20,
|
|
45568
45569
|
height: 20
|
|
45569
45570
|
} : void 0;
|
|
@@ -46051,7 +46052,7 @@ function requireGraphRenderer() {
|
|
|
46051
46052
|
onPendingChangesChange == null ? void 0 : onPendingChangesChange(false);
|
|
46052
46053
|
}
|
|
46053
46054
|
}, [propNodes, propEdges, editStateRef, onEditStateChange, onPendingChangesChange]);
|
|
46054
|
-
const nodes =
|
|
46055
|
+
const nodes = localNodes;
|
|
46055
46056
|
const edges = editable ? localEdges : propEdges;
|
|
46056
46057
|
const checkHasChanges = (0, react_1.useCallback)((state) => {
|
|
46057
46058
|
return state.positionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
|
|
@@ -46323,6 +46324,7 @@ function requireGraphRenderer() {
|
|
|
46323
46324
|
const nodeId = stateEvent.nodeId;
|
|
46324
46325
|
const newState = stateEvent.newState;
|
|
46325
46326
|
if (nodeId && newState) {
|
|
46327
|
+
setLocalNodes((prev) => prev.map((node) => node.id === nodeId ? { ...node, state: newState } : node));
|
|
46326
46328
|
const stateToAnimation = {
|
|
46327
46329
|
processing: "pulse",
|
|
46328
46330
|
completed: "flash",
|
|
@@ -46347,8 +46349,8 @@ function requireGraphRenderer() {
|
|
|
46347
46349
|
});
|
|
46348
46350
|
}, duration);
|
|
46349
46351
|
}
|
|
46350
|
-
onEventProcessed == null ? void 0 : onEventProcessed(latestEvent);
|
|
46351
46352
|
}
|
|
46353
|
+
onEventProcessed == null ? void 0 : onEventProcessed(latestEvent);
|
|
46352
46354
|
}
|
|
46353
46355
|
}
|
|
46354
46356
|
if (latestEvent.category === "node" && latestEvent.operation === "create") {
|