@tscircuit/core 0.0.1016 → 0.0.1017

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as circuit_json from 'circuit-json';
2
- import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, AnySourceComponent, PcbTraceRoutePoint, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
2
+ import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, Size, AnySourceComponent, LayerRef, AnyCircuitElement, PcbTraceRoutePoint, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
3
3
  import * as _tscircuit_props from '@tscircuit/props';
4
- import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, PcbSx, traceProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
4
+ import { subcircuitGroupProps, AutorouterConfig, PlatformConfig, PcbSx, traceProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
7
7
  export { createElement } from 'react';
@@ -9,10 +9,10 @@ import * as zod from 'zod';
9
9
  import { z, ZodType } from 'zod';
10
10
  import { symbols, SchSymbol, BaseSymbolName } from 'schematic-symbols';
11
11
  import { Matrix } from 'transformation-matrix';
12
- import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
13
12
  import { PackSolver2 } from 'calculate-packing';
14
13
  import { AutoroutingPipelineSolver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel } from '@tscircuit/capacity-autorouter';
15
14
  import { CopperPourPipelineSolver } from '@tscircuit/copper-pour-solver';
15
+ import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
16
16
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
17
17
  import { GraphicsObject } from 'graphics-debug';
18
18
 
@@ -162,12 +162,15 @@ interface DebugLogOutputEvent {
162
162
  content: any;
163
163
  }
164
164
 
165
- interface IRootCircuit {
165
+ interface IIsolatedCircuit {
166
166
  emit(event: RootCircuitEventName, ...args: any[]): void;
167
167
  on(event: RootCircuitEventName, listener: (...args: any[]) => void): void;
168
168
  _hasIncompleteAsyncEffectsForPhase(phase: RenderPhase): boolean;
169
169
  }
170
170
 
171
+ interface IRootCircuit extends IIsolatedCircuit {
172
+ }
173
+
171
174
  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"];
172
175
  type RenderPhase = (typeof orderedRenderPhases)[number];
173
176
  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>;
@@ -271,6 +274,80 @@ interface SchematicBoxComponentDimensions {
271
274
  schHeight: number;
272
275
  }
273
276
 
277
+ interface ISubcircuit extends PrimitiveComponent {
278
+ _shouldUseTraceByTraceRouting(): boolean;
279
+ _parsedProps: z.infer<typeof subcircuitGroupProps>;
280
+ _getAutorouterConfig(): AutorouterConfig;
281
+ _isAutoJumperAutorouter(autorouterConfig?: AutorouterConfig): boolean;
282
+ getNextAvailableName(elm: PrimitiveComponent): string;
283
+ _getSubcircuitLayerCount(): number;
284
+ subcircuit_id: string | null;
285
+ getNormalComponentNameMap?: () => Map<string, NormalComponent[]>;
286
+ _isInflatedFromCircuitJson: boolean;
287
+ }
288
+
289
+ interface SchematicSymbolBounds {
290
+ minX: number;
291
+ maxX: number;
292
+ minY: number;
293
+ maxY: number;
294
+ }
295
+ interface ISymbol {
296
+ /**
297
+ * The circuit-json schematic_symbol_id for this symbol.
298
+ * Created during SchematicPrimitiveRender phase.
299
+ */
300
+ schematic_symbol_id?: string;
301
+ /**
302
+ * The transformation matrix to convert from user coordinates (as specified
303
+ * in the symbol's children) to the final resized symbol coordinates.
304
+ * This is computed lazily when first requested.
305
+ */
306
+ userCoordinateToResizedSymbolTransformMat?: Matrix;
307
+ /**
308
+ * The computed bounds of the symbol's schematic primitives before any
309
+ * resizing is applied.
310
+ */
311
+ schematicSymbolBoundsInUserCoordinates?: SchematicSymbolBounds;
312
+ /**
313
+ * Get the bounds of the symbol's schematic primitives.
314
+ * This triggers computation if not already done.
315
+ */
316
+ getSchematicSymbolBounds(): SchematicSymbolBounds | null;
317
+ /**
318
+ * Get the transformation matrix for resizing symbol contents.
319
+ * Returns null if no resizing is needed (no width/height specified).
320
+ */
321
+ getUserCoordinateToResizedSymbolTransform(): Matrix | null;
322
+ /**
323
+ * Check if this symbol has explicit width/height that requires resizing.
324
+ */
325
+ hasExplicitSize(): boolean;
326
+ }
327
+
328
+ interface IGroup extends PrimitiveComponent {
329
+ source_group_id: string | null;
330
+ pcb_group_id: string | null;
331
+ _getSchematicLayoutMode(): "match-adapt" | "flex" | "grid" | "relative";
332
+ _getMinimumFlexContainerSize(): Size | null;
333
+ _repositionOnPcb(position: {
334
+ x: number;
335
+ y: number;
336
+ }): void;
337
+ _repositionOnSchematic(position: {
338
+ x: number;
339
+ y: number;
340
+ }): void;
341
+ }
342
+
343
+ type Ftype = Extract<AnySourceComponent, {
344
+ ftype: string;
345
+ }>["ftype"];
346
+ type TwoPinPorts = "pin1" | "pin2";
347
+ type PassivePorts = TwoPinPorts;
348
+ type PolarizedPassivePorts = PassivePorts | "anode" | "cathode" | "pos" | "neg";
349
+ type TransistorPorts = "pin1" | "pin2" | "pin3" | "emitter" | "collector" | "base";
350
+
274
351
  interface BoardI {
275
352
  componentName: string;
276
353
  boardThickness: number;
@@ -280,13 +357,11 @@ interface BoardI {
280
357
  pcb_board_id?: string | null;
281
358
  }
282
359
 
283
- declare function resolveStaticFileImport(path: string, platform?: PlatformConfig): Promise<string>;
284
-
285
- declare class RootCircuit {
360
+ declare class IsolatedCircuit {
286
361
  firstChild: PrimitiveComponent | null;
287
362
  children: PrimitiveComponent[];
288
363
  db: CircuitJsonUtilObjects;
289
- root: RootCircuit | null;
364
+ root: IsolatedCircuit | null;
290
365
  isRoot: boolean;
291
366
  private _schematicDisabledOverride;
292
367
  get schematicDisabled(): boolean;
@@ -295,7 +370,7 @@ declare class RootCircuit {
295
370
  pcbRoutingDisabled: boolean;
296
371
  _featureMspSchematicTraceRouting: boolean;
297
372
  /**
298
- * The RootCircuit name is usually set by the platform, it's not required but
373
+ * The IsolatedCircuit name is usually set by the platform, it's not required but
299
374
  * if supplied can identify the circuit in certain effects, e.g. it is passed
300
375
  * as the display_name parameter for autorouting effects.
301
376
  */
@@ -351,90 +426,6 @@ declare class RootCircuit {
351
426
  private _registerAsyncEffectStart;
352
427
  private _registerAsyncEffectEnd;
353
428
  }
354
- /**
355
- * @deprecated
356
- */
357
- declare const Project: typeof RootCircuit;
358
- /**
359
- * We currently don't make a distinction between RootCircuit and Circuit, but
360
- * we may in the future allow subcircuits to be created as new Circuit then
361
- * incorporated into a larger RootCircuit
362
- */
363
- declare const Circuit: typeof RootCircuit;
364
-
365
- interface ISubcircuit extends PrimitiveComponent {
366
- _shouldUseTraceByTraceRouting(): boolean;
367
- _parsedProps: z.infer<typeof subcircuitGroupProps>;
368
- _getAutorouterConfig(): AutorouterConfig;
369
- _isAutoJumperAutorouter(autorouterConfig?: AutorouterConfig): boolean;
370
- getNextAvailableName(elm: PrimitiveComponent): string;
371
- _getSubcircuitLayerCount(): number;
372
- subcircuit_id: string | null;
373
- getNormalComponentNameMap?: () => Map<string, NormalComponent[]>;
374
- _isInflatedFromCircuitJson: boolean;
375
- }
376
-
377
- interface SchematicSymbolBounds {
378
- minX: number;
379
- maxX: number;
380
- minY: number;
381
- maxY: number;
382
- }
383
- interface ISymbol {
384
- /**
385
- * The circuit-json schematic_symbol_id for this symbol.
386
- * Created during SchematicPrimitiveRender phase.
387
- */
388
- schematic_symbol_id?: string;
389
- /**
390
- * The transformation matrix to convert from user coordinates (as specified
391
- * in the symbol's children) to the final resized symbol coordinates.
392
- * This is computed lazily when first requested.
393
- */
394
- userCoordinateToResizedSymbolTransformMat?: Matrix;
395
- /**
396
- * The computed bounds of the symbol's schematic primitives before any
397
- * resizing is applied.
398
- */
399
- schematicSymbolBoundsInUserCoordinates?: SchematicSymbolBounds;
400
- /**
401
- * Get the bounds of the symbol's schematic primitives.
402
- * This triggers computation if not already done.
403
- */
404
- getSchematicSymbolBounds(): SchematicSymbolBounds | null;
405
- /**
406
- * Get the transformation matrix for resizing symbol contents.
407
- * Returns null if no resizing is needed (no width/height specified).
408
- */
409
- getUserCoordinateToResizedSymbolTransform(): Matrix | null;
410
- /**
411
- * Check if this symbol has explicit width/height that requires resizing.
412
- */
413
- hasExplicitSize(): boolean;
414
- }
415
-
416
- interface IGroup extends PrimitiveComponent {
417
- source_group_id: string | null;
418
- pcb_group_id: string | null;
419
- _getSchematicLayoutMode(): "match-adapt" | "flex" | "grid" | "relative";
420
- _getMinimumFlexContainerSize(): Size | null;
421
- _repositionOnPcb(position: {
422
- x: number;
423
- y: number;
424
- }): void;
425
- _repositionOnSchematic(position: {
426
- x: number;
427
- y: number;
428
- }): void;
429
- }
430
-
431
- type Ftype = Extract<AnySourceComponent, {
432
- ftype: string;
433
- }>["ftype"];
434
- type TwoPinPorts = "pin1" | "pin2";
435
- type PassivePorts = TwoPinPorts;
436
- type PolarizedPassivePorts = PassivePorts | "anode" | "cathode" | "pos" | "neg";
437
- type TransistorPorts = "pin1" | "pin2" | "pin3" | "emitter" | "collector" | "base";
438
429
 
439
430
  interface BaseComponentConfig {
440
431
  componentName: string;
@@ -603,7 +594,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
603
594
  y: number;
604
595
  };
605
596
  _getBoard(): (PrimitiveComponent & BoardI) | undefined;
606
- get root(): RootCircuit | null;
597
+ get root(): IsolatedCircuit | null;
607
598
  onAddToParent(parent: PrimitiveComponent): void;
608
599
  /**
609
600
  * Called whenever the props change
@@ -1778,7 +1769,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
1778
1769
  interface SubcircuitI {
1779
1770
  subcircuit_id: string | null;
1780
1771
  add(component: PrimitiveComponent): void;
1781
- root: RootCircuit | null;
1772
+ root: IsolatedCircuit | null;
1782
1773
  getGroup(): IGroup | null;
1783
1774
  source_group_id: string | null;
1784
1775
  }
@@ -130544,6 +130535,26 @@ declare class VoltageProbe extends PrimitiveComponent<typeof voltageProbeProps>
130544
130535
  doInitialSchematicReplaceNetLabelsWithSymbols(): void;
130545
130536
  }
130546
130537
 
130538
+ declare function resolveStaticFileImport(path: string, platform?: PlatformConfig): Promise<string>;
130539
+
130540
+ declare class RootCircuit extends IsolatedCircuit {
130541
+ isRoot: boolean;
130542
+ constructor({ platform, projectUrl, }?: {
130543
+ platform?: PlatformConfig;
130544
+ projectUrl?: string;
130545
+ });
130546
+ }
130547
+ /**
130548
+ * @deprecated
130549
+ */
130550
+ declare const Project: typeof RootCircuit;
130551
+ /**
130552
+ * We currently don't make a distinction between RootCircuit and Circuit, but
130553
+ * we may in the future allow subcircuits to be created as new Circuit then
130554
+ * incorporated into a larger RootCircuit
130555
+ */
130556
+ declare const Circuit: typeof RootCircuit;
130557
+
130547
130558
  declare const useRenderedCircuit: (reactElements: react__default.ReactElement) => {
130548
130559
  isLoading: boolean;
130549
130560
  error?: Error | null;
@@ -131859,4 +131870,4 @@ declare module "react/jsx-runtime" {
131859
131870
  }
131860
131871
  }
131861
131872
 
131862
- export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, 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, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, 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, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
131873
+ export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, 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, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, 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, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -22219,8 +22219,9 @@ var VoltageProbe = class extends PrimitiveComponent2 {
22219
22219
  }
22220
22220
  };
22221
22221
 
22222
- // lib/RootCircuit.ts
22222
+ // lib/IsolatedCircuit.ts
22223
22223
  import { su as su5 } from "@tscircuit/circuit-json-util";
22224
+ import Debug14 from "debug";
22224
22225
  import { isValidElement as isValidElement2 } from "react";
22225
22226
  import { identity as identity5 } from "transformation-matrix";
22226
22227
 
@@ -22228,7 +22229,7 @@ import { identity as identity5 } from "transformation-matrix";
22228
22229
  var package_default = {
22229
22230
  name: "@tscircuit/core",
22230
22231
  type: "module",
22231
- version: "0.0.1015",
22232
+ version: "0.0.1016",
22232
22233
  types: "dist/index.d.ts",
22233
22234
  main: "dist/index.js",
22234
22235
  module: "dist/index.js",
@@ -22344,14 +22345,13 @@ var package_default = {
22344
22345
  }
22345
22346
  };
22346
22347
 
22347
- // lib/RootCircuit.ts
22348
- import Debug14 from "debug";
22349
- var RootCircuit = class {
22348
+ // lib/IsolatedCircuit.ts
22349
+ var IsolatedCircuit = class {
22350
22350
  firstChild = null;
22351
22351
  children;
22352
22352
  db;
22353
22353
  root = null;
22354
- isRoot = true;
22354
+ isRoot = false;
22355
22355
  _schematicDisabledOverride;
22356
22356
  get schematicDisabled() {
22357
22357
  if (this._schematicDisabledOverride !== void 0) {
@@ -22367,7 +22367,7 @@ var RootCircuit = class {
22367
22367
  pcbRoutingDisabled = false;
22368
22368
  _featureMspSchematicTraceRouting = true;
22369
22369
  /**
22370
- * The RootCircuit name is usually set by the platform, it's not required but
22370
+ * The IsolatedCircuit name is usually set by the platform, it's not required but
22371
22371
  * if supplied can identify the circuit in certain effects, e.g. it is passed
22372
22372
  * as the display_name parameter for autorouting effects.
22373
22373
  */
@@ -22388,7 +22388,6 @@ var RootCircuit = class {
22388
22388
  } = {}) {
22389
22389
  this.children = [];
22390
22390
  this.db = su5([]);
22391
- this.root = this;
22392
22391
  this.platform = platform;
22393
22392
  this.projectUrl = projectUrl;
22394
22393
  this.pcbDisabled = platform?.pcbDisabled ?? false;
@@ -22422,7 +22421,7 @@ var RootCircuit = class {
22422
22421
  if (this.firstChild) return;
22423
22422
  if (this.children.length === 0) {
22424
22423
  throw new Error(
22425
- "Not able to guess root component: RootCircuit has no children (use circuit.add(...))"
22424
+ "Not able to guess root component: IsolatedCircuit has no children (use circuit.add(...))"
22426
22425
  );
22427
22426
  }
22428
22427
  const panels = this.children.filter(
@@ -22453,7 +22452,7 @@ var RootCircuit = class {
22453
22452
  this._guessRootComponent();
22454
22453
  }
22455
22454
  const { firstChild, db } = this;
22456
- if (!firstChild) throw new Error("RootCircuit has no root component");
22455
+ if (!firstChild) throw new Error("IsolatedCircuit has no root component");
22457
22456
  firstChild.parent = this;
22458
22457
  firstChild.runRenderCycle();
22459
22458
  this._hasRenderedAtleastOnce = true;
@@ -22594,6 +22593,18 @@ var RootCircuit = class {
22594
22593
  this._asyncEffectPhaseById.delete(asyncEffectId);
22595
22594
  }
22596
22595
  };
22596
+
22597
+ // lib/RootCircuit.ts
22598
+ var RootCircuit = class extends IsolatedCircuit {
22599
+ isRoot = true;
22600
+ constructor({
22601
+ platform,
22602
+ projectUrl
22603
+ } = {}) {
22604
+ super({ platform, projectUrl });
22605
+ this.root = this;
22606
+ }
22607
+ };
22597
22608
  var Project = RootCircuit;
22598
22609
  var Circuit = RootCircuit;
22599
22610
 
@@ -22835,6 +22846,7 @@ export {
22835
22846
  Hole,
22836
22847
  Inductor,
22837
22848
  Interconnect,
22849
+ IsolatedCircuit,
22838
22850
  Jumper,
22839
22851
  Keepout,
22840
22852
  Led,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1016",
4
+ "version": "0.0.1017",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",