@tscircuit/core 0.0.161 → 0.0.163

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.
Files changed (2) hide show
  1. package/dist/index.js +28 -60
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -669,7 +669,6 @@ var PrimitiveComponent = class extends Renderable {
669
669
  const base_symbol_name = this.config.schematicSymbolName;
670
670
  const symbol_name_horz = `${base_symbol_name}_horz`;
671
671
  const symbol_name_vert = `${base_symbol_name}_vert`;
672
- if (base_symbol_name in symbols) return base_symbol_name;
673
672
  if (symbol_name_horz in symbols) {
674
673
  if (props.schRotation === 0 || props.schRotation === void 0)
675
674
  return symbol_name_horz;
@@ -679,6 +678,7 @@ var PrimitiveComponent = class extends Renderable {
679
678
  if (props.schRotation === 90) return symbol_name_vert;
680
679
  if (props.schRotation === 270) return symbol_name_vert;
681
680
  }
681
+ if (base_symbol_name in symbols) return base_symbol_name;
682
682
  return void 0;
683
683
  }
684
684
  _getSchematicSymbolNameOrThrow() {
@@ -4157,26 +4157,18 @@ var Capacitor = class extends NormalComponent {
4157
4157
  get config() {
4158
4158
  return {
4159
4159
  componentName: "Capacitor",
4160
- schematicSymbolName: this.props.symbolName ?? "capacitor_horz",
4160
+ schematicSymbolName: this.props.symbolName ?? "capacitor",
4161
4161
  zodProps: capacitorProps,
4162
4162
  sourceFtype: FTYPE.simple_capacitor
4163
4163
  };
4164
4164
  }
4165
4165
  initPorts() {
4166
- this.add(
4167
- new Port({
4168
- name: "pin1",
4169
- pinNumber: 1,
4170
- aliases: ["anode", "pos", "left"]
4171
- })
4172
- );
4173
- this.add(
4174
- new Port({
4175
- name: "pin2",
4176
- pinNumber: 2,
4177
- aliases: ["cathode", "neg", "right"]
4178
- })
4179
- );
4166
+ super.initPorts({
4167
+ additionalAliases: {
4168
+ pin1: ["anode", "pos", "left"],
4169
+ pin2: ["cathode", "neg", "right"]
4170
+ }
4171
+ });
4180
4172
  }
4181
4173
  _getSchematicSymbolDisplayValue() {
4182
4174
  return `${formatSiUnit(this._parsedProps.capacitance)}F`;
@@ -4263,27 +4255,19 @@ var Diode = class extends NormalComponent {
4263
4255
  // @ts-ignore
4264
4256
  get config() {
4265
4257
  return {
4266
- schematicSymbolName: this.props.symbolName ?? "diode_horz",
4258
+ schematicSymbolName: this.props.symbolName ?? "diode",
4267
4259
  componentName: "Diode",
4268
4260
  zodProps: diodeProps,
4269
4261
  sourceFtype: "simple_diode"
4270
4262
  };
4271
4263
  }
4272
4264
  initPorts() {
4273
- this.add(
4274
- new Port({
4275
- name: "pin1",
4276
- pinNumber: 1,
4277
- aliases: ["anode", "pos", "left"]
4278
- })
4279
- );
4280
- this.add(
4281
- new Port({
4282
- name: "pin2",
4283
- pinNumber: 2,
4284
- aliases: ["cathode", "neg", "right"]
4285
- })
4286
- );
4265
+ super.initPorts({
4266
+ additionalAliases: {
4267
+ pin1: ["anode", "pos", "left"],
4268
+ pin2: ["cathode", "neg", "right"]
4269
+ }
4270
+ });
4287
4271
  }
4288
4272
  pos = this.portMap.pin1;
4289
4273
  anode = this.portMap.pin1;
@@ -4338,26 +4322,18 @@ var Led = class extends NormalComponent {
4338
4322
  get config() {
4339
4323
  return {
4340
4324
  componentName: "Led",
4341
- schematicSymbolName: this.props.symbolName ?? "led_horz",
4325
+ schematicSymbolName: this.props.symbolName ?? "led",
4342
4326
  zodProps: ledProps,
4343
4327
  sourceFtype: "simple_diode"
4344
4328
  };
4345
4329
  }
4346
4330
  initPorts() {
4347
- this.add(
4348
- new Port({
4349
- name: "pin1",
4350
- pinNumber: 1,
4351
- aliases: ["anode", "pos", "left"]
4352
- })
4353
- );
4354
- this.add(
4355
- new Port({
4356
- name: "pin2",
4357
- pinNumber: 2,
4358
- aliases: ["cathode", "neg", "right"]
4359
- })
4360
- );
4331
+ super.initPorts({
4332
+ additionalAliases: {
4333
+ pin1: ["anode", "pos", "left"],
4334
+ pin2: ["cathode", "neg", "right"]
4335
+ }
4336
+ });
4361
4337
  }
4362
4338
  pos = this.portMap.pin1;
4363
4339
  anode = this.portMap.pin1;
@@ -4882,20 +4858,12 @@ var Inductor = class extends NormalComponent {
4882
4858
  };
4883
4859
  }
4884
4860
  initPorts() {
4885
- this.add(
4886
- new Port({
4887
- name: "pin1",
4888
- pinNumber: 1,
4889
- aliases: ["anode", "pos", "left"]
4890
- })
4891
- );
4892
- this.add(
4893
- new Port({
4894
- name: "pin2",
4895
- pinNumber: 2,
4896
- aliases: ["cathode", "neg", "right"]
4897
- })
4898
- );
4861
+ super.initPorts({
4862
+ additionalAliases: {
4863
+ pin1: ["anode", "pos", "left"],
4864
+ pin2: ["cathode", "neg", "right"]
4865
+ }
4866
+ });
4899
4867
  }
4900
4868
  doInitialSourceRender() {
4901
4869
  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.161",
4
+ "version": "0.0.163",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "performance-now": "^2.1.0",
52
52
  "react": "^18.3.1",
53
53
  "react-reconciler": "^0.29.2",
54
- "schematic-symbols": "0.0.90",
54
+ "schematic-symbols": "^0.0.92",
55
55
  "transformation-matrix": "^2.16.1",
56
56
  "zod": "^3.23.8"
57
57
  }