Update editor, themes, menus, backgrounds, and release tooling

This commit is contained in:
Knotty Wyvern
2026-10-14 16:19:51 -07:00
parent f6eaa52949
commit edef2520af
113 changed files with 5722 additions and 386 deletions
+14 -1
View File
@@ -9,23 +9,34 @@
import { readerHeadingFolding } from "$lib/editor/headingFolding";
import "$lib/editor/headingFolding.css";
import { readingMenu } from "$lib/editor/readingMenu";
import type { DocumentLinkActions } from "$lib/editor/linkMenu";
type Props = {
noteRel: string;
contents: string;
linkActions?: DocumentLinkActions;
onSearch?: (text: string) => void;
onOpenLink?: (kind: "md" | "wiki", target: string) => void;
onEditBlock?: (start: number, end: number) => void;
editing?: { start: number; end: number } | null;
blockEditor?: Snippet;
};
let { noteRel, contents, onOpenLink, onEditBlock, editing = null, blockEditor }: Props = $props();
let { noteRel, contents, onOpenLink, linkActions = {}, onSearch, onEditBlock, editing = null, blockEditor }: Props = $props();
let html = $state("");
let menuError = $state("");
let sections = $state<MarkdownSection[]>([]);
let root: HTMLDivElement | undefined = $state();
const collapsedHeadings = new Set<string>();
let foldingNote = "";
let headingControls: ReturnType<typeof readerHeadingFolding> | undefined;
$effect(() => {
if (!root) return;
return readingMenu(root, { ...linkActions, open: link => onOpenLink?.(link.kind, link.target) }, onSearch, message => { menuError = message; });
});
async function loadUrls(noteRel: string, contents: string): Promise<Map<string, string>> {
const urls = new Map<string, string>();
await Promise.all(markdownImages(contents).map(async source => {
@@ -117,6 +128,7 @@
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->
<div
class="reading"
tabindex="-1"
bind:this={root}
onkeydown={(event) => {
if (event.target instanceof HTMLElement && event.target.classList.contains("md-edit-block") && (event.key === "Enter" || event.key === " ")) {
@@ -165,6 +177,7 @@
}
}}
>
{#if menuError}<p role="alert">{menuError}</p>{/if}
<h1 class="document-title">{markdownTitle(noteRel)}</h1>
{#if onEditBlock}
{#each sections.filter(section => !editing || section.start < editing.start) as section (section.start)}