@tscircuit/core 0.0.130 → 0.0.132
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 +9 -4
- package/dist/index.js +43 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1218,6 +1218,14 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
|
|
|
1218
1218
|
doInitialSourceRender(): void;
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
+
type PortInfo = {
|
|
1222
|
+
trueIndex: number;
|
|
1223
|
+
pinNumber: number;
|
|
1224
|
+
side: "left" | "right" | "top" | "bottom" | "center";
|
|
1225
|
+
distanceFromEdge: number;
|
|
1226
|
+
x: number;
|
|
1227
|
+
y: number;
|
|
1228
|
+
};
|
|
1221
1229
|
/**
|
|
1222
1230
|
* Get the dimensions of a schematic box based on the provided parameters.
|
|
1223
1231
|
*
|
|
@@ -1234,10 +1242,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
|
|
|
1234
1242
|
*/
|
|
1235
1243
|
interface SchematicBoxDimensions {
|
|
1236
1244
|
pinCount: number;
|
|
1237
|
-
getPortPositionByPinNumber(pinNumber: number):
|
|
1238
|
-
x: number;
|
|
1239
|
-
y: number;
|
|
1240
|
-
};
|
|
1245
|
+
getPortPositionByPinNumber(pinNumber: number): PortInfo;
|
|
1241
1246
|
getSize(): {
|
|
1242
1247
|
width: number;
|
|
1243
1248
|
height: number;
|
package/dist/index.js
CHANGED
|
@@ -1672,6 +1672,17 @@ var Port = class extends PrimitiveComponent {
|
|
|
1672
1672
|
center.x += containerCenter.x;
|
|
1673
1673
|
center.y += containerCenter.y;
|
|
1674
1674
|
}
|
|
1675
|
+
if (this.getSubcircuit().props._schDebugObjectsEnabled) {
|
|
1676
|
+
db.schematic_debug_object.insert({
|
|
1677
|
+
shape: "rect",
|
|
1678
|
+
center,
|
|
1679
|
+
size: {
|
|
1680
|
+
width: 0.1,
|
|
1681
|
+
height: 0.1
|
|
1682
|
+
},
|
|
1683
|
+
label: "obstacle"
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1675
1686
|
this.facingDirection = getRelativeDirection(containerCenter, center);
|
|
1676
1687
|
const schematic_port = db.schematic_port.insert({
|
|
1677
1688
|
schematic_component_id: this.parent?.schematic_component_id,
|
|
@@ -2546,7 +2557,6 @@ var FTYPE = stringProxy;
|
|
|
2546
2557
|
import { traceProps } from "@tscircuit/props";
|
|
2547
2558
|
import {
|
|
2548
2559
|
MultilayerIjump,
|
|
2549
|
-
IJumpAutorouter,
|
|
2550
2560
|
getObstaclesFromSoup
|
|
2551
2561
|
} from "@tscircuit/infgrid-ijump-astar";
|
|
2552
2562
|
|
|
@@ -3183,6 +3193,16 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
|
|
|
3183
3193
|
connectedTo: []
|
|
3184
3194
|
});
|
|
3185
3195
|
}
|
|
3196
|
+
if (elm.type === "schematic_port") {
|
|
3197
|
+
obstacles.push({
|
|
3198
|
+
type: "rect",
|
|
3199
|
+
layers: ["top"],
|
|
3200
|
+
center: elm.center,
|
|
3201
|
+
width: 0.1,
|
|
3202
|
+
height: 0.1,
|
|
3203
|
+
connectedTo: []
|
|
3204
|
+
});
|
|
3205
|
+
}
|
|
3186
3206
|
}
|
|
3187
3207
|
for (const { port } of ports) {
|
|
3188
3208
|
connection.pointsToConnect.push({
|
|
@@ -3216,7 +3236,7 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
|
|
|
3216
3236
|
});
|
|
3217
3237
|
}
|
|
3218
3238
|
}
|
|
3219
|
-
let Autorouter =
|
|
3239
|
+
let Autorouter = MultilayerIjump;
|
|
3220
3240
|
if (this.getSubcircuit().props._schDirectLineRoutingEnabled) {
|
|
3221
3241
|
Autorouter = DirectLineRouter;
|
|
3222
3242
|
}
|
|
@@ -3464,7 +3484,9 @@ var getAllDimensionsForSchematicBox = (params) => {
|
|
|
3464
3484
|
trueIndex: truePinIndex,
|
|
3465
3485
|
pinNumber,
|
|
3466
3486
|
side,
|
|
3467
|
-
distanceFromEdge: currentDistanceFromEdge
|
|
3487
|
+
distanceFromEdge: currentDistanceFromEdge,
|
|
3488
|
+
x: 0,
|
|
3489
|
+
y: 0
|
|
3468
3490
|
});
|
|
3469
3491
|
if (pinStyle) {
|
|
3470
3492
|
if (isVertical) {
|
|
@@ -3553,12 +3575,19 @@ var getAllDimensionsForSchematicBox = (params) => {
|
|
|
3553
3575
|
};
|
|
3554
3576
|
const truePortsWithPositions = orderedTruePorts.map((p) => {
|
|
3555
3577
|
const { distanceFromEdge, side } = p;
|
|
3578
|
+
if (side === "center") {
|
|
3579
|
+
return {
|
|
3580
|
+
...p,
|
|
3581
|
+
x: 0,
|
|
3582
|
+
y: 0
|
|
3583
|
+
};
|
|
3584
|
+
}
|
|
3556
3585
|
const edgePos = trueEdgePositions[side];
|
|
3557
3586
|
const edgeDir = trueEdgeTraversalDirections[side];
|
|
3558
3587
|
return {
|
|
3588
|
+
...p,
|
|
3559
3589
|
x: edgePos.x + distanceFromEdge * edgeDir.x,
|
|
3560
|
-
y: edgePos.y + distanceFromEdge * edgeDir.y
|
|
3561
|
-
...p
|
|
3590
|
+
y: edgePos.y + distanceFromEdge * edgeDir.y
|
|
3562
3591
|
};
|
|
3563
3592
|
});
|
|
3564
3593
|
return {
|
|
@@ -3567,7 +3596,15 @@ var getAllDimensionsForSchematicBox = (params) => {
|
|
|
3567
3596
|
(p) => p.pinNumber.toString() === pinNumber.toString()
|
|
3568
3597
|
);
|
|
3569
3598
|
if (!port) {
|
|
3570
|
-
return {
|
|
3599
|
+
return {
|
|
3600
|
+
trueIndex: -1,
|
|
3601
|
+
// Use -1 for non-existent ports
|
|
3602
|
+
pinNumber,
|
|
3603
|
+
side: "center",
|
|
3604
|
+
distanceFromEdge: 0,
|
|
3605
|
+
x: 0,
|
|
3606
|
+
y: 0
|
|
3607
|
+
};
|
|
3571
3608
|
}
|
|
3572
3609
|
return port;
|
|
3573
3610
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.132",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@tscircuit/soup-util": "^0.0.33",
|
|
45
45
|
"circuit-json": "^0.0.91",
|
|
46
46
|
"circuit-json-to-connectivity-map": "^0.0.17",
|
|
47
|
-
"circuit-to-svg": "^0.0.
|
|
47
|
+
"circuit-to-svg": "^0.0.55",
|
|
48
48
|
"nanoid": "^5.0.7",
|
|
49
49
|
"performance-now": "^2.1.0",
|
|
50
50
|
"react": "^18.3.1",
|