@tscircuit/core 0.0.1364 → 0.0.1365

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
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, 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, schematicSectionProps, 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, 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, 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, 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';
@@ -238,9 +238,9 @@ interface IIsolatedCircuit {
238
238
  interface IRootCircuit extends IIsolatedCircuit {
239
239
  }
240
240
 
241
- declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "RenderIsolatedSubcircuits", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "FetchPartFootprint", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "CreateAutoplacedBreakoutPoints", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceComponentPropertyValidation", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SymbolContainerRender", "SchematicPrimitiveRender", "SchematicSymbolResize", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicSectionRender", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PanelBoardLayout", "ValidatePcbCoordinates", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbCalcPlacementResolution", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbAutoplaceBreakoutPoints", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SupplierFootprintMismatchWarning", "SimulationSpiceEngineRender"];
241
+ declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "RenderIsolatedSubcircuits", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "FetchPartFootprint", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "CreateAutoplacedBreakoutPoints", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceComponentPropertyValidation", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SymbolContainerRender", "SchematicPrimitiveRender", "SchematicSymbolResize", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicSectionRender", "SchematicTraceRender", "SchematicSheetRender", "SchematicReplaceNetLabelsWithSymbols", "PanelBoardLayout", "ValidatePcbCoordinates", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbCalcPlacementResolution", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbAutoplaceBreakoutPoints", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SupplierFootprintMismatchWarning", "SimulationSpiceEngineRender"];
242
242
  type RenderPhase = (typeof orderedRenderPhases)[number];
243
- declare const renderPhaseIndexMap: Map<"ReactSubtreesRender" | "RenderIsolatedSubcircuits" | "InflateSubcircuitCircuitJson" | "SourceNameDuplicateComponentRemoval" | "PcbFootprintStringRender" | "FetchPartFootprint" | "InitializePortsFromChildren" | "CreateNetsFromProps" | "AssignFallbackProps" | "CreateTracesFromProps" | "CreateTracesFromNetLabels" | "CreateTraceHintsFromProps" | "CreateAutoplacedBreakoutPoints" | "SourceGroupRender" | "AssignNameToUnnamedComponents" | "SourceRender" | "SourceComponentPropertyValidation" | "SourceParentAttachment" | "PortMatching" | "OptimizeSelectorCache" | "SourceTraceRender" | "SourceAddConnectivityMapKey" | "SourceDesignRuleChecks" | "SimulationRender" | "SchematicComponentRender" | "SchematicPortRender" | "SymbolContainerRender" | "SchematicPrimitiveRender" | "SchematicSymbolResize" | "SchematicComponentSizeCalculation" | "SchematicLayout" | "SchematicSectionRender" | "SchematicTraceRender" | "SchematicReplaceNetLabelsWithSymbols" | "PanelBoardLayout" | "ValidatePcbCoordinates" | "PcbComponentRender" | "PcbPrimitiveRender" | "PcbFootprintLayout" | "PcbPortRender" | "PcbPortAttachment" | "PcbComponentSizeCalculation" | "PcbComponentAnchorAlignment" | "PcbCalcPlacementResolution" | "PcbLayout" | "PcbBoardAutoSize" | "PanelLayout" | "PcbAutoplaceBreakoutPoints" | "PcbTraceHintRender" | "PcbManualTraceRender" | "PcbTraceRender" | "PcbRouteNetIslands" | "PcbCopperPourRender" | "PcbDesignRuleChecks" | "SilkscreenOverlapAdjustment" | "CadModelRender" | "PartsEngineRender" | "SupplierFootprintMismatchWarning" | "SimulationSpiceEngineRender", number>;
243
+ declare const renderPhaseIndexMap: Map<"ReactSubtreesRender" | "RenderIsolatedSubcircuits" | "InflateSubcircuitCircuitJson" | "SourceNameDuplicateComponentRemoval" | "PcbFootprintStringRender" | "FetchPartFootprint" | "InitializePortsFromChildren" | "CreateNetsFromProps" | "AssignFallbackProps" | "CreateTracesFromProps" | "CreateTracesFromNetLabels" | "CreateTraceHintsFromProps" | "CreateAutoplacedBreakoutPoints" | "SourceGroupRender" | "AssignNameToUnnamedComponents" | "SourceRender" | "SourceComponentPropertyValidation" | "SourceParentAttachment" | "PortMatching" | "OptimizeSelectorCache" | "SourceTraceRender" | "SourceAddConnectivityMapKey" | "SourceDesignRuleChecks" | "SimulationRender" | "SchematicComponentRender" | "SchematicPortRender" | "SymbolContainerRender" | "SchematicPrimitiveRender" | "SchematicSymbolResize" | "SchematicComponentSizeCalculation" | "SchematicLayout" | "SchematicSectionRender" | "SchematicTraceRender" | "SchematicSheetRender" | "SchematicReplaceNetLabelsWithSymbols" | "PanelBoardLayout" | "ValidatePcbCoordinates" | "PcbComponentRender" | "PcbPrimitiveRender" | "PcbFootprintLayout" | "PcbPortRender" | "PcbPortAttachment" | "PcbComponentSizeCalculation" | "PcbComponentAnchorAlignment" | "PcbCalcPlacementResolution" | "PcbLayout" | "PcbBoardAutoSize" | "PanelLayout" | "PcbAutoplaceBreakoutPoints" | "PcbTraceHintRender" | "PcbManualTraceRender" | "PcbTraceRender" | "PcbRouteNetIslands" | "PcbCopperPourRender" | "PcbDesignRuleChecks" | "SilkscreenOverlapAdjustment" | "CadModelRender" | "PartsEngineRender" | "SupplierFootprintMismatchWarning" | "SimulationSpiceEngineRender", number>;
244
244
  type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
