@tscircuit/core 0.0.188 → 0.0.189
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 +45 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4536,6 +4536,7 @@ var Chip = class extends NormalComponent {
|
|
|
4536
4536
|
supplier_part_numbers: props.supplierPartNumbers
|
|
4537
4537
|
});
|
|
4538
4538
|
const dimensions = this._getSchematicBoxDimensions();
|
|
4539
|
+
const hasOnlyLeftAndRightPins = props.schPortArrangement?.topSide !== void 0 && props.schPortArrangement?.bottomSide !== void 0;
|
|
4539
4540
|
const schematic_box_width = dimensions?.getSize().width;
|
|
4540
4541
|
const schematic_box_height = dimensions?.getSize().height;
|
|
4541
4542
|
const manufacturer_part_number_text = db.schematic_text.insert({
|
|
@@ -4544,8 +4545,8 @@ var Chip = class extends NormalComponent {
|
|
|
4544
4545
|
anchor: "left",
|
|
4545
4546
|
rotation: 0,
|
|
4546
4547
|
position: {
|
|
4547
|
-
x: (props.schX ?? 0) + (schematic_box_width ?? 0) / 2,
|
|
4548
|
-
y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55
|
|
4548
|
+
x: hasOnlyLeftAndRightPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
4549
|
+
y: hasOnlyLeftAndRightPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55 : (props.schY ?? 0) - (schematic_box_height ?? 0) / 2 - 0.13
|
|
4549
4550
|
},
|
|
4550
4551
|
color: "#006464"
|
|
4551
4552
|
});
|
|
@@ -4555,8 +4556,8 @@ var Chip = class extends NormalComponent {
|
|
|
4555
4556
|
anchor: "left",
|
|
4556
4557
|
rotation: 0,
|
|
4557
4558
|
position: {
|
|
4558
|
-
x: (props.schX ?? 0) + (schematic_box_width ?? 0) / 2,
|
|
4559
|
-
y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35
|
|
4559
|
+
x: hasOnlyLeftAndRightPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
4560
|
+
y: hasOnlyLeftAndRightPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35 : (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
|
|
4560
4561
|
},
|
|
4561
4562
|
color: "#006464"
|
|
4562
4563
|
});
|
|
@@ -4626,6 +4627,32 @@ var Jumper = class extends NormalComponent {
|
|
|
4626
4627
|
manufacturer_part_number: props.manufacturerPartNumber,
|
|
4627
4628
|
supplier_part_numbers: props.supplierPartNumbers
|
|
4628
4629
|
});
|
|
4630
|
+
const dimensions = this._getSchematicBoxDimensions();
|
|
4631
|
+
const hasOnlyLeftAndRightPins = props.schPortArrangement?.topSide !== void 0 && props.schPortArrangement?.bottomSide !== void 0;
|
|
4632
|
+
const schematic_box_width = dimensions?.getSize().width;
|
|
4633
|
+
const schematic_box_height = dimensions?.getSize().height;
|
|
4634
|
+
const manufacturer_part_number_text = db.schematic_text.insert({
|
|
4635
|
+
text: props.manufacturerPartNumber ?? "",
|
|
4636
|
+
schematic_component_id: source_component.source_component_id,
|
|
4637
|
+
anchor: "left",
|
|
4638
|
+
rotation: 0,
|
|
4639
|
+
position: {
|
|
4640
|
+
x: hasOnlyLeftAndRightPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
4641
|
+
y: hasOnlyLeftAndRightPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55 : (props.schY ?? 0) - (schematic_box_height ?? 0) / 2 - 0.13
|
|
4642
|
+
},
|
|
4643
|
+
color: "#006464"
|
|
4644
|
+
});
|
|
4645
|
+
const component_name_text = db.schematic_text.insert({
|
|
4646
|
+
text: props.name ?? "",
|
|
4647
|
+
schematic_component_id: source_component.source_component_id,
|
|
4648
|
+
anchor: "left",
|
|
4649
|
+
rotation: 0,
|
|
4650
|
+
position: {
|
|
4651
|
+
x: hasOnlyLeftAndRightPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
4652
|
+
y: hasOnlyLeftAndRightPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35 : (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
|
|
4653
|
+
},
|
|
4654
|
+
color: "#006464"
|
|
4655
|
+
});
|
|
4629
4656
|
this.source_component_id = source_component.source_component_id;
|
|
4630
4657
|
}
|
|
4631
4658
|
doInitialPcbComponentRender() {
|
|
@@ -5176,6 +5203,20 @@ var PinHeader = class extends NormalComponent {
|
|
|
5176
5203
|
// gender: props.gender,
|
|
5177
5204
|
// pitch: props.pitch,
|
|
5178
5205
|
});
|
|
5206
|
+
const dimensions = this._getSchematicBoxDimensions();
|
|
5207
|
+
const schematic_box_width = dimensions?.getSize().width;
|
|
5208
|
+
const schematic_box_height = dimensions?.getSize().height;
|
|
5209
|
+
const component_name_text = db.schematic_text.insert({
|
|
5210
|
+
text: props.name ?? "",
|
|
5211
|
+
schematic_component_id: source_component.source_component_id,
|
|
5212
|
+
anchor: "left",
|
|
5213
|
+
rotation: 0,
|
|
5214
|
+
position: {
|
|
5215
|
+
x: (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
5216
|
+
y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
|
|
5217
|
+
},
|
|
5218
|
+
color: "#006464"
|
|
5219
|
+
});
|
|
5179
5220
|
this.source_component_id = source_component.source_component_id;
|
|
5180
5221
|
}
|
|
5181
5222
|
};
|
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.189",
|
|
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.81",
|
|
49
49
|
"format-si-unit": "^0.0.2",
|
|
50
50
|
"nanoid": "^5.0.7",
|
|
51
51
|
"performance-now": "^2.1.0",
|