feat(shared-ui): add reusable HelpModal system with keyboard shortcuts and syntax panels

- Create new help module with HelpModal, KeyboardShortcutsPanel, and SyntaxHelpPanel components
- Add common shortcuts and syntax constants for reusability
- Refactor InputBarHelpModal to use new HelpModal component
- Fix ContextMenu event handling with stopPropagation and pointer-events
- Fix Modal z-index for proper stacking context
- Add CalendarHeaderContextMenu import to WeekView

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-12-14 23:43:19 +01:00
parent 5ac8de722d
commit c712cc7995
12 changed files with 1238 additions and 195 deletions

View file

@ -20,6 +20,7 @@
import EventCard from './EventCard.svelte';
import TaskBlock from './TaskBlock.svelte';
import EventContextMenu from '$lib/components/event/EventContextMenu.svelte';
import CalendarHeaderContextMenu from './CalendarHeaderContextMenu.svelte';
import { goto } from '$app/navigation';
import {
format,

View file

@ -0,0 +1,108 @@
import { NavigationArrow, CalendarBlank, ListChecks } from '@manacore/shared-icons';
import {
COMMON_SHORTCUTS,
COMMON_SYNTAX,
DEFAULT_LIVE_EXAMPLE,
type HelpModalConfig,
type ShortcutCategory,
type SyntaxGroup,
} from '@manacore/shared-ui';
/**
* Calendar-specific keyboard shortcuts
*/
const CALENDAR_SHORTCUTS: ShortcutCategory[] = [
{
id: 'navigation',
title: 'Navigation',
icon: NavigationArrow,
shortcuts: [
{
keys: ['Cmd', '1'],
altKeys: ['Ctrl', '1'],
description: 'Kalender öffnen',
category: 'navigation',
},
{
keys: ['Cmd', '2'],
altKeys: ['Ctrl', '2'],
description: 'Aufgaben öffnen',
category: 'navigation',
},
{
keys: ['Cmd', '3'],
altKeys: ['Ctrl', '3'],
description: 'Statistiken öffnen',
category: 'navigation',
},
{
keys: ['Cmd', '4'],
altKeys: ['Ctrl', '4'],
description: 'Einstellungen öffnen',
category: 'navigation',
},
],
},
{
id: 'calendar',
title: 'Kalender',
icon: CalendarBlank,
shortcuts: [
{
keys: ['Enter'],
description: 'Event/Task öffnen',
category: 'calendar',
},
{
keys: ['Space'],
description: 'Event/Task öffnen',
category: 'calendar',
},
{
keys: ['Esc'],
description: 'Drag/Resize abbrechen',
category: 'calendar',
},
],
},
{
id: 'tasks',
title: 'Aufgaben',
icon: ListChecks,
shortcuts: [
{
keys: ['Enter'],
description: 'Aufgabe öffnen',
category: 'tasks',
},
{
keys: ['Space'],
description: 'Aufgabe abhaken',
category: 'tasks',
},
],
},
];
/**
* Calendar-specific syntax patterns (extends common syntax)
*/
const CALENDAR_SYNTAX: SyntaxGroup[] = [
// Calendar uses all common syntax patterns
];
/**
* Complete help configuration for the Calendar app
* Combines common shortcuts/syntax with Calendar-specific ones
*/
export const CALENDAR_HELP_CONFIG: HelpModalConfig = {
shortcuts: [...COMMON_SHORTCUTS, ...CALENDAR_SHORTCUTS],
syntax: [...COMMON_SYNTAX, ...CALENDAR_SYNTAX],
defaultTab: 'shortcuts',
liveExample: DEFAULT_LIVE_EXAMPLE,
};
/**
* Export individual parts for customization
*/
export { CALENDAR_SHORTCUTS, CALENDAR_SYNTAX };