@tscircuit/core 0.0.860 → 0.0.861
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 +72 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15797,6 +15797,71 @@ function inflateSourceCapacitor(sourceElm, inflatorContext) {
|
|
|
15797
15797
|
}
|
|
15798
15798
|
}
|
|
15799
15799
|
|
|
15800
|
+
// lib/components/normal-components/Inductor.ts
|
|
15801
|
+
import { inductorProps } from "@tscircuit/props";
|
|
15802
|
+
import { formatSiUnit as formatSiUnit4 } from "format-si-unit";
|
|
15803
|
+
var Inductor = class extends NormalComponent3 {
|
|
15804
|
+
_adjustSilkscreenTextAutomatically = true;
|
|
15805
|
+
get config() {
|
|
15806
|
+
return {
|
|
15807
|
+
componentName: "Inductor",
|
|
15808
|
+
schematicSymbolName: this.props.symbolName ?? "inductor",
|
|
15809
|
+
zodProps: inductorProps,
|
|
15810
|
+
sourceFtype: FTYPE.simple_inductor
|
|
15811
|
+
};
|
|
15812
|
+
}
|
|
15813
|
+
_getSchematicSymbolDisplayValue() {
|
|
15814
|
+
return `${formatSiUnit4(this._parsedProps.inductance)}H`;
|
|
15815
|
+
}
|
|
15816
|
+
initPorts() {
|
|
15817
|
+
super.initPorts({
|
|
15818
|
+
additionalAliases: {
|
|
15819
|
+
pin1: ["anode", "pos", "left"],
|
|
15820
|
+
pin2: ["cathode", "neg", "right"]
|
|
15821
|
+
}
|
|
15822
|
+
});
|
|
15823
|
+
}
|
|
15824
|
+
doInitialSourceRender() {
|
|
15825
|
+
const { db } = this.root;
|
|
15826
|
+
const { _parsedProps: props } = this;
|
|
15827
|
+
const source_component = db.source_component.insert({
|
|
15828
|
+
name: this.name,
|
|
15829
|
+
ftype: FTYPE.simple_inductor,
|
|
15830
|
+
inductance: props.inductance,
|
|
15831
|
+
supplier_part_numbers: props.supplierPartNumbers,
|
|
15832
|
+
are_pins_interchangeable: true
|
|
15833
|
+
});
|
|
15834
|
+
this.source_component_id = source_component.source_component_id;
|
|
15835
|
+
}
|
|
15836
|
+
};
|
|
15837
|
+
|
|
15838
|
+
// lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceInductor.ts
|
|
15839
|
+
function inflateSourceInductor(sourceElm, inflatorContext) {
|
|
15840
|
+
const { injectionDb, subcircuit, groupsMap } = inflatorContext;
|
|
15841
|
+
const pcbElm = injectionDb.pcb_component.getWhere({
|
|
15842
|
+
source_component_id: sourceElm.source_component_id
|
|
15843
|
+
});
|
|
15844
|
+
const cadElm = injectionDb.cad_component.getWhere({
|
|
15845
|
+
source_component_id: sourceElm.source_component_id
|
|
15846
|
+
});
|
|
15847
|
+
const inductor = new Inductor({
|
|
15848
|
+
name: sourceElm.name,
|
|
15849
|
+
inductance: sourceElm.inductance
|
|
15850
|
+
});
|
|
15851
|
+
if (pcbElm) {
|
|
15852
|
+
inflatePcbComponent(pcbElm, {
|
|
15853
|
+
...inflatorContext,
|
|
15854
|
+
normalComponent: inductor
|
|
15855
|
+
});
|
|
15856
|
+
}
|
|
15857
|
+
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
15858
|
+
const group = groupsMap.get(sourceElm.source_group_id);
|
|
15859
|
+
group.add(inductor);
|
|
15860
|
+
} else {
|
|
15861
|
+
subcircuit.add(inductor);
|
|
15862
|
+
}
|
|
15863
|
+
}
|
|
15864
|
+
|
|
15800
15865
|
// lib/components/primitive-components/Group/Subcircuit/Subcircuit.ts
|
|
15801
15866
|
var Subcircuit = class extends Group6 {
|
|
15802
15867
|
constructor(props) {
|
|
@@ -15845,6 +15910,9 @@ var Subcircuit = class extends Group6 {
|
|
|
15845
15910
|
case "simple_capacitor":
|
|
15846
15911
|
inflateSourceCapacitor(sourceComponent, inflationCtx);
|
|
15847
15912
|
break;
|
|
15913
|
+
case "simple_inductor":
|
|
15914
|
+
inflateSourceInductor(sourceComponent, inflationCtx);
|
|
15915
|
+
break;
|
|
15848
15916
|
case "simple_chip":
|
|
15849
15917
|
inflateSourceChip(sourceComponent, inflationCtx);
|
|
15850
15918
|
break;
|
|
@@ -16643,7 +16711,7 @@ var PinHeader = class extends NormalComponent3 {
|
|
|
16643
16711
|
|
|
16644
16712
|
// lib/components/normal-components/Resonator.ts
|
|
16645
16713
|
import { resonatorProps } from "@tscircuit/props";
|
|
16646
|
-
import { formatSiUnit as
|
|
16714
|
+
import { formatSiUnit as formatSiUnit5 } from "format-si-unit";
|
|
16647
16715
|
function getResonatorSymbolName(variant) {
|
|
16648
16716
|
switch (variant) {
|
|
16649
16717
|
case "two_ground_pins":
|
|
@@ -16681,52 +16749,14 @@ var Resonator = class extends NormalComponent3 {
|
|
|
16681
16749
|
this.source_component_id = source_component.source_component_id;
|
|
16682
16750
|
}
|
|
16683
16751
|
_getSchematicSymbolDisplayValue() {
|
|
16684
|
-
const freqDisplay = `${
|
|
16752
|
+
const freqDisplay = `${formatSiUnit5(this._parsedProps.frequency)}Hz`;
|
|
16685
16753
|
if (this._parsedProps.loadCapacitance) {
|
|
16686
|
-
return `${freqDisplay} / ${
|
|
16754
|
+
return `${freqDisplay} / ${formatSiUnit5(this._parsedProps.loadCapacitance)}F`;
|
|
16687
16755
|
}
|
|
16688
16756
|
return freqDisplay;
|
|
16689
16757
|
}
|
|
16690
16758
|
};
|
|
16691
16759
|
|
|
16692
|
-
// lib/components/normal-components/Inductor.ts
|
|
16693
|
-
import { inductorProps } from "@tscircuit/props";
|
|
16694
|
-
import { formatSiUnit as formatSiUnit5 } from "format-si-unit";
|
|
16695
|
-
var Inductor = class extends NormalComponent3 {
|
|
16696
|
-
_adjustSilkscreenTextAutomatically = true;
|
|
16697
|
-
get config() {
|
|
16698
|
-
return {
|
|
16699
|
-
componentName: "Inductor",
|
|
16700
|
-
schematicSymbolName: this.props.symbolName ?? "inductor",
|
|
16701
|
-
zodProps: inductorProps,
|
|
16702
|
-
sourceFtype: FTYPE.simple_inductor
|
|
16703
|
-
};
|
|
16704
|
-
}
|
|
16705
|
-
_getSchematicSymbolDisplayValue() {
|
|
16706
|
-
return `${formatSiUnit5(this._parsedProps.inductance)}H`;
|
|
16707
|
-
}
|
|
16708
|
-
initPorts() {
|
|
16709
|
-
super.initPorts({
|
|
16710
|
-
additionalAliases: {
|
|
16711
|
-
pin1: ["anode", "pos", "left"],
|
|
16712
|
-
pin2: ["cathode", "neg", "right"]
|
|
16713
|
-
}
|
|
16714
|
-
});
|
|
16715
|
-
}
|
|
16716
|
-
doInitialSourceRender() {
|
|
16717
|
-
const { db } = this.root;
|
|
16718
|
-
const { _parsedProps: props } = this;
|
|
16719
|
-
const source_component = db.source_component.insert({
|
|
16720
|
-
name: this.name,
|
|
16721
|
-
ftype: FTYPE.simple_inductor,
|
|
16722
|
-
inductance: props.inductance,
|
|
16723
|
-
supplier_part_numbers: props.supplierPartNumbers,
|
|
16724
|
-
are_pins_interchangeable: true
|
|
16725
|
-
});
|
|
16726
|
-
this.source_component_id = source_component.source_component_id;
|
|
16727
|
-
}
|
|
16728
|
-
};
|
|
16729
|
-
|
|
16730
16760
|
// lib/components/normal-components/Potentiometer.ts
|
|
16731
16761
|
import { potentiometerProps } from "@tscircuit/props";
|
|
16732
16762
|
import { formatSiUnit as formatSiUnit6 } from "format-si-unit";
|
|
@@ -17745,7 +17775,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17745
17775
|
var package_default = {
|
|
17746
17776
|
name: "@tscircuit/core",
|
|
17747
17777
|
type: "module",
|
|
17748
|
-
version: "0.0.
|
|
17778
|
+
version: "0.0.860",
|
|
17749
17779
|
types: "dist/index.d.ts",
|
|
17750
17780
|
main: "dist/index.js",
|
|
17751
17781
|
module: "dist/index.js",
|