feat: add command palette functionality and shortcuts
- Implemented command palette with keyboard shortcut (⌘K) for opening. - Added commands for opening, closing, setting query, and selecting items in the command palette. - Created tests for command palette commands and input handling. - Enhanced layer actions with functions for adding, grouping, and deleting layers. - Updated UI components to integrate command palette and shortcuts.
This commit is contained in:
@@ -17,6 +17,11 @@ export const initialEditorState: EditorState = {
|
||||
selectedCandidateId: undefined,
|
||||
compareMode: "result",
|
||||
},
|
||||
commandPalette: {
|
||||
open: false,
|
||||
query: "",
|
||||
selectedIndex: 0,
|
||||
},
|
||||
transformSession: undefined,
|
||||
maskEdit: undefined,
|
||||
brushPreview: undefined,
|
||||
|
||||
@@ -87,11 +87,18 @@ export type GenerationState = {
|
||||
compareMode: GenerationCompareMode;
|
||||
};
|
||||
|
||||
export type CommandPaletteState = {
|
||||
open: boolean;
|
||||
query: string;
|
||||
selectedIndex: number;
|
||||
};
|
||||
|
||||
export type EditorState = {
|
||||
viewport: ViewportState;
|
||||
selection: SelectionState;
|
||||
tools: ToolState;
|
||||
generation: GenerationState;
|
||||
commandPalette: CommandPaletteState;
|
||||
transformSession?: TransformSession;
|
||||
maskEdit?: MaskEditState;
|
||||
brushPreview?: BrushPreviewState;
|
||||
|
||||
Reference in New Issue
Block a user