@tscircuit/core 0.0.925 → 0.0.927
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 +171 -2
- package/dist/index.js +92 -22
- 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, panelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, 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, traceHintProps, viaProps, copperPourProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, 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, panelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, 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, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, 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';
|
|
@@ -26750,6 +26750,174 @@ declare class CopperPour extends PrimitiveComponent<typeof copperPourProps> {
|
|
|
26750
26750
|
doInitialPcbCopperPourRender(): void;
|
|
26751
26751
|
}
|
|
26752
26752
|
|
|
26753
|
+
declare class CopperText extends PrimitiveComponent<typeof copperTextProps> {
|
|
26754
|
+
isPcbPrimitive: boolean;
|
|
26755
|
+
get config(): {
|
|
26756
|
+
componentName: string;
|
|
26757
|
+
zodProps: zod.ZodObject<{
|
|
26758
|
+
pcbX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
26759
|
+
pcbY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
26760
|
+
pcbLeftEdgeX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
26761
|
+
pcbRightEdgeX: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
26762
|
+
pcbTopEdgeY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
26763
|
+
pcbBottomEdgeY: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>]>>;
|
|
26764
|
+
pcbOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26765
|
+
pcbOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26766
|
+
pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26767
|
+
pcbPositionAnchor: zod.ZodOptional<zod.ZodString>;
|
|
26768
|
+
pcbPositionMode: zod.ZodOptional<zod.ZodEnum<["relative_to_group_anchor", "auto", "relative_to_board_anchor", "relative_to_component_anchor"]>>;
|
|
26769
|
+
layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
26770
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
26771
|
+
}, "strip", zod.ZodTypeAny, {
|
|
26772
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26773
|
+
}, {
|
|
26774
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26775
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
26776
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26777
|
+
}>>;
|
|
26778
|
+
pcbMarginTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26779
|
+
pcbMarginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26780
|
+
pcbMarginBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26781
|
+
pcbMarginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26782
|
+
pcbMarginX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26783
|
+
pcbMarginY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26784
|
+
pcbStyle: zod.ZodOptional<zod.ZodObject<{
|
|
26785
|
+
silkscreenFontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26786
|
+
viaPadDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26787
|
+
viaHoleDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26788
|
+
silkscreenTextPosition: zod.ZodOptional<zod.ZodUnion<[zod.ZodEnum<["centered", "outside", "none"]>, zod.ZodObject<{
|
|
26789
|
+
offsetX: zod.ZodNumber;
|
|
26790
|
+
offsetY: zod.ZodNumber;
|
|
26791
|
+
}, "strip", zod.ZodTypeAny, {
|
|
26792
|
+
offsetX: number;
|
|
26793
|
+
offsetY: number;
|
|
26794
|
+
}, {
|
|
26795
|
+
offsetX: number;
|
|
26796
|
+
offsetY: number;
|
|
26797
|
+
}>]>>;
|
|
26798
|
+
silkscreenTextVisibility: zod.ZodOptional<zod.ZodEnum<["hidden", "visible", "inherit"]>>;
|
|
26799
|
+
}, "strip", zod.ZodTypeAny, {
|
|
26800
|
+
silkscreenFontSize?: number | undefined;
|
|
26801
|
+
viaPadDiameter?: number | undefined;
|
|
26802
|
+
viaHoleDiameter?: number | undefined;
|
|
26803
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
26804
|
+
offsetX: number;
|
|
26805
|
+
offsetY: number;
|
|
26806
|
+
} | undefined;
|
|
26807
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
26808
|
+
}, {
|
|
26809
|
+
silkscreenFontSize?: string | number | undefined;
|
|
26810
|
+
viaPadDiameter?: string | number | undefined;
|
|
26811
|
+
viaHoleDiameter?: string | number | undefined;
|
|
26812
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
26813
|
+
offsetX: number;
|
|
26814
|
+
offsetY: number;
|
|
26815
|
+
} | undefined;
|
|
26816
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
26817
|
+
}>>;
|
|
26818
|
+
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
26819
|
+
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
26820
|
+
} & {
|
|
26821
|
+
text: zod.ZodString;
|
|
26822
|
+
anchorAlignment: zod.ZodDefault<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
26823
|
+
font: zod.ZodOptional<zod.ZodEnum<["tscircuit2024"]>>;
|
|
26824
|
+
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
26825
|
+
layers: zod.ZodOptional<zod.ZodArray<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
26826
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
26827
|
+
}, "strip", zod.ZodTypeAny, {
|
|
26828
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26829
|
+
}, {
|
|
26830
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26831
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
26832
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26833
|
+
}>, "many">>;
|
|
26834
|
+
knockout: zod.ZodOptional<zod.ZodBoolean>;
|
|
26835
|
+
mirrored: zod.ZodOptional<zod.ZodBoolean>;
|
|
26836
|
+
}, "strip", zod.ZodTypeAny, {
|
|
26837
|
+
anchorAlignment: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right";
|
|
26838
|
+
text: string;
|
|
26839
|
+
pcbX?: string | number | undefined;
|
|
26840
|
+
pcbY?: string | number | undefined;
|
|
26841
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
26842
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
26843
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
26844
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
26845
|
+
pcbOffsetX?: number | undefined;
|
|
26846
|
+
pcbOffsetY?: number | undefined;
|
|
26847
|
+
pcbRotation?: number | undefined;
|
|
26848
|
+
pcbPositionAnchor?: string | undefined;
|
|
26849
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
26850
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
26851
|
+
pcbMarginTop?: number | undefined;
|
|
26852
|
+
pcbMarginRight?: number | undefined;
|
|
26853
|
+
pcbMarginBottom?: number | undefined;
|
|
26854
|
+
pcbMarginLeft?: number | undefined;
|
|
26855
|
+
pcbMarginX?: number | undefined;
|
|
26856
|
+
pcbMarginY?: number | undefined;
|
|
26857
|
+
pcbStyle?: {
|
|
26858
|
+
silkscreenFontSize?: number | undefined;
|
|
26859
|
+
viaPadDiameter?: number | undefined;
|
|
26860
|
+
viaHoleDiameter?: number | undefined;
|
|
26861
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
26862
|
+
offsetX: number;
|
|
26863
|
+
offsetY: number;
|
|
26864
|
+
} | undefined;
|
|
26865
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
26866
|
+
} | undefined;
|
|
26867
|
+
pcbRelative?: boolean | undefined;
|
|
26868
|
+
relative?: boolean | undefined;
|
|
26869
|
+
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6")[] | undefined;
|
|
26870
|
+
font?: "tscircuit2024" | undefined;
|
|
26871
|
+
fontSize?: number | undefined;
|
|
26872
|
+
knockout?: boolean | undefined;
|
|
26873
|
+
mirrored?: boolean | undefined;
|
|
26874
|
+
}, {
|
|
26875
|
+
text: string;
|
|
26876
|
+
pcbX?: string | number | undefined;
|
|
26877
|
+
pcbY?: string | number | undefined;
|
|
26878
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
26879
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
26880
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
26881
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
26882
|
+
pcbOffsetX?: string | number | undefined;
|
|
26883
|
+
pcbOffsetY?: string | number | undefined;
|
|
26884
|
+
pcbRotation?: string | number | undefined;
|
|
26885
|
+
pcbPositionAnchor?: string | undefined;
|
|
26886
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
26887
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
26888
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26889
|
+
} | undefined;
|
|
26890
|
+
pcbMarginTop?: string | number | undefined;
|
|
26891
|
+
pcbMarginRight?: string | number | undefined;
|
|
26892
|
+
pcbMarginBottom?: string | number | undefined;
|
|
26893
|
+
pcbMarginLeft?: string | number | undefined;
|
|
26894
|
+
pcbMarginX?: string | number | undefined;
|
|
26895
|
+
pcbMarginY?: string | number | undefined;
|
|
26896
|
+
pcbStyle?: {
|
|
26897
|
+
silkscreenFontSize?: string | number | undefined;
|
|
26898
|
+
viaPadDiameter?: string | number | undefined;
|
|
26899
|
+
viaHoleDiameter?: string | number | undefined;
|
|
26900
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
26901
|
+
offsetX: number;
|
|
26902
|
+
offsetY: number;
|
|
26903
|
+
} | undefined;
|
|
26904
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
26905
|
+
} | undefined;
|
|
26906
|
+
pcbRelative?: boolean | undefined;
|
|
26907
|
+
relative?: boolean | undefined;
|
|
26908
|
+
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
26909
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
26910
|
+
})[] | undefined;
|
|
26911
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
26912
|
+
font?: "tscircuit2024" | undefined;
|
|
26913
|
+
fontSize?: string | number | undefined;
|
|
26914
|
+
knockout?: boolean | undefined;
|
|
26915
|
+
mirrored?: boolean | undefined;
|
|
26916
|
+
}>;
|
|
26917
|
+
};
|
|
26918
|
+
doInitialPcbPrimitiveRender(): void;
|
|
26919
|
+
}
|
|
26920
|
+
|
|
26753
26921
|
declare class Cutout extends PrimitiveComponent<typeof cutoutProps> {
|
|
26754
26922
|
pcb_cutout_id: string | null;
|
|
26755
26923
|
isPcbPrimitive: boolean;
|
|
@@ -43291,6 +43459,7 @@ interface TscircuitElements {
|
|
|
43291
43459
|
name?: string;
|
|
43292
43460
|
};
|
|
43293
43461
|
silkscreentext: _tscircuit_props.SilkscreenTextProps;
|
|
43462
|
+
coppertext: _tscircuit_props.CopperTextProps;
|
|
43294
43463
|
cutout: _tscircuit_props.CutoutProps;
|
|
43295
43464
|
silkscreenpath: _tscircuit_props.SilkscreenPathProps;
|
|
43296
43465
|
silkscreenline: _tscircuit_props.SilkscreenLineProps;
|
|
@@ -43337,4 +43506,4 @@ declare module "react/jsx-runtime" {
|
|
|
43337
43506
|
}
|
|
43338
43507
|
}
|
|
43339
43508
|
|
|
43340
|
-
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, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, 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, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
43509
|
+
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, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, 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, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __export(components_exports, {
|
|
|
18
18
|
Chip: () => Chip,
|
|
19
19
|
Constraint: () => Constraint3,
|
|
20
20
|
CopperPour: () => CopperPour,
|
|
21
|
+
CopperText: () => CopperText,
|
|
21
22
|
Crystal: () => Crystal,
|
|
22
23
|
Cutout: () => Cutout,
|
|
23
24
|
Diode: () => Diode,
|
|
@@ -15758,14 +15759,8 @@ var Board = class extends Group6 {
|
|
|
15758
15759
|
const maxX = Math.max(...xValues);
|
|
15759
15760
|
const minY = Math.min(...yValues);
|
|
15760
15761
|
const maxY = Math.max(...yValues);
|
|
15761
|
-
const outlineCenterX = (minX + maxX) / 2;
|
|
15762
|
-
const outlineCenterY = (minY + maxY) / 2;
|
|
15763
15762
|
computedWidth = maxX - minX;
|
|
15764
15763
|
computedHeight = maxY - minY;
|
|
15765
|
-
center = {
|
|
15766
|
-
x: outlineCenterX + (props.outlineOffsetX ?? 0),
|
|
15767
|
-
y: outlineCenterY + (props.outlineOffsetY ?? 0)
|
|
15768
|
-
};
|
|
15769
15764
|
}
|
|
15770
15765
|
let outline = props.outline;
|
|
15771
15766
|
if (!outline && props.borderRadius != null && computedWidth > 0 && computedHeight > 0) {
|
|
@@ -15853,20 +15848,57 @@ var Board = class extends Group6 {
|
|
|
15853
15848
|
}
|
|
15854
15849
|
}
|
|
15855
15850
|
_repositionOnPcb(position) {
|
|
15856
|
-
|
|
15851
|
+
const { db } = this.root;
|
|
15852
|
+
const pcbBoard = this.pcb_board_id ? db.pcb_board.get(this.pcb_board_id) : null;
|
|
15853
|
+
const oldPos = pcbBoard?.center;
|
|
15854
|
+
if (!oldPos) {
|
|
15855
|
+
if (this.pcb_board_id) {
|
|
15856
|
+
db.pcb_board.update(this.pcb_board_id, { center: position });
|
|
15857
|
+
}
|
|
15858
|
+
return;
|
|
15859
|
+
}
|
|
15860
|
+
const deltaX = position.x - oldPos.x;
|
|
15861
|
+
const deltaY = position.y - oldPos.y;
|
|
15862
|
+
if (Math.abs(deltaX) < 1e-6 && Math.abs(deltaY) < 1e-6) {
|
|
15863
|
+
return;
|
|
15864
|
+
}
|
|
15865
|
+
for (const child of this.children) {
|
|
15866
|
+
if (child instanceof NormalComponent3) {
|
|
15867
|
+
let childOldCenter;
|
|
15868
|
+
if (child.pcb_component_id) {
|
|
15869
|
+
const comp = db.pcb_component.get(child.pcb_component_id);
|
|
15870
|
+
if (comp) childOldCenter = comp.center;
|
|
15871
|
+
} else if (child instanceof Group6 && child.pcb_group_id) {
|
|
15872
|
+
const group = db.pcb_group.get(child.pcb_group_id);
|
|
15873
|
+
if (group) childOldCenter = group.center;
|
|
15874
|
+
}
|
|
15875
|
+
if (childOldCenter) {
|
|
15876
|
+
child._repositionOnPcb({
|
|
15877
|
+
x: childOldCenter.x + deltaX,
|
|
15878
|
+
y: childOldCenter.y + deltaY
|
|
15879
|
+
});
|
|
15880
|
+
}
|
|
15881
|
+
}
|
|
15882
|
+
}
|
|
15857
15883
|
if (this.pcb_board_id) {
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
outline
|
|
15869
|
-
|
|
15884
|
+
db.pcb_board.update(this.pcb_board_id, { center: position });
|
|
15885
|
+
if (pcbBoard?.outline) {
|
|
15886
|
+
const outlineBounds = getBoundsFromPoints4(pcbBoard.outline);
|
|
15887
|
+
if (outlineBounds) {
|
|
15888
|
+
const oldOutlineCenter = {
|
|
15889
|
+
x: (outlineBounds.minX + outlineBounds.maxX) / 2,
|
|
15890
|
+
y: (outlineBounds.minY + outlineBounds.maxY) / 2
|
|
15891
|
+
};
|
|
15892
|
+
const outlineDeltaX = position.x - oldOutlineCenter.x;
|
|
15893
|
+
const outlineDeltaY = position.y - oldOutlineCenter.y;
|
|
15894
|
+
const newOutline = pcbBoard.outline.map((p) => ({
|
|
15895
|
+
x: p.x + outlineDeltaX,
|
|
15896
|
+
y: p.y + outlineDeltaY
|
|
15897
|
+
}));
|
|
15898
|
+
db.pcb_board.update(this.pcb_board_id, {
|
|
15899
|
+
outline: newOutline
|
|
15900
|
+
});
|
|
15901
|
+
}
|
|
15870
15902
|
}
|
|
15871
15903
|
}
|
|
15872
15904
|
}
|
|
@@ -18088,6 +18120,43 @@ var CopperPour = class extends PrimitiveComponent2 {
|
|
|
18088
18120
|
}
|
|
18089
18121
|
};
|
|
18090
18122
|
|
|
18123
|
+
// lib/components/primitive-components/CopperText.ts
|
|
18124
|
+
import { copperTextProps } from "@tscircuit/props";
|
|
18125
|
+
var CopperText = class extends PrimitiveComponent2 {
|
|
18126
|
+
isPcbPrimitive = true;
|
|
18127
|
+
get config() {
|
|
18128
|
+
return {
|
|
18129
|
+
componentName: "CopperText",
|
|
18130
|
+
zodProps: copperTextProps
|
|
18131
|
+
};
|
|
18132
|
+
}
|
|
18133
|
+
doInitialPcbPrimitiveRender() {
|
|
18134
|
+
if (this.root?.pcbDisabled) return;
|
|
18135
|
+
const { db } = this.root;
|
|
18136
|
+
const { _parsedProps: props } = this;
|
|
18137
|
+
const container = this.getPrimitiveContainer();
|
|
18138
|
+
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
18139
|
+
const subcircuit = this.getSubcircuit();
|
|
18140
|
+
db.pcb_copper_text.insert({
|
|
18141
|
+
anchor_alignment: props.anchorAlignment,
|
|
18142
|
+
anchor_position: {
|
|
18143
|
+
x: position.x,
|
|
18144
|
+
y: position.y
|
|
18145
|
+
},
|
|
18146
|
+
font: "tscircuit2024",
|
|
18147
|
+
font_size: props.fontSize,
|
|
18148
|
+
layer: props.layer ?? "top",
|
|
18149
|
+
text: normalizeTextForCircuitJson(props.text),
|
|
18150
|
+
ccw_rotation: props.pcbRotation,
|
|
18151
|
+
is_mirrored: props.mirrored,
|
|
18152
|
+
is_knockout: props.knockout,
|
|
18153
|
+
pcb_component_id: container.pcb_component_id,
|
|
18154
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
18155
|
+
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
18156
|
+
});
|
|
18157
|
+
}
|
|
18158
|
+
};
|
|
18159
|
+
|
|
18091
18160
|
// lib/components/normal-components/Battery.ts
|
|
18092
18161
|
import { batteryProps } from "@tscircuit/props";
|
|
18093
18162
|
var Battery = class extends NormalComponent3 {
|
|
@@ -19465,7 +19534,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19465
19534
|
var package_default = {
|
|
19466
19535
|
name: "@tscircuit/core",
|
|
19467
19536
|
type: "module",
|
|
19468
|
-
version: "0.0.
|
|
19537
|
+
version: "0.0.926",
|
|
19469
19538
|
types: "dist/index.d.ts",
|
|
19470
19539
|
main: "dist/index.js",
|
|
19471
19540
|
module: "dist/index.js",
|
|
@@ -19509,7 +19578,7 @@ var package_default = {
|
|
|
19509
19578
|
"@tscircuit/math-utils": "^0.0.29",
|
|
19510
19579
|
"@tscircuit/miniflex": "^0.0.4",
|
|
19511
19580
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
19512
|
-
"@tscircuit/props": "^0.0.
|
|
19581
|
+
"@tscircuit/props": "^0.0.428",
|
|
19513
19582
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
19514
19583
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
19515
19584
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -19529,7 +19598,7 @@ var package_default = {
|
|
|
19529
19598
|
"circuit-json-to-gltf": "^0.0.31",
|
|
19530
19599
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
19531
19600
|
"circuit-json-to-spice": "^0.0.30",
|
|
19532
|
-
"circuit-to-svg": "^0.0.
|
|
19601
|
+
"circuit-to-svg": "^0.0.296",
|
|
19533
19602
|
concurrently: "^9.1.2",
|
|
19534
19603
|
"connectivity-map": "^1.0.0",
|
|
19535
19604
|
debug: "^4.3.6",
|
|
@@ -20028,6 +20097,7 @@ export {
|
|
|
20028
20097
|
Circuit,
|
|
20029
20098
|
Constraint3 as Constraint,
|
|
20030
20099
|
CopperPour,
|
|
20100
|
+
CopperText,
|
|
20031
20101
|
Crystal,
|
|
20032
20102
|
Cutout,
|
|
20033
20103
|
Diode,
|
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.927",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tscircuit/math-utils": "^0.0.29",
|
|
46
46
|
"@tscircuit/miniflex": "^0.0.4",
|
|
47
47
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
48
|
-
"@tscircuit/props": "^0.0.
|
|
48
|
+
"@tscircuit/props": "^0.0.428",
|
|
49
49
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
50
50
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
51
51
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
67
|
"circuit-json-to-spice": "^0.0.30",
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
68
|
+
"circuit-to-svg": "^0.0.296",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|