@tscircuit/pcb-viewer 1.11.149 → 1.11.151
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.js +90 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -109,6 +109,7 @@ __export(dist_exports, {
|
|
|
109
109
|
source_simple_diode: () => source_simple_diode,
|
|
110
110
|
source_simple_ground: () => source_simple_ground,
|
|
111
111
|
source_simple_inductor: () => source_simple_inductor,
|
|
112
|
+
source_simple_led: () => source_simple_led,
|
|
112
113
|
source_simple_mosfet: () => source_simple_mosfet,
|
|
113
114
|
source_simple_pin_header: () => source_simple_pin_header,
|
|
114
115
|
source_simple_potentiometer: () => source_simple_potentiometer,
|
|
@@ -4477,7 +4478,8 @@ var source_component_base = z.object({
|
|
|
4477
4478
|
supplier_part_numbers: z.record(supplier_name, z.array(z.string())).optional(),
|
|
4478
4479
|
display_value: z.string().optional(),
|
|
4479
4480
|
are_pins_interchangeable: z.boolean().optional(),
|
|
4480
|
-
internally_connected_source_port_ids: z.array(z.array(z.string())).optional()
|
|
4481
|
+
internally_connected_source_port_ids: z.array(z.array(z.string())).optional(),
|
|
4482
|
+
source_group_id: z.string().optional()
|
|
4481
4483
|
});
|
|
4482
4484
|
expectTypesMatch(true);
|
|
4483
4485
|
var source_simple_capacitor = source_component_base.extend({
|
|
@@ -4498,6 +4500,12 @@ var source_simple_diode = source_component_base.extend({
|
|
|
4498
4500
|
ftype: z.literal("simple_diode")
|
|
4499
4501
|
});
|
|
4500
4502
|
expectTypesMatch(true);
|
|
4503
|
+
var source_simple_led = source_simple_diode.extend({
|
|
4504
|
+
ftype: z.literal("simple_led"),
|
|
4505
|
+
color: z.string().optional(),
|
|
4506
|
+
wavelength: z.string().optional()
|
|
4507
|
+
});
|
|
4508
|
+
expectTypesMatch(true);
|
|
4501
4509
|
var source_simple_ground = source_component_base.extend({
|
|
4502
4510
|
ftype: z.literal("simple_ground")
|
|
4503
4511
|
});
|
|
@@ -4610,6 +4618,7 @@ var any_source_component = z.union([
|
|
|
4610
4618
|
source_simple_resistor,
|
|
4611
4619
|
source_simple_capacitor,
|
|
4612
4620
|
source_simple_diode,
|
|
4621
|
+
source_simple_led,
|
|
4613
4622
|
source_simple_ground,
|
|
4614
4623
|
source_simple_chip,
|
|
4615
4624
|
source_simple_bug,
|
|
@@ -4676,6 +4685,7 @@ var schematic_box = z.object({
|
|
|
4676
4685
|
schematic_component_id: z.string(),
|
|
4677
4686
|
width: distance,
|
|
4678
4687
|
height: distance,
|
|
4688
|
+
is_dashed: z.boolean().default(false),
|
|
4679
4689
|
x: distance,
|
|
4680
4690
|
y: distance
|
|
4681
4691
|
}).describe("Draws a box on the schematic");
|
|
@@ -4742,7 +4752,9 @@ var schematic_component = z.object({
|
|
|
4742
4752
|
symbol_name: z.string().optional(),
|
|
4743
4753
|
port_arrangement: port_arrangement.optional(),
|
|
4744
4754
|
port_labels: z.record(z.string()).optional(),
|
|
4745
|
-
symbol_display_value: z.string().optional()
|
|
4755
|
+
symbol_display_value: z.string().optional(),
|
|
4756
|
+
subcircuit_id: z.string().optional(),
|
|
4757
|
+
schematic_group_id: z.string().optional()
|
|
4746
4758
|
});
|
|
4747
4759
|
expectTypesMatch(true);
|
|
4748
4760
|
var schematic_line = z.object({
|
|
@@ -4830,6 +4842,9 @@ var schematic_port = z.object({
|
|
|
4830
4842
|
expectTypesMatch(true);
|
|
4831
4843
|
var schematic_net_label = z.object({
|
|
4832
4844
|
type: z.literal("schematic_net_label"),
|
|
4845
|
+
schematic_net_label_id: getZodPrefixedIdWithDefault("schematic_net_label"),
|
|
4846
|
+
schematic_trace_id: z.string().optional(),
|
|
4847
|
+
source_trace_id: z.string().optional(),
|
|
4833
4848
|
source_net_id: z.string(),
|
|
4834
4849
|
center: point,
|
|
4835
4850
|
anchor_position: point.optional(),
|
|
@@ -4837,6 +4852,7 @@ var schematic_net_label = z.object({
|
|
|
4837
4852
|
text: z.string(),
|
|
4838
4853
|
symbol_name: z.string().optional()
|
|
4839
4854
|
});
|
|
4855
|
+
expectTypesMatch(true);
|
|
4840
4856
|
var schematic_error = z.object({
|
|
4841
4857
|
type: z.literal("schematic_error"),
|
|
4842
4858
|
schematic_error_id: z.string(),
|
|
@@ -4950,7 +4966,8 @@ var pcb_component = z.object({
|
|
|
4950
4966
|
rotation,
|
|
4951
4967
|
width: length,
|
|
4952
4968
|
height: length,
|
|
4953
|
-
subcircuit_id: z.string().optional()
|
|
4969
|
+
subcircuit_id: z.string().optional(),
|
|
4970
|
+
pcb_group_id: z.string().optional()
|
|
4954
4971
|
}).describe("Defines a component on the PCB");
|
|
4955
4972
|
expectTypesMatch(true);
|
|
4956
4973
|
var pcb_hole_circle_or_square = z.object({
|
|
@@ -5386,7 +5403,7 @@ var pcb_silkscreen_text = z.object({
|
|
|
5386
5403
|
layer: layer_ref,
|
|
5387
5404
|
is_mirrored: z.boolean().default(false).optional(),
|
|
5388
5405
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
5389
|
-
anchor_alignment:
|
|
5406
|
+
anchor_alignment: ninePointAnchor.default("center")
|
|
5390
5407
|
}).describe("Defines silkscreen text on the PCB");
|
|
5391
5408
|
expectTypesMatch(true);
|
|
5392
5409
|
var pcb_silkscreen_rect = z.object({
|
|
@@ -5596,6 +5613,7 @@ var any_circuit_element = z.union([
|
|
|
5596
5613
|
source_simple_chip,
|
|
5597
5614
|
source_simple_capacitor,
|
|
5598
5615
|
source_simple_diode,
|
|
5616
|
+
source_simple_led,
|
|
5599
5617
|
source_simple_resistor,
|
|
5600
5618
|
source_simple_power_source,
|
|
5601
5619
|
source_simple_battery,
|
|
@@ -6743,6 +6761,70 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
6743
6761
|
layer: "drill"
|
|
6744
6762
|
}
|
|
6745
6763
|
];
|
|
6764
|
+
} else if (element.shape === "circular_hole_with_rect_pad") {
|
|
6765
|
+
const { x, y, hole_diameter, rect_pad_width, rect_pad_height } = element;
|
|
6766
|
+
return [
|
|
6767
|
+
{
|
|
6768
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
6769
|
+
pcb_drawing_type: "rect",
|
|
6770
|
+
x,
|
|
6771
|
+
y,
|
|
6772
|
+
w: rect_pad_width,
|
|
6773
|
+
h: rect_pad_height,
|
|
6774
|
+
layer: "top",
|
|
6775
|
+
// Rectangular pad on top layer
|
|
6776
|
+
_element: element,
|
|
6777
|
+
_parent_pcb_component,
|
|
6778
|
+
_parent_source_component,
|
|
6779
|
+
_source_port
|
|
6780
|
+
},
|
|
6781
|
+
{
|
|
6782
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
6783
|
+
_element: element,
|
|
6784
|
+
pcb_drawing_type: "circle",
|
|
6785
|
+
x,
|
|
6786
|
+
y,
|
|
6787
|
+
r: hole_diameter / 2,
|
|
6788
|
+
layer: "drill"
|
|
6789
|
+
// Circular hole in drill layer
|
|
6790
|
+
}
|
|
6791
|
+
];
|
|
6792
|
+
} else if (element.shape === "pill_hole_with_rect_pad") {
|
|
6793
|
+
const {
|
|
6794
|
+
x,
|
|
6795
|
+
y,
|
|
6796
|
+
hole_width,
|
|
6797
|
+
hole_height,
|
|
6798
|
+
rect_pad_width,
|
|
6799
|
+
rect_pad_height
|
|
6800
|
+
} = element;
|
|
6801
|
+
return [
|
|
6802
|
+
{
|
|
6803
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
6804
|
+
pcb_drawing_type: "rect",
|
|
6805
|
+
x,
|
|
6806
|
+
y,
|
|
6807
|
+
w: rect_pad_width,
|
|
6808
|
+
h: rect_pad_height,
|
|
6809
|
+
layer: "top",
|
|
6810
|
+
// Rectangular pad on top layer
|
|
6811
|
+
_element: element,
|
|
6812
|
+
_parent_pcb_component,
|
|
6813
|
+
_parent_source_component,
|
|
6814
|
+
_source_port
|
|
6815
|
+
},
|
|
6816
|
+
{
|
|
6817
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
6818
|
+
_element: element,
|
|
6819
|
+
pcb_drawing_type: "pill",
|
|
6820
|
+
x,
|
|
6821
|
+
y,
|
|
6822
|
+
w: hole_width,
|
|
6823
|
+
h: hole_height,
|
|
6824
|
+
layer: "drill"
|
|
6825
|
+
// Pill-shaped hole in drill layer
|
|
6826
|
+
}
|
|
6827
|
+
];
|
|
6746
6828
|
} else {
|
|
6747
6829
|
return [];
|
|
6748
6830
|
}
|
|
@@ -9711,7 +9793,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
9711
9793
|
// package.json
|
|
9712
9794
|
var package_default = {
|
|
9713
9795
|
name: "@tscircuit/pcb-viewer",
|
|
9714
|
-
version: "1.11.
|
|
9796
|
+
version: "1.11.150",
|
|
9715
9797
|
main: "dist/index.js",
|
|
9716
9798
|
type: "module",
|
|
9717
9799
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -9738,12 +9820,12 @@ var package_default = {
|
|
|
9738
9820
|
"@storybook/react": "^8.0.6",
|
|
9739
9821
|
"@swc/core": "^1.4.12",
|
|
9740
9822
|
"@tscircuit/eagle-xml-converter": "^1.0.0",
|
|
9741
|
-
"@tscircuit/props": "^0.0.
|
|
9823
|
+
"@tscircuit/props": "^0.0.187",
|
|
9742
9824
|
"@tscircuit/soup-util": "^0.0.41",
|
|
9743
9825
|
"@types/color": "^3.0.6",
|
|
9744
9826
|
"@types/node": "18.7.23",
|
|
9745
9827
|
"@types/react": "^18.3.3",
|
|
9746
|
-
"circuit-json": "^0.0.
|
|
9828
|
+
"circuit-json": "^0.0.186",
|
|
9747
9829
|
next: "^14.1.4",
|
|
9748
9830
|
"pixi.js": "^8.6.6",
|
|
9749
9831
|
react: "^18.2.0",
|
|
@@ -9764,6 +9846,7 @@ var package_default = {
|
|
|
9764
9846
|
"@tscircuit/core": "^0.0.417",
|
|
9765
9847
|
"@tscircuit/math-utils": "^0.0.18",
|
|
9766
9848
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
9849
|
+
"circuit-to-svg": "^0.0.130",
|
|
9767
9850
|
color: "^4.2.3",
|
|
9768
9851
|
"graphics-debug": "^0.0.24",
|
|
9769
9852
|
"react-supergrid": "^1.0.10",
|