@tscircuit/core 0.0.226 → 0.0.227

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
@@ -89,6 +89,7 @@ declare class Circuit {
89
89
  root: Circuit | null;
90
90
  isRoot: boolean;
91
91
  schematicDisabled: boolean;
92
+ pcbDisabled: boolean;
92
93
  _hasRenderedAtleastOnce: boolean;
93
94
  constructor();
94
95
  add(componentOrElm: PrimitiveComponent | ReactElement): void;
package/dist/index.js CHANGED
@@ -1117,6 +1117,7 @@ var Net = class extends PrimitiveComponent {
1117
1117
  * routing phase for autorouters that don't care about connecting nets.
1118
1118
  */
1119
1119
  doInitialPcbRouteNetIslands() {
1120
+ if (this.root?.pcbDisabled) return;
1120
1121
  const { db } = this.root;
1121
1122
  const { _parsedProps: props } = this;
1122
1123
  const traces = this._getAllDirectlyConnectedTraces().filter(
@@ -1263,6 +1264,7 @@ var SmtPad = class extends PrimitiveComponent {
1263
1264
  }
1264
1265
  }
1265
1266
  doInitialPcbPrimitiveRender() {
1267
+ if (this.root?.pcbDisabled) return;
1266
1268
  const { db } = this.root;
1267
1269
  const { _parsedProps: props } = this;
1268
1270
  if (!props.portHints) return;
@@ -1342,6 +1344,7 @@ var SmtPad = class extends PrimitiveComponent {
1342
1344
  }
1343
1345
  }
1344
1346
  doInitialPcbPortAttachment() {
1347
+ if (this.root?.pcbDisabled) return;
1345
1348
  const { db } = this.root;
1346
1349
  db.pcb_smtpad.update(this.pcb_smtpad_id, {
1347
1350
  pcb_port_id: this.matchedPort?.pcb_port_id
@@ -1427,6 +1430,7 @@ var SilkscreenPath = class extends PrimitiveComponent {
1427
1430
  };
1428
1431
  }
1429
1432
  doInitialPcbPrimitiveRender() {
1433
+ if (this.root?.pcbDisabled) return;
1430
1434
  const { db } = this.root;
1431
1435
  const { _parsedProps: props } = this;
1432
1436
  const layer = props.layer ?? "top";
@@ -1523,6 +1527,7 @@ var PlatedHole = class extends PrimitiveComponent {
1523
1527
  }
1524
1528
  }
1525
1529
  doInitialPcbPrimitiveRender() {
1530
+ if (this.root?.pcbDisabled) return;
1526
1531
  const { db } = this.root;
1527
1532
  const { _parsedProps: props } = this;
1528
1533
  const position = this._getGlobalPcbPositionBeforeLayout();
@@ -1560,6 +1565,7 @@ var PlatedHole = class extends PrimitiveComponent {
1560
1565
  }
1561
1566
  }
1562
1567
  doInitialPcbPortAttachment() {
1568
+ if (this.root?.pcbDisabled) return;
1563
1569
  const { db } = this.root;
1564
1570
  db.pcb_plated_hole.update(this.pcb_plated_hole_id, {
1565
1571
  pcb_port_id: this.matchedPort?.pcb_port_id
@@ -1580,6 +1586,7 @@ var Keepout = class extends PrimitiveComponent {
1580
1586
  };
1581
1587
  }
1582
1588
  doInitialPcbPrimitiveRender() {
1589
+ if (this.root?.pcbDisabled) return;
1583
1590
  const { db } = this.root;
1584
1591
  const { _parsedProps: props } = this;
1585
1592
  const position = this._getGlobalPcbPositionBeforeLayout();
@@ -1633,6 +1640,7 @@ var Hole = class extends PrimitiveComponent {
1633
1640
  return { width: props.diameter, height: props.diameter };
1634
1641
  }
1635
1642
  doInitialPcbPrimitiveRender() {
1643
+ if (this.root?.pcbDisabled) return;
1636
1644
  const { db } = this.root;
1637
1645
  const { _parsedProps: props } = this;
1638
1646
  const position = this._getGlobalPcbPositionBeforeLayout();
@@ -1961,6 +1969,7 @@ var Port = class extends PrimitiveComponent {
1961
1969
  this.source_component_id = this.parent?.source_component_id;
1962
1970
  }
1963
1971
  doInitialPcbPortRender() {
1972
+ if (this.root?.pcbDisabled) return;
1964
1973
  const { db } = this.root;
1965
1974
  const { matchedComponents } = this;
1966
1975
  if (!this.parent?.pcb_component_id) {
@@ -2405,6 +2414,7 @@ var Footprint = class extends PrimitiveComponent {
2405
2414
  * to any constraints that are defined.
2406
2415
  */
2407
2416
  doInitialPcbFootprintLayout() {
2417
+ if (this.root?.pcbDisabled) return;
2408
2418
  const constraints = this.children.filter(
2409
2419
  (child) => child.componentName === "Constraint"
2410
2420
  );
@@ -2926,6 +2936,7 @@ var NormalComponent = class extends PrimitiveComponent {
2926
2936
  this.schematic_component_id = schematic_component2.schematic_component_id;
2927
2937
  }
2928
2938
  doInitialPcbComponentRender() {
2939
+ if (this.root?.pcbDisabled) return;
2929
2940
  const { db } = this.root;
2930
2941
  const { _parsedProps: props } = this;
2931
2942
  const pcb_component = db.pcb_component.insert({
@@ -2952,6 +2963,7 @@ var NormalComponent = class extends PrimitiveComponent {
2952
2963
  * the width/height of the component
2953
2964
  */
2954
2965
  doInitialPcbComponentSizeCalculation() {
2966
+ if (this.root?.pcbDisabled) return;
2955
2967
  if (!this.pcb_component_id) return;
2956
2968
  const { db } = this.root;
2957
2969
  const { _parsedProps: props } = this;
@@ -3331,6 +3343,7 @@ var TraceHint = class extends PrimitiveComponent {
3331
3343
  );
3332
3344
  }
3333
3345
  doInitialPcbTraceHintRender() {
3346
+ if (this.root?.pcbDisabled) return;
3334
3347
  const { db } = this.root;
3335
3348
  const { _parsedProps: props } = this;
3336
3349
  db.pcb_trace_hint.insert({
@@ -3464,6 +3477,7 @@ var Group = class extends NormalComponent {
3464
3477
  }
3465
3478
  }
3466
3479
  doInitialPcbTraceRender() {
3480
+ if (this.root?.pcbDisabled) return;
3467
3481
  if (this._shouldUseTraceByTraceRouting()) return;
3468
3482
  const serverUrl = this.props.autorouter?.serverUrl ?? "https://registry-api.tscircuit.com";
3469
3483
  const serverMode = this.props.autorouter?.serverMode ?? "job";
@@ -3651,6 +3665,7 @@ var Board = class extends Group {
3651
3665
  return ["top", "bottom", "inner1", "inner2"];
3652
3666
  }
3653
3667
  doInitialPcbComponentRender() {
3668
+ if (this.root?.pcbDisabled) return;
3654
3669
  const { db } = this.root;
3655
3670
  const { _parsedProps: props } = this;
3656
3671
  if (!props.width || !props.height) {
@@ -4317,6 +4332,7 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
4317
4332
  this.source_trace_id = trace.source_trace_id;
4318
4333
  }
4319
4334
  doInitialPcbTraceRender() {
4335
+ if (this.root?.pcbDisabled) return;
4320
4336
  const { db } = this.root;
4321
4337
  const { _parsedProps: props, parent } = this;
4322
4338
  const subcircuit = this.getSubcircuit();
@@ -4900,6 +4916,7 @@ var Chip = class extends NormalComponent {
4900
4916
  this.source_component_id = source_component.source_component_id;
4901
4917
  }
4902
4918
  doInitialPcbComponentRender() {
4919
+ if (this.root?.pcbDisabled) return;
4903
4920
  const { db } = this.root;
4904
4921
  const { _parsedProps: props } = this;
4905
4922
  const pcb_component = db.pcb_component.insert({
@@ -4966,6 +4983,7 @@ var Jumper = class extends NormalComponent {
4966
4983
  this.source_component_id = source_component.source_component_id;
4967
4984
  }
4968
4985
  doInitialPcbComponentRender() {
4986
+ if (this.root?.pcbDisabled) return;
4969
4987
  const { db } = this.root;
4970
4988
  const { _parsedProps: props } = this;
4971
4989
  const pcb_component = db.pcb_component.insert({
@@ -5167,6 +5185,7 @@ var FabricationNotePath = class extends PrimitiveComponent {
5167
5185
  };
5168
5186
  }
5169
5187
  doInitialPcbPrimitiveRender() {
5188
+ if (this.root?.pcbDisabled) return;
5170
5189
  const { db } = this.root;
5171
5190
  const { _parsedProps: props } = this;
5172
5191
  const layer = props.layer ?? "top";
@@ -5207,6 +5226,7 @@ var FabricationNoteText = class extends PrimitiveComponent {
5207
5226
  };
5208
5227
  }
5209
5228
  doInitialPcbPrimitiveRender() {
5229
+ if (this.root?.pcbDisabled) return;
5210
5230
  const { db } = this.root;
5211
5231
  const { _parsedProps: props } = this;
5212
5232
  const container = this.getPrimitiveContainer();
@@ -5275,6 +5295,7 @@ var SilkscreenCircle = class extends PrimitiveComponent {
5275
5295
  };
5276
5296
  }
5277
5297
  doInitialPcbPrimitiveRender() {
5298
+ if (this.root?.pcbDisabled) return;
5278
5299
  const { db } = this.root;
5279
5300
  const { _parsedProps: props } = this;
5280
5301
  const layer = props.layer ?? "top";
@@ -5308,6 +5329,7 @@ var SilkscreenRect = class extends PrimitiveComponent {
5308
5329
  };
5309
5330
  }
5310
5331
  doInitialPcbPrimitiveRender() {
5332
+ if (this.root?.pcbDisabled) return;
5311
5333
  const { db } = this.root;
5312
5334
  const { _parsedProps: props } = this;
5313
5335
  const layer = props.layer ?? "top";
@@ -5341,6 +5363,7 @@ var SilkscreenText = class extends PrimitiveComponent {
5341
5363
  };
5342
5364
  }
5343
5365
  doInitialPcbPrimitiveRender() {
5366
+ if (this.root?.pcbDisabled) return;
5344
5367
  const { db } = this.root;
5345
5368
  const { _parsedProps: props } = this;
5346
5369
  const container = this.getPrimitiveContainer();
@@ -5412,6 +5435,7 @@ var Via = class extends PrimitiveComponent {
5412
5435
  });
5413
5436
  }
5414
5437
  doInitialPcbPrimitiveRender() {
5438
+ if (this.root?.pcbDisabled) return;
5415
5439
  const { db } = this.root;
5416
5440
  const { _parsedProps: props } = this;
5417
5441
  const position = this._getGlobalPcbPositionBeforeLayout();
@@ -5664,6 +5688,7 @@ var Circuit = class {
5664
5688
  root = null;
5665
5689
  isRoot = true;
5666
5690
  schematicDisabled = false;
5691
+ pcbDisabled = false;
5667
5692
  _hasRenderedAtleastOnce = false;
5668
5693
  constructor() {
5669
5694
  this.children = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.226",
4
+ "version": "0.0.227",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",