@tscircuit/core 0.0.212 → 0.0.213
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 +25 -44
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2898,6 +2898,31 @@ var NormalComponent = class extends PrimitiveComponent {
|
|
|
2898
2898
|
port_labels: primaryPortLabels,
|
|
2899
2899
|
source_component_id: this.source_component_id
|
|
2900
2900
|
});
|
|
2901
|
+
const hasTopOrBottomPins = props.schPortArrangement?.topSide !== void 0 || props.schPortArrangement?.bottomSide !== void 0;
|
|
2902
|
+
const schematic_box_width = dimensions?.getSize().width;
|
|
2903
|
+
const schematic_box_height = dimensions?.getSize().height;
|
|
2904
|
+
const manufacturer_part_number_schematic_text = db.schematic_text.insert({
|
|
2905
|
+
text: props.manufacturerPartNumber ?? "",
|
|
2906
|
+
schematic_component_id: schematic_component2.schematic_component_id,
|
|
2907
|
+
anchor: "left",
|
|
2908
|
+
rotation: 0,
|
|
2909
|
+
position: {
|
|
2910
|
+
x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
2911
|
+
y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35 : (props.schY ?? 0) - (schematic_box_height ?? 0) / 2 - 0.13
|
|
2912
|
+
},
|
|
2913
|
+
color: "#006464"
|
|
2914
|
+
});
|
|
2915
|
+
const component_name_text = db.schematic_text.insert({
|
|
2916
|
+
text: props.name ?? "",
|
|
2917
|
+
schematic_component_id: schematic_component2.source_component_id,
|
|
2918
|
+
anchor: "left",
|
|
2919
|
+
rotation: 0,
|
|
2920
|
+
position: {
|
|
2921
|
+
x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
2922
|
+
y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55 : (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
|
|
2923
|
+
},
|
|
2924
|
+
color: "#006464"
|
|
2925
|
+
});
|
|
2901
2926
|
this.schematic_component_id = schematic_component2.schematic_component_id;
|
|
2902
2927
|
}
|
|
2903
2928
|
doInitialPcbComponentRender() {
|
|
@@ -4765,34 +4790,6 @@ var Chip = class extends NormalComponent {
|
|
|
4765
4790
|
manufacturer_part_number: props.manufacturerPartNumber,
|
|
4766
4791
|
supplier_part_numbers: props.supplierPartNumbers
|
|
4767
4792
|
});
|
|
4768
|
-
if (!this.parent?.root?.schematicDisabled) {
|
|
4769
|
-
const dimensions = this._getSchematicBoxDimensions();
|
|
4770
|
-
const hasTopOrBottomPins = props.schPortArrangement?.topSide !== void 0 || props.schPortArrangement?.bottomSide !== void 0;
|
|
4771
|
-
const schematic_box_width = dimensions?.getSize().width;
|
|
4772
|
-
const schematic_box_height = dimensions?.getSize().height;
|
|
4773
|
-
const manufacturer_part_number_text = db.schematic_text.insert({
|
|
4774
|
-
text: props.manufacturerPartNumber ?? "",
|
|
4775
|
-
schematic_component_id: source_component.source_component_id,
|
|
4776
|
-
anchor: "left",
|
|
4777
|
-
rotation: 0,
|
|
4778
|
-
position: {
|
|
4779
|
-
x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
4780
|
-
y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35 : (props.schY ?? 0) - (schematic_box_height ?? 0) / 2 - 0.13
|
|
4781
|
-
},
|
|
4782
|
-
color: "#006464"
|
|
4783
|
-
});
|
|
4784
|
-
const component_name_text = db.schematic_text.insert({
|
|
4785
|
-
text: props.name ?? "",
|
|
4786
|
-
schematic_component_id: source_component.source_component_id,
|
|
4787
|
-
anchor: "left",
|
|
4788
|
-
rotation: 0,
|
|
4789
|
-
position: {
|
|
4790
|
-
x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
4791
|
-
y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55 : (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
|
|
4792
|
-
},
|
|
4793
|
-
color: "#006464"
|
|
4794
|
-
});
|
|
4795
|
-
}
|
|
4796
4793
|
this.source_component_id = source_component.source_component_id;
|
|
4797
4794
|
}
|
|
4798
4795
|
doInitialPcbComponentRender() {
|
|
@@ -5435,22 +5432,6 @@ var PinHeader = class extends NormalComponent {
|
|
|
5435
5432
|
pin_count: props.pinCount,
|
|
5436
5433
|
gender: props.gender
|
|
5437
5434
|
});
|
|
5438
|
-
if (!this.parent?.root?.schematicDisabled) {
|
|
5439
|
-
const dimensions = this._getSchematicBoxDimensions();
|
|
5440
|
-
const schematic_box_width = dimensions?.getSize().width;
|
|
5441
|
-
const schematic_box_height = dimensions?.getSize().height;
|
|
5442
|
-
const component_name_text = db.schematic_text.insert({
|
|
5443
|
-
text: props.name ?? "",
|
|
5444
|
-
schematic_component_id: source_component.source_component_id,
|
|
5445
|
-
anchor: "left",
|
|
5446
|
-
rotation: 0,
|
|
5447
|
-
position: {
|
|
5448
|
-
x: (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
|
|
5449
|
-
y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
|
|
5450
|
-
},
|
|
5451
|
-
color: "#006464"
|
|
5452
|
-
});
|
|
5453
|
-
}
|
|
5454
5435
|
this.source_component_id = source_component.source_component_id;
|
|
5455
5436
|
}
|
|
5456
5437
|
};
|