sysml-diagram 0.20.2 → 0.20.3

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/out/main.js CHANGED
@@ -170103,6 +170103,9 @@ function resolveEffectiveSubject(node) {
170103
170103
 
170104
170104
  // ../language-server/out/src/messages.js
170105
170105
  var DIAGNOSTIC_MESSAGES = {
170106
+ // REQ-006 - a broad diagram anchor cannot prove which typed occurrence owns
170107
+ // a connection whose projected ports resolve to their shared definition.
170108
+ EDIT_RELATION_OWNER_AMBIGUOUS_PROJECTED_USAGE: "The relation owner is ambiguous between a type definition and a projected usage. Select the concrete occurrence or explicitly synchronize the definition before creating the connection.",
170106
170109
  // REQ-317 — expression paths diagnose the exact missing feature segment.
170107
170110
  RES001_FEATURE_PATH_SEGMENT: (segment, owner) => `Feature path segment '${segment}' does not exist on '${owner}'.`,
170108
170111
  LEX001_UNTERMINATED_STRING: `Unterminated string literal - missing closing '"'.`,
@@ -181911,19 +181914,15 @@ var OPPOSITE_DOCK_SIDE = {
181911
181914
  function portDockSides(side) {
181912
181915
  return [side, OPPOSITE_DOCK_SIDE[side]];
181913
181916
  }
181914
- var PORT_MOVE_STRIP_ACROSS = 10;
181915
181917
  var PORT_MOVE_STRIP_ALONG = 24;
181916
- var PORT_CONNECT_DOT_HIT = 18;
181918
+ var PORT_CONNECT_DOT_HIT = 10;
181917
181919
  function portInteractionStrip(rect, side) {
181918
181920
  const vertical = side === "left" || side === "right";
181919
- const dotHalf = PORT_CONNECT_DOT_HIT / 2;
181920
- const across = Math.max(PORT_MOVE_STRIP_ACROSS, rect.across - dotHalf);
181921
- const inward = -(rect.across - across) / 2;
181922
- const n2 = DOCK_NORMAL[side];
181921
+ const across = Math.max(1, rect.across - PORT_CONNECT_DOT_HIT);
181923
181922
  const run = Math.max(PORT_MOVE_STRIP_ALONG, rect.along);
181924
181923
  return {
181925
- cx: rect.cx + n2.x * inward,
181926
- cy: rect.cy + n2.y * inward,
181924
+ cx: rect.cx,
181925
+ cy: rect.cy,
181927
181926
  w: vertical ? across : run,
181928
181927
  h: vertical ? run : across
181929
181928
  };
@@ -183331,8 +183330,6 @@ function modelToFlow(model, opts) {
183331
183330
  for (const n2 of renderModelNodes) for (const p of n2.ports ?? []) portIds.add(p.id);
183332
183331
  for (const f of frames) for (const p of f.ports ?? []) portIds.add(p.id);
183333
183332
  for (const p of boundary?.ports ?? []) portIds.add(p.id);
183334
- const portSideById = /* @__PURE__ */ new Map();
183335
- for (const n2 of nodes) for (const ph of n2.data.ports ?? []) portSideById.set(ph.port.id, ph.side);
183336
183333
  const ownerOfPort = /* @__PURE__ */ new Map();
183337
183334
  for (const n2 of renderModelNodes) for (const p of n2.ports ?? []) ownerOfPort.set(p.id, n2.id);
183338
183335
  for (const f of frames) for (const p of f.ports ?? []) ownerOfPort.set(p.id, f.id);
@@ -183391,8 +183388,8 @@ function modelToFlow(model, opts) {
183391
183388
  id: e.id,
183392
183389
  source,
183393
183390
  target,
183394
- ...fromPort ? { sourceHandle: portAnchorHandleId(e.from, savedSourcePortSide ?? portSideById.get(e.from) ?? "right") } : savedSourceHandle ? { sourceHandle: savedSourceHandle } : {},
183395
- ...toPort ? { targetHandle: portAnchorHandleId(e.to, savedTargetPortSide ?? portSideById.get(e.to) ?? "left") } : savedTargetHandle ? { targetHandle: savedTargetHandle } : {},
183391
+ ...fromPort ? { sourceHandle: savedSourcePortSide ? portAnchorHandleId(e.from, savedSourcePortSide) : e.from } : savedSourceHandle ? { sourceHandle: savedSourceHandle } : {},
183392
+ ...toPort ? { targetHandle: savedTargetPortSide ? portAnchorHandleId(e.to, savedTargetPortSide) : e.to } : savedTargetHandle ? { targetHandle: savedTargetHandle } : {},
183396
183393
  type: "sysml",
183397
183394
  data: {
183398
183395
  kind: model.kind,
@@ -183411,38 +183408,6 @@ function modelToFlow(model, opts) {
183411
183408
  ...frames.length > 0 || boundary ? { zIndex: 4 } : {}
183412
183409
  });
183413
183410
  }
183414
- const frameIds = /* @__PURE__ */ new Set([...frames.map((f) => f.id), ...boundary ? [boundary.id] : []]);
183415
- const parentOf = /* @__PURE__ */ new Map();
183416
- for (const n2 of renderModelNodes) parentOf.set(
183417
- n2.id,
183418
- n2.frame ?? (model.kind === "gv" && n2.parent && gvPackageIds.has(n2.parent) ? n2.parent : void 0) ?? (boundary ? boundary.id : void 0)
183419
- );
183420
- for (const f of frames) parentOf.set(f.id, f.parent);
183421
- const isInsideFrame = (nodeId, frameId) => {
183422
- let cur = nodeId;
183423
- const seen = /* @__PURE__ */ new Set();
183424
- while (cur && !seen.has(cur)) {
183425
- if (cur === frameId) return true;
183426
- seen.add(cur);
183427
- cur = parentOf.get(cur);
183428
- }
183429
- return false;
183430
- };
183431
- const delegated = /* @__PURE__ */ new Set();
183432
- for (const e of model.edges) {
183433
- const fo = ownerOfPort.get(e.from);
183434
- const to = ownerOfPort.get(e.to);
183435
- const fromOther = to ?? e.to;
183436
- const toOther = fo ?? e.from;
183437
- if (fo && frameIds.has(fo) && fromOther !== fo && isInsideFrame(fromOther, fo)) delegated.add(e.from);
183438
- if (to && frameIds.has(to) && toOther !== to && isInsideFrame(toOther, to)) delegated.add(e.to);
183439
- }
183440
- if (delegated.size) {
183441
- for (const fn of nodes) {
183442
- const owned = (fn.data.ports ?? []).filter((ph) => delegated.has(ph.port.id)).map((ph) => ph.port.id);
183443
- if (owned.length) fn.data = { ...fn.data, delegatedPorts: owned };
183444
- }
183445
- }
183446
183411
  return { nodes, edges };
183447
183412
  }
183448
183413
 
@@ -193583,7 +193548,6 @@ function geometrySignature(nodes) {
193583
193548
  for (const p of n2.data.ports ?? []) {
193584
193549
  out += `|${p.port.id},${p.side},${p.offset},${p.along ?? ""},${p.shift?.along ?? ""},${p.shift?.across ?? ""}`;
193585
193550
  }
193586
- for (const id2 of [...n2.data.delegatedPorts ?? []].sort()) out += `|i:${id2}`;
193587
193551
  for (const d of n2.data.structuralDocks ?? []) out += `|d:${d.id},${d.side},${d.offset},${d.family}`;
193588
193552
  out += ";";
193589
193553
  }
@@ -195147,10 +195111,25 @@ function semanticPortHandle(node, handle) {
195147
195111
  if (parsed && portOnNode(node, parsed.portId)) return parsed.portId;
195148
195112
  return portOnNode(node, handle ?? void 0) ? handle ?? void 0 : void 0;
195149
195113
  }
195150
- function choosePortAnchorSide(node, portId) {
195114
+ function validConcretePortAnchor(node, handle) {
195115
+ const parsed = parsePortAnchorHandleId(handle);
195116
+ const ph = parsed ? portOnNode(node, parsed.portId) : void 0;
195117
+ return !!ph && portConnectHandleIds(ph.port.id, ph.side).includes(handle);
195118
+ }
195119
+ function isStrictDescendant(nodeId, ancestorId, byId) {
195120
+ let cur = byId.get(nodeId)?.parentId;
195121
+ const seen = /* @__PURE__ */ new Set();
195122
+ while (cur && !seen.has(cur)) {
195123
+ if (cur === ancestorId) return true;
195124
+ seen.add(cur);
195125
+ cur = byId.get(cur)?.parentId;
195126
+ }
195127
+ return false;
195128
+ }
195129
+ function inferredPortAnchorSide(node, other, portId, byId) {
195151
195130
  const ph = portOnNode(node, portId);
195152
195131
  if (!ph) return "right";
195153
- return node.data.delegatedPorts?.includes(portId) ? OPPOSITE[ph.side] : ph.side;
195132
+ return other.id === node.id || isStrictDescendant(other.id, node.id, byId) ? OPPOSITE[ph.side] : ph.side;
195154
195133
  }
195155
195134
  function assignPortAnchorSides(nodes, edges) {
195156
195135
  const byId = new Map(nodes.map((n2) => [n2.id, n2]));
@@ -195158,10 +195137,14 @@ function assignPortAnchorSides(nodes, edges) {
195158
195137
  const source = byId.get(e.source);
195159
195138
  const target = byId.get(e.target);
195160
195139
  if (!source || !target) continue;
195161
- const sourcePort = semanticPortHandle(source, e.sourceHandle);
195162
- const targetPort = semanticPortHandle(target, e.targetHandle);
195163
- if (sourcePort) e.sourceHandle = portAnchorHandleId(sourcePort, choosePortAnchorSide(source, sourcePort));
195164
- if (targetPort) e.targetHandle = portAnchorHandleId(targetPort, choosePortAnchorSide(target, targetPort));
195140
+ const sourcePort = semanticPortHandle(source, e.sourceHandle) ?? portOnNode(source, e.data?.edge.from)?.port.id;
195141
+ const targetPort = semanticPortHandle(target, e.targetHandle) ?? portOnNode(target, e.data?.edge.to)?.port.id;
195142
+ if (sourcePort && !validConcretePortAnchor(source, e.sourceHandle)) {
195143
+ e.sourceHandle = portAnchorHandleId(sourcePort, inferredPortAnchorSide(source, target, sourcePort, byId));
195144
+ }
195145
+ if (targetPort && !validConcretePortAnchor(target, e.targetHandle)) {
195146
+ e.targetHandle = portAnchorHandleId(targetPort, inferredPortAnchorSide(target, source, targetPort, byId));
195147
+ }
195165
195148
  }
195166
195149
  }
195167
195150
  function densifiedSideOffsets(base, needed) {
@@ -197891,7 +197874,12 @@ svg.react-flow__connectionline { z-index: 1; }
197891
197874
  .rf-frame .dport-hit { pointer-events: auto; }
197892
197875
  .rf-frame .react-flow__handle { pointer-events: auto; }
197893
197876
  /* REQ-370: a frame is click-through, but its stacked handles still obey React
197894
- * Flow's active end choice. An inactive twin must not cover an eligible end. */
197877
+ * Flow's active end choice. An inactive twin must not cover an eligible end.
197878
+ * This is also what fixes issue 232: the inactive twin is painted on top, so
197879
+ * while it was reachable elementFromPoint returned it, React Flow read no
197880
+ * connectableend, and the drop was refused across the whole port glyph. The
197881
+ * only dock left was the outer dot, which is why a connector from a contained
197882
+ * part could not land on the inner face of the container's own port. */
197895
197883
  .react-flow.sysml-connecting .rf-frame .react-flow__handle:not(.connectionindicator) { pointer-events: none; }
197896
197884
  .rf-frame .react-flow__resize-control { pointer-events: auto; }
197897
197885
  .rf-node .react-flow__resize-control.fork-join-resize {
@@ -197930,8 +197918,8 @@ svg.react-flow__connectionline { z-index: 1; }
197930
197918
  /* Connection handles are invisible at rest and become visible when their node,
197931
197919
  * lifeline, or port is hovered/selected. They create the view's default
197932
197920
  * relationship and remain targets for endpoint reconnection.
197933
- * Each port exposes four handles (top/right/bottom/left) so it behaves as a box
197934
- * with real docking points. Port handles are the PRIMARY connection target in the
197921
+ * Each port exposes two handles, one on its inner face and one on its outer face.
197922
+ * Port handles are the PRIMARY connection target in the
197935
197923
  * Interconnection View and sit ABOVE node-level side handles (which only serve
197936
197924
  * part\u2194part links), so a drop near a port snaps to the port, not the part body. */
197937
197925
  .react-flow__handle.rf-handle { min-width: 0; min-height: 0; border-radius: 50%;
@@ -197943,12 +197931,9 @@ svg.react-flow__connectionline { z-index: 1; }
197943
197931
  background: var(--cyan); border: 1px solid var(--bg-1);
197944
197932
  box-sizing: border-box;
197945
197933
  }
197946
- /* diagram-rules \u2014 Port: the visible connect DOT sits on the port glyph's outer edge
197947
- * (5px dot in an 18px invisible hit box) \u2014 the connect-START affordance and the outer
197948
- * dock point. A SEPARATE glyph-sized portdrop target (below) makes the whole port a
197949
- * reliable DROP landing zone during a drag without covering the dot or the select/move
197950
- * strip. All connection dots share ONE visible 5px size so the affordance reads the same
197951
- * everywhere. */
197934
+ /* diagram-rules - two visible port dots sit on the glyph's outer and inner faces.
197935
+ * Each 5px dot has a compact hit box and can start or end a connector. The chosen
197936
+ * handle is the chosen dock point, while the central body stays selectable. */
197952
197937
  .react-flow__handle.rf-handle-port { width: ${PORT_CONNECT_DOT_HIT}px; height: ${PORT_CONNECT_DOT_HIT}px; --rf-dot-size: 5px; z-index: 6; }
197953
197938
  .react-flow__handle.rf-handle-side { width: ${BODY_SNAP_POINT_HIT_SIZE}px; height: ${BODY_SNAP_POINT_HIT_SIZE}px; --rf-dot-size: 5px; z-index: 2; }
197954
197939
  /* REQ-370: body snap points are hollow circles. Port and pin endpoints are
@@ -197965,28 +197950,13 @@ svg.react-flow__connectionline { z-index: 1; }
197965
197950
  }
197966
197951
  .rf-circular-control-hit:active { cursor: grabbing; }
197967
197952
  .react-flow__handle.rf-handle-port.active { opacity: 0.95; }
197968
- /* The whole-glyph DROP target on a port's inner dock side. It exists ALWAYS (so a
197969
- * delegation connector docking on the inner side resolves and isn't dropped by React
197970
- * Flow), but is click-through AT REST so it never steals the port's click-to-select or
197971
- * the drag-to-move strip; while a connector is being dragged, React Flow's eligible
197972
- * ".connectionindicator" twins become pointer-active, so elementFromPoint returns a
197973
- * connectable end handle for a drop ANYWHERE on the glyph, inside or on an edge. It
197974
- * draws nothing (the drop cue is the port SQUARE highlight); its box is sized inline
197975
- * to PORT_GLYPH_SIZE by the renderer. */
197976
- .react-flow__handle.rf-handle-portdrop { --rf-dot-size: 0px; z-index: 5; border-radius: 3px; }
197977
- .react-flow__handle.rf-handle-portdrop::after { display: none; }
197978
- /* Both rules are (0,4,0), higher than React Flow's own .react-flow__handle.connectionindicator
197979
- * (0,2,0) which otherwise forces pointer-events on every connectable handle. During a drag
197980
- * we still restrict pointer events to ".connectionindicator". Each DualHandle renders a stacked
197981
- * target and source. Loose-mode reconnect can end on either twin, while semantic validation
197982
- * still rejects an incompatible model endpoint. */
197983
- .react-flow:not(.sysml-connecting) .react-flow__handle.rf-handle-portdrop { pointer-events: none; }
197984
- .react-flow.sysml-connecting .react-flow__handle.rf-handle-portdrop.connectionindicator { pointer-events: auto; }
197985
197953
  /* REQ-006 \u2014 graph nodes advertise their default drag relationship with modest
197986
197954
  * cyan side dots; all valid targets light up while a drag is in progress. */
197987
197955
  .rf-node-graph:hover .react-flow__handle.rf-handle-side { opacity: 0.85; }
197988
197956
  .react-flow.sysml-connecting .react-flow__handle.rf-handle-side.connectionindicator,
197989
197957
  .react-flow.sysml-connecting .react-flow__handle.rf-handle-lifeline.connectionindicator { opacity: 0.42; }
197958
+ .react-flow.sysml-connecting .react-flow__handle.rf-handle-port.connectionindicator { opacity: 0.42; }
197959
+ .react-flow.sysml-connecting .react-flow__handle.rf-handle-port.active { opacity: 1; }
197990
197960
  /* The nearest semantically valid body target is stronger than the candidate
197991
197961
  * points. Port and pin targets use the highlighted endpoint glyph instead. */
197992
197962
  .react-flow.sysml-connecting .react-flow__handle.rf-handle-side.connectingto.valid { opacity: 1; }
@@ -198017,13 +197987,14 @@ svg.react-flow__connectionline { z-index: 1; }
198017
197987
  * (diagram-rules \u2014 Nested port expansion control). Sized by the rule, so only its
198018
197988
  * colours and type live here; it reads as part of the port, not as chrome, until
198019
197989
  * hovered. Kept interactive inside a click-through container frame, like the port
198020
- * strip above, and click-through during a connection drag so it can never steal a
198021
- * drop aimed at the port it sits under. */
197990
+ * strip above, and raised above both the strip and face handles so expanding never
197991
+ * makes the collapse control unreachable. It is click-through during a connection
197992
+ * drag so it can never steal a drop aimed at the port it sits under. */
198022
197993
  .dport-toggle {
198023
197994
  display: flex; align-items: center; justify-content: center;
198024
197995
  padding: 0; border: 1px solid var(--fg-3); border-radius: 3px;
198025
197996
  background: var(--bg-1); color: var(--fg-2);
198026
- cursor: pointer; pointer-events: auto;
197997
+ cursor: pointer; pointer-events: auto; z-index: 7;
198027
197998
  }
198028
197999
  .dport-toggle svg { display: block; }
198029
198000
  .dport-toggle:hover { color: var(--accent); border-color: var(--accent); }
@@ -198033,9 +198004,9 @@ svg.react-flow__connectionline { z-index: 1; }
198033
198004
  /* While a connector is being dragged, the port-move strip must NOT intercept the
198034
198005
  * drop: it sits above the port's connect handle, so elementFromPoint would return
198035
198006
  * the strip (not a handle) and the drop would fall back to the nearest handle,
198036
- * which lets a competing part-side handle steal a drop aimed at the port centre.
198037
- * Making it click-through during a connection lets the full-glyph port handle take
198038
- * every drop \u2014 the port stays fully opaque to connectors. */
198007
+ * which lets a competing part-side handle steal a drop aimed at a face snap point.
198008
+ * Making it click-through during a connection leaves both exact port handles
198009
+ * reachable and lets the nearest one win. */
198039
198010
  .react-flow.sysml-connecting .port-drag-hit { pointer-events: none; }
198040
198011
  /* issue 189 \u2014 the in-place rename editor over a container-part FRAME header must
198041
198012
  be typeable even though the frame body is click-through (pointer-events:none). */
@@ -199966,7 +199937,7 @@ function LifelineBody({ node, w, lineBottom, activation, eventMarks }) {
199966
199937
  ] })
199967
199938
  ] });
199968
199939
  }
199969
- function PortGlyph({ ph, w, h, topReserve = 0, showLabels, selected: selected2, hovered, moving, connectTarget, connectStart, onSelect, onContext }) {
199940
+ function PortGlyph({ ph, w, h, topReserve = 0, showLabels, selected: selected2, hovered, moving, connectTargetSide, connectStart, onSelect, onContext }) {
199970
199941
  const rect = portGlyphRect(ph, w, h, topReserve);
199971
199942
  const x = rect.cx;
199972
199943
  const y = rect.cy;
@@ -200040,7 +200011,7 @@ function PortGlyph({ ph, w, h, topReserve = 0, showLabels, selected: selected2,
200040
200011
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200041
200012
  "rect",
200042
200013
  {
200043
- className: `dnode-port${ph.port.pin ? " pin" : ""}${ph.port.ref ? " ref" : ""}${rect.elongated ? " host" : ""}${selected2 ? " selected" : ""}${hovered ? " hovered" : ""}${moving ? " moving" : ""}${connectTarget ? " connect-target" : ""}`,
200014
+ className: `dnode-port${ph.port.pin ? " pin" : ""}${ph.port.ref ? " ref" : ""}${rect.elongated ? " host" : ""}${selected2 ? " selected" : ""}${hovered ? " hovered" : ""}${moving ? " moving" : ""}${connectTargetSide ? " connect-target" : ""}`,
200044
200015
  x: rect.x,
200045
200016
  y: rect.y,
200046
200017
  width: rect.width,
@@ -200053,7 +200024,7 @@ function PortGlyph({ ph, w, h, topReserve = 0, showLabels, selected: selected2,
200053
200024
  d === "out" || d === "inout" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { className: "dport-dir head", d: arrowHead(1) }) : "",
200054
200025
  d === "in" || d === "inout" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { className: "dport-dir head", d: arrowHead(-1) }) : ""
200055
200026
  ] }) : "",
200056
- selected2 && connectStart && !connectTarget ? (() => {
200027
+ selected2 && connectStart && !connectTargetSide ? (() => {
200057
200028
  const px = x + v.x * (half + PORT_PLUS_GAP);
200058
200029
  const py = y + v.y * (half + PORT_PLUS_GAP);
200059
200030
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("g", { className: "dport-plus", children: [
@@ -200061,8 +200032,8 @@ function PortGlyph({ ph, w, h, topReserve = 0, showLabels, selected: selected2,
200061
200032
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: px, y1: py - PORT_PLUS_HALF, x2: px, y2: py + PORT_PLUS_HALF })
200062
200033
  ] });
200063
200034
  })() : "",
200064
- connectTarget ? (() => {
200065
- const at2 = portDockAt(rect, ph.side, ph.side);
200035
+ connectTargetSide ? (() => {
200036
+ const at2 = portDockAt(rect, ph.side, connectTargetSide);
200066
200037
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { className: "dport-anchor", cx: at2.x, cy: at2.y, r: 1.7 });
200067
200038
  })() : "",
200068
200039
  showLabels && hostLabel ? (
@@ -200296,7 +200267,7 @@ function shapeBody(node, data) {
200296
200267
  }
200297
200268
  }
200298
200269
  var CLIP_EXEMPT = /* @__PURE__ */ new Set(["fork", "join", "dot", "initial", "final", "terminate", "lifeline", "actor"]);
200299
- function NodeBody({ node, data, selectedPortId, hoveredPortId, movingPortId, connectTargetPortId, showPortConnectStart, onPortSelect, onPortContext }) {
200270
+ function NodeBody({ node, data, selectedPortId, hoveredPortId, movingPortId, connectTargetPortId, connectTargetPortSide, showPortConnectStart, onPortSelect, onPortContext }) {
200300
200271
  const { w, h } = data;
200301
200272
  const rawId = (0, import_react8.useId)();
200302
200273
  const clipId = `dnode-clip-${rawId.replace(/[^a-zA-Z0-9_-]/g, "")}`;
@@ -200316,7 +200287,7 @@ function NodeBody({ node, data, selectedPortId, hoveredPortId, movingPortId, con
200316
200287
  selected: selectedPortId === ph.port.id,
200317
200288
  hovered: hoveredPortId === ph.port.id,
200318
200289
  moving: movingPortId === ph.port.id,
200319
- connectTarget: connectTargetPortId === ph.port.id,
200290
+ connectTargetSide: connectTargetPortId === ph.port.id ? connectTargetPortSide : void 0,
200320
200291
  connectStart: showPortConnectStart && (data.kind === "iv" ? ph.port.pin !== true : data.kind === "afv"),
200321
200292
  onSelect: onPortSelect,
200322
200293
  onContext: onPortContext
@@ -200329,9 +200300,10 @@ function SysmlNode({ id: id2, data, draggable, selected: selected2, width, heigh
200329
200300
  const ctx = useDiagram();
200330
200301
  const node = data.node;
200331
200302
  const myPortIds = node.ports?.map((p) => p.id) ?? [];
200332
- const connectTargetPortId = useConnection((c) => {
200333
- return validPortDropTarget(c, (portId) => myPortIds.includes(portId))?.portId;
200334
- });
200303
+ const connectTargetHandleId = useConnection((c) => validPortDropTarget(c, (portId) => myPortIds.includes(portId))?.handleId);
200304
+ const connectTargetPort = parsePortAnchorHandleId(connectTargetHandleId);
200305
+ const connectTargetPortId = connectTargetPort?.portId;
200306
+ const connectTargetPortSide = connectTargetPort?.side;
200335
200307
  const w = width ?? data.w;
200336
200308
  const h = height ?? data.h;
200337
200309
  const isLifeline = node.shape === "lifeline";
@@ -200455,6 +200427,7 @@ function SysmlNode({ id: id2, data, draggable, selected: selected2, width, heigh
200455
200427
  hoveredPortId,
200456
200428
  movingPortId: dragId,
200457
200429
  connectTargetPortId,
200430
+ connectTargetPortSide,
200458
200431
  showPortConnectStart: data.kind === "iv" || data.kind === "afv",
200459
200432
  onPortSelect: !ctx.onPortMove && data.ports.length ? portSource : void 0,
200460
200433
  onPortContext: ctx.onContextNode
@@ -200501,7 +200474,6 @@ function SysmlNode({ id: id2, data, draggable, selected: selected2, width, heigh
200501
200474
  node.shape === "initial" || node.shape === "final" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rf-circular-control-hit", "aria-hidden": "true" }) : null,
200502
200475
  ports.flatMap((ph) => {
200503
200476
  const rect = portGlyphRect(ph, w, h, featureCompartmentHeight);
200504
- const c = { x: rect.cx, y: rect.cy };
200505
200477
  const startable = directRelationForHandle(data.kind, {
200506
200478
  id: ph.port.id,
200507
200479
  name: ph.port.name,
@@ -200509,18 +200481,38 @@ function SysmlNode({ id: id2, data, draggable, selected: selected2, width, heigh
200509
200481
  shape: ph.port.pin ? "pin" : "port",
200510
200482
  source: ph.port.source
200511
200483
  }) !== void 0;
200512
- const active = startable && (ph.port.id === hoveredPortId || ph.port.id === selectedPortId) || ph.port.id === connectTargetPortId;
200513
200484
  const [outerId, innerId] = portConnectHandleIds(ph.port.id, ph.side);
200514
- const dropSize = {
200515
- width: Math.max(rect.width, 16),
200516
- height: Math.max(rect.height, 16)
200517
- };
200518
200485
  const outer = portDockAt(rect, ph.side, ph.side);
200486
+ const innerSide = OPPOSITE_DOCK_SIDE[ph.side];
200487
+ const inner = portDockAt(rect, ph.side, innerSide);
200488
+ const revealBoth = startable && (ph.port.id === hoveredPortId || ph.port.id === selectedPortId);
200519
200489
  return [
200520
- // the DROP target stays centred over the glyph — it is a cover,
200521
- // not a dock point (the edge geometry is `dockPoint`'s business)
200522
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DualHandle, { id: innerId, side: OPPOSITE_DOCK_SIDE[ph.side], x: c.x, y: c.y, kind: "portdrop", size: dropSize, startable: false }, `${ph.port.id}-drop`),
200523
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DualHandle, { id: outerId, side: ph.side, x: outer.x, y: outer.y, kind: "port", active, startable }, `${ph.port.id}-out`)
200490
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200491
+ DualHandle,
200492
+ {
200493
+ id: outerId,
200494
+ side: ph.side,
200495
+ x: outer.x,
200496
+ y: outer.y,
200497
+ kind: "port",
200498
+ active: revealBoth || ph.port.id === connectTargetPortId && connectTargetPortSide === ph.side,
200499
+ startable
200500
+ },
200501
+ `${ph.port.id}-out`
200502
+ ),
200503
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200504
+ DualHandle,
200505
+ {
200506
+ id: innerId,
200507
+ side: innerSide,
200508
+ x: inner.x,
200509
+ y: inner.y,
200510
+ kind: "port",
200511
+ active: revealBoth || ph.port.id === connectTargetPortId && connectTargetPortSide === innerSide,
200512
+ startable
200513
+ },
200514
+ `${ph.port.id}-in`
200515
+ )
200524
200516
  ];
200525
200517
  }),
200526
200518
  ctx.onPortMove ? ports.map((ph) => {
@@ -200655,9 +200647,10 @@ function FrameNode({ id: id2, data, selected: selected2, width, height }) {
200655
200647
  const frameSemanticClass = frame2.keyword.startsWith("part") ? "part" : isStructuredControl || isActionElementKeyword(frame2.keyword) ? "action" : frame2.keyword.startsWith("state") ? "state" : void 0;
200656
200648
  const frameBottomHeight = loopUntil ? data.frameBottomHeight ?? LOOP_UNTIL_COMPARTMENT_HEIGHT : 0;
200657
200649
  const myPortIds = isPartitionLane ? [] : frame2.ports?.map((p) => p.id) ?? [];
200658
- const connectTargetPortId = useConnection((c) => {
200659
- return validPortDropTarget(c, (portId) => myPortIds.includes(portId))?.portId;
200660
- });
200650
+ const connectTargetHandleId = useConnection((c) => validPortDropTarget(c, (portId) => myPortIds.includes(portId))?.handleId);
200651
+ const connectTargetPort = parsePortAnchorHandleId(connectTargetHandleId);
200652
+ const connectTargetPortId = connectTargetPort?.portId;
200653
+ const connectTargetPortSide = connectTargetPort?.side;
200661
200654
  const w = width ?? data.w;
200662
200655
  const h = height ?? data.h;
200663
200656
  const partitionKindFull = isExhibitLane ? "\xABexhibited by\xBB" : "\xABperformer\xBB";
@@ -200892,7 +200885,7 @@ function FrameNode({ id: id2, data, selected: selected2, width, height }) {
200892
200885
  selected: selectedPortId === ph.port.id,
200893
200886
  hovered: hoveredPortId === ph.port.id,
200894
200887
  moving: dragId === ph.port.id,
200895
- connectTarget: connectTargetPortId === ph.port.id,
200888
+ connectTargetSide: connectTargetPortId === ph.port.id ? connectTargetPortSide : void 0,
200896
200889
  connectStart: data.kind === "iv" ? ph.port.pin !== true : data.kind === "afv",
200897
200890
  onSelect: ctx.onPortMove ? void 0 : portSource,
200898
200891
  onContext: ctx.onContextNode
@@ -200962,7 +200955,6 @@ function FrameNode({ id: id2, data, selected: selected2, width, height }) {
200962
200955
  }),
200963
200956
  showPorts ? ports.flatMap((ph) => {
200964
200957
  const rect = portGlyphRect(ph, w, h, featureCompartmentHeight);
200965
- const c = { x: rect.cx, y: rect.cy };
200966
200958
  const startable = directRelationForHandle(data.kind, {
200967
200959
  id: ph.port.id,
200968
200960
  name: ph.port.name,
@@ -200970,18 +200962,38 @@ function FrameNode({ id: id2, data, selected: selected2, width, height }) {
200970
200962
  shape: ph.port.pin ? "pin" : "port",
200971
200963
  source: ph.port.source
200972
200964
  }) !== void 0;
200973
- const active = startable && (ph.port.id === hoveredPortId || ph.port.id === selectedPortId) || ph.port.id === connectTargetPortId;
200974
200965
  const [outerId, innerId] = portConnectHandleIds(ph.port.id, ph.side);
200975
- const dropSize = {
200976
- width: Math.max(rect.width, 16),
200977
- height: Math.max(rect.height, 16)
200978
- };
200979
200966
  const outer = portDockAt(rect, ph.side, ph.side);
200967
+ const innerSide = OPPOSITE_DOCK_SIDE[ph.side];
200968
+ const inner = portDockAt(rect, ph.side, innerSide);
200969
+ const revealBoth = startable && (ph.port.id === hoveredPortId || ph.port.id === selectedPortId);
200980
200970
  return [
200981
- // the DROP target stays centred over the glyph — it is a cover,
200982
- // not a dock point (the edge geometry is `dockPoint`'s business)
200983
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DualHandle, { id: innerId, side: OPPOSITE_DOCK_SIDE[ph.side], x: c.x, y: c.y, kind: "portdrop", size: dropSize, startable: false }, `${ph.port.id}-drop`),
200984
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DualHandle, { id: outerId, side: ph.side, x: outer.x, y: outer.y, kind: "port", active, startable }, `${ph.port.id}-out`)
200971
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200972
+ DualHandle,
200973
+ {
200974
+ id: outerId,
200975
+ side: ph.side,
200976
+ x: outer.x,
200977
+ y: outer.y,
200978
+ kind: "port",
200979
+ active: revealBoth || ph.port.id === connectTargetPortId && connectTargetPortSide === ph.side,
200980
+ startable
200981
+ },
200982
+ `${ph.port.id}-out`
200983
+ ),
200984
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200985
+ DualHandle,
200986
+ {
200987
+ id: innerId,
200988
+ side: innerSide,
200989
+ x: inner.x,
200990
+ y: inner.y,
200991
+ kind: "port",
200992
+ active: revealBoth || ph.port.id === connectTargetPortId && connectTargetPortSide === innerSide,
200993
+ startable
200994
+ },
200995
+ `${ph.port.id}-in`
200996
+ )
200985
200997
  ];
200986
200998
  }) : null,
200987
200999
  ctx.onPortMove ? ports.map((ph) => {
@@ -201371,7 +201383,7 @@ async function runExport(command) {
201371
201383
  }
201372
201384
 
201373
201385
  // src/main.ts
201374
- var VERSION2 = true ? "0.20.2" : "dev";
201386
+ var VERSION2 = true ? "0.20.3" : "dev";
201375
201387
  function display(file) {
201376
201388
  const rel2 = path9.relative(process.cwd(), file);
201377
201389
  return rel2 && !rel2.startsWith("..") ? rel2.split(path9.sep).join("/") : file;