@tscircuit/core 0.0.254 → 0.0.255
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 +3 -3
- package/dist/index.js +16 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare abstract class Renderable implements IRenderable {
|
|
|
41
41
|
constructor(props: any);
|
|
42
42
|
protected _markDirty(phase: RenderPhase): void;
|
|
43
43
|
protected _queueAsyncEffect(effectName: string, effect: () => Promise<void>): void;
|
|
44
|
-
protected _emitRenderLifecycleEvent(phase: RenderPhase,
|
|
44
|
+
protected _emitRenderLifecycleEvent(phase: RenderPhase, startOrEnd: "start" | "end"): void;
|
|
45
45
|
getString(): string;
|
|
46
46
|
_hasIncompleteAsyncEffects(): boolean;
|
|
47
47
|
getCurrentRenderPhase(): RenderPhase | null;
|
|
@@ -81,7 +81,7 @@ interface SchematicBoxDimensions {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
type RootCircuitEventName = "
|
|
84
|
+
type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | "external:evalError";
|
|
85
85
|
declare class RootCircuit {
|
|
86
86
|
firstChild: PrimitiveComponent | null;
|
|
87
87
|
children: PrimitiveComponent[];
|
|
@@ -9926,4 +9926,4 @@ declare module "react/jsx-runtime" {
|
|
|
9926
9926
|
}
|
|
9927
9927
|
}
|
|
9928
9928
|
|
|
9929
|
-
export { Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, Renderable, Resistor, Resonator, RootCircuit, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Subcircuit, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, createUseComponent, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
9929
|
+
export { Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Subcircuit, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, createUseComponent, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -127,11 +127,19 @@ var Renderable = class {
|
|
|
127
127
|
complete: false
|
|
128
128
|
};
|
|
129
129
|
this._asyncEffects.push(asyncEffect);
|
|
130
|
+
if ("root" in this && this.root) {
|
|
131
|
+
;
|
|
132
|
+
this.root.emit("asyncEffect:start", {
|
|
133
|
+
effectName,
|
|
134
|
+
componentDisplayName: this.getString(),
|
|
135
|
+
phase: asyncEffect.phase
|
|
136
|
+
});
|
|
137
|
+
}
|
|
130
138
|
asyncEffect.promise.then(() => {
|
|
131
139
|
asyncEffect.complete = true;
|
|
132
140
|
if ("root" in this && this.root) {
|
|
133
141
|
;
|
|
134
|
-
this.root.emit("
|
|
142
|
+
this.root.emit("asyncEffect:end", {
|
|
135
143
|
effectName,
|
|
136
144
|
componentDisplayName: this.getString(),
|
|
137
145
|
phase: asyncEffect.phase
|
|
@@ -145,7 +153,7 @@ ${error.stack}`
|
|
|
145
153
|
asyncEffect.complete = true;
|
|
146
154
|
if ("root" in this && this.root) {
|
|
147
155
|
;
|
|
148
|
-
this.root.emit("
|
|
156
|
+
this.root.emit("asyncEffect:end", {
|
|
149
157
|
effectName,
|
|
150
158
|
componentDisplayName: this.getString(),
|
|
151
159
|
phase: asyncEffect.phase,
|
|
@@ -154,21 +162,19 @@ ${error.stack}`
|
|
|
154
162
|
}
|
|
155
163
|
});
|
|
156
164
|
}
|
|
157
|
-
_emitRenderLifecycleEvent(phase,
|
|
165
|
+
_emitRenderLifecycleEvent(phase, startOrEnd) {
|
|
166
|
+
const granular_event_type = `renderable:renderLifecycle:${phase}:${startOrEnd}`;
|
|
158
167
|
const eventPayload = {
|
|
159
168
|
renderId: this._renderId,
|
|
160
|
-
componentDisplayName: this.getString()
|
|
169
|
+
componentDisplayName: this.getString(),
|
|
170
|
+
type: granular_event_type
|
|
161
171
|
};
|
|
162
|
-
const eventName = `renderable:renderLifecycle:${phase}:${eventType}`;
|
|
163
172
|
if ("root" in this && this.root) {
|
|
164
173
|
;
|
|
165
|
-
this.root.emit(
|
|
166
|
-
...eventPayload,
|
|
167
|
-
type: eventName
|
|
168
|
-
});
|
|
174
|
+
this.root.emit(granular_event_type, eventPayload);
|
|
169
175
|
this.root.emit("renderable:renderLifecycle:anyEvent", {
|
|
170
176
|
...eventPayload,
|
|
171
|
-
type:
|
|
177
|
+
type: granular_event_type
|
|
172
178
|
});
|
|
173
179
|
}
|
|
174
180
|
}
|