Replaces bg-white, text-brand-navy, border-brand-sand, text-gray-*, bg-[#2A2A2A], bg-brand-purple/15, hover:bg-brand-sand, etc. across all 35 .svelte files with semantic token utilities (bg-surface, text-ink, border-line, bg-pdf-bg, bg-nav-active, bg-muted, text-accent, bg-primary, ...). Also adds CSS filter: invert(1) in layout.css for De Gruyter <img> icons in dark mode, excluding icons that carry .invert already (to prevent double-inversion). Closes #64 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
1.8 KiB
Svelte
66 lines
1.8 KiB
Svelte
<script lang="ts">
|
|
import { m } from '$lib/paraglide/messages.js';
|
|
import CommentThread from './CommentThread.svelte';
|
|
|
|
type Props = {
|
|
documentId: string;
|
|
activeAnnotationId: string | null;
|
|
activeAnnotationPage: number | null;
|
|
canComment: boolean;
|
|
currentUserId: string | null;
|
|
canAdmin: boolean;
|
|
onClose: () => void;
|
|
};
|
|
|
|
let {
|
|
documentId,
|
|
activeAnnotationId,
|
|
activeAnnotationPage,
|
|
canComment,
|
|
currentUserId,
|
|
canAdmin,
|
|
onClose
|
|
}: Props = $props();
|
|
|
|
const visible = $derived(activeAnnotationId !== null);
|
|
</script>
|
|
|
|
<div
|
|
class="absolute inset-y-0 right-0 z-10 flex w-80 flex-col border-l border-line bg-surface shadow-[-4px_0_16px_rgba(0,0,0,0.08)] transition-transform duration-200 {visible
|
|
? 'translate-x-0'
|
|
: 'pointer-events-none translate-x-full'}"
|
|
data-testid="annotation-side-panel"
|
|
>
|
|
<!-- Header -->
|
|
<div class="flex shrink-0 items-center justify-between border-b border-line px-4 py-3">
|
|
<span class="font-sans text-xs font-medium text-ink">
|
|
{m.doc_panel_discussion_annotation_tab({ page: String(activeAnnotationPage ?? '?') })}
|
|
</span>
|
|
<button
|
|
onclick={onClose}
|
|
aria-label={m.comment_panel_close()}
|
|
class="rounded p-1 text-ink-3 transition-colors hover:bg-muted hover:text-ink"
|
|
>
|
|
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Comment thread -->
|
|
<div class="flex-1 overflow-y-auto p-4">
|
|
{#if activeAnnotationId}
|
|
{#key activeAnnotationId}
|
|
<CommentThread
|
|
documentId={documentId}
|
|
annotationId={activeAnnotationId}
|
|
canComment={canComment}
|
|
currentUserId={currentUserId}
|
|
canAdmin={canAdmin}
|
|
loadOnMount={true}
|
|
/>
|
|
{/key}
|
|
{/if}
|
|
</div>
|
|
</div>
|