@tscircuit/core 0.0.1012 → 0.0.1013

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,
@@ -19453,6 +19454,108 @@ var CourtyardCircle = class extends PrimitiveComponent2 {
19453
19454
  }
19454
19455
  };
19455
19456
 
19457
+ // lib/components/primitive-components/CourtyardOutline.ts
19458
+ import { courtyardOutlineProps } from "@tscircuit/props";
19459
+ import { getBoundsFromPoints as getBoundsFromPoints6 } from "@tscircuit/math-utils";
19460
+ import { applyToPoint as applyToPoint18 } from "transformation-matrix";
19461
+ var CourtyardOutline = class extends PrimitiveComponent2 {
19462
+ pcb_courtyard_outline_id = null;
19463
+ isPcbPrimitive = true;
19464
+ get config() {
19465
+ return {
19466
+ componentName: "CourtyardOutline",
19467
+ zodProps: courtyardOutlineProps
19468
+ };
19469
+ }
19470
+ doInitialPcbPrimitiveRender() {
19471
+ if (this.root?.pcbDisabled) return;
19472
+ const { db } = this.root;
19473
+ const { _parsedProps: props } = this;
19474
+ const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
19475
+ const layer = maybeFlipLayer(props.layer ?? "top");
19476
+ if (layer !== "top" && layer !== "bottom") {
19477
+ throw new Error(
19478
+ `Invalid layer "${layer}" for CourtyardOutline. Must be "top" or "bottom".`
19479
+ );
19480
+ }
19481
+ const transform = this._computePcbGlobalTransformBeforeLayout();
19482
+ const subcircuit = this.getSubcircuit();
19483
+ const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
19484
+ const pcb_courtyard_outline = db.pcb_courtyard_outline.insert({
19485
+ pcb_component_id,
19486
+ layer,
19487
+ outline: props.outline.map((p) => {
19488
+ const transformedPosition = applyToPoint18(transform, {
19489
+ x: p.x,
19490
+ y: p.y
19491
+ });
19492
+ return {
19493
+ x: transformedPosition.x,
19494
+ y: transformedPosition.y
19495
+ };
19496
+ }),
19497
+ subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
19498
+ pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
19499
+ });
19500
+ this.pcb_courtyard_outline_id = pcb_courtyard_outline.pcb_courtyard_outline_id;
19501
+ }
19502
+ _setPositionFromLayout(newCenter) {
19503
+ const { db } = this.root;
19504
+ const currentOutline = db.pcb_courtyard_outline.get(
19505
+ this.pcb_courtyard_outline_id
19506
+ );
19507
+ if (!currentOutline) return;
19508
+ let currentCenterX = 0;
19509
+ let currentCenterY = 0;
19510
+ for (const point6 of currentOutline.outline) {
19511
+ currentCenterX += point6.x;
19512
+ currentCenterY += point6.y;
19513
+ }
19514
+ currentCenterX /= currentOutline.outline.length;
19515
+ currentCenterY /= currentOutline.outline.length;
19516
+ const offsetX = newCenter.x - currentCenterX;
19517
+ const offsetY = newCenter.y - currentCenterY;
19518
+ const newOutline = currentOutline.outline.map((point6) => ({
19519
+ x: point6.x + offsetX,
19520
+ y: point6.y + offsetY
19521
+ }));
19522
+ db.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id, {
19523
+ outline: newOutline
19524
+ });
19525
+ }
19526
+ _moveCircuitJsonElements({
19527
+ deltaX,
19528
+ deltaY
19529
+ }) {
19530
+ if (this.root?.pcbDisabled) return;
19531
+ const { db } = this.root;
19532
+ if (!this.pcb_courtyard_outline_id) return;
19533
+ const outline = db.pcb_courtyard_outline.get(this.pcb_courtyard_outline_id);
19534
+ if (outline) {
19535
+ db.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id, {
19536
+ outline: outline.outline.map((p) => ({
19537
+ x: p.x + deltaX,
19538
+ y: p.y + deltaY
19539
+ }))
19540
+ });
19541
+ }
19542
+ }
19543
+ getPcbSize() {
19544
+ const { _parsedProps: props } = this;
19545
+ if (!props.outline || props.outline.length === 0) {
19546
+ return { width: 0, height: 0 };
19547
+ }
19548
+ const bounds = getBoundsFromPoints6(props.outline);
19549
+ if (!bounds) {
19550
+ return { width: 0, height: 0 };
19551
+ }
19552
+ return {
19553
+ width: bounds.maxX - bounds.minX,
19554
+ height: bounds.maxY - bounds.minY
19555
+ };
19556
+ }
19557
+ };
19558
+
19456
19559
  // lib/components/primitive-components/CourtyardRect.ts
19457
19560
  import { courtyardRectProps } from "@tscircuit/props";
