@tscircuit/props 0.0.542 → 0.0.544

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.
@@ -1,4 +1,4 @@
1
- import { distance, point, rotation } from "circuit-json"
1
+ import { distance, rotation } from "circuit-json"
2
2
  import { z } from "zod"
3
3
  import { expectTypesMatch } from "lib/typecheck"
4
4
  import type { Distance } from "lib/common/distance"
@@ -14,7 +14,6 @@ export const schematicRectProps = z.object({
14
14
  isFilled: z.boolean().optional().default(false),
15
15
  fillColor: z.string().optional(),
16
16
  isDashed: z.boolean().optional().default(false),
17
- cornerRadius: distance.optional(),
18
17
  })
19
18
 
20
19
  export interface SchematicRectProps {
@@ -28,7 +27,6 @@ export interface SchematicRectProps {
28
27
  isFilled?: boolean
29
28
  fillColor?: string
30
29
  isDashed?: boolean
31
- cornerRadius?: Distance
32
30
  }
33
31
 
34
32
  export type InferredSchematicRectProps = z.input<typeof schematicRectProps>
@@ -0,0 +1,56 @@
1
+ import { type VisibleLayer, visible_layer } from "circuit-json"
2
+ import { type Distance, distance } from "lib/common/distance"
3
+ import { pcbLayoutProps } from "lib/common/layout"
4
+ import { url } from "lib/common/url"
5
+ import { expectTypesMatch } from "lib/typecheck"
6
+ import { z } from "zod"
7
+
8
+ export interface SilkscreenGraphicProps {
9
+ /**
10
+ * URL or static-file import for the source image. tscircuit/core converts the
11
+ * image into the pcb_silkscreen_graphic BRep in circuit-json.
12
+ */
13
+ imageUrl: string
14
+ /** Width of the rendered silkscreen graphic on the PCB. */
15
+ width: Distance
16
+ /** Height of the rendered silkscreen graphic on the PCB. */
17
+ height: Distance
18
+ /** PCB layer for the silkscreen graphic. */
19
+ layer?: VisibleLayer
20
+ pcbX?: string | number
21
+ pcbY?: string | number
22
+ pcbLeftEdgeX?: string | number
23
+ pcbRightEdgeX?: string | number
24
+ pcbTopEdgeY?: string | number
25
+ pcbBottomEdgeY?: string | number
26
+ pcbOffsetX?: string | number
27
+ pcbOffsetY?: string | number
28
+ pcbRotation?: string | number
29
+ pcbPositionAnchor?: string
30
+ pcbPositionMode?:
31
+ | "relative_to_group_anchor"
32
+ | "auto"
33
+ | "relative_to_board_anchor"
34
+ | "relative_to_component_anchor"
35
+ shouldBeOnEdgeOfBoard?: boolean
36
+ pcbMarginTop?: string | number
37
+ pcbMarginRight?: string | number
38
+ pcbMarginBottom?: string | number
39
+ pcbMarginLeft?: string | number
40
+ pcbMarginX?: string | number
41
+ pcbMarginY?: string | number
42
+ pcbRelative?: boolean
43
+ relative?: boolean
44
+ }
45
+
46
+ export const silkscreenGraphicProps = pcbLayoutProps
47
+ .omit({ layer: true, pcbStyle: true, pcbSx: true })
48
+ .extend({
49
+ imageUrl: url,
50
+ width: distance,
51
+ height: distance,
52
+ layer: visible_layer.optional(),
53
+ })
54
+
55
+ type InferredSilkscreenGraphicProps = z.input<typeof silkscreenGraphicProps>
56
+ expectTypesMatch<SilkscreenGraphicProps, InferredSilkscreenGraphicProps>(true)
package/lib/index.ts CHANGED
@@ -113,6 +113,7 @@ export * from "./components/silkscreen-path"
113
113
  export * from "./components/silkscreen-line"
114
114
  export * from "./components/silkscreen-rect"
115
115
  export * from "./components/silkscreen-circle"
116
+ export * from "./components/silkscreen-graphic"
116
117
  export * from "./components/trace-hint"
117
118
  export * from "./components/port"
118
119
  export * from "./components/pcb-note-text"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.542",
3
+ "version": "0.0.544",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "@types/node": "^20.12.11",
33
33
  "@types/react": "^18.3.2",
34
34
  "ava": "^6.1.3",
35
- "circuit-json": "^0.0.428",
35
+ "circuit-json": "^0.0.433",
36
36
  "expect-type": "^1.3.0",
37
37
  "glob": "^11.0.0",
38
38
  "madge": "^8.0.0",