Files
editor/packages/nodes/src/liquid-line/options.ts
T
Sudhir YadavandGitHub 5551500d98 feat: HVAC ductwork + DWV plumbing systems (#402)
Adds two new MEP node families (HVAC ductwork, DWV plumbing) built on a shared port-connectivity model. Co-authored by @sudhir9297.
2026-06-16 15:30:39 -04:00

22 lines
745 B
TypeScript

import { create } from 'zustand'
/**
* Shared draw-time options for the liquid-line tool. Lives in the nodes
* package so both the tool (which reads + key-toggles it) and the app's MEP
* panel (which renders the toggle button) can bind to the same state.
*
* `follow` arms "trace a lineset": while on, clicking an existing lineset
* lays a liquid line beside it along the same path instead of free-drawing.
*/
type LiquidLineToolOptions = {
follow: boolean
setFollow: (value: boolean) => void
toggleFollow: () => void
}
export const useLiquidLineToolOptions = create<LiquidLineToolOptions>((set) => ({
follow: false,
setFollow: (value) => set({ follow: value }),
toggleFollow: () => set((s) => ({ follow: !s.follow })),
}))