@tscircuit/core 0.0.308 → 0.0.310
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 +6 -5
- package/dist/index.js +17 -19
- package/package.json +3 -3
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>>;
|
|
@@ -8099,6 +8099,7 @@ declare class Potentiometer extends NormalComponent<typeof potentiometerProps, P
|
|
|
8099
8099
|
symbolName: zod.ZodOptional<zod.ZodString>;
|
|
8100
8100
|
}>, {
|
|
8101
8101
|
maxResistance: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
8102
|
+
pinVariant: zod.ZodOptional<zod.ZodEnum<["two_pin", "three_pin"]>>;
|
|
8102
8103
|
}>, "strip", zod.ZodTypeAny, {
|
|
8103
8104
|
name: string;
|
|
8104
8105
|
maxResistance: number;
|
|
@@ -8167,6 +8168,7 @@ declare class Potentiometer extends NormalComponent<typeof potentiometerProps, P
|
|
|
8167
8168
|
} | undefined;
|
|
8168
8169
|
children?: any;
|
|
8169
8170
|
symbolName?: string | undefined;
|
|
8171
|
+
pinVariant?: "two_pin" | "three_pin" | undefined;
|
|
8170
8172
|
}, {
|
|
8171
8173
|
name: string;
|
|
8172
8174
|
maxResistance: string | number;
|
|
@@ -8237,11 +8239,10 @@ declare class Potentiometer extends NormalComponent<typeof potentiometerProps, P
|
|
|
8237
8239
|
} | undefined;
|
|
8238
8240
|
children?: any;
|
|
8239
8241
|
symbolName?: string | undefined;
|
|
8242
|
+
pinVariant?: "two_pin" | "three_pin" | undefined;
|
|
8240
8243
|
}>;
|
|
8241
|
-
|
|
8244
|
+
shouldRenderAsSchematicBox: boolean;
|
|
8242
8245
|
};
|
|
8243
|
-
initPorts(): void;
|
|
8244
|
-
_getSchematicSymbolDisplayValue(): string | undefined;
|
|
8245
8246
|
doInitialSourceRender(): void;
|
|
8246
8247
|
}
|
|
8247
8248
|
|
package/dist/index.js
CHANGED
|
@@ -6415,35 +6415,33 @@ var Inductor = class extends NormalComponent {
|
|
|
6415
6415
|
|
|
6416
6416
|
// lib/components/normal-components/Potentiometer.ts
|
|
6417
6417
|
import { potentiometerProps } from "@tscircuit/props";
|
|
6418
|
-
|
|
6418
|
+
function getPotentiometerSymbolName(variant) {
|
|
6419
|
+
switch (variant) {
|
|
6420
|
+
case "three_pin":
|
|
6421
|
+
return "potentiometer3";
|
|
6422
|
+
case "two_pin":
|
|
6423
|
+
return "potentiometer2";
|
|
6424
|
+
default:
|
|
6425
|
+
return "potentiometer2";
|
|
6426
|
+
}
|
|
6427
|
+
}
|
|
6419
6428
|
var Potentiometer = class extends NormalComponent {
|
|
6420
|
-
// @ts-ignore
|
|
6421
6429
|
get config() {
|
|
6422
6430
|
return {
|
|
6423
|
-
schematicSymbolName: this.props.symbolName ?? "potentiometer2",
|
|
6424
6431
|
componentName: "Potentiometer",
|
|
6432
|
+
schematicSymbolName: this.props.symbolName ?? getPotentiometerSymbolName(this.props.pinVariant),
|
|
6425
6433
|
zodProps: potentiometerProps,
|
|
6426
|
-
|
|
6434
|
+
shouldRenderAsSchematicBox: false
|
|
6427
6435
|
};
|
|
6428
6436
|
}
|
|
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
6437
|
doInitialSourceRender() {
|
|
6441
6438
|
const { db } = this.root;
|
|
6442
6439
|
const { _parsedProps: props } = this;
|
|
6443
6440
|
const source_component = db.source_component.insert({
|
|
6444
|
-
name: props.name,
|
|
6445
6441
|
ftype: "simple_potentiometer",
|
|
6446
|
-
|
|
6442
|
+
name: props.name,
|
|
6443
|
+
max_resistance: props.maxResistance,
|
|
6444
|
+
pin_variant: props.pinVariant || "two_pin"
|
|
6447
6445
|
});
|
|
6448
6446
|
this.source_component_id = source_component.source_component_id;
|
|
6449
6447
|
}
|
|
@@ -6489,7 +6487,7 @@ var PushButton = class extends NormalComponent {
|
|
|
6489
6487
|
|
|
6490
6488
|
// lib/components/normal-components/Crystal.ts
|
|
6491
6489
|
import { crystalProps } from "@tscircuit/props";
|
|
6492
|
-
import { formatSiUnit as
|
|
6490
|
+
import { formatSiUnit as formatSiUnit3 } from "format-si-unit";
|
|
6493
6491
|
var Crystal = class extends NormalComponent {
|
|
6494
6492
|
// @ts-ignore
|
|
6495
6493
|
get config() {
|
|
@@ -6509,7 +6507,7 @@ var Crystal = class extends NormalComponent {
|
|
|
6509
6507
|
});
|
|
6510
6508
|
}
|
|
6511
6509
|
_getSchematicSymbolDisplayValue() {
|
|
6512
|
-
return `${
|
|
6510
|
+
return `${formatSiUnit3(this._parsedProps.frequency)}Hz`;
|
|
6513
6511
|
}
|
|
6514
6512
|
doInitialSourceRender() {
|
|
6515
6513
|
const { db } = this.root;
|
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.310",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@tscircuit/footprinter": "^0.0.97",
|
|
55
55
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
56
56
|
"@tscircuit/math-utils": "^0.0.9",
|
|
57
|
-
"@tscircuit/props": "^0.0.
|
|
57
|
+
"@tscircuit/props": "^0.0.145",
|
|
58
58
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
59
59
|
"@tscircuit/soup-util": "^0.0.41",
|
|
60
60
|
"circuit-json": "^0.0.136",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"performance-now": "^2.1.0",
|
|
65
65
|
"react-reconciler": "^0.31.0",
|
|
66
66
|
"react-reconciler-18": "npm:react-reconciler@0.29.2",
|
|
67
|
-
"schematic-symbols": "^0.0.
|
|
67
|
+
"schematic-symbols": "^0.0.119",
|
|
68
68
|
"transformation-matrix": "^2.16.1",
|
|
69
69
|
"zod": "^3.23.8"
|
|
70
70
|
}
|