@tscircuit/core 0.0.117 → 0.0.119

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
@@ -5,8 +5,8 @@ import { SchSymbol, BaseSymbolName } from 'schematic-symbols';
5
5
  import { PcbTraceError, PcbPlacementError, LayerRef, AnyCircuitElement, AnySourceComponent, RouteHintPoint } from 'circuit-json';
6
6
  import { SoupUtilObjects } from '@tscircuit/soup-util';
7
7
  import { Matrix } from 'transformation-matrix';
8
- import * as Props from '@tscircuit/props';
9
- import { traceProps, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, holeProps, pcbKeepoutProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, traceHintProps, viaProps } from '@tscircuit/props';
8
+ import * as _tscircuit_props from '@tscircuit/props';
9
+ import { traceProps, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, traceHintProps, viaProps } from '@tscircuit/props';
10
10
 
11
11
  declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortDiscovery", "PortMatching", "SourceTraceRender", "SchematicComponentRender", "SchematicLayout", "SchematicPortRender", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbTraceRender", "PcbTraceHintRender", "PcbRouteNetIslands", "PcbComponentSizeCalculation", "CadModelRender"];
12
12
  type RenderPhase = (typeof orderedRenderPhases)[number];
@@ -552,6 +552,7 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
552
552
  schematicSymbolPortDef: SchSymbol["ports"][number] | null;
553
553
  matchedComponents: PrimitiveComponent[];
554
554
  facingDirection: "up" | "down" | "left" | "right" | null;
555
+ originDescription: string | null;
555
556
  get config(): {
556
557
  componentName: string;
557
558
  zodProps: z.ZodObject<{
@@ -568,7 +569,9 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
568
569
  aliases?: string[] | undefined;
569
570
  }>;
570
571
  };
571
- constructor(props: z.input<typeof portProps>);
572
+ constructor(props: z.input<typeof portProps>, opts?: {
573
+ originDescription?: string;
574
+ });
572
575
  _getGlobalPcbPositionBeforeLayout(): {
573
576
  x: number;
574
577
  y: number;
@@ -806,7 +809,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
806
809
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
807
810
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
808
811
  }>>;
809
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
812
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
810
813
  }, {
811
814
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
812
815
  }>, {
@@ -1046,6 +1049,8 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
1046
1049
  }>]>>;
1047
1050
  children: zod.ZodOptional<zod.ZodAny>;
1048
1051
  symbolName: zod.ZodOptional<zod.ZodString>;
1052
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1053
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1049
1054
  }>, {
1050
1055
  capacitance: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
1051
1056
  decouplingFor: zod.ZodOptional<zod.ZodString>;
@@ -1062,7 +1067,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
1062
1067
  schY?: number | undefined;
1063
1068
  schRotation?: number | undefined;
1064
1069
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
1065
- footprint?: Props.Footprint | undefined;
1070
+ footprint?: _tscircuit_props.Footprint | undefined;
1066
1071
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
1067
1072
  key?: any;
1068
1073
  cadModel?: string | {
@@ -1120,6 +1125,8 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
1120
1125
  } | undefined;
1121
1126
  children?: any;
1122
1127
  symbolName?: string | undefined;
1128
+ width?: number | undefined;
1129
+ height?: number | undefined;
1123
1130
  decouplingFor?: string | undefined;
1124
1131
  decouplingTo?: string | undefined;
1125
1132
  bypassFor?: string | undefined;
@@ -1136,7 +1143,7 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
1136
1143
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
1137
1144
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
1138
1145
  } | undefined;
1139
- footprint?: Props.Footprint | undefined;
1146
+ footprint?: _tscircuit_props.Footprint | undefined;
1140
1147
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
1141
1148
  key?: any;
1142
1149
  cadModel?: string | {
@@ -1194,6 +1201,8 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PassivePo
1194
1201
  } | undefined;
1195
1202
  children?: any;
1196
1203
  symbolName?: string | undefined;
1204
+ width?: string | number | undefined;
1205
+ height?: string | number | undefined;
1197
1206
  decouplingFor?: string | undefined;
1198
1207
  decouplingTo?: string | undefined;
1199
1208
  bypassFor?: string | undefined;
@@ -1253,7 +1262,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
1253
1262
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
1254
1263
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
1255
1264
  }>>;
1256
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
1265
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
1257
1266
  }, {
1258
1267
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
1259
1268
  }>, {
@@ -1493,9 +1502,11 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
1493
1502
  }>]>>;
1494
1503
  children: zod.ZodOptional<zod.ZodAny>;
1495
1504
  symbolName: zod.ZodOptional<zod.ZodString>;
