@tscircuit/props 0.0.381 → 0.0.383
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/README.md +9 -0
- package/dist/index.d.ts +1298 -1
- package/dist/index.js +124 -106
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +16 -0
- package/lib/components/copper-text.ts +13 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/lib/common/layout.ts
CHANGED
|
@@ -35,6 +35,9 @@ export interface PcbLayoutProps {
|
|
|
35
35
|
pcbMarginLeft?: string | number
|
|
36
36
|
pcbMarginX?: string | number
|
|
37
37
|
pcbMarginY?: string | number
|
|
38
|
+
pcbStyle?: {
|
|
39
|
+
silkscreenFontSize?: string | number
|
|
40
|
+
}
|
|
38
41
|
/**
|
|
39
42
|
* If true, pcbX/pcbY will be interpreted relative to the parent group
|
|
40
43
|
*/
|
|
@@ -60,6 +63,9 @@ export interface CommonLayoutProps {
|
|
|
60
63
|
pcbMarginLeft?: string | number
|
|
61
64
|
pcbMarginX?: string | number
|
|
62
65
|
pcbMarginY?: string | number
|
|
66
|
+
pcbStyle?: {
|
|
67
|
+
silkscreenFontSize?: string | number
|
|
68
|
+
}
|
|
63
69
|
|
|
64
70
|
schMarginTop?: string | number
|
|
65
71
|
schMarginRight?: string | number
|
|
@@ -114,6 +120,11 @@ export const pcbLayoutProps = z.object({
|
|
|
114
120
|
pcbMarginLeft: distance.optional(),
|
|
115
121
|
pcbMarginX: distance.optional(),
|
|
116
122
|
pcbMarginY: distance.optional(),
|
|
123
|
+
pcbStyle: z
|
|
124
|
+
.object({
|
|
125
|
+
silkscreenFontSize: distance.optional(),
|
|
126
|
+
})
|
|
127
|
+
.optional(),
|
|
117
128
|
pcbRelative: z.boolean().optional(),
|
|
118
129
|
relative: z.boolean().optional(),
|
|
119
130
|
})
|
|
@@ -141,6 +152,11 @@ export const commonLayoutProps = z.object({
|
|
|
141
152
|
pcbMarginLeft: distance.optional(),
|
|
142
153
|
pcbMarginX: distance.optional(),
|
|
143
154
|
pcbMarginY: distance.optional(),
|
|
155
|
+
pcbStyle: z
|
|
156
|
+
.object({
|
|
157
|
+
silkscreenFontSize: distance.optional(),
|
|
158
|
+
})
|
|
159
|
+
.optional(),
|
|
144
160
|
schMarginTop: distance.optional(),
|
|
145
161
|
schMarginRight: distance.optional(),
|
|
146
162
|
schMarginBottom: distance.optional(),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { layer_ref, length } from "circuit-json"
|
|
2
|
+
import { pcbLayoutProps } from "lib/common/layout"
|
|
3
|
+
import { ninePointAnchor } from "lib/common/ninePointAnchor"
|
|
4
|
+
import { z } from "zod"
|
|
5
|
+
|
|
6
|
+
export const copperTextProps = pcbLayoutProps.extend({
|
|
7
|
+
text: z.string(),
|
|
8
|
+
anchorAlignment: ninePointAnchor.default("center"),
|
|
9
|
+
font: z.enum(["tscircuit2024"]).optional(),
|
|
10
|
+
fontSize: length.optional(),
|
|
11
|
+
layers: z.array(layer_ref).optional(),
|
|
12
|
+
})
|
|
13
|
+
export type CopperTextProps = z.input<typeof copperTextProps>
|
package/lib/index.ts
CHANGED
|
@@ -82,6 +82,7 @@ export * from "./components/schematic-path"
|
|
|
82
82
|
export * from "./components/schematic-table"
|
|
83
83
|
export * from "./components/schematic-row"
|
|
84
84
|
export * from "./components/schematic-cell"
|
|
85
|
+
export * from "./components/copper-text"
|
|
85
86
|
export * from "./components/silkscreen-text"
|
|
86
87
|
export * from "./components/silkscreen-path"
|
|
87
88
|
export * from "./components/silkscreen-line"
|