245
245
  type RenderPhaseStates = Record<RenderPhase, {
246
246
  initialized: boolean;
@@ -1548,6 +1548,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
1548
1548
  source_group_id: string | null;
1549
1549
  source_component_id: string | null;
1550
1550
  schematic_component_id: string | null;
1551
+ schematic_sheet_id?: string | null;
1551
1552
  pcb_component_id: string | null;
1552
1553
  cad_component_id: string | null;
1553
1554
  _reportedInvalidPcbCalcWarnings: Set<string>;
@@ -1732,6 +1733,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
1732
1733
  doesSelectorMatch(selector: string): boolean;
1733
1734
  getSubcircuit(): ISubcircuit;
1734
1735
  getGroup(): IGroup | null;
1736
+ _resolveSchematicSheetId(): string | undefined;
1735
1737
  doInitialAssignNameToUnnamedComponents(): void;
1736
1738
  doInitialOptimizeSelectorCache(): void;
1737
1739
  /**
@@ -2901,6 +2903,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
2901
2903
  name: zod.ZodOptional<zod.ZodString>;
2902
2904
  children: zod.ZodOptional<zod.ZodAny>;
2903
2905
  schTitle: zod.ZodOptional<zod.ZodString>;
2906
+ schSheetName: zod.ZodOptional<zod.ZodString>;
2904
2907
  key: zod.ZodOptional<zod.ZodAny>;
2905
2908
  showAsSchematicBox: zod.ZodOptional<zod.ZodBoolean>;
2906
2909
  connections: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
@@ -3348,6 +3351,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
3348
3351
  } | undefined;
3349
3352
  schRelative?: boolean | undefined;
3350
3353
  children?: any;
3354
+ schSheetName?: string | undefined;
3351
3355
  grid?: boolean | undefined;
3352
3356
  flex?: string | boolean | undefined;
3353
3357
  layoutMode?: "none" | "relative" | "grid" | "flex" | "match-adapt" | undefined;
@@ -3683,6 +3687,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
3683
3687
  } | undefined;
3684
3688
  schRelative?: boolean | undefined;
3685
3689
  children?: any;
3690
+ schSheetName?: string | undefined;
3686
3691
  grid?: boolean | undefined;
3687
3692
  flex?: string | boolean | undefined;
3688
3693
  layoutMode?: "none" | "relative" | "grid" | "flex" | "match-adapt" | undefined;
@@ -4444,6 +4449,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
4444
4449
  name: zod.ZodOptional<zod.ZodString>;
4445
4450
  children: zod.ZodOptional<zod.ZodAny>;
4446
4451
  schTitle: zod.ZodOptional<zod.ZodString>;
4452
+ schSheetName: zod.ZodOptional<zod.ZodString>;
4447
4453
  key: zod.ZodOptional<zod.ZodAny>;
4448
4454
  showAsSchematicBox: zod.ZodOptional<zod.ZodBoolean>;
4449
4455
  connections: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
@@ -5006,6 +5012,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
5006
5012
  schRelative?: boolean | undefined;
5007
5013
  children?: any;
5008
5014
  manufacturerPartNumber?: string | undefined;
5015
+ schSheetName?: string | undefined;
5009
5016
  grid?: boolean | undefined;
5010
5017
  flex?: string | boolean | undefined;
5011
5018
  layoutMode?: "none" | "relative" | "grid" | "flex" | "match-adapt" | undefined;
@@ -5364,6 +5371,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
5364
5371
  schRelative?: boolean | undefined;
5365
5372
  children?: any;
5366
5373
  manufacturerPartNumber?: string | undefined;
5374
+ schSheetName?: string | undefined;
5367
5375
  grid?: boolean | undefined;
5368
5376
  flex?: string | boolean | undefined;
5369
5377
  layoutMode?: "none" | "relative" | "grid" | "flex" | "match-adapt" | undefined;
@@ -6100,6 +6108,7 @@ declare class Subpanel extends Group<typeof subpanelProps> {
6100
6108
  name: zod.ZodOptional<zod.ZodString>;
6101
6109
  children: zod.ZodOptional<zod.ZodAny>;
6102
6110
  schTitle: zod.ZodOptional<zod.ZodString>;
6111
+ schSheetName: zod.ZodOptional<zod.ZodString>;
6103
6112
  key: zod.ZodOptional<zod.ZodAny>;
6104
6113
  showAsSchematicBox: zod.ZodOptional<zod.ZodBoolean>;
6105
6114
  connections: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
@@ -6330,6 +6339,7 @@ declare class Subpanel extends Group<typeof subpanelProps> {
6330
6339
  } | undefined;
6331
6340
  schRelative?: boolean | undefined;
6332
6341
  children?: any;
6342
+ schSheetName?: string | undefined;
6333
6343
  grid?: boolean | undefined;
6334
6344
  flex?: string | boolean | undefined;
6335
6345
  layoutMode?: "none" | "grid" | "pack" | undefined;
@@ -6606,6 +6616,7 @@ declare class Subpanel extends Group<typeof subpanelProps> {
6606
6616
  } | undefined;
6607
6617
  schRelative?: boolean | undefined;
6608
6618
  children?: any;
6619
+ schSheetName?: string | undefined;
6609
6620
  grid?: boolean | undefined;
6610
6621
  flex?: string | boolean | undefined;
6611
6622
  layoutMode?: "none" | "grid" | "pack" | undefined;
@@ -7301,6 +7312,7 @@ declare class Panel extends Subpanel {
7301
7312
  name: zod.ZodOptional<zod.ZodString>;
7302
7313
  children: zod.ZodOptional<zod.ZodAny>;
7303
7314
  schTitle: zod.ZodOptional<zod.ZodString>;
7315
+ schSheetName: zod.ZodOptional<zod.ZodString>;
7304
7316
  key: zod.ZodOptional<zod.ZodAny>;
7305
7317
  showAsSchematicBox: zod.ZodOptional<zod.ZodBoolean>;
7306
7318
  connections: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
@@ -7531,6 +7543,7 @@ declare class Panel extends Subpanel {
7531
7543
  } | undefined;
7532
7544
  schRelative?: boolean | undefined;
7533
7545
  children?: any;
7546
+ schSheetName?: string | undefined;
7534
7547
  grid?: boolean | undefined;
7535
7548
  flex?: string | boolean | undefined;
7536
7549
  layoutMode?: "none" | "grid" | "pack" | undefined;
@@ -7807,6 +7820,7 @@ declare class Panel extends Subpanel {
7807
7820
  } | undefined;
7808
7821
  schRelative?: boolean | undefined;
7809
7822
  children?: any;
7823
+ schSheetName?: string | undefined;
7810
7824
  grid?: boolean | undefined;
7811
7825
  flex?: string | boolean | undefined;
7812
7826
  layoutMode?: "none" | "grid" | "pack" | undefined;
@@ -152797,6 +152811,31 @@ declare class SchematicSection extends PrimitiveComponent<typeof schematicSectio
152797
152811
  doInitialSchematicSectionRender(): void;
152798
152812
  }
152799
152813
 
152814
+ declare class SchematicSheet extends PrimitiveComponent<typeof schematicSheetProps> {
152815
+ isSchematicPrimitive: boolean;
152816
+ get config(): {
152817
+ componentName: string;
152818
+ zodProps: zod.ZodObject<{
152819
+ name: zod.ZodString;
152820
+ displayName: zod.ZodString;
152821
+ sheetIndex: zod.ZodOptional<zod.ZodNumber>;
152822
+ children: zod.ZodOptional<zod.ZodAny>;
152823
+ }, "strip", zod.ZodTypeAny, {
152824
+ name: string;
152825
+ displayName: string;
152826
+ children?: any;
152827
+ sheetIndex?: number | undefined;
152828
+ }, {
152829
+ name: string;
152830
+ displayName: string;
152831
+ children?: any;
152832
+ sheetIndex?: number | undefined;
152833
+ }>;
152834
+ };
152835
+ doInitialSourceGroupRender(): void;
152836
+ doInitialSchematicSheetRender(): void;
152837
+ }
152838
+
152800
152839
  declare class SchematicTable extends PrimitiveComponent<typeof schematicTableProps> {
152801
152840
  isSchematicPrimitive: boolean;
152802
152841
  schematic_table_id: string | null;
@@ -158980,6 +159019,7 @@ interface TscircuitElements {
158980
159019
  pinout: _tscircuit_props.PinoutProps;
158981
159020
  powersource: _tscircuit_props.PowerSourceProps;
158982
159021
  schematicsection: _tscircuit_props.SchematicSectionProps;
159022
+ schematicsheet: _tscircuit_props.SchematicSheetProps;
158983
159023
  via: _tscircuit_props.ViaProps;
158984
159024
  schematicbox: _tscircuit_props.SchematicBoxProps;
158985
159025
  schematicline: _tscircuit_props.SchematicLineProps;
@@ -159075,4 +159115,4 @@ declare module "react/jsx-runtime" {
159075
159115
  }
159076
159116
  }
159077
159117
 
159078
- 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, 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, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenGraphic, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, SpiceModel, 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 };
159118
+ 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, 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 SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, SpiceModel, 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
@@ -80,6 +80,7 @@ __export(components_exports, {
80
80
  SchematicRect: () => SchematicRect,
81
81
  SchematicRow: () => SchematicRow,
82
82
  SchematicSection: () => SchematicSection,
83
+ SchematicSheet: () => SchematicSheet,
83
84
  SchematicTable: () => SchematicTable,
84
85
  SchematicText: () => SchematicText,
85
86
  SilkscreenCircle: () => SilkscreenCircle,
@@ -353,6 +354,7 @@ var orderedRenderPhases = [
353
354
  "SchematicLayout",
354
355
  "SchematicSectionRender",
355
356
  "SchematicTraceRender",
357
+ "SchematicSheetRender",
356
358
  "SchematicReplaceNetLabelsWithSymbols",
357
359
  "PanelBoardLayout",
358
360
  "ValidatePcbCoordinates",
@@ -397,6 +399,7 @@ var asyncPhaseDependencies = {
397
399
  SchematicLayout: ["PcbFootprintStringRender", "FetchPartFootprint"],
398
400
  SchematicSectionRender: ["PcbFootprintStringRender", "FetchPartFootprint"],
399
401
  SchematicTraceRender: ["PcbFootprintStringRender", "FetchPartFootprint"],
402
+ SchematicSheetRender: ["PcbFootprintStringRender", "FetchPartFootprint"],
400
403
  SchematicReplaceNetLabelsWithSymbols: [
401
404
  "PcbFootprintStringRender",
402
405
  "FetchPartFootprint"
@@ -1319,6 +1322,7 @@ var PrimitiveComponent2 = class extends Renderable {
1319
1322
  source_group_id = null;
1320
1323
  source_component_id = null;
1321
1324
  schematic_component_id = null;
1325
+ schematic_sheet_id = null;
1322
1326
  pcb_component_id = null;
1323
1327
  cad_component_id = null;
1324
1328
  _reportedInvalidPcbCalcWarnings = /* @__PURE__ */ new Set();
@@ -2000,6 +2004,17 @@ var PrimitiveComponent2 = class extends Renderable {
2000
2004
  if (this.isGroup) return this;
2001
2005
  return this.parent?.getGroup?.() ?? null;
2002
2006
  }
2007
+ _resolveSchematicSheetId() {
2008
+ const schSheetName = this._parsedProps?.schSheetName ?? this.props.schSheetName;
2009
+ if (schSheetName) {
2010
+ const matchingSheet = this.root?.db.schematic_sheet.list().find(
2011
+ (sheet) => sheet.name === schSheetName || sheet.schematic_sheet_id === schSheetName
2012
+ );
2013
+ if (matchingSheet) return matchingSheet.schematic_sheet_id;
2014
+ }
2015
+ if (this.schematic_sheet_id) return this.schematic_sheet_id;
2016
+ return this.parent?._resolveSchematicSheetId?.();
2017
+ }
2003
2018
  doInitialAssignNameToUnnamedComponents() {
2004
2019
  if (!this._parsedProps.name) {
2005
2020
  this.fallbackUnassignedName = this.getSubcircuit().getNextAvailableName(this);
@@ -3808,7 +3823,8 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
3808
3823
  source_trace_id: trace.source_trace_id,
3809
3824
  edges: edges2,
3810
3825
  junctions: junctions2,
3811
- subcircuit_connectivity_map_key: trace.subcircuit_connectivity_map_key ?? void 0
3826
+ subcircuit_connectivity_map_key: trace.subcircuit_connectivity_map_key ?? void 0,
3827
+ schematic_sheet_id: trace._resolveSchematicSheetId()
3812
3828
  });
3813
3829
  trace.schematic_trace_id = dbTrace2.schematic_trace_id;
3814
3830
  return;
@@ -3824,7 +3840,8 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
3824
3840
  anchor_side: side2,
3825
3841
  text: schematicNetLabelText
3826
3842
  }),
