feat: add welcome tab, presentation/publishing exports, and spell checking

- Developer format support (JSON, YAML, XML, TOML) import/export
- Presentation export (Reveal.js slides, Beamer PDF)
- Publishing format exports (Confluence wiki, MOBI e-book)
- Enable system spell checking with context menu suggestions
- Add welcome tab with onboarding and feature showcase
This commit is contained in:
2026-03-04 16:24:05 +05:30
parent b5409b7754
commit 336b24365d
4 changed files with 150 additions and 0 deletions
+47
View File
@@ -18,6 +18,7 @@ const { renderSnippetsPanel } = require('./sidebar/snippets-panel');
const { ReplPanel } = require('./repl/repl-panel');
const { CommandPalette } = require('./command-palette');
const { PrintPreview } = require('./print-preview');
const { createWelcomeContent } = require('./welcome');
// Configure marked with highlight extension
marked.use(markedHighlight({
@@ -1192,6 +1193,52 @@ document.addEventListener('DOMContentLoaded', () => {
})
});
// Welcome tab on startup
const hasLaunched = localStorage.getItem('hasLaunchedBefore');
const showWelcome = localStorage.getItem('showWelcomeOnStartup') !== 'false';
if (!hasLaunched || showWelcome) {
localStorage.setItem('hasLaunchedBefore', 'true');
// Set welcome content in the first tab's preview
const recentFiles = JSON.parse(localStorage.getItem('recentFiles') || '[]');
const welcomeHtml = createWelcomeContent(recentFiles);
const tab = tabManager.tabs.get(tabManager.activeTabId);
if (tab) {
tab.title = 'Welcome';
tab.content = '';
const preview = document.getElementById(`preview-${tab.id}`);
if (preview) {
preview.innerHTML = welcomeHtml;
// Wire up card actions
preview.querySelectorAll('.welcome-card').forEach(card => {
card.addEventListener('click', () => {
const action = card.dataset.action;
if (action === 'new-file') tabManager.createNewTab();
else if (action === 'open-file') ipcRenderer.send('menu-open');
else if (action === 'open-template') sidebarManager.togglePanel('templates');
else if (action === 'command-palette') {
if (typeof commandPalette !== 'undefined') commandPalette.open();
}
});
});
// Wire up recent files
preview.querySelectorAll('.welcome-recent-item').forEach(item => {
item.addEventListener('click', () => ipcRenderer.send('open-file-path', item.dataset.path));
});
// Wire up show-on-startup checkbox
const checkbox = document.getElementById('show-welcome-startup');
if (checkbox) {
checkbox.addEventListener('change', () => {
localStorage.setItem('showWelcomeOnStartup', checkbox.checked);
});
}
}
tabManager.updateTabBar();
}
}
// Image paste handler
document.addEventListener('paste', async (e) => {
const items = e.clipboardData?.items;