Files
Docwell/Web-App/frontend/src/components/PageList.vue
T
tajniak81andClaude Opus 5.5 a96c6ad3ce Add spaces, the page tree and the Docwell design system
Spaces and pages:
- Spaces inside workspaces, open or private, with admin/editor/commenter/viewer
  roles that cascade from the workspace role (rules in internal/access)
- Page tree per space with fractional position keys, move with cycle checks,
  trash that hides whole subtrees, restore and permanent delete
- OpenAPI, TypeScript client, and web app sidebar tree with drag-and-drop,
  page, space, trash and space settings views (EN + PL)

Design system:
- Tokens, type scale, radii and shadows from the design kit in
  @docwell/ui/theme.css; Inter, Source Serif 4 and JetBrains Mono bundled
- Vue ports of Button, TextField, Badge, Callout, Icon, Breadcrumbs,
  SlashMenu and PageTreeItem, plus Logo; favicons and web manifest
- Web app and admin panel restyled on the new tokens, in light and dark

Also: fix the Vite dev server crashing on /config.json, and stop tracking
the local Design/ and docs/ folders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 11:14:31 +01:00

26 lines
1.2 KiB
Vue

<script setup lang="ts" generic="Item extends { id: string; title: string; icon: string }">
import { DwIcon } from "@docwell/ui";
// A bordered list of pages (children of a page, a space's top level, the trash).
defineProps<{ items: Item[] }>();
</script>
<template>
<ul class="divide-y divide-line rounded-md border border-line bg-surface-raised">
<li v-for="p in items" :key="p.id" class="flex min-h-11 flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1.5">
<RouterLink
:to="{ name: 'page', params: { id: p.id } }"
class="flex min-w-0 flex-1 items-center gap-2 rounded-xs py-1 text-ink hover:text-accent"
>
<span v-if="p.icon" class="w-4 text-center">{{ p.icon }}</span>
<DwIcon v-else name="page" :size="16" class="text-ink-muted" />
<span class="min-w-0">
<span class="block truncate">{{ p.title || $t("home.untitled") }}</span>
<span v-if="$slots.meta" class="block text-ui-sm text-ink-muted"><slot name="meta" :item="p" /></span>
</span>
</RouterLink>
<span v-if="$slots.actions" class="flex shrink-0 gap-2"><slot name="actions" :item="p" /></span>
</li>
</ul>
</template>