@tscircuit/core 0.0.842 → 0.0.843
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 +2 -1
- package/dist/index.js +16 -4
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
337
|
-
|
|
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.
|
|
17824
|
+
version: "0.0.842",
|
|
17813
17825
|
types: "dist/index.d.ts",
|
|
17814
17826
|
main: "dist/index.js",
|
|
17815
17827
|
module: "dist/index.js",
|