3827
- anchor_side: side2
3843
+ anchor_side: side2,
3844
+ schematic_sheet_id: trace._resolveSchematicSheetId()
3828
3845
  });
3829
3846
  return;
3830
3847
  }
@@ -3838,7 +3855,8 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
3838
3855
  anchor_side: side,
3839
3856
  text: net._parsedProps.name
3840
3857
  }),
3841
- anchor_side: side
3858
+ anchor_side: side,
3859
+ schematic_sheet_id: trace._resolveSchematicSheetId()
3842
3860
  });
3843
3861
  return;
3844
3862
  }
@@ -4042,7 +4060,8 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
4042
4060
  source_trace_id: trace.source_trace_id,
4043
4061
  edges,
4044
4062
  junctions,
4045
- subcircuit_connectivity_map_key: trace.subcircuit_connectivity_map_key ?? void 0
4063
+ subcircuit_connectivity_map_key: trace.subcircuit_connectivity_map_key ?? void 0,
4064
+ schematic_sheet_id: trace._resolveSchematicSheetId()
4046
4065
  });
4047
4066
  trace.schematic_trace_id = dbTrace.schematic_trace_id;
4048
4067
  for (const { port } of connectedPorts) {
@@ -5164,7 +5183,8 @@ function Trace__doInitialSchematicTraceRenderWithDisplayLabel(trace) {
5164
5183
  anchor_side: toSide,
5165
5184
  text: netLabelText
5166
5185
  }),
