@tscircuit/core 0.0.1371 → 0.0.1373
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/dist/index.js +40 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16044,8 +16044,24 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
16044
16044
|
}).filter((c) => c !== null);
|
|
16045
16045
|
const source_nets = db.source_net.list().filter((e) => !subcircuit_id || e.subcircuit_id === subcircuit_id);
|
|
16046
16046
|
const connectionsFromNets = [];
|
|
16047
|
+
const connectionFromNetId = /* @__PURE__ */ new Map();
|
|
16048
|
+
const handledNetConnectivityKeys = /* @__PURE__ */ new Set();
|
|
16049
|
+
const sourceTraces = db.source_trace.list();
|
|
16050
|
+
const getSourceConnectivityKey = (id) => id ? connMap.getNetConnectedToId(id) ?? id : null;
|
|
16047
16051
|
for (const net of source_nets) {
|
|
16048
|
-
const
|
|
16052
|
+
const netConnectivityKey = getSourceConnectivityKey(net.source_net_id);
|
|
16053
|
+
if (!netConnectivityKey || handledNetConnectivityKeys.has(netConnectivityKey)) {
|
|
16054
|
+
continue;
|
|
16055
|
+
}
|
|
16056
|
+
handledNetConnectivityKeys.add(netConnectivityKey);
|
|
16057
|
+
const connectedSourceNetIds = source_nets.filter(
|
|
16058
|
+
(sourceNet) => getSourceConnectivityKey(sourceNet.source_net_id) === netConnectivityKey
|
|
16059
|
+
).map((sourceNet) => sourceNet.source_net_id);
|
|
16060
|
+
const connectedSourceTraces = sourceTraces.filter(
|
|
16061
|
+
(st) => [st.source_trace_id, ...st.connected_source_net_ids ?? []].some(
|
|
16062
|
+
(id) => getSourceConnectivityKey(id) === netConnectivityKey
|
|
16063
|
+
)
|
|
16064
|
+
);
|
|
16049
16065
|
let nominalTraceWidthFromConnectedTraces;
|
|
16050
16066
|
for (const sourceTrace of connectedSourceTraces) {
|
|
16051
16067
|
if (sourceTrace.min_trace_thickness === void 0) continue;
|
|
@@ -16070,12 +16086,16 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
16070
16086
|
});
|
|
16071
16087
|
}
|
|
16072
16088
|
}
|
|
16073
|
-
|
|
16089
|
+
const connection = {
|
|
16074
16090
|
name: net.source_net_id ?? connMap.getNetConnectedToId(net.source_net_id),
|
|
16075
16091
|
nominalTraceWidth: nominalTraceWidthFromConnectedTraces,
|
|
16076
16092
|
width: nominalTraceWidthFromConnectedTraces,
|
|
16077
16093
|
pointsToConnect
|
|
16078
|
-
}
|
|
16094
|
+
};
|
|
16095
|
+
connectionsFromNets.push(connection);
|
|
16096
|
+
for (const sourceNetId of connectedSourceNetIds) {
|
|
16097
|
+
connectionFromNetId.set(sourceNetId, connection);
|
|
16098
|
+
}
|
|
16079
16099
|
}
|
|
16080
16100
|
const connectionsFromBreakoutPoints = [];
|
|
16081
16101
|
for (const bp of breakoutPoints) {
|
|
@@ -16110,7 +16130,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
16110
16130
|
continue;
|
|
16111
16131
|
}
|
|
16112
16132
|
if (bp.source_net_id) {
|
|
16113
|
-
const conn =
|
|
16133
|
+
const conn = connectionFromNetId.get(bp.source_net_id);
|
|
16114
16134
|
if (conn) {
|
|
16115
16135
|
conn.pointsToConnect.push(pt);
|
|
16116
16136
|
} else {
|
|
@@ -20553,9 +20573,15 @@ var insertNetLabelsForPortsMissingTrace = ({
|
|
|
20553
20573
|
if (!sourcePortId) return false;
|
|
20554
20574
|
return db.source_port.get(sourcePortId)?.subcircuit_connectivity_map_key === connKey;
|
|
20555
20575
|
});
|
|
20576
|
+
const connectedPortsForKey = group.selectAll("port").filter((port) => port._getSubcircuitConnectivityKey() === connKey);
|
|
20577
|
+
const { name: resolvedPortNetLabelText, wasAssignedDisplayLabel } = getNetNameFromPorts(connectedPortsForKey);
|
|
20578
|
+
let assignedPortNetLabelText;
|
|
20579
|
+
if (wasAssignedDisplayLabel) {
|
|
20580
|
+
assignedPortNetLabelText = resolvedPortNetLabelText;
|
|
20581
|
+
}
|
|
20556
20582
|
const implicitPortLabelText = connectedSourcePortIdsForKey.map((sourcePortId) => getSourcePortNetLabelText(db, sourcePortId)).filter((label) => Boolean(label)).join("/");
|
|
20557
20583
|
const directCrossSubcircuitConnectionLabelText = getDirectCrossSubcircuitConnectionLabelText(db, srcPortId);
|
|
20558
|
-
const text = sourceNet?.name || sourceNet?.source_net_id || directCrossSubcircuitConnectionLabelText || implicitPortLabelText || connKey;
|
|
20584
|
+
const text = sourceNet?.name || sourceNet?.source_net_id || assignedPortNetLabelText || directCrossSubcircuitConnectionLabelText || implicitPortLabelText || connKey;
|
|
20559
20585
|
const connectedPortCountForKey = Array.from(
|
|
20560
20586
|
allSourceAndSchematicPortIdsInScope
|
|
20561
20587
|
).filter((portId) => {
|
|
@@ -23528,6 +23554,7 @@ var Group5 = class extends NormalComponent3 {
|
|
|
23528
23554
|
const subcircuitComponentsByName = /* @__PURE__ */ new Map();
|
|
23529
23555
|
for (const child of this.children) {
|
|
23530
23556
|
if (child.isSubcircuit) continue;
|
|
23557
|
+
if (child instanceof Trace3) continue;
|
|
23531
23558
|
if (child._parsedProps.name) {
|
|
23532
23559
|
const components = subcircuitComponentsByName.get(child._parsedProps.name) || [];
|
|
23533
23560
|
components.push(child);
|
|
@@ -24660,7 +24687,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
24660
24687
|
var package_default = {
|
|
24661
24688
|
name: "@tscircuit/core",
|
|
24662
24689
|
type: "module",
|
|
24663
|
-
version: "0.0.
|
|
24690
|
+
version: "0.0.1372",
|
|
24664
24691
|
types: "dist/index.d.ts",
|
|
24665
24692
|
main: "dist/index.js",
|
|
24666
24693
|
module: "dist/index.js",
|
|
@@ -25767,15 +25794,17 @@ var Subcircuit = class extends Group5 {
|
|
|
25767
25794
|
const parentNetSelector = `> net.${netName}`;
|
|
25768
25795
|
const childNetSelector = `.${this.name} > net.${netName}`;
|
|
25769
25796
|
const traceName = `exposed_net.${netName}`;
|
|
25770
|
-
const
|
|
25797
|
+
const parentNet = parentSubcircuit.children.find(
|
|
25771
25798
|
(child) => child instanceof Net && child._parsedProps.name === netName
|
|
25772
25799
|
);
|
|
25773
|
-
if (!
|
|
25800
|
+
if (!parentNet) {
|
|
25774
25801
|
parentSubcircuit.add(new Net({ name: netName }));
|
|
25775
25802
|
}
|
|
25776
|
-
const existingTrace = parentSubcircuit.children.find(
|
|
25777
|
-
(child
|
|
25778
|
-
|
|
25803
|
+
const existingTrace = parentSubcircuit.children.find((child) => {
|
|
25804
|
+
if (!(child instanceof Trace3)) return false;
|
|
25805
|
+
const childProps = child._parsedProps;
|
|
25806
|
+
return childProps.name === traceName && childProps.from === childNetSelector && childProps.to === parentNetSelector;
|
|
25807
|
+
});
|
|
25779
25808
|
if (existingTrace) continue;
|
|
25780
25809
|
parentSubcircuit.add(
|
|
25781
25810
|
new Trace3({
|