Skip to content

Commit

Permalink
add support for schAutoLayoutEnabled prop on <group /> (#65)
Browse files Browse the repository at this point in the history
* add support for schematic autolayout prop on groups

* formatbot: Automatically format code

---------

Co-authored-by: tscircuitbot <tscircuitbot@users.noreply.github.com>
  • Loading branch information
seveibar and tscircuitbot authored Oct 18, 2024
1 parent 9c21209 commit 1440b48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/components/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export interface SubcircuitGroupProps extends BaseGroupProps {
layout?: LayoutBuilder
routingDisabled?: boolean
defaultTraceWidth?: Distance

/**
* If true, we'll automatically layout the schematic for this group. Must be
* a subcircuit (currently). This is eventually going to be replaced with more
* sophisticated layout options/modes and will be enabled by default.
*/
schAutoLayoutEnabled?: boolean
}

export type GroupProps = SubcircuitGroupProps | BaseGroupProps
Expand All @@ -27,6 +34,7 @@ export const baseGroupProps = commonLayoutProps.extend({
export const subcircuitGroupProps = baseGroupProps.extend({
subcircuit: z.literal(true),
layout: z.custom<LayoutBuilder>((v) => true).optional(),
schAutoLayoutEnabled: z.boolean().optional(),
routingDisabled: z.boolean().optional(),
defaultTraceWidth: length.optional(),
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@biomejs/biome": "^1.9.3",
"@biomejs/biome": "^1.9.4",
"@tscircuit/layout": "^0.0.11",
"@tscircuit/soup": "^0.0.69",
"@types/bun": "^1.1.8",
Expand Down

0 comments on commit 1440b48

Please sign in to comment.