@tscircuit/core 0.0.1016 → 0.0.1018

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
@@ -3489,6 +3489,14 @@ var SilkscreenText = class extends PrimitiveComponent2 {
3489
3489
  component: this
3490
3490
  });
3491
3491
  const fontSize = props.fontSize ?? resolvedPcbSxFontSize ?? this.getInheritedProperty("pcbStyle")?.silkscreenFontSize ?? this._footprinterFontSize ?? 1;
3492
+ const uniformPadding = props.knockoutPadding ?? 0;
3493
+ const hasKnockoutPadding = props.knockoutPadding !== void 0 || props.knockoutPaddingLeft !== void 0 || props.knockoutPaddingRight !== void 0 || props.knockoutPaddingTop !== void 0 || props.knockoutPaddingBottom !== void 0;
3494
+ const knockoutPadding = hasKnockoutPadding ? {
3495
+ left: props.knockoutPaddingLeft ?? uniformPadding,
3496
+ right: props.knockoutPaddingRight ?? uniformPadding,
3497
+ top: props.knockoutPaddingTop ?? uniformPadding,
3498
+ bottom: props.knockoutPaddingBottom ?? uniformPadding
3499
+ } : void 0;
3492
3500
  for (const layer of targetLayers) {
3493
3501
  const pcb_silkscreen_text = db.pcb_silkscreen_text.insert({
3494
3502
  anchor_alignment: props.anchorAlignment,
@@ -3503,7 +3511,9 @@ var SilkscreenText = class extends PrimitiveComponent2 {
3503
3511
  ccw_rotation: rotation4,
3504
3512
  pcb_component_id: container.pcb_component_id,
3505
3513
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
3506
- pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
3514
+ pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
3515
+ is_knockout: props.isKnockout,
3516
+ knockout_padding: knockoutPadding
3507
3517
  });
3508
3518
  this.pcb_silkscreen_text_ids.push(
3509
3519
  pcb_silkscreen_text.pcb_silkscreen_text_id
@@ -22219,8 +22229,9 @@ var VoltageProbe = class extends PrimitiveComponent2 {
22219
22229
  }
22220
22230
  };
22221
22231
 
22222
- // lib/RootCircuit.ts
22232
+ // lib/IsolatedCircuit.ts
22223
22233
  import { su as su5 } from "@tscircuit/circuit-json-util";
22234
+ import Debug14 from "debug";
22224
22235
  import { isValidElement as isValidElement2 } from "react";
22225
22236
  import { identity as identity5 } from "transformation-matrix";
22226
22237
 
@@ -22228,7 +22239,7 @@ import { identity as identity5 } from "transformation-matrix";
22228
22239
  var package_default = {
22229
22240
  name: "@tscircuit/core",
22230
22241
  type: "module",
22231
- version: "0.0.1015",
22242
+ version: "0.0.1017",
22232
22243
  types: "dist/index.d.ts",
22233
22244
  main: "dist/index.js",
22234
22245
  module: "dist/index.js",
@@ -22292,7 +22303,7 @@ var package_default = {
22292
22303
  "circuit-json-to-gltf": "^0.0.62",
22293
22304
  "circuit-json-to-simple-3d": "^0.0.9",
22294
22305
  "circuit-json-to-spice": "^0.0.33",
22295
- "circuit-to-svg": "^0.0.325",
22306
+ "circuit-to-svg": "^0.0.327",
22296
22307
  concurrently: "^9.1.2",
22297
22308
  "connectivity-map": "^1.0.0",
22298
22309
  debug: "^4.3.6",
@@ -22344,14 +22355,13 @@ var package_default = {
22344
22355
  }
22345
22356
  };
22346
22357
 
22347
- // lib/RootCircuit.ts
22348
- import Debug14 from "debug";
22349
- var RootCircuit = class {
22358
+ // lib/IsolatedCircuit.ts
22359
+ var IsolatedCircuit = class {
22350
22360
  firstChild = null;
22351
22361
  children;
22352
22362
  db;
22353
22363
  root = null;
22354
- isRoot = true;
22364
+ isRoot = false;
22355
22365
  _schematicDisabledOverride;
22356
22366
  get schematicDisabled() {
22357
22367
  if (this._schematicDisabledOverride !== void 0) {
@@ -22367,7 +22377,7 @@ var RootCircuit = class {
22367
22377
  pcbRoutingDisabled = false;
22368
22378
  _featureMspSchematicTraceRouting = true;
22369
22379
  /**
22370
- * The RootCircuit name is usually set by the platform, it's not required but
22380
+ * The IsolatedCircuit name is usually set by the platform, it's not required but
22371
22381
  * if supplied can identify the circuit in certain effects, e.g. it is passed
22372
22382
  * as the display_name parameter for autorouting effects.
22373
22383
  */
@@ -22388,7 +22398,6 @@ var RootCircuit = class {
22388
22398
  } = {}) {
22389
22399
  this.children = [];
22390
22400
  this.db = su5([]);
22391
- this.root = this;
22392
22401
  this.platform = platform;
22393
22402
  this.projectUrl = projectUrl;
22394
22403
  this.pcbDisabled = platform?.pcbDisabled ?? false;
@@ -22422,7 +22431,7 @@ var RootCircuit = class {
22422
22431
  if (this.firstChild) return;
22423
22432
  if (this.children.length === 0) {
22424
22433
  throw new Error(
22425
- "Not able to guess root component: RootCircuit has no children (use circuit.add(...))"
22434
+ "Not able to guess root component: IsolatedCircuit has no children (use circuit.add(...))"
22426
22435
  );
22427
22436
  }
22428
22437
  const panels = this.children.filter(
@@ -22453,7 +22462,7 @@ var RootCircuit = class {
22453
22462
  this._guessRootComponent();
22454
22463
  }
22455
22464
  const { firstChild, db } = this;
22456
- if (!firstChild) throw new Error("RootCircuit has no root component");
22465
+ if (!firstChild) throw new Error("IsolatedCircuit has no root component");
22457
22466
  firstChild.parent = this;
22458
22467
  firstChild.runRenderCycle();
22459
22468
  this._hasRenderedAtleastOnce = true;
@@ -22594,6 +22603,18 @@ var RootCircuit = class {
22594
22603
  this._asyncEffectPhaseById.delete(asyncEffectId);
22595
22604
  }
22596
22605
  };
22606
+
22607
+ // lib/RootCircuit.ts
22608
+ var RootCircuit = class extends IsolatedCircuit {
22609
+ isRoot = true;
22610
+ constructor({
22611
+ platform,
22612
+ projectUrl
22613
+ } = {}) {
22614
+ super({ platform, projectUrl });
22615
+ this.root = this;
22616
+ }
22617
+ };
22597
22618
  var Project = RootCircuit;
22598
22619
  var Circuit = RootCircuit;
22599
22620
 
@@ -22835,6 +22856,7 @@ export {
22835
22856
  Hole,
22836
22857
  Inductor,
22837
22858
  Interconnect,
22859
+ IsolatedCircuit,
22838
22860
  Jumper,
22839
22861
  Keepout,
22840
22862
  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.1018",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -65,7 +65,7 @@
65
65
  "circuit-json-to-gltf": "^0.0.62",
66
66
  "circuit-json-to-simple-3d": "^0.0.9",
67
67
  "circuit-json-to-spice": "^0.0.33",
68
- "circuit-to-svg": "^0.0.325",
68
+ "circuit-to-svg": "^0.0.327",
69
69
  "concurrently": "^9.1.2",
70
70
  "connectivity-map": "^1.0.0",
71
71
  "debug": "^4.3.6",