Update editor, workspace, Git services, appearance, and project guides
This commit is contained in:
+187
-42
@@ -3,10 +3,10 @@
|
||||
import PluginTools from "$lib/plugins/PluginTools.svelte";
|
||||
import PluginAccessMenu from "$lib/plugins/PluginAccessMenu.svelte";
|
||||
import PluginEditor from "$lib/plugins/PluginEditor.svelte";
|
||||
import { pluginSplits, pinPluginEditor, pluginTabActions, pluginTabDragData, dropPluginTab, findPluginEditor } from "$lib/plugins/external";
|
||||
import { pluginSplits, pinPluginEditor, pluginTabActions, pluginTabState, restorePluginTab, pluginTabDragData, dropPluginTab, findPluginEditor } from "$lib/plugins/external";
|
||||
import { containsPane, paneBounds } from "$lib/workspace/splitLayout";
|
||||
import { pluginNavigation, openPluginView, pluginView, pluginEditors, pluginEditorActive, selectPluginEditor, closePluginEditor, openPluginDocument, renamePluginDocuments, removePluginDocuments, notifyPluginWorkspace, guardPluginWrites, handlePluginDocumentRename, cancelPluginDocumentOpen, type OpenPluginView } from "$lib/plugins/external";
|
||||
import { onMount, tick } from "svelte";
|
||||
import { pluginSidebar, closePluginSidebar, pluginNavigation, openPluginView, pluginView, pluginEditors, pluginEditorActive, selectPluginEditor, closePluginEditor, openPluginDocument, renamePluginDocuments, removePluginDocuments, notifyPluginWorkspace, guardPluginWrites, handlePluginFileOpen, handlePluginDocumentRename, cancelPluginDocumentOpen, type OpenPluginView } from "$lib/plugins/external";
|
||||
import { onMount, tick, untrack } from "svelte";
|
||||
import { selectedEditorText } from "$lib/editor/selection";
|
||||
import { pluginHost } from "$lib/plugins/registry";
|
||||
import type { Contributions } from "$lib/plugins/contracts";
|
||||
@@ -17,7 +17,8 @@
|
||||
import { Documents } from "$lib/workspace/documents";
|
||||
import { tabsToClose, type TabCloseScope } from "$lib/workspace/tabActions";
|
||||
import { orderWorkbenchTabs, type WorkbenchTab } from "$lib/workspace/workbenchTabs";
|
||||
import type { ActionMenuItem } from "$lib/ui/actionMenu";
|
||||
import { actionMenu, type ActionMenuItem } from "$lib/ui/actionMenu";
|
||||
import { createNote, noteTemplates, saveNoteTemplate, type NoteTemplate } from "$lib/workspace/templates";
|
||||
import { requestText } from "$lib/workspace/dialogs.svelte";
|
||||
import TextDialog from "./TextDialog.svelte";
|
||||
import QuickOpen from "./QuickOpen.svelte";
|
||||
@@ -25,6 +26,7 @@
|
||||
import SettingsDialog from "./SettingsDialog.svelte";
|
||||
import BrowserSlot from "$lib/plugins/BrowserSlot.svelte";
|
||||
import { DEFAULT_SETTINGS, SETTINGS_KEY, parseSettings, saveSettings, type AppSettings } from "$lib/workspace/settings";
|
||||
import { DEFAULT_WORKBENCH_LAYOUT, WORKBENCH_LAYOUT_KEY, parseWorkbenchLayout, saveWorkbenchLayout, type WorkbenchLayout } from "$lib/workspace/workbenchLayout";
|
||||
import FileTree from "./FileTree.svelte";
|
||||
import EditorPane from "./EditorPane.svelte";
|
||||
import TabBar from "./TabBar.svelte";
|
||||
@@ -79,13 +81,15 @@
|
||||
let error = $state<string | null>(null);
|
||||
let refreshToken = $state(0);
|
||||
let view = $state<Chrome>("Writing");
|
||||
let leftWidth = $state(260);
|
||||
let rightWidth = $state(240);
|
||||
let layoutReady = $state(false);
|
||||
let leftWidth = $state(DEFAULT_WORKBENCH_LAYOUT.leftWidth);
|
||||
let rightWidth = $state(DEFAULT_WORKBENCH_LAYOUT.rightWidth);
|
||||
let bottomHeight = $state(180);
|
||||
let leftView = $state<"files" | "search" | "bookmarks">("files");
|
||||
let leftView = $state<WorkbenchLayout["leftView"]>(DEFAULT_WORKBENCH_LAYOUT.leftView);
|
||||
let searchRequest = $state<{ text: string; id: number } | null>(null);
|
||||
let leftOpen = $state(true);
|
||||
let rightOpen = $state(true);
|
||||
let leftOpen = $state(DEFAULT_WORKBENCH_LAYOUT.leftOpen);
|
||||
let rightOpen = $state(DEFAULT_WORKBENCH_LAYOUT.rightOpen);
|
||||
$effect(() => { if ($pluginSidebar) leftOpen = true; });
|
||||
let terminalOpen = $state(false);
|
||||
let reading = $state(false);
|
||||
let quickOpen = $state(false);
|
||||
@@ -94,6 +98,8 @@
|
||||
let terminalDock: TerminalSlot | undefined = $state();
|
||||
const terminalContribution = $derived.by(() => { void $pluginHost; return pluginHost.get("terminal"); });
|
||||
const terminalEnabled = $derived(!!terminalContribution);
|
||||
const sidebarNavigation = $derived($pluginNavigation.filter(item => item.placement === "sidebar" && !item.toolbar));
|
||||
const ribbonNavigation = $derived($pluginNavigation.filter(item => item.placement !== "sidebar" && !item.toolbar));
|
||||
const browserContribution = $derived.by(() => { void $pluginHost; return pluginHost.get("browser"); });
|
||||
let browserOpening = $state(false);
|
||||
async function openBrowser() {
|
||||
@@ -125,6 +131,7 @@
|
||||
|
||||
let saving = $state(false);
|
||||
let switching = false;
|
||||
let workbenchReady = $state(false);
|
||||
let documents: Documents | null = null;
|
||||
let editorPane: EditorPane | undefined = $state();
|
||||
let closingTabs = false;
|
||||
@@ -165,6 +172,13 @@
|
||||
})),
|
||||
]);
|
||||
const workingTabs = $derived(orderWorkbenchTabs(availableTabs, tabOrder));
|
||||
$effect(() => {
|
||||
if (workbenchReady && !availableTabs.length) untrack(() => {
|
||||
const previousError = error;
|
||||
newTab();
|
||||
error = previousError;
|
||||
});
|
||||
});
|
||||
function workingTabDragData(tab: WorkbenchTab) {
|
||||
const view = $pluginEditors.find(view => view.key === tab.id);
|
||||
return view ? pluginTabDragData(view) : undefined;
|
||||
@@ -241,7 +255,9 @@
|
||||
}
|
||||
|
||||
function selectLeft(next: "files" | "search" | "bookmarks") {
|
||||
if (leftOpen && leftView === next) {
|
||||
const hadSidebar = !!$pluginSidebar;
|
||||
closePluginSidebar();
|
||||
if (!hadSidebar && leftOpen && leftView === next) {
|
||||
leftOpen = false;
|
||||
return;
|
||||
}
|
||||
@@ -270,9 +286,31 @@
|
||||
documents = createDocuments();
|
||||
status = workspace.root;
|
||||
refreshToken += 1;
|
||||
const token = new URLSearchParams(location.search).get("tabTransfer");
|
||||
if (token && /^[0-9a-f-]{36}$/i.test(token)) {
|
||||
const key = `runestone.tab-transfer.${token}`;
|
||||
const raw = localStorage.getItem(key);
|
||||
if (raw) {
|
||||
const transfer = JSON.parse(raw);
|
||||
if (transfer.root === workspace.root && transfer.created > Date.now() - 120000
|
||||
&& (transfer.buffer || transfer.plugin)) {
|
||||
if (transfer.buffer && typeof transfer.buffer.relPath === "string" && typeof transfer.buffer.contents === "string") documents.importTab(transfer.buffer);
|
||||
else if (transfer.plugin) {
|
||||
const deadline = Date.now() + 15000;
|
||||
while (!await restorePluginTab(transfer.plugin)) {
|
||||
if (Date.now() > deadline) throw new Error("Enable the plugin before moving this tab.");
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
}
|
||||
} else throw new Error("Invalid tab transfer.");
|
||||
reading = transfer.reading === true;
|
||||
localStorage.setItem(key + ".accepted", "true");
|
||||
localStorage.removeItem(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) { error = String(err); }
|
||||
finally { switching = false; }
|
||||
finally { switching = false; workbenchReady = true; }
|
||||
}
|
||||
|
||||
function selectTab(relPath: string) {
|
||||
@@ -307,7 +345,40 @@
|
||||
}
|
||||
function workingTabActions(item: WorkbenchTab): ActionMenuItem[] {
|
||||
const tab = workingTabs.find(tab => tab.id === item.id);
|
||||
return tab && "plugin" in tab ? pluginTabActions(tab.plugin) : [];
|
||||
const actions = tab && "plugin" in tab ? pluginTabActions(tab.plugin) : [];
|
||||
if (actions.some(action => "label" in action && /(?:move|open).*new window/i.test(action.label))) return actions;
|
||||
return tab ? [{ label: "Open in new window", icon: "external", disabled: !desktop || !workspace, run: () => { void detachTab(tab); } }, ...actions] : [];
|
||||
}
|
||||
async function detachTab(item: WorkbenchTab) {
|
||||
const tab = workingTabs.find(tab => tab.id === item.id);
|
||||
if (!tab || !workspace || !desktop) return;
|
||||
if ("plugin" in tab) {
|
||||
const action = pluginTabActions(tab.plugin).find(action => "label" in action && /(?:move|open).*new window/i.test(action.label));
|
||||
if (action && "run" in action && !action.disabled) { action.run?.(); return; }
|
||||
}
|
||||
const current = documents;
|
||||
const snapshot = JSON.stringify("buffer" in tab ? tab.buffer : pluginTabState(tab.plugin));
|
||||
const token = crypto.randomUUID(), key = `runestone.tab-transfer.${token}`;
|
||||
let timer: ReturnType<typeof setTimeout>;
|
||||
const finish = () => {
|
||||
window.removeEventListener("storage", accepted);
|
||||
clearTimeout(timer);
|
||||
localStorage.removeItem(key);
|
||||
localStorage.removeItem(key + ".accepted");
|
||||
};
|
||||
const accepted = (event: StorageEvent) => {
|
||||
if (event.key !== key + ".accepted" || event.newValue !== "true") return;
|
||||
if ("buffer" in tab) {
|
||||
if (documents === current && JSON.stringify(current?.buffers.find(buffer => buffer.id === tab.buffer.id)) === snapshot) current?.close(tab.relPath);
|
||||
} else if (JSON.stringify(pluginTabState(tab.plugin)) === snapshot) closePluginEditor(tab.plugin.key);
|
||||
finish();
|
||||
};
|
||||
try {
|
||||
localStorage.setItem(key, JSON.stringify({ root: workspace.root, created: Date.now(), ...("buffer" in tab ? { buffer: tab.buffer } : { plugin: pluginTabState(tab.plugin) }), reading }));
|
||||
window.addEventListener("storage", accepted);
|
||||
timer = setTimeout(() => { finish(); error = "The new window did not accept the tab. The source tab remains open."; }, 30000);
|
||||
await workspaceOpenWindow(workspace.root, token);
|
||||
} catch (reason) { finish(); error = String(reason); }
|
||||
}
|
||||
function pinWorkingTab(path: string) {
|
||||
const tab = workingTabs.find(tab => tab.relPath === path);
|
||||
@@ -372,6 +443,7 @@
|
||||
const items: ActionMenuItem[] = [];
|
||||
if (tab.kind === "text" && isMarkdownPath(tab.relPath)) {
|
||||
items.push(
|
||||
{ label: "Save as template", icon: "copy", run: () => { void saveTemplate({ name: tab.name, rel_path: tab.relPath, kind: "file" }); } },
|
||||
{ label: reading ? "Editing view" : "Reading view", icon: "book", run: () => editorPane?.toggleReadingView() },
|
||||
{ label: isIde ? "Writing mode" : "Source mode", icon: "code", run: toggleChrome },
|
||||
);
|
||||
@@ -544,8 +616,47 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function saveTemplate(entry: TreeEntry) {
|
||||
const name = await requestText("Template name", entry.name.replace(/\.md$/i, ""));
|
||||
if (!name) return;
|
||||
try {
|
||||
const contents = documents?.buffers.find(tab => tab.relPath === entry.rel_path)?.contents ?? await workspaceRead(entry.rel_path);
|
||||
await saveNoteTemplate(name, contents);
|
||||
status = `Saved template: ${name}`;
|
||||
} catch (reason) { error = String(reason); }
|
||||
}
|
||||
|
||||
async function newNote(event?: MouseEvent) {
|
||||
if (!workspace) return;
|
||||
const create = async (template?: NoteTemplate) => {
|
||||
try {
|
||||
const path = await createNote("", template);
|
||||
refreshToken++;
|
||||
await openCreatedFile({ name: path.split("/").pop()!, rel_path: path, kind: "file" });
|
||||
} catch (reason) { error = String(reason); }
|
||||
};
|
||||
const templates = await noteTemplates();
|
||||
if (!templates.length || !event) { await create(); return; }
|
||||
const anchor = event.currentTarget instanceof HTMLElement ? event.currentTarget : document.activeElement as HTMLElement;
|
||||
const close = () => { menu.remove(); window.removeEventListener("pointerdown", outside); anchor?.focus(); };
|
||||
const outside = (event: PointerEvent) => { if (!menu.contains(event.target as Node)) close(); };
|
||||
const menu = actionMenu(event.clientX, event.clientY, [
|
||||
{ label: "Blank note", icon: "file-plus", run: () => { close(); void create(); } },
|
||||
...templates.map(template => ({ label: template.name, icon: "file-plus" as const, run: () => { close(); void create(template); } })),
|
||||
], close, "New note");
|
||||
window.addEventListener("pointerdown", outside);
|
||||
}
|
||||
|
||||
function onPreferencesKeydown(event: KeyboardEvent) {
|
||||
if (event.target instanceof Element && event.target.closest("dialog, [role=dialog], [role=menu]")) return;
|
||||
if (event.ctrlKey && !event.altKey && !event.metaKey && event.key === "Tab" && workingTabs.length) {
|
||||
event.preventDefault(); event.stopPropagation();
|
||||
const index = workingTabs.findIndex(tab => tab.relPath === activeTabPath);
|
||||
const next = (index + (event.shiftKey ? -1 : 1) + workingTabs.length) % workingTabs.length;
|
||||
selectWorkingTab(workingTabs[next].relPath);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey && event.key === ",") {
|
||||
event.preventDefault(); event.stopPropagation(); void openSettings();
|
||||
}
|
||||
@@ -699,7 +810,7 @@
|
||||
const shell = event.currentTarget as HTMLElement;
|
||||
const rect = shell.getBoundingClientRect();
|
||||
if (dragging === "left") {
|
||||
leftWidth = Math.min(480, Math.max(160, event.clientX - rect.left - ($pluginNavigation.length ? 44 : 0)));
|
||||
leftWidth = Math.min(480, Math.max(160, event.clientX - rect.left - (ribbonNavigation.length ? 44 : 0)));
|
||||
}
|
||||
if (dragging === "right") {
|
||||
rightWidth = Math.min(480, Math.max(160, rect.right - event.clientX));
|
||||
@@ -715,6 +826,20 @@
|
||||
settings = { ...next };
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
try {
|
||||
const layout = parseWorkbenchLayout(localStorage.getItem(WORKBENCH_LAYOUT_KEY));
|
||||
({ leftOpen, rightOpen, leftWidth, rightWidth, leftView } = layout);
|
||||
layoutReady = true;
|
||||
} catch { error = "Could not read your layout. Default layout applies for this window."; }
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (!layoutReady) return;
|
||||
try { saveWorkbenchLayout(localStorage, { leftOpen, rightOpen, leftWidth, rightWidth, leftView }); }
|
||||
catch { error = "Could not save your layout. Layout changes apply for this window only."; }
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
try { settings = parseSettings(localStorage.getItem(SETTINGS_KEY)); }
|
||||
catch { error = "Could not read your settings. Default settings apply until you save new settings."; }
|
||||
@@ -741,6 +866,9 @@
|
||||
void restoreLast();
|
||||
let disposed = false;
|
||||
const unlisteners: (() => void)[] = [];
|
||||
unlisteners.push(handlePluginFileOpen(async path => {
|
||||
await openFile({ name: path.split("/").pop() ?? path, rel_path: path, kind: "file" });
|
||||
}));
|
||||
unlisteners.push(handlePluginDocumentRename(async (from, name) => {
|
||||
const current = documents;
|
||||
if (!current || switching) throw new Error("Open a workspace before renaming a document.");
|
||||
@@ -801,7 +929,7 @@
|
||||
|
||||
<div
|
||||
class="shell"
|
||||
class:has-ribbon={$pluginNavigation.length > 0}
|
||||
class:has-ribbon={ribbonNavigation.length > 0}
|
||||
class:left-open={leftOpen}
|
||||
class:right-open={rightOpen}
|
||||
role="application"
|
||||
@@ -818,34 +946,48 @@
|
||||
<IconButton
|
||||
icon="files"
|
||||
label="Files"
|
||||
active={leftOpen && leftView === "files"}
|
||||
active={leftOpen && !$pluginSidebar && leftView === "files"}
|
||||
onclick={() => selectLeft("files")}
|
||||
/>
|
||||
<IconButton
|
||||
icon="search"
|
||||
label="Search"
|
||||
active={leftOpen && leftView === "search"}
|
||||
active={leftOpen && !$pluginSidebar && leftView === "search"}
|
||||
onclick={() => selectLeft("search")}
|
||||
/>
|
||||
<IconButton
|
||||
icon="bookmark"
|
||||
label="Bookmarks"
|
||||
active={leftOpen && leftView === "bookmarks"}
|
||||
active={leftOpen && !$pluginSidebar && leftView === "bookmarks"}
|
||||
onclick={() => selectLeft("bookmarks")}
|
||||
/>
|
||||
{#each sidebarNavigation as item (`${item.owner}:${item.id}`)}
|
||||
<IconButton
|
||||
icon={item.icon === "list" || item.icon === "kanban" || item.icon === "globe" || item.icon === "git" ? item.icon : "puzzle"}
|
||||
label={item.title}
|
||||
active={leftOpen && $pluginSidebar?.owner === item.owner && $pluginSidebar?.id === item.id}
|
||||
onclick={() => openPluginView(item.owner, item.id)}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="header-center" data-tauri-drag-region>
|
||||
<TabBar tabs={workingTabs} activePath={activeTabPath} onSelect={selectWorkingTab} onClose={closeTab}
|
||||
onCloseTabs={(path, scope) => 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)} />
|
||||
<IconButton icon="plus" label="New tab (Ctrl T)" onclick={newTab} />
|
||||
<PluginAccessMenu surface="open" />
|
||||
<PluginAccessMenu surface="open" compact />
|
||||
{#if desktop}<div class="window-drag-space" data-tauri-drag-region></div>{/if}
|
||||
</div>
|
||||
<div class="header-right" data-tauri-drag-region>
|
||||
{#each $pluginNavigation.filter(item => item.toolbar) as item (item.owner + ":" + item.id)}
|
||||
<IconButton icon={item.icon ?? "puzzle"} label={item.title}
|
||||
active={$pluginView?.owner === item.owner && $pluginView?.id === item.id && $pluginEditorActive}
|
||||
onclick={() => openPluginView(item.owner, item.id)} />
|
||||
{/each}
|
||||
<PluginTools />
|
||||
<PluginAccessMenu surface="commands" />
|
||||
<PluginAccessMenu surface="commands" compact />
|
||||
<IconButton icon="save" label="Save" disabled={editorPluginVisible || !dirty || saving} onclick={() => void save()} />
|
||||
{#if terminalEnabled}<IconButton icon="terminal" label="Terminal" active={terminalOpen} onclick={toggleTerminal} />{/if}
|
||||
<IconButton
|
||||
@@ -858,13 +1000,13 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<nav class="plugin-ribbon" aria-label="Plugin shortcuts" hidden={$pluginNavigation.length === 0}>
|
||||
{#each $pluginNavigation as item (`${item.owner}:${item.id}`)}
|
||||
<nav class="plugin-ribbon" aria-label="Plugin shortcuts" hidden={ribbonNavigation.length === 0}>
|
||||
{#each ribbonNavigation as item (`${item.owner}:${item.id}`)}
|
||||
<IconButton
|
||||
icon={item.icon === "list" || item.icon === "kanban" || item.icon === "globe" ? item.icon : "puzzle"}
|
||||
icon={item.icon === "list" || item.icon === "kanban" || item.icon === "globe" || item.icon === "git" ? item.icon : "puzzle"}
|
||||
label={item.title}
|
||||
side="right"
|
||||
active={$pluginView?.owner === item.owner && $pluginView?.id === item.id && !$pluginView?.document && ($pluginView?.placement === "dialog" || $pluginEditorActive)}
|
||||
active={($pluginSidebar?.owner === item.owner && $pluginSidebar?.id === item.id) || $pluginView?.owner === item.owner && $pluginView?.id === item.id && !$pluginView?.document && ($pluginView?.placement === "dialog" || $pluginEditorActive)}
|
||||
onclick={() => openPluginView(item.owner, item.id)}
|
||||
/>
|
||||
{/each}
|
||||
@@ -873,6 +1015,10 @@
|
||||
{#if leftOpen}
|
||||
<aside class="left">
|
||||
<div class="left-body">
|
||||
{#if $pluginSidebar}
|
||||
{#key $pluginSidebar.key}<PluginEditor view={$pluginSidebar} />{/key}
|
||||
{/if}
|
||||
<div class="native-left" class:sidebar-covered={!!$pluginSidebar}>
|
||||
{#if !workspace}
|
||||
{#if leftView === "bookmarks"}<BrowserSlot kind="bookmarks" />{:else}<p class="placeholder">No folder is open.</p>{/if}
|
||||
{:else}
|
||||
@@ -880,10 +1026,12 @@
|
||||
<div class="left-layer" class:shown={leftView === "files"}>
|
||||
<FileTree
|
||||
workspaceRoot={workspace.root}
|
||||
showInternal={settings.showInternalFolder}
|
||||
onSaveTemplate={(entry) => { void saveTemplate(entry); }}
|
||||
activePath={editorPluginVisible ? $pluginView?.document?.path ?? null : activePath}
|
||||
onOpenFile={(entry, newTab) => void openFile(entry, undefined, newTab ? "new" : "current")}
|
||||
{refreshToken}
|
||||
keysActive={leftView === "files"}
|
||||
keysActive={leftOpen && !$pluginSidebar && leftView === "files"}
|
||||
onCreated={(entry) => {
|
||||
void openCreatedFile(entry);
|
||||
}}
|
||||
@@ -902,6 +1050,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="left-footer">
|
||||
<div class="footer-start" bind:this={workspaceAnchor}>
|
||||
@@ -961,6 +1110,7 @@
|
||||
hasWorkspace={!!workspace}
|
||||
onOpenWorkspace={() => void chooseWorkspace()}
|
||||
onNewFile={() => void newFile()}
|
||||
onNewNote={(event) => { void newNote(event); }}
|
||||
onQuickOpen={() => quickOpen = true}
|
||||
onOpenBrowser={browserContribution?.newTab ? () => void openBrowser() : undefined}
|
||||
{browserOpening}
|
||||
@@ -1043,7 +1193,7 @@
|
||||
display: grid;
|
||||
--ribbon-width: 0px;
|
||||
grid-template-columns: var(--ribbon-width) minmax(0, 1fr);
|
||||
grid-template-rows: 36px minmax(0, 1fr) 22px;
|
||||
grid-template-rows: var(--rs-titlebar-height) minmax(0, 1fr) 22px;
|
||||
background: var(--rs-bg);
|
||||
}
|
||||
|
||||
@@ -1086,22 +1236,10 @@
|
||||
gap: 0;
|
||||
padding: 0;
|
||||
background: var(--rs-bg-elevated);
|
||||
border-bottom: 1px solid var(--rs-border);
|
||||
box-shadow: inset 0 -1px var(--rs-border);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.shell.left-open .header {
|
||||
grid-template-columns: calc(var(--left) + var(--ribbon-width)) minmax(0, 1fr) auto;
|
||||
}
|
||||
|
||||
.shell.right-open .header {
|
||||
grid-template-columns: auto minmax(0, 1fr) minmax(max-content, var(--right));
|
||||
}
|
||||
|
||||
.shell.left-open.right-open .header {
|
||||
grid-template-columns: calc(var(--left) + var(--ribbon-width)) minmax(0, 1fr) minmax(max-content, var(--right));
|
||||
}
|
||||
|
||||
.header-left,
|
||||
.header-right {
|
||||
display: flex;
|
||||
@@ -1109,6 +1247,7 @@
|
||||
justify-content: center;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.header-center {
|
||||
@@ -1117,12 +1256,14 @@
|
||||
justify-content: flex-start;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
padding: 0 8px;
|
||||
padding: 0;
|
||||
border-left: 1px solid var(--rs-border);
|
||||
border-right: 1px solid var(--rs-border);
|
||||
}
|
||||
|
||||
.header-left, .header-center, .header-right { height: 100%; }
|
||||
.shell.left-open .header-left { width: calc(var(--ribbon-width) + var(--left) + 1px); padding-left: calc(var(--ribbon-width) + 4px); }
|
||||
.header-left :global(.icon-btn), .header-right :global(.icon-btn) { flex-shrink: 0; }
|
||||
.header-right { justify-content: flex-end; }
|
||||
.window-drag-space { flex: 0 0 40px; align-self: stretch; }
|
||||
|
||||
@@ -1134,15 +1275,16 @@
|
||||
background: transparent;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.header-center :global(.tabs:empty) { min-width: 80px; }
|
||||
|
||||
.header-center :global(.tab) {
|
||||
flex: 0 1 180px;
|
||||
width: 180px;
|
||||
min-width: 96px;
|
||||
max-width: 180px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.header-center :global(.tab.active) {
|
||||
background: var(--rs-item-selection-bg);
|
||||
background: var(--rs-bg);
|
||||
}
|
||||
|
||||
.ws {
|
||||
@@ -1215,6 +1357,9 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.native-left { display: flex; flex-direction: column; min-height: 0; }
|
||||
.native-left.sidebar-covered { display: none; }
|
||||
|
||||
.left-stack {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
Reference in New Issue
Block a user