@tscircuit/core 0.0.504 → 0.0.505
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 +6 -3
- package/dist/index.js +65 -53
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as _tscircuit_layout from '@tscircuit/layout';
|
|
|
12
12
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
13
13
|
import { GraphicsObject } from 'graphics-debug';
|
|
14
14
|
|
|
15
|
-
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicPrimitiveRender", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
|
|
15
|
+
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicPrimitiveRender", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
|
|
16
16
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
17
17
|
type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
|
|
18
18
|
type RenderPhaseStates = Record<RenderPhase, {
|
|
@@ -289,7 +289,7 @@ type TransistorPorts = "pin1" | "pin2" | "pin3" | "emitter" | "collector" | "bas
|
|
|
289
289
|
interface BaseComponentConfig {
|
|
290
290
|
componentName: string;
|
|
291
291
|
schematicSymbolName?: string | null;
|
|
292
|
-
zodProps: ZodType;
|
|
292
|
+
zodProps: z.ZodType;
|
|
293
293
|
sourceFtype?: Ftype | null;
|
|
294
294
|
shouldRenderAsSchematicBox?: boolean;
|
|
295
295
|
}
|
|
@@ -317,6 +317,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
317
317
|
*/
|
|
318
318
|
get isSubcircuit(): any;
|
|
319
319
|
get isGroup(): boolean;
|
|
320
|
+
get name(): any;
|
|
320
321
|
/**
|
|
321
322
|
* A primitive container is a component that contains one or more ports and
|
|
322
323
|
* primitive components that are designed to interact.
|
|
@@ -333,6 +334,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
333
334
|
schematic_component_id: string | null;
|
|
334
335
|
pcb_component_id: string | null;
|
|
335
336
|
cad_component_id: string | null;
|
|
337
|
+
fallbackUnassignedName?: string;
|
|
336
338
|
constructor(props: z.input<ZodProps>);
|
|
337
339
|
setProps(props: Partial<z.input<ZodProps>>): void;
|
|
338
340
|
/**
|
|
@@ -448,6 +450,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
448
450
|
doesSelectorMatch(selector: string): boolean;
|
|
449
451
|
getSubcircuit(): ISubcircuit;
|
|
450
452
|
getGroup(): IGroup | null;
|
|
453
|
+
doInitialAssignNameToUnnamedComponents(): void;
|
|
451
454
|
doInitialOptimizeSelectorCache(): void;
|
|
452
455
|
_cachedSelectAllQueries: Map<string, PrimitiveComponent[]>;
|
|
453
456
|
selectAll(selectorRaw: string): PrimitiveComponent[];
|
|
@@ -928,7 +931,7 @@ type PortMap<T extends string> = {
|
|
|
928
931
|
* }
|
|
929
932
|
* }
|
|
930
933
|
*/
|
|
931
|
-
declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends string = never> extends PrimitiveComponent<ZodProps> implements INormalComponent {
|
|
934
|
+
declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extends string = never> extends PrimitiveComponent<ZodProps> implements INormalComponent {
|
|
932
935
|
reactSubtrees: Array<ReactSubtree>;
|
|
933
936
|
_impliedFootprint?: string | undefined;
|
|
934
937
|
isPrimitiveContainer: boolean;
|
package/dist/index.js
CHANGED
|
@@ -88,6 +88,7 @@ var orderedRenderPhases = [
|
|
|
88
88
|
"CreateTracesFromNetLabels",
|
|
89
89
|
"CreateTraceHintsFromProps",
|
|
90
90
|
"SourceGroupRender",
|
|
91
|
+
"AssignNameToUnnamedComponents",
|
|
91
92
|
"SourceRender",
|
|
92
93
|
"SourceParentAttachment",
|
|
93
94
|
"PortMatching",
|
|
@@ -302,12 +303,6 @@ var extendCatalogue = (objects) => {
|
|
|
302
303
|
Object.assign(catalogue, altKeys);
|
|
303
304
|
};
|
|
304
305
|
|
|
305
|
-
// lib/fiber/create-instance-from-react-element.ts
|
|
306
|
-
import { identity as identity2 } from "transformation-matrix";
|
|
307
|
-
|
|
308
|
-
// lib/components/base-components/PrimitiveComponent/PrimitiveComponent.ts
|
|
309
|
-
import "debug";
|
|
310
|
-
|
|
311
306
|
// lib/errors/InvalidProps.ts
|
|
312
307
|
var InvalidProps = class extends Error {
|
|
313
308
|
constructor(componentName, originalProps, formattedError) {
|
|
@@ -335,6 +330,12 @@ var InvalidProps = class extends Error {
|
|
|
335
330
|
}
|
|
336
331
|
};
|
|
337
332
|
|
|
333
|
+
// lib/fiber/create-instance-from-react-element.ts
|
|
334
|
+
import { identity as identity2 } from "transformation-matrix";
|
|
335
|
+
|
|
336
|
+
// lib/components/base-components/PrimitiveComponent/PrimitiveComponent.ts
|
|
337
|
+
import "debug";
|
|
338
|
+
|
|
338
339
|
// lib/utils/selector-matching/is-matching-selector.ts
|
|
339
340
|
function isMatchingSelector(component, selector) {
|
|
340
341
|
const idMatch = selector.match(/^#(\w+)/);
|
|
@@ -553,6 +554,9 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
553
554
|
get isGroup() {
|
|
554
555
|
return this.lowercaseComponentName === "group";
|
|
555
556
|
}
|
|
557
|
+
get name() {
|
|
558
|
+
return this._parsedProps.name ?? this.fallbackUnassignedName ?? "TODO_REMOVE_THIS";
|
|
559
|
+
}
|
|
556
560
|
/**
|
|
557
561
|
* A primitive container is a component that contains one or more ports and
|
|
558
562
|
* primitive components that are designed to interact.
|
|
@@ -569,13 +573,17 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
569
573
|
schematic_component_id = null;
|
|
570
574
|
pcb_component_id = null;
|
|
571
575
|
cad_component_id = null;
|
|
576
|
+
fallbackUnassignedName;
|
|
572
577
|
constructor(props) {
|
|
573
578
|
super(props);
|
|
574
579
|
this.children = [];
|
|
575
580
|
this.childrenPendingRemoval = [];
|
|
576
581
|
this.props = props ?? {};
|
|
577
582
|
this.externallyAddedAliases = [];
|
|
578
|
-
const
|
|
583
|
+
const zodProps = "partial" in this.config.zodProps ? this.config.zodProps.partial({
|
|
584
|
+
name: true
|
|
585
|
+
}) : this.config.zodProps;
|
|
586
|
+
const parsePropsResult = zodProps.safeParse(props ?? {});
|
|
579
587
|
if (parsePropsResult.success) {
|
|
580
588
|
this._parsedProps = parsePropsResult.data;
|
|
581
589
|
} else {
|
|
@@ -881,24 +889,21 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
881
889
|
component.shouldBeRemoved = true;
|
|
882
890
|
}
|
|
883
891
|
getSubcircuitSelector() {
|
|
884
|
-
const name = this.
|
|
892
|
+
const name = this.name;
|
|
885
893
|
const endPart = name ? `${this.lowercaseComponentName}.${name}` : this.lowercaseComponentName;
|
|
886
894
|
if (!this.parent) return endPart;
|
|
887
895
|
if (this.parent.isSubcircuit) return endPart;
|
|
888
896
|
return `${this.parent.getSubcircuitSelector()} > ${endPart}`;
|
|
889
897
|
}
|
|
890
898
|
getFullPathSelector() {
|
|
891
|
-
const name = this.
|
|
899
|
+
const name = this.name;
|
|
892
900
|
const endPart = name ? `${this.lowercaseComponentName}.${name}` : this.lowercaseComponentName;
|
|
893
901
|
const parentSelector = this.parent?.getFullPathSelector?.();
|
|
894
902
|
if (!parentSelector) return endPart;
|
|
895
903
|
return `${parentSelector} > ${endPart}`;
|
|
896
904
|
}
|
|
897
905
|
getNameAndAliases() {
|
|
898
|
-
return [
|
|
899
|
-
this._parsedProps.name,
|
|
900
|
-
...this._parsedProps.portHints ?? []
|
|
901
|
-
].filter(Boolean);
|
|
906
|
+
return [this.name, ...this._parsedProps.portHints ?? []].filter(Boolean);
|
|
902
907
|
}
|
|
903
908
|
isMatchingNameOrAlias(name) {
|
|
904
909
|
return this.getNameAndAliases().includes(name);
|
|
@@ -913,7 +918,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
913
918
|
}
|
|
914
919
|
doesSelectorMatch(selector) {
|
|
915
920
|
const myTypeNames = [this.componentName, this.lowercaseComponentName];
|
|
916
|
-
const myClassNames = [this.
|
|
921
|
+
const myClassNames = [this.name].filter(Boolean);
|
|
917
922
|
const parts = selector.trim().split(/\> /)[0];
|
|
918
923
|
const firstPart = parts[0];
|
|
919
924
|
if (parts.length > 1) return false;
|
|
@@ -936,6 +941,11 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
936
941
|
if (this.isGroup) return this;
|
|
937
942
|
return this.parent?.getGroup?.() ?? null;
|
|
938
943
|
}
|
|
944
|
+
doInitialAssignNameToUnnamedComponents() {
|
|
945
|
+
if (!this._parsedProps.name) {
|
|
946
|
+
this.fallbackUnassignedName = `UNNAMED_${this.getSubcircuit().subcircuit_id}`;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
939
949
|
doInitialOptimizeSelectorCache() {
|
|
940
950
|
if (!this.isSubcircuit) return;
|
|
941
951
|
const ports = this.selectAll("port");
|
|
@@ -5622,11 +5632,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
5622
5632
|
return s.startsWith("http://") || s.startsWith("https://");
|
|
5623
5633
|
}
|
|
5624
5634
|
_addChildrenFromStringFootprint() {
|
|
5625
|
-
const {
|
|
5626
|
-
name: componentName,
|
|
5627
|
-
pcbRotation: componentRotation,
|
|
5628
|
-
pinLabels
|
|
5629
|
-
} = this.props;
|
|
5635
|
+
const { pcbRotation, pinLabels } = this.props;
|
|
5630
5636
|
let { footprint } = this.props;
|
|
5631
5637
|
footprint ??= this._getImpliedFootprintString?.();
|
|
5632
5638
|
if (!footprint) return;
|
|
@@ -5634,7 +5640,12 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
5634
5640
|
if (this._isFootprintUrl(footprint)) return;
|
|
5635
5641
|
const fpSoup = fp.string(footprint).soup();
|
|
5636
5642
|
const fpComponents = createComponentsFromCircuitJson(
|
|
5637
|
-
{
|
|
5643
|
+
{
|
|
5644
|
+
componentName: this.name,
|
|
5645
|
+
componentRotation: pcbRotation,
|
|
5646
|
+
footprint,
|
|
5647
|
+
pinLabels
|
|
5648
|
+
},
|
|
5638
5649
|
fpSoup
|
|
5639
5650
|
);
|
|
5640
5651
|
this.addAll(fpComponents);
|
|
@@ -5671,7 +5682,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
5671
5682
|
const { _parsedProps: props } = this;
|
|
5672
5683
|
const source_component = db.source_component.insert({
|
|
5673
5684
|
ftype,
|
|
5674
|
-
name:
|
|
5685
|
+
name: this.name,
|
|
5675
5686
|
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
|
|
5676
5687
|
supplier_part_numbers: props.supplierPartNumbers
|
|
5677
5688
|
});
|
|
@@ -5880,11 +5891,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
5880
5891
|
let { footprint } = this.props;
|
|
5881
5892
|
footprint ??= this._getImpliedFootprintString?.();
|
|
5882
5893
|
if (!footprint) return;
|
|
5883
|
-
const {
|
|
5884
|
-
name: componentName,
|
|
5885
|
-
pcbRotation: componentRotation,
|
|
5886
|
-
pinLabels
|
|
5887
|
-
} = this.props;
|
|
5894
|
+
const { pcbRotation, pinLabels } = this.props;
|
|
5888
5895
|
if (typeof footprint === "string" && this._isFootprintUrl(footprint)) {
|
|
5889
5896
|
if (this._hasStartedFootprintUrlLoad) return;
|
|
5890
5897
|
this._hasStartedFootprintUrlLoad = true;
|
|
@@ -5893,7 +5900,12 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
5893
5900
|
const res = await fetch(url);
|
|
5894
5901
|
const soup = await res.json();
|
|
5895
5902
|
const fpComponents = createComponentsFromCircuitJson(
|
|
5896
|
-
{
|
|
5903
|
+
{
|
|
5904
|
+
componentName: this.name,
|
|
5905
|
+
componentRotation: pcbRotation,
|
|
5906
|
+
footprint: url,
|
|
5907
|
+
pinLabels
|
|
5908
|
+
},
|
|
5897
5909
|
soup
|
|
5898
5910
|
);
|
|
5899
5911
|
this.addAll(fpComponents);
|
|
@@ -7557,7 +7569,7 @@ var Group = class extends NormalComponent {
|
|
|
7557
7569
|
doInitialSourceGroupRender() {
|
|
7558
7570
|
const { db } = this.root;
|
|
7559
7571
|
const source_group = db.source_group.insert({
|
|
7560
|
-
name: this.
|
|
7572
|
+
name: this.name,
|
|
7561
7573
|
is_subcircuit: this.isSubcircuit
|
|
7562
7574
|
});
|
|
7563
7575
|
this.source_group_id = source_group.source_group_id;
|
|
@@ -7592,7 +7604,7 @@ var Group = class extends NormalComponent {
|
|
|
7592
7604
|
const pcb_group = db.pcb_group.insert({
|
|
7593
7605
|
is_subcircuit: this.isSubcircuit,
|
|
7594
7606
|
subcircuit_id: this.subcircuit_id,
|
|
7595
|
-
name: this.
|
|
7607
|
+
name: this.name,
|
|
7596
7608
|
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
7597
7609
|
width: 0,
|
|
7598
7610
|
height: 0,
|
|
@@ -8011,7 +8023,7 @@ var Group = class extends NormalComponent {
|
|
|
8011
8023
|
const schematic_group = db.schematic_group.insert({
|
|
8012
8024
|
is_subcircuit: this.isSubcircuit,
|
|
8013
8025
|
subcircuit_id: this.subcircuit_id,
|
|
8014
|
-
name: this.
|
|
8026
|
+
name: this.name,
|
|
8015
8027
|
center: this._getGlobalSchematicPositionBeforeLayout(),
|
|
8016
8028
|
width: 0,
|
|
8017
8029
|
height: 0,
|
|
@@ -8211,7 +8223,7 @@ var Group = class extends NormalComponent {
|
|
|
8211
8223
|
if (components.length > 1) {
|
|
8212
8224
|
db.pcb_trace_error.insert({
|
|
8213
8225
|
error_type: "pcb_trace_error",
|
|
8214
|
-
message: `Multiple components found with name "${name}" in subcircuit "${this.
|
|
8226
|
+
message: `Multiple components found with name "${name}" in subcircuit "${this.name || "unnamed"}". Component names must be unique within a subcircuit.`,
|
|
8215
8227
|
source_trace_id: "",
|
|
8216
8228
|
pcb_trace_id: "",
|
|
8217
8229
|
pcb_component_ids: components.map((c) => c.pcb_component_id).filter(Boolean),
|
|
@@ -8438,7 +8450,7 @@ var Capacitor = class extends NormalComponent {
|
|
|
8438
8450
|
const { _parsedProps: props } = this;
|
|
8439
8451
|
const source_component = db.source_component.insert({
|
|
8440
8452
|
ftype: "simple_capacitor",
|
|
8441
|
-
name:
|
|
8453
|
+
name: this.name,
|
|
8442
8454
|
// @ts-ignore
|
|
8443
8455
|
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
|
|
8444
8456
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
@@ -8473,7 +8485,7 @@ var Chip = class extends NormalComponent {
|
|
|
8473
8485
|
const { _parsedProps: props } = this;
|
|
8474
8486
|
const source_component = db.source_component.insert({
|
|
8475
8487
|
ftype: "simple_chip",
|
|
8476
|
-
name:
|
|
8488
|
+
name: this.name,
|
|
8477
8489
|
manufacturer_part_number: props.manufacturerPartNumber,
|
|
8478
8490
|
supplier_part_numbers: props.supplierPartNumbers
|
|
8479
8491
|
});
|
|
@@ -8537,7 +8549,7 @@ var Diode = class extends NormalComponent {
|
|
|
8537
8549
|
const { _parsedProps: props } = this;
|
|
8538
8550
|
const source_component = db.source_component.insert({
|
|
8539
8551
|
ftype: "simple_diode",
|
|
8540
|
-
name:
|
|
8552
|
+
name: this.name,
|
|
8541
8553
|
// @ts-ignore
|
|
8542
8554
|
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
|
|
8543
8555
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
@@ -8576,7 +8588,7 @@ var Fuse = class extends NormalComponent {
|
|
|
8576
8588
|
const currentRating = typeof props.currentRating === "string" ? parseFloat(props.currentRating) : props.currentRating;
|
|
8577
8589
|
const voltageRating = typeof props.voltageRating === "string" ? parseFloat(props.voltageRating) : props.voltageRating;
|
|
8578
8590
|
const source_component = db.source_component.insert({
|
|
8579
|
-
name:
|
|
8591
|
+
name: this.name,
|
|
8580
8592
|
ftype: FTYPE.simple_fuse,
|
|
8581
8593
|
current_rating_amps: currentRating,
|
|
8582
8594
|
voltage_rating_volts: voltageRating,
|
|
@@ -8615,7 +8627,7 @@ var Jumper = class extends NormalComponent {
|
|
|
8615
8627
|
const source_component = db.source_component.insert({
|
|
8616
8628
|
ftype: "simple_chip",
|
|
8617
8629
|
// TODO unknown or jumper
|
|
8618
|
-
name:
|
|
8630
|
+
name: this.name,
|
|
8619
8631
|
manufacturer_part_number: props.manufacturerPartNumber,
|
|
8620
8632
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
8621
8633
|
are_pins_interchangeable: true
|
|
@@ -8750,7 +8762,7 @@ var SolderJumper = class extends NormalComponent {
|
|
|
8750
8762
|
const source_component = db.source_component.insert({
|
|
8751
8763
|
ftype: "simple_chip",
|
|
8752
8764
|
// TODO unknown or jumper
|
|
8753
|
-
name:
|
|
8765
|
+
name: this.name,
|
|
8754
8766
|
manufacturer_part_number: props.manufacturerPartNumber,
|
|
8755
8767
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
8756
8768
|
are_pins_interchangeable: true
|
|
@@ -8848,7 +8860,7 @@ var Led = class extends NormalComponent {
|
|
|
8848
8860
|
const { _parsedProps: props } = this;
|
|
8849
8861
|
const source_component = db.source_component.insert({
|
|
8850
8862
|
ftype: "simple_led",
|
|
8851
|
-
name:
|
|
8863
|
+
name: this.name,
|
|
8852
8864
|
wave_length: props.wavelength,
|
|
8853
8865
|
color: props.color,
|
|
8854
8866
|
symbol_display_value: this._getSchematicSymbolDisplayValue(),
|
|
@@ -8891,7 +8903,7 @@ var PowerSource = class extends NormalComponent {
|
|
|
8891
8903
|
const { _parsedProps: props } = this;
|
|
8892
8904
|
const source_component = db.source_component.insert({
|
|
8893
8905
|
ftype: "simple_power_source",
|
|
8894
|
-
name:
|
|
8906
|
+
name: this.name,
|
|
8895
8907
|
voltage: props.voltage,
|
|
8896
8908
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
8897
8909
|
are_pins_interchangeable: false
|
|
@@ -8972,7 +8984,7 @@ var Resistor = class extends NormalComponent {
|
|
|
8972
8984
|
const { _parsedProps: props } = this;
|
|
8973
8985
|
const source_component = db.source_component.insert({
|
|
8974
8986
|
ftype: "simple_resistor",
|
|
8975
|
-
name:
|
|
8987
|
+
name: this.name,
|
|
8976
8988
|
// @ts-ignore
|
|
8977
8989
|
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
|
|
8978
8990
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
@@ -9677,7 +9689,7 @@ var Battery = class extends NormalComponent {
|
|
|
9677
9689
|
const { db } = this.root;
|
|
9678
9690
|
const { _parsedProps: props } = this;
|
|
9679
9691
|
const source_component = db.source_component.insert({
|
|
9680
|
-
name:
|
|
9692
|
+
name: this.name,
|
|
9681
9693
|
ftype: "simple_power_source",
|
|
9682
9694
|
capacity: props.capacity,
|
|
9683
9695
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
@@ -9748,7 +9760,7 @@ var PinHeader = class extends NormalComponent {
|
|
|
9748
9760
|
const { _parsedProps: props } = this;
|
|
9749
9761
|
const source_component = db.source_component.insert({
|
|
9750
9762
|
ftype: "simple_pin_header",
|
|
9751
|
-
name:
|
|
9763
|
+
name: this.name,
|
|
9752
9764
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
9753
9765
|
pin_count: props.pinCount,
|
|
9754
9766
|
gender: props.gender,
|
|
@@ -9787,7 +9799,7 @@ var Resonator = class extends NormalComponent {
|
|
|
9787
9799
|
const pinVariant = props.pinVariant || "no_ground";
|
|
9788
9800
|
const source_component = db.source_component.insert({
|
|
9789
9801
|
ftype: "simple_resonator",
|
|
9790
|
-
name:
|
|
9802
|
+
name: this.name,
|
|
9791
9803
|
frequency: props.frequency,
|
|
9792
9804
|
load_capacitance: props.loadCapacitance,
|
|
9793
9805
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
@@ -9825,7 +9837,7 @@ var Inductor = class extends NormalComponent {
|
|
|
9825
9837
|
const { db } = this.root;
|
|
9826
9838
|
const { _parsedProps: props } = this;
|
|
9827
9839
|
const source_component = db.source_component.insert({
|
|
9828
|
-
name:
|
|
9840
|
+
name: this.name,
|
|
9829
9841
|
ftype: FTYPE.simple_inductor,
|
|
9830
9842
|
inductance: props.inductance,
|
|
9831
9843
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
@@ -9866,7 +9878,7 @@ var Potentiometer = class extends NormalComponent {
|
|
|
9866
9878
|
const pinVariant = props.pinVariant || "two_pin";
|
|
9867
9879
|
const source_component = db.source_component.insert({
|
|
9868
9880
|
ftype: "simple_potentiometer",
|
|
9869
|
-
name:
|
|
9881
|
+
name: this.name,
|
|
9870
9882
|
max_resistance: props.maxResistance,
|
|
9871
9883
|
pin_variant: pinVariant,
|
|
9872
9884
|
are_pins_interchangeable: pinVariant === "two_pin"
|
|
@@ -9905,7 +9917,7 @@ var PushButton = class extends NormalComponent {
|
|
|
9905
9917
|
const { db } = this.root;
|
|
9906
9918
|
const { _parsedProps: props } = this;
|
|
9907
9919
|
const source_component = db.source_component.insert({
|
|
9908
|
-
name:
|
|
9920
|
+
name: this.name,
|
|
9909
9921
|
ftype: FTYPE.simple_push_button,
|
|
9910
9922
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
9911
9923
|
are_pins_interchangeable: true
|
|
@@ -9949,7 +9961,7 @@ var Crystal = class extends NormalComponent {
|
|
|
9949
9961
|
const { db } = this.root;
|
|
9950
9962
|
const { _parsedProps: props } = this;
|
|
9951
9963
|
const source_component = db.source_component.insert({
|
|
9952
|
-
name:
|
|
9964
|
+
name: this.name,
|
|
9953
9965
|
ftype: "simple_crystal",
|
|
9954
9966
|
frequency: props.frequency,
|
|
9955
9967
|
load_capacitance: props.loadCapacitance,
|
|
@@ -9996,7 +10008,7 @@ var Transistor = class extends NormalComponent {
|
|
|
9996
10008
|
const { _parsedProps: props } = this;
|
|
9997
10009
|
const source_component = db.source_component.insert({
|
|
9998
10010
|
ftype: "simple_transistor",
|
|
9999
|
-
name:
|
|
10011
|
+
name: this.name,
|
|
10000
10012
|
transistor_type: props.type
|
|
10001
10013
|
});
|
|
10002
10014
|
this.source_component_id = source_component.source_component_id;
|
|
@@ -10022,7 +10034,7 @@ var Mosfet = class extends NormalComponent {
|
|
|
10022
10034
|
const { _parsedProps: props } = this;
|
|
10023
10035
|
const source_component = db.source_component.insert({
|
|
10024
10036
|
ftype: "simple_mosfet",
|
|
10025
|
-
name:
|
|
10037
|
+
name: this.name,
|
|
10026
10038
|
mosfet_mode: props.mosfetMode,
|
|
10027
10039
|
channel_type: props.channelType
|
|
10028
10040
|
});
|
|
@@ -10063,7 +10075,7 @@ var Switch = class extends NormalComponent {
|
|
|
10063
10075
|
const { _parsedProps: props } = this;
|
|
10064
10076
|
const source_component = db.source_component.insert({
|
|
10065
10077
|
ftype: "simple_switch",
|
|
10066
|
-
name:
|
|
10078
|
+
name: this.name,
|
|
10067
10079
|
switch_type: props.type,
|
|
10068
10080
|
is_normally_closed: props.isNormallyClosed ?? false,
|
|
10069
10081
|
are_pins_interchangeable: this._getSwitchType() === "spst"
|
|
@@ -10158,7 +10170,7 @@ var TestPoint = class extends NormalComponent {
|
|
|
10158
10170
|
} = this._getPropsWithDefaults();
|
|
10159
10171
|
const source_component = db.source_component.insert({
|
|
10160
10172
|
ftype: FTYPE.simple_test_point,
|
|
10161
|
-
name:
|
|
10173
|
+
name: this.name,
|
|
10162
10174
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
10163
10175
|
footprint_variant: footprintVariant,
|
|
10164
10176
|
pad_shape: padShape,
|
|
@@ -10405,7 +10417,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10405
10417
|
var package_default = {
|
|
10406
10418
|
name: "@tscircuit/core",
|
|
10407
10419
|
type: "module",
|
|
10408
|
-
version: "0.0.
|
|
10420
|
+
version: "0.0.504",
|
|
10409
10421
|
types: "dist/index.d.ts",
|
|
10410
10422
|
main: "dist/index.js",
|
|
10411
10423
|
module: "dist/index.js",
|
|
@@ -10489,7 +10501,7 @@ var package_default = {
|
|
|
10489
10501
|
"react-reconciler": "^0.31.0",
|
|
10490
10502
|
"react-reconciler-18": "npm:react-reconciler@0.29.2",
|
|
10491
10503
|
"transformation-matrix": "^2.16.1",
|
|
10492
|
-
zod: "^3.
|
|
10504
|
+
zod: "^3.25.67"
|
|
10493
10505
|
}
|
|
10494
10506
|
};
|
|
10495
10507
|
|
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.505",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"react-reconciler": "^0.31.0",
|
|
86
86
|
"react-reconciler-18": "npm:react-reconciler@0.29.2",
|
|
87
87
|
"transformation-matrix": "^2.16.1",
|
|
88
|
-
"zod": "^3.
|
|
88
|
+
"zod": "^3.25.67"
|
|
89
89
|
}
|
|
90
90
|
}
|