@tscircuit/core 0.0.1012 → 0.0.1014

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, 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, 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 { 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, 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';
@@ -67029,6 +67029,168 @@ declare class CourtyardCircle extends PrimitiveComponent<typeof courtyardCircleP
67029
67029
  }): void;
67030
67030
  }
67031
67031
 
67032
+ declare class CourtyardOutline extends PrimitiveComponent<typeof courtyardOutlineProps> {
67033
+ pcb_courtyard_outline_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" | "pcbX" | "pcbY" | "pcbLeftEdgeX" | "pcbRightEdgeX" | "pcbTopEdgeY" | "pcbBottomEdgeY" | "pcbOffsetX" | "pcbOffsetY"> & {
67101
+ outline: zod.ZodArray<zod.ZodObject<{
67102
+ x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
67103
+ y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
67104
+ }, "strip", zod.ZodTypeAny, {
67105
+ x: number;
67106
+ y: number;
67107
+ }, {
67108
+ x: string | number;
67109
+ y: string | number;
67110
+ }>, "many">;
67111
+ strokeWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
67112
+ isClosed: zod.ZodOptional<zod.ZodBoolean>;
67113
+ isStrokeDashed: zod.ZodOptional<zod.ZodBoolean>;
67114
+ color: zod.ZodOptional<zod.ZodString>;
67115
+ }, "strip", zod.ZodTypeAny, {
67116
+ outline: {
67117
+ x: number;
67118
+ y: number;
67119
+ }[];
67120
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
67121
+ pcbPositionAnchor?: string | undefined;
67122
+ pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
67123
+ pcbMarginTop?: number | undefined;
67124
+ pcbMarginRight?: number | undefined;
67125
+ pcbMarginBottom?: number | undefined;
67126
+ pcbMarginLeft?: number | undefined;
67127
+ pcbMarginX?: number | undefined;
67128
+ pcbMarginY?: number | undefined;
67129
+ pcbStyle?: {
67130
+ silkscreenFontSize?: number | undefined;
67131
+ viaPadDiameter?: number | undefined;
67132
+ viaHoleDiameter?: number | undefined;
67133
+ silkscreenTextPosition?: "centered" | "outside" | "none" | {
67134
+ offsetX: number;
67135
+ offsetY: number;
67136
+ } | undefined;
67137
+ silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
67138
+ } | undefined;
67139
+ pcbRelative?: boolean | undefined;
67140
+ relative?: boolean | undefined;
67141
+ strokeWidth?: number | undefined;
67142
+ color?: string | undefined;
67143
+ isStrokeDashed?: boolean | undefined;
67144
+ isClosed?: boolean | undefined;
67145
+ }, {
67146
+ outline: {
67147
+ x: string | number;
67148
+ y: string | number;
67149
+ }[];
67150
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
67151
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
67152
+ } | undefined;
67153
+ pcbPositionAnchor?: string | undefined;
67154
+ pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
67155
+ pcbMarginTop?: string | number | undefined;
67156
+ pcbMarginRight?: string | number | undefined;
67157
+ pcbMarginBottom?: string | number | undefined;
67158
+ pcbMarginLeft?: string | number | undefined;
67159
+ pcbMarginX?: string | number | undefined;
67160
+ pcbMarginY?: string | number | undefined;
67161
+ pcbStyle?: {
67162
+ silkscreenFontSize?: string | number | undefined;
67163
+ viaPadDiameter?: string | number | undefined;
67164
+ viaHoleDiameter?: string | number | undefined;
67165
+ silkscreenTextPosition?: "centered" | "outside" | "none" | {
67166
+ offsetX: number;
67167
+ offsetY: number;
67168
+ } | undefined;
67169
+ silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
67170
+ } | undefined;
67171
+ pcbRelative?: boolean | undefined;
67172
+ relative?: boolean | undefined;
67173
+ strokeWidth?: string | number | undefined;
67174
+ color?: string | undefined;
67175
+ isStrokeDashed?: boolean | undefined;
67176
+ isClosed?: boolean | undefined;
67177
+ }>;
67178
+ };
67179
+ doInitialPcbPrimitiveRender(): void;
67180
+ _setPositionFromLayout(newCenter: {
67181
+ x: number;
67182
+ y: number;
67183
+ }): void;
67184
+ _moveCircuitJsonElements({ deltaX, deltaY, }: {
67185
+ deltaX: number;
67186
+ deltaY: number;
67187
+ }): void;
67188
+ getPcbSize(): {
67189
+ width: number;
67190
+ height: number;
67191
+ };
67192
+ }
67193
+
67032
67194
  declare class CourtyardRect extends PrimitiveComponent<typeof courtyardRectProps> {
67033
67195
  pcb_courtyard_rect_id: string | null;
67034
67196
  isPcbPrimitive: boolean;
@@ -131418,6 +131580,7 @@ interface TscircuitElements {
131418
131580
  silkscreencircle: _tscircuit_props.SilkscreenCircleProps;
131419
131581
  tracehint: _tscircuit_props.TraceHintProps;
131420
131582
  courtyardcircle: _tscircuit_props.CourtyardCircleProps;
131583
+ courtyardoutline: _tscircuit_props.CourtyardOutlineProps;
131421
131584
  courtyardrect: _tscircuit_props.CourtyardRectProps;
131422
131585
  pcbtrace: _tscircuit_props.PcbTraceProps;
131423
131586
  fabricationnoterect: _tscircuit_props.FabricationNoteRectProps;
@@ -131461,4 +131624,4 @@ declare module "react/jsx-runtime" {
131461
131624
  }
131462
131625
  }
131463
131626
 
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 };
131627
+ 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 };
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
+ CourtyardOutline: () => CourtyardOutline,
23
24
  CourtyardRect: () => CourtyardRect,
