@tscircuit/core 0.0.1026 → 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 +5 -5
- package/dist/index.js +30 -28
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -172,9 +172,9 @@ interface IIsolatedCircuit {
|
|
|
172
172
|
interface IRootCircuit extends IIsolatedCircuit {
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
declare const orderedRenderPhases: readonly ["
|
|
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"];
|
|
176
176
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
177
|
-
declare const renderPhaseIndexMap: Map<"
|
|
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>;
|
|
178
178
|
type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
|
|
179
179
|
type RenderPhaseStates = Record<RenderPhase, {
|
|
180
180
|
initialized: boolean;
|
|
@@ -399,7 +399,7 @@ declare class IsolatedCircuit {
|
|
|
399
399
|
_guessRootComponent(): void;
|
|
400
400
|
render(): void;
|
|
401
401
|
renderUntilSettled(): Promise<void>;
|
|
402
|
-
|
|
402
|
+
_hasIncompleteAsyncEffects(): boolean;
|
|
403
403
|
_hasIncompleteAsyncEffectsForPhase(phase: RenderPhase): boolean;
|
|
404
404
|
getCircuitJson(): AnyCircuitElement[];
|
|
405
405
|
toJson(): AnyCircuitElement[];
|
|
@@ -1655,6 +1655,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
|
|
|
1655
1655
|
_hasStartedAsyncAutorouting: boolean;
|
|
1656
1656
|
_isInflatedFromCircuitJson: boolean;
|
|
1657
1657
|
_isolatedCircuitJson: AnyCircuitElement[] | null;
|
|
1658
|
+
_isolatedCircuit: IsolatedCircuit | null;
|
|
1658
1659
|
get _isIsolatedSubcircuit(): boolean;
|
|
1659
1660
|
_normalComponentNameMap: Map<string, NormalComponent[]> | null;
|
|
1660
1661
|
/**
|
|
@@ -1687,8 +1688,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
|
|
|
1687
1688
|
zodProps: Props;
|
|
1688
1689
|
componentName: string;
|
|
1689
1690
|
};
|
|
1690
|
-
|
|
1691
|
-
doInitialRenderIsolatedSubcircuits(): void;
|
|
1691
|
+
runRenderCycle(): void;
|
|
1692
1692
|
doInitialSourceGroupRender(): void;
|
|
1693
1693
|
doInitialSourceRender(): void;
|
|
1694
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.
|
|
14663
|
+
version: "0.0.1026",
|
|
14666
14664
|
types: "dist/index.d.ts",
|
|
14667
14665
|
main: "dist/index.js",
|
|
14668
14666
|
module: "dist/index.js",
|
|
@@ -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.
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15040
|
-
|
|
15041
|
-
|
|
15042
|
-
|
|
15043
|
-
|
|
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
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
}
|
|
15050
|
-
group.
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
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
|
-
|
|
15106
|
-
if (this._isIsolatedSubcircuit
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
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;
|