@tscircuit/core 0.0.309 → 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 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, PolarizedPassivePorts> {
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
- sourceFtype: Ftype;
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
@@ -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
- import { formatSiUnit as formatSiUnit3 } from "format-si-unit";
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
- sourceFtype: "simple_potentiometer"
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
- max_resistance: props.maxResistance
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 formatSiUnit4 } from "format-si-unit";
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 `${formatSiUnit4(this._parsedProps.frequency)}Hz`;
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.309",
4
+ "version": "0.0.310",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",