@tscircuit/core 0.0.979 → 0.0.981

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +58 -37
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -16551,41 +16551,44 @@ var Board = class extends Group6 {
16551
16551
  const { db } = this.root;
16552
16552
  if (!this._areChildSubcircuitsRouted()) return;
16553
16553
  if (this._drcChecksComplete) return;
16554
+ const runDrcChecks = (circuitJson) => {
16555
+ const pcbTraceOverlappingErrors = checkEachPcbTraceNonOverlapping(circuitJson);
16556
+ for (const error of pcbTraceOverlappingErrors) {
16557
+ db.pcb_trace_error.insert(error);
16558
+ }
16559
+ const pcbPortNotConnectedErrors = checkEachPcbPortConnectedToPcbTraces(circuitJson);
16560
+ for (const error of pcbPortNotConnectedErrors) {
16561
+ db.pcb_port_not_connected_error.insert(error);
16562
+ }
16563
+ const pcbComponentOutsideErrors = checkPcbComponentsOutOfBoard(circuitJson);
16564
+ for (const error of pcbComponentOutsideErrors) {
16565
+ db.pcb_component_outside_board_error.insert(error);
16566
+ }
16567
+ const pcbTracesOutOfBoardErrors = checkPcbTracesOutOfBoard(circuitJson);
16568
+ for (const error of pcbTracesOutOfBoardErrors) {
16569
+ db.pcb_trace_error.insert(error);
16570
+ }
16571
+ const differentNetViaErrors = checkDifferentNetViaSpacing(circuitJson);
16572
+ for (const error of differentNetViaErrors) {
16573
+ db.pcb_via_clearance_error.insert(error);
16574
+ }
16575
+ const sameNetViaErrors = checkSameNetViaSpacing(circuitJson);
16576
+ for (const error of sameNetViaErrors) {
16577
+ db.pcb_via_clearance_error.insert(error);
16578
+ }
16579
+ const pcbComponentOverlapErrors = checkPcbComponentOverlap(circuitJson);
16580
+ for (const error of pcbComponentOverlapErrors) {
16581
+ db.pcb_footprint_overlap_error.insert(error);
16582
+ }
16583
+ const sourcePinMustBeConnectedErrors = checkPinMustBeConnected(circuitJson);
16584
+ for (const error of sourcePinMustBeConnectedErrors) {
16585
+ db.source_pin_must_be_connected_error.insert(error);
16586
+ }
16587
+ };
16588
+ const subcircuit = db.subtree({ subcircuit_id: this.subcircuit_id });
16589
+ const subcircuitCircuitJson = subcircuit.toArray();
16590
+ runDrcChecks(subcircuitCircuitJson);
16554
16591
  this._drcChecksComplete = true;
16555
- const errors = checkEachPcbTraceNonOverlapping(db.toArray());
16556
- for (const error of errors) {
16557
- db.pcb_trace_error.insert(error);
16558
- }
16559
- const pcbPortNotConnectedErrors = checkEachPcbPortConnectedToPcbTraces(
16560
- db.toArray()
16561
- );
16562
- for (const error of pcbPortNotConnectedErrors) {
16563
- db.pcb_port_not_connected_error.insert(error);
16564
- }
16565
- const pcbComponentOutsideErrors = checkPcbComponentsOutOfBoard(db.toArray());
16566
- for (const error of pcbComponentOutsideErrors) {
16567
- db.pcb_component_outside_board_error.insert(error);
16568
- }
16569
- const pcbTracesOutOfBoardErrors = checkPcbTracesOutOfBoard(db.toArray());
16570
- for (const error of pcbTracesOutOfBoardErrors) {
16571
- db.pcb_trace_error.insert(error);
16572
- }
16573
- const differentNetViaErrors = checkDifferentNetViaSpacing(db.toArray());
16574
- for (const error of differentNetViaErrors) {
16575
- db.pcb_via_clearance_error.insert(error);
16576
- }
16577
- const sameNetViaErrors = checkSameNetViaSpacing(db.toArray());
16578
- for (const error of sameNetViaErrors) {
16579
- db.pcb_via_clearance_error.insert(error);
16580
- }
16581
- const pcbComponentOverlapErrors = checkPcbComponentOverlap(db.toArray());
16582
- for (const error of pcbComponentOverlapErrors) {
16583
- db.pcb_footprint_overlap_error.insert(error);
16584
- }
16585
- const sourcePinMustBeConnectedErrors = checkPinMustBeConnected(db.toArray());
16586
- for (const error of sourcePinMustBeConnectedErrors) {
16587
- db.source_pin_must_be_connected_error.insert(error);
16588
- }
16589
16592
  }