5167
- anchor_side: toSide
5186
+ anchor_side: toSide,
5187
+ schematic_sheet_id: trace._resolveSchematicSheetId()
5168
5188
  });
5169
5189
  }
5170
5190
  if (!existingFromNetLabel) {
@@ -5178,7 +5198,8 @@ function Trace__doInitialSchematicTraceRenderWithDisplayLabel(trace) {
5178
5198
  anchor_side: fromSide,
5179
5199
  text: netLabelText
5180
5200
  }),
5181
- anchor_side: fromSide
5201
+ anchor_side: fromSide,
5202
+ schematic_sheet_id: trace._resolveSchematicSheetId()
5182
5203
  });
5183
5204
  }
5184
5205
  }
@@ -7869,7 +7890,8 @@ var SchematicArc = class extends PrimitiveComponent2 {
7869
7890
  stroke_width: props.strokeWidth ?? SCHEMATIC_COMPONENT_OUTLINE_STROKE_WIDTH,
7870
7891
  color: props.color ?? SCHEMATIC_COMPONENT_OUTLINE_COLOR,
7871
7892
  is_dashed: props.isDashed,
7872
- subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
7893
+ subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
7894
+ schematic_sheet_id: this._resolveSchematicSheetId()
7873
7895
  });
7874
7896
  this.schematic_arc_id = schematic_arc.schematic_arc_id;
