{#if app.view === "editor"} {app.target?.path.split("/").pop()} {#if app.target?.standalone} single file {/if} {#if app.dirty} {/if} {:else} Typst Desktop {/if}
{#if app.view === "editor"} {lspLabel[app.lspStatus]}
{#if app.target?.space_id || app.documentLink} {/if} {/if}
{#if app.status || app.error}
{app.error || app.status} {#if app.conflicts.length > 0} {/if}
{/if}
{#if app.view === "files"}
(dialog = { kind: "new-project" })} onnewfolder={() => (dialog = { kind: "new-folder" })} onnewdocument={() => (dialog = { kind: "new-document" })} onupload={importFiles} onrename={(entry) => (dialog = { kind: "rename-entry", entry })} ondelete={(entry) => (dialog = { kind: "delete-entry", entry })} onlink={(entry) => (dialog = { kind: "link-entry", entry })} onviewimage={(paths, index) => (imageViewer = { paths, index })} ondownloaddocument={(documentId, title) => downloadDocument(documentId, title)} onnewspace={() => (dialog = { kind: "new-space" })} onclonespace={(id, name) => (dialog = { kind: "clone-space", id, name })} ondeletespace={(id) => (dialog = { kind: "delete-space", id })} onsignin={() => (dialog = { kind: "login" })} />
{:else} {#if !app.target?.standalone}
Files
(dialog = { kind: "rename-file", path })} ondelete={(path) => (dialog = { kind: "delete-file", path })} onsetentry={setEntrypoint} />
{/if}
{#if app.activePath && activeFile?.is_text} (dialog = { kind: "assets" })} onpagesettings={() => (dialog = { kind: "page-settings" })} />
{app.activePath} {#if app.dirty} edited {/if}
{#key app.target?.path + ":" + app.activePath}
{ app.editorContent = value; app.dirty = true; scheduleCompile(); scheduleAutosave(); }} onsave={saveAndCompile} onlspstatus={(status) => (app.lspStatus = status)} onready={(view) => (editorView = view)} />
{/key} {:else}

{app.activePath ? "This file cannot be edited as text" : "Select a file to edit"}

{/if}
{/if}
{#if imageViewer} (imageViewer = null)} /> {/if} {#if dropActive}

{app.view === "editor" ? `Drop to add files to ${app.target?.path.split("/").pop()}` : app.currentDir ? `Drop to add files to ${app.currentDir.split("/").pop()}` : "Drop to add files to your workspace"}

Images, fonts, and Typst files are copied in.

{/if} {#if dialog.kind === "new-project"} {:else if dialog.kind === "new-folder"} {:else if dialog.kind === "new-document"} {:else if dialog.kind === "rename-entry"} {@const target = dialog} renameEntry(target.entry, name)} onclose={close} /> {:else if dialog.kind === "delete-entry"} {@const target = dialog} deleteEntry(target.entry)} onclose={close} /> {:else if dialog.kind === "link-entry"} {@const target = dialog} linkEntry(target.entry)} onclose={close} /> {:else if dialog.kind === "new-space"} {:else if dialog.kind === "delete-space"} {@const target = dialog} deleteSpace(target.id)} onclose={close} /> {:else if dialog.kind === "clone-space"} {@const target = dialog} cloneSpace(target.id, name)} onclose={close} /> {:else if dialog.kind === "new-file"} {:else if dialog.kind === "new-subfolder"} {:else if dialog.kind === "rename-file"} {@const target = dialog} renameFile(target.path, next)} onclose={close} /> {:else if dialog.kind === "delete-file"} {@const target = dialog} deleteFile(target.path)} onclose={close} /> {:else if dialog.kind === "login"} { close(); await refreshAccount(); app.scope = "cloud"; setStatus("Connected to TypstDrive"); }} onclose={close} /> {:else if dialog.kind === "settings"} (dialog = { kind: "login" })} /> {:else if dialog.kind === "info"} {:else if dialog.kind === "assets"} { insertText(editorView, snippet); close(); } : undefined} onchanged={compile} onclose={close} /> {:else if dialog.kind === "page-settings"} {:else if dialog.kind === "conflicts"} {/if}