@tscircuit/props 0.0.262 → 0.0.264

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,24 +1,12 @@
1
- import { distance } from "circuit-json"
2
- import { type Point, point } from "lib/common/point"
3
1
  import { expectTypesMatch } from "lib/typecheck"
4
2
  import { z } from "zod"
5
3
  import { subcircuitGroupProps, type SubcircuitGroupProps } from "./group"
6
4
 
7
5
  export interface BoardProps extends Omit<SubcircuitGroupProps, "subcircuit"> {
8
- width?: number | string
9
- height?: number | string
10
- outline?: Point[]
11
- outlineOffsetX?: number | string
12
- outlineOffsetY?: number | string
13
6
  material?: "fr4" | "fr1"
14
7
  }
15
8
 
16
9
  export const boardProps = subcircuitGroupProps.extend({
17
- width: distance.optional(),
18
- height: distance.optional(),
19
- outline: z.array(point).optional(),
20
- outlineOffsetX: distance.optional(),
21
- outlineOffsetY: distance.optional(),
22
10
  material: z.enum(["fr4", "fr1"]).default("fr4"),
23
11
  })
24
12
 
@@ -1,10 +1,11 @@
1
- import { layer_ref, length } from "circuit-json"
1
+ import { layer_ref, length, distance } from "circuit-json"
2
2
  import type { Distance } from "lib/common/distance"
3
3
  import {
4
4
  type CommonLayoutProps,
5
5
  commonLayoutProps,
6
6
  type SupplierPartNumbers,
7
7
  } from "lib/common/layout"
8
+ import { type Point, point } from "lib/common/point"
8
9
  import { expectTypesMatch } from "lib/typecheck"
9
10
  import { z } from "zod"
10
11
  import type { AnySourceComponent, PcbTrace } from "circuit-json"
@@ -34,6 +35,15 @@ export const layoutConfig = z.object({
34
35
  flexColumn: z.boolean().optional(),
35
36
  gap: z.number().or(z.string()).optional(),
36
37
 
38
+ pack: z
39
+ .boolean()
40
+ .optional()
41
+ .describe("Pack the contents of this group using a packing strategy"),
42
+ packOrderStrategy: z.enum(["largest_to_smallest"]).optional(),
43
+ packPlacementStrategy: z
44
+ .enum(["shortest_connection_along_outline"])
45
+ .optional(),
46
+
37
47
  padding: length.optional(),
38
48
  paddingLeft: length.optional(),
39
49
  paddingRight: length.optional(),
@@ -69,6 +79,10 @@ export interface LayoutConfig {
69
79
  flexColumn?: boolean
70
80
  gap?: number | string
71
81
 
82
+ pack?: boolean
83
+ packOrderStrategy?: "largest_to_smallest"
84
+ packPlacementStrategy?: "shortest_connection_along_outline"
85
+
72
86
  padding?: Distance
73
87
  paddingLeft?: Distance
74
88
  paddingRight?: Distance
@@ -218,6 +232,19 @@ export interface SubcircuitGroupProps extends BaseGroupProps {
218
232
  schTraceAutoLabelEnabled?: boolean
219
233
 
220
234
  partsEngine?: PartsEngine
235
+
236
+ /** When autosizing, the board will be made square */
237
+ square?: boolean
238
+ /** Desired empty area of the board e.g. "22mm^2" or "20%" */
239
+ emptyArea?: string
240
+ /** Desired filled area of the board e.g. "22mm^2" or "20%" */
241
+ filledArea?: string
242
+
243
+ width?: number | string
244
+ height?: number | string
245
+ outline?: Point[]
246
+ outlineOffsetX?: number | string
247
+ outlineOffsetY?: number | string
221
248
  }
222
249
 
223
250
  export interface SubcircuitGroupPropsWithBool extends SubcircuitGroupProps {
@@ -264,6 +291,14 @@ export const subcircuitGroupProps = baseGroupProps.extend({
264
291
  partsEngine: partsEngine.optional(),
265
292
  pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),
266
293
  autorouter: autorouterProp.optional(),
294
+ square: z.boolean().optional(),
295
+ emptyArea: z.string().optional(),
296
+ filledArea: z.string().optional(),
297
+ width: distance.optional(),
298
+ height: distance.optional(),
299
+ outline: z.array(point).optional(),
300
+ outlineOffsetX: distance.optional(),
301
+ outlineOffsetY: distance.optional(),
267
302
  })
268
303
 
269
304
  export const subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.262",
3
+ "version": "0.0.264",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",