7875
7897
  }
@@ -7928,7 +7950,8 @@ var SchematicCircle = class extends PrimitiveComponent2 {
7928
7950
  is_filled: props.isFilled,
7929
7951
  fill_color: props.fillColor,
7930
7952
  is_dashed: props.isDashed,
7931
- subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
7953
+ subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
7954
+ schematic_sheet_id: this._resolveSchematicSheetId()
7932
7955
  });
7933
7956
  this.schematic_circle_id = schematic_circle.schematic_circle_id;
7934
7957
  }
@@ -7986,7 +8009,8 @@ var SchematicLine = class extends PrimitiveComponent2 {
7986
8009
  is_dashed: props.isDashed || props.dashLength !== void 0 || props.dashGap !== void 0,
7987
8010
  dash_length: props.dashLength,
7988
8011
  dash_gap: props.dashGap,
7989
- subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
8012
+ subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
8013
+ schematic_sheet_id: this._resolveSchematicSheetId()
7990
8014
  });
7991
8015
  this.schematic_line_id = schematic_line.schematic_line_id;
7992
8016
  }
@@ -8179,7 +8203,8 @@ var SchematicPath = class extends PrimitiveComponent2 {
8179
8203
  stroke_width: props.strokeWidth,
8180
8204
  dash_length: props.dashLength,
8181
8205
  dash_gap: props.dashGap,
8182
- subcircuit_id
8206
+ subcircuit_id,
8207
+ schematic_sheet_id: this._resolveSchematicSheetId()
8183
8208
  });
8184
8209
  this.schematic_path_ids.push(schematic_path.schematic_path_id);
8185
8210
  }
@@ -8198,7 +8223,8 @@ var SchematicPath = class extends PrimitiveComponent2 {
8198
8223
  stroke_width: props.strokeWidth,
8199
8224
  dash_length: props.dashLength,
8200
8225
  dash_gap: props.dashGap,
8201
- subcircuit_id
8226
+ subcircuit_id,
8227
+ schematic_sheet_id: this._resolveSchematicSheetId()
8202
8228
  });
8203
8229
  this.schematic_path_ids.push(schematic_path.schematic_path_id);
8204
8230
  }
@@ -8258,7 +8284,8 @@ var SchematicRect = class extends PrimitiveComponent2 {
8258
8284
  schematic_component_id,
8259
8285
  is_dashed: props.isDashed,
8260
8286
  rotation: props.rotation ?? 0,
8261
- subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
8287
+ subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
8288
+ schematic_sheet_id: this._resolveSchematicSheetId()
8262
8289
  });
8263
8290
  this.schematic_rect_id = schematic_rect.schematic_rect_id;
8264
8291
  }
@@ -8323,7 +8350,8 @@ var SchematicText = class extends PrimitiveComponent2 {
8323
8350
  x: globalPos.x,
8324
8351
  y: globalPos.y
8325
8352
  },
8326
- rotation: props.schRotation ?? 0
8353
+ rotation: props.schRotation ?? 0,
8354
+ schematic_sheet_id: this._resolveSchematicSheetId()
8327
8355
  });
8328
8356
  this.schematic_text_id = schematic_text.schematic_text_id;
8329
8357
  }
@@ -9915,7 +9943,8 @@ var Port = class extends PrimitiveComponent2 {
9915
9943
  pin_number: props.pinNumber,
9916
9944
  true_ccw_index: localPortInfo?.trueIndex,
9917
9945
  display_pin_label: bestDisplayPinLabel,
9918
- is_connected: false
9946
+ is_connected: false,
9947
+ schematic_sheet_id: this._resolveSchematicSheetId()
9919
9948
  };
9920
9949
  for (const attributes of this._getMatchingPinAttributes()) {
9921
9950
  if (attributes.requiresPower) {
@@ -9943,7 +9972,8 @@ var Port = class extends PrimitiveComponent2 {
9943
9972
  y2,
9944
9973
  stroke_width: 0.02,
9945
9974
  color: SCHEMATIC_COMPONENT_OUTLINE_COLOR,
9946
- is_dashed: false
9975
+ is_dashed: false,
9976
+ schematic_sheet_id: this._resolveSchematicSheetId()
9947
9977
  });
9948
9978
  this.schematic_stem_line_id = stemLine.schematic_line_id;
9949
9979
  }
@@ -13209,6 +13239,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
13209
13239
  source_component_id: this.source_component_id,
13210
13240
  is_box_with_pins: true,
13211
13241
  symbol_name,
13242
+ schematic_sheet_id: this._resolveSchematicSheetId(),
13212
13243
  symbol_display_value: this._getSchematicSymbolDisplayValue()
13213
13244
  });
13214
13245
  this.schematic_component_id = schematic_component2.schematic_component_id;
@@ -13224,7 +13255,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
13224
13255
  size: { width: 0, height: 0 },
13225
13256
  source_component_id: this.source_component_id,
13226
13257
  symbol_display_value: this._getSchematicSymbolDisplayValue(),
13227
- is_box_with_pins: false
13258
+ is_box_with_pins: false,
13259
+ schematic_sheet_id: this._resolveSchematicSheetId()
13228
13260
  });
