@tscircuit/core 0.0.1011 → 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,
@@ -4682,7 +4683,7 @@ function getPortFromHints(hints, opts) {
4682
4683
  const pinNumber = getPinNumberFromLabels(hints);
4683
4684
  if (!pinNumber) return null;
4684
4685
  const aliasesFromHints = hints.filter(
4685
- (p) => p.toString() !== pinNumber.toString() && p !== `pin${pinNumber}`
4686
+ (p) => p.toString() !== pinNumber.toString() && p !== `pin${pinNumber}` && p.trim() !== ""
4686
4687
  );
4687
4688
  const aliases = [
4688
4689
  ...aliasesFromHints,
@@ -9404,7 +9405,11 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
9404
9405
  const newPorts2 = [];
9405
9406
  for (const fpChild of fp2.children) {
9406
9407
  if (!fpChild.props.portHints) continue;
9407
- let portHintsList = fpChild.props.portHints;
9408
+ const filteredPortHints = fpChild.props.portHints.filter(
9409
+ (hint) => hint && hint.trim() !== ""
9410
+ );
9411
+ if (filteredPortHints.length === 0) continue;
9412
+ let portHintsList = filteredPortHints;
9408
9413
  const hasPinPrefix = portHintsList.some(
9409
9414
  (hint) => hint.startsWith("pin")
9410
9415
  );
@@ -15535,22 +15540,24 @@ var Capacitor = class extends NormalComponent3 {
15535
15540
  }
15536
15541
  };
15537
15542
 
15538
- // lib/components/primitive-components/Group/Subcircuit/inflators/inflatePcbComponent.ts
15539
- import { compose as compose5, translate as translate6, rotate as rotate3, inverse } from "transformation-matrix";
15543
+ // lib/utils/extractPcbPrimitivesFromCircuitJson.ts
15540
15544
  import { transformPCBElements as transformPCBElements2 } from "@tscircuit/circuit-json-util";
15541
- var inflatePcbComponent = (pcbElm, inflatorContext) => {
15542
- const { injectionDb, normalComponent } = inflatorContext;
15543
- if (!normalComponent) return;
15544
- const componentCenter = pcbElm.center || { x: 0, y: 0 };
15545
- const componentRotation = pcbElm.rotation || 0;
15545
+ import { compose as compose5, inverse, rotate as rotate3, translate as translate6 } from "transformation-matrix";
15546
+ var extractPcbPrimitivesFromCircuitJson = ({
15547
+ pcbComponent,
15548
+ db,
15549
+ componentName
15550
+ }) => {
15551
+ const componentCenter = pcbComponent.center || { x: 0, y: 0 };
15552
+ const componentRotation = pcbComponent.rotation || 0;
15546
15553
  const absoluteToComponentRelativeTransform = inverse(
15547
15554
  compose5(
15548
15555
  translate6(componentCenter.x, componentCenter.y),
15549
15556
  rotate3(componentRotation * Math.PI / 180)
15550
15557
  )
15551
15558
  );
15552
- const relativeElements = injectionDb.toArray().filter(
15553
- (elm) => "pcb_component_id" in elm && elm.pcb_component_id === pcbElm.pcb_component_id
15559
+ const relativeElements = db.toArray().filter(
15560
+ (elm) => "pcb_component_id" in elm && elm.pcb_component_id === pcbComponent.pcb_component_id
15554
15561
  );
15555
15562
  const clonedRelativeElements = structuredClone(relativeElements);
15556
15563
  transformPCBElements2(
@@ -15559,11 +15566,23 @@ var inflatePcbComponent = (pcbElm, inflatorContext) => {
15559
15566
  );
15560
15567
  const components = createComponentsFromCircuitJson(
15561
15568
  {
15562
- componentName: normalComponent.name,
15569
+ componentName,
15563
15570
  componentRotation: "0deg"
15564
15571
  },
15565
15572
  clonedRelativeElements
15566
15573
  );
15574
+ return components;
15575
+ };
15576
+
15577
+ // lib/components/primitive-components/Group/Subcircuit/inflators/inflatePcbComponent.ts
15578
+ var inflatePcbComponent = (pcbElm, inflatorContext) => {
15579
+ const { injectionDb, normalComponent } = inflatorContext;
15580
+ if (!normalComponent) return;
15581
+ const components = extractPcbPrimitivesFromCircuitJson({
15582
+ pcbComponent: pcbElm,
15583
+ db: injectionDb,
15584
+ componentName: normalComponent.name
15585
+ });
15567
15586
  normalComponent.addAll(components);
15568
15587
  };
15569
15588
 
@@ -15765,6 +15784,21 @@ var Chip = class extends NormalComponent3 {
15765
15784
  }
15766
15785
  };
15767
15786
 
15787
+ // lib/components/primitive-components/Group/Subcircuit/inflators/inflateFootprintComponent.ts
15788
+ var inflateFootprintComponent = (pcbElm, inflatorContext) => {
15789
+ const { injectionDb, normalComponent } = inflatorContext;
15790
+ if (!normalComponent) return null;
15791
+ const primitives = extractPcbPrimitivesFromCircuitJson({
15792
+ pcbComponent: pcbElm,
15793
+ db: injectionDb,
15794
+ componentName: normalComponent.name
15795
+ });
15796
+ if (primitives.length === 0) return null;
15797
+ const footprint = new Footprint({});
15798
+ footprint.addAll(primitives);
15799
+ return footprint;
15800
+ };
15801
+
15768
15802
  // lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceChip.ts
15769
15803
  var mapInternallyConnectedSourcePortIdsToPinLabels = (sourcePortIds, inflatorContext) => {
15770
15804
  if (!sourcePortIds || sourcePortIds.length === 0) return void 0;
@@ -15798,6 +15832,7 @@ var inflateSourceChip = (sourceElm, inflatorContext) => {
15798
15832
  sourceElm.internally_connected_source_port_ids,
15799
15833
  inflatorContext
15800
15834
  );
15835
+ const footprinterString = cadElm?.footprinter_string ?? null;
15801
15836
  const chip = new Chip({
15802
15837
  name: sourceElm.name,
15803
15838
  manufacturerPartNumber: sourceElm.manufacturer_part_number,
@@ -15816,20 +15851,18 @@ var inflateSourceChip = (sourceElm, inflatorContext) => {
15816
15851
  obstructsWithinBounds: pcbElm?.obstructs_within_bounds,
15817
15852
  internallyConnectedPins
15818
15853
  });
15819
- const footprint = cadElm?.footprinter_string ?? null;
15820
- if (footprint) {
15821
- Object.assign(chip.props, { footprint });
15822
- Object.assign(chip._parsedProps, { footprint });
15823
- if (!cadElm) {
15824
- ;
15825
- chip._addChildrenFromStringFootprint?.();
15826
- }
15854
+ if (footprinterString) {
15855
+ Object.assign(chip.props, { footprint: footprinterString });
15856
+ Object.assign(chip._parsedProps, { footprint: footprinterString });
15827
15857
  }
15828
15858
  if (pcbElm) {
15829
- inflatePcbComponent(pcbElm, {
15859
+ const footprint = inflateFootprintComponent(pcbElm, {
15830
15860
  ...inflatorContext,
15831
15861
  normalComponent: chip
15832
15862
  });
15863
+ if (footprint) {
15864
+ chip.add(footprint);
15865
+ }
15833
15866
  }
15834
15867
  if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
15835
15868
  const group = groupsMap.get(sourceElm.source_group_id);
@@ -19421,6 +19454,108 @@ var CourtyardCircle = class extends PrimitiveComponent2 {
19421
19454
  }
19422
19455
  };
19423
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
+
19424
19559
  // lib/components/primitive-components/CourtyardRect.ts
19425
19560
  import { courtyardRectProps } from "@tscircuit/props";
19426
19561
  var CourtyardRect = class extends PrimitiveComponent2 {
@@ -19633,7 +19768,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
19633
19768
 
19634
19769
  // lib/components/primitive-components/SilkscreenLine.ts
19635
19770
  import { silkscreenLineProps } from "@tscircuit/props";
19636
- import { applyToPoint as applyToPoint18 } from "transformation-matrix";
19771
+ import { applyToPoint as applyToPoint19 } from "transformation-matrix";
19637
19772
  var SilkscreenLine = class extends PrimitiveComponent2 {
19638
19773
  pcb_silkscreen_line_id = null;
19639
19774
  isPcbPrimitive = true;
@@ -19656,8 +19791,8 @@ var SilkscreenLine = class extends PrimitiveComponent2 {
19656
19791
  }
19657
19792
  const subcircuit = this.getSubcircuit();
19658
19793
  const transform = this._computePcbGlobalTransformBeforeLayout();
19659
- const p1 = applyToPoint18(transform, { x: props.x1, y: props.y1 });
19660
- 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 });
19661
19796
  const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
19662
19797
  const pcb_silkscreen_line = db.pcb_silkscreen_line.insert({
19663
19798
  pcb_component_id,
@@ -20674,7 +20809,7 @@ var TestPoint = class extends NormalComponent3 {
20674
20809
 
20675
20810
  // lib/components/primitive-components/SchematicText.ts
20676
20811
  import { schematicTextProps } from "@tscircuit/props";
20677
- import { applyToPoint as applyToPoint19 } from "transformation-matrix";
20812
+ import { applyToPoint as applyToPoint20 } from "transformation-matrix";
20678
20813
  var SchematicText = class extends PrimitiveComponent2 {
20679
20814
  isSchematicPrimitive = true;
20680
20815
  schematic_text_id;
@@ -20713,7 +20848,7 @@ var SchematicText = class extends PrimitiveComponent2 {
20713
20848
  const { db } = this.root;
20714
20849
  const text = db.schematic_text.get(this.schematic_text_id);
20715
20850
  if (!text) return;
20716
- const newPosition = applyToPoint19(transform, text.position);
20851
+ const newPosition = applyToPoint20(transform, text.position);
20717
20852
  db.schematic_text.update(this.schematic_text_id, {
20718
20853
  position: { x: newPosition.x, y: newPosition.y }
20719
20854
  });
@@ -20722,7 +20857,7 @@ var SchematicText = class extends PrimitiveComponent2 {
20722
20857
 
20723
20858
  // lib/components/primitive-components/SchematicLine.ts
20724
20859
  import { schematicLineProps } from "@tscircuit/props";
20725
- import { applyToPoint as applyToPoint20 } from "transformation-matrix";
20860
+ import { applyToPoint as applyToPoint21 } from "transformation-matrix";
20726
20861
  var SchematicLine = class extends PrimitiveComponent2 {
20727
20862
  isSchematicPrimitive = true;
20728
20863
  get config() {
@@ -20762,8 +20897,8 @@ var SchematicLine = class extends PrimitiveComponent2 {
20762
20897
  const { db } = this.root;
20763
20898
  const line = db.schematic_line.get(this.schematic_line_id);
20764
20899
  if (!line) return;
20765
- const p1 = applyToPoint20(transform, { x: line.x1, y: line.y1 });
20766
- 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 });
20767
20902
  db.schematic_line.update(this.schematic_line_id, {
20768
20903
  x1: p1.x,
20769
20904
  y1: p1.y,
@@ -20775,7 +20910,7 @@ var SchematicLine = class extends PrimitiveComponent2 {
20775
20910
 
20776
20911
  // lib/components/primitive-components/SchematicRect.ts
20777
20912
  import { schematicRectProps } from "@tscircuit/props";
20778
- import { applyToPoint as applyToPoint21 } from "transformation-matrix";
20913
+ import { applyToPoint as applyToPoint22 } from "transformation-matrix";
20779
20914
  var SchematicRect = class extends PrimitiveComponent2 {
20780
20915
  isSchematicPrimitive = true;
20781
20916
  get config() {
@@ -20819,11 +20954,11 @@ var SchematicRect = class extends PrimitiveComponent2 {
20819
20954
  const { db } = this.root;
20820
20955
  const rect = db.schematic_rect.get(this.schematic_rect_id);
20821
20956
  if (!rect) return;
20822
- const topLeft = applyToPoint21(transform, {
20957
+ const topLeft = applyToPoint22(transform, {
20823
20958
  x: rect.center.x - rect.width / 2,
20824
20959
  y: rect.center.y + rect.height / 2
20825
20960
  });
20826
- const bottomRight = applyToPoint21(transform, {
20961
+ const bottomRight = applyToPoint22(transform, {
20827
20962
  x: rect.center.x + rect.width / 2,
20828
20963
  y: rect.center.y - rect.height / 2
20829
20964
  });
@@ -20843,7 +20978,7 @@ var SchematicRect = class extends PrimitiveComponent2 {
20843
20978
 
20844
20979
  // lib/components/primitive-components/SchematicArc.ts
20845
20980
  import { schematicArcProps } from "@tscircuit/props";
20846
- import { applyToPoint as applyToPoint22 } from "transformation-matrix";
20981
+ import { applyToPoint as applyToPoint23 } from "transformation-matrix";
20847
20982
  var SchematicArc = class extends PrimitiveComponent2 {
20848
20983
  isSchematicPrimitive = true;
20849
20984
  get config() {
@@ -20887,8 +21022,8 @@ var SchematicArc = class extends PrimitiveComponent2 {
20887
21022
  const { db } = this.root;
20888
21023
  const arc = db.schematic_arc.get(this.schematic_arc_id);
20889
21024
  if (!arc) return;
20890
- const newCenter = applyToPoint22(transform, arc.center);
20891
- const edgePoint = applyToPoint22(transform, {
21025
+ const newCenter = applyToPoint23(transform, arc.center);
21026
+ const edgePoint = applyToPoint23(transform, {
20892
21027
  x: arc.center.x + arc.radius,
20893
21028
  y: arc.center.y
20894
21029
  });
@@ -20902,7 +21037,7 @@ var SchematicArc = class extends PrimitiveComponent2 {
20902
21037
 
20903
21038
  // lib/components/primitive-components/SchematicCircle.ts
20904
21039
  import { schematicCircleProps } from "@tscircuit/props";
20905
- import { applyToPoint as applyToPoint23 } from "transformation-matrix";
21040
+ import { applyToPoint as applyToPoint24 } from "transformation-matrix";
20906
21041
  var SchematicCircle = class extends PrimitiveComponent2 {
20907
21042
  isSchematicPrimitive = true;
20908
21043
  get config() {
@@ -20945,8 +21080,8 @@ var SchematicCircle = class extends PrimitiveComponent2 {
20945
21080
  const { db } = this.root;
20946
21081
  const circle = db.schematic_circle.get(this.schematic_circle_id);
20947
21082
  if (!circle) return;
20948
- const newCenter = applyToPoint23(transform, circle.center);
20949
- const edgePoint = applyToPoint23(transform, {
21083
+ const newCenter = applyToPoint24(transform, circle.center);
21084
+ const edgePoint = applyToPoint24(transform, {
20950
21085
  x: circle.center.x + circle.radius,
20951
21086
  y: circle.center.y
20952
21087
  });
@@ -21090,7 +21225,7 @@ function svgPathToPoints(svgPath, samplesPerUnit = 10) {
21090
21225
  }
21091
21226
 
21092
21227
  // lib/components/primitive-components/SchematicPath.ts
21093
- import { applyToPoint as applyToPoint24 } from "transformation-matrix";
21228
+ import { applyToPoint as applyToPoint25 } from "transformation-matrix";
21094
21229
  var SchematicPath = class extends PrimitiveComponent2 {
21095
21230
  isSchematicPrimitive = true;
21096
21231
  schematic_path_ids = [];
@@ -21155,7 +21290,7 @@ var SchematicPath = class extends PrimitiveComponent2 {
21155
21290
  const path = db.schematic_path.get(pathId);
21156
21291
  if (!path) continue;
21157
21292
  const newPoints = path.points.map((point6) => {
21158
- const transformed = applyToPoint24(transform, point6);
21293
+ const transformed = applyToPoint25(transform, point6);
21159
21294
  return { x: transformed.x, y: transformed.y };
21160
21295
  });
21161
21296
  db.schematic_path.update(pathId, {
@@ -21928,7 +22063,7 @@ import { identity as identity5 } from "transformation-matrix";
21928
22063
  var package_default = {
21929
22064
  name: "@tscircuit/core",
21930
22065
  type: "module",
21931
- version: "0.0.1010",
22066
+ version: "0.0.1012",
21932
22067
  types: "dist/index.d.ts",
21933
22068
  main: "dist/index.js",
21934
22069
  module: "dist/index.js",
@@ -21986,13 +22121,13 @@ var package_default = {
21986
22121
  "bun-match-svg": "0.0.12",
21987
22122
  "calculate-elbow": "^0.0.12",
21988
22123
  "chokidar-cli": "^3.0.0",
21989
- "circuit-json": "^0.0.374",
22124
+ "circuit-json": "^0.0.376",
21990
22125
  "circuit-json-to-bpc": "^0.0.13",
21991
22126
  "circuit-json-to-connectivity-map": "^0.0.23",
21992
22127
  "circuit-json-to-gltf": "^0.0.62",
21993
22128
  "circuit-json-to-simple-3d": "^0.0.9",
21994
22129
  "circuit-json-to-spice": "^0.0.33",
21995
- "circuit-to-svg": "^0.0.323",
22130
+ "circuit-to-svg": "^0.0.325",
21996
22131
  concurrently: "^9.1.2",
21997
22132
  "connectivity-map": "^1.0.0",
21998
22133
  debug: "^4.3.6",
@@ -22518,6 +22653,7 @@ export {
22518
22653
  CopperPour,
22519
22654
  CopperText,
22520
22655
  CourtyardCircle,
22656
+ CourtyardOutline,
22521
22657
  CourtyardRect,
22522
22658
  Crystal,
22523
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.1011",
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",