mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 11:48:26 +01:00
"Who produces gallium?" now carries a ranked bar chart, not a list. chatkit
stays dependency-free: it defines the data contract (`ChartBlock`, mirroring
@bitbaum/chartkit's props for line, bars, share, timeline, tiles) and a
renderer slot (`renderers={{ chart }}` on ChatScreen, ChatThread, ChatMessage,
Markdown and RichAnswerBlock); the app injects the drawing.
- Parser: each kind validated field by field (bounded lists, finite numbers,
safe links). A malformed block is rejected by the parser and degrades to
its caption and a table of the safe rows; without a renderer, or when one
returns null, chatkit draws that table itself. A chart is never a blank.
- Instruction: when to draw (ranked 3+ rows -> bars, shares -> share, 3+
points over time -> line, 3+ dated events -> timeline, 2-4 figures ->
tiles), figures only from tool results, hrefs copied from the result.
- Copy and Listen read the figures as lines, never the wire JSON.
- Tests: node tests per kind, the fallback and the renderer paths; the
browser test renders a bars block through a stub renderer and a line block
through the fallback in demo/screen.html at 320/390/1280, with the
broken-word scan and no horizontal overflow.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
23 lines
1.3 KiB
JavaScript
23 lines
1.3 KiB
JavaScript
/**
|
|
* @bitbaum/chatkit/react — the chat every product uses.
|
|
*
|
|
* import { Composer, ChatThread, ChatStarters } from "@bitbaum/chatkit/react";
|
|
* import "@bitbaum/chatkit/styles.css";
|
|
*
|
|
* Behaviour is fixed here and identical everywhere; the look follows the
|
|
* app's tokens through `--ck-*` variables (see styles.css).
|
|
*/
|
|
export { Composer, DEFAULT_COMPOSER_LABELS } from "./Composer.js";
|
|
export { ChatThread, ChatMessage, ChatReplies, ChatStarters, ThinkingRow, formatThinkingDuration, DEFAULT_THREAD_LABELS, } from "./Thread.js";
|
|
export { ChatScreen } from "./Screen.js";
|
|
export { Markdown, SourcesRow, defaultRenderLink, defaultRenderCitation } from "./Markdown.js";
|
|
export { AnswerActions, DEFAULT_ANSWER_ACTIONS_LABELS } from "./AnswerActions.js";
|
|
export { useSpeech } from "./use-speech.js";
|
|
export { Sheet, prefersSheet } from "./Sheet.js";
|
|
export { useDictation } from "./use-dictation.js";
|
|
export { AttachMenu, DEFAULT_ATTACH_MENU_LABELS } from "./AttachMenu.js";
|
|
export { useAttachments } from "./use-attachments.js";
|
|
export { useClipboard, useStickToBottom, useViewportHeight, useAutoGrow } from "./hooks.js";
|
|
export { RichAnswerBlock, ChartTableFigure } from "./RichBlock.js";
|
|
export { RichRenderersContext, useRichRenderers } from "./renderers.js";
|
|
//# sourceMappingURL=index.js.map
|