@botonic/webchat-react 2.37.0 → 2.38.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 (110) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/embedded-config-CmlPSd0n.js +17 -0
  3. package/embedded.d.ts +2 -0
  4. package/embedded.js +28 -0
  5. package/index.d.ts +10 -1
  6. package/index.js +103 -64
  7. package/lib/components/debug-event/debug-event-wrapper.d.ts +40 -0
  8. package/lib/components/debug-event/index.d.ts +4 -0
  9. package/lib/components/{preview-events/preview-event-message → debug-event}/preview-event-message.d.ts +2 -2
  10. package/lib/components/debug-event/use-preview-event-message.d.ts +31 -0
  11. package/lib/components/dialog/dialog-types.d.ts +4 -1
  12. package/lib/components/image-previewer/image-previewer-portal.d.ts +8 -0
  13. package/lib/components/image-previewer/image-previewer.d.ts +6 -0
  14. package/lib/components/image-previewer/index.d.ts +3 -0
  15. package/lib/components/message/image-message/use-image-preview.d.ts +17 -0
  16. package/lib/components/message/index.d.ts +1 -0
  17. package/lib/components/message/message/message-info/message-info.d.ts +2 -0
  18. package/lib/components/message/message/message.d.ts +1 -0
  19. package/lib/components/message/message/use-message.d.ts +1 -0
  20. package/lib/components/message/whatsapp-request-contact-info/index.d.ts +1 -0
  21. package/lib/components/message/whatsapp-request-contact-info/whatsapp-request-contact-info-message.d.ts +10 -0
  22. package/lib/components/message-machine-renderer/use-message-machine-renderer.d.ts +1 -0
  23. package/lib/components/preview-events/events/index.d.ts +0 -14
  24. package/lib/components/preview-events/events/types.d.ts +9 -12
  25. package/lib/components/webchat-app/webchat-app.d.ts +3 -1
  26. package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-download-transcript.d.ts +6 -2
  27. package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-reset-conversation.d.ts +2 -1
  28. package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-reset-session.d.ts +5 -2
  29. package/lib/components/webchat-header/webchat-menu/dropdown-menu-item-sounds.d.ts +3 -2
  30. package/lib/components/webchat-header/webchat-menu/use-dropdown-menu-item-download-transcript.d.ts +25 -0
  31. package/lib/components/webchat-header/webchat-menu/use-dropdown-menu-item-reset-conversation.d.ts +10 -0
  32. package/lib/components/webchat-header/webchat-menu/use-dropdown-menu-item-reset-session.d.ts +9 -2
  33. package/lib/components/webchat-header/webchat-menu/use-dropdown-menu-item-sounds.d.ts +6 -0
  34. package/lib/components/webchat-input/emoji-picker/index.d.ts +3 -0
  35. package/lib/components/webchat-input/emoji-picker/use-webchat-emoji-picker.d.ts +16 -0
  36. package/lib/components/webchat-input/emoji-picker/webchat-emoji-picker-panel.d.ts +6 -0
  37. package/lib/components/webchat-input/emoji-picker/webchat-emoji-picker-trigger-button.d.ts +8 -0
  38. package/lib/components/webchat-input/use-webchat-input.d.ts +8 -1
  39. package/lib/components/webchat-provider/webchat-context.d.ts +8 -1
  40. package/lib/components/webchat-trigger/read-css-duration-ms.d.ts +4 -0
  41. package/lib/components/webchat-trigger/use-trigger-hover-expand.d.ts +19 -0
  42. package/lib/components/webchat-trigger/use-trigger-preview-channels.d.ts +18 -0
  43. package/lib/components/webchat-trigger/use-trigger-proactive-popup.d.ts +13 -0
  44. package/lib/components/webchat-trigger/use-webchat-trigger.d.ts +15 -1
  45. package/lib/components/webchat-trigger/webchat-trigger-channels-panel.d.ts +10 -0
  46. package/lib/domain/supported-trigger-channels.d.ts +16 -0
  47. package/lib/embedded/embedded-config.d.ts +17 -0
  48. package/lib/embedded/embedded-container.d.ts +7 -0
  49. package/lib/embedded/mount-embedded-webchat.d.ts +5 -0
  50. package/lib/hooks/use-embed-trigger-state.d.ts +6 -0
  51. package/lib/hooks/use-webchat-download-transcript.d.ts +5 -0
  52. package/lib/hooks/use-webchat-reset-conversation.d.ts +6 -0
  53. package/lib/hooks/use-webchat-reset-session.d.ts +3 -0
  54. package/lib/hooks/use-webchat-tracking.d.ts +7 -0
  55. package/lib/types/webchat-props.d.ts +61 -3
  56. package/package.json +10 -4
  57. package/styles.css +123 -87
  58. package/supported-trigger-channels-JiTUD-jK.js +9 -0
  59. package/trigger.d.ts +4 -1
  60. package/trigger.js +592 -215
  61. package/webchat-app-md1b0_ze.js +5072 -0
  62. package/lib/components/preview-events/events/ai-agent/ai-agent.d.ts +0 -3
  63. package/lib/components/preview-events/events/ai-agent/executed-tools.d.ts +0 -7
  64. package/lib/components/preview-events/events/ai-agent/index.d.ts +0 -1
  65. package/lib/components/preview-events/events/ai-agent/parse-tools.d.ts +0 -9
  66. package/lib/components/preview-events/events/ai-agent-router/ai-agent-router.d.ts +0 -3
  67. package/lib/components/preview-events/events/ai-agent-router/index.d.ts +0 -1
  68. package/lib/components/preview-events/events/bot-action.d.ts +0 -3
  69. package/lib/components/preview-events/events/components/guardrail-item.d.ts +0 -14
  70. package/lib/components/preview-events/events/components/index.d.ts +0 -2
  71. package/lib/components/preview-events/events/components/sources-section.d.ts +0 -11
  72. package/lib/components/preview-events/events/conditional-channel.d.ts +0 -3
  73. package/lib/components/preview-events/events/conditional-country.d.ts +0 -3
  74. package/lib/components/preview-events/events/conditional-custom.d.ts +0 -3
  75. package/lib/components/preview-events/events/conditional-queue-status.d.ts +0 -3
  76. package/lib/components/preview-events/events/constants.d.ts +0 -35
  77. package/lib/components/preview-events/events/fallback.d.ts +0 -3
  78. package/lib/components/preview-events/events/handoff-success.d.ts +0 -3
  79. package/lib/components/preview-events/events/keyword.d.ts +0 -3
  80. package/lib/components/preview-events/events/knowledge-base.d.ts +0 -3
  81. package/lib/components/preview-events/events/redirect-flow.d.ts +0 -3
  82. package/lib/components/preview-events/events/smart-intent.d.ts +0 -3
  83. package/lib/components/preview-events/events/webview-action-triggered.d.ts +0 -3
  84. package/lib/components/preview-events/hooks/use-knowledge-base-info.d.ts +0 -19
  85. package/lib/components/preview-events/hooks/use-last-label-position.d.ts +0 -9
  86. package/lib/components/preview-events/icons/ai-router-icon.d.ts +0 -1
  87. package/lib/components/preview-events/icons/ai-specialist-icon.d.ts +0 -1
  88. package/lib/components/preview-events/icons/arrow-progress-icon.d.ts +0 -1
  89. package/lib/components/preview-events/icons/brain-icon.d.ts +0 -1
  90. package/lib/components/preview-events/icons/caret-down-icon.d.ts +0 -1
  91. package/lib/components/preview-events/icons/caret-up-icon.d.ts +0 -1
  92. package/lib/components/preview-events/icons/circle-check-icon.d.ts +0 -1
  93. package/lib/components/preview-events/icons/code-icon.d.ts +0 -1
  94. package/lib/components/preview-events/icons/file-pdf-icon.d.ts +0 -1
  95. package/lib/components/preview-events/icons/file-word-icon.d.ts +0 -1
  96. package/lib/components/preview-events/icons/hand-icon.d.ts +0 -1
  97. package/lib/components/preview-events/icons/head-set-icon.d.ts +0 -1
  98. package/lib/components/preview-events/icons/index.d.ts +0 -19
  99. package/lib/components/preview-events/icons/life-ring-icon.d.ts +0 -1
  100. package/lib/components/preview-events/icons/link-icon.d.ts +0 -1
  101. package/lib/components/preview-events/icons/quote-right-icon.d.ts +0 -1
  102. package/lib/components/preview-events/icons/screwdriver-wrench-icon.d.ts +0 -1
  103. package/lib/components/preview-events/icons/split-icon.d.ts +0 -1
  104. package/lib/components/preview-events/icons/wand-icon.d.ts +0 -1
  105. package/lib/components/preview-events/icons/window-restore-icon.d.ts +0 -1
  106. package/lib/components/preview-events/index.d.ts +0 -3
  107. package/lib/components/preview-events/preview-event-message/index.d.ts +0 -1
  108. package/lib/components/preview-events/preview-event-message/use-preview-event-message.d.ts +0 -17
  109. package/lib/components/preview-events/preview-events-types.d.ts +0 -12
  110. package/webchat-app-BrBET32o.js +0 -5447
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../../preview-events-types';
2
- import { AiAgentDebugEvent } from '../types';
3
- export declare const getAiAgentEventConfig: (data: AiAgentDebugEvent) => DebugEventConfig;
@@ -1,7 +0,0 @@
1
- import { ToolExecuted } from '../types';
2
- interface Props {
3
- tools: ToolExecuted[];
4
- onSeeToolDetails: (tool: ToolExecuted) => void;
5
- }
6
- export declare const ExecutedTools: ({ tools, onSeeToolDetails }: Props) => import("react/jsx-runtime").JSX.Element | null;
7
- export {};
@@ -1 +0,0 @@
1
- export { getAiAgentEventConfig } from './ai-agent';
@@ -1,9 +0,0 @@
1
- import { ToolExecuted } from '../types';
2
- export declare const RETRIEVE_KNOWLEDGE_TOOL = "retrieve_knowledge";
3
- export declare function parseTools(tools: ToolExecuted[], excludeTransferTools?: boolean): {
4
- retrieveKnowledgeTools: ToolExecuted[];
5
- otherTools: ToolExecuted[];
6
- allSourcesIds: string[];
7
- allChunksIds: string[];
8
- query: string | undefined;
9
- };
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../../preview-events-types';
2
- import { AiAgentRouterDebugEvent } from '../types';
3
- export declare const getAiAgentRouterEventConfig: (data: AiAgentRouterDebugEvent) => DebugEventConfig;
@@ -1 +0,0 @@
1
- export { getAiAgentRouterEventConfig } from './ai-agent-router';
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { BotActionDebugEvent } from './types';
3
- export declare const getBotActionEventConfig: (data: BotActionDebugEvent) => DebugEventConfig;
@@ -1,14 +0,0 @@
1
- import { default as React } from 'react';
2
- interface GuardrailItemProps {
3
- guardrail: string;
4
- keyPrefix: string;
5
- isLastItem?: boolean;
6
- }
7
- export declare const GuardrailItem: React.FC<GuardrailItemProps>;
8
- interface GuardrailListProps {
9
- guardrails: string[];
10
- keyPrefix: string;
11
- isLastItem?: boolean;
12
- }
13
- export declare const GuardrailList: React.FC<GuardrailListProps>;
14
- export {};
@@ -1,2 +0,0 @@
1
- export { GuardrailItem, GuardrailList } from './guardrail-item';
2
- export { SourcesSection } from './sources-section';
@@ -1,11 +0,0 @@
1
- import { HubtypeChunk, HubtypeSource } from '@botonic/shared';
2
- import { default as React } from 'react';
3
- interface SourcesSectionProps {
4
- sources: HubtypeSource[];
5
- chunks: HubtypeChunk[];
6
- getIconForSourceType: (source: HubtypeSource) => React.ReactNode;
7
- onSeeChunks: () => void;
8
- label?: string;
9
- }
10
- export declare const SourcesSection: ({ sources, chunks, getIconForSourceType, onSeeChunks, label, }: SourcesSectionProps) => import("react/jsx-runtime").JSX.Element | null;
11
- export {};
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { ConditionalChannelDebugEvent } from './types';
3
- export declare const getConditionalChannelEventConfig: (data: ConditionalChannelDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { ConditionalCountryDebugEvent } from './types';
3
- export declare const getConditionalCountryEventConfig: (data: ConditionalCountryDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { ConditionalCustomDebugEvent } from './types';
3
- export declare const getConditionalCustomEventConfig: (data: ConditionalCustomDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { ConditionalQueueStatusDebugEvent } from './types';
3
- export declare const getConditionalQueueStatusEventConfig: (data: ConditionalQueueStatusDebugEvent) => DebugEventConfig;
@@ -1,35 +0,0 @@
1
- export declare const LABELS: {
2
- readonly GUARDRAIL_TRIGGERED: "Guardrail triggered";
3
- readonly KNOWLEDGE_FOUND: "Knowledge found";
4
- readonly FAITHFUL_ANSWER: "Faithful answer";
5
- readonly QUERY: "Query";
6
- readonly SOURCES: "Sources";
7
- readonly KNOWLEDGE_SOURCES: "Knowledge sources";
8
- readonly EXECUTED_TOOLS: "Executed tools";
9
- readonly TOOL_ARGUMENTS: "Tool arguments";
10
- readonly TOOL_RESULTS: "Tool results";
11
- readonly NO_TOOLS_EXECUTED: "No tools executed";
12
- readonly AUTO_ASSIGN_ON: "ON";
13
- readonly AUTO_ASSIGN_OFF: "OFF";
14
- readonly EXIT: "Exit";
15
- readonly ERROR: "Error";
16
- readonly QUEUE: "Queue";
17
- readonly AUTO_ASSIGN: "Auto-assign";
18
- readonly NOTE: "Note";
19
- readonly KNOWLEDGE_BASE_FAIL_REASON: "Knowledge Base Fail Reason";
20
- readonly SEE_CHUNKS_BUTTON: "See chunks";
21
- readonly SEE_TOOL_DETAILS: "Details";
22
- readonly STATUS: "Status";
23
- readonly YES: "Yes";
24
- readonly NO: "No";
25
- readonly OPEN: "Open";
26
- readonly CLOSED: "Closed";
27
- readonly AGENTS_AVAILABLE: "Agents available";
28
- readonly AVAILABLE_TRANSFERS: "Available transfers";
29
- readonly SPECIALISTS_AVAILABLE: "Specialists available";
30
- readonly NO_TRANSFER: "No transfer";
31
- readonly TRANSFERRED_TO: "Transferred to";
32
- readonly TYPE: "Type";
33
- readonly OPERATOR: "Operator";
34
- readonly TARGET: "Target";
35
- };
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { FallbackDebugEvent } from './types';
3
- export declare const getFallbackEventConfig: (data: FallbackDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { HandoffSuccessDebugEvent } from './types';
3
- export declare const getHandoffSuccessEventConfig: (data: HandoffSuccessDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { KeywordDebugEvent } from './types';
3
- export declare const getKeywordEventConfig: (data: KeywordDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { KnowledgeBaseDebugEvent } from './types';
3
- export declare const getKnowledgeBaseEventConfig: (_data: KnowledgeBaseDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { RedirectFlowDebugEvent } from './types';
3
- export declare const getRedirectFlowEventConfig: (data: RedirectFlowDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { SmartIntentDebugEvent } from './types';
3
- export declare const getSmartIntentEventConfig: (data: SmartIntentDebugEvent) => DebugEventConfig;
@@ -1,3 +0,0 @@
1
- import { DebugEventConfig } from '../preview-events-types';
2
- import { WebviewActionTriggeredDebugEvent } from './types';
3
- export declare const getWebviewActionTriggeredEventConfig: (data: WebviewActionTriggeredDebugEvent) => DebugEventConfig;
@@ -1,19 +0,0 @@
1
- import { ChunkIdsGroupedBySourceData, HubtypeSource, PreviewUtils } from '@botonic/shared';
2
- import { default as React } from 'react';
3
- interface UseKnowledgeBaseInfoParams {
4
- sourceIds: string[];
5
- chunkIds: string[];
6
- existingChunksWithSources?: ChunkIdsGroupedBySourceData[];
7
- failReason?: string;
8
- previewUtils?: PreviewUtils;
9
- }
10
- export declare function useKnowledgeBaseInfo({ sourceIds, chunkIds, existingChunksWithSources, failReason, previewUtils, }: UseKnowledgeBaseInfoParams): {
11
- sources: HubtypeSource[];
12
- chunks: HubtypeChunk[];
13
- chunksWithSources: ChunkIdsGroupedBySourceData[];
14
- isLoading: boolean;
15
- getIconForSourceType: (source: HubtypeSource) => React.ReactNode;
16
- hasKnowledge: boolean;
17
- isFaithful: boolean;
18
- };
19
- export {};
@@ -1,9 +0,0 @@
1
- import { RefObject } from 'react';
2
- interface UseLastLabelPositionProps {
3
- wrapperRef: RefObject<HTMLDivElement | null>;
4
- isExpanded: boolean;
5
- debugEvent: unknown;
6
- isCollapsible: boolean;
7
- }
8
- export declare function useLastLabelPosition({ wrapperRef, isExpanded, debugEvent, isCollapsible, }: UseLastLabelPositionProps): void;
9
- export {};
@@ -1 +0,0 @@
1
- export declare function AiRouterIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function AiSpecialistIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function ArrowProgressIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function BrainIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function CaretDownIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function CaretUpIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function CircleCheckIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function CodeIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function FilePdfIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function FileWordIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function HandIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function HeadSetIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +0,0 @@
1
- export { AiRouterIcon } from './ai-router-icon';
2
- export { AiSpecialistIcon } from './ai-specialist-icon';
3
- export { ArrowProgressIcon } from './arrow-progress-icon';
4
- export { BrainIcon } from './brain-icon';
5
- export { CaretDownIcon } from './caret-down-icon';
6
- export { CaretUpIcon } from './caret-up-icon';
7
- export { CircleCheckIcon } from './circle-check-icon';
8
- export { CodeIcon } from './code-icon';
9
- export { FilePdfIcon } from './file-pdf-icon';
10
- export { FileWordIcon } from './file-word-icon';
11
- export { HandIcon } from './hand-icon';
12
- export { HeadSetIcon } from './head-set-icon';
13
- export { LifeRingIcon } from './life-ring-icon';
14
- export { LinkIcon } from './link-icon';
15
- export { QuoteRightIcon } from './quote-right-icon';
16
- export { ScrewdriverWrenchIcon } from './screwdriver-wrench-icon';
17
- export { SplitIcon } from './split-icon';
18
- export { WandIcon } from './wand-icon';
19
- export { WindowRestoreIcon } from './window-restore-icon';
@@ -1 +0,0 @@
1
- export declare function LifeRingIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function LinkIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function QuoteRightIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function ScrewdriverWrenchIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function SplitIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function WandIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function WindowRestoreIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export type { DebugEvent } from './events/types';
2
- export { PreviewEventMessage, type PreviewEventMessageProps, SYSTEM_MESSAGE_ROLE, } from './preview-event-message';
3
- export type { DebugEventConfig } from './preview-events-types';
@@ -1 +0,0 @@
1
- export { PreviewEventMessage, type PreviewEventMessageProps, SYSTEM_MESSAGE_ROLE, } from './preview-event-message';
@@ -1,17 +0,0 @@
1
- import { PreviewUtils } from '@botonic/shared';
2
- import { default as React } from 'react';
3
- import { DebugEvent } from '../events';
4
- import { DebugEventConfig } from '../preview-events-types';
5
- export interface UsePreviewEventMessageProps {
6
- debugEvent: DebugEvent;
7
- messageId?: string;
8
- previewUtils?: PreviewUtils;
9
- }
10
- export declare function usePreviewEventMessage({ debugEvent, messageId, previewUtils, }: UsePreviewEventMessageProps): {
11
- isExpanded: boolean;
12
- eventConfig: DebugEventConfig | undefined;
13
- wrapperRef: React.RefObject<HTMLDivElement>;
14
- messageId: string | undefined;
15
- previewUtils: any;
16
- handleContainerClick: (e: React.MouseEvent) => void;
17
- };
@@ -1,12 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface IconProps {
3
- color?: string;
4
- }
5
- export interface DebugEventConfig {
6
- action: string;
7
- title: React.ReactNode;
8
- component: React.ComponentType<any> | null;
9
- icon?: React.ReactNode;
10
- collapsible?: boolean;
11
- }
12
- export type { DebugEvent } from './events/types';