feat(tokens): app-local non-player tokens with session moves and UI polish

Add token library/placements, keep play-time moves for the session, lock presentation interactions, and fix export/import modal layout plus freeform trap label.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-27 11:04:12 +08:00
parent bdeb64e356
commit f270812219
44 changed files with 2617 additions and 341 deletions
@@ -0,0 +1,17 @@
import { useEffect, useState } from 'react';
import { ipcChannels } from '../../../shared/ipc/contracts';
import type { AppToken } from '../../../shared/types';
import { getDndApi } from '../dndApi';
export function useAppTokens(): AppToken[] {
const api = getDndApi();
const [tokens, setTokens] = useState<AppToken[]>([]);
useEffect(() => {
void api.invoke(ipcChannels.tokens.list, {}).then(({ tokens: list }) => setTokens(list));
return api.on(ipcChannels.tokens.stateChanged, ({ tokens: list }) => setTokens(list));
}, [api]);
return tokens;
}