Release RuneStone 0.1.4 with installable plugins and settings
This commit is contained in:
@@ -33,7 +33,14 @@
|
||||
let { buffer, tabs, chrome, reading, focusLine, onChange, onRenameTitle, onInsertImage, onToggleReading, onToggleChrome, onOpenLink, onOpenWorkspace, onNewFile, onQuickOpen, hasWorkspace, tableActions }: Props = $props();
|
||||
let previewMode = $state<"split" | "preview">("split");
|
||||
let modeControls = $state<HTMLDivElement>();
|
||||
let titleFocusId = $state<string | null>(null);
|
||||
const shouldFocusOnMount = () => !modeControls?.contains(document.activeElement);
|
||||
export function focusTitle(id: string) {
|
||||
titleFocusId = id;
|
||||
}
|
||||
$effect(() => {
|
||||
if (titleFocusId !== buffer?.id) titleFocusId = null;
|
||||
});
|
||||
const previewScroll = new Map<string, { top: number; left: number }>();
|
||||
$effect(() => {
|
||||
const ids = tabs.map(tab => tab.id);
|
||||
@@ -131,7 +138,8 @@
|
||||
<div class="editor-wrap" class:hidden={reading && canPreview && previewMode === "preview"}>
|
||||
{#key buffer.id}
|
||||
{#if !isIde && canPreview && !reading}
|
||||
<LiveWriter {buffer} {onChange} {onRenameTitle} {onInsertImage} {onOpenLink} {focusLine} {tableActions} {shouldFocusOnMount} />
|
||||
<LiveWriter {buffer} {onChange} {onRenameTitle} {onInsertImage} {onOpenLink} {focusLine} {tableActions} {shouldFocusOnMount}
|
||||
focusTitle={titleFocusId === buffer.id} onTitleFocused={() => { titleFocusId = null; }} />
|
||||
{:else}
|
||||
<EditorHost {buffer} {chrome} {onChange} {onInsertImage} {focusLine} {tableActions} {shouldFocusOnMount} />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user