minor refactors
This commit is contained in:
parent
5af8fee981
commit
6e41abdf46
2 changed files with 7 additions and 7 deletions
|
@ -8,10 +8,8 @@
|
||||||
--surface-5: light-dark(#fff, #444);
|
--surface-5: light-dark(#fff, #444);
|
||||||
--text-1: light-dark(#222, #eee);
|
--text-1: light-dark(#222, #eee);
|
||||||
--text-2: light-dark(#282828, #d8d8d8);
|
--text-2: light-dark(#282828, #d8d8d8);
|
||||||
--primary: light-dark(#41c6b3, #6be8d6);
|
|
||||||
|
|
||||||
color: var(--text-1);
|
--primary: light-dark(oklch(.7503 0.117 181.6), oklch(.8549 0.1149 182.77));
|
||||||
accent-color: var(--primary);
|
|
||||||
|
|
||||||
--info: light-dark(oklch(.71 .17 249), oklch(.71 .17 249));
|
--info: light-dark(oklch(.71 .17 249), oklch(.71 .17 249));
|
||||||
--fail: light-dark(oklch(.64 .21 25.3), oklch(.64 .21 25.3));
|
--fail: light-dark(oklch(.64 .21 25.3), oklch(.64 .21 25.3));
|
||||||
|
@ -50,6 +48,7 @@ body {
|
||||||
|
|
||||||
background-color: var(--surface-1);
|
background-color: var(--surface-1);
|
||||||
color: var(--text-2);
|
color: var(--text-2);
|
||||||
|
accent-color: var(--primary);
|
||||||
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
||||||
const [active, setActive] = createSignal<string>();
|
const [active, setActive] = createSignal<string>();
|
||||||
const [contents, setContents] = createSignal<Map<string, Map<string, string>>>(new Map());
|
const [contents, setContents] = createSignal<Map<string, Map<string, string>>>(new Map());
|
||||||
const [tree, setFiles] = createSignal<FolderEntry>(emptyFolder);
|
const [tree, setFiles] = createSignal<FolderEntry>(emptyFolder);
|
||||||
|
const [prompt, setPrompt] = createSignal<PromptApi>();
|
||||||
|
|
||||||
const tab = createMemo(() => {
|
const tab = createMemo(() => {
|
||||||
const name = active();
|
const name = active();
|
||||||
|
@ -180,8 +181,6 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
|
|
||||||
const [prompt, setPrompt] = createSignal<PromptApi>();
|
|
||||||
|
|
||||||
const commands = {
|
const commands = {
|
||||||
open: createCommand('open folder', async () => {
|
open: createCommand('open folder', async () => {
|
||||||
const directory = await window.showDirectoryPicker({ mode: 'readwrite' });
|
const directory = await window.showDirectoryPicker({ mode: 'readwrite' });
|
||||||
|
@ -298,8 +297,6 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
||||||
}}>{file().name}</Context.Handle>;
|
}}>{file().name}</Context.Handle>;
|
||||||
},
|
},
|
||||||
] as const}</Tree>
|
] as const}</Tree>
|
||||||
|
|
||||||
<span>Total mutation: {mutations().length}</span>
|
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
|
|
||||||
<Tabs active={setActive} onClose={commands.closeTab}>
|
<Tabs active={setActive} onClose={commands.closeTab}>
|
||||||
|
@ -322,6 +319,10 @@ const Content: Component<{ directory: FileSystemDirectoryHandle, api?: Setter<Gr
|
||||||
const [rows, setRows] = createSignal<Map<string, Record<string, string>>>(new Map);
|
const [rows, setRows] = createSignal<Map<string, Record<string, string>>>(new Map);
|
||||||
const [api, setApi] = createSignal<GridApi>();
|
const [api, setApi] = createSignal<GridApi>();
|
||||||
|
|
||||||
|
if (!isServer && !('showDirectoryPicker' in window)) {
|
||||||
|
throw new Error('Unable to manage files');
|
||||||
|
}
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
props.entries?.(entries());
|
props.entries?.(entries());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue