@industry-theme/principal-view-panels 0.1.27 → 0.1.29
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 +26 -24
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +3 -3
package/dist/panels.bundle.js
CHANGED
|
@@ -5304,19 +5304,19 @@ class CanvasConverter {
|
|
|
5304
5304
|
* Convert a single canvas node to React Flow node
|
|
5305
5305
|
*/
|
|
5306
5306
|
static convertNode(node, canvas) {
|
|
5307
|
-
var _a, _b;
|
|
5307
|
+
var _a, _b, _c, _d;
|
|
5308
5308
|
const pv = node.pv;
|
|
5309
5309
|
const color = resolveCanvasColor(node.color);
|
|
5310
5310
|
let nodeName;
|
|
5311
5311
|
switch (node.type) {
|
|
5312
5312
|
case "text":
|
|
5313
|
-
nodeName = node.text.split("\n")[0].replace(/^#+ /, "").substring(0, 50);
|
|
5313
|
+
nodeName = ((_a = node.text) == null ? void 0 : _a.split("\n")[0].replace(/^#+ /, "").substring(0, 50)) || "Text";
|
|
5314
5314
|
break;
|
|
5315
5315
|
case "file":
|
|
5316
|
-
nodeName = node.file.split("/").pop() || node.file;
|
|
5316
|
+
nodeName = ((_b = node.file) == null ? void 0 : _b.split("/").pop()) || node.file || "File";
|
|
5317
5317
|
break;
|
|
5318
5318
|
case "link":
|
|
5319
|
-
nodeName = node.url;
|
|
5319
|
+
nodeName = node.url || "Link";
|
|
5320
5320
|
break;
|
|
5321
5321
|
case "group":
|
|
5322
5322
|
nodeName = node.label || "Group";
|
|
@@ -5328,7 +5328,7 @@ class CanvasConverter {
|
|
|
5328
5328
|
canvasType: node.type,
|
|
5329
5329
|
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
5330
5330
|
icon: pv == null ? void 0 : pv.icon,
|
|
5331
|
-
color: ((
|
|
5331
|
+
color: ((_d = (_c = pv == null ? void 0 : pv.states) == null ? void 0 : _c.idle) == null ? void 0 : _d.color) || color,
|
|
5332
5332
|
width: node.width,
|
|
5333
5333
|
height: node.height
|
|
5334
5334
|
};
|
|
@@ -5400,7 +5400,7 @@ class CanvasConverter {
|
|
|
5400
5400
|
* Convert Extended Canvas to internal NodeState/EdgeState format
|
|
5401
5401
|
*/
|
|
5402
5402
|
static canvasToGraph(canvas) {
|
|
5403
|
-
var _a, _b;
|
|
5403
|
+
var _a, _b, _c, _d, _e2;
|
|
5404
5404
|
const nodes = [];
|
|
5405
5405
|
const edges = [];
|
|
5406
5406
|
const now2 = Date.now();
|
|
@@ -5411,16 +5411,16 @@ class CanvasConverter {
|
|
|
5411
5411
|
let nodeDescription;
|
|
5412
5412
|
switch (node.type) {
|
|
5413
5413
|
case "text": {
|
|
5414
|
-
const lines = node.text.split("\n");
|
|
5415
|
-
nodeName = lines[0].replace(/^#+ /, "").substring(0, 50);
|
|
5414
|
+
const lines = ((_a = node.text) == null ? void 0 : _a.split("\n")) || [];
|
|
5415
|
+
nodeName = ((_b = lines[0]) == null ? void 0 : _b.replace(/^#+ /, "").substring(0, 50)) || "Text";
|
|
5416
5416
|
nodeDescription = lines.slice(1).join("\n").trim() || void 0;
|
|
5417
5417
|
break;
|
|
5418
5418
|
}
|
|
5419
5419
|
case "file":
|
|
5420
|
-
nodeName = node.file.split("/").pop() || node.file;
|
|
5420
|
+
nodeName = ((_c = node.file) == null ? void 0 : _c.split("/").pop()) || node.file || "File";
|
|
5421
5421
|
break;
|
|
5422
5422
|
case "link":
|
|
5423
|
-
nodeName = node.url;
|
|
5423
|
+
nodeName = node.url || "Link";
|
|
5424
5424
|
break;
|
|
5425
5425
|
case "group":
|
|
5426
5426
|
nodeName = node.label || "Group";
|
|
@@ -5465,7 +5465,7 @@ class CanvasConverter {
|
|
|
5465
5465
|
if (canvas.edges) {
|
|
5466
5466
|
for (const edge of canvas.edges) {
|
|
5467
5467
|
const pv = edge.pv;
|
|
5468
|
-
const edgeTypeDef = (pv == null ? void 0 : pv.edgeType) ? (
|
|
5468
|
+
const edgeTypeDef = (pv == null ? void 0 : pv.edgeType) ? (_e2 = (_d = canvas.pv) == null ? void 0 : _d.edgeTypes) == null ? void 0 : _e2[pv.edgeType] : void 0;
|
|
5469
5469
|
edges.push({
|
|
5470
5470
|
id: edge.id,
|
|
5471
5471
|
type: (pv == null ? void 0 : pv.edgeType) || "default",
|
|
@@ -47093,7 +47093,7 @@ function requireCustomNode() {
|
|
|
47093
47093
|
const react_1 = /* @__PURE__ */ requireUmd();
|
|
47094
47094
|
const iconResolver_1 = requireIconResolver();
|
|
47095
47095
|
const CustomNode$1 = ({ data, selected }) => {
|
|
47096
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o2
|
|
47096
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o2;
|
|
47097
47097
|
const nodeProps = data;
|
|
47098
47098
|
const { typeDefinition, state, hasViolations, data: nodeData, animationType, animationDuration = 1e3, editable = false } = nodeProps;
|
|
47099
47099
|
if (!typeDefinition) {
|
|
@@ -47126,7 +47126,6 @@ function requireCustomNode() {
|
|
|
47126
47126
|
const animationClass = getAnimationClass();
|
|
47127
47127
|
const isGroup = nodeData.canvasType === "group";
|
|
47128
47128
|
const getShapeStyles = () => {
|
|
47129
|
-
var _a2, _b2;
|
|
47130
47129
|
const baseStyles = {
|
|
47131
47130
|
padding: "12px 16px",
|
|
47132
47131
|
backgroundColor: isGroup ? "rgba(255, 255, 255, 0.7)" : "white",
|
|
@@ -47137,8 +47136,9 @@ function requireCustomNode() {
|
|
|
47137
47136
|
// Use 100% width/height to fill the node container (for resizing support)
|
|
47138
47137
|
width: "100%",
|
|
47139
47138
|
height: "100%",
|
|
47140
|
-
|
|
47141
|
-
|
|
47139
|
+
// Use small absolute minimums - typeDefinition.size is the default, not the minimum
|
|
47140
|
+
minWidth: 20,
|
|
47141
|
+
minHeight: 20,
|
|
47142
47142
|
display: "flex",
|
|
47143
47143
|
flexDirection: "column",
|
|
47144
47144
|
alignItems: "center",
|
|
@@ -47196,8 +47196,8 @@ function requireCustomNode() {
|
|
|
47196
47196
|
const isHexagon = typeDefinition.shape === "hexagon";
|
|
47197
47197
|
const isCircle = typeDefinition.shape === "circle";
|
|
47198
47198
|
const keepAspectRatio = isCircle;
|
|
47199
|
-
const minWidth =
|
|
47200
|
-
const minHeight =
|
|
47199
|
+
const minWidth = 40;
|
|
47200
|
+
const minHeight = isCircle ? 40 : 30;
|
|
47201
47201
|
const hexagonClipPath = "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)";
|
|
47202
47202
|
const hexagonBorderWidth = 2;
|
|
47203
47203
|
const hexagonBorderStyle = isHexagon ? {
|
|
@@ -47207,8 +47207,9 @@ function requireCustomNode() {
|
|
|
47207
47207
|
// Use 100% to fill container for resizing support
|
|
47208
47208
|
width: "100%",
|
|
47209
47209
|
height: "100%",
|
|
47210
|
-
|
|
47211
|
-
|
|
47210
|
+
// Use small absolute minimums - typeDefinition.size is the default, not the minimum
|
|
47211
|
+
minWidth: 20,
|
|
47212
|
+
minHeight: 20,
|
|
47212
47213
|
boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
|
|
47213
47214
|
transition: "box-shadow 0.2s ease",
|
|
47214
47215
|
boxSizing: "border-box"
|
|
@@ -47238,8 +47239,9 @@ function requireCustomNode() {
|
|
|
47238
47239
|
backgroundColor: hasViolations ? "#D0021B" : strokeColor,
|
|
47239
47240
|
width: "100%",
|
|
47240
47241
|
height: "100%",
|
|
47241
|
-
|
|
47242
|
-
|
|
47242
|
+
// Use small absolute minimums - typeDefinition.size is the default, not the minimum
|
|
47243
|
+
minWidth: 20,
|
|
47244
|
+
minHeight: 20,
|
|
47243
47245
|
boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
|
|
47244
47246
|
transition: "box-shadow 0.2s ease",
|
|
47245
47247
|
boxSizing: "border-box"
|
|
@@ -47296,7 +47298,7 @@ function requireCustomNode() {
|
|
|
47296
47298
|
padding: "2px 6px",
|
|
47297
47299
|
borderRadius: "4px",
|
|
47298
47300
|
textAlign: "center"
|
|
47299
|
-
}, children: ((
|
|
47301
|
+
}, children: ((_g = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _g.label) || ((_i = (_h = typeDefinition.states) == null ? void 0 : _h[state]) == null ? void 0 : _i.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
|
|
47300
47302
|
fontSize: "10px",
|
|
47301
47303
|
color: "#D0021B",
|
|
47302
47304
|
fontWeight: "bold"
|
|
@@ -47307,7 +47309,7 @@ function requireCustomNode() {
|
|
|
47307
47309
|
padding: "2px 6px",
|
|
47308
47310
|
borderRadius: "4px",
|
|
47309
47311
|
textAlign: "center"
|
|
47310
|
-
}, children: ((
|
|
47312
|
+
}, 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: {
|
|
47311
47313
|
fontSize: "10px",
|
|
47312
47314
|
color: "#D0021B",
|
|
47313
47315
|
fontWeight: "bold"
|
|
@@ -47326,7 +47328,7 @@ function requireCustomNode() {
|
|
|
47326
47328
|
padding: "2px 6px",
|
|
47327
47329
|
borderRadius: "4px",
|
|
47328
47330
|
textAlign: "center"
|
|
47329
|
-
}, children: ((
|
|
47331
|
+
}, 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: {
|
|
47330
47332
|
fontSize: "10px",
|
|
47331
47333
|
color: "#D0021B",
|
|
47332
47334
|
fontWeight: "bold"
|