@industry-theme/principal-view-panels 0.1.17 → 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;
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) {
@@ -47107,7 +47107,7 @@ function requireCustomNode() {
47107
47107
  const animationClass = getAnimationClass();
47108
47108
  const isGroup = nodeData.canvasType === "group";
47109
47109
  const getShapeStyles = () => {
47110
- var _a2, _b2, _c2, _d2, _e3;
47110
+ var _a2, _b2;
47111
47111
  const baseStyles = {
47112
47112
  padding: "12px 16px",
47113
47113
  backgroundColor: isGroup ? "rgba(255, 255, 255, 0.7)" : "white",
@@ -47115,6 +47115,9 @@ function requireCustomNode() {
47115
47115
  border: `2px solid ${hasViolations ? "#D0021B" : strokeColor}`,
47116
47116
  fontSize: "12px",
47117
47117
  fontWeight: 500,
47118
+ // Use 100% width/height to fill the node container (for resizing support)
47119
+ width: "100%",
47120
+ height: "100%",
47118
47121
  minWidth: ((_a2 = typeDefinition.size) == null ? void 0 : _a2.width) || 80,
47119
47122
  minHeight: ((_b2 = typeDefinition.size) == null ? void 0 : _b2.height) || 40,
47120
47123
  display: "flex",
@@ -47123,16 +47126,15 @@ function requireCustomNode() {
47123
47126
  justifyContent: isGroup ? "flex-start" : "center",
47124
47127
  gap: "4px",
47125
47128
  boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
47126
- transition: "all 0.2s ease",
47127
- animationDuration: animationType ? `${animationDuration}ms` : void 0
47129
+ transition: "box-shadow 0.2s ease",
47130
+ animationDuration: animationType ? `${animationDuration}ms` : void 0,
47131
+ boxSizing: "border-box"
47128
47132
  };
47129
47133
  switch (typeDefinition.shape) {
47130
47134
  case "circle":
47131
47135
  return {
47132
47136
  ...baseStyles,
47133
47137
  borderRadius: "50%",
47134
- width: ((_c2 = typeDefinition.size) == null ? void 0 : _c2.width) || 80,
47135
- height: ((_d2 = typeDefinition.size) == null ? void 0 : _d2.height) || 80,
47136
47138
  padding: "8px"
47137
47139
  };
47138
47140
  case "hexagon":
@@ -47150,13 +47152,18 @@ function requireCustomNode() {
47150
47152
  // Shadow handled by wrapper
47151
47153
  };
47152
47154
  case "diamond":
47153
- const diamondSize = ((_e3 = typeDefinition.size) == null ? void 0 : _e3.width) || 70;
47154
47155
  return {
47155
47156
  ...baseStyles,
47156
- transform: "rotate(45deg)",
47157
- width: diamondSize,
47158
- height: diamondSize,
47159
- padding: "8px"
47157
+ border: "none",
47158
+ // Border handled by wrapper
47159
+ clipPath: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",
47160
+ width: "100%",
47161
+ height: "100%",
47162
+ minWidth: "unset",
47163
+ minHeight: "unset",
47164
+ padding: "8px 16px",
47165
+ boxShadow: "none"
47166
+ // Shadow handled by wrapper
47160
47167
  };
47161
47168
  case "rectangle":
47162
47169
  default:
@@ -47168,16 +47175,24 @@ function requireCustomNode() {
47168
47175
  };
47169
47176
  const isDiamond = typeDefinition.shape === "diamond";
47170
47177
  const isHexagon = typeDefinition.shape === "hexagon";
47178
+ const isCircle = typeDefinition.shape === "circle";
47179
+ const keepAspectRatio = isCircle;
47180
+ const minWidth = ((_g = typeDefinition.size) == null ? void 0 : _g.width) || 80;
47181
+ const minHeight = ((_h = typeDefinition.size) == null ? void 0 : _h.height) || (isCircle ? minWidth : 40);
47171
47182
  const hexagonClipPath = "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)";
47172
47183
  const hexagonBorderWidth = 2;
47173
47184
  const hexagonBorderStyle = isHexagon ? {
47174
47185
  position: "relative",
47175
47186
  clipPath: hexagonClipPath,
47176
47187
  backgroundColor: hasViolations ? "#D0021B" : strokeColor,
47177
- width: ((_g = typeDefinition.size) == null ? void 0 : _g.width) || 120,
47178
- height: ((_h = typeDefinition.size) == null ? void 0 : _h.height) || 120,
47188
+ // Use 100% to fill container for resizing support
47189
+ width: "100%",
47190
+ height: "100%",
47191
+ minWidth: ((_i = typeDefinition.size) == null ? void 0 : _i.width) || 120,
47192
+ minHeight: ((_j = typeDefinition.size) == null ? void 0 : _j.height) || 120,
47179
47193
  boxShadow: selected ? `0 0 0 2px ${strokeColor}` : "0 2px 4px rgba(0,0,0,0.1)",
47180
- transition: "all 0.2s ease"
47194
+ transition: "box-shadow 0.2s ease",
47195
+ boxSizing: "border-box"
47181
47196
  } : {};
47182
47197
  const hexagonInnerStyle = isHexagon ? {
47183
47198
  position: "absolute",
@@ -47196,6 +47211,37 @@ function requireCustomNode() {
47196
47211
  fontWeight: 500,
47197
47212
  gap: "4px"
47198
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
+ } : {};
47199
47245
  const baseHandleStyle = editable ? {
47200
47246
  background: color,
47201
47247
  width: 12,
@@ -47207,45 +47253,44 @@ function requireCustomNode() {
47207
47253
  width: 8,
47208
47254
  height: 8
47209
47255
  };
47210
- const diamondOffset = isDiamond ? "21%" : "0";
47211
- const getHandleStyle = (position) => {
47256
+ const getHandleStyle = (_position) => {
47212
47257
  if (!isDiamond && !isHexagon)
47213
47258
  return baseHandleStyle;
47214
47259
  const offsetStyle = { ...baseHandleStyle };
47215
- if (isDiamond) {
47216
- switch (position) {
47217
- case "top":
47218
- offsetStyle.top = `-${diamondOffset}`;
47219
- break;
47220
- case "bottom":
47221
- offsetStyle.bottom = `-${diamondOffset}`;
47222
- break;
47223
- case "left":
47224
- offsetStyle.left = `-${diamondOffset}`;
47225
- break;
47226
- case "right":
47227
- offsetStyle.right = `-${diamondOffset}`;
47228
- break;
47229
- }
47230
- }
47231
- if (isHexagon) {
47260
+ if (isHexagon || isDiamond) {
47232
47261
  offsetStyle.zIndex = 10;
47233
47262
  }
47234
47263
  return offsetStyle;
47235
47264
  };
47236
- 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.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: {
47265
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [editable && (0, jsx_runtime_1.jsx)(react_1.NodeResizer, { color: strokeColor, isVisible: selected, minWidth, minHeight, keepAspectRatio, handleStyle: {
47266
+ width: 8,
47267
+ height: 8,
47268
+ borderRadius: 2
47269
+ }, lineStyle: {
47270
+ borderWidth: 1
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: {
47237
47283
  fontSize: "10px",
47238
47284
  backgroundColor: color,
47239
47285
  color: "white",
47240
47286
  padding: "2px 6px",
47241
47287
  borderRadius: "4px",
47242
47288
  textAlign: "center"
47243
- }, 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: {
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: {
47244
47290
  fontSize: "10px",
47245
47291
  color: "#D0021B",
47246
47292
  fontWeight: "bold"
47247
47293
  }, children: "⚠️" })] }) }) : (0, jsx_runtime_1.jsx)("div", { style: getShapeStyles(), className: animationClass, children: (0, jsx_runtime_1.jsxs)("div", { style: {
47248
- ...isDiamond ? { transform: "rotate(-45deg)" } : {},
47249
47294
  ...isGroup ? { width: "100%" } : {}
47250
47295
  }, children: [isGroup ? (0, jsx_runtime_1.jsxs)("div", { style: {
47251
47296
  display: "flex",
@@ -47260,11 +47305,11 @@ function requireCustomNode() {
47260
47305
  padding: "2px 6px",
47261
47306
  borderRadius: "4px",
47262
47307
  textAlign: "center"
47263
- }, 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: {
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: {
47264
47309
  fontSize: "10px",
47265
47310
  color: "#D0021B",
47266
47311
  fontWeight: "bold"
47267
- }, 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: `
47268
47313
  /* Processing pulse - continuous breathing effect */
47269
47314
  .node-pulse {
47270
47315
  animation: node-pulse ease-in-out infinite;
@@ -47334,22 +47379,6 @@ function requireCustomNode() {
47334
47379
  }
47335
47380
  }
47336
47381
 
47337
- /* Special handling for diamond shape with shake */
47338
- .node-shake[style*="rotate(45deg)"] {
47339
- animation: node-shake-diamond ease-in-out;
47340
- }
47341
-
47342
- @keyframes node-shake-diamond {
47343
- 0%, 100% {
47344
- transform: rotate(45deg) translateX(0);
47345
- }
47346
- 10%, 30%, 50%, 70%, 90% {
47347
- transform: rotate(45deg) translateX(-4px);
47348
- }
47349
- 20%, 40%, 60%, 80% {
47350
- transform: rotate(45deg) translateX(4px);
47351
- }
47352
- }
47353
47382
  ` })] });
47354
47383
  };
47355
47384
  CustomNode.CustomNode = CustomNode$1;
@@ -48170,6 +48199,182 @@ function requireNodeInfoPanel() {
48170
48199
  NodeInfoPanel.NodeInfoPanel = NodeInfoPanel$1;
48171
48200
  return NodeInfoPanel;
48172
48201
  }
48202
+ var SelectionSidebar = {};
48203
+ var hasRequiredSelectionSidebar;
48204
+ function requireSelectionSidebar() {
48205
+ if (hasRequiredSelectionSidebar) return SelectionSidebar;
48206
+ hasRequiredSelectionSidebar = 1;
48207
+ Object.defineProperty(SelectionSidebar, "__esModule", { value: true });
48208
+ SelectionSidebar.SelectionSidebar = void 0;
48209
+ const jsx_runtime_1 = require$$0;
48210
+ const react_1 = React2;
48211
+ const industry_theme_1 = requireCjs();
48212
+ const iconResolver_1 = requireIconResolver();
48213
+ const SelectionSidebar$1 = ({ selectedNodeIds, nodes, nodeTypeDefinitions, onClose }) => {
48214
+ const { theme } = (0, industry_theme_1.useTheme)();
48215
+ const [expandedNodes, setExpandedNodes] = (0, react_1.useState)({});
48216
+ const selectedNodes = nodes.filter((n) => selectedNodeIds.has(n.id));
48217
+ const toggleExpanded = (nodeId) => {
48218
+ setExpandedNodes((prev) => ({
48219
+ ...prev,
48220
+ [nodeId]: !prev[nodeId]
48221
+ }));
48222
+ };
48223
+ const internalFields = [
48224
+ "icon",
48225
+ "name",
48226
+ "description",
48227
+ "sources",
48228
+ "color",
48229
+ "stroke",
48230
+ "width",
48231
+ "height",
48232
+ "canvasType",
48233
+ "text",
48234
+ "file",
48235
+ "url",
48236
+ "shape",
48237
+ "states",
48238
+ "actions",
48239
+ "nodeType"
48240
+ ];
48241
+ return (0, jsx_runtime_1.jsxs)("div", { style: {
48242
+ position: "absolute",
48243
+ top: "60px",
48244
+ right: "20px",
48245
+ backgroundColor: theme.colors.background,
48246
+ color: theme.colors.text,
48247
+ borderRadius: "8px",
48248
+ boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
48249
+ padding: "16px",
48250
+ minWidth: "280px",
48251
+ maxWidth: "350px",
48252
+ maxHeight: "calc(100vh - 120px)",
48253
+ overflowY: "auto",
48254
+ zIndex: 1e3,
48255
+ border: `1px solid ${theme.colors.border}`
48256
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
48257
+ display: "flex",
48258
+ justifyContent: "space-between",
48259
+ alignItems: "center",
48260
+ marginBottom: "12px",
48261
+ paddingBottom: "8px",
48262
+ borderBottom: `2px solid ${theme.colors.primary}`
48263
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { fontWeight: "bold", fontSize: "14px", color: theme.colors.primary }, children: [selectedNodes.length, " nodes selected"] }), (0, jsx_runtime_1.jsx)("button", { onClick: onClose, style: {
48264
+ border: "none",
48265
+ background: "none",
48266
+ cursor: "pointer",
48267
+ fontSize: "18px",
48268
+ color: theme.colors.textSecondary,
48269
+ padding: "0",
48270
+ width: "24px",
48271
+ height: "24px",
48272
+ display: "flex",
48273
+ alignItems: "center",
48274
+ justifyContent: "center"
48275
+ }, children: "x" })] }), (0, jsx_runtime_1.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: selectedNodes.map((node) => {
48276
+ var _a, _b, _c, _d, _e2, _f, _g;
48277
+ const typeDefinition = nodeTypeDefinitions[node.type];
48278
+ const nodeColor = ((_a = node.data) == null ? void 0 : _a.color) || (typeDefinition == null ? void 0 : typeDefinition.color) || theme.colors.secondary;
48279
+ const icon = ((_b = node.data) == null ? void 0 : _b.icon) || (typeDefinition == null ? void 0 : typeDefinition.icon);
48280
+ const isExpanded = expandedNodes[node.id] || false;
48281
+ const description = (_c = node.data) == null ? void 0 : _c.description;
48282
+ const dataEntries = node.data ? Object.entries(node.data).filter(([key]) => !internalFields.includes(key)) : [];
48283
+ return (0, jsx_runtime_1.jsxs)("div", { style: {
48284
+ backgroundColor: theme.colors.surface,
48285
+ borderRadius: "6px",
48286
+ border: `1px solid ${theme.colors.border}`,
48287
+ overflow: "hidden"
48288
+ }, children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => toggleExpanded(node.id), style: {
48289
+ width: "100%",
48290
+ padding: "10px 12px",
48291
+ backgroundColor: "transparent",
48292
+ border: "none",
48293
+ cursor: "pointer",
48294
+ display: "flex",
48295
+ alignItems: "flex-start",
48296
+ gap: "10px",
48297
+ textAlign: "left"
48298
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
48299
+ width: "28px",
48300
+ height: "28px",
48301
+ borderRadius: "6px",
48302
+ backgroundColor: nodeColor,
48303
+ display: "flex",
48304
+ alignItems: "center",
48305
+ justifyContent: "center",
48306
+ flexShrink: 0,
48307
+ color: "white"
48308
+ }, children: icon ? (0, iconResolver_1.resolveIcon)(icon, 16) : null }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
48309
+ fontWeight: 600,
48310
+ fontSize: "13px",
48311
+ color: theme.colors.text,
48312
+ marginBottom: description ? "2px" : 0
48313
+ }, children: node.name || node.id }), description && (0, jsx_runtime_1.jsx)("div", { style: {
48314
+ fontSize: "11px",
48315
+ color: theme.colors.textSecondary,
48316
+ overflow: "hidden",
48317
+ textOverflow: "ellipsis",
48318
+ display: "-webkit-box",
48319
+ WebkitLineClamp: isExpanded ? "unset" : 2,
48320
+ WebkitBoxOrient: "vertical"
48321
+ }, children: description })] }), (0, jsx_runtime_1.jsx)("div", { style: {
48322
+ color: theme.colors.textSecondary,
48323
+ fontSize: "10px",
48324
+ transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)",
48325
+ transition: "transform 0.2s",
48326
+ flexShrink: 0
48327
+ }, children: "▼" })] }), isExpanded && (0, jsx_runtime_1.jsxs)("div", { style: {
48328
+ padding: "0 12px 10px 12px",
48329
+ borderTop: `1px solid ${theme.colors.border}`,
48330
+ marginTop: "0"
48331
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { marginTop: "10px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
48332
+ fontSize: "10px",
48333
+ color: theme.colors.textSecondary,
48334
+ marginBottom: "4px"
48335
+ }, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: {
48336
+ fontSize: "11px",
48337
+ padding: "3px 8px",
48338
+ backgroundColor: nodeColor,
48339
+ color: "white",
48340
+ borderRadius: "4px",
48341
+ display: "inline-block"
48342
+ }, children: node.type })] }), node.state && (0, jsx_runtime_1.jsxs)("div", { style: { marginTop: "8px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
48343
+ fontSize: "10px",
48344
+ color: theme.colors.textSecondary,
48345
+ marginBottom: "4px"
48346
+ }, children: "State" }), (0, jsx_runtime_1.jsx)("div", { style: {
48347
+ fontSize: "11px",
48348
+ padding: "3px 8px",
48349
+ backgroundColor: ((_e2 = (_d = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _d[node.state]) == null ? void 0 : _e2.color) || theme.colors.secondary,
48350
+ color: "white",
48351
+ borderRadius: "4px",
48352
+ display: "inline-block"
48353
+ }, children: ((_g = (_f = typeDefinition == null ? void 0 : typeDefinition.states) == null ? void 0 : _f[node.state]) == null ? void 0 : _g.label) || node.state })] }), dataEntries.length > 0 && (0, jsx_runtime_1.jsxs)("div", { style: { marginTop: "8px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
48354
+ fontSize: "10px",
48355
+ color: theme.colors.textSecondary,
48356
+ marginBottom: "6px",
48357
+ fontWeight: "bold"
48358
+ }, children: "Properties" }), dataEntries.map(([key, value]) => (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: "6px" }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
48359
+ fontSize: "10px",
48360
+ color: theme.colors.textSecondary,
48361
+ marginBottom: "2px"
48362
+ }, children: key }), (0, jsx_runtime_1.jsx)("div", { style: {
48363
+ fontSize: "11px",
48364
+ color: theme.colors.text,
48365
+ wordBreak: "break-word"
48366
+ }, children: value !== void 0 && value !== null ? typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) : "-" })] }, key))] }), (0, jsx_runtime_1.jsxs)("div", { style: {
48367
+ fontSize: "10px",
48368
+ color: theme.colors.textMuted,
48369
+ marginTop: "8px",
48370
+ paddingTop: "6px",
48371
+ borderTop: `1px solid ${theme.colors.border}`
48372
+ }, children: ["ID: ", node.id] })] })] }, node.id);
48373
+ }) })] });
48374
+ };
48375
+ SelectionSidebar.SelectionSidebar = SelectionSidebar$1;
48376
+ return SelectionSidebar;
48377
+ }
48173
48378
  var hasRequiredGraphRenderer;
