@botonic/webchat-react 2.28.0 → 2.29.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 +12 -0
- package/index.d.ts +6 -3
- package/index.js +51 -49
- package/lib/components/message/index.d.ts +1 -0
- package/lib/components/message/message/message.d.ts +2 -0
- package/lib/components/message/message/use-message.d.ts +2 -0
- package/lib/components/message/rating-message/icons/face-angry.d.ts +2 -0
- package/lib/components/message/rating-message/icons/face-frown.d.ts +2 -0
- package/lib/components/message/rating-message/icons/face-grin-beam.d.ts +2 -0
- package/lib/components/message/rating-message/icons/face-meh.d.ts +2 -0
- package/lib/components/message/rating-message/icons/face-smile.d.ts +2 -0
- package/lib/components/message/rating-message/icons/index.d.ts +7 -0
- package/lib/components/message/rating-message/icons/rating-icon-types.d.ts +5 -0
- package/lib/components/message/rating-message/icons/star.d.ts +2 -0
- package/lib/components/message/rating-message/index.d.ts +1 -0
- package/lib/components/message/rating-message/rating-message.d.ts +4 -0
- package/lib/components/message/rating-message/use-rating-message.d.ts +31 -0
- package/lib/components/message-machine-renderer/message-machine-renderer.d.ts +1 -1
- package/lib/components/shared/index.d.ts +2 -2
- package/lib/components/shared/quick-reply/index.d.ts +2 -0
- package/lib/components/shared/{button-component/button-component.d.ts → quick-reply/quick-reply.d.ts} +4 -4
- package/lib/components/webchat-app/webchat-app.d.ts +1 -4
- package/lib/components/webchat-messages/use-webchat-messages.d.ts +7 -1
- package/lib/components/webchat-overlay/base/index.d.ts +0 -1
- package/lib/components/webchat-overlay/base/overlay/use-overlay.d.ts +0 -4
- package/lib/components/webchat-overlay/base/overlay-context.d.ts +0 -2
- package/lib/components/webchat-overlay/index.d.ts +1 -1
- package/lib/hooks/use-update-custom-message-props.d.ts +1 -0
- package/lib/hooks/use-webchat-state.d.ts +10 -2
- package/lib/hooks/webchat-output-renderers.d.ts +6 -0
- package/package.json +4 -4
- package/styles.css +47 -1
- package/trigger.js +1 -1
- package/webchat-app-C3YH_yqx.js +4293 -0
- package/lib/components/shared/button-component/index.d.ts +0 -2
- package/lib/components/webchat-overlay/base/confirm-modal/confirm-modal.d.ts +0 -8
- package/lib/components/webchat-overlay/base/confirm-modal/index.d.ts +0 -2
- package/webchat-app-I5AArwfY.js +0 -4122
- /package/lib/components/shared/{button-component → quick-reply}/external-link-icon.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 2.29.0 (2026-05-12)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **botonic:** v2 refinements - update skills, serve-bot defaults, staging bot warning ([#888](https://github.com/metis-ai/hubtype-product/pull/888))
|
|
6
|
+
- rating component ([#882](https://github.com/metis-ai/hubtype-product/pull/882))
|
|
7
|
+
|
|
8
|
+
### ❤️ Thank You
|
|
9
|
+
|
|
10
|
+
- David Hidalgo @Davidhidalgo
|
|
11
|
+
- Marc Rabat @vanbasten17
|
|
12
|
+
|
|
1
13
|
## 2.28.0 (2026-05-06)
|
|
2
14
|
|
|
3
15
|
### 🚀 Features
|
package/index.d.ts
CHANGED
|
@@ -51,15 +51,18 @@ export { useWebchatContainer } from './lib/components/webchat-container/use-webc
|
|
|
51
51
|
export { useWebchatHeader } from './lib/components/webchat-header/use-webchat-header';
|
|
52
52
|
export { useWebchatInput } from './lib/components/webchat-input/use-webchat-input';
|
|
53
53
|
export { useWebchatMessages } from './lib/components/webchat-messages/use-webchat-messages';
|
|
54
|
-
export {
|
|
54
|
+
export { useUpdateCustomMessageProps } from './lib/hooks/use-update-custom-message-props';
|
|
55
|
+
export { useWebchatState, type WebchatCustomMessageComponents, type WebchatStateProps, } from './lib/hooks/use-webchat-state';
|
|
56
|
+
export { WEBCHAT_OUTPUT_RENDERERS } from './lib/hooks/webchat-output-renderers';
|
|
55
57
|
export { DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG, getMessageActorCount, mergeWebchatHeroHeaderLayoutConfig, useWebchatHeroHeaderLayout, type UseWebchatHeroHeaderLayoutParams, type WebchatHeroHeaderLayoutConfig, type WebchatHeroHeaderLayoutResult, } from './lib/hero-header-layout';
|
|
56
58
|
export { Message, type MessageProps } from './lib/components/message/message';
|
|
57
59
|
export { MessageBubble, type MessageBubbleProps, } from './lib/components/message/message/message-bubble';
|
|
60
|
+
export { RatingMessage, type RatingMessageProps, } from './lib/components/message/rating-message';
|
|
58
61
|
export { TypingIndicator } from './lib/components/message/typing-message';
|
|
59
62
|
export { MessageMachineRenderer } from './lib/components/message-machine-renderer/message-machine-renderer';
|
|
60
63
|
export { Backdrop, Dialog, type DialogAction, DialogContext, type DialogControls, type DialogOpenProps, DialogProvider, type DialogState, type DialogVariant, useDialog, } from './lib/components/dialog';
|
|
61
|
-
export { type CoverComponentRegistry, Overlay,
|
|
62
|
-
export {
|
|
64
|
+
export { type CoverComponentRegistry, Overlay, 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';
|
|
65
|
+
export { QuickReply, type QuickReplyProps } from './lib/components/shared';
|
|
63
66
|
export * from './lib/types/primitives';
|
|
64
67
|
export * from './lib/types/webchat-props';
|
|
65
68
|
export type { WebchatConfig, WebchatController, WebchatEmittedEvent, } from '@botonic/webchat-core';
|
package/index.js
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
|
-
import { B as s,
|
|
2
|
-
import { Badge as J, Banner as K, Button as
|
|
1
|
+
import { B as s, C as t, D as o, a as r, b as n, c as u, d as i, e as c, f as l, g, M as d, h, i as p, j as W, O as b, k as C, l as M, m as v, n as y, o as O, Q as T, R as D, T as H, W as m, p as R, q as S, r as x, s as B, t as E, u as I, v as A, w, x as _, y as F, z as L, A as U, E as f, F as k, G as P, H as G, I as N, J as Q, K as j, L as q } from "./webchat-app-C3YH_yqx.js";
|
|
2
|
+
import { Badge as J, Banner as K, Button as Y, Checkbox as V, Multiselect as X, MultiselectWithSections as Z, Select as $, SelectWithSections as ee, Slider as ae, Spinner as se, Switch as te, Tag as oe, TextArea as re, TextInput as ne, Tooltip as ue } from "@lilara/ui-web-react";
|
|
3
3
|
export {
|
|
4
4
|
s as Backdrop,
|
|
5
5
|
J as Badge,
|
|
6
6
|
K as Banner,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
o as
|
|
11
|
-
r as
|
|
12
|
-
n as
|
|
13
|
-
u as
|
|
14
|
-
i as
|
|
15
|
-
c as
|
|
16
|
-
l as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
W as
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
C as
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
y as
|
|
29
|
-
O as
|
|
30
|
-
|
|
31
|
-
D as
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
Y as Button,
|
|
8
|
+
V as Checkbox,
|
|
9
|
+
t as CloseButton,
|
|
10
|
+
o as DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG,
|
|
11
|
+
r as Dialog,
|
|
12
|
+
n as DialogContext,
|
|
13
|
+
u as DialogProvider,
|
|
14
|
+
i as DropdownMenuItemDownloadTranscript,
|
|
15
|
+
c as DropdownMenuItemResetConversation,
|
|
16
|
+
l as DropdownMenuItemResetSession,
|
|
17
|
+
g as DropdownMenuItemSounds,
|
|
18
|
+
d as MenuTriggerButton,
|
|
19
|
+
h as Message,
|
|
20
|
+
p as MessageBubble,
|
|
21
|
+
W as MessageMachineRenderer,
|
|
22
|
+
X as Multiselect,
|
|
23
|
+
Z as MultiselectWithSections,
|
|
24
|
+
b as Overlay,
|
|
25
|
+
C as OverlayContent,
|
|
26
|
+
M as OverlayContext,
|
|
27
|
+
v as OverlayCoverFrame,
|
|
28
|
+
y as OverlayHeader,
|
|
29
|
+
O as OverlayWebviewFrame,
|
|
30
|
+
T as QuickReply,
|
|
31
|
+
D as RatingMessage,
|
|
32
|
+
$ as Select,
|
|
33
|
+
ee as SelectWithSections,
|
|
34
|
+
ae as Slider,
|
|
35
|
+
se as Spinner,
|
|
36
|
+
te as Switch,
|
|
37
|
+
oe as Tag,
|
|
38
|
+
re as TextArea,
|
|
39
|
+
ne as TextInput,
|
|
40
|
+
ue as Tooltip,
|
|
41
41
|
H as TypingIndicator,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
m as WEBCHAT_OUTPUT_RENDERERS,
|
|
43
|
+
R as WebchatApp,
|
|
44
|
+
S as WebchatContainer,
|
|
45
|
+
x as WebchatHeader,
|
|
46
|
+
B as WebchatInput,
|
|
47
|
+
E as WebchatMessages,
|
|
48
|
+
I as WebchatProvider,
|
|
48
49
|
A as getMessageActorCount,
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
w as mergeWebchatHeroHeaderLayoutConfig,
|
|
51
|
+
_ as useDialog,
|
|
51
52
|
F as useOverlay,
|
|
52
53
|
L as useOverlayContext,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
k as
|
|
54
|
+
U as useOverlayHeader,
|
|
55
|
+
f as useUpdateCustomMessageProps,
|
|
56
|
+
k as useWebchatContainer,
|
|
57
|
+
P as useWebchatContext,
|
|
56
58
|
G as useWebchatHeader,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
N as useWebchatHeroHeaderLayout,
|
|
60
|
+
Q as useWebchatInput,
|
|
59
61
|
j as useWebchatMessages,
|
|
60
62
|
q as useWebchatState
|
|
61
63
|
};
|
|
@@ -29,6 +29,7 @@ export { type CarouselElement, CarouselMessage, type CarouselMessageProps, } fro
|
|
|
29
29
|
export { DocumentMessage, type DocumentMessageProps } from './document-message';
|
|
30
30
|
export { ImageMessage, type ImageMessageProps } from './image-message';
|
|
31
31
|
export { LocationMessage, type LocationMessageProps } from './location-message';
|
|
32
|
+
export { RatingMessage, type RatingMessageProps } from './rating-message';
|
|
32
33
|
export { TextMessage, type TextMessageProps } from './text-message';
|
|
33
34
|
export { TypingIndicator, type TypingIndicatorProps } from './typing-message';
|
|
34
35
|
export { VideoMessage, type VideoMessageProps } from './video-message';
|
|
@@ -17,6 +17,8 @@ export interface MessageProps {
|
|
|
17
17
|
senderName?: string;
|
|
18
18
|
/** A class name to apply to the message. */
|
|
19
19
|
className?: string;
|
|
20
|
+
/** Class name merged onto the inner {@link MessageBubble} (e.g. rating card overrides). */
|
|
21
|
+
bubbleClassName?: string;
|
|
20
22
|
/** The content to render inside the message bubble. */
|
|
21
23
|
children: React.ReactNode;
|
|
22
24
|
/** Hide the footer when the next message belongs to the same group. */
|
|
@@ -19,6 +19,8 @@ export interface UseMessageProps {
|
|
|
19
19
|
senderName?: string;
|
|
20
20
|
/** A class name to apply to the message. */
|
|
21
21
|
className?: string;
|
|
22
|
+
/** Class name merged onto {@link MessageBubble}. */
|
|
23
|
+
bubbleClassName?: string;
|
|
22
24
|
/** The content to render inside the bubble. */
|
|
23
25
|
children: React.ReactNode;
|
|
24
26
|
/** Hide the footer when this message is grouped with the next. */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FaceAngrySvg } from './face-angry';
|
|
2
|
+
export { FaceFrownSvg } from './face-frown';
|
|
3
|
+
export { FaceGrinBeamSvg } from './face-grin-beam';
|
|
4
|
+
export { FaceMehSvg } from './face-meh';
|
|
5
|
+
export { FaceSmileSvg } from './face-smile';
|
|
6
|
+
export type { RatingIconProps } from './rating-icon-types';
|
|
7
|
+
export { StarSvg } from './star';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RatingMessage, type RatingMessageProps } from './rating-message';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WebchatOutputRatingProps } from '@botonic/shared';
|
|
2
|
+
export interface RatingMessageProps extends WebchatOutputRatingProps {
|
|
3
|
+
messageId?: string;
|
|
4
|
+
messageProps?: Record<string, unknown>;
|
|
5
|
+
/** Persisted state — populated from message.data.props after interaction */
|
|
6
|
+
selected?: number;
|
|
7
|
+
comment?: string;
|
|
8
|
+
submitted?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseRatingMessageReturn {
|
|
11
|
+
state: {
|
|
12
|
+
selected: number | undefined;
|
|
13
|
+
hovered: number | undefined;
|
|
14
|
+
comment: string;
|
|
15
|
+
submitted: boolean;
|
|
16
|
+
isSubmitting: boolean;
|
|
17
|
+
};
|
|
18
|
+
handlers: {
|
|
19
|
+
handleSelect: (value: number) => void;
|
|
20
|
+
handleHover: (value: number | undefined) => void;
|
|
21
|
+
handleCommentChange: (value: string) => void;
|
|
22
|
+
handleSubmit: () => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
resolved: {
|
|
25
|
+
messageText: string;
|
|
26
|
+
buttonText: string;
|
|
27
|
+
messageProps: Record<string, unknown>;
|
|
28
|
+
ratingType: 'stars' | 'smileys';
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export declare function useRatingMessage(props: RatingMessageProps): UseRatingMessageReturn;
|
|
@@ -8,7 +8,7 @@ export interface MessageMachineRendererProps {
|
|
|
8
8
|
/** The XState message machine actor */
|
|
9
9
|
messageActor: ActorRefFrom<typeof WebchatMessageMachine>;
|
|
10
10
|
/** Custom renderer for custom message types */
|
|
11
|
-
customMessageRenderer?: (message: unknown, messageData: unknown, onButtonClick: (button: BotonicButtonContent) => void) => React.ReactNode;
|
|
11
|
+
customMessageRenderer?: (message: unknown, messageData: unknown, onButtonClick: (button: BotonicButtonContent) => void, messageProps: Partial<MessageProps>) => React.ReactNode;
|
|
12
12
|
/** Additional props to pass to all message components */
|
|
13
13
|
baseProps?: Partial<MessageProps> & {
|
|
14
14
|
avatarConfig?: AvatarConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export {
|
|
1
|
+
export type { QuickReplyProps } from './quick-reply';
|
|
2
|
+
export { QuickReply } from './quick-reply';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BotonicButtonContent } from '@botonic/shared';
|
|
2
|
-
export interface
|
|
2
|
+
export interface QuickReplyProps {
|
|
3
3
|
/** The button text. */
|
|
4
4
|
text: string;
|
|
5
5
|
/** Whether the button is disabled. */
|
|
@@ -19,6 +19,6 @@ export interface ButtonComponentProps {
|
|
|
19
19
|
/** Button variant - 'primary' for carousel-style, 'secondary' for button-message-style. */
|
|
20
20
|
variant?: 'primary' | 'secondary';
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
export declare const
|
|
24
|
-
export default
|
|
22
|
+
/** Chat message button for quick replies and carousel CTAs. */
|
|
23
|
+
export declare const QuickReply: import('react').ForwardRefExoticComponent<QuickReplyProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
export default QuickReply;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { WebchatController } from '@botonic/webchat-core';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
2
|
import { WebchatHeroHeaderLayoutConfig } from '../../hero-header-layout';
|
|
4
3
|
import { WebchatStateProps } from '../../hooks/use-webchat-state';
|
|
5
4
|
import { WebchatInputIcons } from '../../types/webchat-props';
|
|
6
5
|
import { CoverComponentRegistry } from '../webchat-overlay';
|
|
7
|
-
export interface WebchatAppProps extends
|
|
6
|
+
export interface WebchatAppProps extends WebchatStateProps {
|
|
8
7
|
/** Whether the webchat is open */
|
|
9
8
|
isOpen: boolean;
|
|
10
9
|
/** Callback when the webchat is closed */
|
|
@@ -22,8 +21,6 @@ export interface WebchatAppProps extends Omit<WebchatStateProps, 'customMessages
|
|
|
22
21
|
* Can also be set via WebchatTrigger `webchatConfig.showBranding`. Default: true.
|
|
23
22
|
*/
|
|
24
23
|
showBranding?: boolean;
|
|
25
|
-
/** Custom messages registry */
|
|
26
|
-
customMessages?: Record<string, ComponentType<any>>;
|
|
27
24
|
/** Cover components registry */
|
|
28
25
|
coverRegistry?: CoverComponentRegistry;
|
|
29
26
|
/** Override default icons for the input action bar. */
|
|
@@ -25,12 +25,15 @@ export declare function useWebchatMessages(props: WebchatMessagesProps, state: W
|
|
|
25
25
|
id: string;
|
|
26
26
|
data: Record<string, string>;
|
|
27
27
|
};
|
|
28
|
+
} | {
|
|
29
|
+
type: "UPDATE_CUSTOM_PROPS";
|
|
30
|
+
props: Record<string, unknown>;
|
|
28
31
|
} | {
|
|
29
32
|
type: "BUTTON_CLICKED";
|
|
30
33
|
button: import('@botonic/shared').BotonicButtonContent;
|
|
31
34
|
}, {
|
|
32
35
|
[x: string]: import('xstate').ActorRefFromLogic<import('@botonic/webchat-core').PostMessageActor> | undefined;
|
|
33
|
-
}, "
|
|
36
|
+
}, "sending" | "idle" | "checkStatus" | "errorSendingMessage" | "performingPostback", string, import('xstate').NonReducibleUnknown, import('xstate').MetaObject, {
|
|
34
37
|
states: {
|
|
35
38
|
readonly checkStatus: {};
|
|
36
39
|
readonly sending: {};
|
|
@@ -46,6 +49,9 @@ export declare function useWebchatMessages(props: WebchatMessagesProps, state: W
|
|
|
46
49
|
id: string;
|
|
47
50
|
data: Record<string, string>;
|
|
48
51
|
};
|
|
52
|
+
} | {
|
|
53
|
+
type: "UPDATE_CUSTOM_PROPS";
|
|
54
|
+
props: Record<string, unknown>;
|
|
49
55
|
} | {
|
|
50
56
|
type: "BUTTON_CLICKED";
|
|
51
57
|
button: import('@botonic/shared').BotonicButtonContent;
|
|
@@ -2,4 +2,3 @@ export { Overlay, type OverlayProps, useOverlay } from './overlay';
|
|
|
2
2
|
export { type CoverComponentRegistry, OverlayContext, type OverlayContextValue, useOverlayContext, } from './overlay-context';
|
|
3
3
|
export { OverlayHeader, type OverlayHeaderProps, useOverlayHeader, } from './header';
|
|
4
4
|
export { OverlayContent, type OverlayContentProps } from './content';
|
|
5
|
-
export { OverlayConfirmModal, type OverlayConfirmModalProps, } from './confirm-modal';
|
|
@@ -11,11 +11,7 @@ export interface OverlayHandlers {
|
|
|
11
11
|
export interface UseOverlayResult {
|
|
12
12
|
isLoading: boolean;
|
|
13
13
|
setIsLoading: (loading: boolean) => void;
|
|
14
|
-
showConfirmModal: boolean;
|
|
15
|
-
setShowConfirmModal: (show: boolean) => void;
|
|
16
14
|
attemptClose: () => void;
|
|
17
|
-
handleConfirmClose: () => void;
|
|
18
|
-
handleCancelClose: () => void;
|
|
19
15
|
variants: {
|
|
20
16
|
isLoading: boolean;
|
|
21
17
|
};
|
|
@@ -17,8 +17,6 @@ export interface OverlayContextValue {
|
|
|
17
17
|
isLoading: boolean;
|
|
18
18
|
setIsLoading: (loading: boolean) => void;
|
|
19
19
|
attemptClose: () => void;
|
|
20
|
-
showConfirmModal: boolean;
|
|
21
|
-
setShowConfirmModal: (show: boolean) => void;
|
|
22
20
|
coverRegistry?: CoverComponentRegistry;
|
|
23
21
|
}
|
|
24
22
|
export declare const OverlayContext: import('react').Context<OverlayContextValue | null>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { type CoverComponentRegistry, Overlay,
|
|
1
|
+
export { type CoverComponentRegistry, Overlay, OverlayContent, type OverlayContentProps, OverlayContext, type OverlayContextValue, OverlayHeader, type OverlayHeaderProps, type OverlayProps, useOverlay, useOverlayContext, useOverlayHeader, } from './base';
|
|
2
2
|
export { OverlayCoverFrame, type OverlayCoverFrameProps } from './cover';
|
|
3
3
|
export { OverlayWebviewFrame, type OverlayWebviewFrameProps } from './webview';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUpdateCustomMessageProps(messageId: string | undefined): (props: Record<string, unknown>) => void;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { WebchatClientSettings } from '@botonic/shared';
|
|
2
2
|
import { OverlayState, WebchatConfig, WebchatController, WebchatMessageMachine } from '@botonic/webchat-core';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
3
4
|
import { ActorRefFrom } from 'xstate';
|
|
4
5
|
import { AvatarConfig } from '../components/message-machine-renderer/use-avatar';
|
|
5
6
|
import { WebchatClientSettingsBehaviors } from './webchat-client-settings-behaviors';
|
|
7
|
+
/** Embedder registry merged with `WEBCHAT_OUTPUT_RENDERERS` (rating UI, …). */
|
|
8
|
+
export type WebchatCustomMessageComponents = Record<string, ComponentType<Record<string, unknown>>>;
|
|
6
9
|
export type WebchatStateProps = WebchatConfig & {
|
|
7
10
|
avatarConfig?: AvatarConfig;
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Extra or replacement custom message components. Framework defaults from
|
|
13
|
+
* {@link WEBCHAT_OUTPUT_RENDERERS} are applied first; matching keys here override.
|
|
14
|
+
*/
|
|
15
|
+
customMessages?: WebchatCustomMessageComponents;
|
|
9
16
|
};
|
|
10
17
|
export interface WebchatState {
|
|
11
18
|
controller: WebchatController;
|
|
@@ -23,6 +30,7 @@ export interface WebchatState {
|
|
|
23
30
|
avatarConfig?: AvatarConfig;
|
|
24
31
|
/** Mirrors `WebchatConfig.enableResponsiveHeroHeader`; default true. */
|
|
25
32
|
enableResponsiveHeroHeader: boolean;
|
|
26
|
-
customMessages
|
|
33
|
+
/** Merged `WEBCHAT_OUTPUT_RENDERERS` + embedder `customMessages`. */
|
|
34
|
+
customMessages: WebchatCustomMessageComponents;
|
|
27
35
|
}
|
|
28
36
|
export declare function useWebchatState(stateProps: WebchatStateProps): WebchatState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Default webchat output renderers merged ahead of embedder `customMessages`.
|
|
4
|
+
* Embedder keys override when they use the same message name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const WEBCHAT_OUTPUT_RENDERERS: Record<string, ComponentType<Record<string, unknown>>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/webchat-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^18.0.0",
|
|
28
28
|
"react-dom": "^18.0.0",
|
|
29
|
-
"@botonic/webchat-core": "2.
|
|
30
|
-
"@botonic/shared": "2.
|
|
31
|
-
"@lilara/ui-web-react": ">=0.
|
|
29
|
+
"@botonic/webchat-core": "2.29.0",
|
|
30
|
+
"@botonic/shared": "2.29.0",
|
|
31
|
+
"@lilara/ui-web-react": ">=0.8.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|