@haklex/rich-ext-chat
v0.34.0
Published
Static chat-snapshot node for the haklex rich editor
Readme
@haklex/rich-ext-chat
Static chat-snapshot blocks for assistant / conversation transcripts. Renders multi-participant message lists with variant-aware bubble styling.
Installation
pnpm add @haklex/rich-ext-chatPeer Dependencies
| Package | Version |
| --------- | --------- |
| lexical | ^0.45.0 |
| react | >= 19 |
Usage
Register nodes
Edit (read + write):
import { chatEditNodes } from '@haklex/rich-ext-chat/edit';
const editorConfig = { nodes: [...chatEditNodes] };Static / read-only:
import { chatNodes } from '@haklex/rich-ext-chat/node';
const staticConfig = { nodes: [...chatNodes] };Use renderers
import { ChatEditRenderer } from '@haklex/rich-ext-chat/edit';
import { ChatRenderer } from '@haklex/rich-ext-chat/renderer';Tree-shake the default renderer
import { CHAT_NODE_KEY, chatNodes } from '@haklex/rich-ext-chat/node';
import type { RichRendererModule } from '@haklex/rich-compose';
const lightModule: RichRendererModule = {
name: 'chat',
nodes: chatNodes,
renderers: { [CHAT_NODE_KEY]: MyLightChat },
};Import styles
import '@haklex/rich-ext-chat/style.css';Exports
Nodes
ChatNode-- static (read-only) nodeChatEditNode-- edit node$createChatNode()/$isChatNode()-- Lexical helperschatNodes-- array of static nodes for config registrationchatEditNodes-- array of edit nodes for config registration
Renderers
ChatRenderer-- static rendererChatEditRenderer-- edit renderer with participant management
Slot Key
CHAT_NODE_KEY--'Chat'constant forRendererConfigslot lookup
Types
ChatMessage,ChatParticipant,ChatParticipantKind,ChatVariantChatRendererProps(also flowed intoRendererConfig.Chatvia module augmentation)SerializedChatNode
Sub-path Exports
| Path | Description |
| --------------------------------- | --------------------------------------------------------- |
| @haklex/rich-ext-chat | Full exports (node + renderer + edit) |
| @haklex/rich-ext-chat/node | Lightweight node + slot key + types — no default renderer |
| @haklex/rich-ext-chat/renderer | Default ChatRenderer (heavy) |
| @haklex/rich-ext-chat/edit | Edit-mode node + ChatEditRenderer |
| @haklex/rich-ext-chat/static | Convenience: node + renderer (SSR bundle) |
| @haklex/rich-ext-chat/style.css | Stylesheet |
Part of Haklex
This package is part of the Haklex rich editor ecosystem.
License
MIT
