@tscircuit/core 0.0.240 → 0.0.242
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/README.md +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @tscircuit/core
|
|
2
2
|
|
|
3
|
-
[tscircuit](https://github.com/tscircuit/tscircuit) · [Development Guide](./docs/DEVELOPMENT.md)
|
|
4
|
-
|
|
5
3
|
The core logic used to build Circuit JSON from tscircuit React elements.
|
|
6
4
|
|
|
5
|
+
[tscircuit](https://github.com/tscircuit/tscircuit) · [Development Guide](./docs/DEVELOPMENT.md)
|
|
6
|
+
|
|
7
7
|
You can use `core` to create [Circuit JSON](https://github.com/tscircuit/circuit-json), which can then
|
|
8
8
|
be converted into Gerbers, viewed online, and much more.
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -82,11 +82,11 @@ interface SchematicBoxDimensions {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
type RootCircuitEventName = "asyncEffectComplete" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | "external:evalError";
|
|
85
|
-
declare class
|
|
85
|
+
declare class RootCircuit {
|
|
86
86
|
firstChild: PrimitiveComponent | null;
|
|
87
87
|
children: PrimitiveComponent[];
|
|
88
88
|
db: SoupUtilObjects;
|
|
89
|
-
root:
|
|
89
|
+
root: RootCircuit | null;
|
|
90
90
|
isRoot: boolean;
|
|
91
91
|
schematicDisabled: boolean;
|
|
92
92
|
pcbDisabled: boolean;
|
|
@@ -129,7 +129,7 @@ declare class Circuit {
|
|
|
129
129
|
/**
|
|
130
130
|
* @deprecated
|
|
131
131
|
*/
|
|
132
|
-
declare const Project: typeof
|
|
132
|
+
declare const Project: typeof RootCircuit;
|
|
133
133
|
|
|
134
134
|
interface ISubcircuit extends PrimitiveComponent {
|
|
135
135
|
_shouldUseTraceByTraceRouting(): boolean;
|
|
@@ -268,7 +268,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
268
268
|
x: number;
|
|
269
269
|
y: number;
|
|
270
270
|
};
|
|
271
|
-
get root():
|
|
271
|
+
get root(): RootCircuit | null;
|
|
272
272
|
onAddToParent(parent: PrimitiveComponent): void;
|
|
273
273
|
/**
|
|
274
274
|
* Called whenever the props change
|
|
@@ -8297,7 +8297,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
|
|
|
8297
8297
|
declare const useRenderedCircuit: (reactElements: React.ReactElement) => {
|
|
8298
8298
|
isLoading: boolean;
|
|
8299
8299
|
error?: Error | null;
|
|
8300
|
-
circuit?:
|
|
8300
|
+
circuit?: RootCircuit;
|
|
8301
8301
|
circuitJson?: AnyCircuitElement[];
|
|
8302
8302
|
};
|
|
8303
8303
|
|
|
@@ -8664,4 +8664,4 @@ declare module "react/jsx-runtime" {
|
|
|
8664
8664
|
}
|
|
8665
8665
|
}
|
|
8666
8666
|
|
|
8667
|
-
export { Battery, Board, Capacitor, Chip,
|
|
8667
|
+
export { Battery, Board, Capacitor, Chip, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Net, NetAlias, NormalComponent, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, Renderable, Resistor, RootCircuit, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Subcircuit, Trace, TraceHint, Via, applyEditEventsToManualEditsFile, createUseComponent, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -5883,11 +5883,11 @@ var Crystal = class extends NormalComponent {
|
|
|
5883
5883
|
}
|
|
5884
5884
|
};
|
|
5885
5885
|
|
|
5886
|
-
// lib/
|
|
5886
|
+
// lib/RootCircuit.ts
|
|
5887
5887
|
import { su } from "@tscircuit/soup-util";
|
|
5888
5888
|
import { isValidElement as isValidElement2 } from "react";
|
|
5889
5889
|
import { identity as identity5 } from "transformation-matrix";
|
|
5890
|
-
var
|
|
5890
|
+
var RootCircuit = class {
|
|
5891
5891
|
firstChild = null;
|
|
5892
5892
|
children;
|
|
5893
5893
|
db;
|
|
@@ -6026,7 +6026,7 @@ var Circuit = class {
|
|
|
6026
6026
|
return "";
|
|
6027
6027
|
}
|
|
6028
6028
|
};
|
|
6029
|
-
var Project =
|
|
6029
|
+
var Project = RootCircuit;
|
|
6030
6030
|
|
|
6031
6031
|
// lib/hooks/use-rendered-circuit.ts
|
|
6032
6032
|
import React from "react";
|
|
@@ -6041,7 +6041,7 @@ var useRenderedCircuit = (reactElements) => {
|
|
|
6041
6041
|
if (reactElements) {
|
|
6042
6042
|
setTimeout(() => {
|
|
6043
6043
|
try {
|
|
6044
|
-
const circuit2 = new
|
|
6044
|
+
const circuit2 = new RootCircuit();
|
|
6045
6045
|
circuit2.add(reactElements);
|
|
6046
6046
|
setCircuit(circuit2);
|
|
6047
6047
|
setCircuitJson(circuit2.toJson());
|
|
@@ -6192,7 +6192,6 @@ export {
|
|
|
6192
6192
|
Board,
|
|
6193
6193
|
Capacitor,
|
|
6194
6194
|
Chip,
|
|
6195
|
-
Circuit,
|
|
6196
6195
|
Constraint2 as Constraint,
|
|
6197
6196
|
Crystal,
|
|
6198
6197
|
Diode,
|
|
@@ -6218,6 +6217,7 @@ export {
|
|
|
6218
6217
|
PushButton,
|
|
6219
6218
|
Renderable,
|
|
6220
6219
|
Resistor,
|
|
6220
|
+
RootCircuit,
|
|
6221
6221
|
SilkscreenCircle,
|
|
6222
6222
|
SilkscreenLine,
|
|
6223
6223
|
SilkscreenPath,
|