@tscircuit/core 0.0.1442 → 0.0.1443

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 +30 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21628,7 +21628,36 @@ var insertNetLabelsForPortsMissingTrace = ({
21628
21628
  }
21629
21629
  const implicitPortLabelText = connectedSourcePortIdsForKey.map((sourcePortId) => getSourcePortNetLabelText(db, sourcePortId)).filter((label) => Boolean(label)).join("/");
21630
21630
  const directCrossSubcircuitConnectionLabelText = getDirectCrossSubcircuitConnectionLabelText(db, srcPortId);
21631
+ const isConnectivityKeyFallback = !sourceNet?.name && !sourceNet?.source_net_id && !assignedPortNetLabelText && !directCrossSubcircuitConnectionLabelText && !implicitPortLabelText;
21631
21632
  const text = sourceNet?.name || sourceNet?.source_net_id || assignedPortNetLabelText || directCrossSubcircuitConnectionLabelText || implicitPortLabelText || connKey;
21633
+ if (isConnectivityKeyFallback) {
21634
+ const sourcePortComponent = connectedPortsForKey.find(
21635
+ (port) => port.source_port_id === srcPortId
21636
+ );
21637
+ const collapsedGroup = sourcePortComponent?.parent;
21638
+ if (sourcePortComponent?.isGroupPort() && collapsedGroup?._parsedProps?.showAsSchematicBox) {
21639
+ const sourceTracesConnectedToPort = db.source_trace.list().filter(
21640
+ (trace) => trace.connected_source_port_ids?.includes(srcPortId)
21641
+ );
21642
+ const isPortInsideCollapsedGroup = (port) => {
21643
+ let parent = port.parent;
21644
+ while (parent) {
21645
+ if (parent === collapsedGroup) return true;
21646
+ parent = parent.parent;
21647
+ }
21648
+ return false;
21649
+ };
21650
+ const allConnectionsAreInternal = sourceTracesConnectedToPort.length > 0 && sourceTracesConnectedToPort.every(
21651
+ (trace) => (trace.connected_source_net_ids?.length ?? 0) === 0 && trace.connected_source_port_ids.filter((sourcePortId) => sourcePortId !== srcPortId).every((sourcePortId) => {
21652
+ const connectedPort = connectedPortsForKey.find(
21653
+ (port) => port.source_port_id === sourcePortId
21654
+ );
21655
+ return connectedPort ? isPortInsideCollapsedGroup(connectedPort) : false;
21656
+ })
21657
+ );
21658
+ if (allConnectionsAreInternal) continue;
21659
+ }
21660
+ }
21632
21661
  const connectedPortCountForKey = Array.from(
21633
21662
  allSourceAndSchematicPortIdsInScope
21634
21663
  ).filter((portId) => {
@@ -22564,7 +22593,7 @@ function Group_getRoutingPhasePlans(group) {
22564
22593
  var package_default = {
22565
22594
  name: "@tscircuit/core",
22566
22595
  type: "module",
22567
- version: "0.0.1441",
22596
+ version: "0.0.1442",
22568
22597
  types: "dist/index.d.ts",
22569
22598
  main: "dist/index.js",
22570
22599
  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.1442",
4
+ "version": "0.0.1443",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",