feat: unify utilities into shared packages (Tier 1)

- Add LanguageSelector component to @manacore/shared-i18n
- Add keyboard.ts to @manacore/shared-utils (shortcuts handling)
- Add cache.ts to @manacore/shared-utils (IndexedDB caching)
- Extend format.ts and date.ts with additional utilities
- Update Memoro to use shared utilities with app-specific wrappers

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-24 22:19:04 +01:00
parent 7d426d57fd
commit 74ccad38d5
15 changed files with 877 additions and 647 deletions

View file

@ -150,3 +150,29 @@ export function formatPercent(
maximumFractionDigits: decimals,
}).format(value);
}
/**
* Format duration as compact string (alias for formatDuration)
* Kept for compatibility - returns MM:SS or HH:MM:SS
*/
export const formatDurationCompact = formatDuration;
/**
* Parse duration string to seconds
*
* @param duration - Duration string (e.g., "1:30" or "1:01:05")
* @returns Duration in seconds
*/
export function parseDuration(duration: string): number {
const parts = duration.split(':').map(Number);
if (parts.length === 3) {
// Hours:Minutes:Seconds
return parts[0] * 3600 + parts[1] * 60 + parts[2];
} else if (parts.length === 2) {
// Minutes:Seconds
return parts[0] * 60 + parts[1];
}
return parts[0] || 0;
}