import type { Command } from "./command"; import { commandIds } from "./ids"; export type EditorSetPointerSessionPayload = { type: "pan" } | undefined; export const editorSetPointerSessionCommand: Command = { id: commandIds.editorSetPointerSession, name: "Set pointer session", history: { mode: "ignore" }, execute({ state }, payload) { if (state.editor.pointerSession?.type === payload?.type) return state; return { ...state, editor: { ...state.editor, pointerSession: payload } }; }, }; export const editorCommands = [editorSetPointerSessionCommand] satisfies Command[];