24
25
  Crystal: () => Crystal,
25
26
  CurrentSource: () => CurrentSource,
@@ -7545,7 +7546,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
7545
7546
  layer: currentLayer,
7546
7547
  start_pcb_port_id: anchorPort.pcb_port_id
7547
7548
  });
7548
- const transform = anchorPort?._computePcbGlobalTransformBeforeLayout?.() || identity3();
7549
+ const transform = subcircuit._isInflatedFromCircuitJson ? trace._computePcbGlobalTransformBeforeLayout() : anchorPort?._computePcbGlobalTransformBeforeLayout?.() || identity3();
7549
7550
  const pcbPath = props.pcbPath;
7550
7551
  for (const pt of pcbPath) {
7551
7552
  let coordinates;
@@ -16189,6 +16190,25 @@ function inflateSourceResistor(sourceElm, inflatorContext) {
16189
16190
  }
16190
16191
  }
16191
16192
 
16193
+ // lib/utils/pcbTraceRouteToPcbPath.ts
16194
+ function pcbTraceRouteToPcbPath(route) {
16195
+ if (route.length <= 2) {
16196
+ return [];
16197
+ }
16198
+ return route.slice(1, -1).map((point6) => {
16199
+ if (point6.route_type === "via") {
16200
+ return {
16201
+ x: point6.x,
16202
+ y: point6.y,
16203
+ via: true,
16204
+ fromLayer: point6.from_layer,
16205
+ toLayer: point6.to_layer
16206
+ };
16207
+ }
16208
+ return { x: point6.x, y: point6.y };
16209
+ });
16210
+ }
16211
+
16192
16212
  // lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceTrace.ts