16590
16593
  _emitRenderLifecycleEvent(phase, startOrEnd) {
16591
16594
  super._emitRenderLifecycleEvent(phase, startOrEnd);
@@ -16999,10 +17002,28 @@ var Panel = class extends Group6 {
16999
17002
  doInitialPanelBoardLayout() {
17000
17003
  if (this.root?.pcbDisabled) return;
17001
17004
  const layoutMode = this._parsedProps.layoutMode ?? "none";
17002
- if (layoutMode !== "grid") return;
17003
17005
  const childBoardInstances = this.children.filter(
17004
17006
  (c) => c instanceof Board
17005
17007
  );
17008
+ if (layoutMode !== "none") {
17009
+ for (const board of childBoardInstances) {
17010
+ const hasPcbX = board._parsedProps.pcbX !== void 0;
17011
+ const hasPcbY = board._parsedProps.pcbY !== void 0;
17012
+ if (hasPcbX || hasPcbY) {
17013
+ const properties = [];
17014
+ if (hasPcbX) properties.push("pcbX");
17015
+ if (hasPcbY) properties.push("pcbY");
17016
+ const propertyNames = properties.join(" and ");
17017
+ this.root.db.source_property_ignored_warning.insert({
17018
+ source_component_id: board.source_component_id,
17019
+ property_name: propertyNames,
17020
+ message: `Board has manual positioning (${propertyNames}) but panel layout mode is "${layoutMode}". Manual positioning will be ignored.`,
17021
+ error_type: "source_property_ignored_warning"
17022
+ });
17023
+ }
17024
+ }
17025
+ }
17026
+ if (layoutMode !== "grid") return;
17006
17027
  const tabWidth = this._parsedProps.tabWidth ?? DEFAULT_TAB_WIDTH;
17007
17028
  const boardGap = this._parsedProps.boardGap ?? tabWidth;
17008
17029
  const { positions, gridWidth, gridHeight } = packBoardsIntoGrid({
@@ -20953,7 +20974,7 @@ import { identity as identity5 } from "transformation-matrix";
20953
20974
  var package_default = {
20954
20975
  name: "@tscircuit/core",
20955
20976
  type: "module",
20956
- version: "0.0.978",
20977
+ version: "0.0.980",
20957
20978
  types: "dist/index.d.ts",
20958
20979
  main: "dist/index.js",
20959
20980
  module: "dist/index.js",
@@ -20986,7 +21007,7 @@ var package_default = {
20986
21007
  "@resvg/resvg-js": "^2.6.2",
20987
21008
  "@tscircuit/capacity-autorouter": "^0.0.264",
20988
21009
  "@tscircuit/checks": "^0.0.87",
20989
- "@tscircuit/circuit-json-util": "^0.0.75",
21010
+ "@tscircuit/circuit-json-util": "^0.0.77",
20990
21011
  "@tscircuit/common": "^0.0.20",
20991
21012
  "@tscircuit/copper-pour-solver": "^0.0.14",
20992
21013
  "@tscircuit/footprinter": "^0.0.288",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.979",
4
+ "version": "0.0.981",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -34,7 +34,7 @@
34
34
  "@resvg/resvg-js": "^2.6.2",
35
35
  "@tscircuit/capacity-autorouter": "^0.0.264",
36
36
  "@tscircuit/checks": "^0.0.87",
37
- "@tscircuit/circuit-json-util": "^0.0.75",
37
+ "@tscircuit/circuit-json-util": "^0.0.77",
38
38
  "@tscircuit/common": "^0.0.20",
39
39
  "@tscircuit/copper-pour-solver": "^0.0.14",
40
40
  "@tscircuit/footprinter": "^0.0.288",