@enjoys/react-chatbot-plugin 1.8.2 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -8
- package/dist/index.cjs +101 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +588 -2
- package/dist/index.mjs +101 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
- **Async actions** — Run API calls on step entry with real-time loading/progress/error states
|
|
45
45
|
- **Custom step components** — Render your own React widgets inside flow steps
|
|
46
46
|
- **Dynamic routing** — Route to different steps based on API results, status codes, or custom logic
|
|
47
|
-
- **Plugin architecture** —
|
|
47
|
+
- **Plugin architecture** — 35+ built-in plugins: analytics, AI, webhooks, persistence, i18n, CRM, rate limiting, live agent, tags, rating, offline, proactive, persona, and more
|
|
48
48
|
- **Slash commands** — `/help`, `/back`, `/cancel`, `/restart` built-in
|
|
49
49
|
- **`customizeChat` slot map** — All UI customization in one prop: component overrides (bubble, quick replies, typing indicator, header, input, launcher, branding, welcome/login screen) + config (header, branding, welcome screen content)
|
|
50
50
|
- **Custom header/input** — Swap the header or input with your own React components
|
|
@@ -57,7 +57,72 @@
|
|
|
57
57
|
- **Branding** — Customizable footer and header
|
|
58
58
|
- **Typing delay** — Realistic typing pause before bot replies
|
|
59
59
|
- **onUnhandledMessage** — Callback when nothing handles user text
|
|
60
|
-
- **Live Agent (WebSocket / Socket.IO)** — Real-time handoff to human agents with session persistence, queue updates, typing indicators, and "agent joined/left" system messages
|
|
60
|
+
- **Live Agent (WebSocket / Socket.IO)** — Real-time handoff to human agents with session persistence, queue updates, typing indicators, and "agent joined/left" system messages
|
|
61
|
+
- **Message Reactions** — 👍👎 emoji reactions on messages with analytics events
|
|
62
|
+
- **Message Search** — Full-text search through chat history with highlighted matches
|
|
63
|
+
- **Voice Input** — Speech-to-text via Web Speech API with language support
|
|
64
|
+
- **Typing Preview** — Real-time "User is typing..." indicator for live agent/flow mode
|
|
65
|
+
- **Rich Cards / Carousels** — Horizontal scrollable cards with images, titles, buttons
|
|
66
|
+
- **Date/Time Picker** — Native date/time/datetime form field type
|
|
67
|
+
- **Conversation Tags** — Group and tag conversations by topic
|
|
68
|
+
- **Conditional Rendering** — Show/hide steps with `visibleIf` rules based on collected data
|
|
69
|
+
- **Flow Composition** — Reusable sub-flows via `subFlow` field
|
|
70
|
+
- **Middleware Pipeline** — Pre-process, transform, or block messages before dispatch
|
|
71
|
+
- **Event Bus** — Standalone pub/sub system via `createEventBus()`
|
|
72
|
+
- **Headless Mode** — Run engine + plugins without UI via `createHeadlessBot()`
|
|
73
|
+
- **Message Edit/Delete** — Users can edit or delete their sent messages
|
|
74
|
+
- **Read Receipts** — ✓ sent, ✓✓ delivered, ✓✓ read status indicators
|
|
75
|
+
- **Rating Plugin** — End-of-chat satisfaction survey (1-5 stars)
|
|
76
|
+
- **Offline Queue** — Queue messages offline, auto-send on reconnect
|
|
77
|
+
- **Proactive Messages** — Trigger bot messages based on page behavior (idle, scroll, exit intent)
|
|
78
|
+
- **Persona Switching** — Switch between bot personalities in one widget
|
|
79
|
+
- **Message Pinning** — Pin/unpin important messages for quick reference
|
|
80
|
+
- **Theme Toggle** — In-chat dark/light mode switch with persistence
|
|
81
|
+
- **Confetti/Animations** — Celebration effects on flow completion or custom events
|
|
82
|
+
- **Priority & Labels** — Set conversation urgency and custom tags
|
|
83
|
+
- **Whisper Mode** — Supervisor notes visible only to agents
|
|
84
|
+
- **Message Scheduling** — Send messages at a future time
|
|
85
|
+
- **Conversation Summary** — AI-powered or keyword-based conversation recap
|
|
86
|
+
- **Knowledge Base** — Search FAQ/docs inline and surface answers
|
|
87
|
+
- **Auto-Translation** — Real-time message translation between languages
|
|
88
|
+
- **Transcript Export** — Download chat as text, JSON, CSV, or HTML
|
|
89
|
+
- **Notification Badge** — Unread count on launcher + browser notifications
|
|
90
|
+
- **Location Sharing** — Share GPS coordinates with map links
|
|
91
|
+
- **Code Snippets** — Syntax-highlighted code blocks with copy button
|
|
92
|
+
- **Inline Polls** — Create polls with voting and result visualization
|
|
93
|
+
- **Payment Widget** — Stripe/Razorpay/custom payment collection inline
|
|
94
|
+
- **Appointment Booking** — Calendar-based slot booking with confirmation
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Release History
|
|
99
|
+
|
|
100
|
+
| Version | Features | Type | Description |
|
|
101
|
+
|---------|----------|------|-------------|
|
|
102
|
+
| **v1.23.0** | Badge, Poll, Payment, Booking, Location | Plugin | Unread badge, inline polls, payment gateway, calendar booking, GPS sharing |
|
|
103
|
+
| **v1.22.0** | Summary, KB, Translation, Export, Code | Plugin | AI summary, FAQ search, auto-translate, transcript download, syntax highlight |
|
|
104
|
+
| **v1.21.0** | Pin, Theme Toggle, Confetti, Priority, Whisper, Schedule | Plugin | Pin messages, dark/light toggle, celebrations, priority labels, agent whisper, delayed send |
|
|
105
|
+
| **v1.20.0** | Headless Mode | Prop + Utility | `createHeadlessBot()` + `headless` prop — run engine without UI |
|
|
106
|
+
| **v1.19.0** | Event Bus | Utility | `createEventBus()` standalone pub/sub utility |
|
|
107
|
+
| **v1.18.0** | Middleware Pipeline | Prop | `middleware` prop — intercept/transform/block messages |
|
|
108
|
+
| **v1.17.0** | Conditional Rendering, Flow Composition | Engine | `visibleIf` on steps + `subFlow` for reusable flows |
|
|
109
|
+
| **v1.16.0** | Tags, Rating, Offline, Proactive, Persona | Plugin | 5 conversation plugins |
|
|
110
|
+
| **v1.15.0** | Date/Time Picker | Prop (form field) | Native `date`, `time`, `datetime` form field types |
|
|
111
|
+
| **v1.14.0** | Rich Cards / Carousels | Prop (message) | `CarouselCards` component + `cards` message field |
|
|
112
|
+
| **v1.13.0** | Typing, Edit/Delete, Read Receipts | Prop | User typing indicator, message edit/delete, delivery status |
|
|
113
|
+
| **v1.12.0** | Voice Input | Prop | Speech-to-text via Web Speech API |
|
|
114
|
+
| **v1.11.0** | Message Search | Prop | Full-text search with header search bar |
|
|
115
|
+
| **v1.10.0** | Message Reactions | Prop | Emoji reactions on messages |
|
|
116
|
+
| **v1.9.0** | Live Agent | Prop + Plugin | WebSocket / Socket.IO real-time agent chat |
|
|
117
|
+
| **v1.8.0** | Custom Icons | Prop | `icons` prop — override any built-in icon |
|
|
118
|
+
| **v1.7.0** | Markdown Rendering | Prop | `markdown` prop — bold, italic, code, links, lists |
|
|
119
|
+
| **v1.6.0** | Keywords & Fallback | Prop | Pattern matching, greeting detection, typing delay |
|
|
120
|
+
| **v1.5.0** | Custom Form Fields | Prop | `renderFormField` prop — replace any form field renderer |
|
|
121
|
+
| **v1.4.0** | customizeChat Slot Map | Prop | 9-slot UI customization system |
|
|
122
|
+
| **v1.3.0** | Async Actions + Dynamic Routing | Prop | Step-entry API calls with status-based routing |
|
|
123
|
+
| **v1.2.0** | File Upload + Emoji Picker | Prop | Drag & drop uploads, emoji selector |
|
|
124
|
+
| **v1.1.0** | Plugin System | Architecture | 30 built-in plugins + custom plugin API |
|
|
125
|
+
| **v1.0.0** | Initial Release | Core | Flow engine, forms, theming, slash commands |
|
|
61
126
|
|
|
62
127
|
## Installation
|
|
63
128
|
|
|
@@ -144,17 +209,27 @@ Full documentation is available in the [`docs/`](./docs/) folder:
|
|
|
144
209
|
| `inputPlaceholder` | `string` | Input placeholder text |
|
|
145
210
|
| `position` | `'bottom-right' \| 'bottom-left'` | Widget position |
|
|
146
211
|
| `enableEmoji` | `boolean` | Show emoji picker |
|
|
212
|
+
| `enableReactions` | `boolean \| string[]` | Emoji reactions on messages |
|
|
213
|
+
| `enableSearch` | `boolean` | Message search in header |
|
|
214
|
+
| `enableVoice` | `boolean \| { lang?, continuous? }` | Speech-to-text input |
|
|
215
|
+
| `showUserTyping` | `boolean` | Show typing indicator to agents |
|
|
216
|
+
| `allowMessageEdit` | `boolean` | Let users edit/delete sent messages |
|
|
217
|
+
| `showReadReceipts` | `boolean` | Show ✓/✓✓ delivery status |
|
|
218
|
+
| `markdown` | `boolean \| MarkdownOptions` | Render markdown in messages |
|
|
147
219
|
| `fileUpload` | `FileUploadConfig` | File upload settings |
|
|
148
220
|
| `components` | `Record<string, ComponentType<StepComponentProps>>` | Custom React components for flow steps |
|
|
149
221
|
| `actionHandlers` | `Record<string, (data, ctx) => Promise<FlowActionResult>>` | Async action handlers for flow steps |
|
|
222
|
+
| `middleware` | `FlowMiddleware[]` | Message middleware pipeline |
|
|
223
|
+
| `headless` | `boolean` | Hide UI, run only engine + plugins |
|
|
224
|
+
| `icons` | `Partial<ChatIconMap>` | Override built-in icons |
|
|
150
225
|
| `defaultOpen` | `boolean` | Start with chat open |
|
|
151
226
|
| `showLauncher` | `boolean` | Show/hide launcher button |
|
|
152
227
|
| `launcherIcon` | `ReactNode` | Custom launcher icon |
|
|
153
228
|
| `closeIcon` | `ReactNode` | Custom close icon |
|
|
154
229
|
| `zIndex` | `number` | CSS z-index |
|
|
155
230
|
| `renderFormField` | `FormFieldRenderMap` | Custom renderers for form field types |
|
|
156
|
-
| `customizeChat` | `ChatCustomizeChat` | All UI customization — slot configs + component overrides
|
|
157
|
-
| `liveAgent` | `LiveAgentConfig` | WebSocket / Socket.IO real-time agent chat
|
|
231
|
+
| `customizeChat` | `ChatCustomizeChat` | All UI customization — slot configs + component overrides |
|
|
232
|
+
| `liveAgent` | `LiveAgentConfig` | WebSocket / Socket.IO real-time agent chat |
|
|
158
233
|
| `className` | `string` | Root element class name |
|
|
159
234
|
|
|
160
235
|
### `customizeChat` Slots
|
|
@@ -259,13 +334,13 @@ All internal components are exported for advanced use cases:
|
|
|
259
334
|
|
|
260
335
|
**Forms:** `TextField`, `SelectField`, `RadioField`, `CheckboxField`, `FileUploadField`
|
|
261
336
|
|
|
262
|
-
**Icons:** `SendIcon`, `ChatBubbleIcon`, `CloseIcon`, `MinimizeIcon`, `EmojiIcon`, `AttachmentIcon`, `FileIcon`, `ImageIcon`, `RemoveIcon`, `RestartIcon`
|
|
337
|
+
**Icons:** `SendIcon`, `ChatBubbleIcon`, `CloseIcon`, `MinimizeIcon`, `EmojiIcon`, `AttachmentIcon`, `FileIcon`, `ImageIcon`, `RemoveIcon`, `RestartIcon`, `SearchIcon`, `MicIcon`, `StarIcon`, `EditIcon`, `TrashIcon`
|
|
263
338
|
|
|
264
|
-
**Engine & Core:** `FlowEngine`, `PluginManager`, `useChat`, `ChatContext`, `useChatContext`
|
|
339
|
+
**Engine & Core:** `FlowEngine`, `PluginManager`, `createEventBus`, `createHeadlessBot`, `LiveAgentAdapter`, `useChat`, `useLiveAgent`, `ChatContext`, `useChatContext`
|
|
265
340
|
|
|
266
|
-
**Theme utilities:** `resolveTheme`, `buildStyles`, `buildCSSVariables`
|
|
341
|
+
**Theme utilities:** `resolveTheme`, `buildStyles`, `buildCSSVariables`, `renderMarkdown`
|
|
267
342
|
|
|
268
|
-
**Built-in plugins:** `analyticsPlugin`, `webhookPlugin`, `persistencePlugin`, `loggerPlugin`, `crmPlugin`, `emailPlugin`, `syncPlugin`, `aiPlugin`, `intentPlugin`, `typingPlugin`, `autoReplyPlugin`, `validationPlugin`, `uploadPlugin`, `authPlugin`, `rateLimitPlugin`, `pushPlugin`, `soundPlugin`, `agentPlugin`, `transferPlugin`, `themePlugin`, `componentPlugin`, `leadPlugin`, `campaignPlugin`, `schedulerPlugin`, `reminderPlugin`, `i18nPlugin`, `debugPlugin`, `devtoolsPlugin`, `mediaPlugin`, `markdownPlugin`
|
|
343
|
+
**Built-in plugins (51):** `analyticsPlugin`, `webhookPlugin`, `persistencePlugin`, `loggerPlugin`, `crmPlugin`, `emailPlugin`, `syncPlugin`, `aiPlugin`, `intentPlugin`, `typingPlugin`, `autoReplyPlugin`, `validationPlugin`, `uploadPlugin`, `authPlugin`, `rateLimitPlugin`, `pushPlugin`, `soundPlugin`, `agentPlugin`, `transferPlugin`, `themePlugin`, `componentPlugin`, `leadPlugin`, `campaignPlugin`, `schedulerPlugin`, `reminderPlugin`, `i18nPlugin`, `debugPlugin`, `devtoolsPlugin`, `mediaPlugin`, `markdownPlugin`, `liveAgentPlugin`, `tagsPlugin`, `ratingPlugin`, `offlinePlugin`, `proactivePlugin`, `personaPlugin`, `pinPlugin`, `themeTogglePlugin`, `confettiPlugin`, `priorityPlugin`, `whisperPlugin`, `messageSchedulePlugin`, `notificationBadgePlugin`, `summaryPlugin`, `knowledgeBasePlugin`, `translationPlugin`, `transcriptExportPlugin`, `codeHighlightPlugin`, `pollPlugin`, `paymentPlugin`, `bookingPlugin`, `locationPlugin`
|
|
269
344
|
|
|
270
345
|
## Development
|
|
271
346
|
|