16193
16213
  var getSelectorPath = (component, inflatorContext) => {
16194
16214
  const { injectionDb, subcircuit, groupsMap } = inflatorContext;
@@ -16244,9 +16264,20 @@ function inflateSourceTrace(sourceTrace, inflatorContext) {
16244
16264
  if (connectedSelectors.length < 2) {
16245
16265
  return;
16246
16266
  }
16247
- const trace = new Trace3({
16248
- path: connectedSelectors
16267
+ const pcbTrace = injectionDb.pcb_trace.getWhere({
16268
+ source_trace_id: sourceTrace.source_trace_id
16249
16269
  });
16270
+ let pcbPath;
16271
+ if (pcbTrace) {
16272
+ pcbPath = pcbTraceRouteToPcbPath(pcbTrace.route);
16273
+ }
16274
+ const traceProps2 = {
16275
+ path: connectedSelectors
16276
+ };
16277
+ if (pcbPath && pcbPath.length > 0) {
16278
+ traceProps2.pcbPath = pcbPath;
16279
+ }
16280
+ const trace = new Trace3(traceProps2);
16250
16281
  trace.source_trace_id = sourceTrace.source_trace_id;
16251
16282
  subcircuit.add(trace);
16252
16283
  }
@@ -19453,6 +19484,108 @@ var CourtyardCircle = class extends PrimitiveComponent2 {
19453
19484
  }
19454
19485
  };
19455
19486
 
19487
+ // lib/components/primitive-components/CourtyardOutline.ts
19488
+ import { courtyardOutlineProps } from "@tscircuit/props";
19489
+ import { getBoundsFromPoints as getBoundsFromPoints6 } from "@tscircuit/math-utils";
19490
+ import { applyToPoint as applyToPoint18 } from "transformation-matrix";
19491
+ var CourtyardOutline = class extends PrimitiveComponent2 {
19492
+ pcb_courtyard_outline_id = null;
19493
+ isPcbPrimitive = true;
19494
+ get config() {
19495
+ return {
19496
+ componentName: "CourtyardOutline",
19497
+ zodProps: courtyardOutlineProps
19498
+ };
19499
+ }
19500
+ doInitialPcbPrimitiveRender() {
19501
+ if (this.root?.pcbDisabled) return;
19502
+ const { db } = this.root;
19503
+ const { _parsedProps: props } = this;
19504
+ const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
19505
+ const layer = maybeFlipLayer(props.layer ?? "top");
19506
+ if (layer !== "top" && layer !== "bottom") {
19507
+ throw new Error(
19508
+ `Invalid layer "${layer}" for CourtyardOutline. Must be "top" or "bottom".`
19509
+ );
19510
+ }
19511
+ const transform = this._computePcbGlobalTransformBeforeLayout();
19512
+ const subcircuit = this.getSubcircuit();
19513
+ const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
19514
+ const pcb_courtyard_outline = db.pcb_courtyard_outline.insert({
19515
+ pcb_component_id,
19516
+ layer,
19517
+ outline: props.outline.map((p) => {
19518
+ const transformedPosition = applyToPoint18(transform, {
19519
+ x: p.x,
19520
+ y: p.y
19521
+ });
19522
+ return {
19523
+ x: transformedPosition.x,
19524
+ y: transformedPosition.y
19525
+ };
19526
+ }),
19527
+ subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
19528
+ pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
19529
+ });
19530
+ this.pcb_courtyard_outline_id = pcb_courtyard_outline.pcb_courtyard_outline_id;
19531
+ }
19532
+ _setPositionFromLayout(newCenter) {
19533
+ const { db } = this.root;
19534
+ const currentOutline = db.pcb_courtyard_outline.get(
19535
+ this.pcb_courtyard_outline_id
19536
+ );
19537
+ if (!currentOutline) return;
19538
+ let currentCenterX = 0;
19539
+ let currentCenterY = 0;
19540
+ for (const point6 of currentOutline.outline) {
19541
+ currentCenterX += point6.x;
19542
+ currentCenterY += point6.y;
19543
+ }
19544
+ currentCenterX /= currentOutline.outline.length;
19545
+ currentCenterY /= currentOutline.outline.length;
19546
+ const offsetX = newCenter.x - currentCenterX;
19547
+ const offsetY = newCenter.y - currentCenterY;
19548
+ const newOutline = currentOutline.outline.map((point6) => ({
19549
+ x: point6.x + offsetX,
19550
+ y: point6.y + offsetY
19551
+ }));
19552
+ db.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id, {
19553
+ outline: newOutline
19554
+ });
19555
+ }
19556
+ _moveCircuitJsonElements({
19557
+ deltaX,
19558
+ deltaY
19559
+ }) {
19560
+ if (this.root?.pcbDisabled) return;
19561
+ const { db } = this.root;
19562
+ if (!this.pcb_courtyard_outline_id) return;
19563
+ const outline = db.pcb_courtyard_outline.get(this.pcb_courtyard_outline_id);
19564
+ if (outline) {
19565
+ db.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id, {
19566
+ outline: outline.outline.map((p) => ({
19567
+ x: p.x + deltaX,
19568
+ y: p.y + deltaY
19569
+ }))
19570
+ });
19571
+ }
19572
+ }
19573
+ getPcbSize() {
19574
+ const { _parsedProps: props } = this;
19575
+ if (!props.outline || props.outline.length === 0) {
19576
+ return { width: 0, height: 0 };
19577
+ }
19578
+ const bounds = getBoundsFromPoints6(props.outline);
19579
+ if (!bounds) {
19580
+ return { width: 0, height: 0 };
19581
+ }
19582
+ return {
19583
+ width: bounds.maxX - bounds.minX,
19584
+ height: bounds.maxY - bounds.minY
19585
+ };
19586
+ }
19587
+ };
19588
+
19456
19589
  // lib/components/primitive-components/CourtyardRect.ts
