Editor/UI: expanded bottom bar, kanban rich editor, ConvertDialog ordlyd
- Editor compact mode: send/minimer-knapper flyttes til bunnrad når utvidet - KanbanBlock: bruker Editor-komponent for beskrivelse i stedet for textarea - ConvertDialog: «Opprett» i stedet for «Konverter» (meldingen beholdes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
58646b1543
commit
531defe986
3 changed files with 55 additions and 43 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
import type { KanbanConnection, KanbanColumn } from '$lib/kanban/types';
|
import type { KanbanConnection, KanbanColumn } from '$lib/kanban/types';
|
||||||
import type { MessageData } from '$lib/types/message';
|
import type { MessageData } from '$lib/types/message';
|
||||||
import MessageBox from '$lib/components/MessageBox.svelte';
|
import MessageBox from '$lib/components/MessageBox.svelte';
|
||||||
|
import Editor from '$lib/components/Editor.svelte';
|
||||||
|
|
||||||
let { props = {} }: { props?: Record<string, unknown> } = $props();
|
let { props = {} }: { props?: Record<string, unknown> } = $props();
|
||||||
|
|
||||||
|
|
@ -225,12 +226,13 @@
|
||||||
bind:value={editTitle}
|
bind:value={editTitle}
|
||||||
placeholder="Tittel"
|
placeholder="Tittel"
|
||||||
/>
|
/>
|
||||||
<textarea
|
<div class="edit-desc-editor">
|
||||||
class="edit-desc"
|
<Editor
|
||||||
bind:value={editDescription}
|
mode="extended"
|
||||||
|
bind:content={editDescription}
|
||||||
placeholder="Beskrivelse (valgfritt)"
|
placeholder="Beskrivelse (valgfritt)"
|
||||||
rows="3"
|
/>
|
||||||
></textarea>
|
</div>
|
||||||
<div class="modal-actions">
|
<div class="modal-actions">
|
||||||
<button type="button" onclick={saveEdit}>Lagre</button>
|
<button type="button" onclick={saveEdit}>Lagre</button>
|
||||||
<button type="button" class="delete" onclick={handleDeleteCard}>Slett</button>
|
<button type="button" class="delete" onclick={handleDeleteCard}>Slett</button>
|
||||||
|
|
@ -457,7 +459,7 @@
|
||||||
border: 1px solid #2d3148;
|
border: 1px solid #2d3148;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
width: 340px;
|
width: 420px;
|
||||||
max-width: 90vw;
|
max-width: 90vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -480,24 +482,13 @@
|
||||||
border-color: #3b82f6;
|
border-color: #3b82f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-desc {
|
.edit-desc-editor {
|
||||||
background: #0f1117;
|
|
||||||
border: 1px solid #2d3148;
|
border: 1px solid #2d3148;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: #e1e4e8;
|
overflow: hidden;
|
||||||
padding: 0.5rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-family: inherit;
|
|
||||||
resize: vertical;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-desc:focus {
|
.edit-title::placeholder {
|
||||||
outline: none;
|
|
||||||
border-color: #3b82f6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-desc::placeholder, .edit-title::placeholder {
|
|
||||||
color: #8b92a5;
|
color: #8b92a5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||||
<div class="convert-dialog" onclick={(e) => e.stopPropagation()}>
|
<div class="convert-dialog" onclick={(e) => e.stopPropagation()}>
|
||||||
<h3>{type === 'kanban' ? 'Konverter til kanban-kort' : 'Konverter til kalenderhendelse'}</h3>
|
<h3>{type === 'kanban' ? 'Opprett kanban-kort' : 'Opprett kalenderhendelse'}</h3>
|
||||||
|
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<p class="convert-dialog__loading">Laster...</p>
|
<p class="convert-dialog__loading">Laster...</p>
|
||||||
|
|
@ -147,7 +147,7 @@
|
||||||
<button class="convert-dialog__btn convert-dialog__btn--cancel" onclick={onCancel}>Avbryt</button>
|
<button class="convert-dialog__btn convert-dialog__btn--cancel" onclick={onCancel}>Avbryt</button>
|
||||||
<button class="convert-dialog__btn convert-dialog__btn--confirm" onclick={handleSubmit}
|
<button class="convert-dialog__btn convert-dialog__btn--confirm" onclick={handleSubmit}
|
||||||
disabled={loading || (type === 'kanban' ? !selectedColumnId : !selectedCalendarId || !startsAt)}
|
disabled={loading || (type === 'kanban' ? !selectedColumnId : !selectedCalendarId || !startsAt)}
|
||||||
>Konverter</button>
|
>Opprett</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -307,27 +307,15 @@
|
||||||
<div bind:this={editorEl} class="editor-mount"></div>
|
<div bind:this={editorEl} class="editor-mount"></div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if mode === 'compact'}
|
{#if mode === 'compact' && !expanded}
|
||||||
<button type="button" class="expand-btn" onclick={toggleExpand} title={expanded ? 'Minimer' : 'Utvid editor'}>
|
<button type="button" class="expand-btn" onclick={toggleExpand} title="Utvid editor">
|
||||||
{#if expanded}
|
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
||||||
<polyline points="4 14 10 14 10 20"></polyline>
|
|
||||||
<polyline points="20 10 14 10 14 4"></polyline>
|
|
||||||
<line x1="14" y1="10" x2="21" y2="3"></line>
|
|
||||||
<line x1="3" y1="21" x2="10" y2="14"></line>
|
|
||||||
</svg>
|
|
||||||
{:else}
|
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
<polyline points="15 3 21 3 21 9"></polyline>
|
<polyline points="15 3 21 3 21 9"></polyline>
|
||||||
<polyline points="9 21 3 21 3 15"></polyline>
|
<polyline points="9 21 3 21 3 15"></polyline>
|
||||||
<line x1="21" y1="3" x2="14" y2="10"></line>
|
<line x1="21" y1="3" x2="14" y2="10"></line>
|
||||||
<line x1="3" y1="21" x2="10" y2="14"></line>
|
<line x1="3" y1="21" x2="10" y2="14"></line>
|
||||||
</svg>
|
</svg>
|
||||||
{/if}
|
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if mode === 'compact'}
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="send-btn"
|
class="send-btn"
|
||||||
|
|
@ -342,6 +330,30 @@
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if mode === 'compact' && expanded}
|
||||||
|
<div class="editor-bottom-bar">
|
||||||
|
<button type="button" class="expand-btn" onclick={toggleExpand} title="Minimer">
|
||||||
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<polyline points="4 14 10 14 10 20"></polyline>
|
||||||
|
<polyline points="20 10 14 10 14 4"></polyline>
|
||||||
|
<line x1="14" y1="10" x2="21" y2="3"></line>
|
||||||
|
<line x1="3" y1="21" x2="10" y2="14"></line>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="send-btn"
|
||||||
|
onclick={handleSubmit}
|
||||||
|
disabled={!hasContent}
|
||||||
|
aria-label="Send"
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||||
|
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<!-- Mention suggestions popup -->
|
<!-- Mention suggestions popup -->
|
||||||
{#if suggestions.length > 0 && mentionPopupPos}
|
{#if suggestions.length > 0 && mentionPopupPos}
|
||||||
<div
|
<div
|
||||||
|
|
@ -616,6 +628,15 @@
|
||||||
margin: 0 0.15rem;
|
margin: 0 0.15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bottom bar (expanded compact mode) */
|
||||||
|
.editor-bottom-bar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
padding: 0.3rem 0.4rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Send button (compact mode) */
|
/* Send button (compact mode) */
|
||||||
.send-btn {
|
.send-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue