@tscircuit/core 0.0.1257 → 0.0.1261

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
@@ -192,6 +192,9 @@ interface AutoroutingProgressEvent {
192
192
  }
193
193
  interface AutoroutingEndEvent {
194
194
  type: "autorouting:end";
195
+ subcircuit_id: string;
196
+ componentDisplayName: string;
197
+ simpleRouteJson: SimpleRouteJson;
195
198
  }
196
199
  interface PackingStartEvent {
197
200
  type: "packing:start";
@@ -1335,9 +1338,11 @@ declare class Net extends PrimitiveComponent<typeof netProps> {
1335
1338
  highlightColor: zod.ZodOptional<zod.ZodString>;
1336
1339
  isPowerNet: zod.ZodOptional<zod.ZodBoolean>;
1337
1340
  isGroundNet: zod.ZodOptional<zod.ZodBoolean>;
1341
+ nominalTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1338
1342
  }, "strip", zod.ZodTypeAny, {
1339
1343
  name: string;
1340
1344
  highlightColor?: string | undefined;
1345
+ nominalTraceWidth?: number | undefined;
1341
1346
  connectsTo?: string | string[] | undefined;
1342
1347
  routingPhaseIndex?: number | null | undefined;
1343
1348
  isPowerNet?: boolean | undefined;
@@ -1345,6 +1350,7 @@ declare class Net extends PrimitiveComponent<typeof netProps> {
1345
1350
  }, {
1346
1351
  name: string;
1347
1352
  highlightColor?: string | undefined;
1353
+ nominalTraceWidth?: string | number | undefined;
1348
1354
  connectsTo?: string | string[] | undefined;
1349
1355
  routingPhaseIndex?: number | null | undefined;
1350
1356
  isPowerNet?: boolean | undefined;
@@ -1398,6 +1404,7 @@ interface RoutingPhasePlan {
1398
1404
  autorouter?: AutorouterProp;
1399
1405
  reroute?: boolean;
1400
1406
  region?: AutoroutingPhaseProps["region"];
1407
+ connectionSelectors?: string[];
1401
1408
  drcTolerances?: RoutingPhaseDrcTolerances;
1402
1409
  nets: Net[];
1403
1410
  traces: Trace[];
@@ -71254,6 +71261,8 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71254
71261
  maxY: number;
71255
71262
  shape?: "rect" | undefined;
71256
71263
  }>>;
71264
+ connection: zod.ZodOptional<zod.ZodString>;
71265
+ connections: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
71257
71266
  reroute: zod.ZodOptional<zod.ZodBoolean>;
71258
71267
  minTraceWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
71259
71268
  minViaHoleEdgeToViaHoleEdgeClearance: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -71269,6 +71278,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71269
71278
  phaseIndex: zod.ZodOptional<zod.ZodNumber>;
71270
71279
  }, "strip", zod.ZodTypeAny, {
71271
71280
  key?: any;
71281
+ connections?: string[] | undefined;
71272
71282
  minTraceWidth?: number | undefined;
71273
71283
  minViaHoleEdgeToViaHoleEdgeClearance?: number | undefined;
71274
71284
  minViaEdgeToPadEdgeClearance?: number | undefined;
@@ -71279,6 +71289,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71279
71289
  minViaHoleDiameter?: number | undefined;
71280
71290
  minViaPadDiameter?: number | undefined;
71281
71291
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
71292
+ connection?: string | undefined;
71282
71293
  phaseIndex?: number | undefined;
71283
71294
  region?: {
71284
71295
  minX: number;
@@ -71290,6 +71301,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71290
71301
  reroute?: boolean | undefined;
71291
71302
  }, {
71292
71303
  key?: any;
71304
+ connections?: string[] | undefined;
71293
71305
  minTraceWidth?: string | number | undefined;
71294
71306
  minViaHoleEdgeToViaHoleEdgeClearance?: string | number | undefined;
71295
71307
  minViaEdgeToPadEdgeClearance?: string | number | undefined;
@@ -71300,6 +71312,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71300
71312
  minViaHoleDiameter?: string | number | undefined;
71301
71313
  minViaPadDiameter?: string | number | undefined;
71302
71314
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
71315
+ connection?: string | undefined;
71303
71316
  phaseIndex?: number | undefined;
71304
71317
  region?: {
71305
71318
  minX: number;
@@ -71311,6 +71324,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71311
71324
  reroute?: boolean | undefined;
71312
71325
  }>, {
71313
71326
  key?: any;
71327
+ connections?: string[] | undefined;
71314
71328
  minTraceWidth?: number | undefined;
71315
71329
  minViaHoleEdgeToViaHoleEdgeClearance?: number | undefined;
71316
71330
  minViaEdgeToPadEdgeClearance?: number | undefined;
@@ -71321,6 +71335,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71321
71335
  minViaHoleDiameter?: number | undefined;
71322
71336
  minViaPadDiameter?: number | undefined;
71323
71337
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
71338
+ connection?: string | undefined;
71324
71339
  phaseIndex?: number | undefined;
71325
71340
  region?: {
71326
71341
  minX: number;
@@ -71332,6 +71347,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71332
71347
  reroute?: boolean | undefined;
71333
71348
  }, {
71334
71349
  key?: any;
71350
+ connections?: string[] | undefined;
71335
71351
  minTraceWidth?: string | number | undefined;
71336
71352
  minViaHoleEdgeToViaHoleEdgeClearance?: string | number | undefined;
71337
71353
  minViaEdgeToPadEdgeClearance?: string | number | undefined;
@@ -71342,6 +71358,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
71342
71358
  minViaHoleDiameter?: string | number | undefined;
71343
71359
  minViaPadDiameter?: string | number | undefined;
71344
71360
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
71361
+ connection?: string | undefined;
71345
71362
  phaseIndex?: number | undefined;
71346
71363
  region?: {
71347
71364
  minX: number;
@@ -83566,7 +83583,7 @@ declare const pcbViaProps: z.ZodObject<{
83566
83583
  schRelative: z.ZodOptional<z.ZodBoolean>;
83567
83584
  pcbRelative: z.ZodOptional<z.ZodBoolean>;
83568
83585
  connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
83569
- fromLayer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83586
+ fromLayer: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83570
83587
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
83571
83588
  }, "strip", z.ZodTypeAny, {
83572
83589
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -83574,8 +83591,8 @@ declare const pcbViaProps: z.ZodObject<{
83574
83591
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83575
83592
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
83576
83593
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83577
- }>>;
83578
- toLayer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83594
+ }>>>;
83595
+ toLayer: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83579
83596
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
83580
83597
  }, "strip", z.ZodTypeAny, {
83581
83598
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -83583,7 +83600,7 @@ declare const pcbViaProps: z.ZodObject<{
83583
83600
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83584
83601
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
83585
83602
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83586
- }>>;
83603
+ }>>>;
83587
83604
  holeDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
83588
83605
  isTented: z.ZodOptional<z.ZodBoolean>;
83589
83606
  outerDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -83817,7 +83834,7 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
83817
83834
  schRelative: z.ZodOptional<z.ZodBoolean>;
83818
83835
  pcbRelative: z.ZodOptional<z.ZodBoolean>;
83819
83836
  connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
83820
- fromLayer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83837
+ fromLayer: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83821
83838
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
83822
83839
  }, "strip", z.ZodTypeAny, {
83823
83840
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -83825,8 +83842,8 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
83825
83842
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83826
83843
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
83827
83844
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83828
- }>>;
83829
- toLayer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83845
+ }>>>;
83846
+ toLayer: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
83830
83847
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
83831
83848
  }, "strip", z.ZodTypeAny, {
83832
83849
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -83834,7 +83851,7 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
83834
83851
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83835
83852
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
83836
83853
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
83837
- }>>;
83854
+ }>>>;
83838
83855
  holeDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
83839
83856
  isTented: z.ZodOptional<z.ZodBoolean>;
83840
83857
  outerDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -84277,7 +84294,7 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
84277
84294
  pcbRelative: z.ZodOptional<z.ZodBoolean>;
84278
84295
  } & {
84279
84296
  name: z.ZodOptional<z.ZodString>;
84280
- fromLayer: z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
84297
+ fromLayer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
84281
84298
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
84282
84299
  }, "strip", z.ZodTypeAny, {
84283
84300
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -84285,8 +84302,8 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
84285
84302
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84286
84303
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84287
84304
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84288
- }>;
84289
- toLayer: z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
84305
+ }>>;
84306
+ toLayer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
84290
84307
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
84291
84308
  }, "strip", z.ZodTypeAny, {
84292
84309
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
@@ -84294,17 +84311,25 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
84294
84311
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84295
84312
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84296
84313
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84297
- }>;
84314
+ }>>;
84298
84315
  holeDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