19457
19590
  import { courtyardRectProps } from "@tscircuit/props";
19458
19591
  var CourtyardRect = class extends PrimitiveComponent2 {
@@ -19665,7 +19798,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
19665
19798
 
19666
19799
  // lib/components/primitive-components/SilkscreenLine.ts
19667
19800
  import { silkscreenLineProps } from "@tscircuit/props";
19668
- import { applyToPoint as applyToPoint18 } from "transformation-matrix";
19801
+ import { applyToPoint as applyToPoint19 } from "transformation-matrix";
19669
19802
  var SilkscreenLine = class extends PrimitiveComponent2 {
19670
19803
  pcb_silkscreen_line_id = null;
19671
19804
  isPcbPrimitive = true;
@@ -19688,8 +19821,8 @@ var SilkscreenLine = class extends PrimitiveComponent2 {
19688
19821
  }
19689
19822
  const subcircuit = this.getSubcircuit();
19690
19823
  const transform = this._computePcbGlobalTransformBeforeLayout();
19691
- const p1 = applyToPoint18(transform, { x: props.x1, y: props.y1 });
19692
- const p2 = applyToPoint18(transform, { x: props.x2, y: props.y2 });
19824
+ const p1 = applyToPoint19(transform, { x: props.x1, y: props.y1 });
19825
+ const p2 = applyToPoint19(transform, { x: props.x2, y: props.y2 });
19693
19826
  const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
19694
19827
  const pcb_silkscreen_line = db.pcb_silkscreen_line.insert({
19695
19828
  pcb_component_id,
@@ -20706,7 +20839,7 @@ var TestPoint = class extends NormalComponent3 {
20706
20839
 
20707
20840
  // lib/components/primitive-components/SchematicText.ts
20708
20841
  import { schematicTextProps } from "@tscircuit/props";
20709
- import { applyToPoint as applyToPoint19 } from "transformation-matrix";
20842
+ import { applyToPoint as applyToPoint20 } from "transformation-matrix";
20710
20843
  var SchematicText = class extends PrimitiveComponent2 {
20711
20844
  isSchematicPrimitive = true;
20712
20845
  schematic_text_id;
@@ -20745,7 +20878,7 @@ var SchematicText = class extends PrimitiveComponent2 {
20745
20878
  const { db } = this.root;
20746
20879
  const text = db.schematic_text.get(this.schematic_text_id);
20747
20880
  if (!text) return;
20748
- const newPosition = applyToPoint19(transform, text.position);
20881
+ const newPosition = applyToPoint20(transform, text.position);
20749
20882
  db.schematic_text.update(this.schematic_text_id, {
20750
20883
  position: { x: newPosition.x, y: newPosition.y }
20751
20884
  });
@@ -20754,7 +20887,7 @@ var SchematicText = class extends PrimitiveComponent2 {
20754
20887
 
20755
20888
  // lib/components/primitive-components/SchematicLine.ts
20756
20889
  import { schematicLineProps } from "@tscircuit/props";
20757
- import { applyToPoint as applyToPoint20 } from "transformation-matrix";
20890
+ import { applyToPoint as applyToPoint21 } from "transformation-matrix";
20758
20891
  var SchematicLine = class extends PrimitiveComponent2 {
20759
20892
  isSchematicPrimitive = true;
20760
20893
  get config() {
@@ -20794,8 +20927,8 @@ var SchematicLine = class extends PrimitiveComponent2 {
20794
20927
  const { db } = this.root;
20795
20928
  const line = db.schematic_line.get(this.schematic_line_id);
20796
20929
  if (!line) return;
20797
- const p1 = applyToPoint20(transform, { x: line.x1, y: line.y1 });
20798
- const p2 = applyToPoint20(transform, { x: line.x2, y: line.y2 });
20930
+ const p1 = applyToPoint21(transform, { x: line.x1, y: line.y1 });
20931
+ const p2 = applyToPoint21(transform, { x: line.x2, y: line.y2 });
20799
20932
  db.schematic_line.update(this.schematic_line_id, {
20800
20933
  x1: p1.x,
20801
20934
  y1: p1.y,
@@ -20807,7 +20940,7 @@ var SchematicLine = class extends PrimitiveComponent2 {
20807
20940
 
20808
20941
  // lib/components/primitive-components/SchematicRect.ts
20809
20942
  import { schematicRectProps } from "@tscircuit/props";
20810
- import { applyToPoint as applyToPoint21 } from "transformation-matrix";
20943
+ import { applyToPoint as applyToPoint22 } from "transformation-matrix";
20811
20944
  var SchematicRect = class extends PrimitiveComponent2 {
20812
20945
  isSchematicPrimitive = true;
20813
20946
  get config() {
@@ -20851,11 +20984,11 @@ var SchematicRect = class extends PrimitiveComponent2 {
20851
20984
  const { db } = this.root;
20852
20985
  const rect = db.schematic_rect.get(this.schematic_rect_id);
20853
20986
  if (!rect) return;
20854
- const topLeft = applyToPoint21(transform, {
20987
+ const topLeft = applyToPoint22(transform, {
20855
20988
  x: rect.center.x - rect.width / 2,
20856
20989
  y: rect.center.y + rect.height / 2
20857
20990
  });
20858
- const bottomRight = applyToPoint21(transform, {
20991
+ const bottomRight = applyToPoint22(transform, {
20859
20992
  x: rect.center.x + rect.width / 2,
20860
20993
  y: rect.center.y - rect.height / 2
20861
20994
  });
@@ -20875,7 +21008,7 @@ var SchematicRect = class extends PrimitiveComponent2 {
20875
21008
 
20876
21009
  // lib/components/primitive-components/SchematicArc.ts
20877
21010
  import { schematicArcProps } from "@tscircuit/props";
20878
- import { applyToPoint as applyToPoint22 } from "transformation-matrix";
21011
+ import { applyToPoint as applyToPoint23 } from "transformation-matrix";
20879
21012
  var SchematicArc = class extends PrimitiveComponent2 {
20880
21013
  isSchematicPrimitive = true;
20881
21014
  get config() {
@@ -20919,8 +21052,8 @@ var SchematicArc = class extends PrimitiveComponent2 {
20919
21052
  const { db } = this.root;
20920
21053
  const arc = db.schematic_arc.get(this.schematic_arc_id);
20921
21054
  if (!arc) return;
20922
- const newCenter = applyToPoint22(transform, arc.center);
20923
- const edgePoint = applyToPoint22(transform, {
21055
+ const newCenter = applyToPoint23(transform, arc.center);
21056
+ const edgePoint = applyToPoint23(transform, {
20924
21057
  x: arc.center.x + arc.radius,
20925
21058
  y: arc.center.y
20926
21059
  });
@@ -20934,7 +21067,7 @@ var SchematicArc = class extends PrimitiveComponent2 {
20934
21067
 
20935
21068
  // lib/components/primitive-components/SchematicCircle.ts
20936
21069
  import { schematicCircleProps } from "@tscircuit/props";
20937
- import { applyToPoint as applyToPoint23 } from "transformation-matrix";
21070
+ import { applyToPoint as applyToPoint24 } from "transformation-matrix";
20938
21071
  var SchematicCircle = class extends PrimitiveComponent2 {
20939
21072
  isSchematicPrimitive = true;
20940
21073
  get config() {
@@ -20977,8 +21110,8 @@ var SchematicCircle = class extends PrimitiveComponent2 {
20977
21110
  const { db } = this.root;
20978
21111
  const circle = db.schematic_circle.get(this.schematic_circle_id);
20979
21112
  if (!circle) return;
20980
- const newCenter = applyToPoint23(transform, circle.center);
20981
- const edgePoint = applyToPoint23(transform, {
21113
+ const newCenter = applyToPoint24(transform, circle.center);
21114
+ const edgePoint = applyToPoint24(transform, {
20982
21115
  x: circle.center.x + circle.radius,
20983
21116
  y: circle.center.y
20984
21117
  });
@@ -21122,7 +21255,7 @@ function svgPathToPoints(svgPath, samplesPerUnit = 10) {
21122
21255
  }
21123
21256
 
21124
21257
  // lib/components/primitive-components/SchematicPath.ts
21125
- import { applyToPoint as applyToPoint24 } from "transformation-matrix";
21258
+ import { applyToPoint as applyToPoint25 } from "transformation-matrix";
21126
21259
  var SchematicPath = class extends PrimitiveComponent2 {
21127
21260
  isSchematicPrimitive = true;
21128
21261
  schematic_path_ids = [];
@@ -21187,7 +21320,7 @@ var SchematicPath = class extends PrimitiveComponent2 {
21187
21320
  const path = db.schematic_path.get(pathId);
21188
21321
  if (!path) continue;
21189
21322
  const newPoints = path.points.map((point6) => {
21190
- const transformed = applyToPoint24(transform, point6);
21323
+ const transformed = applyToPoint25(transform, point6);
21191
21324
  return { x: transformed.x, y: transformed.y };
21192
21325
  });
21193
21326
  db.schematic_path.update(pathId, {
@@ -21960,7 +22093,7 @@ import { identity as identity5 } from "transformation-matrix";
21960
22093
  var package_default = {
21961
22094
  name: "@tscircuit/core",
21962
22095
  type: "module",
21963
- version: "0.0.1011",
22096
+ version: "0.0.1013",
21964
22097
  types: "dist/index.d.ts",
21965
22098
  main: "dist/index.js",
21966
22099
  module: "dist/index.js",
@@ -22018,13 +22151,13 @@ var package_default = {
22018
22151
  "bun-match-svg": "0.0.12",
22019
22152
  "calculate-elbow": "^0.0.12",
22020
22153
  "chokidar-cli": "^3.0.0",
22021
- "circuit-json": "^0.0.374",
22154
+ "circuit-json": "^0.0.376",
22022
22155
  "circuit-json-to-bpc": "^0.0.13",
22023
22156
  "circuit-json-to-connectivity-map": "^0.0.23",
22024
22157
  "circuit-json-to-gltf": "^0.0.62",
22025
22158
  "circuit-json-to-simple-3d": "^0.0.9",
22026
22159
  "circuit-json-to-spice": "^0.0.33",
22027
- "circuit-to-svg": "^0.0.323",
22160
+ "circuit-to-svg": "^0.0.325",
22028
22161
  concurrently: "^9.1.2",
22029
22162
  "connectivity-map": "^1.0.0",
22030
22163
  debug: "^4.3.6",
@@ -22550,6 +22683,7 @@ export {
22550
22683
  CopperPour,
22551
22684
  CopperText,
22552
22685
  CourtyardCircle,
22686
+ CourtyardOutline,
22553
22687
  CourtyardRect,
22554
22688
  Crystal,
22555
22689
  CurrentSource,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1012",
4
+ "version": "0.0.1014",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -59,13 +59,13 @@
59
59
  "bun-match-svg": "0.0.12",
60
60
  "calculate-elbow": "^0.0.12",
61
61
  "chokidar-cli": "^3.0.0",
62
- "circuit-json": "^0.0.374",
62
+ "circuit-json": "^0.0.376",
63
63
  "circuit-json-to-bpc": "^0.0.13",
64
64
  "circuit-json-to-connectivity-map": "^0.0.23",
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.323",
68
+ "circuit-to-svg": "^0.0.325",
69
69
  "concurrently": "^9.1.2",
70
70
  "connectivity-map": "^1.0.0",
71
71
  "debug": "^4.3.6",