@tscircuit/core 0.0.1436 → 0.0.1438
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.d.ts +2 -0
- package/dist/index.js +169 -99
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2135,10 +2135,12 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
|
|
|
2135
2135
|
* Return traces that are explicitly connected to this port (not via a net)
|
|
2136
2136
|
*/
|
|
2137
2137
|
_getDirectlyConnectedTraces(): Trace[];
|
|
2138
|
+
doInitialCreateTracesFromProps(): void;
|
|
2138
2139
|
doInitialSourceRender(): void;
|
|
2139
2140
|
doInitialSourceParentAttachment(): void;
|
|
2140
2141
|
doInitialPcbPortRender(): void;
|
|
2141
2142
|
updatePcbPortRender(): void;
|
|
2143
|
+
doInitialPcbPortAttachment(): void;
|
|
2142
2144
|
/**
|
|
2143
2145
|
* Get the best display label for this port based on port_hints
|
|
2144
2146
|
* Filters out generic patterns and applies showPinAliases logic
|
package/dist/index.js
CHANGED
|
@@ -3664,25 +3664,29 @@ function getPcbSelectorErrorForTracePort(selector, port) {
|
|
|
3664
3664
|
const siblingPorts = (parentNormalComponent?.children ?? []).filter(
|
|
3665
3665
|
(child) => child.componentName === "Port" && child.isMatchingAnyOf([selectorToken])
|
|
3666
3666
|
);
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
const rawPinSelectors2 = Array.from(
|
|
3673
|
-
new Set(
|
|
3674
|
-
siblingPorts.flatMap(
|
|
3675
|
-
(siblingPort) => siblingPort.getNameAndAliases().filter((alias) => /^pin\d+$/.test(alias)).map((alias) => `${parentName}.${alias}`)
|
|
3676
|
-
)
|
|
3677
|
-
)
|
|
3678
|
-
);
|
|
3679
|
-
const suggestion = rawPinSelectors2.length > 0 ? ` Use a raw pin selector like ${rawPinSelectors2.map((s) => `"${s}"`).join(" or ")}.` : "";
|
|
3680
|
-
const siblingPcbMatches = siblingPorts.flatMap(
|
|
3681
|
-
(siblingPort) => siblingPort.matchedComponents.filter(
|
|
3682
|
-
(component) => component.isPcbPrimitive
|
|
3667
|
+
if (siblingPorts.length > 1) {
|
|
3668
|
+
const internallyConnectedGroups = parentNormalComponent?._getInternallyConnectedPins?.() ?? [];
|
|
3669
|
+
const matchingPortsAreInternallyConnected = internallyConnectedGroups.some(
|
|
3670
|
+
(group) => siblingPorts.every(
|
|
3671
|
+
(siblingPort) => group.includes(siblingPort)
|
|
3683
3672
|
)
|
|
3684
3673
|
);
|
|
3685
|
-
|
|
3674
|
+
if (!matchingPortsAreInternallyConnected) {
|
|
3675
|
+
const rawPinSelectors2 = Array.from(
|
|
3676
|
+
new Set(
|
|
3677
|
+
siblingPorts.flatMap(
|
|
3678
|
+
(siblingPort) => siblingPort.getNameAndAliases().filter((alias) => /^pin\d+$/.test(alias)).map((alias) => `${parentName}.${alias}`)
|
|
3679
|
+
)
|
|
3680
|
+
)
|
|
3681
|
+
);
|
|
3682
|
+
const suggestion = rawPinSelectors2.length > 0 ? ` Use a raw pin selector like ${rawPinSelectors2.map((s) => `"${s}"`).join(" or ")}.` : "";
|
|
3683
|
+
const siblingPcbMatches = siblingPorts.flatMap(
|
|
3684
|
+
(siblingPort) => siblingPort.matchedComponents.filter(
|
|
3685
|
+
(component) => component.isPcbPrimitive
|
|
3686
|
+
)
|
|
3687
|
+
);
|
|
3688
|
+
return `Trace selector "${selector}" resolved to "${parentName}.${port.props.name}", but alias "${selectorToken}" matches multiple PCB pads: ${siblingPcbMatches.map((component) => formatPcbPrimitiveForError(component)).join(", ")}.${suggestion}`;
|
|
3689
|
+
}
|
|
3686
3690
|
}
|
|
3687
3691
|
}
|
|
3688
3692
|
if (port.pcb_port_id) return null;
|
|
@@ -9558,6 +9562,62 @@ var applyPinAttributesToSourcePort = (sourcePortProps, attributes) => {
|
|
|
9558
9562
|
}
|
|
9559
9563
|
};
|
|
9560
9564
|
|
|
9565
|
+
// lib/components/primitive-components/Port/Port_doInitialCreateTracesFromProps.ts
|
|
9566
|
+
var getConnectionTargets = (target) => {
|
|
9567
|
+
if (!target) return [];
|
|
9568
|
+
return typeof target === "string" ? [target] : [...target];
|
|
9569
|
+
};
|
|
9570
|
+
function Port_doInitialCreateTracesFromProps(port) {
|
|
9571
|
+
if (!port.isGroupPort()) return;
|
|
9572
|
+
const connectsTo = port._parsedProps.connectsTo;
|
|
9573
|
+
if (!connectsTo) return;
|
|
9574
|
+
const parent = port.parent;
|
|
9575
|
+
if (!parent) return;
|
|
9576
|
+
const parentConnections = parent._parsedProps?.connections;
|
|
9577
|
+
const connectionIsCreatedByParent = Object.keys(parentConnections ?? {}).some(
|
|
9578
|
+
(pinName) => port.isMatchingAnyOf([pinName])
|
|
9579
|
+
);
|
|
9580
|
+
if (connectionIsCreatedByParent) return;
|
|
9581
|
+
const parentName = parent.name;
|
|
9582
|
+
const portName = port.name;
|
|
9583
|
+
if (!parentName || !portName) return;
|
|
9584
|
+
const from = `.${parentName} > .${portName}`;
|
|
9585
|
+
for (const target of getConnectionTargets(connectsTo)) {
|
|
9586
|
+
const traceAlreadyExists = parent.children.some((child) => {
|
|
9587
|
+
if (!(child instanceof Trace3)) return false;
|
|
9588
|
+
const traceProps2 = child._parsedProps;
|
|
9589
|
+
if (!("from" in traceProps2) || !("to" in traceProps2)) return false;
|
|
9590
|
+
return traceProps2.from === from && traceProps2.to === target || traceProps2.from === target && traceProps2.to === from;
|
|
9591
|
+
});
|
|
9592
|
+
if (traceAlreadyExists) continue;
|
|
9593
|
+
parent.add(new Trace3({ from, to: target }));
|
|
9594
|
+
}
|
|
9595
|
+
}
|
|
9596
|
+
|
|
9597
|
+
// lib/components/primitive-components/Port/Port_tryRenderGroupPcbPort.ts
|
|
9598
|
+
function Port_tryRenderGroupPcbPort(port) {
|
|
9599
|
+
if (port.root?.pcbDisabled) return false;
|
|
9600
|
+
if (port.pcb_port_id) return true;
|
|
9601
|
+
const { db } = port.root;
|
|
9602
|
+
const connectedPort = port._getConnectedPortsFromConnectsTo()[0];
|
|
9603
|
+
if (!connectedPort?.pcb_port_id) return false;
|
|
9604
|
+
const connectedPcbPort = db.pcb_port.get(connectedPort.pcb_port_id);
|
|
9605
|
+
if (!connectedPcbPort) return false;
|
|
9606
|
+
const subcircuit = port.getSubcircuit();
|
|
9607
|
+
const pcbPort = db.pcb_port.insert({
|
|
9608
|
+
pcb_component_id: void 0,
|
|
9609
|
+
layers: connectedPort.getAvailablePcbLayers(),
|
|
9610
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
9611
|
+
pcb_group_id: port.getGroup()?.pcb_group_id ?? void 0,
|
|
9612
|
+
x: connectedPcbPort.x,
|
|
9613
|
+
y: connectedPcbPort.y,
|
|
9614
|
+
source_port_id: port.source_port_id,
|
|
9615
|
+
is_board_pinout: false
|
|
9616
|
+
});
|
|
9617
|
+
port.pcb_port_id = pcbPort.pcb_port_id;
|
|
9618
|
+
return true;
|
|
9619
|
+
}
|
|
9620
|
+
|
|
9561
9621
|
// lib/components/primitive-components/Port/Port.ts
|
|
9562
9622
|
var Port = class extends PrimitiveComponent2 {
|
|
9563
9623
|
source_port_id = null;
|
|
@@ -9827,6 +9887,9 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
9827
9887
|
const connectedTraces = allSubcircuitTraces.filter((trace) => !trace._couldNotFindPort).filter((trace) => trace._isExplicitlyConnectedToPort(this));
|
|
9828
9888
|
return connectedTraces;
|
|
9829
9889
|
}
|
|
9890
|
+
doInitialCreateTracesFromProps() {
|
|
9891
|
+
Port_doInitialCreateTracesFromProps(this);
|
|
9892
|
+
}
|
|
9830
9893
|
doInitialSourceRender() {
|
|
9831
9894
|
const { db } = this.root;
|
|
9832
9895
|
const { _parsedProps: props } = this;
|
|
@@ -9876,27 +9939,7 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
9876
9939
|
const { db } = this.root;
|
|
9877
9940
|
const { matchedComponents } = this;
|
|
9878
9941
|
if (this.isGroupPort()) {
|
|
9879
|
-
|
|
9880
|
-
if (connectedPorts.length === 0) {
|
|
9881
|
-
return;
|
|
9882
|
-
}
|
|
9883
|
-
const connectedPort = connectedPorts[0];
|
|
9884
|
-
if (!connectedPort.pcb_port_id) {
|
|
9885
|
-
return;
|
|
9886
|
-
}
|
|
9887
|
-
const connectedPcbPort = db.pcb_port.get(connectedPort.pcb_port_id);
|
|
9888
|
-
const matchCenter2 = { x: connectedPcbPort.x, y: connectedPcbPort.y };
|
|
9889
|
-
const subcircuit = this.getSubcircuit();
|
|
9890
|
-
const pcb_port = db.pcb_port.insert({
|
|
9891
|
-
pcb_component_id: void 0,
|
|
9892
|
-
layers: connectedPort.getAvailablePcbLayers(),
|
|
9893
|
-
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
9894
|
-
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
|
|
9895
|
-
...matchCenter2,
|
|
9896
|
-
source_port_id: this.source_port_id,
|
|
9897
|
-
is_board_pinout: false
|
|
9898
|
-
});
|
|
9899
|
-
this.pcb_port_id = pcb_port.pcb_port_id;
|
|
9942
|
+
Port_tryRenderGroupPcbPort(this);
|
|
9900
9943
|
return;
|
|
9901
9944
|
}
|
|
9902
9945
|
const parentNormalComponent = this.getParentNormalComponent();
|
|
@@ -9956,23 +9999,7 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
9956
9999
|
const { db } = this.root;
|
|
9957
10000
|
if (this.pcb_port_id) return;
|
|
9958
10001
|
if (this.isGroupPort()) {
|
|
9959
|
-
|
|
9960
|
-
if (connectedPorts.length === 0) return;
|
|
9961
|
-
const connectedPort = connectedPorts[0];
|
|
9962
|
-
if (!connectedPort.pcb_port_id) return;
|
|
9963
|
-
const connectedPcbPort = db.pcb_port.get(connectedPort.pcb_port_id);
|
|
9964
|
-
const matchCenter2 = { x: connectedPcbPort.x, y: connectedPcbPort.y };
|
|
9965
|
-
const subcircuit2 = this.getSubcircuit();
|
|
9966
|
-
const pcb_port2 = db.pcb_port.insert({
|
|
9967
|
-
pcb_component_id: void 0,
|
|
9968
|
-
layers: connectedPort.getAvailablePcbLayers(),
|
|
9969
|
-
subcircuit_id: subcircuit2?.subcircuit_id ?? void 0,
|
|
9970
|
-
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
|
|
9971
|
-
...matchCenter2,
|
|
9972
|
-
source_port_id: this.source_port_id,
|
|
9973
|
-
is_board_pinout: false
|
|
9974
|
-
});
|
|
9975
|
-
this.pcb_port_id = pcb_port2.pcb_port_id;
|
|
10002
|
+
Port_tryRenderGroupPcbPort(this);
|
|
9976
10003
|
return;
|
|
9977
10004
|
}
|
|
9978
10005
|
const pcbMatches = this.matchedComponents.filter((c) => c.isPcbPrimitive);
|
|
@@ -10006,6 +10033,10 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
10006
10033
|
});
|
|
10007
10034
|
this.pcb_port_id = pcb_port.pcb_port_id;
|
|
10008
10035
|
}
|
|
10036
|
+
doInitialPcbPortAttachment() {
|
|
10037
|
+
if (!this.isGroupPort() || this.pcb_port_id) return;
|
|
10038
|
+
Port_tryRenderGroupPcbPort(this);
|
|
10039
|
+
}
|
|
10009
10040
|
/**
|
|
10010
10041
|
* Get the best display label for this port based on port_hints
|
|
10011
10042
|
* Filters out generic patterns and applies showPinAliases logic
|
|
@@ -19318,6 +19349,49 @@ function getReservedChipSize({
|
|
|
19318
19349
|
const growsPastGap = rotatedSize.x - unrotatedSize.x >= chipGap || rotatedSize.y - unrotatedSize.y >= chipGap;
|
|
19319
19350
|
return growsPastGap ? rotatedSize : unrotatedSize;
|
|
19320
19351
|
}
|
|
19352
|
+
function getNestedGroupMatchpackProxy({
|
|
19353
|
+
db,
|
|
19354
|
+
schematicGroup,
|
|
19355
|
+
groupComponents,
|
|
19356
|
+
groupInstance
|
|
19357
|
+
}) {
|
|
19358
|
+
let minX = Infinity;
|
|
19359
|
+
let maxX = -Infinity;
|
|
19360
|
+
let minY = Infinity;
|
|
19361
|
+
let maxY = -Infinity;
|
|
19362
|
+
let hasValidBounds = false;
|
|
19363
|
+
for (const component of groupComponents) {
|
|
19364
|
+
if (!component.center || !component.size) continue;
|
|
19365
|
+
hasValidBounds = true;
|
|
19366
|
+
const componentBounds = getSchematicComponentWithTextBounds({
|
|
19367
|
+
db,
|
|
19368
|
+
schematicComponent: component
|
|
19369
|
+
}) ?? getBoundFromCenteredRect2({
|
|
19370
|
+
center: component.center,
|
|
19371
|
+
width: component.size.width,
|
|
19372
|
+
height: component.size.height
|
|
19373
|
+
});
|
|
19374
|
+
minX = Math.min(minX, componentBounds.minX);
|
|
19375
|
+
maxX = Math.max(maxX, componentBounds.maxX);
|
|
19376
|
+
minY = Math.min(minY, componentBounds.minY);
|
|
19377
|
+
maxY = Math.max(maxY, componentBounds.maxY);
|
|
19378
|
+
}
|
|
19379
|
+
const marginLeft = groupInstance?._parsedProps?.schMarginLeft ?? groupInstance?._parsedProps?.schMarginX ?? 0;
|
|
19380
|
+
const marginRight = groupInstance?._parsedProps?.schMarginRight ?? groupInstance?._parsedProps?.schMarginX ?? 0;
|
|
19381
|
+
const marginTop = groupInstance?._parsedProps?.schMarginTop ?? groupInstance?._parsedProps?.schMarginY ?? 0;
|
|
19382
|
+
const marginBottom = groupInstance?._parsedProps?.schMarginBottom ?? groupInstance?._parsedProps?.schMarginY ?? 0;
|
|
19383
|
+
const contentCenter = hasValidBounds ? { x: (minX + maxX) / 2, y: (minY + maxY) / 2 } : schematicGroup.center ?? { x: 0, y: 0 };
|
|
19384
|
+
return {
|
|
19385
|
+
center: {
|
|
19386
|
+
x: contentCenter.x + (marginRight - marginLeft) / 2,
|
|
19387
|
+
y: contentCenter.y + (marginTop - marginBottom) / 2
|
|
19388
|
+
},
|
|
19389
|
+
size: {
|
|
19390
|
+
x: (hasValidBounds ? maxX - minX : 2) + marginLeft + marginRight,
|
|
19391
|
+
y: (hasValidBounds ? maxY - minY : 2) + marginTop + marginBottom
|
|
19392
|
+
}
|
|
19393
|
+
};
|
|
19394
|
+
}
|
|
19321
19395
|
function isTreeChildExplicitlyPositioned(treeChild, group) {
|
|
19322
19396
|
if (treeChild.nodeType === "component" && treeChild.sourceComponent) {
|
|
19323
19397
|
const component = group.children.find(
|
|
@@ -19353,6 +19427,7 @@ function convertTreeToMatchPackInputProblem(tree, db, group) {
|
|
|
19353
19427
|
decouplingCapsGap: 0.4,
|
|
19354
19428
|
partitionGap: 1.2
|
|
19355
19429
|
};
|
|
19430
|
+
const nestedGroupMatchpackProxyMap = {};
|
|
19356
19431
|
const groupOffset = group._getGlobalSchematicPositionBeforeLayout();
|
|
19357
19432
|
debug6(
|
|
19358
19433
|
`[${group.name}] Processing ${tree.childNodes.length} child nodes for input problem`
|
|
@@ -19464,38 +19539,15 @@ function convertTreeToMatchPackInputProblem(tree, db, group) {
|
|
|
19464
19539
|
`[${group.name}] Group ${groupId} has ${groupComponents.length} components:`,
|
|
19465
19540
|
groupComponents.map((c) => c.source_component_id)
|
|
19466
19541
|
);
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
hasValidBounds = true;
|
|
19475
|
-
const compBounds = getSchematicComponentWithTextBounds({
|
|
19476
|
-
db,
|
|
19477
|
-
schematicComponent: comp
|
|
19478
|
-
}) ?? getBoundFromCenteredRect2({
|
|
19479
|
-
center: comp.center,
|
|
19480
|
-
width: comp.size.width,
|
|
19481
|
-
height: comp.size.height
|
|
19482
|
-
});
|
|
19483
|
-
minX = Math.min(minX, compBounds.minX);
|
|
19484
|
-
maxX = Math.max(maxX, compBounds.maxX);
|
|
19485
|
-
minY = Math.min(minY, compBounds.minY);
|
|
19486
|
-
maxY = Math.max(maxY, compBounds.maxY);
|
|
19487
|
-
}
|
|
19488
|
-
}
|
|
19489
|
-
const marginLeft = groupInstance?._parsedProps?.schMarginLeft ?? groupInstance?._parsedProps?.schMarginX ?? 0;
|
|
19490
|
-
const marginRight = groupInstance?._parsedProps?.schMarginRight ?? groupInstance?._parsedProps?.schMarginX ?? 0;
|
|
19491
|
-
const marginTop = groupInstance?._parsedProps?.schMarginTop ?? groupInstance?._parsedProps?.schMarginY ?? 0;
|
|
19492
|
-
const marginBottom = groupInstance?._parsedProps?.schMarginBottom ?? groupInstance?._parsedProps?.schMarginY ?? 0;
|
|
19493
|
-
const marginXShift = (marginRight - marginLeft) / 2;
|
|
19494
|
-
const marginYShift = (marginTop - marginBottom) / 2;
|
|
19495
|
-
const groupWidth = (hasValidBounds ? maxX - minX : 2) + marginLeft + marginRight;
|
|
19496
|
-
const groupHeight = (hasValidBounds ? maxY - minY : 2) + marginTop + marginBottom;
|
|
19542
|
+
const matchpackProxy = getNestedGroupMatchpackProxy({
|
|
19543
|
+
db,
|
|
19544
|
+
schematicGroup,
|
|
19545
|
+
groupComponents,
|
|
19546
|
+
groupInstance
|
|
19547
|
+
});
|
|
19548
|
+
nestedGroupMatchpackProxyMap[groupId] = matchpackProxy;
|
|
19497
19549
|
debug6(
|
|
19498
|
-
`[${group.name}] Group ${groupId} computed
|
|
19550
|
+
`[${group.name}] Group ${groupId} computed proxy: ${matchpackProxy.size.x} x ${matchpackProxy.size.y} centered at (${matchpackProxy.center.x}, ${matchpackProxy.center.y})`
|
|
19499
19551
|
);
|
|
19500
19552
|
const groupPins = [];
|
|
19501
19553
|
for (const comp of groupComponents) {
|
|
@@ -19507,13 +19559,12 @@ function convertTreeToMatchPackInputProblem(tree, db, group) {
|
|
|
19507
19559
|
if (!sourcePort) continue;
|
|
19508
19560
|
const pinId = `${groupId}.${sourcePort.pin_number || sourcePort.name || port.schematic_port_id}`;
|
|
19509
19561
|
groupPins.push(pinId);
|
|
19510
|
-
const groupCenter = schematicGroup.center || { x: 0, y: 0 };
|
|
19511
19562
|
const side = facingDirectionToSide(port.facing_direction);
|
|
19512
19563
|
problem.chipPinMap[pinId] = {
|
|
19513
19564
|
pinId,
|
|
19514
19565
|
offset: {
|
|
19515
|
-
x: (port.center?.x || 0) -
|
|
19516
|
-
y: (port.center?.y || 0) -
|
|
19566
|
+
x: (port.center?.x || 0) - matchpackProxy.center.x,
|
|
19567
|
+
y: (port.center?.y || 0) - matchpackProxy.center.y
|
|
19517
19568
|
},
|
|
19518
19569
|
side
|
|
19519
19570
|
};
|
|
@@ -19526,10 +19577,7 @@ function convertTreeToMatchPackInputProblem(tree, db, group) {
|
|
|
19526
19577
|
problem.chipMap[groupId] = {
|
|
19527
19578
|
chipId: groupId,
|
|
19528
19579
|
pins: groupPins,
|
|
19529
|
-
size:
|
|
19530
|
-
x: groupWidth,
|
|
19531
|
-
y: groupHeight
|
|
19532
|
-
}
|
|
19580
|
+
size: matchpackProxy.size
|
|
19533
19581
|
};
|
|
19534
19582
|
debug6(`[${group.name}] Added group ${groupId} to chipMap`);
|
|
19535
19583
|
} else {
|
|
@@ -19681,7 +19729,7 @@ function convertTreeToMatchPackInputProblem(tree, db, group) {
|
|
|
19681
19729
|
);
|
|
19682
19730
|
}
|
|
19683
19731
|
}
|
|
19684
|
-
return problem;
|
|
19732
|
+
return { inputProblem: problem, nestedGroupMatchpackProxyMap };
|
|
19685
19733
|
}
|
|
19686
19734
|
function applySchematicMatchPackLayoutToTree(group, tree) {
|
|
19687
19735
|
const { db } = group.root;
|
|
@@ -19696,7 +19744,7 @@ function applySchematicMatchPackLayoutToTree(group, tree) {
|
|
|
19696
19744
|
return;
|
|
19697
19745
|
}
|
|
19698
19746
|
debug6("Converting circuit tree to InputProblem...");
|
|
19699
|
-
const inputProblem = convertTreeToMatchPackInputProblem(tree, db, group);
|
|
19747
|
+
const { inputProblem, nestedGroupMatchpackProxyMap } = convertTreeToMatchPackInputProblem(tree, db, group);
|
|
19700
19748
|
if (debug6.enabled) {
|
|
19701
19749
|
group.root?.emit("debug:logOutput", {
|
|
19702
19750
|
type: "debug:logOutput",
|
|
@@ -19870,7 +19918,8 @@ function applySchematicMatchPackLayoutToTree(group, tree) {
|
|
|
19870
19918
|
debug6(
|
|
19871
19919
|
`Group ${chipId} has ${groupComponents.length} components to move`
|
|
19872
19920
|
);
|
|
19873
|
-
const
|
|
19921
|
+
const matchpackProxy = nestedGroupMatchpackProxyMap[chipId];
|
|
19922
|
+
const oldCenter = matchpackProxy?.center ?? schematicGroup.center ?? { x: 0, y: 0 };
|
|
19874
19923
|
const positionDelta = {
|
|
19875
19924
|
x: newCenter.x - oldCenter.x,
|
|
19876
19925
|
y: newCenter.y - oldCenter.y
|
|
@@ -19904,9 +19953,19 @@ function applySchematicMatchPackLayoutToTree(group, tree) {
|
|
|
19904
19953
|
text.position.y += positionDelta.y;
|
|
19905
19954
|
}
|
|
19906
19955
|
}
|
|
19956
|
+
updateSchematicPrimitivesForLayoutShift({
|
|
19957
|
+
db,
|
|
19958
|
+
schematicComponentId: component.schematic_component_id,
|
|
19959
|
+
deltaX: positionDelta.x,
|
|
19960
|
+
deltaY: positionDelta.y
|
|
19961
|
+
});
|
|
19907
19962
|
}
|
|
19908
19963
|
}
|
|
19909
19964
|
schematicGroup.center = newCenter;
|
|
19965
|
+
if (matchpackProxy) {
|
|
19966
|
+
schematicGroup.width = matchpackProxy.size.x;
|
|
19967
|
+
schematicGroup.height = matchpackProxy.size.y;
|
|
19968
|
+
}
|
|
19910
19969
|
debug6(
|
|
19911
19970
|
`Updated group ${chipId} center to (${newCenter.x}, ${newCenter.y})`
|
|
19912
19971
|
);
|
|
@@ -21498,7 +21557,7 @@ var getSourcePortNetLabelText = (db, sourcePortId) => {
|
|
|
21498
21557
|
if (!sourceComponent?.name || !sourcePort.name) return void 0;
|
|
21499
21558
|
return `${sourceComponent.name}_${sourcePort.name}`;
|
|
21500
21559
|
};
|
|
21501
|
-
var
|
|
21560
|
+
var getDirectCrossSubcircuitConnectedSourcePortId = (db, sourcePortId) => {
|
|
21502
21561
|
const sourcePort = db.source_port.get(sourcePortId);
|
|
21503
21562
|
if (!sourcePort) return void 0;
|
|
21504
21563
|
for (const sourceTrace of db.source_trace.list()) {
|
|
@@ -21513,9 +21572,17 @@ var getDirectCrossSubcircuitConnectionLabelText = (db, sourcePortId) => {
|
|
|
21513
21572
|
const otherSourcePort = db.source_port.get(otherSourcePortId);
|
|
21514
21573
|
if (!otherSourcePort) continue;
|
|
21515
21574
|
if (otherSourcePort.subcircuit_id === sourcePort.subcircuit_id) continue;
|
|
21516
|
-
return
|
|
21575
|
+
return otherSourcePortId;
|
|
21517
21576
|
}
|
|
21518
21577
|
};
|
|
21578
|
+
var getDirectCrossSubcircuitConnectionLabelText = (db, sourcePortId) => {
|
|
21579
|
+
const otherSourcePortId = getDirectCrossSubcircuitConnectedSourcePortId(
|
|
21580
|
+
db,
|
|
21581
|
+
sourcePortId
|
|
21582
|
+
);
|
|
21583
|
+
if (!otherSourcePortId) return void 0;
|
|
21584
|
+
return getSourcePortNetLabelText(db, otherSourcePortId);
|
|
21585
|
+
};
|
|
21519
21586
|
var insertNetLabelsForPortsMissingTrace = ({
|
|
21520
21587
|
allSourceAndSchematicPortIdsInScope,
|
|
21521
21588
|
group,
|
|
@@ -21532,6 +21599,9 @@ var insertNetLabelsForPortsMissingTrace = ({
|
|
|
21532
21599
|
const srcPortId = schPortIdToSourcePortId.get(schOrSrcPortId);
|
|
21533
21600
|
if (!srcPortId) continue;
|
|
21534
21601
|
const sourcePort = db.source_port.get(srcPortId);
|
|
21602
|
+
if (group._parsedProps.showAsSchematicBox && sourcePort?.subcircuit_id === group.subcircuit_id && !sourcePort.source_component_id && getDirectCrossSubcircuitConnectedSourcePortId(db, srcPortId)) {
|
|
21603
|
+
continue;
|
|
21604
|
+
}
|
|
21535
21605
|
const connKey = sourcePort?.subcircuit_connectivity_map_key;
|
|
21536
21606
|
if (!connKey) continue;
|
|
21537
21607
|
const sourceNet = connKeyToSourceNet.get(connKey);
|
|
@@ -22487,7 +22557,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
22487
22557
|
var package_default = {
|
|
22488
22558
|
name: "@tscircuit/core",
|
|
22489
22559
|
type: "module",
|
|
22490
|
-
version: "0.0.
|
|
22560
|
+
version: "0.0.1437",
|
|
22491
22561
|
types: "dist/index.d.ts",
|
|
22492
22562
|
main: "dist/index.js",
|
|
22493
22563
|
module: "dist/index.js",
|