1505
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1506
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1496
1507
  }>, {
1497
1508
  manufacturerPartNumber: zod.ZodOptional<zod.ZodString>;
1498
- pinLabels: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>, zod.ZodString>>;
1509
+ pinLabels: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>, zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">]>>>;
1499
1510
  schPortArrangement: zod.ZodOptional<zod.ZodObject<{
1500
1511
  leftSize: zod.ZodOptional<zod.ZodNumber>;
1501
1512
  topSize: zod.ZodOptional<zod.ZodNumber>;
@@ -1624,7 +1635,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
1624
1635
  schY?: number | undefined;
1625
1636
  schRotation?: number | undefined;
1626
1637
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
1627
- footprint?: Props.Footprint | undefined;
1638
+ footprint?: _tscircuit_props.Footprint | undefined;
1628
1639
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
1629
1640
  key?: any;
1630
1641
  cadModel?: string | {
@@ -1682,8 +1693,10 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
1682
1693
  } | undefined;
1683
1694
  children?: any;
1684
1695
  symbolName?: string | undefined;
1696
+ width?: number | undefined;
1697
+ height?: number | undefined;
1685
1698
  manufacturerPartNumber?: string | undefined;
1686
- pinLabels?: Record<string | number, string> | undefined;
1699
+ pinLabels?: Record<string | number, string | string[]> | undefined;
1687
1700
  schPortArrangement?: {
1688
1701
  leftSize?: number | undefined;
1689
1702
  topSize?: number | undefined;
@@ -1730,7 +1743,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
1730
1743
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
1731
1744
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
1732
1745
  } | undefined;
1733
- footprint?: Props.Footprint | undefined;
1746
+ footprint?: _tscircuit_props.Footprint | undefined;
1734
1747
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
1735
1748
  key?: any;
1736
1749
  cadModel?: string | {
@@ -1788,8 +1801,10 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
1788
1801
  } | undefined;
1789
1802
  children?: any;
1790
1803
  symbolName?: string | undefined;
1804
+ width?: string | number | undefined;
1805
+ height?: string | number | undefined;
1791
1806
  manufacturerPartNumber?: string | undefined;
1792
- pinLabels?: Record<string | number, string> | undefined;
1807
+ pinLabels?: Record<string | number, string | string[]> | undefined;
1793
1808
  schPortArrangement?: {
1794
1809
  leftSize?: number | undefined;
1795
1810
  topSize?: number | undefined;
@@ -1852,7 +1867,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
1852
1867
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
1853
1868
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
1854
1869
  }>>;
1855
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
1870
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
1856
1871
  }, {
1857
1872
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
1858
1873
  }>, {
@@ -2092,6 +2107,8 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
2092
2107
  }>]>>;
2093
2108
  children: zod.ZodOptional<zod.ZodAny>;
2094
2109
  symbolName: zod.ZodOptional<zod.ZodString>;
2110
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2111
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2095
2112
  }>, {}>, "strip", zod.ZodTypeAny, {
2096
2113
  name: string;
2097
2114
  pcbX?: number | undefined;
@@ -2101,7 +2118,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
2101
2118
  schY?: number | undefined;
2102
2119
  schRotation?: number | undefined;
2103
2120
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2104
- footprint?: Props.Footprint | undefined;
2121
+ footprint?: _tscircuit_props.Footprint | undefined;
2105
2122
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
2106
2123
  key?: any;
2107
2124
  cadModel?: string | {
@@ -2159,6 +2176,8 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
2159
2176
  } | undefined;
2160
2177
  children?: any;
2161
2178
  symbolName?: string | undefined;
2179
+ width?: number | undefined;
2180
+ height?: number | undefined;
2162
2181
  }, {
2163
2182
  name: string;
2164
2183
  pcbX?: string | number | undefined;
@@ -2170,7 +2189,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
2170
2189
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2171
2190
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2172
2191
  } | undefined;
2173
- footprint?: Props.Footprint | undefined;
2192
+ footprint?: _tscircuit_props.Footprint | undefined;
2174
2193
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
2175
2194
  key?: any;
2176
2195
  cadModel?: string | {
@@ -2228,6 +2247,8 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
2228
2247
  } | undefined;
2229
2248
  children?: any;
2230
2249
  symbolName?: string | undefined;
2250
+ width?: string | number | undefined;
2251
+ height?: string | number | undefined;
2231
2252
  }>;
2232
2253
  sourceFtype: Ftype;
2233
2254
  };
@@ -2258,7 +2279,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
2258
2279
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2259
2280
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2260
2281
  }>>;
2261
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
2282
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
2262
2283
  }, {
2263
2284
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
2264
2285
  }>, {
@@ -2498,6 +2519,8 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
2498
2519
  }>]>>;
