@tscircuit/core 0.0.185 → 0.0.187
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 +36 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4353,6 +4353,17 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
|
|
|
4353
4353
|
connectedTo: []
|
|
4354
4354
|
});
|
|
4355
4355
|
}
|
|
4356
|
+
if (elm.type === "schematic_text") {
|
|
4357
|
+
obstacles.push({
|
|
4358
|
+
type: "rect",
|
|
4359
|
+
layers: ["top"],
|
|
4360
|
+
center: elm.position,
|
|
4361
|
+
// Approximate text bounds based on text length
|
|
4362
|
+
width: (elm.text?.length ?? 0) * 0.1,
|
|
4363
|
+
height: 0.2,
|
|
4364
|
+
connectedTo: []
|
|
4365
|
+
});
|
|
4366
|
+
}
|
|
4356
4367
|
}
|
|
4357
4368
|
const portsWithPosition = connectedPorts.map(({ port }) => ({
|
|
4358
4369
|
port,
|
|
@@ -4521,6 +4532,31 @@ var Chip = class extends NormalComponent {
|
|
|
4521
4532
|
manufacturer_part_number: props.manufacturerPartNumber,
|
|
4522
4533
|
supplier_part_numbers: props.supplierPartNumbers
|
|
4523
4534
|
});
|
|
4535
|
+
const dimensions = this._getSchematicBoxDimensions();
|
|
4536
|
+
const schematic_box_width = dimensions?.getSize().width;
|
|
4537
|
+
const schematic_box_height = dimensions?.getSize().height;
|
|
4538
|
+
const manufacturer_part_number_text = db.schematic_text.insert({
|
|
4539
|
+
text: props.manufacturerPartNumber ?? "",
|
|
4540
|
+
schematic_component_id: source_component.source_component_id,
|
|
4541
|
+
anchor: "left",
|
|
4542
|
+
rotation: 0,
|
|
4543
|
+
position: {
|
|
4544
|
+
x: (props.schX ?? 0) + (schematic_box_width ?? 0) / 2,
|
|
4545
|
+
y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55
|
|
4546
|
+
},
|
|
4547
|
+
color: "#006464"
|
|
4548
|
+
});
|
|
4549
|
+
const component_name_text = db.schematic_text.insert({
|
|
4550
|
+
text: props.name ?? "",
|
|
4551
|
+
schematic_component_id: source_component.source_component_id,
|
|
4552
|
+
anchor: "left",
|
|
4553
|
+
rotation: 0,
|
|
4554
|
+
position: {
|
|
4555
|
+
x: (props.schX ?? 0) + (schematic_box_width ?? 0) / 2,
|
|
4556
|
+
y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35
|
|
4557
|
+
},
|
|
4558
|
+
color: "#006464"
|
|
4559
|
+
});
|
|
4524
4560
|
this.source_component_id = source_component.source_component_id;
|
|
4525
4561
|
}
|
|
4526
4562
|
doInitialPcbComponentRender() {
|
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.187",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tscircuit/soup-util": "^0.0.40",
|
|
46
46
|
"circuit-json": "^0.0.104",
|
|
47
47
|
"circuit-json-to-connectivity-map": "^0.0.17",
|
|
48
|
-
"circuit-to-svg": "^0.0.
|
|
48
|
+
"circuit-to-svg": "^0.0.80",
|
|
49
49
|
"format-si-unit": "^0.0.2",
|
|
50
50
|
"nanoid": "^5.0.7",
|
|
51
51
|
"performance-now": "^2.1.0",
|