13229
13261
  this.schematic_component_id = schematic_component2.schematic_component_id;
13230
13262
  }
@@ -13258,7 +13290,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
13258
13290
  // @ts-ignore soup needs to support distance for pin_styles
13259
13291
  pin_styles: underscorifyPinStyles(props.schPinStyle, props.pinLabels),
13260
13292
  port_labels: primaryPortLabels,
13261
- source_component_id: this.source_component_id
13293
+ source_component_id: this.source_component_id,
13294
+ schematic_sheet_id: this._resolveSchematicSheetId()
13262
13295
  });
13263
13296
  const hasTopOrBottomPins = schPortArrangement?.topSide !== void 0 || schPortArrangement?.bottomSide !== void 0;
13264
13297
  const schematic_box_width = dimensions?.getSize().width;
@@ -13273,7 +13306,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
13273
13306
  y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.35 : center.y - (schematic_box_height ?? 0) / 2 - 0.13
13274
13307
  },
13275
13308
  color: "#006464",
13276
- font_size: 0.18
13309
+ font_size: 0.18,
13310
+ schematic_sheet_id: this._resolveSchematicSheetId()
13277
13311
  });
13278
13312
  const component_name_text = db.schematic_text.insert({
13279
13313
  text: props.displayName ?? props.name ?? "",
@@ -13285,7 +13319,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
13285
13319
  y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.55 : center.y + (schematic_box_height ?? 0) / 2 + 0.13
13286
13320
  },
13287
13321
  color: "#006464",
13288
- font_size: 0.18
13322
+ font_size: 0.18,
13323
+ schematic_sheet_id: this._resolveSchematicSheetId()
13289
13324
  });
13290
13325
  this.schematic_component_id = schematic_component2.schematic_component_id;
13291
13326
  }
@@ -19267,7 +19302,8 @@ var Group_doInitialSchematicBoxComponentRender = (group) => {
19267
19302
  props.schPinStyle,
19268
19303
  portLabels
19269
19304
  ),
19270
- port_labels: portLabels
19305
+ port_labels: portLabels,
19306
+ schematic_sheet_id: group._resolveSchematicSheetId()
19271
19307
  });
19272
19308
  group.schematic_component_id = schematicComponent.schematic_component_id;
19273
19309
  if (group.schematic_group_id) {
@@ -19290,7 +19326,8 @@ var Group_doInitialSchematicBoxComponentRender = (group) => {
19290
19326
  y: center.y + size.height / 2 + 0.13
19291
19327
  },
19292
19328
  color: "#006464",
19293
- font_size: 0.18
19329
+ font_size: 0.18,
19330
+ schematic_sheet_id: group._resolveSchematicSheetId()
19294
19331
  });
19295
19332
  }
19296
19333
  };
@@ -20166,7 +20203,8 @@ function applyTracesFromSolverOutput(args) {
20166
20203
  junctions: junctionsById[t.source_trace_id] ?? [],
20167
20204
  subcircuit_connectivity_map_key: pendingTraces.find(
20168
20205
  (p) => p.source_trace_id === t.source_trace_id
20169
- )?.subcircuit_connectivity_map_key
20206
+ )?.subcircuit_connectivity_map_key,
20207
+ schematic_sheet_id: group._resolveSchematicSheetId()
20170
20208
  });
20171
20209
  }
20172
20210
  }
@@ -20309,7 +20347,8 @@ function applyNetLabelPlacements(args) {
20309
20347
  source_net_id: sourceNet.source_net_id,
20310
20348
  anchor_position,
20311
20349
  center: center2,
20312
- anchor_side
20350
+ anchor_side,
20351
+ schematic_sheet_id: group._resolveSchematicSheetId()
20313
20352
  };
20314
20353
  db.schematic_net_label.insert(netLabel2);
20315
20354
  continue;
@@ -20336,7 +20375,8 @@ function applyNetLabelPlacements(args) {
20336
20375
  source_net_id: placementConnKey ?? placement.netId ?? placement.globalConnNetId,
20337
20376
  anchor_position,
20338
20377
  center,
20339
- anchor_side
20378
+ anchor_side,
20379
+ schematic_sheet_id: group._resolveSchematicSheetId()
20340
20380
  };
20341
20381
  db.schematic_net_label.insert(netLabel);
20342
20382
  }
@@ -20531,7 +20571,8 @@ var insertNetLabelsForPortsMissingTrace = ({
20531
20571
  source_net_id: sourceNet?.source_net_id ?? connKey,
20532
20572
  anchor_position: schPort.center,
20533
20573
  center,
20534
- anchor_side: side
20574
+ anchor_side: side,
20575
+ schematic_sheet_id: group._resolveSchematicSheetId()
20535
20576
  };
20536
20577
  db.schematic_net_label.insert(netLabel);
20537
20578
  }
