@tscircuit/core 0.0.544 → 0.0.546

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 +20 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6272,7 +6272,22 @@ var NormalComponent = class extends PrimitiveComponent2 {
6272
6272
  const pinCountFromSchematicPortArrangement = this._getPinCountFromSchematicPortArrangement();
6273
6273
  return pinCountFromSchematicPortArrangement;
6274
6274
  }
6275
- return this.getPortsFromFootprint().length;
6275
+ const portsFromFootprint = this.getPortsFromFootprint();
6276
+ if (portsFromFootprint.length > 0) {
6277
+ return portsFromFootprint.length;
6278
+ }
6279
+ const { pinLabels } = this._parsedProps;
6280
+ if (pinLabels) {
6281
+ if (Array.isArray(pinLabels)) {
6282
+ return pinLabels.length;
6283
+ }
6284
+ const pinNumbers = Object.keys(pinLabels).map((k) => k.startsWith("pin") ? parseInt(k.slice(3)) : parseInt(k)).filter((n) => !Number.isNaN(n));
6285
+ if (pinNumbers.length > 0) {
6286
+ return Math.max(...pinNumbers);
6287
+ }
6288
+ return Object.keys(pinLabels).length;
6289
+ }
6290
+ return 0;
6276
6291
  }
6277
6292
  /**
6278
6293
  * Override the schematic port arrangement if you want to customize where pins
@@ -8927,6 +8942,9 @@ var SolderJumper = class extends NormalComponent {
8927
8942
  if (finalPinCount === 2 || finalPinCount === 3) {
8928
8943
  resolvedPinCount = finalPinCount;
8929
8944
  }
8945
+ if (resolvedPinCount == null && props.footprint && [2, 3].includes(this.getPortsFromFootprint().length)) {
8946
+ resolvedPinCount = this.getPortsFromFootprint().length;
8947
+ }
8930
8948
  }
8931
8949
  let symbolName = "";
8932
8950
  if (resolvedPinCount) {
@@ -10678,7 +10696,7 @@ import { identity as identity4 } from "transformation-matrix";
10678
10696
  var package_default = {
10679
10697
  name: "@tscircuit/core",
10680
10698
  type: "module",
10681
- version: "0.0.543",
10699
+ version: "0.0.545",
10682
10700
  types: "dist/index.d.ts",
10683
10701
  main: "dist/index.js",
10684
10702
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.544",
4
+ "version": "0.0.546",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",