ontoref/assets/presentation/setup/image-overlay.ts
Jesús Pérez d59644b96f
feat: unified auth model, project onboarding, install pipeline, config management
The full scope across this batch: POST /sessions key→token exchange, SessionStore dual-index with revoke_by_id, CLI Bearer injection (ONTOREF_TOKEN), ontoref setup
  --gen-keys, install scripts, daemon config form roundtrip, ADR-004/005, on+re self-description update (fully-self-described), and landing page refresh.
2026-03-13 20:56:31 +00:00

35 lines
796 B
TypeScript

import { onMounted, onUnmounted, ref } from 'vue'
/**
* Composable for image overlay functionality with M key toggle
* Used in the main app layout for keyboard handling
*/
export function useImageOverlay() {
const showImageOverlay = ref(false)
const toggleImageOverlay = () => {
showImageOverlay.value = !showImageOverlay.value
}
const handleKeyDown = (event: KeyboardEvent) => {
// Toggle image overlay with 'M' key (case-insensitive)
if (event.key.toLowerCase() === 'm') {
event.preventDefault()
toggleImageOverlay()
}
}
onMounted(() => {
window.addEventListener('keydown', handleKeyDown)
})
onUnmounted(() => {
window.removeEventListener('keydown', handleKeyDown)
})
return {
showImageOverlay,
toggleImageOverlay,
}
}