diff --git a/docs/development.md b/docs/development.md index bdbe3c8..7310c3d 100644 --- a/docs/development.md +++ b/docs/development.md @@ -80,7 +80,7 @@ A new command needs an entry in `generate_handler!` in `lib.rs`, in the command | Folder | Responsibility | | --- | --- | -| `layout/` | The app shell (`Workbench.svelte`), the file tree, tabs, panes, Settings, and dialogs | +| `layout/` | The app shell: `Workbench.svelte` holds the state and the commands, and `WorkbenchHeader`, `PluginRibbon`, `LeftPane`, `DocumentArea`, `RightPane`, and `StatusBar` draw its regions. Also the file tree, tabs, panes, Settings, and dialogs | | `editor/` | The document editor (`DocumentEditor.svelte`) with its Write and Source configurations, Markdown lists, tables, links, images, and editor menus | | `formulas/` | Table formulas: the parser and evaluator (`engine.ts`), the rendered results, the formula help, and the `tableFormulas` setting (`index.ts`) | | `workspace/` | Tauri wrappers, document buffers, the workspace session (`session.svelte.ts`: marks, renames, change events, and the note index), paths, templates, and tab transfer (`tabTransfer.ts`) | diff --git a/src/lib/layout/DocumentArea.svelte b/src/lib/layout/DocumentArea.svelte new file mode 100644 index 0000000..490d5c4 --- /dev/null +++ b/src/lib/layout/DocumentArea.svelte @@ -0,0 +1,161 @@ + + +
+
+ {#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 split && bounds} + tab.id === pane.key)} /> + {/if} + +
+ {/each} +
+
+
1}> + {#each documentViews as pane (pane.id)} + +
onFocusPane(pane.id)} + onfocusin={() => onFocusPane(pane.id)}> + {#if pane.buffer?.diskError} + + {:else if pane.buffer?.diskContents != null} + +
{$t("View disk version")}
{pane.buffer.diskContents}
+ {/if} + 1 ? () => onCloseSplit(pane.id) : undefined} + {hasWorkspace} + {onOpenWorkspace} + {onNewFile} + {onNewNote} + {onQuickOpen} + {onOpenBrowser} + {browserOpening} + buffer={pane.buffer} + chrome={pane.buffer?.chromeOverride ?? pane.buffer?.chrome ?? "Writing"} + reading={pane.reading} + focusLine={activePane === pane.id ? focusLine : null} + {onChange} + onInsertImage={file => onInsertImage(file, pane.buffer)} + {onRenameTitle} + tableActions={tableActions(pane)} + linkActions={linkActions(pane)} + onToggleReading={() => onToggleReading(pane)} + onToggleChrome={() => onToggleChrome(pane)} + onOpenLink={(kind, target) => onOpenLink(pane, kind, target)} + /> +
+ {/each} +
+
+
+ + diff --git a/src/lib/layout/LeftPane.svelte b/src/lib/layout/LeftPane.svelte new file mode 100644 index 0000000..2f693e0 --- /dev/null +++ b/src/lib/layout/LeftPane.svelte @@ -0,0 +1,171 @@ + + + + + diff --git a/src/lib/layout/PluginRibbon.svelte b/src/lib/layout/PluginRibbon.svelte new file mode 100644 index 0000000..fb4bec8 --- /dev/null +++ b/src/lib/layout/PluginRibbon.svelte @@ -0,0 +1,39 @@ + + + + + diff --git a/src/lib/layout/RightPane.svelte b/src/lib/layout/RightPane.svelte new file mode 100644 index 0000000..a935f6a --- /dev/null +++ b/src/lib/layout/RightPane.svelte @@ -0,0 +1,33 @@ + + + + + diff --git a/src/lib/layout/StatusBar.svelte b/src/lib/layout/StatusBar.svelte new file mode 100644 index 0000000..b0e5b10 --- /dev/null +++ b/src/lib/layout/StatusBar.svelte @@ -0,0 +1,35 @@ + + + + + diff --git a/src/lib/layout/Workbench.svelte b/src/lib/layout/Workbench.svelte index 1f32059..bc708f9 100644 --- a/src/lib/layout/Workbench.svelte +++ b/src/lib/layout/Workbench.svelte @@ -1,9 +1,7 @@ + +
+
+ {#if !detached} + onSelectLeft("files")} /> + onSelectLeft("search")} /> + onSelectLeft("bookmarks")} /> + {#each sidebarNavigation as item (`${item.owner}:${item.id}`)} + openPluginView(item.owner, item.id)} + /> + {/each} + {/if} +
+
+ + + {#if desktop}
{/if} +
+
+ {#if canOpenBrowser}{/if} + + + + + {#if terminalEnabled}{/if} + {#if !detached}{/if} + {#if desktop}{/if} +
+
+ +