84299
84316
  outerDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
84317
+ layers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
84318
+ name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
84319
+ }, "strip", z.ZodTypeAny, {
84320
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84321
+ }, {
84322
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84323
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84324
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84325
+ }>, "many">>;
84300
84326
  connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
84301
84327
  netIsAssignable: z.ZodOptional<z.ZodBoolean>;
84302
84328
  }, "strip", z.ZodTypeAny, {
84303
- fromLayer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84304
- toLayer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84305
84329
  symbol?: _tscircuit_props.SymbolProp | undefined;
84306
84330
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
84307
84331
  name?: string | undefined;
84332
+ layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6")[] | undefined;
84308
84333
  pcbX?: string | number | undefined;
84309
84334
  pcbY?: string | number | undefined;
84310
84335
  pcbLeftEdgeX?: string | number | undefined;
@@ -84354,19 +84379,18 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
84354
84379
  connectsTo?: string | string[] | undefined;
84355
84380
  holeDiameter?: number | undefined;
84356
84381
  outerDiameter?: number | undefined;
84382
+ fromLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
84383
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
84357
84384
  netIsAssignable?: boolean | undefined;
84358
84385
  }, {
84359
- fromLayer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84360
- name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84361
- };
84362
- toLayer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84363
- name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84364
- };
84365
84386
  symbol?: _tscircuit_props.SymbolProp | undefined;
84366
84387
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84367
84388
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84368
84389
  } | undefined;
84369
84390
  name?: string | undefined;
84391
+ layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84392
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84393
+ })[] | undefined;
84370
84394
  pcbX?: string | number | undefined;
84371
84395
  pcbY?: string | number | undefined;
84372
84396
  pcbLeftEdgeX?: string | number | undefined;
@@ -84416,6 +84440,12 @@ declare class Via extends PrimitiveComponent<typeof viaProps> {
84416
84440
  connectsTo?: string | string[] | undefined;
84417
84441
  holeDiameter?: string | number | undefined;
84418
84442
  outerDiameter?: string | number | undefined;
84443
+ fromLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84444
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84445
+ } | undefined;
84446
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
84447
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
84448
+ } | undefined;
84419
84449
  netIsAssignable?: boolean | undefined;
84420
84450
  }>;
84421
84451
  };
package/dist/index.js CHANGED
@@ -12618,6 +12618,14 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
12618
12618
  const cadModelProp2 = this._parsedProps.cadModel;
12619
12619
  const cadModel = cadModelProp2 === void 0 ? this._asyncFootprintCadModel : cadModelProp2;
12620
12620
  const footprint = this.getFootprinterString() ?? this._getImpliedFootprintString();
12621
+ let footprintString;
12622
+ if (typeof footprint === "string") {
12623
+ footprintString = footprint;
12624
+ }
12625
+ let footprintIsFootprinterString = false;
12626
+ if (footprintString) {
12627
+ footprintIsFootprinterString = !parseLibraryFootprintRef(footprintString) && !isHttpUrl(footprintString) && !isStaticAssetPath(footprintString);
12628
+ }
12621
12629
  if (!this.pcb_component_id) return;
12622
12630
  if (cadModel === null) return;
