@tscircuit/core 0.0.917 → 0.0.919
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 +34 -5
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ interface BoardI {
|
|
|
118
118
|
_connectedSchematicPortPairs: Set<string>;
|
|
119
119
|
allLayers: ReadonlyArray<LayerRef>;
|
|
120
120
|
_getBoardCalcVariables(): Record<string, number>;
|
|
121
|
+
pcb_board_id?: string | null;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
type SimplifiedPcbTrace = {
|
|
@@ -1262,6 +1263,7 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
|
|
|
1262
1263
|
doInitialCreateTracesFromProps(): void;
|
|
1263
1264
|
_createTracesFromConnectionsProp(): void;
|
|
1264
1265
|
doInitialSourceDesignRuleChecks(): void;
|
|
1266
|
+
doInitialPcbLayout(): void;
|
|
1265
1267
|
/**
|
|
1266
1268
|
* Get the minimum flex container size for this component on PCB
|
|
1267
1269
|
*/
|
package/dist/index.js
CHANGED
|
@@ -9453,6 +9453,24 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
9453
9453
|
doInitialSourceDesignRuleChecks() {
|
|
9454
9454
|
NormalComponent_doInitialSourceDesignRuleChecks(this);
|
|
9455
9455
|
}
|
|
9456
|
+
doInitialPcbLayout() {
|
|
9457
|
+
if (this.root?.pcbDisabled) return;
|
|
9458
|
+
if (!this.pcb_component_id) return;
|
|
9459
|
+
const { db } = this.root;
|
|
9460
|
+
const props = this._parsedProps;
|
|
9461
|
+
const hasExplicitPcbPosition = props.pcbX !== void 0 || props.pcbY !== void 0;
|
|
9462
|
+
if (!hasExplicitPcbPosition) return;
|
|
9463
|
+
const sourceComponent = db.source_component.get(this.source_component_id);
|
|
9464
|
+
const positionedRelativeToGroupId = sourceComponent?.source_group_id ? db.pcb_group.getWhere({
|
|
9465
|
+
source_group_id: sourceComponent.source_group_id
|
|
9466
|
+
})?.pcb_group_id : void 0;
|
|
9467
|
+
const positionedRelativeToBoardId = positionedRelativeToGroupId ? void 0 : this._getBoard()?.pcb_board_id ?? void 0;
|
|
9468
|
+
db.pcb_component.update(this.pcb_component_id, {
|
|
9469
|
+
position_mode: "relative_to_group_anchor",
|
|
9470
|
+
positioned_relative_to_pcb_group_id: positionedRelativeToGroupId,
|
|
9471
|
+
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId
|
|
9472
|
+
});
|
|
9473
|
+
}
|
|
9456
9474
|
/**
|
|
9457
9475
|
* Get the minimum flex container size for this component on PCB
|
|
9458
9476
|
*/
|
|
@@ -12146,6 +12164,9 @@ var applyPackOutput = (group, packOutput, clusterMap) => {
|
|
|
12146
12164
|
for (const memberId of cluster.componentIds) {
|
|
12147
12165
|
const rel = cluster.relativeCenters[memberId];
|
|
12148
12166
|
if (!rel) continue;
|
|
12167
|
+
db.pcb_component.update(memberId, {
|
|
12168
|
+
position_mode: "packed"
|
|
12169
|
+
});
|
|
12149
12170
|
const rotatedRel = {
|
|
12150
12171
|
x: rel.x * Math.cos(angleRad) - rel.y * Math.sin(angleRad),
|
|
12151
12172
|
y: rel.x * Math.sin(angleRad) + rel.y * Math.cos(angleRad)
|
|
@@ -12174,6 +12195,9 @@ var applyPackOutput = (group, packOutput, clusterMap) => {
|
|
|
12174
12195
|
}
|
|
12175
12196
|
const pcbComponent = db.pcb_component.get(componentId);
|
|
12176
12197
|
if (pcbComponent) {
|
|
12198
|
+
db.pcb_component.update(componentId, {
|
|
12199
|
+
position_mode: "packed"
|
|
12200
|
+
});
|
|
12177
12201
|
const currentGroupId = group.source_group_id;
|
|
12178
12202
|
const sourceComponent = db.source_component.get(
|
|
12179
12203
|
pcbComponent.source_component_id
|
|
@@ -12250,6 +12274,13 @@ var applyPackOutput = (group, packOutput, clusterMap) => {
|
|
|
12250
12274
|
}
|
|
12251
12275
|
return false;
|
|
12252
12276
|
});
|
|
12277
|
+
for (const elm of relatedElements) {
|
|
12278
|
+
if (elm.type === "pcb_component") {
|
|
12279
|
+
db.pcb_component.update(elm.pcb_component_id, {
|
|
12280
|
+
position_mode: "packed"
|
|
12281
|
+
});
|
|
12282
|
+
}
|
|
12283
|
+
}
|
|
12253
12284
|
transformPCBElements(relatedElements, transformMatrix);
|
|
12254
12285
|
db.pcb_group.update(pcbGroup.pcb_group_id, { center });
|
|
12255
12286
|
}
|
|
@@ -16412,8 +16443,6 @@ var Interconnect = class extends NormalComponent3 {
|
|
|
16412
16443
|
if (sourcePortIds.length >= 2) {
|
|
16413
16444
|
db.source_component_internal_connection.insert({
|
|
16414
16445
|
source_component_id: this.source_component_id,
|
|
16415
|
-
// @ts-expect-error uncomment when circuit-json includes subcircuit_id
|
|
16416
|
-
// in the source_component_internal_connection schema
|
|
16417
16446
|
subcircuit_id: this.getSubcircuit()?.subcircuit_id,
|
|
16418
16447
|
source_port_ids: sourcePortIds
|
|
16419
16448
|
});
|
|
@@ -19249,7 +19278,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19249
19278
|
var package_default = {
|
|
19250
19279
|
name: "@tscircuit/core",
|
|
19251
19280
|
type: "module",
|
|
19252
|
-
version: "0.0.
|
|
19281
|
+
version: "0.0.918",
|
|
19253
19282
|
types: "dist/index.d.ts",
|
|
19254
19283
|
main: "dist/index.js",
|
|
19255
19284
|
module: "dist/index.js",
|
|
@@ -19307,13 +19336,13 @@ var package_default = {
|
|
|
19307
19336
|
"bun-match-svg": "0.0.12",
|
|
19308
19337
|
"calculate-elbow": "^0.0.12",
|
|
19309
19338
|
"chokidar-cli": "^3.0.0",
|
|
19310
|
-
"circuit-json": "^0.0.
|
|
19339
|
+
"circuit-json": "^0.0.331",
|
|
19311
19340
|
"circuit-json-to-bpc": "^0.0.13",
|
|
19312
19341
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
19313
19342
|
"circuit-json-to-gltf": "^0.0.31",
|
|
19314
19343
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
19315
19344
|
"circuit-json-to-spice": "^0.0.30",
|
|
19316
|
-
"circuit-to-svg": "^0.0.
|
|
19345
|
+
"circuit-to-svg": "^0.0.288",
|
|
19317
19346
|
concurrently: "^9.1.2",
|
|
19318
19347
|
"connectivity-map": "^1.0.0",
|
|
19319
19348
|
debug: "^4.3.6",
|
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.919",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.331",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
67
|
"circuit-json-to-spice": "^0.0.30",
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
68
|
+
"circuit-to-svg": "^0.0.288",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|