@tscircuit/core 0.0.309 → 0.0.311
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 +3 -5
- package/dist/index.js +18 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7837,10 +7837,10 @@ declare class Inductor extends NormalComponent<typeof inductorProps, PassivePort
|
|
|
7837
7837
|
doInitialSourceRender(): void;
|
|
7838
7838
|
}
|
|
7839
7839
|
|
|
7840
|
-
declare class Potentiometer extends NormalComponent<typeof potentiometerProps
|
|
7840
|
+
declare class Potentiometer extends NormalComponent<typeof potentiometerProps> {
|
|
7841
7841
|
get config(): {
|
|
7842
|
-
schematicSymbolName: string;
|
|
7843
7842
|
componentName: string;
|
|
7843
|
+
schematicSymbolName: string;
|
|
7844
7844
|
zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
|
|
7845
7845
|
pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
7846
7846
|
pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
@@ -8241,10 +8241,8 @@ declare class Potentiometer extends NormalComponent<typeof potentiometerProps, P
|
|
|
8241
8241
|
symbolName?: string | undefined;
|
|
8242
8242
|
pinVariant?: "two_pin" | "three_pin" | undefined;
|
|
8243
8243
|
}>;
|
|
8244
|
-
|
|
8244
|
+
shouldRenderAsSchematicBox: boolean;
|
|
8245
8245
|
};
|
|
8246
|
-
initPorts(): void;
|
|
8247
|
-
_getSchematicSymbolDisplayValue(): string | undefined;
|
|
8248
8246
|
doInitialSourceRender(): void;
|
|
8249
8247
|
}
|
|
8250
8248
|
|
package/dist/index.js
CHANGED
|
@@ -3928,6 +3928,7 @@ var Group = class extends NormalComponent {
|
|
|
3928
3928
|
const debug4 = Debug5("tscircuit:core:doInitialPcbTraceRender");
|
|
3929
3929
|
if (!this.isSubcircuit) return;
|
|
3930
3930
|
if (this.root?.pcbDisabled) return;
|
|
3931
|
+
if (this.getInheritedProperty("routingDisabled")) return;
|
|
3931
3932
|
if (this._shouldUseTraceByTraceRouting()) return;
|
|
3932
3933
|
if (!this._areChildSubcircuitsRouted()) {
|
|
3933
3934
|
debug4(
|
|
@@ -6415,35 +6416,33 @@ var Inductor = class extends NormalComponent {
|
|
|
6415
6416
|
|
|
6416
6417
|
// lib/components/normal-components/Potentiometer.ts
|
|
6417
6418
|
import { potentiometerProps } from "@tscircuit/props";
|
|
6418
|
-
|
|
6419
|
+
function getPotentiometerSymbolName(variant) {
|
|
6420
|
+
switch (variant) {
|
|
6421
|
+
case "three_pin":
|
|
6422
|
+
return "potentiometer3";
|
|
6423
|
+
case "two_pin":
|
|
6424
|
+
return "potentiometer2";
|
|
6425
|
+
default:
|
|
6426
|
+
return "potentiometer2";
|
|
6427
|
+
}
|
|
6428
|
+
}
|
|
6419
6429
|
var Potentiometer = class extends NormalComponent {
|
|
6420
|
-
// @ts-ignore
|
|
6421
6430
|
get config() {
|
|
6422
6431
|
return {
|
|
6423
|
-
schematicSymbolName: this.props.symbolName ?? "potentiometer2",
|
|
6424
6432
|
componentName: "Potentiometer",
|
|
6433
|
+
schematicSymbolName: this.props.symbolName ?? getPotentiometerSymbolName(this.props.pinVariant),
|
|
6425
6434
|
zodProps: potentiometerProps,
|
|
6426
|
-
|
|
6435
|
+
shouldRenderAsSchematicBox: false
|
|
6427
6436
|
};
|
|
6428
6437
|
}
|
|
6429
|
-
initPorts() {
|
|
6430
|
-
super.initPorts({
|
|
6431
|
-
additionalAliases: {
|
|
6432
|
-
pin1: ["pos", "left"],
|
|
6433
|
-
pin2: ["neg", "right"]
|
|
6434
|
-
}
|
|
6435
|
-
});
|
|
6436
|
-
}
|
|
6437
|
-
_getSchematicSymbolDisplayValue() {
|
|
6438
|
-
return `${formatSiUnit3(this._parsedProps.maxResistance)}\u03A9`;
|
|
6439
|
-
}
|
|
6440
6438
|
doInitialSourceRender() {
|
|
6441
6439
|
const { db } = this.root;
|
|
6442
6440
|
const { _parsedProps: props } = this;
|
|
6443
6441
|
const source_component = db.source_component.insert({
|
|
6444
|
-
name: props.name,
|
|
6445
6442
|
ftype: "simple_potentiometer",
|
|
6446
|
-
|
|
6443
|
+
name: props.name,
|
|
6444
|
+
max_resistance: props.maxResistance,
|
|
6445
|
+
pin_variant: props.pinVariant || "two_pin"
|
|
6447
6446
|
});
|
|
6448
6447
|
this.source_component_id = source_component.source_component_id;
|
|
6449
6448
|
}
|
|
@@ -6489,7 +6488,7 @@ var PushButton = class extends NormalComponent {
|
|
|
6489
6488
|
|
|
6490
6489
|
// lib/components/normal-components/Crystal.ts
|
|
6491
6490
|
import { crystalProps } from "@tscircuit/props";
|
|
6492
|
-
import { formatSiUnit as
|
|
6491
|
+
import { formatSiUnit as formatSiUnit3 } from "format-si-unit";
|
|
6493
6492
|
var Crystal = class extends NormalComponent {
|
|
6494
6493
|
// @ts-ignore
|
|
6495
6494
|
get config() {
|
|
@@ -6509,7 +6508,7 @@ var Crystal = class extends NormalComponent {
|
|
|
6509
6508
|
});
|
|
6510
6509
|
}
|
|
6511
6510
|
_getSchematicSymbolDisplayValue() {
|
|
6512
|
-
return `${
|
|
6511
|
+
return `${formatSiUnit3(this._parsedProps.frequency)}Hz`;
|
|
6513
6512
|
}
|
|
6514
6513
|
doInitialSourceRender() {
|
|
6515
6514
|
const { db } = this.root;
|