@tscircuit/core 0.0.124 → 0.0.125

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 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43,6 +43,7 @@ __export(components_exports, {
43
43
  // lib/components/base-components/NormalComponent.ts
44
44
  import { fp } from "@tscircuit/footprinter";
45
45
  import { point3, rotation } from "circuit-json";
46
+ import Debug2 from "debug";
46
47
 
47
48
  // lib/fiber/create-instance-from-react-element.ts
48
49
  import ReactReconciler from "react-reconciler";
@@ -1903,7 +1904,6 @@ var Footprint = class extends PrimitiveComponent {
1903
1904
  };
1904
1905
 
1905
1906
  // lib/components/base-components/NormalComponent.ts
1906
- import Debug2 from "debug";
1907
1907
  var debug2 = Debug2("tscircuit:core");
1908
1908
  var rotation3 = z4.object({
1909
1909
  x: rotation,
@@ -1954,6 +1954,23 @@ var NormalComponent = class extends PrimitiveComponent {
1954
1954
  }
1955
1955
  }
1956
1956
  }
1957
+ const sides = ["left", "right", "top", "bottom"];
1958
+ let pinNum = 1;
1959
+ for (const side of sides) {
1960
+ const size = schPortArrangement[`${side}Size`];
1961
+ for (let i = 0; i < size; i++) {
1962
+ portsToCreate.push(
1963
+ new Port(
1964
+ {
1965
+ pinNumber: pinNum++
1966
+ },
1967
+ {
1968
+ originDescription: `schPortArrangement:${side}`
1969
+ }
1970
+ )
1971
+ );
1972
+ }
1973
+ }
1957
1974
  }
1958
1975
  const pinLabels = this._parsedProps.pinLabels;
1959
1976
  if (pinLabels) {
@@ -3537,14 +3554,14 @@ var Chip = class extends NormalComponent {
3537
3554
  doInitialSchematicComponentRender() {
3538
3555
  const { db } = this.root;
3539
3556
  const { _parsedProps: props } = this;
3540
- const ports = this.children.filter((child) => child instanceof Port);
3557
+ const pinCount = (props.schPortArrangement?.leftSize ?? 0) + (props.schPortArrangement?.rightSize ?? 0) + (props.schPortArrangement?.topSize ?? 0) + (props.schPortArrangement?.bottomSize ?? 0);
3541
3558
  const pinSpacing = props.schPinSpacing ?? 0.2;
3542
3559
  const dimensions = getAllDimensionsForSchematicBox({
3543
3560
  schWidth: props.schWidth,
3544
3561
  schHeight: props.schHeight,
3545
3562
  schPinSpacing: pinSpacing,
3546
3563
  schPinStyle: props.schPinStyle,
3547
- pinCount: ports.length,
3564
+ pinCount,
3548
3565
  // @ts-ignore there's a subtley in the definition difference with
3549
3566
  // leftSide/rightSide/topSide/bottomSide in how the direction is defined
3550
3567
  // that doesn't really matter
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.124",
4
+ "version": "0.0.125",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",