@tscircuit/core 0.0.1314 → 0.0.1315

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19732,6 +19732,24 @@ var getSourcePortNetLabelText = (db, sourcePortId) => {
19732
19732
  if (!sourceComponent?.name || !sourcePort.name) return void 0;
19733
19733
  return `${sourceComponent.name}_${sourcePort.name}`;
19734
19734
  };
19735
+ var getDirectCrossSubcircuitConnectionLabelText = (db, sourcePortId) => {
19736
+ const sourcePort = db.source_port.get(sourcePortId);
19737
+ if (!sourcePort) return void 0;
19738
+ for (const sourceTrace of db.source_trace.list()) {
19739
+ const connectedSourcePortIds = sourceTrace.connected_source_port_ids ?? [];
19740
+ if (connectedSourcePortIds.length !== 2) continue;
19741
+ if ((sourceTrace.connected_source_net_ids ?? []).length > 0) continue;
19742
+ if (!connectedSourcePortIds.includes(sourcePortId)) continue;
19743
+ const otherSourcePortId = connectedSourcePortIds.find(
19744
+ (portId) => portId !== sourcePortId
19745
+ );
19746
+ if (!otherSourcePortId) continue;
19747
+ const otherSourcePort = db.source_port.get(otherSourcePortId);
19748
+ if (!otherSourcePort) continue;
19749
+ if (otherSourcePort.subcircuit_id === sourcePort.subcircuit_id) continue;
19750
+ return getSourcePortNetLabelText(db, otherSourcePortId);
19751
+ }
19752
+ };
19735
19753
  var insertNetLabelsForPortsMissingTrace = ({
19736
19754
  allSourceAndSchematicPortIdsInScope,
19737
19755
  group,
@@ -19758,7 +19776,8 @@ var insertNetLabelsForPortsMissingTrace = ({
19758
19776
  return db.source_port.get(sourcePortId)?.subcircuit_connectivity_map_key === connKey;
19759
19777
  });
19760
19778
  const implicitPortLabelText = connectedSourcePortIdsForKey.map((sourcePortId) => getSourcePortNetLabelText(db, sourcePortId)).filter((label) => Boolean(label)).join("/");
19761
- const text = sourceNet?.name || sourceNet?.source_net_id || implicitPortLabelText || connKey;
19779
+ const directCrossSubcircuitConnectionLabelText = getDirectCrossSubcircuitConnectionLabelText(db, srcPortId);
19780
+ const text = sourceNet?.name || sourceNet?.source_net_id || directCrossSubcircuitConnectionLabelText || implicitPortLabelText || connKey;
19762
19781
  const connectedPortCountForKey = Array.from(
19763
19782
  allSourceAndSchematicPortIdsInScope
19764
19783
  ).filter((portId) => {
@@ -23498,7 +23517,7 @@ import { identity as identity5 } from "transformation-matrix";
23498
23517
  var package_default = {
23499
23518
  name: "@tscircuit/core",
23500
23519
  type: "module",
23501
- version: "0.0.1313",
23520
+ version: "0.0.1314",
23502
23521
  types: "dist/index.d.ts",
23503
23522
  main: "dist/index.js",
23504
23523
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1314",
4
+ "version": "0.0.1315",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",