1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Named commands, contexts, rebindable keys, and the registry.
//!
//! A workbench application describes each action once as a [`Command`], registers it in
//! a [`CommandRegistry`], and lets menus, the palette, the title bar, context menus, and
//! keyboard shortcuts all read that registry. Nothing has to be wired three times.
//!
//! The core owns the metadata, the `when` language, the key syntax, the sequence state,
//! and the conflict rules. The UI adapts `egui::Key`/`egui::Modifiers` and feeds
//! [`CommandRegistry::handle_key`]; it keeps only the widgets (CORE-KEY-01..04).
//!
//! ```
//! use crisol_core::commands::{Command, CommandRegistry, WhenContext};
//!
//! let mut registry = CommandRegistry::new();
//! registry.register(Command::new("file.save", "Save").shortcut("Ctrl+S"));
//! registry.register(
//! Command::new("edit.paste", "Paste")
//! .shortcut("Ctrl+V")
//! .when("editorFocus && !dialogOpen"),
//! );
//! let context = WhenContext::new().with("editorFocus");
//! assert_eq!(registry.bindings().len(), 2);
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;