feat(ui): add content editor components for skills and thoughts
Some checks failed
CI / build-and-test (push) Failing after -31m24s
Some checks failed
CI / build-and-test (push) Failing after -31m24s
* Implement ContentEditorField for inline editing of content * Create ContentEditorModal for editing content in a modal * Introduce FormerShell for managing forms related to skills and thoughts * Enhance SkillsPage and ThoughtsPage with new components for better content management
This commit is contained in:
38
ui/src/components/shared/FormerShell.svelte
Normal file
38
ui/src/components/shared/FormerShell.svelte
Normal file
@@ -0,0 +1,38 @@
|
||||
<script lang="ts">
|
||||
import { FormerDrawer } from '@warkypublic/svelix';
|
||||
import type { FormerProps, FormRequestType } from '@warkypublic/svelix';
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
interface Props extends FormerProps<any> {
|
||||
title?: string;
|
||||
width?: string;
|
||||
children?: Snippet<[any]>;
|
||||
}
|
||||
|
||||
let {
|
||||
title = 'Form',
|
||||
opened = $bindable(false),
|
||||
values = $bindable<any>(undefined),
|
||||
request = $bindable<FormRequestType>('insert'),
|
||||
layout = { buttonArea: 'bottom' },
|
||||
width = '36rem',
|
||||
children: formContent,
|
||||
...rest
|
||||
}: Props = $props();
|
||||
</script>
|
||||
|
||||
<FormerDrawer
|
||||
bind:opened
|
||||
bind:values
|
||||
bind:request
|
||||
{title}
|
||||
{layout}
|
||||
{width}
|
||||
{...rest}
|
||||
>
|
||||
{#snippet children(state)}
|
||||
<div class="space-y-4 p-6">
|
||||
{@render formContent?.(state)}
|
||||
</div>
|
||||
{/snippet}
|
||||
</FormerDrawer>
|
||||
Reference in New Issue
Block a user