seat-editor 3.6.32 → 3.6.34

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.
@@ -193,7 +193,7 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
193
193
  // stroke="#0f172a"
194
194
  // strokeWidth={1.5}
195
195
  style: { pointerEvents: "none" } })] }), ((_a = edge.waypoints) !== null && _a !== void 0 ? _a : []).map((wp, i) => (_jsxs("g", { children: [_jsx("circle", { cx: wp.x, cy: wp.y, r: 12, fill: "transparent", style: { cursor: "grab" }, onMouseDown: (e) => onStartDragWaypoint(e, edge.id, i), onContextMenu: (e) => onRemoveWaypoint(e, edge.id, i) }), _jsx("circle", { cx: wp.x, cy: wp.y, r: isSel ? 8 : 5, fill: isSel ? "#1e1b2e" : "#0f172a", stroke: isSel ? "#a78bfa" : "#38bdf8", strokeWidth: isSel ? 2 : 1.2, style: { pointerEvents: "none" } }), _jsx("circle", { cx: wp.x, cy: wp.y, r: isSel ? 3 : 2, fill: isSel ? "#a78bfa" : "#38bdf8", style: { pointerEvents: "none" } })] }, `wp-${i}`))), isSel &&
196
- isConnectEdge &&
196
+ (isConnectEdge && !isSelectNode) &&
197
197
  allPoints.slice(0, -1).map((pt, i) => {
198
198
  var _a;
199
199
  const next = allPoints[i + 1];
@@ -204,7 +204,7 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
204
204
  if (tooClose)
205
205
  return null;
206
206
  return (_jsxs("g", { children: [_jsx("circle", { cx: mx, cy: my, r: 10, fill: "transparent", style: { cursor: "crosshair" }, onMouseDown: (e) => onInsertWaypoint(e, edge.id, i, mx, my) }), _jsx("circle", { cx: mx, cy: my, r: 4, fill: "#1e1b2e", stroke: "#a78bfa", strokeWidth: 1, strokeDasharray: "2 2", style: { pointerEvents: "none" } }), _jsx("circle", { cx: mx, cy: my, r: 1.5, fill: "#a78bfa", style: { pointerEvents: "none" } })] }, `mid-${i}`));
207
- }), isSel && isConnectEdge && (_jsxs("g", { onClick: (e) => {
207
+ }), isSel && (isConnectEdge && !isSelectNode) && (_jsxs("g", { onClick: (e) => {
208
208
  e.stopPropagation();
209
209
  onDeleteEdge(edge.id);
210
210
  }, style: { cursor: "pointer" }, children: [_jsx("rect", { x: midX - 16, y: midY - 10, width: 32, height: 18, rx: 4, fill: "#1e1b2e", stroke: "#a78bfa", strokeWidth: 1, opacity: 0.95 }), _jsx("text", { x: midX, y: midY, textAnchor: "middle", dominantBaseline: "middle", fill: "#a78bfa", fontSize: 9, fontFamily: "monospace", fontWeight: 600, children: "DEL" })] }))] }, edge.id));
@@ -289,7 +289,7 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
289
289
 
290
290
  {/* Midpoint insert handles */}
291
291
  {isSel &&
292
- isConnectEdge &&
292
+ (isConnectEdge && !isSelectNode) &&
293
293
  allPoints.slice(0, -1).map((pt, i) => {
294
294
  var _a;
295
295
  const next = allPoints[i + 1];
@@ -307,7 +307,7 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
307
307
  })}
308
308
 
309
309
  {/* DEL badge */}
310
- {isSel && isConnectEdge && (<g onClick={(e) => {
310
+ {isSel && (isConnectEdge && !isSelectNode) && (<g onClick={(e) => {
311
311
  e.stopPropagation();
312
312
  onDeleteEdge(edge.id);
313
313
  }} style={{ cursor: "pointer" }}>
@@ -120,7 +120,7 @@ export interface LayerViewProps<TMeta = undefined> {
120
120
  key: string;
121
121
  value: string | number;
122
122
  };
123
- onTableMainConnection?: (id: string) => void;
123
+ onTableMainConnection?: (id: string | null) => void;
124
124
  }
125
125
  declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
126
126
  export default LayerView;
@@ -651,6 +651,7 @@ const LayerView = (props) => {
651
651
  tableMatchKey,
652
652
  statusKey,
653
653
  initialEdges: props === null || props === void 0 ? void 0 : props.initialEdges,
654
+ onTableMainConnection: props === null || props === void 0 ? void 0 : props.onTableMainConnection
654
655
  });
655
656
  // ─── Render ───────────────────────────────────────────────────────────────
656
657
  const hasBoundingBox = hasBoundingBoxRef.current;
@@ -650,6 +650,7 @@ const LayerView = (props) => {
650
650
  tableMatchKey,
651
651
  statusKey,
652
652
  initialEdges: props === null || props === void 0 ? void 0 : props.initialEdges,
653
+ onTableMainConnection: props === null || props === void 0 ? void 0 : props.onTableMainConnection
653
654
  });
654
655
  // ─── Render ───────────────────────────────────────────────────────────────
655
656
  const hasBoundingBox = hasBoundingBoxRef.current;
@@ -13,8 +13,9 @@ export type UseConnectionGraphOptions = {
13
13
  statusKey?: string;
14
14
  showConnection?: boolean;
15
15
  initialEdges?: EdgeType[];
16
+ onTableMainConnection?: (id: string | null) => void;
16
17
  };
17
- export declare const useConnectionGraph: ({ svgRef, onEdgesChange, keyNode, mappingKey, initialEdges, }: UseConnectionGraphOptions) => {
18
+ export declare const useConnectionGraph: ({ svgRef, onEdgesChange, keyNode, mappingKey, initialEdges, onTableMainConnection }: UseConnectionGraphOptions) => {
18
19
  edges: EdgeType[];
19
20
  setEdges: React.Dispatch<React.SetStateAction<EdgeType[]>>;
20
21
  selectedEdge: string;
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { rotatePoint, snap } from "./utils";
4
4
  import { useAppSelector } from "../../hooks/use-redux";
5
5
  import { isEqual } from "lodash";
6
- export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey, initialEdges, }) => {
6
+ export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey, initialEdges, onTableMainConnection }) => {
7
7
  const components = useAppSelector((state) => state.board.components);
8
8
  const [edges, setEdges] = useState([]);
9
9
  const [selectedEdge, setSelectedEdge] = useState(null);
@@ -47,6 +47,7 @@ export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey,
47
47
  fromPos: connecting.fromPos,
48
48
  toPos,
49
49
  waypoints: [],
50
+ status: 1
50
51
  },
51
52
  ];
52
53
  });
@@ -152,6 +153,7 @@ export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey,
152
153
  cancelDragAnchor();
153
154
  clearSelection();
154
155
  clearSelectionNode();
156
+ onTableMainConnection(null);
155
157
  }
156
158
  };
157
159
  window.addEventListener("keydown", onKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.6.32",
3
+ "version": "3.6.34",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",