@tscircuit/core 0.0.896 → 0.0.898

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 +46 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -274,7 +274,10 @@ ${error.stack}`
274
274
  return this.constructor.name;
275
275
  }
276
276
  _hasIncompleteAsyncEffects() {
277
- return this._asyncEffects.some((effect) => !effect.complete);
277
+ if (this._asyncEffects.some((effect) => !effect.complete)) return true;
278
+ return this.children.some(
279
+ (child) => typeof child._hasIncompleteAsyncEffects === "function" ? child._hasIncompleteAsyncEffects() : false
280
+ );
278
281
  }
279
282
  _hasIncompleteAsyncEffectsInSubtreeForPhase(phase) {
280
283
  for (const e of this._asyncEffects) {
@@ -14498,6 +14501,42 @@ var Group6 = class extends NormalComponent3 {
14498
14501
  // lib/utils/circuit-json/inflate-circuit-json.ts
14499
14502
  import { cju } from "@tscircuit/circuit-json-util";
14500
14503
 
14504
+ // lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceBoard.ts
14505
+ function inflateSourceBoard(sourceBoard, inflatorContext) {
14506
+ const { injectionDb, subcircuit, groupsMap } = inflatorContext;
14507
+ if (subcircuit.lowercaseComponentName === "board") {
14508
+ return;
14509
+ }
14510
+ if (subcircuit.parent?.lowercaseComponentName === "board") {
14511
+ return;
14512
+ }
14513
+ const pcbBoards = injectionDb.pcb_board.list();
14514
+ const pcbBoard = pcbBoards.length > 0 ? pcbBoards[0] : null;
14515
+ const boardProps2 = {
14516
+ name: sourceBoard.title || "inflated_board"
14517
+ };
14518
+ if (pcbBoard) {
14519
+ if (pcbBoard.width) boardProps2.width = pcbBoard.width;
14520
+ if (pcbBoard.height) boardProps2.height = pcbBoard.height;
14521
+ if (pcbBoard.center) {
14522
+ boardProps2.pcbX = pcbBoard.center.x;
14523
+ boardProps2.pcbY = pcbBoard.center.y;
14524
+ }
14525
+ if (pcbBoard.outline) boardProps2.outline = pcbBoard.outline;
14526
+ if (pcbBoard.thickness) boardProps2.thickness = pcbBoard.thickness;
14527
+ if (pcbBoard.material) boardProps2.material = pcbBoard.material;
14528
+ }
14529
+ const board = new Board(boardProps2);
14530
+ board.source_board_id = sourceBoard.source_board_id;
14531
+ if (sourceBoard.source_group_id && groupsMap?.has(sourceBoard.source_group_id)) {
14532
+ const parentGroup = groupsMap.get(sourceBoard.source_group_id);
14533
+ parentGroup.add(board);
14534
+ } else {
14535
+ subcircuit.add(board);
14536
+ }
14537
+ return board;
14538
+ }
14539
+
14501
14540
  // lib/components/normal-components/Capacitor.ts
14502
14541
  import { capacitorProps } from "@tscircuit/props";
14503
14542
 
@@ -15362,6 +15401,10 @@ var inflateCircuitJson = (target, circuitJson, children) => {
15362
15401
  for (const sourceGroup of sourceGroups) {
15363
15402
  inflateSourceGroup(sourceGroup, inflationCtx);
15364
15403
  }
15404
+ const sourceBoards = injectionDb.source_board.list();
15405
+ for (const sourceBoard of sourceBoards) {
15406
+ inflateSourceBoard(sourceBoard, inflationCtx);
15407
+ }
15365
15408
  const sourceComponents = injectionDb.source_component.list();
15366
15409
  for (const sourceComponent of sourceComponents) {
15367
15410
  switch (sourceComponent.ftype) {
@@ -19231,7 +19274,7 @@ import { identity as identity6 } from "transformation-matrix";
19231
19274
  var package_default = {
19232
19275
  name: "@tscircuit/core",
19233
19276
  type: "module",
19234
- version: "0.0.895",
19277
+ version: "0.0.897",
19235
19278
  types: "dist/index.d.ts",
19236
19279
  main: "dist/index.js",
19237
19280
  module: "dist/index.js",
@@ -19475,12 +19518,7 @@ var RootCircuit = class {
19475
19518
  this.emit("renderComplete");
19476
19519
  }
19477
19520
  _hasIncompleteAsyncEffects() {
19478
- return this.children.some((child) => {
19479
- if (child._hasIncompleteAsyncEffects()) return true;
19480
- return child.children.some(
19481
- (grandchild) => grandchild._hasIncompleteAsyncEffects()
19482
- );
19483
- });
19521
+ return this.children.some((child) => child._hasIncompleteAsyncEffects());
19484
19522
  }
19485
19523
  getCircuitJson() {
19486
19524
  if (!this._hasRenderedAtleastOnce) this.render();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.896",
4
+ "version": "0.0.898",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",