@botonic/webchat-react 2.25.0 → 2.27.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/CHANGELOG.md +42 -0
- package/CLAUDE.md +170 -0
- package/index.d.ts +12 -5
- package/index.js +59 -28
- package/lib/components/dialog/backdrop/backdrop.d.ts +5 -0
- package/lib/components/dialog/dialog/dialog.d.ts +7 -0
- package/lib/components/dialog/dialog-context.d.ts +3 -0
- package/lib/components/dialog/dialog-provider.d.ts +17 -0
- package/lib/components/dialog/dialog-types.d.ts +24 -0
- package/lib/components/dialog/icons/check-icon.d.ts +1 -0
- package/lib/components/dialog/icons/xmark-icon.d.ts +1 -0
- package/lib/components/dialog/index.d.ts +5 -0
- package/lib/components/dialog/webchat-dialog-provider.d.ts +6 -0
- package/lib/components/message/audio-message/audio-message.d.ts +2 -0
- package/lib/components/message/audio-message/use-audio-message.d.ts +294 -0
- package/lib/components/message/button-message/button-message.d.ts +6 -1
- package/lib/components/message/carousel-message/carousel-message.d.ts +2 -2
- package/lib/components/message/carousel-message/icons/chevron-left-icon.d.ts +1 -0
- package/lib/components/message/carousel-message/icons/chevron-right-icon.d.ts +1 -0
- package/lib/components/message/carousel-message/index.d.ts +1 -1
- package/lib/components/message/carousel-message/use-carousel-message.d.ts +47 -0
- package/lib/components/message/document-message/document-message.d.ts +2 -8
- package/lib/components/message/document-message/use-document-message.d.ts +11 -0
- package/lib/components/message/image-message/use-image-message.d.ts +10 -0
- package/lib/components/message/index.d.ts +2 -1
- package/lib/components/message/message/message-avatar/message-avatar.d.ts +2 -0
- package/lib/components/message/message/message-bubble/message-bubble.d.ts +0 -3
- package/lib/components/message/message/message-info/message-info.d.ts +2 -0
- package/lib/components/message/message/message.d.ts +2 -0
- package/lib/components/message/message/use-message.d.ts +3 -3
- package/lib/components/{typing-indicator → message/typing-message}/index.d.ts +1 -1
- package/lib/components/{typing-indicator/typing-indicator.d.ts → message/typing-message/typing-message.d.ts} +0 -5
- package/lib/components/message/video-message/use-video-message.d.ts +21 -0
- package/lib/components/message/video-message/video-message.d.ts +3 -1
- package/lib/components/message-machine-renderer/message-machine-renderer.d.ts +1 -0
- package/lib/components/message-machine-renderer/use-message-machine-renderer.d.ts +1 -0
- package/lib/components/shared/button-component/external-link-icon.d.ts +1 -0
- package/lib/components/webchat-app/webchat-app.d.ts +13 -3
- package/lib/components/webchat-container/use-webchat-container.d.ts +1 -0
- package/lib/components/webchat-header/icons/close-icon.d.ts +1 -0
- package/lib/components/webchat-header/icons/download-icon.d.ts +1 -0
- package/lib/components/webchat-header/icons/leave-icon.d.ts +1 -0
- package/lib/components/webchat-header/icons/menu-icon.d.ts +1 -0
- package/lib/components/webchat-header/icons/sounds-icon.d.ts +1 -0
- package/lib/components/webchat-header/icons/start-over-icon.d.ts +1 -0
- package/lib/components/webchat-header/use-webchat-header.d.ts +11 -2
- package/lib/components/webchat-header/webchat-header.d.ts +4 -1
- package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-download-transcript.d.ts +5 -0
- package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-reset-conversation.d.ts +5 -0
- package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-reset-session.d.ts +5 -0
- package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-sounds.d.ts +5 -0
- package/lib/components/webchat-header/webchat-menu/use-dropdown-menu-item-reset-session.d.ts +9 -0
- package/lib/components/webchat-input/attachment-preview/attachment-preview.d.ts +2 -0
- package/lib/components/webchat-input/attachment-preview/index.d.ts +3 -0
- package/lib/components/webchat-input/attachment-preview/use-attachment-preview.d.ts +23 -0
- package/lib/components/webchat-input/audio-input/audio-input.d.ts +2 -0
- package/lib/components/webchat-input/audio-input/index.d.ts +3 -0
- package/lib/components/webchat-input/audio-input/use-audio-input.d.ts +34 -0
- package/lib/components/webchat-input/audio-waveform/audio-waveform.d.ts +5 -0
- package/lib/components/webchat-input/audio-waveform/index.d.ts +1 -0
- package/lib/components/webchat-input/audio-waveform/static-waveform.d.ts +9 -0
- package/lib/components/webchat-input/constants.d.ts +3 -0
- package/lib/components/webchat-input/icons/attachment-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/cancel-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/close-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/confirm-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/emoji-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/file-icon.d.ts +2 -0
- package/lib/components/webchat-input/icons/file-pdf-icon.d.ts +2 -0
- package/lib/components/webchat-input/icons/microphone-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/pause-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/play-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/send-icon.d.ts +1 -0
- package/lib/components/webchat-input/icons/svg-attrs.d.ts +7 -0
- package/lib/components/webchat-input/use-webchat-input.d.ts +26 -9
- package/lib/components/webchat-input/webchat-input.d.ts +6 -1
- package/lib/components/webchat-messages/use-webchat-messages-list-scroll.d.ts +15 -0
- package/lib/components/webchat-messages/use-webchat-messages.d.ts +18 -0
- package/lib/components/webchat-provider/webchat-context.d.ts +8 -0
- package/lib/components/webchat-provider/webchat-provider.d.ts +1 -10
- package/lib/components/webchat-trigger/icons/chat-icon.d.ts +1 -0
- package/lib/components/webchat-trigger/icons/chevron-down-icon.d.ts +1 -0
- package/lib/components/webchat-trigger/use-webchat-trigger.d.ts +10 -0
- package/lib/contexts/media-playback-context.d.ts +11 -0
- package/lib/hero-header-layout/index.d.ts +3 -0
- package/lib/hero-header-layout/use-webchat-hero-header-layout.d.ts +40 -0
- package/lib/hero-header-layout/webchat-hero-header-layout-config.d.ts +26 -0
- package/lib/hero-header-layout/webchat-hero-header-layout-utils.d.ts +2 -0
- package/lib/hooks/use-audio-recorder.d.ts +20 -0
- package/lib/hooks/use-webchat-state.d.ts +7 -0
- package/lib/hooks/webchat-client-settings-behaviors.d.ts +13 -0
- package/lib/types/webchat-props.d.ts +57 -2
- package/lib/utils/audio-utils.d.ts +1 -0
- package/lib/utils/uuid-utils.d.ts +1 -0
- package/package.json +4 -3
- package/styles.css +177 -16
- package/trigger.js +231 -135
- package/webchat-app-DSDMjE-m.js +4051 -0
- package/lib/components/webchat-messages/use-custom-scrollbar.d.ts +0 -11
- package/webchat-app-BUGnjp8Q.js +0 -2408
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
## 2.27.0 (2026-04-29)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **webchat-react:** add design system gateway for @lilara/ui-web-react (BLT-2334) ([#859](https://github.com/metis-ai/hubtype-product/pull/859))
|
|
6
|
+
- **webchat-react:** add webchat header menu (BLT-1861) ([#858](https://github.com/metis-ai/hubtype-product/pull/858))
|
|
7
|
+
- Hero Header transitions ([#860](https://github.com/metis-ai/hubtype-product/pull/860))
|
|
8
|
+
- **webchat-react:** complete CarouselMessage component ([#842](https://github.com/metis-ai/hubtype-product/pull/842))
|
|
9
|
+
- typing to work again and improve it with few modes when sending messages ([#831](https://github.com/metis-ai/hubtype-product/pull/831))
|
|
10
|
+
- **BLT-1884:** wire DialogProvider into webchat and webview render trees ([#837](https://github.com/metis-ai/hubtype-product/pull/837))
|
|
11
|
+
- **BLT-1884:** add Dialog primitive, Backdrop, DialogProvider, and useDialog ([#836](https://github.com/metis-ai/hubtype-product/pull/836))
|
|
12
|
+
- **BLT-1884:** add pauseAll() to MediaPlaybackContext ([#835](https://github.com/metis-ai/hubtype-product/pull/835))
|
|
13
|
+
- **BLT-1884:** add backdrop named grid lines to webchat and webview containers ([#834](https://github.com/metis-ai/hubtype-product/pull/834))
|
|
14
|
+
- receiving db_id, bot_interaction_id and working capture_user_input_id and first_interaction updatable ([#822](https://github.com/metis-ai/hubtype-product/pull/822))
|
|
15
|
+
- **BLT-2281:** webchat chat message media ([#823](https://github.com/metis-ai/hubtype-product/pull/823))
|
|
16
|
+
- **BLT-2291:** attachment input preview with file validation ([#817](https://github.com/metis-ai/hubtype-product/pull/817))
|
|
17
|
+
- **BLT-2293:** send audio messages ([#804](https://github.com/metis-ai/hubtype-product/pull/804))
|
|
18
|
+
- set basis for webchat client settings ([#791](https://github.com/metis-ai/hubtype-product/pull/791))
|
|
19
|
+
|
|
20
|
+
### 🩹 Fixes
|
|
21
|
+
|
|
22
|
+
- add missing tokens and update theme ([#864](https://github.com/metis-ai/hubtype-product/pull/864))
|
|
23
|
+
- fix headers after merge ([#863](https://github.com/metis-ai/hubtype-product/pull/863))
|
|
24
|
+
- **BLT-1884:** reset actions/subtitle on variant change; fix DialogDemo layout ([#844](https://github.com/metis-ai/hubtype-product/pull/844))
|
|
25
|
+
- incompatible useWebchatContext export on HMR ([#826](https://github.com/metis-ai/hubtype-product/pull/826))
|
|
26
|
+
- **webchat:** fix scroll fade gradient and recording controls padding #BLT-2317 ([#821](https://github.com/metis-ai/hubtype-product/pull/821))
|
|
27
|
+
|
|
28
|
+
### ❤️ Thank You
|
|
29
|
+
|
|
30
|
+
- David Hidalgo @Davidhidalgo
|
|
31
|
+
- Marc Rabat @vanbasten17
|
|
32
|
+
|
|
33
|
+
## 2.26.0 (2026-03-31)
|
|
34
|
+
|
|
35
|
+
### 🚀 Features
|
|
36
|
+
|
|
37
|
+
- **webchat-react:** chat input action bar and contextual send/mic #BLT-2290 ([#788](https://github.com/metis-ai/hubtype-product/pull/788))
|
|
38
|
+
|
|
39
|
+
### ❤️ Thank You
|
|
40
|
+
|
|
41
|
+
- David Hidalgo @Davidhidalgo
|
|
42
|
+
|
|
1
43
|
## 2.25.0 (2026-03-27)
|
|
2
44
|
|
|
3
45
|
### 🚀 Features
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: webchat-react conventions — hook/component split, CSS layers, webchat tokens, message components, inline SVGs, and animation patterns
|
|
3
|
+
globs: libs/botonic/webchat-react/**
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# webchat-react
|
|
8
|
+
|
|
9
|
+
Conventions specific to `libs/botonic/webchat-react`. Base rules in the root `CLAUDE.md` apply here too.
|
|
10
|
+
|
|
11
|
+
## Hook / Component Split
|
|
12
|
+
|
|
13
|
+
Every non-trivial component is split into:
|
|
14
|
+
|
|
15
|
+
- **`use-[component].ts`** — all state, refs, callbacks, derived values; returns named prop bundles
|
|
16
|
+
- **`[component].tsx`** — pure render only; spreads prop bundles from the hook
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
webchat-input/
|
|
20
|
+
├── use-webchat-input.ts
|
|
21
|
+
├── webchat-input.tsx
|
|
22
|
+
├── webchat-input.module.css
|
|
23
|
+
├── webchat-input.spec.tsx
|
|
24
|
+
└── index.ts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Before touching any component, check:**
|
|
28
|
+
|
|
29
|
+
1. Does a `use-[component].ts` already exist? If not, create it as part of your change.
|
|
30
|
+
2. Is all state, refs, callbacks, and derived values in the hook — not in the `.tsx` file?
|
|
31
|
+
3. Does the `.tsx` file only render — no `useState`, `useRef`, `useCallback`, or business logic?
|
|
32
|
+
|
|
33
|
+
Violating this in a PR is a blocker. When adding a feature or fixing a bug in a component that lacks a hook, refactor it in the same PR.
|
|
34
|
+
|
|
35
|
+
Hook return shape uses named bundles, not flat props:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
return {
|
|
39
|
+
inputProps: { value, onChange: handleChange, onKeyDown: handleKeyDown },
|
|
40
|
+
primaryActionProps: { onClick: handleSubmit, 'aria-label': submitLabel },
|
|
41
|
+
variants: { isDisabled, hasError, isEmpty },
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## CSS Layers
|
|
46
|
+
|
|
47
|
+
The cascade stack, from lowest to highest priority:
|
|
48
|
+
|
|
49
|
+
| Layer | Who writes it | Purpose |
|
|
50
|
+
| --------------------------- | ------------------------- | ------------------------------------------------------------ |
|
|
51
|
+
| `@layer components` | webchat-react | Base component styles |
|
|
52
|
+
| `@layer component-variants` | webchat-react | Visual variants of components (e.g. different bubble styles) |
|
|
53
|
+
| `@layer overrides` | `webchat-tokens.css` only | Library-default token values |
|
|
54
|
+
| _(unlayered)_ | Bot app consumers | Final consumer customizations — always wins |
|
|
55
|
+
|
|
56
|
+
**Component styles → `@layer components`.**
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
@layer components {
|
|
60
|
+
.documentMessage {
|
|
61
|
+
width: auto;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**CSS animations:** declare `@keyframes` outside any layer (global scope), use them inside `@layer components`. Add `@media (prefers-reduced-motion: reduce)` outside any layer too.
|
|
67
|
+
|
|
68
|
+
**Token default values → `@layer overrides`** in `webchat-tokens.css` only. Bot apps override tokens with unlayered CSS in their own `webchat-tokens-overrides.css`.
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
/* webchat-tokens.css */
|
|
72
|
+
@layer overrides {
|
|
73
|
+
:root {
|
|
74
|
+
--webchat-input-bg: var(--color-neutral-white);
|
|
75
|
+
--webchat-send-button-color: var(--color-primary-500);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
> **Never add end-consumer override CSS in library code.** The `@layer overrides` in `webchat-tokens.css` is for library defaults only. Bot apps write their own overrides in `webchat-tokens-overrides.css`.
|
|
81
|
+
|
|
82
|
+
## Webchat Tokens (`--webchat-*`)
|
|
83
|
+
|
|
84
|
+
Every value a consumer might want to customize must be a `--webchat-*` token defined in `webchat-tokens.css`.
|
|
85
|
+
|
|
86
|
+
Pattern: `--webchat-{component}-{property}` with fallback to a foundations token:
|
|
87
|
+
|
|
88
|
+
```css
|
|
89
|
+
--webchat-input-bg: var(--color-neutral-white);
|
|
90
|
+
--webchat-bubble-bot-bg: var(--color-neutral-100);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Message Components
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
components/message/[message-type]/
|
|
97
|
+
├── [message-type]-message.tsx # forwardRef, extends MessageProps
|
|
98
|
+
├── [message-type]-message.module.css
|
|
99
|
+
├── [message-type]-message.stories.tsx
|
|
100
|
+
└── index.ts
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
See the `create-new-message-type` skill for the full step-by-step guide.
|
|
104
|
+
|
|
105
|
+
## Inline SVGs
|
|
106
|
+
|
|
107
|
+
No external icon library. Rules:
|
|
108
|
+
|
|
109
|
+
1. Extract each SVG into a **React function component** in `webchat-input/icons/` (e.g. `play-icon.tsx`)
|
|
110
|
+
2. Use `currentColor` for fill/stroke
|
|
111
|
+
3. Set `role='img'` and `aria-hidden={true}` on decorative SVGs
|
|
112
|
+
4. Import and render as `<PlayIcon />` — never inline SVG markup inside a component
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
// Good — dedicated icon component
|
|
116
|
+
// webchat-input/icons/play-icon.tsx
|
|
117
|
+
export function PlayIcon() {
|
|
118
|
+
return (
|
|
119
|
+
<svg viewBox='0 0 24 24' fill='currentColor' role='img' aria-hidden={true}>
|
|
120
|
+
<polygon points='5,3 19,12 5,21' />
|
|
121
|
+
</svg>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Good — import and use
|
|
126
|
+
import { PlayIcon } from '../icons/play-icon'
|
|
127
|
+
const MyButton = () => (
|
|
128
|
+
<button>
|
|
129
|
+
<PlayIcon />
|
|
130
|
+
</button>
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
// Bad — SVG inlined directly inside a component
|
|
134
|
+
const MyButton = () => (
|
|
135
|
+
<button>
|
|
136
|
+
<svg viewBox='0 0 24 24'>...</svg>
|
|
137
|
+
</button>
|
|
138
|
+
)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Animations
|
|
142
|
+
|
|
143
|
+
Prefer CSS keyframes over JS animation libraries. Define keyframes **outside any layer**, use them inside `@layer component-variants`. Always add `prefers-reduced-motion`.
|
|
144
|
+
|
|
145
|
+
```css
|
|
146
|
+
@keyframes webchat-fade-in {
|
|
147
|
+
from {
|
|
148
|
+
opacity: 0;
|
|
149
|
+
transform: translateY(4px);
|
|
150
|
+
}
|
|
151
|
+
to {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
transform: translateY(0);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@layer component-variants {
|
|
158
|
+
.messageEnter {
|
|
159
|
+
animation: webchat-fade-in var(--webchat-animation-duration, var(--transition-fast)) var(--webchat-animation-easing, ease-out) both;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@media (prefers-reduced-motion: reduce) {
|
|
164
|
+
.messageEnter {
|
|
165
|
+
animation: none;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
See the `webchat-animations` skill for token naming conventions and keyframe architecture.
|
package/index.d.ts
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* ## Embedded Webchat (full control)
|
|
7
7
|
* ```tsx
|
|
8
|
-
* import { WebchatProvider, WebchatContainer, WebchatMessages, WebchatInput } from '@botonic/webchat-react'
|
|
9
|
-
* import { Button } from '@lilara/ui-web-react'
|
|
8
|
+
* import { WebchatProvider, WebchatContainer, WebchatMessages, WebchatInput, Button } from '@botonic/webchat-react'
|
|
10
9
|
* import '@lilara/foundations/base.css'
|
|
11
10
|
* import '@lilara/ui-web-react/styles.css'
|
|
12
11
|
* import '@botonic/webchat-react/styles.css'
|
|
@@ -37,10 +36,15 @@
|
|
|
37
36
|
* window.botonic.open()
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
|
-
export { useWebchatContext
|
|
39
|
+
export { useWebchatContext } from './lib/components/webchat-provider/webchat-context';
|
|
40
|
+
export { WebchatProvider } from './lib/components/webchat-provider/webchat-provider';
|
|
41
41
|
export { WebchatApp, type WebchatAppProps } from './lib/components/webchat-app';
|
|
42
42
|
export { WebchatContainer } from './lib/components/webchat-container/webchat-container';
|
|
43
|
-
export { WebchatHeader } from './lib/components/webchat-header/webchat-header';
|
|
43
|
+
export { CloseButton, MenuTriggerButton, WebchatHeader, } from './lib/components/webchat-header/webchat-header';
|
|
44
|
+
export { DropdownMenuItemDownloadTranscript, type DropdownMenuItemDownloadTranscriptProps, } from './lib/components/webchat-header/webchat-menu/dropdown-menu-item-download-transcript';
|
|
45
|
+
export { DropdownMenuItemResetConversation, type DropdownMenuItemResetConversationProps, } from './lib/components/webchat-header/webchat-menu/dropdown-menu-item-reset-conversation';
|
|
46
|
+
export { DropdownMenuItemResetSession, type DropdownMenuItemResetSessionProps, } from './lib/components/webchat-header/webchat-menu/dropdown-menu-item-reset-session';
|
|
47
|
+
export { DropdownMenuItemSounds, type DropdownMenuItemSoundsProps, } from './lib/components/webchat-header/webchat-menu/dropdown-menu-item-sounds';
|
|
44
48
|
export { WebchatInput } from './lib/components/webchat-input/webchat-input';
|
|
45
49
|
export { WebchatMessages } from './lib/components/webchat-messages/webchat-messages';
|
|
46
50
|
export { useWebchatContainer } from './lib/components/webchat-container/use-webchat-container';
|
|
@@ -48,12 +52,15 @@ export { useWebchatHeader } from './lib/components/webchat-header/use-webchat-he
|
|
|
48
52
|
export { useWebchatInput } from './lib/components/webchat-input/use-webchat-input';
|
|
49
53
|
export { useWebchatMessages } from './lib/components/webchat-messages/use-webchat-messages';
|
|
50
54
|
export { useWebchatState } from './lib/hooks/use-webchat-state';
|
|
55
|
+
export { DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG, getMessageActorCount, mergeWebchatHeroHeaderLayoutConfig, useWebchatHeroHeaderLayout, type UseWebchatHeroHeaderLayoutParams, type WebchatHeroHeaderLayoutConfig, type WebchatHeroHeaderLayoutResult, } from './lib/hero-header-layout';
|
|
51
56
|
export { Message, type MessageProps } from './lib/components/message/message';
|
|
52
57
|
export { MessageBubble, type MessageBubbleProps, } from './lib/components/message/message/message-bubble';
|
|
58
|
+
export { TypingIndicator } from './lib/components/message/typing-message';
|
|
53
59
|
export { MessageMachineRenderer } from './lib/components/message-machine-renderer/message-machine-renderer';
|
|
54
|
-
export {
|
|
60
|
+
export { Backdrop, Dialog, type DialogAction, DialogContext, type DialogControls, type DialogOpenProps, DialogProvider, type DialogState, type DialogVariant, useDialog, } from './lib/components/dialog';
|
|
55
61
|
export { type CoverComponentRegistry, Overlay, OverlayConfirmModal, type OverlayConfirmModalProps, OverlayContent, type OverlayContentProps, OverlayContext, type OverlayContextValue, OverlayCoverFrame, type OverlayCoverFrameProps, OverlayHeader, type OverlayHeaderProps, type OverlayProps, OverlayWebviewFrame, type OverlayWebviewFrameProps, useOverlay, useOverlayContext, useOverlayHeader, } from './lib/components/webchat-overlay';
|
|
56
62
|
export { ButtonComponent, type ButtonComponentProps, } from './lib/components/shared';
|
|
57
63
|
export * from './lib/types/primitives';
|
|
58
64
|
export * from './lib/types/webchat-props';
|
|
59
65
|
export type { WebchatConfig, WebchatController, WebchatEmittedEvent, } from '@botonic/webchat-core';
|
|
66
|
+
export { Badge, type BadgeProps, Banner, type BannerProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Multiselect, type MultiselectProps, MultiselectWithSections, type MultiselectWithSectionsProps, Select, type SelectItem, type SelectProps, type SelectSection, SelectWithSections, type SelectWithSectionsProps, Slider, type SliderProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Tag, type TagProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, Tooltip, type TooltipProps, } from '@lilara/ui-web-react';
|
package/index.js
CHANGED
|
@@ -1,30 +1,61 @@
|
|
|
1
|
-
import { B as s,
|
|
1
|
+
import { B as s, a as t, C as o, D as r, b as n, c as u, d as i, e as c, f as l, g as d, h, M as b, i as g, j as W, k as p, O as C, l as v, m as M, n as y, o as O, p as m, q as D, T as H, W as T, r as x, s as B, t as I, u as S, v as w, w as A, x as E, y as f, z as F, A as L, E as R, F as _, G as k, H as G, I as P, J as U, K as j, L as q } from "./webchat-app-DSDMjE-m.js";
|
|
2
|
+
import { Badge as J, Banner as K, Button as N, Checkbox as Y, Multiselect as Q, MultiselectWithSections as V, Select as X, SelectWithSections as Z, Slider as $, Spinner as ee, Switch as ae, Tag as se, TextArea as te, TextInput as oe, Tooltip as re } from "@lilara/ui-web-react";
|
|
2
3
|
export {
|
|
3
|
-
s as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
s as Backdrop,
|
|
5
|
+
J as Badge,
|
|
6
|
+
K as Banner,
|
|
7
|
+
N as Button,
|
|
8
|
+
t as ButtonComponent,
|
|
9
|
+
Y as Checkbox,
|
|
10
|
+
o as CloseButton,
|
|
11
|
+
r as DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG,
|
|
12
|
+
n as Dialog,
|
|
13
|
+
u as DialogContext,
|
|
14
|
+
i as DialogProvider,
|
|
15
|
+
c as DropdownMenuItemDownloadTranscript,
|
|
16
|
+
l as DropdownMenuItemResetConversation,
|
|
17
|
+
d as DropdownMenuItemResetSession,
|
|
18
|
+
h as DropdownMenuItemSounds,
|
|
19
|
+
b as MenuTriggerButton,
|
|
20
|
+
g as Message,
|
|
21
|
+
W as MessageBubble,
|
|
22
|
+
p as MessageMachineRenderer,
|
|
23
|
+
Q as Multiselect,
|
|
24
|
+
V as MultiselectWithSections,
|
|
25
|
+
C as Overlay,
|
|
26
|
+
v as OverlayConfirmModal,
|
|
27
|
+
M as OverlayContent,
|
|
28
|
+
y as OverlayContext,
|
|
29
|
+
O as OverlayCoverFrame,
|
|
30
|
+
m as OverlayHeader,
|
|
31
|
+
D as OverlayWebviewFrame,
|
|
32
|
+
X as Select,
|
|
33
|
+
Z as SelectWithSections,
|
|
34
|
+
$ as Slider,
|
|
35
|
+
ee as Spinner,
|
|
36
|
+
ae as Switch,
|
|
37
|
+
se as Tag,
|
|
38
|
+
te as TextArea,
|
|
39
|
+
oe as TextInput,
|
|
40
|
+
re as Tooltip,
|
|
41
|
+
H as TypingIndicator,
|
|
42
|
+
T as WebchatApp,
|
|
43
|
+
x as WebchatContainer,
|
|
44
|
+
B as WebchatHeader,
|
|
45
|
+
I as WebchatInput,
|
|
46
|
+
S as WebchatMessages,
|
|
47
|
+
w as WebchatProvider,
|
|
48
|
+
A as getMessageActorCount,
|
|
49
|
+
E as mergeWebchatHeroHeaderLayoutConfig,
|
|
50
|
+
f as useDialog,
|
|
51
|
+
F as useOverlay,
|
|
52
|
+
L as useOverlayContext,
|
|
53
|
+
R as useOverlayHeader,
|
|
54
|
+
_ as useWebchatContainer,
|
|
55
|
+
k as useWebchatContext,
|
|
56
|
+
G as useWebchatHeader,
|
|
57
|
+
P as useWebchatHeroHeaderLayout,
|
|
58
|
+
U as useWebchatInput,
|
|
59
|
+
j as useWebchatMessages,
|
|
60
|
+
q as useWebchatState
|
|
30
61
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DialogState, DialogVariant } from '../dialog-types';
|
|
2
|
+
type DialogProps = Omit<DialogState, 'isOpen'> & {
|
|
3
|
+
isClosing?: boolean;
|
|
4
|
+
onExited?: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function Dialog({ variant, title, subtitle, actions, isClosing, onExited, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type { DialogVariant };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DialogControls } from './dialog-types';
|
|
3
|
+
interface DialogProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Called synchronously before the dialog opens.
|
|
7
|
+
* Use this to pause media, blur backgrounds, etc.
|
|
8
|
+
*/
|
|
9
|
+
onOpen?: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Optional ref that will be populated with the dialog controls on mount.
|
|
12
|
+
* Useful for wiring the controls to external callers (e.g. the public API).
|
|
13
|
+
*/
|
|
14
|
+
controlsRef?: React.MutableRefObject<Pick<DialogControls, 'open' | 'update' | 'close'> | null>;
|
|
15
|
+
}
|
|
16
|
+
export declare function DialogProvider({ children, onOpen, controlsRef, }: DialogProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ButtonProps } from '@lilara/ui-web-react';
|
|
2
|
+
export type DialogVariant = 'default' | 'loading' | 'error' | 'success';
|
|
3
|
+
export type DialogAction = Omit<ButtonProps, 'children'> & {
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export interface DialogOpenProps {
|
|
7
|
+
variant?: DialogVariant;
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
actions?: DialogAction[];
|
|
11
|
+
}
|
|
12
|
+
export interface DialogState {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
variant: DialogVariant;
|
|
15
|
+
title: string;
|
|
16
|
+
subtitle?: string;
|
|
17
|
+
actions?: DialogAction[];
|
|
18
|
+
}
|
|
19
|
+
export interface DialogControls {
|
|
20
|
+
open: (props: DialogOpenProps) => void;
|
|
21
|
+
update: (props: Partial<DialogOpenProps>) => void;
|
|
22
|
+
close: () => void;
|
|
23
|
+
dialogState: DialogState;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CheckIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function XmarkIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Backdrop } from './backdrop/backdrop';
|
|
2
|
+
export { Dialog } from './dialog/dialog';
|
|
3
|
+
export { DialogContext, useDialog } from './dialog-context';
|
|
4
|
+
export { DialogProvider } from './dialog-provider';
|
|
5
|
+
export type { DialogAction, DialogControls, DialogOpenProps, DialogState, DialogVariant, } from './dialog-types';
|
|
@@ -2,6 +2,8 @@ import { MessageProps } from '../message';
|
|
|
2
2
|
export interface AudioMessageProps extends Omit<MessageProps, 'children'> {
|
|
3
3
|
/** The audio URL. */
|
|
4
4
|
src: string;
|
|
5
|
+
/** Unique message identifier — used to coordinate exclusive playback. */
|
|
6
|
+
messageId?: string;
|
|
5
7
|
/** Alt text for the audio (for accessibility). */
|
|
6
8
|
alt?: string;
|
|
7
9
|
/** Callback when audio loads (useful for scroll adjustment). */
|