@tscircuit/core 0.0.842 → 0.0.844

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
@@ -55,9 +55,10 @@ declare abstract class Renderable implements IRenderable {
55
55
  protected _emitRenderLifecycleEvent(phase: RenderPhase, startOrEnd: "start" | "end"): void;
56
56
  getString(): string;
57
57
  _hasIncompleteAsyncEffects(): boolean;
58
- private _hasIncompleteAsyncEffectsInSubtreeForPhase;
58
+ _hasIncompleteAsyncEffectsInSubtreeForPhase(phase: RenderPhase): boolean;
59
59
  getCurrentRenderPhase(): RenderPhase | null;
60
60
  getRenderGraph(): Record<string, any>;
61
+ getTopLevelRenderable(): Renderable;
61
62
  runRenderCycle(): void;
62
63
  /**
63
64
  * This runs all the render methods for a given phase, calling one of:
package/dist/index.js CHANGED
@@ -174,7 +174,7 @@ var asyncPhaseDependencies = {
174
174
  PcbComponentAnchorAlignment: ["PcbFootprintStringRender"]
175
175
  };
176
176
  var globalRenderCounter = 0;
177
- var Renderable = class {
177
+ var Renderable = class _Renderable {
178
178
  renderPhaseStates;
179
179
  shouldBeRemoved = false;
180
180
  children;
@@ -299,6 +299,13 @@ ${error.stack}`
299
299
  )
300
300
  };
301
301
  }
302
+ getTopLevelRenderable() {
303
+ let current = this;
304
+ while (current.parent && current.parent instanceof _Renderable) {
305
+ current = current.parent;
306
+ }
307
+ return current;
308
+ }
302
309
  runRenderCycle() {
303
310
  for (const renderPhase of orderedRenderPhases) {
304
311
  this.runRenderPhaseForChildren(renderPhase);
@@ -333,8 +340,13 @@ ${error.stack}`
333
340
  if (hasIncompleteEffects) return;
334
341
  }
335
342
  const deps = asyncPhaseDependencies[phase] || [];
336
- for (const depPhase of deps) {
337
- if (this._hasIncompleteAsyncEffectsInSubtreeForPhase(depPhase)) return;
343
+ if (deps.length > 0) {
344
+ const root = this.getTopLevelRenderable();
345
+ for (const depPhase of deps) {
346
+ if (root._hasIncompleteAsyncEffectsInSubtreeForPhase(depPhase)) {
347
+ return;
348
+ }
349
+ }
338
350
  }
339
351
  this._emitRenderLifecycleEvent(phase, "start");
340
352
  if (isInitialized) {
@@ -17809,7 +17821,7 @@ import { identity as identity6 } from "transformation-matrix";
17809
17821
  var package_default = {
17810
17822
  name: "@tscircuit/core",
17811
17823
  type: "module",
17812
- version: "0.0.841",
17824
+ version: "0.0.843",
17813
17825
  types: "dist/index.d.ts",
17814
17826
  main: "dist/index.js",
17815
17827
  module: "dist/index.js",
@@ -17843,7 +17855,7 @@ var package_default = {
17843
17855
  "@tscircuit/capacity-autorouter": "^0.0.140",
17844
17856
  "@tscircuit/checks": "^0.0.85",
17845
17857
  "@tscircuit/circuit-json-util": "^0.0.72",
17846
- "@tscircuit/common": "^0.0.14",
17858
+ "@tscircuit/common": "^0.0.20",
17847
17859
  "@tscircuit/footprinter": "^0.0.236",
17848
17860
  "@tscircuit/import-snippet": "^0.0.4",
17849
17861
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.842",
4
+ "version": "0.0.844",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "@tscircuit/capacity-autorouter": "^0.0.140",
36
36
  "@tscircuit/checks": "^0.0.85",
37
37
  "@tscircuit/circuit-json-util": "^0.0.72",
38
- "@tscircuit/common": "^0.0.14",
38
+ "@tscircuit/common": "^0.0.20",
39
39
  "@tscircuit/footprinter": "^0.0.236",
40
40
  "@tscircuit/import-snippet": "^0.0.4",
41
41
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",