@tscircuit/core 0.0.312 → 0.0.314

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The core logic used to build Circuit JSON from tscircuit React elements.
4
4
 
5
- [tscircuit](https://github.com/tscircuit/tscircuit) · [Development Guide](./docs/DEVELOPMENT.md)
5
+ [tscircuit](https://github.com/tscircuit/tscircuit) · [Development Guide](./docs/DEVELOPMENT.md) · [Core Benchmarks](https://core-benchmarks.tscircuit.com/)
6
6
 
7
7
  You can use `core` to create [Circuit JSON](https://github.com/tscircuit/circuit-json), which can then
8
8
  be converted into Gerbers, viewed online, and much more.
package/dist/index.d.ts CHANGED
@@ -8918,7 +8918,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
8918
8918
  }>, {
8919
8919
  frequency: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
8920
8920
  loadCapacitance: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
8921
- pinVariant: zod.ZodOptional<zod.ZodEnum<["2pin", "4pin"]>>;
8921
+ pinVariant: zod.ZodOptional<zod.ZodEnum<["two_pin", "four_pin"]>>;
8922
8922
  }>, "strip", zod.ZodTypeAny, {
8923
8923
  name: string;
8924
8924
  frequency: number;
@@ -8988,7 +8988,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
8988
8988
  } | undefined;
8989
8989
  children?: any;
8990
8990
  symbolName?: string | undefined;
8991
- pinVariant?: "2pin" | "4pin" | undefined;
8991
+ pinVariant?: "two_pin" | "four_pin" | undefined;
8992
8992
  }, {
8993
8993
  name: string;
8994
8994
  frequency: string | number;
@@ -9060,7 +9060,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
9060
9060
  } | undefined;
9061
9061
  children?: any;
9062
9062
  symbolName?: string | undefined;
9063
- pinVariant?: "2pin" | "4pin" | undefined;
9063
+ pinVariant?: "two_pin" | "four_pin" | undefined;
9064
9064
  }>;
9065
9065
  sourceFtype: Ftype;
9066
9066
  };
@@ -10286,6 +10286,7 @@ interface TscircuitElements {
10286
10286
  trace: _tscircuit_props.TraceProps;
10287
10287
  custom: any;
10288
10288
  component: _tscircuit_props.ComponentProps;
10289
+ crystal: _tscircuit_props.CrystalProps;
10289
10290
  footprint: any;
10290
10291
  silkscreentext: _tscircuit_props.SilkscreenTextProps;
10291
10292
  silkscreenpath: _tscircuit_props.SilkscreenPathProps;
package/dist/index.js CHANGED
@@ -6492,19 +6492,26 @@ import { formatSiUnit as formatSiUnit3 } from "format-si-unit";
6492
6492
  var Crystal = class extends NormalComponent {
6493
6493
  // @ts-ignore
6494
6494
  get config() {
6495
+ const symbolName = this.props.symbolName ?? (this.props.pinVariant === "four_pin" ? "crystal_4pin" : "crystal");
6495
6496
  return {
6496
- schematicSymbolName: this.props.symbolName ?? "crystal",
6497
+ schematicSymbolName: symbolName,
6497
6498
  componentName: "Crystal",
6498
6499
  zodProps: crystalProps,
6499
6500
  sourceFtype: "simple_crystal"
6500
6501
  };
6501
6502
  }
6502
6503
  initPorts() {
6504
+ const additionalAliases = this.props.pinVariant === "four_pin" ? {
6505
+ pin1: ["left1", "1"],
6506
+ pin2: ["top1", "2", "gnd1"],
6507
+ pin3: ["right1", "3"],
6508
+ pin4: ["bottom1", "4", "gnd2"]
6509
+ } : {
6510
+ pin1: ["pos", "left"],
6511
+ pin2: ["neg", "right"]
6512
+ };
6503
6513
  super.initPorts({
6504
- additionalAliases: {
6505
- pin1: ["pos", "left"],
6506
- pin2: ["neg", "right"]
6507
- }
6514
+ additionalAliases
6508
6515
  });
6509
6516
  }
6510
6517
  _getSchematicSymbolDisplayValue() {
@@ -6517,7 +6524,8 @@ var Crystal = class extends NormalComponent {
6517
6524
  name: props.name,
6518
6525
  ftype: "simple_crystal",
6519
6526
  frequency: props.frequency,
6520
- load_capacitance: props.loadCapacitance
6527
+ load_capacitance: props.loadCapacitance,
6528
+ pin_variant: props.pinVariant || "two_pin"
6521
6529
  });
6522
6530
  this.source_component_id = source_component.source_component_id;
6523
6531
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.312",
4
+ "version": "0.0.314",
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.145",
57
+ "@tscircuit/props": "^0.0.147",
58
58
  "@tscircuit/schematic-autolayout": "^0.0.6",
59
59
  "@tscircuit/soup-util": "^0.0.41",
60
60
  "circuit-json": "^0.0.136",