12623
12631
  const bounds = this._getPcbCircuitJsonBounds();
@@ -12647,7 +12655,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
12647
12655
  const preLayoutRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
12648
12656
  const totalRotation = pcbComponent?.position_mode === "packed" ? pcbComponent.rotation ?? preLayoutRotation : preLayoutRotation;
12649
12657
  const isBottomLayer = computedLayer === "bottom";
12650
- if (!cadModel && !footprint) {
12658
+ if (!cadModel && !footprintIsFootprinterString) {
12651
12659
  const cad_component = db.cad_component.insert({
12652
12660
  position: {
12653
12661
  x: bounds.center.x,
@@ -12671,6 +12679,10 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
12671
12679
  }
12672
12680
  const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
12673
12681
  const cadRotationZ = normalizeDegrees2(rotationWithOffset);
12682
+ let footprinterStringForCadComponent;
12683
+ if (!cadModel && footprintIsFootprinterString) {
12684
+ footprinterStringForCadComponent = footprintString;
12685
+ }
12674
12686
  const cad_model = db.cad_component.insert({
12675
12687
  // TODO z maybe depends on layer
12676
12688
  position: {
@@ -12698,7 +12710,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
12698
12710
  model_origin_alignment: "center_of_component_on_board_surface",
12699
12711
  anchor_alignment: "center_of_component_on_board_surface",
12700
12712
  model_origin_position: cadModel?.modelOriginPosition,
12701
- footprinter_string: typeof footprint === "string" && !cadModel ? footprint : void 0,
12713
+ footprinter_string: footprinterStringForCadComponent,
12702
12714
  show_as_translucent_model: this._parsedProps.showAsTranslucentModel
12703
12715
  });
12704
12716
  this.cad_component_id = cad_model.cad_component_id;
@@ -18740,6 +18752,20 @@ function getTraceRoutingPhaseIndex(trace) {
18740
18752
  }
18741
18753
  return routingPhaseIndex;
18742
18754
  }
18755
+ function convertPortSelectorToEndpointKey(selector) {
18756
+ return selector.trim().replace(/\s*>\s*/g, ".").replace(/\s+/g, ".").replace(/^\./, "").replace(/\.\./g, ".");
18757
+ }
18758
+ function getConnectionSelectorsFromAutoroutingPhaseProps(phaseProps) {
18759
+ return [
18760
+ ...phaseProps.connection ? [phaseProps.connection] : [],
18761
+ ...phaseProps.connections ?? []
18762
+ ];
18763
+ }
18764
+ function traceHasEndpointMatchingConnectionSelector(trace, connectionSelectorEndpointKey) {
18765
+ return trace.getTracePortPathSelectors().some(
18766
+ (selector) => convertPortSelectorToEndpointKey(selector) === connectionSelectorEndpointKey
18767
+ );
18768
+ }
18743
18769
  function getAutoroutersByPhaseIndex(group) {
18744
18770
  const autoroutingPhases = group.selectAll(
18745
18771
  "autoroutingphase"
@@ -18812,7 +18838,13 @@ function Group_getRoutingPhasePlans(group) {
18812
18838
  const hasReroutePhase = Array.from(phasePropsByPhaseIndex.values()).some(
18813
18839
  (phaseProps) => phaseProps.reroute
18814
18840
  );
18815
- if (!hasDirectRoutingTargets && !hasReroutePhase) return [];
18841
+ const hasConnectionTargetedPhase = Array.from(
18842
+ phasePropsByPhaseIndex.values()
18843
+ ).some(
18844
+ (phaseProps) => getConnectionSelectorsFromAutoroutingPhaseProps(phaseProps).length > 0
18845
+ );
18846
+ if (!hasDirectRoutingTargets && !hasReroutePhase && !hasConnectionTargetedPhase)
18847
+ return [];
18816
18848
  for (const net of nets) {
18817
18849
  const routingPhaseIndex = getNetRoutingPhaseIndex(net);
18818
18850
  getOrCreateRoutingPhasePlan(plansByPhaseIndex, routingPhaseIndex).nets.push(
@@ -18827,6 +18859,30 @@ function Group_getRoutingPhasePlans(group) {
18827
18859
  ).traces.push(trace);
18828
18860
  }
18829
18861
  for (const [phaseIndex, phaseProps] of phasePropsByPhaseIndex) {
18862
+ const connectionSelectors = getConnectionSelectorsFromAutoroutingPhaseProps(phaseProps);
18863
+ if (connectionSelectors.length > 0) {
18864
+ const plan = getOrCreateRoutingPhasePlan(plansByPhaseIndex, phaseIndex);
18865
+ const connectionSelectorEndpointKeys = connectionSelectors.map(
18866
+ convertPortSelectorToEndpointKey
18867
+ );
18868
+ plan.connectionSelectors = connectionSelectors;
18869
+ for (const trace of traces) {
18870
+ if (connectionSelectorEndpointKeys.some(
18871
+ (endpointKey) => traceHasEndpointMatchingConnectionSelector(trace, endpointKey)
18872
+ )) {
18873
+ if (!phaseProps.reroute) {
18874
+ for (const existingPlan of plansByPhaseIndex.values()) {
18875
+ if (existingPlan === plan) continue;
18876
+ existingPlan.traces = existingPlan.traces.filter(
18877
+ (existingTrace) => existingTrace !== trace
18878
+ );
18879
+ }
18880
+ }
18881
+ if (plan.traces.includes(trace)) continue;
18882
+ plan.traces.push(trace);
18883
+ }
18884
+ }
18885
+ }
18830
18886
  if (phaseProps.reroute) {
18831
18887
  getOrCreateRoutingPhasePlan(plansByPhaseIndex, phaseIndex);
18832
18888
  }
@@ -18839,6 +18895,7 @@ function Group_getRoutingPhasePlans(group) {
18839
18895
  const phaseProps = phasePropsByPhaseIndex.get(plan.routingPhaseIndex);
18840
18896
  plan.reroute = phaseProps?.reroute;
18841
18897
  plan.region = phaseProps?.region;
18898
+ plan.connectionSelectors = phaseProps ? getConnectionSelectorsFromAutoroutingPhaseProps(phaseProps) : void 0;
18842
18899
  plan.drcTolerances = phaseProps ? getDrcTolerancesFromAutoroutingPhaseProps(phaseProps) : void 0;
18843
18900
  }
18844
18901
  const defaultPhaseProps = phasePropsByPhaseIndex.get(null);
@@ -18969,6 +19026,10 @@ function connectionIsInRoutingPhase(connection, phasePlan) {
18969
19026
  if (!trace.source_trace_id) continue;
18970
19027
  if (connection.source_trace_id === trace.source_trace_id) return true;
18971
19028
  if (connection.name === trace.source_trace_id) return true;
19029
+ if (connection.rootConnectionName === trace.source_trace_id) return true;
19030
+ if (connection.mergedConnectionNames?.includes(trace.source_trace_id)) {
19031
+ return true;
19032
+ }
18972
19033
  }
18973
19034
  for (const net of phasePlan.nets) {
18974
19035
  if (!net.source_net_id) continue;
@@ -19997,20 +20058,41 @@ var Group5 = class extends NormalComponent3 {
19997
20058
  const outputTraces = [];
19998
20059
  const outputJumpers = [];
19999
20060
  const existingRerouteSeedTraces = getExistingSimplifiedPcbTracesForReroute(this);
20061
+ const traceMatchesRoutingPhase = (trace, routingPhasePlan) => {
20062
+ const connectionName = trace.connection_name ?? trace.pcb_trace_id;
20063
+ const sourceTraceIds = /* @__PURE__ */ new Set([
20064
+ connectionName,
20065
+ trace.pcb_trace_id,
20066
+ ...getSourceTraceIdsFromRerouteName(connectionName),
20067
+ ...getSourceTraceIdsFromRerouteName(trace.pcb_trace_id)
20068
+ ]);
20069
+ return baseSimpleRouteJson.connections.some((connection) => {
20070
+ if (!connectionIsInRoutingPhase(connection, routingPhasePlan)) {
20071
+ return false;
20072
+ }
20073
+ return sourceTraceIds.has(connection.name) || (connection.source_trace_id ? sourceTraceIds.has(connection.source_trace_id) : false) || (connection.rootConnectionName ? sourceTraceIds.has(connection.rootConnectionName) : false) || connection.mergedConnectionNames?.some(
20074
+ (name) => sourceTraceIds.has(name)
20075
+ );
20076
+ });
20077
+ };
20000
20078
  for (const routingPhasePlan of routingPhasePlans) {
20001
20079
  const phaseAutorouterConfig = routingPhasePlan.autorouter ? getPresetAutoroutingConfig(
20002
20080
  routingPhasePlan.autorouter,
20003
20081
  this.root?.platform
20004
20082
  ) : autorouterConfig;
20005
20083
  let simpleRouteJson = baseSimpleRouteJson;
20006
- const isReroutePhase = Boolean(
20084
+ const isRegionReroutePhase = Boolean(
20007
20085
  routingPhasePlan.reroute && routingPhasePlan.region
20008
20086
  );
20009
- const rerouteOriginalSrj = isReroutePhase ? {
20087
+ const isConnectionReroutePhase = Boolean(
20088
+ routingPhasePlan.reroute && !routingPhasePlan.region && routingPhasePlan.traces.length > 0
20089
+ );
20090
+ const isReroutePhase = isRegionReroutePhase || isConnectionReroutePhase;
20091
+ const rerouteOriginalSrj = isRegionReroutePhase ? {
20010
20092
  ...baseSimpleRouteJson,
20011
20093
  traces: [...existingRerouteSeedTraces, ...outputTraces]
20012
20094
  } : null;
20013
- if (isReroutePhase && rerouteOriginalSrj) {
20095
+ if (isRegionReroutePhase && rerouteOriginalSrj) {
20014
20096
  simpleRouteJson = getRerouteSimpleRouteJson(
20015
20097
  rerouteOriginalSrj,
20016
20098
  {
@@ -20018,6 +20100,19 @@ var Group5 = class extends NormalComponent3 {
20018
20100
  ...routingPhasePlan.region
20019
20101
  }
20020
20102
  );
20103
+ } else if (isConnectionReroutePhase) {
20104
+ simpleRouteJson = Group_filterSimpleRouteJsonForPhase(
20105
+ baseSimpleRouteJson,
20106
+ routingPhasePlan
20107
+ );
20108
+ simpleRouteJson.obstacles = [
20109
+ ...simpleRouteJson.obstacles,
20110
+ ...Group_getObstaclesFromRoutedTraces(
20111
+ outputTraces.filter(
20112
+ (trace) => !traceMatchesRoutingPhase(trace, routingPhasePlan)
20113
+ )
20114
+ )
20115
+ ];
20021
20116
  } else if (hasPhasedAutorouting) {
20022
20117
  simpleRouteJson = Group_filterSimpleRouteJsonForPhase(
20023
20118
  baseSimpleRouteJson,
@@ -20109,6 +20204,16 @@ var Group5 = class extends NormalComponent3 {
20109
20204
  autorouter.start();
20110
20205
  try {
20111
20206
  const traces = await routingPromise;
20207
+ const outputSimpleRouteJson = {
20208
+ ...simpleRouteJson,
20209
+ traces
20210
+ };
20211
+ this.root?.emit("autorouting:end", {
20212
+ type: "autorouting:end",
20213
+ subcircuit_id: this.subcircuit_id,
20214
+ componentDisplayName: this.getString(),
20215
+ simpleRouteJson: outputSimpleRouteJson
20216
+ });
20112
20217
  if (autorouter.getConnectedOffboardObstacles) {
20113
20218
  const connectedOffboardObstacles = autorouter.getConnectedOffboardObstacles();
20114
20219
  createSourceTracesFromOffboardConnections({
@@ -20122,7 +20227,7 @@ var Group5 = class extends NormalComponent3 {
20122
20227
  if (solver?.getOutputJumpers) {
20123
20228
  outputJumpers.push(...solver.getOutputJumpers() || []);
20124
20229
  }
20125
- if (isReroutePhase && rerouteOriginalSrj) {
20230
+ if (isRegionReroutePhase && rerouteOriginalSrj) {
20126
20231
  const reconnectedSrj = reconnectReroutedSimpleRouteJsonRegion(
20127
20232
  rerouteOriginalSrj,
20128
20233
  {
@@ -20135,6 +20240,15 @@ var Group5 = class extends NormalComponent3 {
20135
20240
  outputTraces.length,
20136
20241
  ...reconnectedSrj.traces ?? []
20137
20242
  );
20243
+ } else if (isConnectionReroutePhase) {
20244
+ outputTraces.splice(
20245
+ 0,
20246
+ outputTraces.length,
20247
+ ...outputTraces.filter(
20248
+ (trace) => !traceMatchesRoutingPhase(trace, routingPhasePlan)
20249
+ ),
20250
+ ...traces
20251
+ );
20138
20252
  } else {
20139
20253
  outputTraces.push(...traces);
20140
20254
  }
@@ -21388,7 +21502,7 @@ import { identity as identity5 } from "transformation-matrix";
21388
21502
  var package_default = {
21389
21503
  name: "@tscircuit/core",
21390
21504
  type: "module",
21391
- version: "0.0.1256",
21505
+ version: "0.0.1258",
21392
21506
  types: "dist/index.d.ts",
21393
21507
  main: "dist/index.js",
21394
21508
  module: "dist/index.js",
@@ -21420,7 +21534,7 @@ var package_default = {
21420
21534
  "@biomejs/biome": "^1.8.3",
21421
21535
  "@resvg/resvg-js": "^2.6.2",
21422
21536
  "@tscircuit/alphabet": "0.0.25",
21423
- "@tscircuit/capacity-autorouter": "^0.0.505",
21537
+ "@tscircuit/capacity-autorouter": "^0.0.523",
21424
21538
  "@tscircuit/checks": "0.0.130",
21425
21539
  "@tscircuit/circuit-json-util": "^0.0.94",
21426
21540
  "@tscircuit/common": "^0.0.20",
@@ -21435,7 +21549,7 @@ var package_default = {
21435
21549
  "@tscircuit/math-utils": "^0.0.36",
21436
21550
  "@tscircuit/miniflex": "^0.0.4",
21437
21551
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
21438
- "@tscircuit/props": "^0.0.531",
21552
+ "@tscircuit/props": "^0.0.536",
21439
21553
  "@tscircuit/schematic-match-adapt": "^0.0.16",
21440
21554
  "@tscircuit/schematic-trace-solver": "^0.0.57",
21441
21555
  "@tscircuit/solver-utils": "^0.0.3",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1257",
4
+ "version": "0.0.1261",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "@biomejs/biome": "^1.8.3",
34
34
  "@resvg/resvg-js": "^2.6.2",
35
35
  "@tscircuit/alphabet": "0.0.25",
36
- "@tscircuit/capacity-autorouter": "^0.0.505",
36
+ "@tscircuit/capacity-autorouter": "^0.0.523",
37
37
  "@tscircuit/checks": "0.0.130",
38
38
  "@tscircuit/circuit-json-util": "^0.0.94",
39
39
  "@tscircuit/common": "^0.0.20",
@@ -48,7 +48,7 @@
48
48
  "@tscircuit/math-utils": "^0.0.36",
49
49
  "@tscircuit/miniflex": "^0.0.4",
50
50
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
51
- "@tscircuit/props": "^0.0.531",
51
+ "@tscircuit/props": "^0.0.536",
52
52
  "@tscircuit/schematic-match-adapt": "^0.0.16",
53
53
  "@tscircuit/schematic-trace-solver": "^0.0.57",
54
54
  "@tscircuit/solver-utils": "^0.0.3",