@tscircuit/core 0.0.1025 → 0.0.1027

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
@@ -101,6 +101,7 @@ interface SimpleRouteJson {
101
101
  }>;
102
102
  traces?: SimplifiedPcbTrace[];
103
103
  allowJumpers?: boolean;
104
+ availableJumperTypes?: Array<"1206x4" | "0603">;
104
105
  }
105
106
 
106
107
  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" | "packing:start" | "packing:end" | "packing:error" | "solver:started" | "renderComplete" | "debug:logOutput";
@@ -171,9 +172,9 @@ interface IIsolatedCircuit {
171
172
  interface IRootCircuit extends IIsolatedCircuit {
172
173
  }
173
174
 
174
- declare const orderedRenderPhases: readonly ["RenderIsolatedSubcircuits", "ReactSubtreesRender", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SymbolContainerRender", "SchematicPrimitiveRender", "SchematicSymbolResize", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PanelBoardLayout", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SimulationSpiceEngineRender"];
175
+ declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SymbolContainerRender", "SchematicPrimitiveRender", "SchematicSymbolResize", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PanelBoardLayout", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SimulationSpiceEngineRender"];
175
176
  type RenderPhase = (typeof orderedRenderPhases)[number];
176
- declare const renderPhaseIndexMap: Map<"RenderIsolatedSubcircuits" | "ReactSubtreesRender" | "InflateSubcircuitCircuitJson" | "SourceNameDuplicateComponentRemoval" | "PcbFootprintStringRender" | "InitializePortsFromChildren" | "CreateNetsFromProps" | "AssignFallbackProps" | "CreateTracesFromProps" | "CreateTracesFromNetLabels" | "CreateTraceHintsFromProps" | "SourceGroupRender" | "AssignNameToUnnamedComponents" | "SourceRender" | "SourceParentAttachment" | "PortMatching" | "OptimizeSelectorCache" | "SourceTraceRender" | "SourceAddConnectivityMapKey" | "SourceDesignRuleChecks" | "SimulationRender" | "SchematicComponentRender" | "SchematicPortRender" | "SymbolContainerRender" | "SchematicPrimitiveRender" | "SchematicSymbolResize" | "SchematicComponentSizeCalculation" | "SchematicLayout" | "SchematicTraceRender" | "SchematicReplaceNetLabelsWithSymbols" | "PanelBoardLayout" | "PcbComponentRender" | "PcbPrimitiveRender" | "PcbFootprintLayout" | "PcbPortRender" | "PcbPortAttachment" | "PcbComponentSizeCalculation" | "PcbComponentAnchorAlignment" | "PcbLayout" | "PcbBoardAutoSize" | "PanelLayout" | "PcbTraceHintRender" | "PcbManualTraceRender" | "PcbTraceRender" | "PcbRouteNetIslands" | "PcbCopperPourRender" | "PcbDesignRuleChecks" | "SilkscreenOverlapAdjustment" | "CadModelRender" | "PartsEngineRender" | "SimulationSpiceEngineRender", number>;
177
+ declare const renderPhaseIndexMap: Map<"ReactSubtreesRender" | "InflateSubcircuitCircuitJson" | "SourceNameDuplicateComponentRemoval" | "PcbFootprintStringRender" | "InitializePortsFromChildren" | "CreateNetsFromProps" | "AssignFallbackProps" | "CreateTracesFromProps" | "CreateTracesFromNetLabels" | "CreateTraceHintsFromProps" | "SourceGroupRender" | "AssignNameToUnnamedComponents" | "SourceRender" | "SourceParentAttachment" | "PortMatching" | "OptimizeSelectorCache" | "SourceTraceRender" | "SourceAddConnectivityMapKey" | "SourceDesignRuleChecks" | "SimulationRender" | "SchematicComponentRender" | "SchematicPortRender" | "SymbolContainerRender" | "SchematicPrimitiveRender" | "SchematicSymbolResize" | "SchematicComponentSizeCalculation" | "SchematicLayout" | "SchematicTraceRender" | "SchematicReplaceNetLabelsWithSymbols" | "PanelBoardLayout" | "PcbComponentRender" | "PcbPrimitiveRender" | "PcbFootprintLayout" | "PcbPortRender" | "PcbPortAttachment" | "PcbComponentSizeCalculation" | "PcbComponentAnchorAlignment" | "PcbLayout" | "PcbBoardAutoSize" | "PanelLayout" | "PcbTraceHintRender" | "PcbManualTraceRender" | "PcbTraceRender" | "PcbRouteNetIslands" | "PcbCopperPourRender" | "PcbDesignRuleChecks" | "SilkscreenOverlapAdjustment" | "CadModelRender" | "PartsEngineRender" | "SimulationSpiceEngineRender", number>;
177
178
  type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
178
179
  type RenderPhaseStates = Record<RenderPhase, {
179
180
  initialized: boolean;
@@ -398,7 +399,7 @@ declare class IsolatedCircuit {
398
399
  _guessRootComponent(): void;
399
400
  render(): void;
400
401
  renderUntilSettled(): Promise<void>;
401
- private _hasIncompleteAsyncEffects;
402
+ _hasIncompleteAsyncEffects(): boolean;
402
403
  _hasIncompleteAsyncEffectsForPhase(phase: RenderPhase): boolean;
403
404
  getCircuitJson(): AnyCircuitElement[];
404
405
  toJson(): AnyCircuitElement[];
@@ -1654,6 +1655,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
1654
1655
  _hasStartedAsyncAutorouting: boolean;
1655
1656
  _isInflatedFromCircuitJson: boolean;
1656
1657
  _isolatedCircuitJson: AnyCircuitElement[] | null;
1658
+ _isolatedCircuit: IsolatedCircuit | null;
1657
1659
  get _isIsolatedSubcircuit(): boolean;
1658
1660
  _normalComponentNameMap: Map<string, NormalComponent[]> | null;
1659
1661
  /**
@@ -1686,8 +1688,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
1686
1688
  zodProps: Props;
1687
1689
  componentName: string;
1688
1690
  };
1689
- runRenderPhaseForChildren(phase: RenderPhase): void;
1690
- doInitialRenderIsolatedSubcircuits(): void;
1691
+ runRenderCycle(): void;
1691
1692
  doInitialSourceGroupRender(): void;
1692
1693
  doInitialSourceRender(): void;
1693
1694
  doInitialSourceParentAttachment(): void;
package/dist/index.js CHANGED
@@ -117,7 +117,6 @@ import { DefaultEventPriority } from "react-reconciler/constants.js";
117
117
  import Debug from "debug";
118
118
  var debug = Debug("tscircuit:renderable");
119
119
  var orderedRenderPhases = [
120
- "RenderIsolatedSubcircuits",
121
120
  "ReactSubtreesRender",
122
121
  "InflateSubcircuitCircuitJson",
123
122
  "SourceNameDuplicateComponentRemoval",
@@ -173,7 +172,6 @@ var renderPhaseIndexMap = new Map(
173
172
  orderedRenderPhases.map((phase, index) => [phase, index])
174
173
  );
175
174
  var asyncPhaseDependencies = {
176
- InflateSubcircuitCircuitJson: ["RenderIsolatedSubcircuits"],
177
175
  PcbFootprintLayout: ["PcbFootprintStringRender"],
178
176
  PcbComponentSizeCalculation: ["PcbFootprintStringRender"],
179
177
  PcbLayout: ["PcbFootprintStringRender"],
@@ -14662,7 +14660,7 @@ import { identity as identity4 } from "transformation-matrix";
14662
14660
  var package_default = {
14663
14661
  name: "@tscircuit/core",
14664
14662
  type: "module",
14665
- version: "0.0.1024",
14663
+ version: "0.0.1026",
14666
14664
  types: "dist/index.d.ts",
14667
14665
  main: "dist/index.js",
14668
14666
  module: "dist/index.js",
@@ -14694,7 +14692,7 @@ var package_default = {
14694
14692
  "@biomejs/biome": "^1.8.3",
14695
14693
  "@resvg/resvg-js": "^2.6.2",
14696
14694
  "@tscircuit/alphabet": "0.0.18",
14697
- "@tscircuit/capacity-autorouter": "^0.0.264",
14695
+ "@tscircuit/capacity-autorouter": "^0.0.269",
14698
14696
  "@tscircuit/checks": "^0.0.88",
14699
14697
  "@tscircuit/circuit-json-util": "^0.0.77",
14700
14698
  "@tscircuit/common": "^0.0.20",
@@ -15033,26 +15031,28 @@ var IsolatedCircuit = class {
15033
15031
 
15034
15032
  // lib/components/primitive-components/Group/Group_doInitialRenderIsolatedSubcircuits.ts
15035
15033
  function Group_doInitialRenderIsolatedSubcircuits(group) {
15036
- if (!group._isIsolatedSubcircuit) return;
15037
- if (!group.root) return;
15038
- const parentRoot = group.root;
15039
- const isolatedCircuit = new IsolatedCircuit({
15040
- platform: {
15041
- ...parentRoot.platform,
15042
- pcbDisabled: parentRoot.pcbDisabled,
15043
- schematicDisabled: parentRoot.schematicDisabled
15034
+ if (!group._isolatedCircuit) {
15035
+ const parentRoot = group.root;
15036
+ group._isolatedCircuit = new IsolatedCircuit({
15037
+ platform: {
15038
+ ...parentRoot.platform,
15039
+ pcbDisabled: parentRoot.pcbDisabled,
15040
+ schematicDisabled: parentRoot.schematicDisabled
15041
+ }
15042
+ });
15043
+ for (const child of group.children) {
15044
+ group._isolatedCircuit.add(child);
15044
15045
  }
15045
- });
15046
- const childrenSnapshot = [...group.children];
15047
- for (const child of childrenSnapshot) {
15048
- isolatedCircuit.add(child);
15049
- }
15050
- group._queueAsyncEffect("render-isolated-subcircuit", async () => {
15051
- await isolatedCircuit.renderUntilSettled();
15052
- group.children = [];
15053
- group._normalComponentNameMap = null;
15054
- group._isolatedCircuitJson = isolatedCircuit.getCircuitJson();
15055
- });
15046
+ }
15047
+ group._isolatedCircuit.render();
15048
+ if (group._isolatedCircuit._hasIncompleteAsyncEffects()) {
15049
+ return false;
15050
+ }
15051
+ group._isolatedCircuitJson = group._isolatedCircuit.getCircuitJson();
15052
+ group.children = [];
15053
+ group._normalComponentNameMap = null;
15054
+ group._isolatedCircuit = null;
15055
+ return true;
15056
15056
  }
15057
15057
 
15058
15058
  // lib/components/primitive-components/Group/Group.ts
@@ -15063,6 +15063,7 @@ var Group6 = class extends NormalComponent3 {
15063
15063
  _hasStartedAsyncAutorouting = false;
15064
15064
  _isInflatedFromCircuitJson = false;
15065
15065
  _isolatedCircuitJson = null;
15066
+ _isolatedCircuit = null;
15066
15067
  get _isIsolatedSubcircuit() {
15067
15068
  return Boolean(this._parsedProps._subcircuitCachingEnabled);
15068
15069
  }
@@ -15102,12 +15103,13 @@ var Group6 = class extends NormalComponent3 {
15102
15103
  componentName: "Group"
15103
15104
  };
15104
15105
  }
15105
- runRenderPhaseForChildren(phase) {
15106
- if (this._isIsolatedSubcircuit && !this._isInflatedFromCircuitJson) return;
15107
- super.runRenderPhaseForChildren(phase);
15108
- }
15109
- doInitialRenderIsolatedSubcircuits() {
15110
- Group_doInitialRenderIsolatedSubcircuits(this);
15106
+ runRenderCycle() {
15107
+ if (!this._isIsolatedSubcircuit || !this.root) {
15108
+ super.runRenderCycle();
15109
+ return;
15110
+ }
15111
+ if (!Group_doInitialRenderIsolatedSubcircuits(this)) return;
15112
+ super.runRenderCycle();
15111
15113
  }
15112
15114
  doInitialSourceGroupRender() {
15113
15115
  const { db } = this.root;
@@ -15441,6 +15443,9 @@ var Group6 = class extends NormalComponent3 {
15441
15443
  });
15442
15444
  if (isAutoJumperPreset) {
15443
15445
  simpleRouteJson.allowJumpers = true;
15446
+ if (autorouterConfig.availableJumperTypes) {
15447
+ simpleRouteJson.availableJumperTypes = autorouterConfig.availableJumperTypes;
15448
+ }
15444
15449
  }
15445
15450
  if (debug11.enabled) {
15446
15451
  ;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1025",
4
+ "version": "0.0.1027",
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.18",
36
- "@tscircuit/capacity-autorouter": "^0.0.264",
36
+ "@tscircuit/capacity-autorouter": "^0.0.269",
37
37
  "@tscircuit/checks": "^0.0.88",
38
38
  "@tscircuit/circuit-json-util": "^0.0.77",
39
39
  "@tscircuit/common": "^0.0.20",