Publisher pack

This commit is contained in:
TC
2026-06-14 18:34:43 +10:00
parent 32c57e02f1
commit 839f61cffe
7 changed files with 59 additions and 4 deletions

View File

@@ -38,6 +38,15 @@ export default function App(): JSX.Element {
console.error('[App] openStoryBible failed:', err)
}
}
const handleOpenPublisherPack = async (): Promise<void> => {
try {
const { path, content } = await window.api.openPublisherPack()
setActiveFile(path, content)
} catch (err) {
console.error('[App] openPublisherPack failed:', err)
}
}
const [sidebarOpen, setSidebarOpen] = useState(
() => localStorage.getItem('sidebarOpen') !== 'false'
)
@@ -212,16 +221,23 @@ export default function App(): JSX.Element {
<button
className="sidebar-nav-btn"
onClick={handleOpenStoryBible}
title="Open Story Bible"
title="Story Bible"
>
<span className="sidebar-nav-icon">📖</span>
</button>
<button
className="sidebar-nav-btn"
onClick={handleOpenPublisherPack}
title="Publisher Pack"
>
<span className="sidebar-nav-label">Pack</span>
</button>
<button
className={`sidebar-nav-btn${showSubmissions ? ' active' : ''}`}
onClick={goSubmissions}
title="Submissions"
>
<span className="sidebar-nav-icon"></span>
<span className="sidebar-nav-label">Sub</span>
</button>
</div>
<FileTree />

View File

@@ -207,6 +207,15 @@
line-height: 1;
}
.sidebar-nav-label {
font-family: var(--font-sans);
font-size: 9px;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
line-height: 1;
}
/* ─── Editor area ──────────────────────────────────────────────── */
.editor-area {
grid-row: 2;

View File

@@ -32,6 +32,7 @@ declare global {
moveFile: (sourcePath: string, targetDirPath: string) => Promise<string>
openStoryBible: () => Promise<{ path: string; content: string }>
writeStoryBible: (content: string) => Promise<string>
openPublisherPack: () => Promise<{ path: string; content: string }>
onMenuAction: (handler: (action: string) => void) => () => void
searchFiles: (query: string, options: SearchOptions) => Promise<SearchFileResult[]>
replaceInFiles: (query: string, replacement: string, options: SearchOptions, filePaths: string[]) => Promise<string[]>