@@ -24306,7 +24347,7 @@ import { identity as identity5 } from "transformation-matrix";
24306
24347
  var package_default = {
24307
24348
  name: "@tscircuit/core",
24308
24349
  type: "module",
24309
- version: "0.0.1363",
24350
+ version: "0.0.1364",
24310
24351
  types: "dist/index.d.ts",
24311
24352
  main: "dist/index.js",
24312
24353
  module: "dist/index.js",
@@ -24355,7 +24396,7 @@ var package_default = {
24355
24396
  "@tscircuit/math-utils": "^0.0.36",
24356
24397
  "@tscircuit/miniflex": "^0.0.4",
24357
24398
  "@tscircuit/ngspice-spice-engine": "^0.0.18",
24358
- "@tscircuit/props": "^0.0.558",
24399
+ "@tscircuit/props": "^0.0.561",
24359
24400
  "@tscircuit/schematic-match-adapt": "^0.0.18",
24360
24401
  "@tscircuit/schematic-trace-solver": "^0.0.72",
24361
24402
  "@tscircuit/solver-utils": "^0.0.16",
@@ -24369,13 +24410,13 @@ var package_default = {
24369
24410
  "bun-match-svg": "0.0.12",
24370
24411
  "calculate-elbow": "^0.0.12",
24371
24412
  "chokidar-cli": "^3.0.0",
24372
- "circuit-json": "^0.0.439",
24413
+ "circuit-json": "^0.0.442",
24373
24414
  "circuit-json-to-bpc": "^0.0.13",
24374
24415
  "circuit-json-to-connectivity-map": "^0.0.23",
24375
24416
  "circuit-json-to-gltf": "^0.0.105",
24376
24417
  "circuit-json-to-simple-3d": "^0.0.9",
24377
24418
  "circuit-json-to-spice": "^0.0.40",
24378
- "circuit-to-svg": "^0.0.360",
24419
+ "circuit-to-svg": "^0.0.364",
24379
24420
  concurrently: "^9.1.2",
24380
24421
  "connectivity-map": "^1.0.0",
24381
24422
  debug: "^4.3.6",
@@ -28598,7 +28639,8 @@ var NetLabel = class extends PrimitiveComponent2 {
28598
28639
  source_net_id: net.source_net_id,
28599
28640
  anchor_position: anchorPos,
28600
28641
  center,
28601
- anchor_side: anchorSide
28642
+ anchor_side: anchorSide,
28643
+ schematic_sheet_id: this._resolveSchematicSheetId()
28602
28644
  });
28603
28645
  this.source_net_label_id = netLabel.source_net_id;
28604
28646
  }
@@ -28709,7 +28751,8 @@ var NetLabel = class extends PrimitiveComponent2 {
28709
28751
  source_trace_id,
28710
28752
  edges,
28711
28753
  junctions: [],
28712
- subcircuit_connectivity_map_key
28754
+ subcircuit_connectivity_map_key,
28755
+ schematic_sheet_id: this._resolveSchematicSheetId()
28713
28756
  });
28714
28757
  db.schematic_port.update(port.schematic_port_id, { is_connected: true });
28715
28758
  }
@@ -29458,7 +29501,8 @@ function insertInnerSymbolInSchematicBox(connector, symbol) {
29458
29501
  is_dashed: false,
29459
29502
  fill_color: primitive.fill ? SCHEMATIC_COMPONENT_OUTLINE_COLOR : void 0,
29460
29503
  stroke_width: 0.02,
29461
- subcircuit_id
29504
+ subcircuit_id,
29505
+ schematic_sheet_id: connector._resolveSchematicSheetId()
29462
29506
  });
29463
29507
  } else if (primitive.type === "circle") {
29464
29508
  db.schematic_circle.insert({
@@ -29470,7 +29514,8 @@ function insertInnerSymbolInSchematicBox(connector, symbol) {
29470
29514
  is_filled: primitive.fill,
29471
29515
  fill_color: primitive.fill ? SCHEMATIC_COMPONENT_OUTLINE_COLOR : void 0,
29472
29516
  is_dashed: false,
29473
- subcircuit_id
29517
+ subcircuit_id,
29518
+ schematic_sheet_id: connector._resolveSchematicSheetId()
29474
29519
  });
29475
29520
  } else if (primitive.type === "box") {
29476
29521
  const topLeft = transformPoint({ x: primitive.x, y: primitive.y });
@@ -29491,7 +29536,8 @@ function insertInnerSymbolInSchematicBox(connector, symbol) {
29491
29536
  is_filled: false,
29492
29537
  is_dashed: false,
29493
29538
  rotation: 0,
29494
- subcircuit_id
29539
+ subcircuit_id,
29540
+ schematic_sheet_id: connector._resolveSchematicSheetId()
29495
29541
  });
29496
29542
  }
29497
29543
  }
@@ -30564,7 +30610,8 @@ var SchematicBox = class extends PrimitiveComponent2 {
30564
30610
  x: titleX,
30565
30611
  y: titleY
30566
30612
  },
30567
- rotation: 0
30613
+ rotation: 0,
30614
+ schematic_sheet_id: this._resolveSchematicSheetId()
30568
30615
  });
30569
30616
  }
30570
30617
  }
@@ -30670,7 +30717,8 @@ var SchematicSection = class _SchematicSection extends PrimitiveComponent2 {
30670
30717
  y2: line.end.y,
30671
30718
  stroke_width: STROKE_WIDTH,
30672
30719
  color: "#000000",
30673
- is_dashed: false
30720
+ is_dashed: false,
30721
+ schematic_sheet_id: this._resolveSchematicSheetId()
30674
30722
  });
30675
30723
  }
