@tscircuit/core 0.0.16 → 0.0.18
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 +842 -43
- package/dist/index.js +211 -16
- package/lib/Project.ts +29 -0
- package/lib/components/base-components/NormalComponent.ts +16 -0
- package/lib/components/base-components/PrimitiveComponent.ts +3 -0
- package/lib/components/index.ts +3 -0
- package/lib/components/normal-components/Chip.ts +0 -19
- package/lib/components/normal-components/Jumper.ts +101 -0
- package/lib/components/primitive-components/PlatedHole.ts +60 -0
- package/lib/components/primitive-components/Port.ts +1 -0
- package/lib/components/primitive-components/SilkscreenPath.ts +35 -0
- package/lib/fiber/intrinsic-jsx.ts +1 -0
- package/lib/utils/createComponentsFromSoup.ts +23 -50
- package/package.json +5 -3
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AnySoupElement } from "@tscircuit/soup"
|
|
2
2
|
import type { PrimitiveComponent } from "../components/base-components/PrimitiveComponent"
|
|
3
3
|
import { SmtPad } from "lib/components/primitive-components/SmtPad"
|
|
4
|
+
import { SilkscreenPath } from "lib/components/primitive-components/SilkscreenPath"
|
|
5
|
+
import { PlatedHole } from "lib/components/primitive-components/PlatedHole"
|
|
4
6
|
|
|
5
7
|
export const createComponentsFromSoup = (
|
|
6
8
|
soup: AnySoupElement[],
|
|
@@ -30,57 +32,28 @@ export const createComponentsFromSoup = (
|
|
|
30
32
|
portHints: elm.port_hints,
|
|
31
33
|
}),
|
|
32
34
|
)
|
|
35
|
+
} else if (elm.type === "pcb_silkscreen_path") {
|
|
36
|
+
components.push(
|
|
37
|
+
new SilkscreenPath({
|
|
38
|
+
layer: elm.layer,
|
|
39
|
+
route: elm.route,
|
|
40
|
+
strokeWidth: elm.stroke_width,
|
|
41
|
+
}),
|
|
42
|
+
)
|
|
43
|
+
} else if (elm.type === "pcb_plated_hole" && elm.shape === "circle") {
|
|
44
|
+
if (elm.shape === "circle") {
|
|
45
|
+
components.push(
|
|
46
|
+
new PlatedHole({
|
|
47
|
+
pcbX: elm.x,
|
|
48
|
+
pcbY: elm.y,
|
|
49
|
+
shape: "circle",
|
|
50
|
+
holeDiameter: elm.hole_diameter,
|
|
51
|
+
outerDiameter: elm.outer_diameter,
|
|
52
|
+
portHints: elm.port_hints,
|
|
53
|
+
}),
|
|
54
|
+
)
|
|
55
|
+
}
|
|
33
56
|
}
|
|
34
57
|
}
|
|
35
58
|
return components
|
|
36
|
-
// if (elm.type === "pcb_smtpad") {
|
|
37
|
-
// this.add("smtpad", (pb) => pb.setProps(elm))
|
|
38
|
-
// } else if (elm.type === "pcb_plated_hole") {
|
|
39
|
-
// this.add("platedhole", (pb) => pb.setProps(elm))
|
|
40
|
-
// } else if (elm.type === "pcb_hole") {
|
|
41
|
-
// this.add("hole", (pb) => pb.setProps(elm))
|
|
42
|
-
// } else if (elm.type === "pcb_silkscreen_circle") {
|
|
43
|
-
// this.add("silkscreencircle", (pb) =>
|
|
44
|
-
// pb.setProps({
|
|
45
|
-
// ...elm,
|
|
46
|
-
// pcbX: elm.center.x,
|
|
47
|
-
// pcbY: elm.center.y,
|
|
48
|
-
// })
|
|
49
|
-
// )
|
|
50
|
-
// } else if (elm.type === "pcb_silkscreen_line") {
|
|
51
|
-
// this.add("silkscreenline", (pb) =>
|
|
52
|
-
// pb.setProps({
|
|
53
|
-
// ...elm,
|
|
54
|
-
// strokeWidth: elm.stroke_width,
|
|
55
|
-
// })
|
|
56
|
-
// )
|
|
57
|
-
// } else if (elm.type === "pcb_silkscreen_path") {
|
|
58
|
-
// this.add("silkscreenpath", (pb) =>
|
|
59
|
-
// pb.setProps({
|
|
60
|
-
// ...elm,
|
|
61
|
-
// strokeWidth: elm.stroke_width,
|
|
62
|
-
// })
|
|
63
|
-
// )
|
|
64
|
-
// } else if (elm.type === "pcb_silkscreen_rect") {
|
|
65
|
-
// this.add("silkscreenrect", (pb) =>
|
|
66
|
-
// pb.setProps({
|
|
67
|
-
// ...elm,
|
|
68
|
-
// pcbX: elm.center.x,
|
|
69
|
-
// pcbY: elm.center.y,
|
|
70
|
-
// // TODO silkscreen rect isFilled, isOutline etc.
|
|
71
|
-
// })
|
|
72
|
-
// )
|
|
73
|
-
// } else if (elm.type === "pcb_fabrication_note_path") {
|
|
74
|
-
// this.add("fabricationnotepath", (pb) => pb.setProps(elm))
|
|
75
|
-
// } else if (elm.type === "pcb_fabrication_note_text") {
|
|
76
|
-
// this.add("fabricationnotetext", (pb) =>
|
|
77
|
-
// pb.setProps({
|
|
78
|
-
// ...elm,
|
|
79
|
-
// pcbX: elm.anchor_position.x,
|
|
80
|
-
// pcbY: elm.anchor_position.y,
|
|
81
|
-
// anchorAlignment: elm.anchor_alignment,
|
|
82
|
-
// fontSize: elm.font_size,
|
|
83
|
-
// })
|
|
84
|
-
// )
|
|
85
|
-
// }
|
|
86
59
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"module": "index.ts",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.18",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"files": [
|
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@biomejs/biome": "^1.8.3",
|
|
19
|
+
"@tscircuit/layout": "^0.0.27",
|
|
19
20
|
"@tscircuit/log-soup": "^1.0.2",
|
|
20
21
|
"@types/bun": "latest",
|
|
21
22
|
"@types/react": "^18.3.3",
|
|
22
23
|
"@types/react-reconciler": "^0.28.8",
|
|
23
|
-
"
|
|
24
|
+
"bun-match-svg": "0.0.2",
|
|
25
|
+
"circuit-to-svg": "^0.0.13",
|
|
24
26
|
"howfat": "^0.3.8",
|
|
25
27
|
"looks-same": "^9.0.1",
|
|
26
28
|
"tsup": "^8.2.4"
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
34
|
"@tscircuit/infgrid-ijump-astar": "0.0.5",
|
|
33
|
-
"@tscircuit/props": "^0.0.
|
|
35
|
+
"@tscircuit/props": "^0.0.49",
|
|
34
36
|
"@tscircuit/soup": "^0.0.58",
|
|
35
37
|
"@tscircuit/soup-util": "0.0.18",
|
|
36
38
|
"footprinter": "^0.0.44",
|