@tscircuit/core 0.0.662 → 0.0.663

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
@@ -12020,7 +12020,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
12020
12020
  rightAngle: zod.ZodOptional<zod.ZodBoolean>;
12021
12021
  holeDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12022
12022
  platedDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12023
- pinLabels: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
12023
+ pinLabels: zod.ZodOptional<zod.ZodUnion<[zod.ZodRecord<zod.ZodString, zod.ZodString>, zod.ZodArray<zod.ZodString, "many">]>>;
12024
12024
  connections: zod.ZodOptional<zod.ZodPipeline<zod.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, zod.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
12025
12025
  facingDirection: zod.ZodOptional<zod.ZodEnum<["left", "right"]>>;
12026
12026
  schPinArrangement: zod.ZodOptional<zod.ZodObject<{
@@ -12237,7 +12237,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
12237
12237
  doNotPlace?: boolean | undefined;
12238
12238
  schWidth?: number | undefined;
12239
12239
  schHeight?: number | undefined;
12240
- pinLabels?: string[] | undefined;
12240
+ pinLabels?: string[] | Record<string, string> | undefined;
12241
12241
  pcbPinLabels?: Record<string, string> | undefined;
12242
12242
  schPinArrangement?: {
12243
12243
  leftSize?: number | undefined;
@@ -12370,7 +12370,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
12370
12370
  schWidth?: string | number | undefined;
12371
12371
  schHeight?: string | number | undefined;
12372
12372
  gender?: "male" | "female" | "unpopulated" | undefined;
12373
- pinLabels?: string[] | undefined;
12373
+ pinLabels?: string[] | Record<string, string> | undefined;
12374
12374
  pcbPinLabels?: Record<string, string> | undefined;
12375
12375
  schPinArrangement?: {
12376
12376
  leftSize?: number | undefined;
package/dist/index.js CHANGED
@@ -12908,7 +12908,7 @@ var PinHeader = class extends NormalComponent {
12908
12908
  };
12909
12909
  }
12910
12910
  _getImpliedFootprintString() {
12911
- const pinCount = this._parsedProps.pinCount ?? this._parsedProps.pinLabels?.length ?? 0;
12911
+ const pinCount = this._parsedProps.pinCount ?? (Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels.length : this._parsedProps.pinLabels ? Object.keys(this._parsedProps.pinLabels).length : 0);
12912
12912
  const holeDiameter = this._parsedProps.holeDiameter;
12913
12913
  const platedDiameter = this._parsedProps.platedDiameter;
12914
12914
  const pitch = this._parsedProps.pitch;
@@ -12936,15 +12936,14 @@ var PinHeader = class extends NormalComponent {
12936
12936
  return null;
12937
12937
  }
12938
12938
  initPorts() {
12939
- const pinCount = this._parsedProps.pinCount ?? this._parsedProps.pinLabels?.length ?? 1;
12939
+ const pinCount = this._parsedProps.pinCount ?? (Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels.length : this._parsedProps.pinLabels ? Object.keys(this._parsedProps.pinLabels).length : 1);
12940
12940
  for (let i = 1; i <= pinCount; i++) {
12941
+ const label = Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels[i - 1] : this._parsedProps.pinLabels?.[i];
12941
12942
  this.add(
12942
12943
  new Port({
12943
12944
  name: `pin${i}`,
12944
12945
  pinNumber: i,
12945
- aliases: [this._parsedProps.pinLabels?.[i - 1]].filter(
12946
- Boolean
12947
- )
12946
+ aliases: [label].filter(Boolean)
12948
12947
  })
12949
12948
  );
12950
12949
  }
@@ -13827,7 +13826,7 @@ import { identity as identity5 } from "transformation-matrix";
13827
13826
  var package_default = {
13828
13827
  name: "@tscircuit/core",
13829
13828
  type: "module",
13830
- version: "0.0.661",
13829
+ version: "0.0.662",
13831
13830
  types: "dist/index.d.ts",
13832
13831
  main: "dist/index.js",
13833
13832
  module: "dist/index.js",
@@ -13866,7 +13865,7 @@ var package_default = {
13866
13865
  "@tscircuit/matchpack": "^0.0.9",
13867
13866
  "@tscircuit/math-utils": "^0.0.18",
13868
13867
  "@tscircuit/miniflex": "^0.0.4",
13869
- "@tscircuit/props": "0.0.288",
13868
+ "@tscircuit/props": "0.0.289",
13870
13869
  "@tscircuit/schematic-autolayout": "^0.0.6",
13871
13870
  "@tscircuit/schematic-match-adapt": "^0.0.16",
13872
13871
  "@tscircuit/schematic-trace-solver": "^0.0.23",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.662",
4
+ "version": "0.0.663",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "@tscircuit/matchpack": "^0.0.9",
41
41
  "@tscircuit/math-utils": "^0.0.18",
42
42
  "@tscircuit/miniflex": "^0.0.4",
43
- "@tscircuit/props": "0.0.288",
43
+ "@tscircuit/props": "0.0.289",
44
44
  "@tscircuit/schematic-autolayout": "^0.0.6",
45
45
  "@tscircuit/schematic-match-adapt": "^0.0.16",
46
46
  "@tscircuit/schematic-trace-solver": "^0.0.23",