@tscircuit/core 0.0.1009 → 0.0.1011
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 +170 -2
- package/dist/index.js +79 -1
- package/package.json +1 -1
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, AnySourceComponent, 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, 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, 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 { PlatformConfig, subcircuitGroupProps, AutorouterConfig, 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, 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';
|
|
@@ -371,6 +371,7 @@ interface ISubcircuit extends PrimitiveComponent {
|
|
|
371
371
|
_getSubcircuitLayerCount(): number;
|
|
372
372
|
subcircuit_id: string | null;
|
|
373
373
|
getNormalComponentNameMap?: () => Map<string, NormalComponent[]>;
|
|
374
|
+
_isInflatedFromCircuitJson: boolean;
|
|
374
375
|
}
|
|
375
376
|
|
|
376
377
|
interface SchematicSymbolBounds {
|
|
@@ -1653,6 +1654,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
|
|
|
1653
1654
|
schematic_group_id: string | null;
|
|
1654
1655
|
subcircuit_id: string | null;
|
|
1655
1656
|
_hasStartedAsyncAutorouting: boolean;
|
|
1657
|
+
_isInflatedFromCircuitJson: boolean;
|
|
1656
1658
|
private _normalComponentNameMap;
|
|
1657
1659
|
/**
|
|
1658
1660
|
* Returns a cached map of component names to NormalComponent instances within this subcircuit.
|
|
@@ -67027,6 +67029,171 @@ declare class CourtyardCircle extends PrimitiveComponent<typeof courtyardCircleP
|
|
|
67027
67029
|
}): void;
|
|
67028
67030
|
}
|
|
67029
67031
|
|
|
67032
|
+
declare class CourtyardRect extends PrimitiveComponent<typeof courtyardRectProps> {
|
|
67033
|
+
pcb_courtyard_rect_id: string | null;
|
|
67034
|
+
isPcbPrimitive: boolean;
|
|
67035
|
+
get config(): {
|
|
67036
|
+
componentName: string;
|
|
67037
|
+
zodProps: zod.ZodObject<Omit<{
|
|
67038
|
+
pcbX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
67039
|
+
pcbY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
67040
|
+
pcbLeftEdgeX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
67041
|
+
pcbRightEdgeX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
67042
|
+
pcbTopEdgeY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
67043
|
+
pcbBottomEdgeY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
67044
|
+
pcbOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67045
|
+
pcbOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67046
|
+
pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67047
|
+
pcbPositionAnchor: zod.ZodOptional<zod.ZodString>;
|
|
67048
|
+
pcbPositionMode: zod.ZodOptional<zod.ZodEnum<["relative_to_group_anchor", "auto", "relative_to_board_anchor", "relative_to_component_anchor"]>>;
|
|
67049
|
+
layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
67050
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
67051
|
+
}, "strip", zod.ZodTypeAny, {
|
|
67052
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
67053
|
+
}, {
|
|
67054
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
67055
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
67056
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
67057
|
+
}>>;
|
|
67058
|
+
pcbMarginTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67059
|
+
pcbMarginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67060
|
+
pcbMarginBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67061
|
+
pcbMarginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67062
|
+
pcbMarginX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67063
|
+
pcbMarginY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67064
|
+
pcbStyle: zod.ZodOptional<zod.ZodObject<{
|
|
67065
|
+
silkscreenFontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67066
|
+
viaPadDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67067
|
+
viaHoleDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67068
|
+
silkscreenTextPosition: zod.ZodOptional<zod.ZodUnion<[zod.ZodEnum<["centered", "outside", "none"]>, zod.ZodObject<{
|
|
67069
|
+
offsetX: zod.ZodNumber;
|
|
67070
|
+
offsetY: zod.ZodNumber;
|
|
67071
|
+
}, "strip", zod.ZodTypeAny, {
|
|
67072
|
+
offsetX: number;
|
|
67073
|
+
offsetY: number;
|
|
67074
|
+
}, {
|
|
67075
|
+
offsetX: number;
|
|
67076
|
+
offsetY: number;
|
|
67077
|
+
}>]>>;
|
|
67078
|
+
silkscreenTextVisibility: zod.ZodOptional<zod.ZodEnum<["hidden", "visible", "inherit"]>>;
|
|
67079
|
+
}, "strip", zod.ZodTypeAny, {
|
|
67080
|
+
silkscreenFontSize?: number | undefined;
|
|
67081
|
+
viaPadDiameter?: number | undefined;
|
|
67082
|
+
viaHoleDiameter?: number | undefined;
|
|
67083
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
67084
|
+
offsetX: number;
|
|
67085
|
+
offsetY: number;
|
|
67086
|
+
} | undefined;
|
|
67087
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
67088
|
+
}, {
|
|
67089
|
+
silkscreenFontSize?: string | number | undefined;
|
|
67090
|
+
viaPadDiameter?: string | number | undefined;
|
|
67091
|
+
viaHoleDiameter?: string | number | undefined;
|
|
67092
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
67093
|
+
offsetX: number;
|
|
67094
|
+
offsetY: number;
|
|
67095
|
+
} | undefined;
|
|
67096
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
67097
|
+
}>>;
|
|
67098
|
+
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
67099
|
+
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
67100
|
+
}, "pcbRotation"> & {
|
|
67101
|
+
width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
67102
|
+
height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
67103
|
+
strokeWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
67104
|
+
isFilled: zod.ZodOptional<zod.ZodBoolean>;
|
|
67105
|
+
hasStroke: zod.ZodOptional<zod.ZodBoolean>;
|
|
67106
|
+
isStrokeDashed: zod.ZodOptional<zod.ZodBoolean>;
|
|
67107
|
+
color: zod.ZodOptional<zod.ZodString>;
|
|
67108
|
+
}, "strip", zod.ZodTypeAny, {
|
|
67109
|
+
width: number;
|
|
67110
|
+
height: number;
|
|
67111
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
67112
|
+
pcbX?: string | number | undefined;
|
|
67113
|
+
pcbY?: string | number | undefined;
|
|
67114
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
67115
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
67116
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
67117
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
67118
|
+
pcbOffsetX?: number | undefined;
|
|
67119
|
+
pcbOffsetY?: number | undefined;
|
|
67120
|
+
pcbPositionAnchor?: string | undefined;
|
|
67121
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
67122
|
+
pcbMarginTop?: number | undefined;
|
|
67123
|
+
pcbMarginRight?: number | undefined;
|
|
67124
|
+
pcbMarginBottom?: number | undefined;
|
|
67125
|
+
pcbMarginLeft?: number | undefined;
|
|
67126
|
+
pcbMarginX?: number | undefined;
|
|
67127
|
+
pcbMarginY?: number | undefined;
|
|
67128
|
+
pcbStyle?: {
|
|
67129
|
+
silkscreenFontSize?: number | undefined;
|
|
67130
|
+
viaPadDiameter?: number | undefined;
|
|
67131
|
+
viaHoleDiameter?: number | undefined;
|
|
67132
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
67133
|
+
offsetX: number;
|
|
67134
|
+
offsetY: number;
|
|
67135
|
+
} | undefined;
|
|
67136
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
67137
|
+
} | undefined;
|
|
67138
|
+
pcbRelative?: boolean | undefined;
|
|
67139
|
+
relative?: boolean | undefined;
|
|
67140
|
+
strokeWidth?: number | undefined;
|
|
67141
|
+
color?: string | undefined;
|
|
67142
|
+
isFilled?: boolean | undefined;
|
|
67143
|
+
hasStroke?: boolean | undefined;
|
|
67144
|
+
isStrokeDashed?: boolean | undefined;
|
|
67145
|
+
}, {
|
|
67146
|
+
width: string | number;
|
|
67147
|
+
height: string | number;
|
|
67148
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
67149
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
67150
|
+
} | undefined;
|
|
67151
|
+
pcbX?: string | number | undefined;
|
|
67152
|
+
pcbY?: string | number | undefined;
|
|
67153
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
67154
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
67155
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
67156
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
67157
|
+
pcbOffsetX?: string | number | undefined;
|
|
67158
|
+
pcbOffsetY?: string | number | undefined;
|
|
67159
|
+
pcbPositionAnchor?: string | undefined;
|
|
67160
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
67161
|
+
pcbMarginTop?: string | number | undefined;
|
|
67162
|
+
pcbMarginRight?: string | number | undefined;
|
|
67163
|
+
pcbMarginBottom?: string | number | undefined;
|
|
67164
|
+
pcbMarginLeft?: string | number | undefined;
|
|
67165
|
+
pcbMarginX?: string | number | undefined;
|
|
67166
|
+
pcbMarginY?: string | number | undefined;
|
|
67167
|
+
pcbStyle?: {
|
|
67168
|
+
silkscreenFontSize?: string | number | undefined;
|
|
67169
|
+
viaPadDiameter?: string | number | undefined;
|
|
67170
|
+
viaHoleDiameter?: string | number | undefined;
|
|
67171
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
67172
|
+
offsetX: number;
|
|
67173
|
+
offsetY: number;
|
|
67174
|
+
} | undefined;
|
|
67175
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
67176
|
+
} | undefined;
|
|
67177
|
+
pcbRelative?: boolean | undefined;
|
|
67178
|
+
relative?: boolean | undefined;
|
|
67179
|
+
strokeWidth?: string | number | undefined;
|
|
67180
|
+
color?: string | undefined;
|
|
67181
|
+
isFilled?: boolean | undefined;
|
|
67182
|
+
hasStroke?: boolean | undefined;
|
|
67183
|
+
isStrokeDashed?: boolean | undefined;
|
|
67184
|
+
}>;
|
|
67185
|
+
};
|
|
67186
|
+
doInitialPcbPrimitiveRender(): void;
|
|
67187
|
+
getPcbSize(): {
|
|
67188
|
+
width: number;
|
|
67189
|
+
height: number;
|
|
67190
|
+
};
|
|
67191
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
67192
|
+
deltaX: number;
|
|
67193
|
+
deltaY: number;
|
|
67194
|
+
}): void;
|
|
67195
|
+
}
|
|
67196
|
+
|
|
67030
67197
|
declare class SilkscreenCircle extends PrimitiveComponent<typeof silkscreenCircleProps> {
|
|
67031
67198
|
pcb_silkscreen_circle_id: string | null;
|
|
67032
67199
|
isPcbPrimitive: boolean;
|
|
@@ -131251,6 +131418,7 @@ interface TscircuitElements {
|
|
|
131251
131418
|
silkscreencircle: _tscircuit_props.SilkscreenCircleProps;
|
|
131252
131419
|
tracehint: _tscircuit_props.TraceHintProps;
|
|
131253
131420
|
courtyardcircle: _tscircuit_props.CourtyardCircleProps;
|
|
131421
|
+
courtyardrect: _tscircuit_props.CourtyardRectProps;
|
|
131254
131422
|
pcbtrace: _tscircuit_props.PcbTraceProps;
|
|
131255
131423
|
fabricationnoterect: _tscircuit_props.FabricationNoteRectProps;
|
|
131256
131424
|
pcbnoteline: _tscircuit_props.PcbNoteLineProps;
|
|
@@ -131293,4 +131461,4 @@ declare module "react/jsx-runtime" {
|
|
|
131293
131461
|
}
|
|
131294
131462
|
}
|
|
131295
131463
|
|
|
131296
|
-
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, 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 };
|
|
131464
|
+
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, 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 };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __export(components_exports, {
|
|
|
20
20
|
CopperPour: () => CopperPour,
|
|
21
21
|
CopperText: () => CopperText,
|
|
22
22
|
CourtyardCircle: () => CourtyardCircle,
|
|
23
|
+
CourtyardRect: () => CourtyardRect,
|
|
23
24
|
Crystal: () => Crystal,
|
|
24
25
|
CurrentSource: () => CurrentSource,
|
|
25
26
|
Cutout: () => Cutout,
|
|
@@ -2087,6 +2088,7 @@ var Net = class extends PrimitiveComponent2 {
|
|
|
2087
2088
|
doInitialPcbRouteNetIslands() {
|
|
2088
2089
|
if (this.root?.pcbDisabled) return;
|
|
2089
2090
|
if (this.getSubcircuit()._parsedProps.routingDisabled) return;
|
|
2091
|
+
if (this.getSubcircuit()._isInflatedFromCircuitJson) return;
|
|
2090
2092
|
if (this.getSubcircuit()._getAutorouterConfig().groupMode !== "sequential-trace")
|
|
2091
2093
|
return;
|
|
2092
2094
|
const { db } = this.root;
|
|
@@ -7012,6 +7014,9 @@ function Trace_doInitialPcbTraceRender(trace) {
|
|
|
7012
7014
|
if (subcircuit._parsedProps.routingDisabled) {
|
|
7013
7015
|
return;
|
|
7014
7016
|
}
|
|
7017
|
+
if (subcircuit._isInflatedFromCircuitJson) {
|
|
7018
|
+
return;
|
|
7019
|
+
}
|
|
7015
7020
|
const cachedRoute = subcircuit._parsedProps.pcbRouteCache?.pcbTraces;
|
|
7016
7021
|
if (cachedRoute) {
|
|
7017
7022
|
const pcb_trace2 = db.pcb_trace.insert({
|
|
@@ -14470,6 +14475,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14470
14475
|
schematic_group_id = null;
|
|
14471
14476
|
subcircuit_id = null;
|
|
14472
14477
|
_hasStartedAsyncAutorouting = false;
|
|
14478
|
+
_isInflatedFromCircuitJson = false;
|
|
14473
14479
|
_normalComponentNameMap = null;
|
|
14474
14480
|
/**
|
|
14475
14481
|
* Returns a cached map of component names to NormalComponent instances within this subcircuit.
|
|
@@ -14964,6 +14970,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14964
14970
|
if (!this.isSubcircuit) return;
|
|
14965
14971
|
if (this.root?.pcbDisabled) return;
|
|
14966
14972
|
if (this.getInheritedProperty("routingDisabled")) return;
|
|
14973
|
+
if (this._isInflatedFromCircuitJson) return;
|
|
14967
14974
|
if (this._shouldUseTraceByTraceRouting()) return;
|
|
14968
14975
|
if (!this._areChildSubcircuitsRouted()) {
|
|
14969
14976
|
debug11(
|
|
@@ -14984,6 +14991,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14984
14991
|
const debug11 = Debug13("tscircuit:core:updatePcbTraceRender");
|
|
14985
14992
|
debug11(`[${this.getString()}] updating...`);
|
|
14986
14993
|
if (!this.isSubcircuit) return;
|
|
14994
|
+
if (this._isInflatedFromCircuitJson) return;
|
|
14987
14995
|
if (this._shouldRouteAsync() && this._hasTracesToRoute() && !this._hasStartedAsyncAutorouting) {
|
|
14988
14996
|
if (this._areChildSubcircuitsRouted()) {
|
|
14989
14997
|
debug11(
|
|
@@ -15155,6 +15163,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
15155
15163
|
}
|
|
15156
15164
|
_getPcbLayoutMode() {
|
|
15157
15165
|
const props = this._parsedProps;
|
|
15166
|
+
if (this._isInflatedFromCircuitJson) return "none";
|
|
15158
15167
|
if (props.pcbRelative) return "none";
|
|
15159
15168
|
if (props.pcbLayout?.matchAdapt) return "match-adapt";
|
|
15160
15169
|
if (props.pcbLayout?.flex) return "flex";
|
|
@@ -16627,6 +16636,9 @@ var Board = class extends Group6 {
|
|
|
16627
16636
|
}
|
|
16628
16637
|
doInitialInflateSubcircuitCircuitJson() {
|
|
16629
16638
|
const { circuitJson, children } = this._parsedProps;
|
|
16639
|
+
if (circuitJson) {
|
|
16640
|
+
this._isInflatedFromCircuitJson = true;
|
|
16641
|
+
}
|
|
16630
16642
|
inflateCircuitJson(this, circuitJson, children);
|
|
16631
16643
|
}
|
|
16632
16644
|
doInitialPcbComponentRender() {
|
|
@@ -19011,6 +19023,9 @@ var Subcircuit = class extends Group6 {
|
|
|
19011
19023
|
*/
|
|
19012
19024
|
doInitialInflateSubcircuitCircuitJson() {
|
|
19013
19025
|
const { circuitJson, children } = this._parsedProps;
|
|
19026
|
+
if (circuitJson) {
|
|
19027
|
+
this._isInflatedFromCircuitJson = true;
|
|
19028
|
+
}
|
|
19014
19029
|
inflateCircuitJson(this, circuitJson, children);
|
|
19015
19030
|
}
|
|
19016
19031
|
};
|
|
@@ -19406,6 +19421,68 @@ var CourtyardCircle = class extends PrimitiveComponent2 {
|
|
|
19406
19421
|
}
|
|
19407
19422
|
};
|
|
19408
19423
|
|
|
19424
|
+
// lib/components/primitive-components/CourtyardRect.ts
|
|
19425
|
+
import { courtyardRectProps } from "@tscircuit/props";
|
|
19426
|
+
var CourtyardRect = class extends PrimitiveComponent2 {
|
|
19427
|
+
pcb_courtyard_rect_id = null;
|
|
19428
|
+
isPcbPrimitive = true;
|
|
19429
|
+
get config() {
|
|
19430
|
+
return {
|
|
19431
|
+
componentName: "CourtyardRect",
|
|
19432
|
+
zodProps: courtyardRectProps
|
|
19433
|
+
};
|
|
19434
|
+
}
|
|
19435
|
+
doInitialPcbPrimitiveRender() {
|
|
19436
|
+
if (this.root?.pcbDisabled) return;
|
|
19437
|
+
const { db } = this.root;
|
|
19438
|
+
const { _parsedProps: props } = this;
|
|
19439
|
+
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
19440
|
+
const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
|
|
19441
|
+
const layer = maybeFlipLayer(props.layer ?? "top");
|
|
19442
|
+
if (layer !== "top" && layer !== "bottom") {
|
|
19443
|
+
throw new Error(
|
|
19444
|
+
`Invalid layer "${layer}" for CourtyardRect. Must be "top" or "bottom".`
|
|
19445
|
+
);
|
|
19446
|
+
}
|
|
19447
|
+
const subcircuit = this.getSubcircuit();
|
|
19448
|
+
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
|
|
19449
|
+
const pcb_courtyard_rect = db.pcb_courtyard_rect.insert({
|
|
19450
|
+
pcb_component_id,
|
|
19451
|
+
layer,
|
|
19452
|
+
center: {
|
|
19453
|
+
x: position.x,
|
|
19454
|
+
y: position.y
|
|
19455
|
+
},
|
|
19456
|
+
width: props.width,
|
|
19457
|
+
height: props.height,
|
|
19458
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
19459
|
+
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
19460
|
+
});
|
|
19461
|
+
this.pcb_courtyard_rect_id = pcb_courtyard_rect.pcb_courtyard_rect_id;
|
|
19462
|
+
}
|
|
19463
|
+
getPcbSize() {
|
|
19464
|
+
const { _parsedProps: props } = this;
|
|
19465
|
+
return { width: props.width, height: props.height };
|
|
19466
|
+
}
|
|
19467
|
+
_moveCircuitJsonElements({
|
|
19468
|
+
deltaX,
|
|
19469
|
+
deltaY
|
|
19470
|
+
}) {
|
|
19471
|
+
if (this.root?.pcbDisabled) return;
|
|
19472
|
+
const { db } = this.root;
|
|
19473
|
+
if (!this.pcb_courtyard_rect_id) return;
|
|
19474
|
+
const rect = db.pcb_courtyard_rect.get(this.pcb_courtyard_rect_id);
|
|
19475
|
+
if (rect) {
|
|
19476
|
+
db.pcb_courtyard_rect.update(this.pcb_courtyard_rect_id, {
|
|
19477
|
+
center: {
|
|
19478
|
+
x: rect.center.x + deltaX,
|
|
19479
|
+
y: rect.center.y + deltaY
|
|
19480
|
+
}
|
|
19481
|
+
});
|
|
19482
|
+
}
|
|
19483
|
+
}
|
|
19484
|
+
};
|
|
19485
|
+
|
|
19409
19486
|
// lib/components/primitive-components/SilkscreenCircle.ts
|
|
19410
19487
|
import { silkscreenCircleProps } from "@tscircuit/props";
|
|
19411
19488
|
var SilkscreenCircle = class extends PrimitiveComponent2 {
|
|
@@ -21851,7 +21928,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
21851
21928
|
var package_default = {
|
|
21852
21929
|
name: "@tscircuit/core",
|
|
21853
21930
|
type: "module",
|
|
21854
|
-
version: "0.0.
|
|
21931
|
+
version: "0.0.1010",
|
|
21855
21932
|
types: "dist/index.d.ts",
|
|
21856
21933
|
main: "dist/index.js",
|
|
21857
21934
|
module: "dist/index.js",
|
|
@@ -22441,6 +22518,7 @@ export {
|
|
|
22441
22518
|
CopperPour,
|
|
22442
22519
|
CopperText,
|
|
22443
22520
|
CourtyardCircle,
|
|
22521
|
+
CourtyardRect,
|
|
22444
22522
|
Crystal,
|
|
22445
22523
|
CurrentSource,
|
|
22446
22524
|
Cutout,
|