67 const std::string& source,
const std::string& filename =
"");
155 const std::string& source,
156 const std::vector<DetectedShortcut>& existing_extracted);
167 const std::vector<DefaultShortcutCandidate>& accepted,
Normalized intermediate representation (IR) for imported designs: the IR value model (style,...
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
DefaultShortcutScan detect_default_shortcuts(const std::string &source, const std::vector< DetectedShortcut > &existing_extracted)
Static-scan a TSX/JS source string for components matching the platform-convention defaults table.
std::vector< DetectedShortcut > apply_default_shortcuts(const std::vector< DefaultShortcutCandidate > &accepted, TargetPlatform platform)
DefaultShortcutPattern
Which platform-convention surface a default binding maps to.
Definition design_shortcuts.hpp:95
@ new_file
Definition design_shortcuts.hpp:99
@ settings
Definition design_shortcuts.hpp:96
@ help
Definition design_shortcuts.hpp:97
@ save_file
Definition design_shortcuts.hpp:101
@ cheatsheet
Definition design_shortcuts.hpp:98
@ find
Definition design_shortcuts.hpp:102
@ open_file
Definition design_shortcuts.hpp:100
bool looks_like_bundler_entry(const std::string &html)
Heuristic: does this HTML look like a JS-bundler entry (React, Vue, Svelte, @pulp/react,...
std::string serialize_default_shortcut_scan(const DefaultShortcutScan &scan)
Render the auto-bound defaults + collisions into JSON for emission alongside the extracted-shortcuts ...
TargetPlatform
Convert accepted candidates from detect_default_shortcuts into the DetectedShortcut form that V2 code...
Definition design_shortcuts.hpp:164
@ macos
Definition design_shortcuts.hpp:164
@ win_linux
Definition design_shortcuts.hpp:164
std::string serialize_detected_shortcuts(const std::vector< DetectedShortcut > &shortcuts)
Serialize a list of DetectedShortcuts to JSON in the caller-provided order.
AudioWidgetType
Audio widget type detected from naming conventions or annotations.
Definition design_ir.hpp:258
std::vector< DetectedShortcut > extract_keyboard_shortcuts(const std::string &source, const std::string &filename="")
Static-scan a TSX/JS source string for keyboard-shortcut patterns.
@ html
Definition design_ir.hpp:46
AudioWidgetType detect_audio_widget(const std::string &name)
Detect audio widget type from a node name.
One default-binding emission produced by the source heuristic.
Definition design_shortcuts.hpp:110
std::string target
Component name / identifier that won the match — for traceability in shortcuts.json and for the devel...
Definition design_shortcuts.hpp:114
DefaultShortcutPattern pattern
Definition design_shortcuts.hpp:111
std::vector< std::string > signals
Source signals that fired, in order.
Definition design_shortcuts.hpp:120
std::string confidence
"high" (≥3 signals) or "medium" (exactly 2).
Definition design_shortcuts.hpp:117
One unresolved candidate set — emitted when multiple components match the same pattern with comparabl...
Definition design_shortcuts.hpp:126
std::string reason
Definition design_shortcuts.hpp:129
std::vector< std::string > candidates
Definition design_shortcuts.hpp:128
DefaultShortcutPattern pattern
Definition design_shortcuts.hpp:127
Result of running detect_default_shortcuts.
Definition design_shortcuts.hpp:136
std::vector< DefaultShortcutCollision > collisions
Definition design_shortcuts.hpp:138
std::vector< DefaultShortcutCandidate > accepted
Definition design_shortcuts.hpp:137
Definition design_shortcuts.hpp:26
std::vector< std::string > modifiers
Modifier names normalized to the extractor's emission order: "meta", "ctrl", "alt",...
Definition design_shortcuts.hpp:41
std::string source_location
Best-effort source location for the matched pattern, in <file>:<line> form when the input source carr...
Definition design_shortcuts.hpp:46
std::string key
Human-readable key name in DOM-spec form: "Escape", "s", "ArrowLeft".
Definition design_shortcuts.hpp:35
std::string pattern
Verbatim pattern as it appeared in source — "e.key === 'Escape'", "e.metaKey && e....
Definition design_shortcuts.hpp:30
std::string handler_excerpt
Best-effort handler-body excerpt — the first ~80 chars after the condition match.
Definition design_shortcuts.hpp:51