@tscircuit/core 0.0.1007 → 0.0.1009
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 +150 -2
- package/dist/index.js +113 -13
- package/package.json +3 -3
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, 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, 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';
|
|
@@ -66880,6 +66880,153 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
66880
66880
|
}): void;
|
|
66881
66881
|
}
|
|
66882
66882
|
|
|
66883
|
+
declare class CourtyardCircle extends PrimitiveComponent<typeof courtyardCircleProps> {
|
|
66884
|
+
pcb_courtyard_circle_id: string | null;
|
|
66885
|
+
isPcbPrimitive: boolean;
|
|
66886
|
+
get config(): {
|
|
66887
|
+
componentName: string;
|
|
66888
|
+
zodProps: zod.ZodObject<Omit<{
|
|
66889
|
+
pcbX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
66890
|
+
pcbY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
66891
|
+
pcbLeftEdgeX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
66892
|
+
pcbRightEdgeX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
66893
|
+
pcbTopEdgeY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
66894
|
+
pcbBottomEdgeY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
66895
|
+
pcbOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66896
|
+
pcbOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66897
|
+
pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66898
|
+
pcbPositionAnchor: zod.ZodOptional<zod.ZodString>;
|
|
66899
|
+
pcbPositionMode: zod.ZodOptional<zod.ZodEnum<["relative_to_group_anchor", "auto", "relative_to_board_anchor", "relative_to_component_anchor"]>>;
|
|
66900
|
+
layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
66901
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
66902
|
+
}, "strip", zod.ZodTypeAny, {
|
|
66903
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
66904
|
+
}, {
|
|
66905
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
66906
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
66907
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
66908
|
+
}>>;
|
|
66909
|
+
pcbMarginTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66910
|
+
pcbMarginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66911
|
+
pcbMarginBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66912
|
+
pcbMarginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66913
|
+
pcbMarginX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66914
|
+
pcbMarginY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66915
|
+
pcbStyle: zod.ZodOptional<zod.ZodObject<{
|
|
66916
|
+
silkscreenFontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66917
|
+
viaPadDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66918
|
+
viaHoleDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
66919
|
+
silkscreenTextPosition: zod.ZodOptional<zod.ZodUnion<[zod.ZodEnum<["centered", "outside", "none"]>, zod.ZodObject<{
|
|
66920
|
+
offsetX: zod.ZodNumber;
|
|
66921
|
+
offsetY: zod.ZodNumber;
|
|
66922
|
+
}, "strip", zod.ZodTypeAny, {
|
|
66923
|
+
offsetX: number;
|
|
66924
|
+
offsetY: number;
|
|
66925
|
+
}, {
|
|
66926
|
+
offsetX: number;
|
|
66927
|
+
offsetY: number;
|
|
66928
|
+
}>]>>;
|
|
66929
|
+
silkscreenTextVisibility: zod.ZodOptional<zod.ZodEnum<["hidden", "visible", "inherit"]>>;
|
|
66930
|
+
}, "strip", zod.ZodTypeAny, {
|
|
66931
|
+
silkscreenFontSize?: number | undefined;
|
|
66932
|
+
viaPadDiameter?: number | undefined;
|
|
66933
|
+
viaHoleDiameter?: number | undefined;
|
|
66934
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
66935
|
+
offsetX: number;
|
|
66936
|
+
offsetY: number;
|
|
66937
|
+
} | undefined;
|
|
66938
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
66939
|
+
}, {
|
|
66940
|
+
silkscreenFontSize?: string | number | undefined;
|
|
66941
|
+
viaPadDiameter?: string | number | undefined;
|
|
66942
|
+
viaHoleDiameter?: string | number | undefined;
|
|
66943
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
66944
|
+
offsetX: number;
|
|
66945
|
+
offsetY: number;
|
|
66946
|
+
} | undefined;
|
|
66947
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
66948
|
+
}>>;
|
|
66949
|
+
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
66950
|
+
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
66951
|
+
}, "pcbRotation"> & {
|
|
66952
|
+
radius: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
66953
|
+
}, "strip", zod.ZodTypeAny, {
|
|
66954
|
+
radius: number;
|
|
66955
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
66956
|
+
pcbX?: string | number | undefined;
|
|
66957
|
+
pcbY?: string | number | undefined;
|
|
66958
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
66959
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
66960
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
66961
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
66962
|
+
pcbOffsetX?: number | undefined;
|
|
66963
|
+
pcbOffsetY?: number | undefined;
|
|
66964
|
+
pcbPositionAnchor?: string | undefined;
|
|
66965
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
66966
|
+
pcbMarginTop?: number | undefined;
|
|
66967
|
+
pcbMarginRight?: number | undefined;
|
|
66968
|
+
pcbMarginBottom?: number | undefined;
|
|
66969
|
+
pcbMarginLeft?: number | undefined;
|
|
66970
|
+
pcbMarginX?: number | undefined;
|
|
66971
|
+
pcbMarginY?: number | undefined;
|
|
66972
|
+
pcbStyle?: {
|
|
66973
|
+
silkscreenFontSize?: number | undefined;
|
|
66974
|
+
viaPadDiameter?: number | undefined;
|
|
66975
|
+
viaHoleDiameter?: number | undefined;
|
|
66976
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
66977
|
+
offsetX: number;
|
|
66978
|
+
offsetY: number;
|
|
66979
|
+
} | undefined;
|
|
66980
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
66981
|
+
} | undefined;
|
|
66982
|
+
pcbRelative?: boolean | undefined;
|
|
66983
|
+
relative?: boolean | undefined;
|
|
66984
|
+
}, {
|
|
66985
|
+
radius: string | number;
|
|
66986
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
66987
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
66988
|
+
} | undefined;
|
|
66989
|
+
pcbX?: string | number | undefined;
|
|
66990
|
+
pcbY?: string | number | undefined;
|
|
66991
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
66992
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
66993
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
66994
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
66995
|
+
pcbOffsetX?: string | number | undefined;
|
|
66996
|
+
pcbOffsetY?: string | number | undefined;
|
|
66997
|
+
pcbPositionAnchor?: string | undefined;
|
|
66998
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
66999
|
+
pcbMarginTop?: string | number | undefined;
|
|
67000
|
+
pcbMarginRight?: string | number | undefined;
|
|
67001
|
+
pcbMarginBottom?: string | number | undefined;
|
|
67002
|
+
pcbMarginLeft?: string | number | undefined;
|
|
67003
|
+
pcbMarginX?: string | number | undefined;
|
|
67004
|
+
pcbMarginY?: string | number | undefined;
|
|
67005
|
+
pcbStyle?: {
|
|
67006
|
+
silkscreenFontSize?: string | number | undefined;
|
|
67007
|
+
viaPadDiameter?: string | number | undefined;
|
|
67008
|
+
viaHoleDiameter?: string | number | undefined;
|
|
67009
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
67010
|
+
offsetX: number;
|
|
67011
|
+
offsetY: number;
|
|
67012
|
+
} | undefined;
|
|
67013
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
67014
|
+
} | undefined;
|
|
67015
|
+
pcbRelative?: boolean | undefined;
|
|
67016
|
+
relative?: boolean | undefined;
|
|
67017
|
+
}>;
|
|
67018
|
+
};
|
|
67019
|
+
doInitialPcbPrimitiveRender(): void;
|
|
67020
|
+
getPcbSize(): {
|
|
67021
|
+
width: number;
|
|
67022
|
+
height: number;
|
|
67023
|
+
};
|
|
67024
|
+
_moveCircuitJsonElements({ deltaX, deltaY, }: {
|
|
67025
|
+
deltaX: number;
|
|
67026
|
+
deltaY: number;
|
|
67027
|
+
}): void;
|
|
67028
|
+
}
|
|
67029
|
+
|
|
66883
67030
|
declare class SilkscreenCircle extends PrimitiveComponent<typeof silkscreenCircleProps> {
|
|
66884
67031
|
pcb_silkscreen_circle_id: string | null;
|
|
66885
67032
|
isPcbPrimitive: boolean;
|
|
@@ -131103,6 +131250,7 @@ interface TscircuitElements {
|
|
|
131103
131250
|
silkscreenrect: _tscircuit_props.SilkscreenRectProps;
|
|
131104
131251
|
silkscreencircle: _tscircuit_props.SilkscreenCircleProps;
|
|
131105
131252
|
tracehint: _tscircuit_props.TraceHintProps;
|
|
131253
|
+
courtyardcircle: _tscircuit_props.CourtyardCircleProps;
|
|
131106
131254
|
pcbtrace: _tscircuit_props.PcbTraceProps;
|
|
131107
131255
|
fabricationnoterect: _tscircuit_props.FabricationNoteRectProps;
|
|
131108
131256
|
pcbnoteline: _tscircuit_props.PcbNoteLineProps;
|
|
@@ -131145,4 +131293,4 @@ declare module "react/jsx-runtime" {
|
|
|
131145
131293
|
}
|
|
131146
131294
|
}
|
|
131147
131295
|
|
|
131148
|
-
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, 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 };
|
|
131296
|
+
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, CopperText, CourtyardCircle, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __export(components_exports, {
|
|
|
19
19
|
Constraint: () => Constraint3,
|
|
20
20
|
CopperPour: () => CopperPour,
|
|
21
21
|
CopperText: () => CopperText,
|
|
22
|
+
CourtyardCircle: () => CourtyardCircle,
|
|
22
23
|
Crystal: () => Crystal,
|
|
23
24
|
CurrentSource: () => CurrentSource,
|
|
24
25
|
Cutout: () => Cutout,
|
|
@@ -7527,6 +7528,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
7527
7528
|
}
|
|
7528
7529
|
const otherPort = ports.find((p) => p !== anchorPort) ?? ports[1];
|
|
7529
7530
|
const layer = anchorPort.getAvailablePcbLayers()[0] || "top";
|
|
7531
|
+
let currentLayer = layer;
|
|
7530
7532
|
const anchorPos = anchorPort._getGlobalPcbPositionAfterLayout();
|
|
7531
7533
|
const otherPos = otherPort._getGlobalPcbPositionAfterLayout();
|
|
7532
7534
|
const route = [];
|
|
@@ -7535,13 +7537,17 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
7535
7537
|
x: anchorPos.x,
|
|
7536
7538
|
y: anchorPos.y,
|
|
7537
7539
|
width,
|
|
7538
|
-
layer,
|
|
7540
|
+
layer: currentLayer,
|
|
7539
7541
|
start_pcb_port_id: anchorPort.pcb_port_id
|
|
7540
7542
|
});
|
|
7541
7543
|
const transform = anchorPort?._computePcbGlobalTransformBeforeLayout?.() || identity3();
|
|
7542
|
-
|
|
7544
|
+
const pcbPath = props.pcbPath;
|
|
7545
|
+
for (const pt of pcbPath) {
|
|
7543
7546
|
let coordinates;
|
|
7544
7547
|
let isGlobalPosition = false;
|
|
7548
|
+
const isViaPoint = typeof pt !== "string" && pt.via;
|
|
7549
|
+
let viaFromLayer;
|
|
7550
|
+
let viaToLayer;
|
|
7545
7551
|
if (typeof pt === "string") {
|
|
7546
7552
|
const resolvedPort = trace.getSubcircuit().selectOne(pt, {
|
|
7547
7553
|
type: "port"
|
|
@@ -7563,22 +7569,37 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
7563
7569
|
} else {
|
|
7564
7570
|
coordinates = { x: pt.x, y: pt.y };
|
|
7565
7571
|
isGlobalPosition = false;
|
|
7572
|
+
if (pt.via) {
|
|
7573
|
+
viaFromLayer = pt.fromLayer ?? currentLayer;
|
|
7574
|
+
viaToLayer = pt.toLayer;
|
|
7575
|
+
}
|
|
7566
7576
|
}
|
|
7567
7577
|
const finalCoordinates = isGlobalPosition ? coordinates : applyToPoint7(transform, coordinates);
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7578
|
+
if (isViaPoint) {
|
|
7579
|
+
route.push({
|
|
7580
|
+
route_type: "via",
|
|
7581
|
+
x: finalCoordinates.x,
|
|
7582
|
+
y: finalCoordinates.y,
|
|
7583
|
+
from_layer: viaFromLayer ?? currentLayer,
|
|
7584
|
+
to_layer: viaToLayer ?? currentLayer
|
|
7585
|
+
});
|
|
7586
|
+
currentLayer = viaToLayer ?? currentLayer;
|
|
7587
|
+
} else {
|
|
7588
|
+
route.push({
|
|
7589
|
+
route_type: "wire",
|
|
7590
|
+
x: finalCoordinates.x,
|
|
7591
|
+
y: finalCoordinates.y,
|
|
7592
|
+
width,
|
|
7593
|
+
layer: currentLayer
|
|
7594
|
+
});
|
|
7595
|
+
}
|
|
7575
7596
|
}
|
|
7576
7597
|
route.push({
|
|
7577
7598
|
route_type: "wire",
|
|
7578
7599
|
x: otherPos.x,
|
|
7579
7600
|
y: otherPos.y,
|
|
7580
7601
|
width,
|
|
7581
|
-
layer,
|
|
7602
|
+
layer: currentLayer,
|
|
7582
7603
|
end_pcb_port_id: otherPort.pcb_port_id
|
|
7583
7604
|
});
|
|
7584
7605
|
const traceLength = getTraceLength(route);
|
|
@@ -7589,6 +7610,22 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
7589
7610
|
pcb_group_id: trace.getGroup()?.pcb_group_id ?? void 0,
|
|
7590
7611
|
trace_length: traceLength
|
|
7591
7612
|
});
|
|
7613
|
+
const pcbStyle = trace.getInheritedMergedProperty("pcbStyle");
|
|
7614
|
+
const { holeDiameter, padDiameter } = getViaDiameterDefaults(pcbStyle);
|
|
7615
|
+
for (const point6 of route) {
|
|
7616
|
+
if (point6.route_type === "via") {
|
|
7617
|
+
db.pcb_via.insert({
|
|
7618
|
+
pcb_trace_id: pcb_trace.pcb_trace_id,
|
|
7619
|
+
x: point6.x,
|
|
7620
|
+
y: point6.y,
|
|
7621
|
+
hole_diameter: holeDiameter,
|
|
7622
|
+
outer_diameter: padDiameter,
|
|
7623
|
+
layers: [point6.from_layer, point6.to_layer],
|
|
7624
|
+
from_layer: point6.from_layer,
|
|
7625
|
+
to_layer: point6.to_layer
|
|
7626
|
+
});
|
|
7627
|
+
}
|
|
7628
|
+
}
|
|
7592
7629
|
trace._portsRoutedOnPcb = ports;
|
|
7593
7630
|
trace.pcb_trace_id = pcb_trace.pcb_trace_id;
|
|
7594
7631
|
trace._insertErrorIfTraceIsOutsideBoard(route, ports);
|
|
@@ -19307,6 +19344,68 @@ var NetLabel = class extends PrimitiveComponent2 {
|
|
|
19307
19344
|
}
|
|
19308
19345
|
};
|
|
19309
19346
|
|
|
19347
|
+
// lib/components/primitive-components/CourtyardCircle.ts
|
|
19348
|
+
import { courtyardCircleProps } from "@tscircuit/props";
|
|
19349
|
+
var CourtyardCircle = class extends PrimitiveComponent2 {
|
|
19350
|
+
pcb_courtyard_circle_id = null;
|
|
19351
|
+
isPcbPrimitive = true;
|
|
19352
|
+
get config() {
|
|
19353
|
+
return {
|
|
19354
|
+
componentName: "CourtyardCircle",
|
|
19355
|
+
zodProps: courtyardCircleProps
|
|
19356
|
+
};
|
|
19357
|
+
}
|
|
19358
|
+
doInitialPcbPrimitiveRender() {
|
|
19359
|
+
if (this.root?.pcbDisabled) return;
|
|
19360
|
+
const { db } = this.root;
|
|
19361
|
+
const { _parsedProps: props } = this;
|
|
19362
|
+
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
19363
|
+
const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
|
|
19364
|
+
const layer = maybeFlipLayer(props.layer ?? "top");
|
|
19365
|
+
if (layer !== "top" && layer !== "bottom") {
|
|
19366
|
+
throw new Error(
|
|
19367
|
+
`Invalid layer "${layer}" for CourtyardCircle. Must be "top" or "bottom".`
|
|
19368
|
+
);
|
|
19369
|
+
}
|
|
19370
|
+
const subcircuit = this.getSubcircuit();
|
|
19371
|
+
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
|
|
19372
|
+
const pcb_courtyard_circle = db.pcb_courtyard_circle.insert({
|
|
19373
|
+
pcb_component_id,
|
|
19374
|
+
layer,
|
|
19375
|
+
center: {
|
|
19376
|
+
x: position.x,
|
|
19377
|
+
y: position.y
|
|
19378
|
+
},
|
|
19379
|
+
radius: props.radius,
|
|
19380
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
19381
|
+
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
19382
|
+
});
|
|
19383
|
+
this.pcb_courtyard_circle_id = pcb_courtyard_circle.pcb_courtyard_circle_id;
|
|
19384
|
+
}
|
|
19385
|
+
getPcbSize() {
|
|
19386
|
+
const { _parsedProps: props } = this;
|
|
19387
|
+
const diameter = props.radius * 2;
|
|
19388
|
+
return { width: diameter, height: diameter };
|
|
19389
|
+
}
|
|
19390
|
+
_moveCircuitJsonElements({
|
|
19391
|
+
deltaX,
|
|
19392
|
+
deltaY
|
|
19393
|
+
}) {
|
|
19394
|
+
if (this.root?.pcbDisabled) return;
|
|
19395
|
+
const { db } = this.root;
|
|
19396
|
+
if (!this.pcb_courtyard_circle_id) return;
|
|
19397
|
+
const circle = db.pcb_courtyard_circle.get(this.pcb_courtyard_circle_id);
|
|
19398
|
+
if (circle) {
|
|
19399
|
+
db.pcb_courtyard_circle.update(this.pcb_courtyard_circle_id, {
|
|
19400
|
+
center: {
|
|
19401
|
+
x: circle.center.x + deltaX,
|
|
19402
|
+
y: circle.center.y + deltaY
|
|
19403
|
+
}
|
|
19404
|
+
});
|
|
19405
|
+
}
|
|
19406
|
+
}
|
|
19407
|
+
};
|
|
19408
|
+
|
|
19310
19409
|
// lib/components/primitive-components/SilkscreenCircle.ts
|
|
19311
19410
|
import { silkscreenCircleProps } from "@tscircuit/props";
|
|
19312
19411
|
var SilkscreenCircle = class extends PrimitiveComponent2 {
|
|
@@ -21752,7 +21851,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
21752
21851
|
var package_default = {
|
|
21753
21852
|
name: "@tscircuit/core",
|
|
21754
21853
|
type: "module",
|
|
21755
|
-
version: "0.0.
|
|
21854
|
+
version: "0.0.1008",
|
|
21756
21855
|
types: "dist/index.d.ts",
|
|
21757
21856
|
main: "dist/index.js",
|
|
21758
21857
|
module: "dist/index.js",
|
|
@@ -21810,13 +21909,13 @@ var package_default = {
|
|
|
21810
21909
|
"bun-match-svg": "0.0.12",
|
|
21811
21910
|
"calculate-elbow": "^0.0.12",
|
|
21812
21911
|
"chokidar-cli": "^3.0.0",
|
|
21813
|
-
"circuit-json": "^0.0.
|
|
21912
|
+
"circuit-json": "^0.0.374",
|
|
21814
21913
|
"circuit-json-to-bpc": "^0.0.13",
|
|
21815
21914
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
21816
21915
|
"circuit-json-to-gltf": "^0.0.62",
|
|
21817
21916
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
21818
21917
|
"circuit-json-to-spice": "^0.0.33",
|
|
21819
|
-
"circuit-to-svg": "^0.0.
|
|
21918
|
+
"circuit-to-svg": "^0.0.323",
|
|
21820
21919
|
concurrently: "^9.1.2",
|
|
21821
21920
|
"connectivity-map": "^1.0.0",
|
|
21822
21921
|
debug: "^4.3.6",
|
|
@@ -22341,6 +22440,7 @@ export {
|
|
|
22341
22440
|
Constraint3 as Constraint,
|
|
22342
22441
|
CopperPour,
|
|
22343
22442
|
CopperText,
|
|
22443
|
+
CourtyardCircle,
|
|
22344
22444
|
Crystal,
|
|
22345
22445
|
CurrentSource,
|
|
22346
22446
|
Cutout,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1009",
|
|
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.
|
|
62
|
+
"circuit-json": "^0.0.374",
|
|
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.
|
|
68
|
+
"circuit-to-svg": "^0.0.323",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|