@botonic/webchat-react 2.27.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/CLAUDE.md +9 -5
  3. package/index.d.ts +6 -3
  4. package/index.js +51 -49
  5. package/lib/components/message/index.d.ts +1 -0
  6. package/lib/components/message/message/message-bubble/message-bubble.d.ts +4 -0
  7. package/lib/components/message/message/message.d.ts +10 -0
  8. package/lib/components/message/message/use-message.d.ts +10 -0
  9. package/lib/components/message/rating-message/icons/face-angry.d.ts +2 -0
  10. package/lib/components/message/rating-message/icons/face-frown.d.ts +2 -0
  11. package/lib/components/message/rating-message/icons/face-grin-beam.d.ts +2 -0
  12. package/lib/components/message/rating-message/icons/face-meh.d.ts +2 -0
  13. package/lib/components/message/rating-message/icons/face-smile.d.ts +2 -0
  14. package/lib/components/message/rating-message/icons/index.d.ts +7 -0
  15. package/lib/components/message/rating-message/icons/rating-icon-types.d.ts +5 -0
  16. package/lib/components/message/rating-message/icons/star.d.ts +2 -0
  17. package/lib/components/message/rating-message/index.d.ts +1 -0
  18. package/lib/components/message/rating-message/rating-message.d.ts +4 -0
  19. package/lib/components/message/rating-message/use-rating-message.d.ts +31 -0
  20. package/lib/components/message-machine-renderer/message-machine-renderer.d.ts +1 -1
  21. package/lib/components/message-machine-renderer/use-message-machine-renderer.d.ts +2 -2
  22. package/lib/components/shared/index.d.ts +2 -2
  23. package/lib/components/shared/quick-reply/index.d.ts +2 -0
  24. package/lib/components/shared/{button-component/button-component.d.ts → quick-reply/quick-reply.d.ts} +4 -4
  25. package/lib/components/webchat-app/webchat-app.d.ts +1 -4
  26. package/lib/components/webchat-messages/use-webchat-messages.d.ts +8 -2
  27. package/lib/components/webchat-overlay/base/index.d.ts +0 -1
  28. package/lib/components/webchat-overlay/base/overlay/use-overlay.d.ts +0 -4
  29. package/lib/components/webchat-overlay/base/overlay-context.d.ts +0 -2
  30. package/lib/components/webchat-overlay/index.d.ts +1 -1
  31. package/lib/hooks/use-update-custom-message-props.d.ts +1 -0
  32. package/lib/hooks/use-webchat-state.d.ts +10 -2
  33. package/lib/hooks/webchat-output-renderers.d.ts +6 -0
  34. package/package.json +4 -4
  35. package/styles.css +105 -55
  36. package/trigger.js +1 -1
  37. package/webchat-app-C3YH_yqx.js +4293 -0
  38. package/lib/components/shared/button-component/index.d.ts +0 -2
  39. package/lib/components/webchat-overlay/base/confirm-modal/confirm-modal.d.ts +0 -8
  40. package/lib/components/webchat-overlay/base/confirm-modal/index.d.ts +0 -2
  41. package/webchat-app-DSDMjE-m.js +0 -4051
  42. /package/lib/components/shared/{button-component → quick-reply}/external-link-icon.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
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
+
13
+ ## 2.28.0 (2026-05-06)
14
+
15
+ ### 🚀 Features
16
+
17
+ - **webchat:** message grouping, responsive layout, and token refinements (BLT-2359) ([#880](https://github.com/metis-ai/hubtype-product/pull/880))
18
+ - **lilara:** semantic token layer — primary/secondary scales, text/surface/radius tokens, component CSS migration ([#879](https://github.com/metis-ai/hubtype-product/pull/879))
19
+ - **foundations:** semantic token layer — PR 1 foundations (BLT-2358) ([#874](https://github.com/metis-ai/hubtype-product/pull/874))
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - David Hidalgo @Davidhidalgo
24
+
1
25
  ## 2.27.0 (2026-04-29)
2
26
 
3
27
  ### 🚀 Features
package/CLAUDE.md CHANGED
@@ -71,8 +71,8 @@ The cascade stack, from lowest to highest priority:
71
71
  /* webchat-tokens.css */
72
72
  @layer overrides {
73
73
  :root {
74
- --webchat-input-bg: var(--color-neutral-white);
75
- --webchat-send-button-color: var(--color-primary-500);
74
+ --webchat-input-bg: var(--surface-foreground);
75
+ --webchat-send-button-color: var(--primary-500);
76
76
  }
77
77
  }
78
78
  ```
@@ -83,13 +83,17 @@ The cascade stack, from lowest to highest priority:
83
83
 
84
84
  Every value a consumer might want to customize must be a `--webchat-*` token defined in `webchat-tokens.css`.
85
85
 
86
- Pattern: `--webchat-{component}-{property}` with fallback to a foundations token:
86
+ Pattern: `--webchat-{component}-{property}` with fallback to a semantic foundations token:
87
87
 
88
88
  ```css
89
- --webchat-input-bg: var(--color-neutral-white);
90
- --webchat-bubble-bot-bg: var(--color-neutral-100);
89
+ --webchat-input-bg: var(--surface-foreground);
90
+ --webchat-send-button-color: var(--primary-500);
91
+ --webchat-bubble-bot-bg: var(--primary-50);
91
92
  ```
92
93
 
94
+ Prefer `--primary-*` / `--secondary-*` over raw `--color-purple-*` / `--color-aqua-*`.
95
+ Prefer `--color-focus` over `--secondary-600` directly.
96
+
93
97
  ## Message Components
94
98
 
95
99
  ```
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 { useWebchatState } from './lib/hooks/use-webchat-state';
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, 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';
62
- export { ButtonComponent, type ButtonComponentProps, } from './lib/components/shared';
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, 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";
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
- 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,
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
- T as WebchatApp,
43
- x as WebchatContainer,
44
- B as WebchatHeader,
45
- I as WebchatInput,
46
- S as WebchatMessages,
47
- w as WebchatProvider,
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
- E as mergeWebchatHeroHeaderLayoutConfig,
50
- f as useDialog,
50
+ w as mergeWebchatHeroHeaderLayoutConfig,
51
+ _ as useDialog,
51
52
  F as useOverlay,
52
53
  L as useOverlayContext,
53
- R as useOverlayHeader,
54
- _ as useWebchatContainer,
55
- k as useWebchatContext,
54
+ U as useOverlayHeader,
55
+ f as useUpdateCustomMessageProps,
56
+ k as useWebchatContainer,
57
+ P as useWebchatContext,
56
58
  G as useWebchatHeader,
57
- P as useWebchatHeroHeaderLayout,
58
- U as useWebchatInput,
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';
@@ -4,6 +4,10 @@ export interface MessageBubbleProps {
4
4
  variant?: 'user' | 'bot' | 'system' | 'agent';
5
5
  /** The status of the message. */
6
6
  status?: 'sending' | 'sent' | 'error';
7
+ /** Flatten the near-side top corner (continuation of a group). */
8
+ flatTopCorner?: boolean;
9
+ /** Flatten the near-side bottom corner (more messages follow in the group). */
10
+ flatBottomCorner?: boolean;
7
11
  /** A class name to apply to the bubble. */
8
12
  className?: string;
9
13
  /** The content to render inside the bubble. */
@@ -17,8 +17,18 @@ 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;
24
+ /** Hide the footer when the next message belongs to the same group. */
25
+ hideFooter?: boolean;
26
+ /** Whether this message continues a group started by the previous message. */
27
+ isContinuation?: boolean;
28
+ /** Expand the bubble to the full max-width (e.g. carousel, media). */
29
+ isFullWidth?: boolean;
30
+ /** Bot interaction ID, rendered as a data attribute for grouping. */
31
+ botInteractionId?: string;
22
32
  }
23
33
  /** Message component with common functionality for all message types. */
24
34
  export declare const Message: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
@@ -19,8 +19,18 @@ 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;
26
+ /** Hide the footer when this message is grouped with the next. */
27
+ hideFooter?: boolean;
28
+ /** Whether this message continues a group started by the previous message. */
29
+ isContinuation?: boolean;
30
+ /** Whether this message has action buttons below the bubble. */
31
+ hasActions?: boolean;
32
+ /** Expand the bubble to the full max-width (e.g. carousel, media). */
33
+ isFullWidth?: boolean;
24
34
  /** Additional props to pass through. */
25
35
  [key: string]: any;
26
36
  }
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceAngrySvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceFrownSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceGrinBeamSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceMehSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceSmileSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,5 @@
1
+ /** Mirrors hubtype/botonic `RatingIconProps` (packages/botonic-react rating icons). */
2
+ export interface RatingIconProps {
3
+ color: string;
4
+ selected?: boolean;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const StarSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { RatingMessage, type RatingMessageProps } from './rating-message';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { RatingMessageProps } from './use-rating-message';
3
+ export type { RatingMessageProps };
4
+ export declare const RatingMessage: React.FC<RatingMessageProps>;
@@ -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,5 +1,5 @@
1
- import { BotonicButtonContent, WebchatMessage } from '@botonic/shared';
2
- import { WebchatMessageMachine } from '@botonic/webchat-core';
1
+ import { BotonicButtonContent } from '@botonic/shared';
2
+ import { WebchatMessage, WebchatMessageMachine } from '@botonic/webchat-core';
3
3
  import { ActorRefFrom } from 'xstate';
4
4
  import { AvatarConfigResult } from './use-avatar';
5
5
  export interface MessageMachineData {
@@ -1,2 +1,2 @@
1
- export type { ButtonComponentProps } from './button-component';
2
- export { ButtonComponent } from './button-component';
1
+ export type { QuickReplyProps } from './quick-reply';
2
+ export { QuickReply } from './quick-reply';
@@ -0,0 +1,2 @@
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 ButtonComponentProps {
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
- /** Shared button component for use in button messages and carousel messages. */
23
- export declare const ButtonComponent: import('react').ForwardRefExoticComponent<ButtonComponentProps & import('react').RefAttributes<HTMLButtonElement>>;
24
- export default ButtonComponent;
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 Omit<WebchatStateProps, 'customMessages'> {
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. */
@@ -12,7 +12,7 @@ export declare function useWebchatMessages(props: WebchatMessagesProps, state: W
12
12
  };
13
13
  messageListProps: {
14
14
  messageActors: import('xstate').ActorRef<import('xstate').MachineSnapshot<{
15
- message: import('@botonic/shared').WebchatMessage;
15
+ message: import('@botonic/webchat-core').WebchatMessage;
16
16
  user: import('@botonic/shared').HubtypeUser;
17
17
  status: import('@botonic/webchat-core').WebchatMessageStatus;
18
18
  file?: File;
@@ -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
- }, "checkStatus" | "sending" | "idle" | "errorSendingMessage" | "performingPostback", string, import('xstate').NonReducibleUnknown, import('xstate').MetaObject, {
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, OverlayConfirmModal, type OverlayConfirmModalProps, OverlayContent, type OverlayContentProps, OverlayContext, type OverlayContextValue, OverlayHeader, type OverlayHeaderProps, type OverlayProps, useOverlay, useOverlayContext, useOverlayHeader, } from './base';
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
- customMessages: any;
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: any;
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.27.0",
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.27.0",
30
- "@botonic/shared": "2.27.0",
31
- "@lilara/ui-web-react": ">=0.6.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"