30676
30724
  const hDividers = dividers.filter(
@@ -30698,12 +30746,65 @@ var SchematicSection = class _SchematicSection extends PrimitiveComponent2 {
30698
30746
  x: leftBoundary + LABEL_PADDING,
30699
30747
  y: topBoundary - LABEL_PADDING
30700
30748
  },
30701
- rotation: 0
30749
+ rotation: 0,
30750
+ schematic_sheet_id: this._resolveSchematicSheetId()
30702
30751
  });
30703
30752
  }
30704
30753
  }
30705
30754
  };
30706
30755
 
30756
+ // lib/components/primitive-components/SchematicSheet.ts
30757
+ import { schematicSheetProps } from "@tscircuit/props";
30758
+ var SchematicSheet = class extends PrimitiveComponent2 {
30759
+ isSchematicPrimitive = true;
30760
+ get config() {
30761
+ return {
30762
+ componentName: "SchematicSheet",
30763
+ zodProps: schematicSheetProps
30764
+ };
30765
+ }
30766
+ doInitialSourceGroupRender() {
30767
+ if (this.root?.schematicDisabled) return;
30768
+ const { db } = this.root;
30769
+ const { _parsedProps: props } = this;
30770
+ const schematicSheet = db.schematic_sheet.insert({
30771
+ name: props.name,
30772
+ display_name: props.displayName,
30773
+ sheet_index: props.sheetIndex,
30774
+ subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
30775
+ });
30776
+ this.schematic_sheet_id = schematicSheet.schematic_sheet_id;
30777
+ }
30778
+ doInitialSchematicSheetRender() {
30779
+ if (this.root?.schematicDisabled) return;
30780
+ if (!this.schematic_sheet_id) return;
30781
+ const { db } = this.root;
30782
+ const schematicElements = [
30783
+ ...db.schematic_component.list(),
30784
+ ...db.schematic_port.list(),
30785
+ ...db.schematic_text.list(),
30786
+ ...db.schematic_line.list(),
30787
+ ...db.schematic_rect.list(),
30788
+ ...db.schematic_circle.list(),
30789
+ ...db.schematic_arc.list(),
30790
+ ...db.schematic_path.list()
30791
+ ].filter(
30792
+ (element) => element.schematic_sheet_id === this.schematic_sheet_id
30793
+ );
30794
+ if (schematicElements.length === 0) return;
30795
+ const bounds = getBoundsForSchematic(schematicElements);
30796
+ if (!Number.isFinite(bounds.minX) || !Number.isFinite(bounds.maxX) || !Number.isFinite(bounds.minY) || !Number.isFinite(bounds.maxY)) {
30797
+ return;
30798
+ }
30799
+ db.schematic_sheet.update(this.schematic_sheet_id, {
30800
+ center: {
30801
+ x: (bounds.minX + bounds.maxX) / 2,
30802
+ y: (bounds.minY + bounds.maxY) / 2
30803
+ }
30804
+ });
30805
+ }
30806
+ };
30807
+
30707
30808
  // lib/components/primitive-components/SchematicTable.ts
30708
30809
  import { schematicTableProps } from "@tscircuit/props";
30709
30810
  var SchematicTable = class extends PrimitiveComponent2 {
@@ -30784,7 +30885,8 @@ var SchematicTable = class extends PrimitiveComponent2 {
30784
30885
  border_width: props.borderWidth,
30785
30886
  anchor: props.anchor,
30786
30887
  subcircuit_id: this.getSubcircuit()?.subcircuit_id || "",
30787
- schematic_component_id: this.parent?.schematic_component_id || ""
30888
+ schematic_component_id: this.parent?.schematic_component_id || "",
30889
+ schematic_sheet_id: this._resolveSchematicSheetId()
30788
30890
  });
30789
30891
  this.schematic_table_id = table.schematic_table_id;
30790
30892
  const processedCells = /* @__PURE__ */ new Set();
@@ -31563,6 +31665,7 @@ export {
31563
31665
  SchematicRect,
31564
31666
  SchematicRow,
31565
31667
  SchematicSection,
31668
+ SchematicSheet,
31566
31669
  SchematicTable,
31567
31670
  SchematicText,
31568
31671
  SilkscreenCircle,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1364",
4
+ "version": "0.0.1365",
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.18",
53
- "@tscircuit/props": "^0.0.558",
53
+ "@tscircuit/props": "^0.0.561",
54
54
  "@tscircuit/schematic-match-adapt": "^0.0.18",
55
55
  "@tscircuit/schematic-trace-solver": "^0.0.72",
56
56
  "@tscircuit/solver-utils": "^0.0.16",
@@ -64,13 +64,13 @@
64
64
  "bun-match-svg": "0.0.12",
65
65
  "calculate-elbow": "^0.0.12",
66
66
  "chokidar-cli": "^3.0.0",
67
- "circuit-json": "^0.0.439",
67
+ "circuit-json": "^0.0.442",
68
68
  "circuit-json-to-bpc": "^0.0.13",
69
69
  "circuit-json-to-connectivity-map": "^0.0.23",
70
70
  "circuit-json-to-gltf": "^0.0.105",
71
71
  "circuit-json-to-simple-3d": "^0.0.9",
72
72
  "circuit-json-to-spice": "^0.0.40",
73
- "circuit-to-svg": "^0.0.360",
73
+ "circuit-to-svg": "^0.0.364",
74
74
  "concurrently": "^9.1.2",
75
75
  "connectivity-map": "^1.0.0",
76
76
  "debug": "^4.3.6",