- Adjusted button styles across various components for consistency and better UX. - Enhanced layout of action controls to utilize whitespace more effectively. - Updated slider styles for a more modern appearance and improved usability. - Refined input fields and labels for better accessibility and readability. - Introduced new app surface styles for a cohesive design across the application. - Added tests for canvas cursor behavior to ensure correct cursor display during operations.
29 lines
998 B
TypeScript
29 lines
998 B
TypeScript
import type { WorkspacePanel } from "@editor/state";
|
|
import type { Command } from "./command";
|
|
import { commandIds } from "./ids";
|
|
|
|
export type WorkspaceSetPanelPayload = { panel: WorkspacePanel };
|
|
|
|
export const workspaceSetPanelCommand: Command<WorkspaceSetPanelPayload> = {
|
|
id: commandIds.workspaceSetPanel,
|
|
name: "Set workspace panel",
|
|
history: { mode: "ignore" },
|
|
execute({ state }, payload) {
|
|
if (!workspacePanels.has(payload.panel)) return state;
|
|
if (state.editor.workspace.panel === payload.panel && !state.editor.brushPreview && !state.editor.brushStrokePreview) return state;
|
|
return {
|
|
...state,
|
|
editor: {
|
|
...state.editor,
|
|
workspace: { panel: payload.panel },
|
|
brushPreview: undefined,
|
|
brushStrokePreview: undefined,
|
|
},
|
|
};
|
|
},
|
|
};
|
|
|
|
const workspacePanels = new Set<WorkspacePanel>(["none", "generate", "chromaKey", "layers"]);
|
|
|
|
export const workspaceCommands = [workspaceSetPanelCommand] satisfies Command<unknown>[];
|