48174
48379
  function requireGraphRenderer() {
48175
48380
  if (hasRequiredGraphRenderer) return GraphRenderer;
@@ -48187,6 +48392,7 @@ function requireGraphRenderer() {
48187
48392
  const graphConverter_1 = requireGraphConverter();
48188
48393
  const EdgeInfoPanel_1 = requireEdgeInfoPanel();
48189
48394
  const NodeInfoPanel_1 = requireNodeInfoPanel();
48395
+ const SelectionSidebar_1 = requireSelectionSidebar();
48190
48396
  const nodeTypes = {
48191
48397
  custom: CustomNode_1.CustomNode
48192
48398
  };
@@ -48195,6 +48401,7 @@ function requireGraphRenderer() {
48195
48401
  };
48196
48402
  const createEmptyEditState = () => ({
48197
48403
  positionChanges: /* @__PURE__ */ new Map(),
48404
+ dimensionChanges: /* @__PURE__ */ new Map(),
48198
48405
  nodeUpdates: /* @__PURE__ */ new Map(),
48199
48406
  deletedNodeIds: /* @__PURE__ */ new Set(),
48200
48407
  createdEdges: [],
@@ -48207,8 +48414,8 @@ function requireGraphRenderer() {
48207
48414
  nodeAnimations: {},
48208
48415
  edgeAnimations: {}
48209
48416
  });
48210
- const [selectedEdgeId, setSelectedEdgeId] = (0, react_1.useState)(null);
48211
- const [selectedNodeId, setSelectedNodeId] = (0, react_1.useState)(null);
48417
+ const [selectedEdgeIds, setSelectedEdgeIds] = (0, react_1.useState)(/* @__PURE__ */ new Set());
48418
+ const [selectedNodeIds, setSelectedNodeIds] = (0, react_1.useState)(/* @__PURE__ */ new Set());
48212
48419
  const [pendingConnection, setPendingConnection] = (0, react_1.useState)(null);
48213
48420
  const [localNodes, setLocalNodes] = (0, react_1.useState)(propNodes);
48214
48421
  const [localEdges, setLocalEdges] = (0, react_1.useState)(propEdges);
@@ -48230,7 +48437,7 @@ function requireGraphRenderer() {
48230
48437
  const nodes = localNodes;
48231
48438
  const edges = editable ? localEdges : propEdges;
48232
48439
  const checkHasChanges = (0, react_1.useCallback)((state) => {
48233
- return state.positionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
48440
+ return state.positionChanges.size > 0 || state.dimensionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
48234
48441
  }, []);
48235
48442
  const updateEditState = (0, react_1.useCallback)((updater) => {
48236
48443
  const newState = updater(editStateRef.current);
@@ -48238,16 +48445,50 @@ function requireGraphRenderer() {
48238
48445
  onEditStateChange == null ? void 0 : onEditStateChange(newState);
48239
48446
  onPendingChangesChange == null ? void 0 : onPendingChangesChange(checkHasChanges(newState));
48240
48447
  }, [editStateRef, onEditStateChange, onPendingChangesChange, checkHasChanges]);
48241
- const onEdgeClick = (0, react_1.useCallback)((_event, edge) => {
48242
- setSelectedEdgeId((prev) => prev === edge.id ? null : edge.id);
48243
- setSelectedNodeId(null);
48244
- }, []);
48245
- const onNodeClick = (0, react_1.useCallback)((_event, node) => {
48246
- setSelectedNodeId((prev) => prev === node.id ? null : node.id);
48247
- setSelectedEdgeId(null);
48248
- }, []);
48448
+ const onEdgeClick = (0, react_1.useCallback)((event, edge) => {
48449
+ if (event.shiftKey && editable) {
48450
+ setSelectedEdgeIds((prev) => {
48451
+ const next = new Set(prev);
48452
+ if (next.has(edge.id)) {
48453
+ next.delete(edge.id);
48454
+ } else {
48455
+ next.add(edge.id);
48456
+ }
48457
+ return next;
48458
+ });
48459
+ } else {
48460
+ setSelectedEdgeIds((prev) => {
48461
+ if (prev.size === 1 && prev.has(edge.id)) {
48462
+ return /* @__PURE__ */ new Set();
48463
+ }
48464
+ return /* @__PURE__ */ new Set([edge.id]);
48465
+ });
48466
+ setSelectedNodeIds(/* @__PURE__ */ new Set());
48467
+ }
48468
+ }, [editable]);
48469
+ const onNodeClick = (0, react_1.useCallback)((event, node) => {
48470
+ if (event.shiftKey && editable) {
48471
+ setSelectedNodeIds((prev) => {
48472
+ const next = new Set(prev);
48473
+ if (next.has(node.id)) {
48474
+ next.delete(node.id);
48475
+ } else {
48476
+ next.add(node.id);
48477
+ }
48478
+ return next;
48479
+ });
48480
+ } else {
48481
+ setSelectedNodeIds((prev) => {
48482
+ if (prev.size === 1 && prev.has(node.id)) {
48483
+ return /* @__PURE__ */ new Set();
48484
+ }
48485
+ return /* @__PURE__ */ new Set([node.id]);
48486
+ });
48487
+ setSelectedEdgeIds(/* @__PURE__ */ new Set());
48488
+ }
48489
+ }, [editable]);
48249
48490
  const onCloseEdgeInfoPanel = (0, react_1.useCallback)(() => {
48250
- setSelectedEdgeId(null);
48491
+ setSelectedEdgeIds(/* @__PURE__ */ new Set());
48251
48492
  }, []);
48252
48493
  const handleUpdateEdgeSides = (0, react_1.useCallback)((edgeId, fromSide, toSide) => {
48253
48494
  setLocalEdges((currentEdges) => currentEdges.map((edge) => edge.id === edgeId ? {
@@ -48260,8 +48501,18 @@ function requireGraphRenderer() {
48260
48501
  } : edge));
48261
48502
  }, []);
48262
48503
  const onCloseNodeInfoPanel = (0, react_1.useCallback)(() => {
48263
- setSelectedNodeId(null);
48504
+ setSelectedNodeIds(/* @__PURE__ */ new Set());
48264
48505
  }, []);
48506
+ const onPaneClick = (0, react_1.useCallback)(() => {
48507
+ setSelectedNodeIds(/* @__PURE__ */ new Set());
48508
+ setSelectedEdgeIds(/* @__PURE__ */ new Set());
48509
+ }, []);
48510
+ const handleSelectionChange = (0, react_1.useCallback)(({ nodes: selectedNodes, edges: selectedEdges }) => {
48511
+ if (editable) {
48512
+ setSelectedNodeIds(new Set(selectedNodes.map((n) => n.id)));
48513
+ setSelectedEdgeIds(new Set(selectedEdges.map((e) => e.id)));
48514
+ }
48515
+ }, [editable]);
48265
48516
  const handleNodeUpdate = (0, react_1.useCallback)((nodeId, updates) => {
48266
48517
  if (!editable)
48267
48518
  return;
@@ -48297,16 +48548,19 @@ function requireGraphRenderer() {
48297
48548
  newUpdates.delete(nodeId);
48298
48549
  const newPositions = new Map(prev.positionChanges);
48299
48550
  newPositions.delete(nodeId);
48551
+ const newDimensions = new Map(prev.dimensionChanges);
48552
+ newDimensions.delete(nodeId);
48300
48553
  const newCreatedEdges = prev.createdEdges.filter((e) => e.from !== nodeId && e.to !== nodeId);
48301
48554
  return {
48302
48555
  ...prev,
48303
48556
  deletedNodeIds: newDeletedNodes,
48304
48557
  nodeUpdates: newUpdates,
48305
48558
  positionChanges: newPositions,
48559
+ dimensionChanges: newDimensions,
48306
48560
  createdEdges: newCreatedEdges
48307
48561
  };
48308
48562
  });
48309
- setSelectedNodeId(null);
48563
+ setSelectedNodeIds(/* @__PURE__ */ new Set());
48310
48564
  }, [editable, updateEditState]);
48311
48565
  const handleEdgeDelete = (0, react_1.useCallback)((edgeId) => {
48312
48566
  if (!editable)
@@ -48334,7 +48588,7 @@ function requireGraphRenderer() {
48334
48588
  }
48335
48589
  return prev;
48336
48590
  });
48337
- setSelectedEdgeId(null);
48591
+ setSelectedEdgeIds(/* @__PURE__ */ new Set());
48338
48592
  }, [editable, updateEditState, localEdges]);
48339
48593
  const handleConnect = (0, react_1.useCallback)((connection) => {
48340
48594
  if (!editable || !connection.source || !connection.target)
@@ -48464,6 +48718,11 @@ function requireGraphRenderer() {
48464
48718
  const handleReconnectEnd = (0, react_1.useCallback)(() => {
48465
48719
  edgeReconnectSuccessful.current = true;
48466
48720
  }, []);
48721
+ const selectedEdgeId = (0, react_1.useMemo)(() => {
48722
+ if (selectedEdgeIds.size === 0)
48723
+ return null;
48724
+ return selectedEdgeIds.values().next().value;
48725
+ }, [selectedEdgeIds]);
48467
48726
  const selectedEdge = (0, react_1.useMemo)(() => {
48468
48727
  if (!selectedEdgeId)
48469
48728
  return null;
@@ -48474,6 +48733,11 @@ function requireGraphRenderer() {
48474
48733
  return null;
48475
48734
  return configuration.edgeTypes[selectedEdge.type];
48476
48735
  }, [selectedEdge, configuration.edgeTypes]);
48736
+ const selectedNodeId = (0, react_1.useMemo)(() => {
48737
+ if (selectedNodeIds.size === 0)
48738
+ return null;
48739
+ return selectedNodeIds.values().next().value;
48740
+ }, [selectedNodeIds]);
48477
48741
  const selectedNode = (0, react_1.useMemo)(() => {
48478
48742
  if (!selectedNodeId)
48479
48743
  return null;
@@ -48618,6 +48882,21 @@ function requireGraphRenderer() {
48618
48882
  return;
48619
48883
  setXyflowLocalNodes((nds) => (0, react_2.applyNodeChanges)(changes, nds));
48620
48884
  const positionChanges = changes.filter((change) => change.type === "position" && "position" in change && change.position !== void 0 && "dragging" in change && change.dragging === false);
48885
+ const dimensionChanges = changes.filter((change) => change.type === "dimensions" && "dimensions" in change && change.dimensions !== void 0 && "resizing" in change && change.resizing === false);
48886
+ if (dimensionChanges.length > 0) {
48887
+ updateEditState((prev) => {
48888
+ const newDimensions = new Map(prev.dimensionChanges);
48889
+ for (const change of dimensionChanges) {
48890
+ if (change.dimensions) {
48891
+ newDimensions.set(change.id, {
48892
+ width: Math.round(change.dimensions.width),
48893
+ height: Math.round(change.dimensions.height)
48894
+ });
48895
+ }
48896
+ }
48897
+ return { ...prev, dimensionChanges: newDimensions };
48898
+ });
48899
+ }
48621
48900
  if (positionChanges.length > 0) {
48622
48901
  updateEditState((prev) => {
48623
48902
  const newPositions = new Map(prev.positionChanges);
@@ -48697,11 +48976,11 @@ function requireGraphRenderer() {
48697
48976
  }, 100);
48698
48977
  return () => clearTimeout(timeoutId);
48699
48978
  }, [baseNodesKey, fitView]);
48700
- 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, panOnDrag: true, selectionOnDrag: false, 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) => {
48701
48980
  var _a;
48702
48981
  const nodeData = node.data;
48703
48982
  return ((_a = nodeData == null ? void 0 : nodeData.typeDefinition) == null ? void 0 : _a.color) || theme.colors.secondary;
48704
- }, nodeBorderRadius: 2, pannable: true, zoomable: true })] }, baseNodesKey), selectedEdge && selectedEdgeTypeDefinition && (0, jsx_runtime_1.jsx)(EdgeInfoPanel_1.EdgeInfoPanel, { edge: selectedEdge, typeDefinition: selectedEdgeTypeDefinition, sourceNodeId: selectedEdge.from, targetNodeId: selectedEdge.to, onClose: onCloseEdgeInfoPanel, onDelete: editable ? handleEdgeDelete : void 0, onUpdateSides: editable ? handleUpdateEdgeSides : void 0 }), selectedNode && selectedNodeTypeDefinition && (0, jsx_runtime_1.jsx)(NodeInfoPanel_1.NodeInfoPanel, { node: selectedNode, typeDefinition: selectedNodeTypeDefinition, availableNodeTypes: configuration.nodeTypes, onClose: onCloseNodeInfoPanel, onDelete: editable ? handleNodeDelete : void 0, onUpdate: editable ? handleNodeUpdate : void 0 }), pendingConnection && (0, jsx_runtime_1.jsxs)("div", { style: {
48983
+ }, nodeBorderRadius: 2, pannable: true, zoomable: true })] }, baseNodesKey), selectedNodeIds.size >= 2 && (0, jsx_runtime_1.jsx)(SelectionSidebar_1.SelectionSidebar, { selectedNodeIds, nodes, nodeTypeDefinitions: configuration.nodeTypes, onClose: onCloseNodeInfoPanel }), selectedEdgeIds.size === 1 && selectedEdge && selectedEdgeTypeDefinition && (0, jsx_runtime_1.jsx)(EdgeInfoPanel_1.EdgeInfoPanel, { edge: selectedEdge, typeDefinition: selectedEdgeTypeDefinition, sourceNodeId: selectedEdge.from, targetNodeId: selectedEdge.to, onClose: onCloseEdgeInfoPanel, onDelete: editable ? handleEdgeDelete : void 0, onUpdateSides: editable ? handleUpdateEdgeSides : void 0 }), selectedNodeIds.size === 1 && selectedNode && selectedNodeTypeDefinition && (0, jsx_runtime_1.jsx)(NodeInfoPanel_1.NodeInfoPanel, { node: selectedNode, typeDefinition: selectedNodeTypeDefinition, availableNodeTypes: configuration.nodeTypes, onClose: onCloseNodeInfoPanel, onDelete: editable ? handleNodeDelete : void 0, onUpdate: editable ? handleNodeUpdate : void 0 }), pendingConnection && (0, jsx_runtime_1.jsxs)("div", { style: {
48705
48984
  position: "absolute",
48706
48985
  top: "50%",
48707
48986
  left: "50%",
@@ -48874,6 +49153,10 @@ function requireGraphRenderer() {
48874
49153
  nodeId,
48875
49154
  position
48876
49155
  })),
49156
+ dimensionChanges: Array.from(state.dimensionChanges.entries()).map(([nodeId, dimensions]) => ({
49157
+ nodeId,
49158
+ dimensions
49159
+ })),
48877
49160
  nodeUpdates: Array.from(state.nodeUpdates.entries()).map(([nodeId, updates]) => ({
48878
49161
  nodeId,
48879
49162
  updates
@@ -48887,7 +49170,7 @@ function requireGraphRenderer() {
48887
49170
  targetHandle: e.targetHandle
48888
49171
  })),
48889
49172
  deletedEdges: state.deletedEdges.map((e) => ({ from: e.from, to: e.to, type: e.type })),
48890
- hasChanges: state.positionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0
49173
+ hasChanges: state.positionChanges.size > 0 || state.dimensionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0
48891
49174
  };
48892
49175
  },
48893
49176
  resetEditState: () => {
@@ -48895,7 +49178,7 @@ function requireGraphRenderer() {
48895
49178
  },
48896
49179
  hasUnsavedChanges: () => {
48897
49180
  const state = editStateRef.current;
48898
- return state.positionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
49181
+ return state.positionChanges.size > 0 || state.dimensionChanges.size > 0 || state.nodeUpdates.size > 0 || state.deletedNodeIds.size > 0 || state.createdEdges.length > 0 || state.deletedEdges.length > 0;
48899
49182
  }
48900
49183
  }), []);
48901
49184
  if (!canvasData) {
@@ -54300,7 +54583,7 @@ function handleToCanvasSide(handle) {
54300
54583
  return void 0;
54301
54584
  }
54302
54585
  function applyChangesToCanvas(canvas, changes) {
54303
- var _a, _b;
54586
+ var _a, _b, _c;
54304
54587
  const updatedCanvas = JSON.parse(JSON.stringify(canvas));
54305
54588
  for (const { nodeId, position } of changes.positionChanges) {
54306
54589
  const node = (_a = updatedCanvas.nodes) == null ? void 0 : _a.find((n) => n.id === nodeId);
@@ -54309,8 +54592,15 @@ function applyChangesToCanvas(canvas, changes) {
54309
54592
  node.y = Math.round(position.y);
54310
54593
  }
54311
54594
  }
54312
- for (const { nodeId, updates } of changes.nodeUpdates) {
54595
+ for (const { nodeId, dimensions } of changes.dimensionChanges) {
54313
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);
54314
54604
  if (node) {
54315
54605
  if (updates.type && updates.type !== nodeId) {
54316
54606
  node.id = updates.type;