19458
19561
  var CourtyardRect = class extends PrimitiveComponent2 {
@@ -19665,7 +19768,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
19665
19768
 
19666
19769
  // lib/components/primitive-components/SilkscreenLine.ts
19667
19770
  import { silkscreenLineProps } from "@tscircuit/props";
19668
- import { applyToPoint as applyToPoint18 } from "transformation-matrix";
19771
+ import { applyToPoint as applyToPoint19 } from "transformation-matrix";
19669
19772
  var SilkscreenLine = class extends PrimitiveComponent2 {
19670
19773
  pcb_silkscreen_line_id = null;
19671
19774
  isPcbPrimitive = true;
@@ -19688,8 +19791,8 @@ var SilkscreenLine = class extends PrimitiveComponent2 {
19688
19791
  }
19689
19792
  const subcircuit = this.getSubcircuit();
19690
19793
  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 });
19794
+ const p1 = applyToPoint19(transform, { x: props.x1, y: props.y1 });
19795
+ const p2 = applyToPoint19(transform, { x: props.x2, y: props.y2 });
19693
19796
  const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
19694
19797
  const pcb_silkscreen_line = db.pcb_silkscreen_line.insert({
19695
19798
  pcb_component_id,
@@ -20706,7 +20809,7 @@ var TestPoint = class extends NormalComponent3 {
20706
20809
 
20707
20810
  // lib/components/primitive-components/SchematicText.ts
20708
20811
  import { schematicTextProps } from "@tscircuit/props";
20709
- import { applyToPoint as applyToPoint19 } from "transformation-matrix";
20812
+ import { applyToPoint as applyToPoint20 } from "transformation-matrix";
20710
20813
  var SchematicText = class extends PrimitiveComponent2 {
20711
20814
  isSchematicPrimitive = true;
20712
20815
  schematic_text_id;
@@ -20745,7 +20848,7 @@ var SchematicText = class extends PrimitiveComponent2 {
20745
20848
  const { db } = this.root;
20746
20849
  const text = db.schematic_text.get(this.schematic_text_id);
20747
20850
  if (!text) return;
20748
- const newPosition = applyToPoint19(transform, text.position);
20851
+ const newPosition = applyToPoint20(transform, text.position);
20749
20852
  db.schematic_text.update(this.schematic_text_id, {
20750
20853
  position: { x: newPosition.x, y: newPosition.y }
20751
20854
  });
@@ -20754,7 +20857,7 @@ var SchematicText = class extends PrimitiveComponent2 {
20754
20857
 
20755
20858
  // lib/components/primitive-components/SchematicLine.ts
20756
20859
  import { schematicLineProps } from "@tscircuit/props";
20757
- import { applyToPoint as applyToPoint20 } from "transformation-matrix";
20860
+ import { applyToPoint as applyToPoint21 } from "transformation-matrix";
20758
20861
  var SchematicLine = class extends PrimitiveComponent2 {
20759
20862
  isSchematicPrimitive = true;
20760
20863
  get config() {
@@ -20794,8 +20897,8 @@ var SchematicLine = class extends PrimitiveComponent2 {
20794
20897
  const { db } = this.root;
20795
20898
  const line = db.schematic_line.get(this.schematic_line_id);
20796
20899
  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 });
20900
+ const p1 = applyToPoint21(transform, { x: line.x1, y: line.y1 });
20901
+ const p2 = applyToPoint21(transform, { x: line.x2, y: line.y2 });
20799
20902
  db.schematic_line.update(this.schematic_line_id, {
20800
20903
  x1: p1.x,
20801
20904
  y1: p1.y,
@@ -20807,7 +20910,7 @@ var SchematicLine = class extends PrimitiveComponent2 {
20807
20910
 
20808
20911
  // lib/components/primitive-components/SchematicRect.ts
20809
20912
  import { schematicRectProps } from "@tscircuit/props";
20810
- import { applyToPoint as applyToPoint21 } from "transformation-matrix";
20913
+ import { applyToPoint as applyToPoint22 } from "transformation-matrix";
20811
20914
  var SchematicRect = class extends PrimitiveComponent2 {
20812
20915
  isSchematicPrimitive = true;
20813
20916
  get config() {
@@ -20851,11 +20954,11 @@ var SchematicRect = class extends PrimitiveComponent2 {
20851
20954
  const { db } = this.root;
20852
20955
  const rect = db.schematic_rect.get(this.schematic_rect_id);
20853
20956
  if (!rect) return;
20854
- const topLeft = applyToPoint21(transform, {
20957
+ const topLeft = applyToPoint22(transform, {
20855
20958
  x: rect.center.x - rect.width / 2,
20856
20959
  y: rect.center.y + rect.height / 2
20857
20960
  });
20858
- const bottomRight = applyToPoint21(transform, {
20961
+ const bottomRight = applyToPoint22(transform, {
20859
20962
  x: rect.center.x + rect.width / 2,
20860
20963
  y: rect.center.y - rect.height / 2
20861
20964
  });
@@ -20875,7 +20978,7 @@ var SchematicRect = class extends PrimitiveComponent2 {
20875
20978
 
20876
20979
  // lib/components/primitive-components/SchematicArc.ts
20877
20980
  import { schematicArcProps } from "@tscircuit/props";
20878
- import { applyToPoint as applyToPoint22 } from "transformation-matrix";
20981
+ import { applyToPoint as applyToPoint23 } from "transformation-matrix";
20879
20982
  var SchematicArc = class extends PrimitiveComponent2 {
20880
20983
  isSchematicPrimitive = true;
20881
20984
  get config() {
@@ -20919,8 +21022,8 @@ var SchematicArc = class extends PrimitiveComponent2 {
20919
21022
  const { db } = this.root;
20920
21023
  const arc = db.schematic_arc.get(this.schematic_arc_id);
20921
21024
  if (!arc) return;
20922
- const newCenter = applyToPoint22(transform, arc.center);
20923
- const edgePoint = applyToPoint22(transform, {
21025
+ const newCenter = applyToPoint23(transform, arc.center);
21026
+ const edgePoint = applyToPoint23(transform, {
20924
21027
  x: arc.center.x + arc.radius,
20925
21028
  y: arc.center.y
20926
21029
  });
@@ -20934,7 +21037,7 @@ var SchematicArc = class extends PrimitiveComponent2 {
20934
21037
 
20935
21038
  // lib/components/primitive-components/SchematicCircle.ts
20936
21039
  import { schematicCircleProps } from "@tscircuit/props";
20937
- import { applyToPoint as applyToPoint23 } from "transformation-matrix";
21040
+ import { applyToPoint as applyToPoint24 } from "transformation-matrix";
20938
21041
  var SchematicCircle = class extends PrimitiveComponent2 {
20939
21042
  isSchematicPrimitive = true;
20940
21043
  get config() {
@@ -20977,8 +21080,8 @@ var SchematicCircle = class extends PrimitiveComponent2 {
20977
21080
  const { db } = this.root;
20978
21081
  const circle = db.schematic_circle.get(this.schematic_circle_id);
20979
21082
  if (!circle) return;
20980
- const newCenter = applyToPoint23(transform, circle.center);
20981
- const edgePoint = applyToPoint23(transform, {
21083
+ const newCenter = applyToPoint24(transform, circle.center);
21084
+ const edgePoint = applyToPoint24(transform, {
20982
21085
  x: circle.center.x + circle.radius,
20983
21086
  y: circle.center.y
20984
21087
  });
@@ -21122,7 +21225,7 @@ function svgPathToPoints(svgPath, samplesPerUnit = 10) {
21122
21225
  }
21123
21226
 
21124
21227
  // lib/components/primitive-components/SchematicPath.ts
21125
- import { applyToPoint as applyToPoint24 } from "transformation-matrix";
21228
+ import { applyToPoint as applyToPoint25 } from "transformation-matrix";
21126
21229
  var SchematicPath = class extends PrimitiveComponent2 {
21127
21230
  isSchematicPrimitive = true;
21128
21231
  schematic_path_ids = [];
@@ -21187,7 +21290,7 @@ var SchematicPath = class extends PrimitiveComponent2 {
21187
21290
  const path = db.schematic_path.get(pathId);
21188
21291
  if (!path) continue;
21189
21292
  const newPoints = path.points.map((point6) => {
21190
- const transformed = applyToPoint24(transform, point6);
21293
+ const transformed = applyToPoint25(transform, point6);
21191
21294
  return { x: transformed.x, y: transformed.y };
21192
21295
  });
21193
21296
  db.schematic_path.update(pathId, {
@@ -21960,7 +22063,7 @@ import { identity as identity5 } from "transformation-matrix";
21960
22063
  var package_default = {
21961
22064
  name: "@tscircuit/core",
21962
22065
  type: "module",
21963
- version: "0.0.1011",
22066
+ version: "0.0.1012",
21964
22067
  types: "dist/index.d.ts",
21965
22068
  main: "dist/index.js",
21966
22069
  module: "dist/index.js",
@@ -22018,13 +22121,13 @@ var package_default = {
22018
22121
  "bun-match-svg": "0.0.12",
22019
22122
  "calculate-elbow": "^0.0.12",
22020
22123
  "chokidar-cli": "^3.0.0",
22021
- "circuit-json": "^0.0.374",
22124
+ "circuit-json": "^0.0.376",
22022
22125
  "circuit-json-to-bpc": "^0.0.13",
22023
22126
  "circuit-json-to-connectivity-map": "^0.0.23",
22024
22127
  "circuit-json-to-gltf": "^0.0.62",
22025
22128
  "circuit-json-to-simple-3d": "^0.0.9",
22026
22129
  "circuit-json-to-spice": "^0.0.33",
22027
- "circuit-to-svg": "^0.0.323",
22130
+ "circuit-to-svg": "^0.0.325",
22028
22131
  concurrently: "^9.1.2",
22029
22132
  "connectivity-map": "^1.0.0",
22030
22133
  debug: "^4.3.6",
@@ -22550,6 +22653,7 @@ export {
22550
22653
  CopperPour,
22551
22654
  CopperText,
22552
22655
  CourtyardCircle,
22656
+ CourtyardOutline,
22553
22657
  CourtyardRect,
22554
22658
  Crystal,
22555
22659
  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.1013",
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",