2499
2520
  children: zod.ZodOptional<zod.ZodAny>;
2500
2521
  symbolName: zod.ZodOptional<zod.ZodString>;
2522
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2523
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2501
2524
  }>, {
2502
2525
  manufacturerPartNumber: zod.ZodOptional<zod.ZodString>;
2503
2526
  pinLabels: zod.ZodOptional<zod.ZodRecord<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>, zod.ZodString>>;
@@ -2630,7 +2653,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
2630
2653
  schY?: number | undefined;
2631
2654
  schRotation?: number | undefined;
2632
2655
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2633
- footprint?: Props.Footprint | undefined;
2656
+ footprint?: _tscircuit_props.Footprint | undefined;
2634
2657
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
2635
2658
  key?: any;
2636
2659
  cadModel?: string | {
@@ -2688,6 +2711,8 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
2688
2711
  } | undefined;
2689
2712
  children?: any;
2690
2713
  symbolName?: string | undefined;
2714
+ width?: number | undefined;
2715
+ height?: number | undefined;
2691
2716
  manufacturerPartNumber?: string | undefined;
2692
2717
  pinLabels?: Record<string | number, string> | undefined;
2693
2718
  schPortArrangement?: {
@@ -2737,7 +2762,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
2737
2762
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2738
2763
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2739
2764
  } | undefined;
2740
- footprint?: Props.Footprint | undefined;
2765
+ footprint?: _tscircuit_props.Footprint | undefined;
2741
2766
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
2742
2767
  key?: any;
2743
2768
  cadModel?: string | {
@@ -2795,6 +2820,8 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
2795
2820
  } | undefined;
2796
2821
  children?: any;
2797
2822
  symbolName?: string | undefined;
2823
+ width?: string | number | undefined;
2824
+ height?: string | number | undefined;
2798
2825
  manufacturerPartNumber?: string | undefined;
2799
2826
  pinLabels?: Record<string | number, string> | undefined;
2800
2827
  schPortArrangement?: {
@@ -2860,7 +2887,7 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
2860
2887
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2861
2888
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2862
2889
  }>>;
2863
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
2890
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
2864
2891
  }, {
2865
2892
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
2866
2893
  }>, {
@@ -3100,6 +3127,8 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
3100
3127
  }>]>>;
3101
3128
  children: zod.ZodOptional<zod.ZodAny>;
3102
3129
  symbolName: zod.ZodOptional<zod.ZodString>;
3130
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3131
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3103
3132
  }>, {
3104
3133
  color: zod.ZodOptional<zod.ZodString>;
3105
3134
  }>, "strip", zod.ZodTypeAny, {
@@ -3111,7 +3140,7 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
3111
3140
  schY?: number | undefined;
3112
3141
  schRotation?: number | undefined;
3113
3142
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
3114
- footprint?: Props.Footprint | undefined;
3143
+ footprint?: _tscircuit_props.Footprint | undefined;
3115
3144
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3116
3145
  key?: any;
3117
3146
  cadModel?: string | {
@@ -3169,6 +3198,8 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
3169
3198
  } | undefined;
3170
3199
  children?: any;
3171
3200
  symbolName?: string | undefined;
3201
+ width?: number | undefined;
3202
+ height?: number | undefined;
3172
3203
  color?: string | undefined;
3173
3204
  }, {
3174
3205
  name: string;
@@ -3181,7 +3212,7 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
3181
3212
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3182
3213
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3183
3214
  } | undefined;
3184
- footprint?: Props.Footprint | undefined;
3215
+ footprint?: _tscircuit_props.Footprint | undefined;
3185
3216
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3186
3217
  key?: any;
3187
3218
  cadModel?: string | {
@@ -3239,6 +3270,8 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
3239
3270
  } | undefined;
3240
3271
  children?: any;
3241
3272
  symbolName?: string | undefined;
3273
+ width?: string | number | undefined;
3274
+ height?: string | number | undefined;
3242
3275
  color?: string | undefined;
3243
3276
  }>;
3244
3277
  sourceFtype: Ftype;
@@ -3270,7 +3303,7 @@ declare class PowerSource extends NormalComponent<typeof powerSourceProps, Polar
3270
3303
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3271
3304
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3272
3305
  }>>;
3273
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
3306
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
3274
3307
  }, {
3275
3308
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
3276
3309
  }>, {
@@ -3510,6 +3543,8 @@ declare class PowerSource extends NormalComponent<typeof powerSourceProps, Polar
3510
3543
  }>]>>;
3511
3544
  children: zod.ZodOptional<zod.ZodAny>;
3512
3545
  symbolName: zod.ZodOptional<zod.ZodString>;
