@tscircuit/core 0.0.1467 → 0.0.1469
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 +36 -2
- package/dist/index.js +81 -10
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as circuit_json from 'circuit-json';
|
|
2
2
|
import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, PcbTrace as PcbTrace$1, PcbVia as PcbVia$1, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, SchematicPort, SchematicComponent, PcbSilkscreenGraphic, RouteHintPoint, CircuitJson } from 'circuit-json';
|
|
3
3
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
4
|
-
import { PlatformConfig, traceProps, netProps, AutorouterProp, AutoroutingPhaseProps, subcircuitGroupProps, AutorouterConfig, PcbSx, portProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, ammeterProps, resistorProps, constraintProps, drcCheckProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, silkscreenGraphicProps, smtPadProps, fiducialProps, differentialPairProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, CrystalPinLabels, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicSheetProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, spicemodelProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
4
|
+
import { PlatformConfig, traceProps, netProps, AutorouterProp, AutoroutingPhaseProps, subcircuitGroupProps, AutorouterConfig, PcbSx, portProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, ammeterProps, resistorProps, constraintProps, internalCircuitProps, drcCheckProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, silkscreenGraphicProps, smtPadProps, fiducialProps, differentialPairProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, CrystalPinLabels, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicSheetProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, spicemodelProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
5
5
|
export { kicadFootprintStrings } from '@tscircuit/props';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import react__default, { ReactElement } from 'react';
|
|
@@ -16340,12 +16340,14 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
16340
16340
|
schWidth: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16341
16341
|
schHeight: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16342
16342
|
noSchematicRepresentation: z.ZodOptional<z.ZodBoolean>;
|
|
16343
|
+
schShowInternalCircuit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
16343
16344
|
noConnect: z.ZodOptional<z.ZodUnion<[z.ZodReadonly<z.ZodArray<z.ZodString, "many">>, z.ZodArray<z.ZodString, "many">]>>;
|
|
16344
16345
|
connections: z.ZodOptional<z.ZodPipeline<z.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, z.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>>;
|
|
16345
16346
|
spiceModel: z.ZodOptional<z.ZodType<_tscircuit_props.SpiceModelElement, z.ZodTypeDef, _tscircuit_props.SpiceModelElement>>;
|
|
16346
16347
|
internalCircuit: z.ZodOptional<z.ZodType<_tscircuit_props.InternalCircuitElement, z.ZodTypeDef, _tscircuit_props.InternalCircuitElement>>;
|
|
16347
16348
|
}, "strip", z.ZodTypeAny, {
|
|
16348
16349
|
name: string;
|
|
16350
|
+
schShowInternalCircuit: boolean;
|
|
16349
16351
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
16350
16352
|
showAsTranslucentModel?: boolean | undefined;
|
|
16351
16353
|
key?: any;
|
|
@@ -17657,6 +17659,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
17657
17659
|
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
17658
17660
|
}[] | undefined;
|
|
17659
17661
|
noSchematicRepresentation?: boolean | undefined;
|
|
17662
|
+
schShowInternalCircuit?: boolean | undefined;
|
|
17660
17663
|
noConnect?: readonly string[] | string[] | undefined;
|
|
17661
17664
|
spiceModel?: _tscircuit_props.SpiceModelElement | undefined;
|
|
17662
17665
|
internalCircuit?: _tscircuit_props.InternalCircuitElement | undefined;
|
|
@@ -17665,6 +17668,8 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
17665
17668
|
};
|
|
17666
17669
|
initPorts(opts?: {}): void;
|
|
17667
17670
|
doInitialSchematicComponentRender(): void;
|
|
17671
|
+
_getSchematicBoxDimensions(): SchematicBoxDimensions | null;
|
|
17672
|
+
doInitialReactSubtreesRender(): void;
|
|
17668
17673
|
doInitialSourceRender(): void;
|
|
17669
17674
|
doInitialPcbComponentRender(): void;
|
|
17670
17675
|
doInitialCreateTracesFromProps(): void;
|
|
@@ -21328,12 +21333,14 @@ declare class Pinout<PinLabels extends string = never> extends Chip<PinLabels> {
|
|
|
21328
21333
|
schWidth: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
21329
21334
|
schHeight: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
21330
21335
|
noSchematicRepresentation: z.ZodOptional<z.ZodBoolean>;
|
|
21336
|
+
schShowInternalCircuit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
21331
21337
|
noConnect: z.ZodOptional<z.ZodUnion<[z.ZodReadonly<z.ZodArray<z.ZodString, "many">>, z.ZodArray<z.ZodString, "many">]>>;
|
|
21332
21338
|
connections: z.ZodOptional<z.ZodPipeline<z.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, z.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>>;
|
|
21333
21339
|
spiceModel: z.ZodOptional<z.ZodType<_tscircuit_props.SpiceModelElement, z.ZodTypeDef, _tscircuit_props.SpiceModelElement>>;
|
|
21334
21340
|
internalCircuit: z.ZodOptional<z.ZodType<_tscircuit_props.InternalCircuitElement, z.ZodTypeDef, _tscircuit_props.InternalCircuitElement>>;
|
|
21335
21341
|
}, "strip", z.ZodTypeAny, {
|
|
21336
21342
|
name: string;
|
|
21343
|
+
schShowInternalCircuit: boolean;
|
|
21337
21344
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
21338
21345
|
showAsTranslucentModel?: boolean | undefined;
|
|
21339
21346
|
key?: any;
|
|
@@ -22645,6 +22652,7 @@ declare class Pinout<PinLabels extends string = never> extends Chip<PinLabels> {
|
|
|
22645
22652
|
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
22646
22653
|
}[] | undefined;
|
|
22647
22654
|
noSchematicRepresentation?: boolean | undefined;
|
|
22655
|
+
schShowInternalCircuit?: boolean | undefined;
|
|
22648
22656
|
noConnect?: readonly string[] | string[] | undefined;
|
|
22649
22657
|
spiceModel?: _tscircuit_props.SpiceModelElement | undefined;
|
|
22650
22658
|
internalCircuit?: _tscircuit_props.InternalCircuitElement | undefined;
|
|
@@ -76006,6 +76014,19 @@ declare class Constraint extends PrimitiveComponent<typeof constraintProps> {
|
|
|
76006
76014
|
};
|
|
76007
76015
|
}
|
|
76008
76016
|
|
|
76017
|
+
declare class InternalCircuit extends PrimitiveComponent<typeof internalCircuitProps> {
|
|
76018
|
+
get config(): {
|
|
76019
|
+
componentName: string;
|
|
76020
|
+
zodProps: zod.ZodObject<{
|
|
76021
|
+
children: zod.ZodOptional<zod.ZodType<react.ReactNode, zod.ZodTypeDef, react.ReactNode>>;
|
|
76022
|
+
}, "strip", zod.ZodTypeAny, {
|
|
76023
|
+
children?: react.ReactNode;
|
|
76024
|
+
}, {
|
|
76025
|
+
children?: react.ReactNode;
|
|
76026
|
+
}>;
|
|
76027
|
+
};
|
|
76028
|
+
}
|
|
76029
|
+
|
|
76009
76030
|
declare class DrcCheck extends PrimitiveComponent<typeof drcCheckProps> {
|
|
76010
76031
|
get config(): {
|
|
76011
76032
|
componentName: string;
|
|
@@ -98679,6 +98700,7 @@ declare class Connector<PinLabels extends string = never> extends Chip<PinLabels
|
|
|
98679
98700
|
schWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
98680
98701
|
schHeight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
98681
98702
|
noSchematicRepresentation: zod.ZodOptional<zod.ZodBoolean>;
|
|
98703
|
+
schShowInternalCircuit: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
|
|
98682
98704
|
noConnect: zod.ZodOptional<zod.ZodUnion<[zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>, zod.ZodArray<zod.ZodString, "many">]>>;
|
|
98683
98705
|
connections: zod.ZodOptional<zod.ZodPipeline<zod.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, zod.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
|
|
98684
98706
|
spiceModel: zod.ZodOptional<zod.ZodType<_tscircuit_props.SpiceModelElement, zod.ZodTypeDef, _tscircuit_props.SpiceModelElement>>;
|
|
@@ -98687,6 +98709,7 @@ declare class Connector<PinLabels extends string = never> extends Chip<PinLabels
|
|
|
98687
98709
|
standard: zod.ZodOptional<zod.ZodEnum<["usb_c", "m2"]>>;
|
|
98688
98710
|
}, "strip", zod.ZodTypeAny, {
|
|
98689
98711
|
name: string;
|
|
98712
|
+
schShowInternalCircuit: boolean;
|
|
98690
98713
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
98691
98714
|
showAsTranslucentModel?: boolean | undefined;
|
|
98692
98715
|
key?: any;
|
|
@@ -99999,6 +100022,7 @@ declare class Connector<PinLabels extends string = never> extends Chip<PinLabels
|
|
|
99999
100022
|
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
100000
100023
|
}[] | undefined;
|
|
100001
100024
|
noSchematicRepresentation?: boolean | undefined;
|
|
100025
|
+
schShowInternalCircuit?: boolean | undefined;
|
|
100002
100026
|
noConnect?: readonly string[] | string[] | undefined;
|
|
100003
100027
|
spiceModel?: _tscircuit_props.SpiceModelElement | undefined;
|
|
100004
100028
|
internalCircuit?: _tscircuit_props.InternalCircuitElement | undefined;
|
|
@@ -122097,12 +122121,14 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
|
|
|
122097
122121
|
schWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
122098
122122
|
schHeight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
122099
122123
|
noSchematicRepresentation: zod.ZodOptional<zod.ZodBoolean>;
|
|
122124
|
+
schShowInternalCircuit: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
|
|
122100
122125
|
noConnect: zod.ZodOptional<zod.ZodUnion<[zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>, zod.ZodArray<zod.ZodString, "many">]>>;
|
|
122101
122126
|
connections: zod.ZodOptional<zod.ZodPipeline<zod.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, zod.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
|
|
122102
122127
|
spiceModel: zod.ZodOptional<zod.ZodType<_tscircuit_props.SpiceModelElement, zod.ZodTypeDef, _tscircuit_props.SpiceModelElement>>;
|
|
122103
122128
|
internalCircuit: zod.ZodOptional<zod.ZodType<_tscircuit_props.InternalCircuitElement, zod.ZodTypeDef, _tscircuit_props.InternalCircuitElement>>;
|
|
122104
122129
|
}, "strip", zod.ZodTypeAny, {
|
|
122105
122130
|
name: string;
|
|
122131
|
+
schShowInternalCircuit: boolean;
|
|
122106
122132
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
122107
122133
|
showAsTranslucentModel?: boolean | undefined;
|
|
122108
122134
|
key?: any;
|
|
@@ -123414,6 +123440,7 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
|
|
|
123414
123440
|
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
123415
123441
|
}[] | undefined;
|
|
123416
123442
|
noSchematicRepresentation?: boolean | undefined;
|
|
123443
|
+
schShowInternalCircuit?: boolean | undefined;
|
|
123417
123444
|
noConnect?: readonly string[] | string[] | undefined;
|
|
123418
123445
|
spiceModel?: _tscircuit_props.SpiceModelElement | undefined;
|
|
123419
123446
|
internalCircuit?: _tscircuit_props.InternalCircuitElement | undefined;
|
|
@@ -137062,6 +137089,12 @@ declare class Mosfet extends NormalComponent<typeof mosfetProps> {
|
|
|
137062
137089
|
doInitialSourceRender(): void;
|
|
137063
137090
|
}
|
|
137064
137091
|
|
|
137092
|
+
declare class InternalCircuitMosfet extends Mosfet {
|
|
137093
|
+
resolveFootprint(): undefined;
|
|
137094
|
+
doInitialPcbComponentRender(): void;
|
|
137095
|
+
doInitialReactSubtreesRender(): void;
|
|
137096
|
+
}
|
|
137097
|
+
|
|
137065
137098
|
declare class OpAmp extends NormalComponent<typeof opampProps, OpAmpPinLabels> {
|
|
137066
137099
|
getSchematicSymbolName(): BaseSymbolName;
|
|
137067
137100
|
get config(): {
|
|
@@ -159210,6 +159243,7 @@ interface TscircuitElements {
|
|
|
159210
159243
|
transistor: _tscircuit_props.TransistorProps;
|
|
159211
159244
|
switch: _tscircuit_props.SwitchProps;
|
|
159212
159245
|
mosfet: _tscircuit_props.MosfetProps;
|
|
159246
|
+
internalcircuit: _tscircuit_props.InternalCircuitProps;
|
|
159213
159247
|
testpoint: _tscircuit_props.TestpointProps;
|
|
159214
159248
|
voltagesource: _tscircuit_props.VoltageSourceProps;
|
|
159215
159249
|
currentsource: _tscircuit_props.CurrentSourceProps;
|
|
@@ -159239,4 +159273,4 @@ declare module "react/jsx-runtime" {
|
|
|
159239
159273
|
}
|
|
159240
159274
|
}
|
|
159241
159275
|
|
|
159242
|
-
export { Ammeter, AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, DifferentialPair, Diode, DrcCheck, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Breakout as Fanout, BreakoutPoint as FanoutPoint, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PcbVia, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicSheet, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenGraphic, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteDifferentialPair, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, SpiceModel, type SrjConnectionName, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, unrouteCircuitJson, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
159276
|
+
export { Ammeter, AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, DifferentialPair, Diode, DrcCheck, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Breakout as Fanout, BreakoutPoint as FanoutPoint, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, InternalCircuit, InternalCircuitMosfet, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PcbVia, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicSheet, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenGraphic, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteDifferentialPair, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, SpiceModel, type SrjConnectionName, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, unrouteCircuitJson, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,8 @@ __export(components_exports, {
|
|
|
44
44
|
Hole: () => Hole,
|
|
45
45
|
Inductor: () => Inductor,
|
|
46
46
|
Interconnect: () => Interconnect,
|
|
47
|
+
InternalCircuit: () => InternalCircuit,
|
|
48
|
+
InternalCircuitMosfet: () => InternalCircuitMosfet,
|
|
47
49
|
Jumper: () => Jumper,
|
|
48
50
|
Keepout: () => Keepout,
|
|
49
51
|
Led: () => Led,
|
|
@@ -4261,6 +4263,13 @@ function Trace_doInitialPcbTraceRender(trace) {
|
|
|
4261
4263
|
}
|
|
4262
4264
|
const portsConnectedOnPcbViaNet = [];
|
|
4263
4265
|
if (!allPortsFound) return;
|
|
4266
|
+
const hasEndpointWithoutPcbRepresentation = ports.some((port) => {
|
|
4267
|
+
const parentComponent = port.getParentNormalComponent();
|
|
4268
|
+
return Boolean(
|
|
4269
|
+
parentComponent?.source_component_id && !parentComponent.pcb_component_id
|
|
4270
|
+
);
|
|
4271
|
+
});
|
|
4272
|
+
if (hasEndpointWithoutPcbRepresentation) return;
|
|
4264
4273
|
const pcbSelectorError = portsWithSelectors.map(
|
|
4265
4274
|
({ selector, port }) => getPcbSelectorErrorForTracePort(selector, port)
|
|
4266
4275
|
).find(Boolean);
|
|
@@ -5730,6 +5739,7 @@ import { DefaultEventPriority } from "react-reconciler/constants.js";
|
|
|
5730
5739
|
|
|
5731
5740
|
// lib/fiber/catalogue.ts
|
|
5732
5741
|
var catalogue = {};
|
|
5742
|
+
var internalCircuitCatalogue = {};
|
|
5733
5743
|
var extendCatalogue = (objects) => {
|
|
5734
5744
|
const altKeys = Object.fromEntries(
|
|
5735
5745
|
Object.entries(objects).map(([key, v]) => [key.toLowerCase(), v])
|
|
@@ -5737,6 +5747,13 @@ var extendCatalogue = (objects) => {
|
|
|
5737
5747
|
Object.assign(catalogue, objects);
|
|
5738
5748
|
Object.assign(catalogue, altKeys);
|
|
5739
5749
|
};
|
|
5750
|
+
var extendInternalCircuitCatalogue = (objects) => {
|
|
5751
|
+
const altKeys = Object.fromEntries(
|
|
5752
|
+
Object.entries(objects).map(([key, value]) => [key.toLowerCase(), value])
|
|
5753
|
+
);
|
|
5754
|
+
Object.assign(internalCircuitCatalogue, objects);
|
|
5755
|
+
Object.assign(internalCircuitCatalogue, altKeys);
|
|
5756
|
+
};
|
|
5740
5757
|
|
|
5741
5758
|
// lib/fiber/create-instance-from-react-element.ts
|
|
5742
5759
|
import { identity as identity3 } from "transformation-matrix";
|
|
@@ -5851,14 +5868,19 @@ function prepare(object, state) {
|
|
|
5851
5868
|
}
|
|
5852
5869
|
var hostConfig = {
|
|
5853
5870
|
supportsMutation: true,
|
|
5854
|
-
createInstance(type, props) {
|
|
5855
|
-
const target = catalogue[type];
|
|
5871
|
+
createInstance(type, props, _rootContainer, hostContext) {
|
|
5872
|
+
const target = hostContext.isInsideInternalCircuit ? internalCircuitCatalogue[type] : catalogue[type];
|
|
5856
5873
|
if (!target) {
|
|
5857
5874
|
if (Object.keys(catalogue).length === 0) {
|
|
5858
5875
|
throw new Error(
|
|
5859
5876
|
"No components registered in catalogue, did you forget to import lib/register-catalogue in your test file?"
|
|
5860
5877
|
);
|
|
5861
5878
|
}
|
|
5879
|
+
if (hostContext.isInsideInternalCircuit) {
|
|
5880
|
+
throw new Error(
|
|
5881
|
+
`Unsupported component type "${type}" inside <internalcircuit>. No schematic-only implementation is registered for this element.`
|
|
5882
|
+
);
|
|
5883
|
+
}
|
|
5862
5884
|
throw new Error(
|
|
5863
5885
|
`Unsupported component type "${type}". No element with this name is registered in the @tscircuit/core catalogue. Check for typos or see https://docs.tscircuit.com/category/built-in-elements for a list of valid components. To add your own component, see docs/CREATING_NEW_COMPONENTS.md`
|
|
5864
5886
|
);
|
|
@@ -5895,10 +5917,14 @@ var hostConfig = {
|
|
|
5895
5917
|
return false;
|
|
5896
5918
|
},
|
|
5897
5919
|
getRootHostContext() {
|
|
5898
|
-
return {};
|
|
5920
|
+
return { isInsideInternalCircuit: false };
|
|
5899
5921
|
},
|
|
5900
|
-
getChildHostContext() {
|
|
5901
|
-
return
|
|
5922
|
+
getChildHostContext(parentHostContext, type) {
|
|
5923
|
+
if (parentHostContext.isInsideInternalCircuit) return parentHostContext;
|
|
5924
|
+
if (type === "internalcircuit") {
|
|
5925
|
+
return { isInsideInternalCircuit: true };
|
|
5926
|
+
}
|
|
5927
|
+
return parentHostContext;
|
|
5902
5928
|
},
|
|
5903
5929
|
prepareForCommit() {
|
|
5904
5930
|
return null;
|
|
@@ -9978,6 +10004,8 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
9978
10004
|
Port_tryRenderGroupPcbPort(this);
|
|
9979
10005
|
return;
|
|
9980
10006
|
}
|
|
10007
|
+
const pcbMatches = matchedComponents.filter((c) => c.isPcbPrimitive);
|
|
10008
|
+
if (pcbMatches.length === 0) return;
|
|
9981
10009
|
const parentNormalComponent = this.getParentNormalComponent();
|
|
9982
10010
|
const parentWithPcbComponentId = this.parent?.pcb_component_id ? this.parent : parentNormalComponent;
|
|
9983
10011
|
if (!parentWithPcbComponentId?.pcb_component_id) {
|
|
@@ -9985,8 +10013,6 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
9985
10013
|
`${this.getString()} has no parent pcb component, cannot render pcb_port (parent: ${this.parent?.getString()}, parentNormalComponent: ${parentNormalComponent?.getString()})`
|
|
9986
10014
|
);
|
|
9987
10015
|
}
|
|
9988
|
-
const pcbMatches = matchedComponents.filter((c) => c.isPcbPrimitive);
|
|
9989
|
-
if (pcbMatches.length === 0) return;
|
|
9990
10016
|
let matchCenter = null;
|
|
9991
10017
|
if (pcbMatches.length === 1) {
|
|
9992
10018
|
matchCenter = pcbMatches[0]._getPcbCircuitJsonBounds().center;
|
|
@@ -15282,6 +15308,19 @@ var Chip = class extends NormalComponent3 {
|
|
|
15282
15308
|
if (props?.noSchematicRepresentation === true) return;
|
|
15283
15309
|
super.doInitialSchematicComponentRender();
|
|
15284
15310
|
}
|
|
15311
|
+
_getSchematicBoxDimensions() {
|
|
15312
|
+
if (this._parsedProps.schShowInternalCircuit && this._parsedProps.internalCircuit) {
|
|
15313
|
+
return null;
|
|
15314
|
+
}
|
|
15315
|
+
return super._getSchematicBoxDimensions();
|
|
15316
|
+
}
|
|
15317
|
+
doInitialReactSubtreesRender() {
|
|
15318
|
+
super.doInitialReactSubtreesRender();
|
|
15319
|
+
const internalCircuit = this._parsedProps.internalCircuit;
|
|
15320
|
+
if (this._parsedProps.schShowInternalCircuit && internalCircuit && !this.children.some((child) => child.componentName === "InternalCircuit")) {
|
|
15321
|
+
this.add(internalCircuit);
|
|
15322
|
+
}
|
|
15323
|
+
}
|
|
15285
15324
|
doInitialSourceRender() {
|
|
15286
15325
|
const { db } = this.root;
|
|
15287
15326
|
const { _parsedProps: props } = this;
|
|
@@ -22899,7 +22938,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
22899
22938
|
var package_default = {
|
|
22900
22939
|
name: "@tscircuit/core",
|
|
22901
22940
|
type: "module",
|
|
22902
|
-
version: "0.0.
|
|
22941
|
+
version: "0.0.1468",
|
|
22903
22942
|
types: "dist/index.d.ts",
|
|
22904
22943
|
main: "dist/index.js",
|
|
22905
22944
|
module: "dist/index.js",
|
|
@@ -22948,7 +22987,7 @@ var package_default = {
|
|
|
22948
22987
|
"@tscircuit/math-utils": "^0.0.36",
|
|
22949
22988
|
"@tscircuit/miniflex": "^0.0.4",
|
|
22950
22989
|
"@tscircuit/ngspice-spice-engine": "^0.0.19",
|
|
22951
|
-
"@tscircuit/props": "^0.0.
|
|
22990
|
+
"@tscircuit/props": "^0.0.586",
|
|
22952
22991
|
"@tscircuit/schematic-match-adapt": "^0.0.18",
|
|
22953
22992
|
"@tscircuit/schematic-trace-solver": "^0.0.104",
|
|
22954
22993
|
"@tscircuit/solver-utils": "^0.0.16",
|
|
@@ -22967,7 +23006,7 @@ var package_default = {
|
|
|
22967
23006
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
22968
23007
|
"circuit-json-to-gltf": "^0.0.105",
|
|
22969
23008
|
"circuit-json-to-spice": "^0.0.43",
|
|
22970
|
-
"circuit-to-svg": "^0.0.
|
|
23009
|
+
"circuit-to-svg": "^0.0.391",
|
|
22971
23010
|
concurrently: "^9.1.2",
|
|
22972
23011
|
"connectivity-map": "^1.0.0",
|
|
22973
23012
|
debug: "^4.3.6",
|
|
@@ -29520,6 +29559,17 @@ var Constraint3 = class extends PrimitiveComponent2 {
|
|
|
29520
29559
|
}
|
|
29521
29560
|
};
|
|
29522
29561
|
|
|
29562
|
+
// lib/components/primitive-components/InternalCircuit.ts
|
|
29563
|
+
import { internalCircuitProps } from "@tscircuit/props";
|
|
29564
|
+
var InternalCircuit = class extends PrimitiveComponent2 {
|
|
29565
|
+
get config() {
|
|
29566
|
+
return {
|
|
29567
|
+
componentName: "InternalCircuit",
|
|
29568
|
+
zodProps: internalCircuitProps
|
|
29569
|
+
};
|
|
29570
|
+
}
|
|
29571
|
+
};
|
|
29572
|
+
|
|
29523
29573
|
// lib/components/primitive-components/AutoroutingPhase.ts
|
|
29524
29574
|
import { autoroutingPhaseProps } from "@tscircuit/props";
|
|
29525
29575
|
var AutoroutingPhase = class extends PrimitiveComponent2 {
|
|
@@ -32540,6 +32590,22 @@ var Mosfet = class extends NormalComponent3 {
|
|
|
32540
32590
|
}
|
|
32541
32591
|
};
|
|
32542
32592
|
|
|
32593
|
+
// lib/components/normal-components/InternalCircuitMosfet.ts
|
|
32594
|
+
import { isValidElement as isValidElement3 } from "react";
|
|
32595
|
+
var InternalCircuitMosfet = class extends Mosfet {
|
|
32596
|
+
resolveFootprint() {
|
|
32597
|
+
return void 0;
|
|
32598
|
+
}
|
|
32599
|
+
doInitialPcbComponentRender() {
|
|
32600
|
+
}
|
|
32601
|
+
doInitialReactSubtreesRender() {
|
|
32602
|
+
const symbol = this.props.symbol;
|
|
32603
|
+
if (isValidElement3(symbol) && !this.children.some((child) => child.componentName === "Symbol")) {
|
|
32604
|
+
this.add(symbol);
|
|
32605
|
+
}
|
|
32606
|
+
}
|
|
32607
|
+
};
|
|
32608
|
+
|
|
32543
32609
|
// lib/components/normal-components/OpAmp.ts
|
|
32544
32610
|
import { opampProps } from "@tscircuit/props";
|
|
32545
32611
|
var OpAmp = class extends NormalComponent3 {
|
|
@@ -33895,6 +33961,9 @@ extendCatalogue({
|
|
|
33895
33961
|
Fanout: Breakout,
|
|
33896
33962
|
FanoutPoint: BreakoutPoint
|
|
33897
33963
|
});
|
|
33964
|
+
extendInternalCircuitCatalogue({
|
|
33965
|
+
Mosfet: InternalCircuitMosfet
|
|
33966
|
+
});
|
|
33898
33967
|
export {
|
|
33899
33968
|
Ammeter,
|
|
33900
33969
|
AnalogSimulation,
|
|
@@ -33934,6 +34003,8 @@ export {
|
|
|
33934
34003
|
Hole,
|
|
33935
34004
|
Inductor,
|
|
33936
34005
|
Interconnect,
|
|
34006
|
+
InternalCircuit,
|
|
34007
|
+
InternalCircuitMosfet,
|
|
33937
34008
|
IsolatedCircuit,
|
|
33938
34009
|
Jumper,
|
|
33939
34010
|
Keepout,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1469",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@tscircuit/math-utils": "^0.0.36",
|
|
51
51
|
"@tscircuit/miniflex": "^0.0.4",
|
|
52
52
|
"@tscircuit/ngspice-spice-engine": "^0.0.19",
|
|
53
|
-
"@tscircuit/props": "^0.0.
|
|
53
|
+
"@tscircuit/props": "^0.0.586",
|
|
54
54
|
"@tscircuit/schematic-match-adapt": "^0.0.18",
|
|
55
55
|
"@tscircuit/schematic-trace-solver": "^0.0.104",
|
|
56
56
|
"@tscircuit/solver-utils": "^0.0.16",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
70
70
|
"circuit-json-to-gltf": "^0.0.105",
|
|
71
71
|
"circuit-json-to-spice": "^0.0.43",
|
|
72
|
-
"circuit-to-svg": "^0.0.
|
|
72
|
+
"circuit-to-svg": "^0.0.391",
|
|
73
73
|
"concurrently": "^9.1.2",
|
|
74
74
|
"connectivity-map": "^1.0.0",
|
|
75
75
|
"debug": "^4.3.6",
|