@tscircuit/core 0.0.1402 → 0.0.1404

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
@@ -53092,10 +53092,10 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
53092
53092
  _getSchematicSymbolDisplayValue(): string | undefined;
53093
53093
  getFootprinterString(): string | null;
53094
53094
  doInitialSourceRender(): void;
53095
- pos: Port;
53096
- anode: Port;
53097
- neg: Port;
53098
- cathode: Port;
53095
+ get pos(): Port;
53096
+ get anode(): Port;
53097
+ get neg(): Port;
53098
+ get cathode(): Port;
53099
53099
  }
53100
53100
 
53101
53101
  declare class PowerSource extends NormalComponent<typeof powerSourceProps, PolarizedPassivePorts> {
package/dist/index.js CHANGED
@@ -13237,7 +13237,9 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
13237
13237
  for (const symPort of sym.ports) {
13238
13238
  const pinNumber = getPinNumberFromLabels(symPort.labels);
13239
13239
  if (!pinNumber) continue;
13240
- const existingPort = portsToCreate.find(
13240
+ const existingPort = this._getAllPortsFromChildren().find(
13241
+ (p) => p._parsedProps.pinNumber === Number(pinNumber)
13242
+ ) ?? portsToCreate.find(
13241
13243
  (p) => p._parsedProps.pinNumber === Number(pinNumber)
13242
13244
  );
13243
13245
  if (existingPort) {
@@ -24378,10 +24380,18 @@ var Led = class extends NormalComponent3 {
24378
24380
  };
24379
24381
  }
24380
24382
  initPorts() {
24383
+ const hasFootprintChild = this.children.some(
24384
+ (child) => child.componentName === "Footprint"
24385
+ );
24386
+ const footprint = this.resolveFootprint();
24387
+ const hasPinLabels = Boolean(this._resolvePinLabels());
24388
+ const shouldAddDefaultAliases = !hasPinLabels && !hasFootprintChild && (!footprint || isFootprinterString(footprint));
24381
24389
  super.initPorts({
24390
+ pinCount: 2,
24391
+ ignoreSymbolPorts: !hasPinLabels && !shouldAddDefaultAliases,
24382
24392
  additionalAliases: {
24383
- pin1: ["anode", "pos", "left"],
24384
- pin2: ["cathode", "neg", "right"]
24393
+ pin1: shouldAddDefaultAliases ? ["anode", "pos", "left"] : [],
24394
+ pin2: shouldAddDefaultAliases ? ["cathode", "neg", "right"] : []
24385
24395
  }
24386
24396
  });
24387
24397
  }
@@ -24411,10 +24421,18 @@ var Led = class extends NormalComponent3 {
24411
24421
  });
24412
24422
  this.source_component_id = source_component.source_component_id;
24413
24423
  }
24414
- pos = this.portMap.pin1;
24415
- anode = this.portMap.pin1;
24416
- neg = this.portMap.pin2;
24417
- cathode = this.portMap.pin2;
24424
+ get pos() {
24425
+ return this.portMap.pos;
24426
+ }
24427
+ get anode() {
24428
+ return this.portMap.anode;
24429
+ }
24430
+ get neg() {
24431
+ return this.portMap.neg;
24432
+ }
24433
+ get cathode() {
24434
+ return this.portMap.cathode;
24435
+ }
24418
24436
  };
24419
24437
 
24420
24438
  // lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceLed.ts
@@ -25300,7 +25318,7 @@ import { identity as identity5 } from "transformation-matrix";
25300
25318
  var package_default = {
25301
25319
  name: "@tscircuit/core",
25302
25320
  type: "module",
25303
- version: "0.0.1401",
25321
+ version: "0.0.1403",
25304
25322
  types: "dist/index.d.ts",
25305
25323
  main: "dist/index.js",
25306
25324
  module: "dist/index.js",
@@ -25345,7 +25363,7 @@ var package_default = {
25345
25363
  "@tscircuit/jlcpcb-manufacturing-specs": "git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#e08af159db01a37db007e33f0a7268d0e4a279a5",
25346
25364
  "@tscircuit/krt-wasm": "^0.1.1",
25347
25365
  "@tscircuit/log-soup": "^1.0.2",
25348
- "@tscircuit/matchpack": "^0.0.29",
25366
+ "@tscircuit/matchpack": "^0.0.31",
25349
25367
  "@tscircuit/math-utils": "^0.0.36",
25350
25368
  "@tscircuit/miniflex": "^0.0.4",
25351
25369
  "@tscircuit/ngspice-spice-engine": "^0.0.18",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1402",
4
+ "version": "0.0.1404",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "@tscircuit/jlcpcb-manufacturing-specs": "git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#e08af159db01a37db007e33f0a7268d0e4a279a5",
47
47
  "@tscircuit/krt-wasm": "^0.1.1",
48
48
  "@tscircuit/log-soup": "^1.0.2",
49
- "@tscircuit/matchpack": "^0.0.29",
49
+ "@tscircuit/matchpack": "^0.0.31",
50
50
  "@tscircuit/math-utils": "^0.0.36",
51
51
  "@tscircuit/miniflex": "^0.0.4",
52
52
  "@tscircuit/ngspice-spice-engine": "^0.0.18",