mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 17:30:07 +00:00
[refactor] Extract keybinding functionality into @comfyorg/keybinding package
Create framework-agnostic keybinding package following domain-driven design patterns. Move pure business logic to package while keeping Vue integration in workbench layer. Changes: - Add @comfyorg/keybinding package with KeyComboImpl and KeybindingImpl classes - Move core keybindings and reserved key constants to package - Update workbench layer to import from package with backward compatibility - Update all imports across codebase to use package exports - Maintain existing API surface for consumers
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import {
|
||||
CORE_KEYBINDINGS,
|
||||
KeyComboImpl,
|
||||
KeybindingImpl
|
||||
} from '@comfyorg/keybinding'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { CORE_KEYBINDINGS } from '@/platform/keybinding/constants/coreKeybindings'
|
||||
import { useCommandStore } from '@/stores/commandStore'
|
||||
import { useDialogStore } from '@/stores/dialogStore'
|
||||
import { useKeybindingService } from '@/workbench/keybindings/services/keybindingService'
|
||||
import {
|
||||
KeyComboImpl,
|
||||
KeybindingImpl,
|
||||
useKeybindingStore
|
||||
} from '@/workbench/keybindings/stores/keybindingStore'
|
||||
import { useKeybindingStore } from '@/workbench/keybindings/stores/keybindingStore'
|
||||
|
||||
// Mock stores
|
||||
vi.mock('@/platform/settings/settingStore', () => ({
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { KeybindingImpl } from '@comfyorg/keybinding'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
import { beforeEach, describe, expect, it } from 'vitest'
|
||||
|
||||
import {
|
||||
KeybindingImpl,
|
||||
useKeybindingStore
|
||||
} from '@/workbench/keybindings/stores/keybindingStore'
|
||||
import { useKeybindingStore } from '@/workbench/keybindings/stores/keybindingStore'
|
||||
|
||||
describe('useKeybindingStore', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user