feat: object label per object + {obj:UUID} sentence placeholders

- Annotate: per-object single label input (M2M via db_objects_db_words), auto-save on blur, remove picture-level word section
- Generate: object chips insert {obj:UUID} at cursor position in question/statement textarea
- Live preview resolves {obj:UUID} → actual object label
- PairsList display also resolves placeholders
- Remove F/A/B word chip system from pair form (replaced by object placeholders)
- Backend: POST /api/directus/db-objects/<id>/words replaces existing word with single label

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 13:04:37 +02:00
parent 2595b8d32e
commit 214f8a2019
5 changed files with 252 additions and 456 deletions

View File

@@ -463,6 +463,19 @@ export async function getDbObjectWords(objectId: string, token: string): Promise
return data.data as DbWord[]
}
export async function saveDbObjectWord(
objectId: string,
word: { titel_de: string; level: number } | null,
token: string
) {
const res = await fetch(`/api/directus/db-objects/${objectId}/words`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: token },
body: JSON.stringify(word ? { titel_de: word.titel_de, level: word.level } : { titel_de: '' }),
})
return res.json()
}
export async function updateDbPair(
pairId: string,
payload: {