@industry-theme/principal-view-panels 0.1.18 → 0.1.19

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.
@@ -47074,7 +47074,7 @@ function requireCustomNode() {
47074
47074
  const react_1 = /* @__PURE__ */ requireUmd();
47075
47075
  const iconResolver_1 = requireIconResolver();
47076
47076
  const CustomNode$1 = ({ data, selected }) => {
47077
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o2, _p;
47077
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o2, _p, _q, _r, _s, _t2, _u;
47078
47078
  const nodeProps = data;
47079
47079
  const { typeDefinition, state, hasViolations, data: nodeData, animationType, animationDuration = 1e3, editable = false } = nodeProps;
47080
47080
  if (!typeDefinition) {
@@ -47154,10 +47154,16 @@ function requireCustomNode() {
47154
47154
  case "diamond":
47155
47155
  return {
47156
47156
  ...baseStyles,
47157
- transform: "rotate(45deg)",
47157
+ border: "none",
47158
+ // Border handled by wrapper
47159
+ clipPath: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",
47158
47160
  width: "100%",
47159
47161
  height: "100%",
47160
- padding: "8px"
47162
+ minWidth: "unset",
47163
+ minHeight: "unset",
47164
+ padding: "8px 16px",
47165
+ boxShadow: "none"
47166
+ // Shadow handled by wrapper
47161
47167
  };
47162
47168
  case "rectangle":
47163
47169
  default:
@@ -47170,7 +47176,7 @@ function requireCustomNode() {
47170
47176
  const isDiamond = typeDefinition.shape === "diamond";
47171
47177
  const isHexagon = typeDefinition.shape === "hexagon";
47172
47178
  const isCircle = typeDefinition.shape === "circle";
47173
- const keepAspectRatio = isCircle || isDiamond;
47179
+ const keepAspectRatio = isCircle;
47174
47180
  const minWidth = ((_g = typeDefinition.size) == null ? void 0 : _g.width) || 80;
47175
47181
  const minHeight = ((_h = typeDefinition.size) == null ? void 0 : _h.height) || (isCircle ? minWidth : 40);
47176
47182
  const hexagonClipPath = "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)";
@@ -47205,6 +47211,37 @@ function requireCustomNode() {
47205
47211
  fontWeight: 500,
47206
47212
  gap: "4px"
47207
47213
  } : {};
47214
+ const diamondClipPath = "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)";
47215
+ const diamondBorderWidth = 2;
47216
+ const diamondBorderStyle = isDiamond ? {
47217
+ position: "relative",
47218
+ clipPath: diamondClipPath,
47219
+ backgroundColor: hasViolations ? "#D0021B" : strokeColor,
47220
+ width: "100%",
47221
+ height: "100%",
47222
+ minWidth: ((_k = typeDefinition.size) == null ? void 0 : _k.width) || 80,
47223
+ minHeight: ((_l = typeDefinition.size) == null ? void 0 : _l.height) || 80,
47224
+ boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
47225
+ transition: "box-shadow 0.2s ease",
47226
+ boxSizing: "border-box"
47227
+ } : {};
47228
+ const diamondInnerStyle = isDiamond ? {
47229
+ position: "absolute",
47230
+ top: diamondBorderWidth,
47231
+ left: diamondBorderWidth,
47232
+ right: diamondBorderWidth,
47233
+ bottom: diamondBorderWidth,
47234
+ clipPath: diamondClipPath,
47235
+ backgroundColor: "white",
47236
+ color: "#000",
47237
+ display: "flex",
47238
+ flexDirection: "column",
47239
+ alignItems: "center",
47240
+ justifyContent: "center",
47241
+ fontSize: "12px",
47242
+ fontWeight: 500,
47243
+ gap: "4px"
47244
+ } : {};
47208
47245
  const baseHandleStyle = editable ? {
47209
47246
  background: color,
47210
47247
  width: 12,
@@ -47216,28 +47253,11 @@ function requireCustomNode() {
47216
47253
  width: 8,
47217
47254
  height: 8
47218
47255
  };
47219
- const diamondOffset = isDiamond ? "21%" : "0";
47220
- const getHandleStyle = (position) => {
47256
+ const getHandleStyle = (_position) => {
47221
47257
  if (!isDiamond && !isHexagon)
47222
47258
  return baseHandleStyle;
47223
47259
  const offsetStyle = { ...baseHandleStyle };
47224
- if (isDiamond) {
47225
- switch (position) {
47226
- case "top":
47227
- offsetStyle.top = `-${diamondOffset}`;
47228
- break;
47229
- case "bottom":
47230
- offsetStyle.bottom = `-${diamondOffset}`;
47231
- break;
47232
- case "left":
47233
- offsetStyle.left = `-${diamondOffset}`;
47234
- break;
47235
- case "right":
47236
- offsetStyle.right = `-${diamondOffset}`;
47237
- break;
47238
- }
47239
- }
47240
- if (isHexagon) {
47260
+ if (isHexagon || isDiamond) {
47241
47261
  offsetStyle.zIndex = 10;
47242
47262
  }
47243
47263
  return offsetStyle;
@@ -47248,19 +47268,29 @@ function requireCustomNode() {
47248
47268
  borderRadius: 2
47249
47269
  }, lineStyle: {
47250
47270
  borderWidth: 1
47251
- } }), (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.Bottom, id: "bottom", style: getHandleStyle("bottom") }), (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: {
47271
+ } }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Top, id: "top", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Bottom, id: "bottom", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Left, id: "left", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "target", position: react_1.Position.Right, id: "right", style: getHandleStyle() }), 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: {
47272
+ fontSize: "10px",
47273
+ backgroundColor: color,
47274
+ color: "white",
47275
+ padding: "2px 6px",
47276
+ borderRadius: "4px",
47277
+ textAlign: "center"
47278
+ }, 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: {
47279
+ fontSize: "10px",
47280
+ color: "#D0021B",
47281
+ fontWeight: "bold"
47282
+ }, children: "⚠️" })] }) }) : isDiamond ? (0, jsx_runtime_1.jsx)("div", { style: diamondBorderStyle, className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: diamondInnerStyle, 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: {
47252
47283
  fontSize: "10px",
47253
47284
  backgroundColor: color,
47254
47285
  color: "white",
47255
47286
  padding: "2px 6px",
47256
47287
  borderRadius: "4px",
47257
47288
  textAlign: "center"
47258
- }, children: ((_k = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _k.label) || ((_m = (_l = typeDefinition.states) == null ? void 0 : _l[state]) == null ? void 0 : _m.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
47289
+ }, children: ((_p = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _p.label) || ((_r = (_q = typeDefinition.states) == null ? void 0 : _q[state]) == null ? void 0 : _r.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
47259
47290
  fontSize: "10px",
47260
47291
  color: "#D0021B",
47261
47292
  fontWeight: "bold"
47262
47293
  }, children: "⚠️" })] }) }) : (0, jsx_runtime_1.jsx)("div", { style: getShapeStyles(), className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: {
47263
- ...isDiamond ? { transform: "rotate(-45deg)" } : {},
47264
47294
  ...isGroup ? { width: "100%" } : {}
47265
47295
  }, children: [isGroup ? (0, jsx_runtime_1.jsxs)("div", { style: {
47266
47296
  display: "flex",
@@ -47275,11 +47305,11 @@ function requireCustomNode() {
47275
47305
  padding: "2px 6px",
47276
47306
  borderRadius: "4px",
47277
47307
  textAlign: "center"
47278
- }, children: ((_n2 = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _n2.label) || ((_p = (_o2 = typeDefinition.states) == null ? void 0 : _o2[state]) == null ? void 0 : _p.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
47308
+ }, children: ((_s = nodeDataStates == null ? void 0 : nodeDataStates[state]) == null ? void 0 : _s.label) || ((_u = (_t2 = typeDefinition.states) == null ? void 0 : _t2[state]) == null ? void 0 : _u.label) || state }), hasViolations && (0, jsx_runtime_1.jsx)("div", { style: {
47279
47309
  fontSize: "10px",
47280
47310
  color: "#D0021B",
47281
47311
  fontWeight: "bold"
47282
- }, children: "⚠️" })] }) }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Top, id: "top-out", style: getHandleStyle("top") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Bottom, id: "bottom-out", style: getHandleStyle("bottom") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Left, id: "left-out", style: getHandleStyle("left") }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Right, id: "right-out", style: getHandleStyle("right") }), (0, jsx_runtime_1.jsx)("style", { children: `
47312
+ }, children: "⚠️" })] }) }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Top, id: "top-out", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Bottom, id: "bottom-out", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Left, id: "left-out", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)(react_1.Handle, { type: "source", position: react_1.Position.Right, id: "right-out", style: getHandleStyle() }), (0, jsx_runtime_1.jsx)("style", { children: `
47283
47313
  /* Processing pulse - continuous breathing effect */
47284
47314
  .node-pulse {
47285
47315
  animation: node-pulse ease-in-out infinite;
@@ -47349,22 +47379,6 @@ function requireCustomNode() {
47349
47379
  }
47350
47380
  }
47351
47381
 
47352
- /* Special handling for diamond shape with shake */
47353
- .node-shake[style*="rotate(45deg)"] {
47354
- animation: node-shake-diamond ease-in-out;
47355
- }
47356
-
47357
- @keyframes node-shake-diamond {
47358
- 0%, 100% {
47359
- transform: rotate(45deg) translateX(0);
47360
- }
47361
- 10%, 30%, 50%, 70%, 90% {
47362
- transform: rotate(45deg) translateX(-4px);
47363
- }
47364
- 20%, 40%, 60%, 80% {
47365
- transform: rotate(45deg) translateX(4px);
47366
- }
47367
- }
47368
47382
  ` })] });
47369
47383
  };
47370
47384
  CustomNode.CustomNode = CustomNode$1;
@@ -48962,7 +48976,7 @@ function requireGraphRenderer() {
48962
48976
  }, 100);
48963
48977
  return () => clearTimeout(timeoutId);
48964
48978
  }, [baseNodesKey, fitView]);
48965
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.ReactFlow, { nodes: xyflowNodes, edges: xyflowEdges, nodeTypes, edgeTypes, minZoom: 0.1, maxZoom: 4, defaultEdgeOptions: { type: "custom" }, onEdgeClick, onNodeClick, proOptions: { hideAttribution: true }, nodesDraggable: editable, elementsSelectable: true, nodesConnectable: editable, edgesReconnectable: editable, reconnectRadius: 25, elevateEdgesOnSelect: true, onNodesChange: handleNodesChange, onConnect: handleConnect, onReconnectStart: handleReconnectStart, onReconnect: handleReconnect, onReconnectEnd: handleReconnectEnd, onPaneClick, onSelectionChange: handleSelectionChange, panOnDrag: !editable, selectionOnDrag: editable, selectionKeyCode: null, multiSelectionKeyCode: "Shift", children: [showBackground && (0, jsx_runtime_1.jsx)(react_2.Background, { color: theme.colors.border, gap: 16, size: 1 }), showControls && (0, jsx_runtime_1.jsx)(react_2.Controls, { showZoom: true, showFitView: true, showInteractive: true }), showMinimap && (0, jsx_runtime_1.jsx)(react_2.MiniMap, { nodeColor: (node) => {
48979
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.ReactFlow, { nodes: xyflowNodes, edges: xyflowEdges, nodeTypes, edgeTypes, minZoom: 0.1, maxZoom: 4, defaultEdgeOptions: { type: "custom" }, onEdgeClick, onNodeClick, proOptions: { hideAttribution: true }, nodesDraggable: editable, elementsSelectable: true, nodesConnectable: editable, edgesReconnectable: editable, reconnectRadius: 25, elevateEdgesOnSelect: true, onNodesChange: handleNodesChange, onConnect: handleConnect, onReconnectStart: handleReconnectStart, onReconnect: handleReconnect, onReconnectEnd: handleReconnectEnd, onPaneClick, onSelectionChange: handleSelectionChange, panOnDrag: true, selectionOnDrag: false, selectionKeyCode: editable ? "Shift" : null, multiSelectionKeyCode: "Shift", children: [showBackground && (0, jsx_runtime_1.jsx)(react_2.Background, { color: theme.colors.border, gap: 16, size: 1 }), showControls && (0, jsx_runtime_1.jsx)(react_2.Controls, { showZoom: true, showFitView: true, showInteractive: true }), showMinimap && (0, jsx_runtime_1.jsx)(react_2.MiniMap, { nodeColor: (node) => {
48966
48980
  var _a;
48967
48981
  const nodeData = node.data;
48968
48982
  return ((_a = nodeData == null ? void 0 : nodeData.typeDefinition) == null ? void 0 : _a.color) || theme.colors.secondary;
@@ -54569,7 +54583,7 @@ function handleToCanvasSide(handle) {
54569
54583
  return void 0;
54570
54584
  }
54571
54585
  function applyChangesToCanvas(canvas, changes) {
54572
- var _a, _b;
54586
+ var _a, _b, _c;
54573
54587
  const updatedCanvas = JSON.parse(JSON.stringify(canvas));
54574
54588
  for (const { nodeId, position } of changes.positionChanges) {
54575
54589
  const node = (_a = updatedCanvas.nodes) == null ? void 0 : _a.find((n) => n.id === nodeId);
@@ -54578,8 +54592,15 @@ function applyChangesToCanvas(canvas, changes) {
54578
54592
  node.y = Math.round(position.y);
54579
54593
  }
54580
54594
  }
54581
- for (const { nodeId, updates } of changes.nodeUpdates) {
54595
+ for (const { nodeId, dimensions } of changes.dimensionChanges) {
54582
54596
  const node = (_b = updatedCanvas.nodes) == null ? void 0 : _b.find((n) => n.id === nodeId);
54597
+ if (node) {
54598
+ node.width = dimensions.width;
54599
+ node.height = dimensions.height;
54600
+ }
54601
+ }
54602
+ for (const { nodeId, updates } of changes.nodeUpdates) {
54603
+ const node = (_c = updatedCanvas.nodes) == null ? void 0 : _c.find((n) => n.id === nodeId);
54583
54604
  if (node) {
54584
54605
  if (updates.type && updates.type !== nodeId) {
54585
54606
  node.id = updates.type;