extracted selection logic to own feature and anhanched with range selection

This commit is contained in:
Chris Kruining 2024-10-16 13:37:26 +02:00
parent 40f46eba1d
commit 1a963a665e
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
15 changed files with 295 additions and 254 deletions

View file

@ -1,5 +1,5 @@
import { Title } from "@solidjs/meta";
import { Show } from "solid-js";
import { ParentProps, Show } from "solid-js";
import { BsTranslate } from "solid-icons/bs";
import { FilesProvider } from "~/features/file";
import { MenuProvider, asMenuRoot } from "~/features/menu";
@ -8,7 +8,7 @@ import { A } from "@solidjs/router";
asMenuRoot // prevents removal of import
export default function Editor(props) {
export default function Editor(props: ParentProps) {
const supported = isServer || typeof window.showDirectoryPicker === 'function';
return <MenuProvider>
@ -18,12 +18,10 @@ export default function Editor(props) {
<A class="logo" href="/"><BsTranslate /></A>
</nav>
<main style="padding: 1em; block-size: 100%; overflow: clip;">
<Show when={supported} fallback={<span>too bad, so sad. Your browser does not support the File Access API</span>}>
<FilesProvider>
{props.children}
</FilesProvider>
</Show>
</main>
<Show when={supported} fallback={<span>too bad, so sad. Your browser does not support the File Access API</span>}>
<FilesProvider>
{props.children}
</FilesProvider>
</Show>
</MenuProvider>
}