@@ -23,7 +23,7 @@ import {
2323 PopoverTrigger ,
2424} from "@/components/ui/popover"
2525import { ToggleGroup , ToggleGroupItem } from "./ui/toggle-group"
26- import { makeShifter , type ShiftDirection } from "@/logic/nodeTypes/shift"
26+ import { makeShifter , type ShiftKind } from "@/logic/nodeTypes/shift"
2727import { neg } from "@/logic/nodeTypes/neg"
2828import type { NodeType } from "@/logic/simulation"
2929
@@ -34,7 +34,7 @@ type NodeInfo = {
3434}
3535
3636type NodeCreationParams = {
37- dir : ShiftDirection
37+ kind : ShiftKind
3838 bits : number
3939}
4040
@@ -50,13 +50,13 @@ const placeableNodes: NodeInfo[] = [
5050 {
5151 name : "Shift" ,
5252 params : true ,
53- node : ( params ) => makeShifter ( params . dir , params . bits ) ,
53+ node : ( params ) => makeShifter ( params . kind , params . bits ) ,
5454 } ,
5555]
5656
5757function AddNodePopup ( props : { trigger : ReactNode } ) {
5858 const [ selectedNode , setSelectedNode ] = useState < NodeInfo | undefined > ( )
59- const [ shiftDir , setShiftDir ] = useState < ShiftDirection > ( "left" )
59+ const [ shiftKind , setShiftKind ] = useState < ShiftKind > ( "left" )
6060 const [ shiftBits , setShiftBits ] = useState ( "1" )
6161
6262 return (
@@ -98,11 +98,14 @@ function AddNodePopup(props: { trigger: ReactNode }) {
9898 id = "shift-direction"
9999 type = "single"
100100 variant = "outline"
101- value = { shiftDir }
102- onValueChange = { ( v : ShiftDirection ) => setShiftDir ( v ) }
101+ value = { shiftKind }
102+ onValueChange = { ( v : ShiftKind ) => setShiftKind ( v ) }
103103 >
104104 < ToggleGroupItem value = "left" > Left</ ToggleGroupItem >
105105 < ToggleGroupItem value = "right" > Right</ ToggleGroupItem >
106+ < ToggleGroupItem value = "rightLogical" >
107+ Right Logical
108+ </ ToggleGroupItem >
106109 </ ToggleGroup >
107110 </ div >
108111
0 commit comments