@tscircuit/core 0.0.703 → 0.0.705

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
@@ -165,7 +165,7 @@ interface SimpleRouteJson {
165
165
  traces?: SimplifiedPcbTrace[];
166
166
  }
167
167
 
168
- type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | `board:renderPhaseStarted` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:error" | "autorouting:progress" | "renderComplete";
168
+ type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | `board:renderPhaseStarted` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:error" | "autorouting:progress" | "renderComplete" | "debug:logOutput";
169
169
  interface AutoroutingStartEvent {
170
170
  type: "autorouting:start";
171
171
  subcircuit_id: string;
@@ -194,6 +194,11 @@ interface AutoroutingProgressEvent {
194
194
  interface AutoroutingEndEvent {
195
195
  type: "autorouting:end";
196
196
  }
197
+ interface DebugLogOutputEvent {
198
+ type: "debug:logOutput";
199
+ name: string;
200
+ content: any;
201
+ }
197
202
 
198
203
  declare class RootCircuit {
199
204
  firstChild: PrimitiveComponent | null;
@@ -1084,6 +1089,7 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
1084
1089
  * the width/height of the component
1085
1090
  */
1086
1091
  doInitialPcbComponentSizeCalculation(): void;
1092
+ updatePcbComponentSizeCalculation(): void;
1087
1093
  _renderReactSubtree(element: ReactElement): ReactSubtree;
1088
1094
  doInitialInitializePortsFromChildren(): void;
1089
1095
  doInitialReactSubtreesRender(): void;
@@ -2290,6 +2296,7 @@ declare class Board extends Group<typeof boardProps> {
2290
2296
  get allLayers(): readonly ["top", "bottom", "inner1", "inner2"] | readonly ["top", "bottom"];
2291
2297
  _getSubcircuitLayerCount(): number;
2292
2298
  doInitialPcbBoardAutoSize(): void;
2299
+ updatePcbBoardAutoSize(): void;
2293
2300
  /**
2294
2301
  * Update the board information silkscreen text if platform config is set and
2295
2302
  * the project name, version, or url is set.
@@ -21688,4 +21695,4 @@ declare module "react/jsx-runtime" {
21688
21695
  }
21689
21696
  }
21690
21697
 
21691
- export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Cutout, Diode, FabricationNotePath, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicBox, SchematicCell, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, TestPoint, Trace, TraceHint, Transistor, Via, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
21698
+ export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNotePath, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicBox, SchematicCell, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, TestPoint, Trace, TraceHint, Transistor, Via, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -7188,6 +7188,9 @@ var NormalComponent2 = class extends PrimitiveComponent2 {
7188
7188
  height: bounds.height
7189
7189
  });
7190
7190
  }
7191
+ updatePcbComponentSizeCalculation() {
7192
+ this.doInitialPcbComponentSizeCalculation();
7193
+ }
7191
7194
  _renderReactSubtree(element) {
7192
7195
  return {
7193
7196
  element,
@@ -8859,10 +8862,11 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
8859
8862
  debug5("Converting circuit tree to InputProblem...");
8860
8863
  const inputProblem = convertTreeToInputProblem(tree, db, group);
8861
8864
  if (debug5.enabled) {
8862
- global.debugOutputs?.add(
8863
- `matchpack-input-problem-${group.name}`,
8864
- JSON.stringify(inputProblem, null, 2)
8865
- );
8865
+ group.root?.emit("debug:logOutput", {
8866
+ type: "debug:logOutput",
8867
+ name: `matchpack-input-problem-${group.name}`,
8868
+ content: JSON.stringify(inputProblem, null, 2)
8869
+ });
8866
8870
  }
8867
8871
  const solver = new LayoutPipelineSolver(inputProblem);
8868
8872
  debug5("Starting LayoutPipelineSolver...");
@@ -9782,11 +9786,16 @@ var Group_doInitialPcbLayoutPack = (group) => {
9782
9786
  minGap: gapMm
9783
9787
  };
9784
9788
  if (debug6.enabled) {
9785
- global.debugOutputs?.add(
9786
- `packInput-circuitjson-${group.name}`,
9787
- JSON.stringify(db.toArray())
9788
- );
9789
- global.debugOutputs?.add(`packInput-${group.name}`, packInput);
9789
+ group.root?.emit("debug:logOutput", {
9790
+ type: "debug:logOutput",
9791
+ name: `packInput-circuitjson-${group.name}`,
9792
+ content: JSON.stringify(db.toArray())
9793
+ });
9794
+ group.root?.emit("debug:logOutput", {
9795
+ type: "debug:logOutput",
9796
+ name: `packInput-${group.name}`,
9797
+ content: packInput
9798
+ });
9790
9799
  }
9791
9800
  const packOutput = pack(packInput);
9792
9801
  if (debug6.enabled) {
@@ -10825,10 +10834,11 @@ var Group_doInitialSchematicTraceRender = (group) => {
10825
10834
  } = createSchematicTraceSolverInputProblem(group);
10826
10835
  const schematicPortIdsWithPreExistingNetLabels = getSchematicPortIdsWithAssignedNetLabels(group);
10827
10836
  if (debug9.enabled) {
10828
- globalThis.debugOutputs?.add(
10829
- "group-trace-render-input-problem",
10830
- JSON.stringify(inputProblem, null, 2)
10831
- );
10837
+ group.root?.emit("debug:logOutput", {
10838
+ type: "debug:logOutput",
10839
+ name: "group-trace-render-input-problem",
10840
+ content: JSON.stringify(inputProblem, null, 2)
10841
+ });
10832
10842
  }
10833
10843
  const solver = new SchematicTracePipelineSolver4(inputProblem);
10834
10844
  solver.solve();
@@ -11711,6 +11721,10 @@ var Board = class extends Group6 {
11711
11721
  center
11712
11722
  });
11713
11723
  }
11724
+ // Recompute autosize after child components update (e.g., async footprints)
11725
+ updatePcbBoardAutoSize() {
11726
+ this.doInitialPcbBoardAutoSize();
11727
+ }
11714
11728
  /**
11715
11729
  * Update the board information silkscreen text if platform config is set and
11716
11730
  * the project name, version, or url is set.
@@ -14358,7 +14372,7 @@ import { identity as identity6 } from "transformation-matrix";
14358
14372
  var package_default = {
14359
14373
  name: "@tscircuit/core",
14360
14374
  type: "module",
14361
- version: "0.0.702",
14375
+ version: "0.0.704",
14362
14376
  types: "dist/index.d.ts",
14363
14377
  main: "dist/index.js",
14364
14378
  module: "dist/index.js",
@@ -14397,7 +14411,7 @@ var package_default = {
14397
14411
  "@tscircuit/matchpack": "^0.0.16",
14398
14412
  "@tscircuit/math-utils": "^0.0.21",
14399
14413
  "@tscircuit/miniflex": "^0.0.4",
14400
- "@tscircuit/props": "0.0.298",
14414
+ "@tscircuit/props": "0.0.300",
14401
14415
  "@tscircuit/schematic-autolayout": "^0.0.6",
14402
14416
  "@tscircuit/schematic-match-adapt": "^0.0.16",
14403
14417
  "@tscircuit/schematic-trace-solver": "^0.0.35",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.703",
4
+ "version": "0.0.705",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "@tscircuit/matchpack": "^0.0.16",
41
41
  "@tscircuit/math-utils": "^0.0.21",
42
42
  "@tscircuit/miniflex": "^0.0.4",
43
- "@tscircuit/props": "0.0.298",
43
+ "@tscircuit/props": "0.0.300",
44
44
  "@tscircuit/schematic-autolayout": "^0.0.6",
45
45
  "@tscircuit/schematic-match-adapt": "^0.0.16",
46
46
  "@tscircuit/schematic-trace-solver": "^0.0.35",