@tscircuit/core 0.0.409 → 0.0.411
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 +43 -7
- package/dist/index.js +54 -33
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -2591,6 +2591,16 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
2591
2591
|
topPinCount?: number | undefined;
|
|
2592
2592
|
bottomPinCount?: number | undefined;
|
|
2593
2593
|
}>>;
|
|
2594
|
+
pinCompatibleVariants: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
2595
|
+
manufacturerPartNumber: zod.ZodOptional<zod.ZodString>;
|
|
2596
|
+
supplierPartNumber: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
|
|
2597
|
+
}, "strip", zod.ZodTypeAny, {
|
|
2598
|
+
manufacturerPartNumber?: string | undefined;
|
|
2599
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2600
|
+
}, {
|
|
2601
|
+
manufacturerPartNumber?: string | undefined;
|
|
2602
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2603
|
+
}>, "many">>;
|
|
2594
2604
|
schPinStyle: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
|
|
2595
2605
|
marginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
2596
2606
|
marginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
@@ -2749,6 +2759,10 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
2749
2759
|
topPinCount?: number | undefined;
|
|
2750
2760
|
bottomPinCount?: number | undefined;
|
|
2751
2761
|
} | undefined;
|
|
2762
|
+
pinCompatibleVariants?: {
|
|
2763
|
+
manufacturerPartNumber?: string | undefined;
|
|
2764
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2765
|
+
}[] | undefined;
|
|
2752
2766
|
schPinStyle?: Record<string, {
|
|
2753
2767
|
marginLeft?: number | undefined;
|
|
2754
2768
|
marginRight?: number | undefined;
|
|
@@ -2889,6 +2903,10 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
2889
2903
|
topPinCount?: number | undefined;
|
|
2890
2904
|
bottomPinCount?: number | undefined;
|
|
2891
2905
|
} | undefined;
|
|
2906
|
+
pinCompatibleVariants?: {
|
|
2907
|
+
manufacturerPartNumber?: string | undefined;
|
|
2908
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2909
|
+
}[] | undefined;
|
|
2892
2910
|
schPinStyle?: Record<string, {
|
|
2893
2911
|
marginLeft?: string | number | undefined;
|
|
2894
2912
|
marginRight?: string | number | undefined;
|
|
@@ -6100,7 +6118,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6100
6118
|
rectPadHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6101
6119
|
holeShape: zod.ZodOptional<zod.ZodLiteral<"circle">>;
|
|
6102
6120
|
padShape: zod.ZodOptional<zod.ZodLiteral<"rect">>;
|
|
6103
|
-
shape: zod.ZodOptional<zod.ZodLiteral<"
|
|
6121
|
+
shape: zod.ZodOptional<zod.ZodLiteral<"circular_hole_with_rect_pad">>;
|
|
6104
6122
|
portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
|
|
6105
6123
|
}, "strip", zod.ZodTypeAny, {
|
|
6106
6124
|
holeDiameter: number;
|
|
@@ -6109,7 +6127,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6109
6127
|
pcbX?: number | undefined;
|
|
6110
6128
|
pcbY?: number | undefined;
|
|
6111
6129
|
name?: string | undefined;
|
|
6112
|
-
shape?: "
|
|
6130
|
+
shape?: "circular_hole_with_rect_pad" | undefined;
|
|
6113
6131
|
portHints?: (string | number)[] | undefined;
|
|
6114
6132
|
holeShape?: "circle" | undefined;
|
|
6115
6133
|
padShape?: "rect" | undefined;
|
|
@@ -6120,7 +6138,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6120
6138
|
pcbX?: string | number | undefined;
|
|
6121
6139
|
pcbY?: string | number | undefined;
|
|
6122
6140
|
name?: string | undefined;
|
|
6123
|
-
shape?: "
|
|
6141
|
+
shape?: "circular_hole_with_rect_pad" | undefined;
|
|
6124
6142
|
portHints?: (string | number)[] | undefined;
|
|
6125
6143
|
holeShape?: "circle" | undefined;
|
|
6126
6144
|
padShape?: "rect" | undefined;
|
|
@@ -6131,7 +6149,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6131
6149
|
pcbX?: number | undefined;
|
|
6132
6150
|
pcbY?: number | undefined;
|
|
6133
6151
|
name?: string | undefined;
|
|
6134
|
-
shape?: "
|
|
6152
|
+
shape?: "circular_hole_with_rect_pad" | undefined;
|
|
6135
6153
|
portHints?: (string | number)[] | undefined;
|
|
6136
6154
|
holeShape?: "circle" | undefined;
|
|
6137
6155
|
padShape?: "rect" | undefined;
|
|
@@ -6142,7 +6160,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6142
6160
|
pcbX?: string | number | undefined;
|
|
6143
6161
|
pcbY?: string | number | undefined;
|
|
6144
6162
|
name?: string | undefined;
|
|
6145
|
-
shape?: "
|
|
6163
|
+
shape?: "circular_hole_with_rect_pad" | undefined;
|
|
6146
6164
|
portHints?: (string | number)[] | undefined;
|
|
6147
6165
|
holeShape?: "circle" | undefined;
|
|
6148
6166
|
padShape?: "rect" | undefined;
|
|
@@ -6185,7 +6203,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6185
6203
|
pcbX?: number | undefined;
|
|
6186
6204
|
pcbY?: number | undefined;
|
|
6187
6205
|
name?: string | undefined;
|
|
6188
|
-
shape?: "
|
|
6206
|
+
shape?: "circular_hole_with_rect_pad" | undefined;
|
|
6189
6207
|
portHints?: (string | number)[] | undefined;
|
|
6190
6208
|
holeShape?: "circle" | undefined;
|
|
6191
6209
|
padShape?: "rect" | undefined;
|
|
@@ -6228,7 +6246,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
6228
6246
|
pcbX?: string | number | undefined;
|
|
6229
6247
|
pcbY?: string | number | undefined;
|
|
6230
6248
|
name?: string | undefined;
|
|
6231
|
-
shape?: "
|
|
6249
|
+
shape?: "circular_hole_with_rect_pad" | undefined;
|
|
6232
6250
|
portHints?: (string | number)[] | undefined;
|
|
6233
6251
|
holeShape?: "circle" | undefined;
|
|
6234
6252
|
padShape?: "rect" | undefined;
|
|
@@ -9772,6 +9790,16 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
|
|
|
9772
9790
|
topPinCount?: number | undefined;
|
|
9773
9791
|
bottomPinCount?: number | undefined;
|
|
9774
9792
|
}>>;
|
|
9793
|
+
pinCompatibleVariants: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
9794
|
+
manufacturerPartNumber: zod.ZodOptional<zod.ZodString>;
|
|
9795
|
+
supplierPartNumber: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
|
|
9796
|
+
}, "strip", zod.ZodTypeAny, {
|
|
9797
|
+
manufacturerPartNumber?: string | undefined;
|
|
9798
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
9799
|
+
}, {
|
|
9800
|
+
manufacturerPartNumber?: string | undefined;
|
|
9801
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
9802
|
+
}>, "many">>;
|
|
9775
9803
|
schPinStyle: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
|
|
9776
9804
|
marginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
9777
9805
|
marginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
@@ -9930,6 +9958,10 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
|
|
|
9930
9958
|
topPinCount?: number | undefined;
|
|
9931
9959
|
bottomPinCount?: number | undefined;
|
|
9932
9960
|
} | undefined;
|
|
9961
|
+
pinCompatibleVariants?: {
|
|
9962
|
+
manufacturerPartNumber?: string | undefined;
|
|
9963
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
9964
|
+
}[] | undefined;
|
|
9933
9965
|
schPinStyle?: Record<string, {
|
|
9934
9966
|
marginLeft?: number | undefined;
|
|
9935
9967
|
marginRight?: number | undefined;
|
|
@@ -10070,6 +10102,10 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
|
|
|
10070
10102
|
topPinCount?: number | undefined;
|
|
10071
10103
|
bottomPinCount?: number | undefined;
|
|
10072
10104
|
} | undefined;
|
|
10105
|
+
pinCompatibleVariants?: {
|
|
10106
|
+
manufacturerPartNumber?: string | undefined;
|
|
10107
|
+
supplierPartNumber?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
10108
|
+
}[] | undefined;
|
|
10073
10109
|
schPinStyle?: Record<string, {
|
|
10074
10110
|
marginLeft?: string | number | undefined;
|
|
10075
10111
|
marginRight?: string | number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1971,6 +1971,9 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
1971
1971
|
if (props.shape === "oval" || props.shape === "pill") {
|
|
1972
1972
|
return { width: props.outerWidth, height: props.outerHeight };
|
|
1973
1973
|
}
|
|
1974
|
+
if (props.shape === "circular_hole_with_rect_pad") {
|
|
1975
|
+
return { width: props.rectPadWidth, height: props.rectPadHeight };
|
|
1976
|
+
}
|
|
1974
1977
|
throw new Error(
|
|
1975
1978
|
`getPcbSize for shape "${props.shape}" not implemented for ${this.componentName}`
|
|
1976
1979
|
);
|
|
@@ -2097,6 +2100,22 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
2097
2100
|
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
2098
2101
|
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
2099
2102
|
});
|
|
2103
|
+
} else if (props.shape === "circular_hole_with_rect_pad") {
|
|
2104
|
+
const pcb_plated_hole = db.pcb_plated_hole.insert({
|
|
2105
|
+
pcb_component_id,
|
|
2106
|
+
pcb_port_id: this.matchedPort?.pcb_port_id,
|
|
2107
|
+
hole_diameter: props.holeDiameter,
|
|
2108
|
+
rect_pad_width: props.rectPadWidth,
|
|
2109
|
+
rect_pad_height: props.rectPadHeight,
|
|
2110
|
+
shape: "circular_hole_with_rect_pad",
|
|
2111
|
+
port_hints: this.getNameAndAliases(),
|
|
2112
|
+
x: position.x,
|
|
2113
|
+
y: position.y,
|
|
2114
|
+
layers: ["top", "bottom"],
|
|
2115
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
2116
|
+
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
2117
|
+
});
|
|
2118
|
+
this.pcb_plated_hole_id = pcb_plated_hole.pcb_plated_hole_id;
|
|
2100
2119
|
}
|
|
2101
2120
|
}
|
|
2102
2121
|
doInitialPcbPortAttachment() {
|
|
@@ -3722,43 +3741,45 @@ var createDownwardNetLabelGroundSymbol = ({
|
|
|
3722
3741
|
source_trace_id
|
|
3723
3742
|
}, { db }) => {
|
|
3724
3743
|
const offsets = calculateOffsets(port);
|
|
3744
|
+
const isLeftOrRight = port.facingDirection === "left" || port.facingDirection === "right";
|
|
3745
|
+
const horizontalEndPos = {
|
|
3746
|
+
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3747
|
+
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3748
|
+
};
|
|
3749
|
+
const groundSymbolPos = isLeftOrRight ? {
|
|
3750
|
+
x: horizontalEndPos.x,
|
|
3751
|
+
y: horizontalEndPos.y - 0.5
|
|
3752
|
+
} : horizontalEndPos;
|
|
3725
3753
|
db.schematic_net_label.insert({
|
|
3726
3754
|
anchor_side: "top",
|
|
3727
|
-
center:
|
|
3728
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3729
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3730
|
-
},
|
|
3755
|
+
center: groundSymbolPos,
|
|
3731
3756
|
source_net_id: port.source_port_id,
|
|
3732
3757
|
text: schDisplayLabel,
|
|
3733
|
-
anchor_position:
|
|
3734
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3735
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3736
|
-
},
|
|
3758
|
+
anchor_position: groundSymbolPos,
|
|
3737
3759
|
symbol_name: "ground_horz"
|
|
3738
3760
|
});
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
{
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
|
|
3746
|
-
}
|
|
3747
|
-
},
|
|
3748
|
-
{
|
|
3749
|
-
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3750
|
-
to: {
|
|
3751
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3752
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3753
|
-
}
|
|
3754
|
-
}
|
|
3755
|
-
],
|
|
3756
|
-
junctions: [
|
|
3757
|
-
{
|
|
3758
|
-
x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
|
|
3759
|
-
y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
|
|
3761
|
+
const edges = [
|
|
3762
|
+
{
|
|
3763
|
+
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3764
|
+
to: {
|
|
3765
|
+
x: anchorPos.x,
|
|
3766
|
+
y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
|
|
3760
3767
|
}
|
|
3761
|
-
|
|
3768
|
+
},
|
|
3769
|
+
{
|
|
3770
|
+
from: { x: anchorPos.x, y: anchorPos.y },
|
|
3771
|
+
to: horizontalEndPos
|
|
3772
|
+
}
|
|
3773
|
+
];
|
|
3774
|
+
if (isLeftOrRight) {
|
|
3775
|
+
edges.push({
|
|
3776
|
+
from: horizontalEndPos,
|
|
3777
|
+
to: groundSymbolPos
|
|
3778
|
+
});
|
|
3779
|
+
}
|
|
3780
|
+
db.schematic_trace.insert({
|
|
3781
|
+
edges,
|
|
3782
|
+
junctions: [],
|
|
3762
3783
|
source_trace_id
|
|
3763
3784
|
});
|
|
3764
3785
|
};
|
|
@@ -8236,7 +8257,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
8236
8257
|
var package_default = {
|
|
8237
8258
|
name: "@tscircuit/core",
|
|
8238
8259
|
type: "module",
|
|
8239
|
-
version: "0.0.
|
|
8260
|
+
version: "0.0.410",
|
|
8240
8261
|
types: "dist/index.d.ts",
|
|
8241
8262
|
main: "dist/index.js",
|
|
8242
8263
|
module: "dist/index.js",
|
|
@@ -8287,10 +8308,10 @@ var package_default = {
|
|
|
8287
8308
|
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
8288
8309
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
8289
8310
|
"@tscircuit/math-utils": "^0.0.18",
|
|
8290
|
-
"@tscircuit/props": "^0.0.
|
|
8311
|
+
"@tscircuit/props": "^0.0.183",
|
|
8291
8312
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
8292
8313
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
8293
|
-
"circuit-json": "0.0.170",
|
|
8314
|
+
"circuit-json": "^0.0.170",
|
|
8294
8315
|
"schematic-symbols": "^0.0.132"
|
|
8295
8316
|
},
|
|
8296
8317
|
peerDependencies: {
|
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.411",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
53
53
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
54
54
|
"@tscircuit/math-utils": "^0.0.18",
|
|
55
|
-
"@tscircuit/props": "^0.0.
|
|
55
|
+
"@tscircuit/props": "^0.0.183",
|
|
56
56
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
57
57
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
58
|
-
"circuit-json": "0.0.170",
|
|
58
|
+
"circuit-json": "^0.0.170",
|
|
59
59
|
"schematic-symbols": "^0.0.132"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|