Vorlesen: - „Seite vorlesen“ in der Kopfzeile auf jeder Seite, dazu im Artikel - satzweise mit Markierung des gelesenen Satzes (CSS Highlight API), mitscrollend; Steuerleiste mit Pause, Satz zurück/vor, langsam, Stopp - Satzgrenzen folgen der Darstellung; Bedienelemente werden übersprungen Barrierefreiheit (axe-core, WCAG 2.2 AA – jetzt ohne Befund): - Kontraste von Hilfstext und Status-Schrift angehoben, keine Transparenz mehr bei erledigten Einträgen - Fehlerseiten mit Titel und Hauptbereich (App, Redaktion, allgemein) - Überschriften-Hierarchie in der Meldungsliste - Text-Editor mit zugänglichem Namen, eindeutige Seitenleisten, beschriftete Symbol-Buttons, ausreichend große Tippflächen - Redaktion: Sprunglink zum Inhalt, Schriftgröße/Farbschema unter „Mein Konto“; Redaktionskalender in voller Breite Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
74 lines
2.9 KiB
Svelte
74 lines
2.9 KiB
Svelte
<script lang="ts">
|
|
import Plus from '@lucide/svelte/icons/plus';
|
|
import EntryChip from './EntryChip.svelte';
|
|
import { callAction } from '../actions';
|
|
import { EDITORIAL_STATUS, STATUS_TONE, statusKeys, type CalendarEntry, type EditorialStatus, type TeamMember } from '$lib/editorial';
|
|
import { formatShort } from '$lib/dates';
|
|
|
|
let {
|
|
plans,
|
|
team,
|
|
today,
|
|
onopen,
|
|
oncreate
|
|
}: {
|
|
plans: CalendarEntry[];
|
|
team: TeamMember[];
|
|
today: string;
|
|
onopen: (e: CalendarEntry) => void;
|
|
oncreate: (date: string, status?: EditorialStatus) => void;
|
|
} = $props();
|
|
|
|
const columns = $derived(
|
|
statusKeys.map((s) => ({ status: s, items: plans.filter((p) => p.type === 'plan' && p.status === s) }))
|
|
);
|
|
|
|
let dropTarget = $state<string | null>(null);
|
|
|
|
async function drop(e: DragEvent, status: EditorialStatus) {
|
|
e.preventDefault();
|
|
dropTarget = null;
|
|
const raw = e.dataTransfer?.getData('application/x-redaktion');
|
|
if (!raw) return;
|
|
const { type, id } = JSON.parse(raw);
|
|
if (type !== 'plan') return;
|
|
await callAction('status', { id, status }, `Status: ${EDITORIAL_STATUS[status]}`);
|
|
}
|
|
</script>
|
|
|
|
<div class="flex gap-4 overflow-x-auto pb-4 -mx-4 px-4 sm:mx-0 sm:px-0 snap-x 2xl:grid 2xl:grid-cols-5 2xl:overflow-visible">
|
|
{#each columns as col (col.status)}
|
|
<section
|
|
aria-labelledby="col-{col.status}"
|
|
class="tone-{STATUS_TONE[col.status]} snap-start shrink-0 w-72 2xl:w-auto rounded-2xl bg-surface-2 p-3 transition-colors {dropTarget === col.status ? 'outline-2 outline-dashed outline-tone bg-tone-soft' : ''}"
|
|
ondragover={(e) => {
|
|
if (!e.dataTransfer?.types.includes('application/x-redaktion')) return;
|
|
e.preventDefault();
|
|
dropTarget = col.status;
|
|
}}
|
|
ondragleave={() => dropTarget === col.status && (dropTarget = null)}
|
|
ondrop={(e) => drop(e, col.status)}
|
|
>
|
|
<header class="flex items-center gap-2 px-1 mb-3">
|
|
<span class="size-2.5 rounded-full bg-tone" aria-hidden="true"></span>
|
|
<h2 id="col-{col.status}" class="font-bold text-sm flex-1">{EDITORIAL_STATUS[col.status]}</h2>
|
|
<span class="text-xs font-bold text-ink-3" aria-label="{col.items.length} Einträge">{col.items.length}</span>
|
|
<button type="button" class="grid place-items-center size-7 rounded-full text-ink-3 hover:bg-surface hover:text-ink" aria-label="Neuer Eintrag mit Status {EDITORIAL_STATUS[col.status]}" onclick={() => oncreate('', col.status)}>
|
|
<Plus class="size-4" />
|
|
</button>
|
|
</header>
|
|
<ul class="space-y-2 min-h-16">
|
|
{#each col.items as entry (entry.id)}
|
|
<li>
|
|
<EntryChip {entry} {team} {today} {onopen} />
|
|
{#if entry.type === 'plan' && entry.date}
|
|
<span class="sr-only">geplant für {formatShort(entry.date)}</span>
|
|
{/if}
|
|
</li>
|
|
{:else}
|
|
<li class="text-xs text-ink-3 px-1 py-4 text-center border-2 border-dashed border-line rounded-xl">Hierher ziehen</li>
|
|
{/each}
|
|
</ul>
|
|
</section>
|
|
{/each}
|
|
</div>
|