3546
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3547
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3513
3548
  }>, {
3514
3549
  voltage: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3515
3550
  }>, "strip", zod.ZodTypeAny, {
@@ -3522,7 +3557,7 @@ declare class PowerSource extends NormalComponent<typeof powerSourceProps, Polar
3522
3557
  schY?: number | undefined;
3523
3558
  schRotation?: number | undefined;
3524
3559
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
3525
- footprint?: Props.Footprint | undefined;
3560
+ footprint?: _tscircuit_props.Footprint | undefined;
3526
3561
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3527
3562
  key?: any;
3528
3563
  cadModel?: string | {
@@ -3580,6 +3615,8 @@ declare class PowerSource extends NormalComponent<typeof powerSourceProps, Polar
3580
3615
  } | undefined;
3581
3616
  children?: any;
3582
3617
  symbolName?: string | undefined;
3618
+ width?: number | undefined;
3619
+ height?: number | undefined;
3583
3620
  }, {
3584
3621
  name: string;
3585
3622
  voltage: string | number;
@@ -3592,7 +3629,7 @@ declare class PowerSource extends NormalComponent<typeof powerSourceProps, Polar
3592
3629
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3593
3630
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3594
3631
  } | undefined;
3595
- footprint?: Props.Footprint | undefined;
3632
+ footprint?: _tscircuit_props.Footprint | undefined;
3596
3633
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3597
3634
  key?: any;
3598
3635
  cadModel?: string | {
@@ -3650,6 +3687,8 @@ declare class PowerSource extends NormalComponent<typeof powerSourceProps, Polar
3650
3687
  } | undefined;
3651
3688
  children?: any;
3652
3689
  symbolName?: string | undefined;
3690
+ width?: string | number | undefined;
3691
+ height?: string | number | undefined;
3653
3692
  }>;
3654
3693
  sourceFtype: Ftype;
3655
3694
  };
@@ -3680,7 +3719,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
3680
3719
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3681
3720
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3682
3721
  }>>;
3683
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
3722
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
3684
3723
  }, {
3685
3724
  supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
3686
3725
  }>, {
@@ -3920,6 +3959,8 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
3920
3959
  }>]>>;
3921
3960
  children: zod.ZodOptional<zod.ZodAny>;
3922
3961
  symbolName: zod.ZodOptional<zod.ZodString>;
3962
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3963
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3923
3964
  }>, {
3924
3965
  resistance: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3925
3966
  pullupFor: zod.ZodOptional<zod.ZodString>;
@@ -3936,7 +3977,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
3936
3977
  schY?: number | undefined;
3937
3978
  schRotation?: number | undefined;
3938
3979
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
3939
- footprint?: Props.Footprint | undefined;
3980
+ footprint?: _tscircuit_props.Footprint | undefined;
3940
3981
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3941
3982
  key?: any;
3942
3983
  cadModel?: string | {
@@ -3994,6 +4035,8 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
3994
4035
  } | undefined;
3995
4036
  children?: any;
3996
4037
  symbolName?: string | undefined;
4038
+ width?: number | undefined;
4039
+ height?: number | undefined;
3997
4040
  pullupFor?: string | undefined;
3998
4041
  pullupTo?: string | undefined;
3999
4042
  pulldownFor?: string | undefined;
@@ -4010,7 +4053,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
4010
4053
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4011
4054
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4012
4055
  } | undefined;
4013
- footprint?: Props.Footprint | undefined;
4056
+ footprint?: _tscircuit_props.Footprint | undefined;
4014
4057
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
4015
4058
  key?: any;
4016
4059
  cadModel?: string | {
@@ -4068,6 +4111,8 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
4068
4111
  } | undefined;
4069
4112
  children?: any;
4070
4113
  symbolName?: string | undefined;
4114
+ width?: string | number | undefined;
4115
+ height?: string | number | undefined;
4071
4116
  pullupFor?: string | undefined;
4072
4117
  pullupTo?: string | undefined;
4073
4118
  pulldownFor?: string | undefined;
@@ -4478,25 +4523,54 @@ declare class Keepout extends PrimitiveComponent<typeof pcbKeepoutProps> {
4478
4523
  doInitialPcbPrimitiveRender(): void;
4479
4524
  }
4480
4525
 
4481
- declare const netAliasProps: z.ZodObject<{
4482
- net: z.ZodString;
4483
- }, "strip", z.ZodTypeAny, {
4484
- net: string;
4485
- }, {
4486
- net: string;
4487
- }>;
4488
4526
  declare class NetAlias extends PrimitiveComponent<typeof netAliasProps> {
4489
4527
  source_net_alias_id?: string;
4490
4528
  get config(): {
4491
4529
  componentName: string;
4492
- zodProps: z.ZodObject<{
4493
- net: z.ZodString;
4494
- }, "strip", z.ZodTypeAny, {
4495
- net: string;
4530
+ zodProps: zod.ZodObject<zod.objectUtil.extendShape<{
4531
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4532
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4533
+ pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4534
+ schX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4535
+ schY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4536
+ schRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4537
+ layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
4538
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
4539
+ }, "strip", zod.ZodTypeAny, {
4540
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4541
+ }, {
4542
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4543
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4544
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4545
+ }>>;
4546
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
4496
4547
  }, {
4497
- net: string;
4548
+ net: zod.ZodOptional<zod.ZodString>;
4549
+ }>, "strip", zod.ZodTypeAny, {
4550
+ pcbX?: number | undefined;
4551
+ pcbY?: number | undefined;
4552
+ pcbRotation?: number | undefined;
4553
+ schX?: number | undefined;
4554
+ schY?: number | undefined;
4555
+ schRotation?: number | undefined;
4556
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
4557
+ footprint?: _tscircuit_props.Footprint | undefined;
4558
+ net?: string | undefined;
4559
+ }, {
4560
+ pcbX?: string | number | undefined;
4561
+ pcbY?: string | number | undefined;
4562
+ pcbRotation?: string | number | undefined;
4563
+ schX?: string | number | undefined;
4564
+ schY?: string | number | undefined;
4565
+ schRotation?: string | number | undefined;
4566
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4567
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4568
+ } | undefined;
4569
+ footprint?: _tscircuit_props.Footprint | undefined;
4570
+ net?: string | undefined;
4498
4571
  }>;
4499
4572
  };
4573
+ initPorts(): void;
4500
4574
  doInitialSchematicComponentRender(): void;
4501
4575
  }
4502
4576
 
@@ -5146,7 +5220,7 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
5146
5220
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
5147
5221
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
5148
5222
  }>>;
5149
- footprint: zod.ZodOptional<zod.ZodType<Props.Footprint, zod.ZodTypeDef, Props.Footprint>>;
5223
+ footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
5150
5224
  }, {
5151
5225
  fromLayer: zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
5152
5226
  name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
@@ -5180,7 +5254,7 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
5180
5254
  schY?: number | undefined;
5181
5255
  schRotation?: number | undefined;
5182
5256
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
5183
- footprint?: Props.Footprint | undefined;
5257
+ footprint?: _tscircuit_props.Footprint | undefined;
5184
5258
  }, {
5185
5259
  fromLayer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
5186
5260
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -5199,7 +5273,7 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
5199
5273
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
5200
5274
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
5201
5275
  } | undefined;
5202
- footprint?: Props.Footprint | undefined;
5276
+ footprint?: _tscircuit_props.Footprint | undefined;
5203
5277
  }>;
5204
5278
  };
5205
5279
  getAvailablePcbLayers(): string[];
@@ -5240,44 +5314,44 @@ declare const createUseComponent: <C extends React.ComponentType<any>, PiD exten
5240
5314
  declare global {
5241
5315
  namespace JSX {
5242
5316
  interface IntrinsicElements {
5243
- resistor: Props.ResistorProps;
5244
- capacitor: Props.CapacitorProps;
5245
- inductor: Props.InductorProps;
5246
- diode: Props.DiodeProps;
5247
- led: Props.LedProps;
5248
- board: Props.BoardProps;
5249
- jumper: Props.JumperProps;
5250
- bug: Props.ChipProps;
5251
- chip: Props.ChipProps;
5252
- powersource: Props.PowerSourceProps;
5253
- via: Props.ViaProps;
5254
- schematicbox: Props.SchematicBoxProps;
5255
- schematicline: Props.SchematicLineProps;
5256
- schematicpath: Props.SchematicPathProps;
5257
- schematictext: Props.SchematicTextProps;
5258
- smtpad: Props.SmtPadProps;
5259
- platedhole: Props.PlatedHoleProps;
5260
- keepout: Props.PcbKeepoutProps;
5261
- hole: Props.HoleProps;
5262
- port: Props.PortProps;
5263
- group: Props.GroupProps;
5264
- netalias: Props.NetAliasProps;
5265
- net: Props.NetProps;
5266
- trace: Props.TraceProps;
5317
+ resistor: _tscircuit_props.ResistorProps;
5318
+ capacitor: _tscircuit_props.CapacitorProps;
5319
+ inductor: _tscircuit_props.InductorProps;
5320
+ diode: _tscircuit_props.DiodeProps;
5321
+ led: _tscircuit_props.LedProps;
5322
+ board: _tscircuit_props.BoardProps;
5323
+ jumper: _tscircuit_props.JumperProps;
5324
+ bug: _tscircuit_props.ChipProps;
5325
+ chip: _tscircuit_props.ChipProps;
5326
+ powersource: _tscircuit_props.PowerSourceProps;
5327
+ via: _tscircuit_props.ViaProps;
5328
+ schematicbox: _tscircuit_props.SchematicBoxProps;
5329
+ schematicline: _tscircuit_props.SchematicLineProps;
5330
+ schematicpath: _tscircuit_props.SchematicPathProps;
5331
+ schematictext: _tscircuit_props.SchematicTextProps;
5332
+ smtpad: _tscircuit_props.SmtPadProps;
5333
+ platedhole: _tscircuit_props.PlatedHoleProps;
5334
+ keepout: _tscircuit_props.PcbKeepoutProps;
5335
+ hole: _tscircuit_props.HoleProps;
5336
+ port: _tscircuit_props.PortProps;
5337
+ group: _tscircuit_props.GroupProps;
5338
+ netalias: _tscircuit_props.NetAliasProps;
5339
+ net: _tscircuit_props.NetProps;
5340
+ trace: _tscircuit_props.TraceProps;
5267
5341
  custom: any;
5268
- component: Props.ComponentProps;
5342
+ component: _tscircuit_props.ComponentProps;
5269
5343
  footprint: any;
5270
- silkscreentext: Props.SilkscreenTextProps;
5271
- silkscreenpath: Props.SilkscreenPathProps;
5272
- silkscreenline: Props.SilkscreenLineProps;
5273
- silkscreenrect: Props.SilkscreenRectProps;
5274
- silkscreencircle: Props.SilkscreenCircleProps;
5275
- tracehint: Props.TraceHintProps;
5276
- pcbtrace: Props.PcbTraceProps;
5277
- fabricationnotetext: Props.FabricationNoteTextProps;
5278
- fabricationnotepath: Props.FabricationNotePathProps;
5279
- constraint: Props.ConstraintProps;
5280
- constrainedlayout: Props.ConstrainedLayoutProps;
5344
+ silkscreentext: _tscircuit_props.SilkscreenTextProps;
5345
+ silkscreenpath: _tscircuit_props.SilkscreenPathProps;
5346
+ silkscreenline: _tscircuit_props.SilkscreenLineProps;
5347
+ silkscreenrect: _tscircuit_props.SilkscreenRectProps;
5348
+ silkscreencircle: _tscircuit_props.SilkscreenCircleProps;
5349
+ tracehint: _tscircuit_props.TraceHintProps;
5350
+ pcbtrace: _tscircuit_props.PcbTraceProps;
5351
+ fabricationnotetext: _tscircuit_props.FabricationNoteTextProps;
5352
+ fabricationnotepath: _tscircuit_props.FabricationNotePathProps;
5353
+ constraint: _tscircuit_props.ConstraintProps;
5354
+ constrainedlayout: _tscircuit_props.ConstrainedLayoutProps;
5281
5355
  jscad: any;
5282
5356
  }
5283
5357
  }
package/dist/index.js CHANGED
@@ -739,6 +739,9 @@ var PrimitiveComponent = class extends Renderable {
739
739
  }
740
740
  getString() {
741
741
  const { lowercaseComponentName: cname, _parsedProps: props, parent } = this;
742
+ if (props?.pinNumber !== void 0 && parent?.props?.name && props?.name) {
743
+ return `<${cname}#${this._renderId}(pin:${props.pinNumber} .${parent?.props.name}>.${props.name}) />`;
744
+ }
742
745
  if (parent?.props?.name && props?.name) {
743
746
  return `<${cname}#${this._renderId}(.${parent?.props.name}>.${props?.name}) />`;
744
747
  }
@@ -1465,18 +1468,22 @@ var Port = class extends PrimitiveComponent {
1465
1468
  schematicSymbolPortDef = null;
1466
1469
  matchedComponents;
1467
1470
  facingDirection = null;
1471
+ originDescription = null;
1468
1472
  get config() {
1469
1473
  return {
1470
1474
  componentName: "Port",
1471
1475
  zodProps: portProps
1472
1476
  };
1473
1477
  }
1474
- constructor(props) {
1478
+ constructor(props, opts = {}) {
1475
1479
  if (!props.name && props.pinNumber) props.name = `pin${props.pinNumber}`;
1476
1480
  if (!props.name) {
1477
1481
  throw new Error("Port must have a name or a pinNumber");
1478
1482
  }
1479
1483
  super(props);
1484
+ if (opts.originDescription) {
1485
+ this.originDescription = opts.originDescription;
1486
+ }
1480
1487
  this.matchedComponents = [];
1481
1488
  }
1482
1489
  _getGlobalPcbPositionBeforeLayout() {
@@ -1879,6 +1886,8 @@ var Footprint = class extends PrimitiveComponent {
1879
1886
  };
1880
1887
 
1881
1888
  // lib/components/base-components/NormalComponent.ts
1889
+ import Debug2 from "debug";
1890
+ var debug2 = Debug2("tscircuit:core");
1882
1891
  var rotation3 = z4.object({
1883
1892
  x: rotation,
1884
1893
  y: rotation,
@@ -1915,7 +1924,16 @@ var NormalComponent = class extends PrimitiveComponent {
1915
1924
  const pins = schPortArrangement[side].pins;
1916
1925
  if (Array.isArray(pins)) {
1917
1926
  for (const pinNumber of pins) {
1918
- portsToCreate.push(new Port({ pinNumber }));
1927
+ portsToCreate.push(
1928
+ new Port(
1929
+ {
1930
+ pinNumber
1931
+ },
1932
+ {
1933
+ originDescription: `schPortArrangement:${side}`
1934
+ }
1935
+ )
1936
+ );
1919
1937
  }
1920
1938
  }
1921
1939
  }
@@ -1927,15 +1945,23 @@ var NormalComponent = class extends PrimitiveComponent {
1927
1945
  let existingPort = portsToCreate.find(
1928
1946
  (p) => p._parsedProps.pinNumber === Number(pinNumber)
1929
1947
  );
1948
+ const primaryLabel = Array.isArray(label) ? label[0] : label;
1949
+ const otherLabels = Array.isArray(label) ? label.slice(1) : [];
1930
1950
  if (!existingPort) {
1931
- existingPort = new Port({
1932
- pinNumber: parseInt(pinNumber),
1933
- name: label
1934
- });
1951
+ existingPort = new Port(
1952
+ {
1953
+ pinNumber: parseInt(pinNumber),
1954
+ name: primaryLabel,
1955
+ aliases: otherLabels
1956
+ },
1957
+ {
1958
+ originDescription: `pinLabels:pin${pinNumber}`
1959
+ }
1960
+ );
1935
1961
  portsToCreate.push(existingPort);
1936
1962
  } else {
1937
- existingPort.externallyAddedAliases.push(label);
1938
- existingPort.props.name = label;
1963
+ existingPort.externallyAddedAliases.push(primaryLabel, ...otherLabels);
1964
+ existingPort.props.name = primaryLabel;
1939
1965
  }
1940
1966
  }
1941
1967
  }
@@ -1945,6 +1971,7 @@ var NormalComponent = class extends PrimitiveComponent {
1945
1971
  for (const symPort of sym.ports) {
1946
1972
  const port = getPortFromHints(symPort.labels);
1947
1973
  if (port) {
1974
+ port.originDescription = `schematicSymbol:labels[0]:${symPort.labels[0]}`;
1948
1975
  port.schematicSymbolPortDef = symPort;
1949
1976
  portsToCreate.push(port);
1950
1977
  }
@@ -2107,8 +2134,8 @@ var NormalComponent = class extends PrimitiveComponent {
2107
2134
  (p) => p.isMatchingAnyOf(component.getNameAndAliases())
2108
2135
  );
2109
2136
  if (conflictingPort) {
2110
- throw new Error(
2111
- `Conflicting ports added. Port 1: ${conflictingPort}, Port 2: ${component}`
2137
+ debug2(
2138
+ `Similar ports added. Port 1: ${conflictingPort}, Port 2: ${component}`
2112
2139
  );
2113
2140
  }
2114
2141
  }
@@ -2126,6 +2153,7 @@ var NormalComponent = class extends PrimitiveComponent {
2126
2153
  if ("port_hints" in elm && elm.port_hints) {
2127
2154
  const newPort = getPortFromHints(elm.port_hints);
2128
2155
  if (!newPort) continue;
2156
+ newPort.originDescription = `footprint:string:${footprint}:port_hints[0]:${elm.port_hints[0]}`;
2129
2157
  newPorts2.push(newPort);
2130
2158
  }
2131
2159
  }
@@ -2137,6 +2165,7 @@ var NormalComponent = class extends PrimitiveComponent {
2137
2165
  for (const fpChild of fp2.children) {
2138
2166
  const newPort = getPortFromHints(fpChild.props.portHints ?? []);
2139
2167
  if (!newPort) continue;
2168
+ newPort.originDescription = `footprint:${footprint}`;
2140
2169
  newPorts2.push(newPort);
2141
2170
  }
2142
2171
  return newPorts2;
@@ -3437,6 +3466,10 @@ var Chip = class extends NormalComponent {
3437
3466
  schPortArrangement: props.schPortArrangement
3438
3467
  });
3439
3468
  this.schematicDimensions = dimensions;
3469
+ const primaryPortLabels = {};
3470
+ for (const [port, label] of Object.entries(props.pinLabels ?? {})) {
3471
+ primaryPortLabels[port] = Array.isArray(label) ? label[0] : label;
3472
+ }
3440
3473
  const schematic_component2 = db.schematic_component.insert({
3441
3474
  center: { x: props.schX ?? 0, y: props.schY ?? 0 },
3442
3475
  rotation: props.schRotation ?? 0,
@@ -3447,7 +3480,7 @@ var Chip = class extends NormalComponent {
3447
3480
  pin_spacing: pinSpacing,
3448
3481
  // @ts-ignore soup needs to support distance for pin_styles
3449
3482
  pin_styles: underscorifyPinStyles(props.schPinStyle),
3450
- port_labels: props.pinLabels,
3483
+ port_labels: primaryPortLabels,
3451
3484
  source_component_id: this.source_component_id
3452
3485
  });
3453
3486
  this.schematic_component_id = schematic_component2.schematic_component_id;
@@ -3483,10 +3516,10 @@ var Diode = class extends NormalComponent {
3483
3516
  }
3484
3517
  initPorts() {
3485
3518
  this.add(
3486
- new Port({ name: "pin1", pinNumber: 1, aliases: ["anode", "pos"] })
3519
+ new Port({ name: "pin1", pinNumber: 1, aliases: ["anode", "pos", "left"] })
3487
3520
  );
3488
3521
  this.add(
3489
- new Port({ name: "pin2", pinNumber: 2, aliases: ["cathode", "neg"] })
3522
+ new Port({ name: "pin2", pinNumber: 2, aliases: ["cathode", "neg", "right"] })
3490
3523
  );
3491
3524
  }
3492
3525
  pos = this.portMap.pin1;
@@ -3582,8 +3615,8 @@ var Led = class extends NormalComponent {
3582
3615
  };
3583
3616
  }
3584
3617
  initPorts() {
3585
- this.add(new Port({ name: "pin1", pinNumber: 1, aliases: ["anode", "pos"] }));
3586
- this.add(new Port({ name: "pin2", pinNumber: 2, aliases: ["cathode", "neg"] }));
3618
+ this.add(new Port({ name: "pin1", pinNumber: 1, aliases: ["anode", "pos", "left"] }));
3619
+ this.add(new Port({ name: "pin2", pinNumber: 2, aliases: ["cathode", "neg", "right"] }));
3587
3620
  }
3588
3621
  pos = this.portMap.pin1;
3589
3622
  anode = this.portMap.pin1;
@@ -3803,10 +3836,7 @@ var FabricationNoteText = class extends PrimitiveComponent {
3803
3836
  };
3804
3837
 
3805
3838
  // lib/components/primitive-components/NetAlias.ts
3806
- import { z as z9 } from "zod";
3807
- var netAliasProps = z9.object({
3808
- net: z9.string()
3809
- });
3839
+ import { netAliasProps } from "@tscircuit/props";
3810
3840
  var NetAlias = class extends PrimitiveComponent {
3811
3841
  source_net_alias_id;
3812
3842
  get config() {
@@ -3815,13 +3845,22 @@ var NetAlias = class extends PrimitiveComponent {
3815
3845
  zodProps: netAliasProps
3816
3846
  };
3817
3847
  }
3848
+ initPorts() {
3849
+ this.add(
3850
+ new Port({
3851
+ name: "pin1",
3852
+ pinNumber: 1,
3853
+ aliases: ["anode", "pos", "left"]
3854
+ })
3855
+ );
3856
+ }
3818
3857
  doInitialSchematicComponentRender() {
3819
3858
  const { db } = this.root;
3820
3859
  const { _parsedProps: props } = this;
3821
3860
  const netAlias = db.schematic_net_label.insert({
3822
3861
  text: props.net,
3823
3862
  source_net_id: props.net,
3824
- center: { x: 0, y: 0 },
3863
+ center: { x: props.schX ?? 0, y: props.schY ?? 0 },
3825
3864
  anchor_side: "bottom"
3826
3865
  });
3827
3866
  this.source_net_alias_id = netAlias.source_net_id;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.117",
4
+ "version": "0.0.119",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "@tscircuit/footprinter": "^0.0.71",
40
40
  "@tscircuit/infgrid-ijump-astar": "^0.0.21",
41
41
  "@tscircuit/math-utils": "^0.0.4",
42
- "@tscircuit/props": "^0.0.68",
42
+ "@tscircuit/props": "^0.0.70",
43
43
  "@tscircuit/soup-util": "^0.0.33",
44
44
  "circuit-json": "^0.0.85",
45
45
  "circuit-json-to-connectivity-map": "^0.0.17",