@tscircuit/props 0.0.358 → 0.0.359
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 +4 -0
- package/dist/index.d.ts +567 -563
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +10 -0
- package/package.json +1 -1
package/lib/components/group.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
commonLayoutProps,
|
|
7
7
|
type SupplierPartNumbers,
|
|
8
8
|
} from "lib/common/layout"
|
|
9
|
+
import { ninePointAnchor } from "lib/common/ninePointAnchor"
|
|
9
10
|
import { type Point, point } from "lib/common/point"
|
|
10
11
|
import { expectTypesMatch } from "lib/typecheck"
|
|
11
12
|
import { z } from "zod"
|
|
@@ -210,6 +211,10 @@ export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {
|
|
|
210
211
|
pcbPaddingRight?: Distance
|
|
211
212
|
pcbPaddingTop?: Distance
|
|
212
213
|
pcbPaddingBottom?: Distance
|
|
214
|
+
/**
|
|
215
|
+
* Anchor to use when interpreting pcbX/pcbY relative to pcbPosition
|
|
216
|
+
*/
|
|
217
|
+
pcbPositionAnchor?: AutocompleteString<z.infer<typeof ninePointAnchor>>
|
|
213
218
|
|
|
214
219
|
/** @deprecated Use `pcbGrid` */
|
|
215
220
|
grid?: boolean
|
|
@@ -325,6 +330,10 @@ export type AutorouterProp =
|
|
|
325
330
|
| AutorouterConfig
|
|
326
331
|
| AutocompleteString<AutorouterPreset>
|
|
327
332
|
|
|
333
|
+
const pcbPositionAnchorAutocomplete = z.custom<
|
|
334
|
+
AutocompleteString<z.infer<typeof ninePointAnchor>>
|
|
335
|
+
>((value) => typeof value === "string")
|
|
336
|
+
|
|
328
337
|
export const autorouterConfig = z.object({
|
|
329
338
|
serverUrl: z.string().optional(),
|
|
330
339
|
inputFormat: z.enum(["simplified", "circuit-json"]).optional(),
|
|
@@ -520,6 +529,7 @@ export const baseGroupProps = commonLayoutProps.extend({
|
|
|
520
529
|
pcbPaddingRight: length.optional(),
|
|
521
530
|
pcbPaddingTop: length.optional(),
|
|
522
531
|
pcbPaddingBottom: length.optional(),
|
|
532
|
+
pcbPositionAnchor: pcbPositionAnchorAutocomplete.optional(),
|
|
523
533
|
})
|
|
524
534
|
|
|
525
535
|
export const partsEngine = z.custom<PartsEngine>((v) => "findPart" in v)
|