{ if (hasDirty) { event.preventDefault(); event.returnValue = ""; } }} /> {#if preferences} preferences = null} />{/if} {#if quickOpen && workspace} void openFile(entry)} onClose={() => quickOpen = false} />{/if} {#if templateManager && workspace} templateManager = false} onEdit={(entry) => { templateManager = false; void openFile(entry, undefined, "new"); }} onRenamed={(from, to) => { applyPathRename(from, to); refreshToken++; }} onDeleted={(path) => { removePluginDocuments(path); void documents?.refresh(); refreshToken++; }} />{/if}
0} class:left-open={!transferredWindow && leftOpen} class:right-open={!transferredWindow && rightOpen} role="application" aria-label={$t("RuneStone workbench")} style:--left="{leftWidth}px" style:--right="{rightWidth}px" style:--bottom="{bottomHeight}px" onpointermove={onPointerMove} onpointerup={() => (dragging = null)} onpointerleave={() => (dragging = null)} >
{#if !transferredWindow} selectLeft("files")} /> selectLeft("search")} /> selectLeft("bookmarks")} /> {#each sidebarNavigation as item (`${item.owner}:${item.id}`)} openPluginView(item.owner, item.id)} /> {/each} {/if}
void closeTabs(path, scope)} onPin={pinWorkingTab} fileActions={workingTabFileActions} tabActions={workingTabActions} onMove={moveWorkingTab} onDetach={(tab) => { void detachTab(tab); }} tabDragData={workingTabDragData} onDropTab={(data, index) => void receiveTab(data, index)} /> {#if desktop}
{/if}
{#if browserContribution?.newTab} void openBrowser()} />{/if} void save()} /> {#if terminalEnabled}{/if} {#if !transferredWindow} (rightOpen = !rightOpen)} />{/if} {#if desktop} error = message} />{/if}
{#if !transferredWindow}{/if} {#if leftOpen && !transferredWindow} {/if}
{#each $pluginEditors as pane (pane.key)} {@const bounds = pluginBounds[pane.key]}
{ if ($pluginView?.key !== pane.key) selectPluginEditor(pane); }} onpointerdown={() => { if ($pluginView?.key !== pane.key) selectPluginEditor(pane); }}> {#if activeSplit && bounds} tab.id === pane.key)} activePath={activeTabPath} onSelect={selectWorkingTab} onClose={closeTab} onMove={moveWorkingTab} onPin={pinWorkingTab} onCloseTabs={(path, scope) => void closeTabs(path, scope)} fileActions={workingTabFileActions} tabActions={workingTabActions} tabDragData={workingTabDragData} onDropTab={(data, index) => void receiveTab(data, index)} /> {/if}
{/each}
1}> {#each documentViews as pane (pane.id)}
focusDocumentPane(pane.id)} onfocusin={() => focusDocumentPane(pane.id)}> {#if pane.buffer?.diskError} {:else if pane.buffer?.diskContents != null}
{$t("View disk version")}
{pane.buffer.diskContents}
{/if} 1 ? () => closeSplit(pane.id) : undefined} hasWorkspace={!!workspace} onOpenWorkspace={() => void chooseWorkspace()} onNewFile={() => void newFile()} onNewNote={(event) => { void newNote(event); }} onQuickOpen={() => quickOpen = true} onOpenBrowser={browserContribution?.newTab ? () => void openBrowser() : undefined} {browserOpening} buffer={pane.buffer} chrome={pane.buffer?.chromeOverride ?? pane.buffer?.chrome ?? "Writing"} reading={pane.reading} focusLine={documentPanes.active === pane.id ? focusLine : null} {onChange} onInsertImage={file => insertImage(file, pane.buffer)} onRenameTitle={renameNoteTitle} tableActions={{ onSearch: searchSelection, onExtract: (markdown, label, valid) => extractSelection(markdown, label, valid, pane.buffer) }} linkActions={{ browser: browserContribution ? async target => { if (!await browserContribution?.open(target)) throw new Error("Could not open the app browser."); } : undefined, defaultBrowser: target => openUrl(target), workspaceItems: link => workspaceLinkItems(link, pane.buffer?.relPath ?? "", pane.id), }} onToggleReading={() => setReading(!pane.reading, pane.id)} onToggleChrome={() => { focusDocumentPane(pane.id); toggleChrome(); }} onOpenLink={(kind, target) => void openLink(kind, target, pane.buffer?.relPath ?? "", pane.id)} />
{/each}
{#if terminalContribution && terminalStarted}
{#if workspace} {#key workspace.root} { terminalOpen = false; terminalStarted = false; terminalMaximized = false; }} maximized={terminalMaximized} onMaximize={() => terminalMaximized = !terminalMaximized} activeFile={buffer?.kind === "text" && !reading} onRunFile={terminalFile} getSelection={() => selectedEditorText(buffer?.id)} onConfigureTasks={configureTasks} /> {/key} {:else}

{$t("Open a workspace to start the terminal.")}

{/if}
{/if}
{#if rightOpen && !transferredWindow} {/if}
{error ?? status} {#if workspace} {workspace.watch_mode} watch {/if} {isIde ? $t("IDE") : $t("Writer")}