@cagent/chat-embedding-core 0.0.1
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/.env.example +34 -0
- package/.eslintrc.cjs +15 -0
- package/.idea/flowise-chatbox.iml +10 -0
- package/.idea/modules.xml +8 -0
- package/.idea/workspace.xml +4 -0
- package/.prettierignore +3 -0
- package/.prettierrc +8 -0
- package/AGENTS.md +184 -0
- package/README.md +213 -0
- package/base.json +21 -0
- package/dist/api/chatRoom.d.ts +84 -0
- package/dist/assets/notificationSounds.d.ts +2 -0
- package/dist/components/Badge.d.ts +9 -0
- package/dist/components/Bot.d.ts +132 -0
- package/dist/components/FeedbackContentDialog.d.ts +12 -0
- package/dist/components/RoomReconnectAlert.d.ts +13 -0
- package/dist/components/Toast.d.ts +9 -0
- package/dist/components/TypingBubble.d.ts +1 -0
- package/dist/components/avatars/Avatar.d.ts +3 -0
- package/dist/components/avatars/DefaultAvatar.d.ts +1 -0
- package/dist/components/bubbles/AgentReasoningBubble.d.ts +15 -0
- package/dist/components/bubbles/BotBubble.d.ts +39 -0
- package/dist/components/bubbles/ChartBubble.d.ts +72 -0
- package/dist/components/bubbles/ChartLoadingPlaceholder.d.ts +7 -0
- package/dist/components/bubbles/ChartPlaceholder.d.ts +19 -0
- package/dist/components/bubbles/ChartPopupModal.d.ts +3 -0
- package/dist/components/bubbles/FollowUpPromptBubble.d.ts +7 -0
- package/dist/components/bubbles/GuestBubble.d.ts +15 -0
- package/dist/components/bubbles/LeadCaptureBubble.d.ts +19 -0
- package/dist/components/bubbles/LoadingBubble.d.ts +7 -0
- package/dist/components/bubbles/SourceBubble.d.ts +8 -0
- package/dist/components/bubbles/StableChartWrapper.d.ts +17 -0
- package/dist/components/bubbles/StarterPromptBubble.d.ts +7 -0
- package/dist/components/buttons/AttachmentUploadButton.d.ts +10 -0
- package/dist/components/buttons/CancelButton.d.ts +9 -0
- package/dist/components/buttons/CopyMessageButton.d.ts +9 -0
- package/dist/components/buttons/EditMessageButton.d.ts +7 -0
- package/dist/components/buttons/FeedbackButtons.d.ts +13 -0
- package/dist/components/buttons/ImageUploadButton.d.ts +10 -0
- package/dist/components/buttons/LeadCaptureButtons.d.ts +10 -0
- package/dist/components/buttons/PopupToast.d.ts +6 -0
- package/dist/components/buttons/RecordAudioButton.d.ts +10 -0
- package/dist/components/buttons/SendButton.d.ts +12 -0
- package/dist/components/dialogs/EditMessageDialog.d.ts +8 -0
- package/dist/components/icons/AddImageIcon.d.ts +2 -0
- package/dist/components/icons/AttachmentIcon.d.ts +2 -0
- package/dist/components/icons/CheckIcon.d.ts +2 -0
- package/dist/components/icons/CircleDotIcon.d.ts +2 -0
- package/dist/components/icons/ClipboardIcon.d.ts +2 -0
- package/dist/components/icons/CopyIcon.d.ts +4 -0
- package/dist/components/icons/DeleteIcon.d.ts +2 -0
- package/dist/components/icons/EditIcon.d.ts +4 -0
- package/dist/components/icons/FullScreenIcon.d.ts +2 -0
- package/dist/components/icons/RecordIcon.d.ts +2 -0
- package/dist/components/icons/ResetZoomIcon.d.ts +2 -0
- package/dist/components/icons/SendIcon.d.ts +2 -0
- package/dist/components/icons/SparklesIcon.d.ts +2 -0
- package/dist/components/icons/StopIcon.d.ts +2 -0
- package/dist/components/icons/ThumbsDownIcon.d.ts +4 -0
- package/dist/components/icons/ThumbsUpIcon.d.ts +4 -0
- package/dist/components/icons/TickIcon.d.ts +1 -0
- package/dist/components/icons/TrashIcon.d.ts +2 -0
- package/dist/components/icons/XIcon.d.ts +4 -0
- package/dist/components/icons/ZoomInIcon.d.ts +2 -0
- package/dist/components/icons/ZoomOutIcon.d.ts +2 -0
- package/dist/components/icons/index.d.ts +21 -0
- package/dist/components/image/PreviewImage.d.ts +4 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/inputs/textInput/components/FilePreview.d.ts +11 -0
- package/dist/components/inputs/textInput/components/ShortTextInput.d.ts +13 -0
- package/dist/components/inputs/textInput/components/TextInput.d.ts +50 -0
- package/dist/components/inputs/textInput/index.d.ts +2 -0
- package/dist/constants.d.ts +2 -0
- package/dist/features/bubble/components/Bubble.d.ts +4 -0
- package/dist/features/bubble/components/BubbleButton.d.ts +15 -0
- package/dist/features/bubble/components/Tooltip.d.ts +14 -0
- package/dist/features/bubble/components/index.d.ts +1 -0
- package/dist/features/bubble/index.d.ts +1 -0
- package/dist/features/bubble/types.d.ts +108 -0
- package/dist/features/full/components/Full.d.ts +6 -0
- package/dist/features/full/components/index.d.ts +1 -0
- package/dist/features/full/index.d.ts +1 -0
- package/dist/features/popup/components/DisclaimerPopup.d.ts +13 -0
- package/dist/features/popup/components/Popup.d.ts +8 -0
- package/dist/features/popup/components/index.d.ts +2 -0
- package/dist/features/popup/index.d.ts +1 -0
- package/dist/features/popup/types.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/queries/sendMessageQuery.d.ts +165 -0
- package/dist/register.d.ts +1 -0
- package/dist/store/constant.d.ts +42 -0
- package/dist/types/chart.d.ts +85 -0
- package/dist/utils/audioRecording.d.ts +20 -0
- package/dist/utils/chartInstanceManager.d.ts +42 -0
- package/dist/utils/chartTagParser.d.ts +38 -0
- package/dist/utils/chatInputHistory.d.ts +21 -0
- package/dist/utils/chatStreamHelper.d.ts +18 -0
- package/dist/utils/index.d.ts +26 -0
- package/dist/utils/isMobileSignal.d.ts +1 -0
- package/dist/utils/transcriptApi.d.ts +7 -0
- package/dist/utils/ultimateJsonParser.d.ts +1 -0
- package/dist/web.d.ts +34 -0
- package/dist/web.js +1 -0
- package/dist/window.d.ts +35 -0
- package/docs/chart-rendering-implementation-plan.md +565 -0
- package/images/ChatEmbed.gif +0 -0
- package/images/proxyserver.png +0 -0
- package/package.json +87 -0
- package/public/index.html +43 -0
- package/server.js +477 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { FilePreview } from '@/components/inputs/textInput/components/FilePreview';
|
|
2
|
+
import { BotMessageTheme, DateTimeToggleTheme, DisclaimerPopUpTheme, FeedbackTheme, FooterTheme, TextInputTheme, UserMessageTheme } from '@/features/bubble/types';
|
|
3
|
+
import { FeedbackRatingType } from '@/queries/sendMessageQuery';
|
|
4
|
+
import type { ChartConfig } from '@/types/chart';
|
|
5
|
+
export type FileEvent<T = EventTarget> = {
|
|
6
|
+
target: T;
|
|
7
|
+
};
|
|
8
|
+
export type FormEvent<T = EventTarget> = {
|
|
9
|
+
preventDefault: () => void;
|
|
10
|
+
currentTarget: T;
|
|
11
|
+
};
|
|
12
|
+
type IUploadConstraits = {
|
|
13
|
+
fileTypes: string[];
|
|
14
|
+
maxUploadSize: number;
|
|
15
|
+
};
|
|
16
|
+
export type UploadsConfig = {
|
|
17
|
+
imgUploadSizeAndTypes: IUploadConstraits[];
|
|
18
|
+
fileUploadSizeAndTypes: IUploadConstraits[];
|
|
19
|
+
isImageUploadAllowed: boolean;
|
|
20
|
+
isSpeechToTextEnabled: boolean;
|
|
21
|
+
isRAGFileUploadAllowed: boolean;
|
|
22
|
+
};
|
|
23
|
+
type FilePreviewData = string | ArrayBuffer;
|
|
24
|
+
type FilePreview = {
|
|
25
|
+
data: FilePreviewData;
|
|
26
|
+
mime: string;
|
|
27
|
+
name: string;
|
|
28
|
+
preview: string;
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
type messageType = 'apiMessage' | 'userMessage' | 'usermessagewaiting' | 'leadCaptureMessage';
|
|
32
|
+
export type IAgentReasoning = {
|
|
33
|
+
agentName?: string;
|
|
34
|
+
messages?: string[];
|
|
35
|
+
usedTools?: any[];
|
|
36
|
+
artifacts?: FileUpload[];
|
|
37
|
+
sourceDocuments?: any[];
|
|
38
|
+
instructions?: string;
|
|
39
|
+
nextAgent?: string;
|
|
40
|
+
};
|
|
41
|
+
export type IAction = {
|
|
42
|
+
id?: string;
|
|
43
|
+
elements?: Array<{
|
|
44
|
+
type: string;
|
|
45
|
+
label: string;
|
|
46
|
+
}>;
|
|
47
|
+
mapping?: {
|
|
48
|
+
approve: string;
|
|
49
|
+
reject: string;
|
|
50
|
+
toolCalls: any[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export type FileUpload = Omit<FilePreview, 'preview'>;
|
|
54
|
+
export type MessageType = {
|
|
55
|
+
messageId?: string;
|
|
56
|
+
message: string;
|
|
57
|
+
type: messageType;
|
|
58
|
+
sourceDocuments?: any;
|
|
59
|
+
fileAnnotations?: any;
|
|
60
|
+
fileUploads?: Partial<FileUpload>[];
|
|
61
|
+
artifacts?: Partial<FileUpload>[];
|
|
62
|
+
agentReasoning?: IAgentReasoning[];
|
|
63
|
+
usedTools?: any[];
|
|
64
|
+
action?: IAction | null;
|
|
65
|
+
rating?: FeedbackRatingType;
|
|
66
|
+
id?: string;
|
|
67
|
+
followUpPrompts?: string;
|
|
68
|
+
dateTime?: string;
|
|
69
|
+
chartConfigs?: ChartConfig[];
|
|
70
|
+
aborted?: boolean;
|
|
71
|
+
};
|
|
72
|
+
type observerConfigType = (accessor: string | boolean | object | MessageType[]) => void;
|
|
73
|
+
export type observersConfigType = Record<'observeUserInput' | 'observeLoading' | 'observeMessages', observerConfigType>;
|
|
74
|
+
export type BotProps = {
|
|
75
|
+
chatflowid: string;
|
|
76
|
+
apiHost?: string;
|
|
77
|
+
onRequest?: (request: RequestInit) => Promise<void>;
|
|
78
|
+
chatflowConfig?: Record<string, unknown>;
|
|
79
|
+
welcomeMessage?: string;
|
|
80
|
+
secondMessage?: string;
|
|
81
|
+
errorMessage?: string;
|
|
82
|
+
botMessage?: BotMessageTheme;
|
|
83
|
+
userMessage?: UserMessageTheme;
|
|
84
|
+
textInput?: TextInputTheme;
|
|
85
|
+
feedback?: FeedbackTheme;
|
|
86
|
+
poweredByTextColor?: string;
|
|
87
|
+
badgeBackgroundColor?: string;
|
|
88
|
+
bubbleBackgroundColor?: string;
|
|
89
|
+
bubbleTextColor?: string;
|
|
90
|
+
showTitle?: boolean;
|
|
91
|
+
showAgentMessages?: boolean;
|
|
92
|
+
title?: string;
|
|
93
|
+
titleAvatarSrc?: string;
|
|
94
|
+
fontSize?: number;
|
|
95
|
+
isFullPage?: boolean;
|
|
96
|
+
footer?: FooterTheme;
|
|
97
|
+
sourceDocsTitle?: string;
|
|
98
|
+
observersConfig?: observersConfigType;
|
|
99
|
+
starterPrompts?: string[] | Record<string, {
|
|
100
|
+
prompt: string;
|
|
101
|
+
}>;
|
|
102
|
+
starterPromptFontSize?: number;
|
|
103
|
+
clearChatOnReload?: boolean;
|
|
104
|
+
disclaimer?: DisclaimerPopUpTheme;
|
|
105
|
+
dateTimeToggle?: DateTimeToggleTheme;
|
|
106
|
+
renderHTML?: boolean;
|
|
107
|
+
showResponseTime?: boolean;
|
|
108
|
+
chatwootUrl?: string;
|
|
109
|
+
roomIds?: Record<string, string>;
|
|
110
|
+
isUseFAQ?: boolean;
|
|
111
|
+
s3ExplorerUrl?: string;
|
|
112
|
+
filePath?: string;
|
|
113
|
+
suggestQuestions?: string;
|
|
114
|
+
externalData?: string;
|
|
115
|
+
callBackFunction?: (e: any) => void;
|
|
116
|
+
callBackIcon?: string;
|
|
117
|
+
onToggleFullScreen?: () => void;
|
|
118
|
+
isFullScreen?: boolean;
|
|
119
|
+
onResetChat?: () => void;
|
|
120
|
+
};
|
|
121
|
+
export type LeadsConfig = {
|
|
122
|
+
status: boolean;
|
|
123
|
+
title?: string;
|
|
124
|
+
name?: boolean;
|
|
125
|
+
email?: boolean;
|
|
126
|
+
phone?: boolean;
|
|
127
|
+
successMessage?: string;
|
|
128
|
+
};
|
|
129
|
+
export declare const Bot: (botProps: BotProps & {
|
|
130
|
+
class?: string;
|
|
131
|
+
}) => import("solid-js").JSX.Element;
|
|
132
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Accessor, Setter } from 'solid-js';
|
|
2
|
+
type FeedbackContentDialogProps = {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onSubmit: (text: string) => void;
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
inputValue: Accessor<string>;
|
|
9
|
+
setInputValue: Setter<string>;
|
|
10
|
+
};
|
|
11
|
+
declare const FeedbackContentDialog: (props: FeedbackContentDialogProps) => import("solid-js").JSX.Element;
|
|
12
|
+
export default FeedbackContentDialog;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Room Reconnect Alert Component
|
|
3
|
+
* Shows alert when user has an active human advisor session that can be reconnected
|
|
4
|
+
*/
|
|
5
|
+
import { JSX } from 'solid-js';
|
|
6
|
+
export interface RoomReconnectAlertProps {
|
|
7
|
+
roomId: string;
|
|
8
|
+
advisorName?: string;
|
|
9
|
+
onReconnect: () => void;
|
|
10
|
+
onDismiss: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const RoomReconnectAlert: (props: RoomReconnectAlertProps) => JSX.Element;
|
|
13
|
+
export default RoomReconnectAlert;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TypingBubble: () => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DefaultAvatar: () => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FileUpload } from '../Bot';
|
|
2
|
+
type Props = {
|
|
3
|
+
apiHost?: string;
|
|
4
|
+
chatflowid: string;
|
|
5
|
+
chatId: string;
|
|
6
|
+
agentName: string;
|
|
7
|
+
agentMessage: string;
|
|
8
|
+
agentArtifacts?: FileUpload[];
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
fontSize?: number;
|
|
12
|
+
renderHTML?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const AgentReasoningBubble: (props: Props) => import("solid-js").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IAction, MessageType } from '../Bot';
|
|
2
|
+
import { DateTimeToggleTheme } from '@/features/bubble/types';
|
|
3
|
+
import type { ChartConfig } from '@/types/chart';
|
|
4
|
+
type Props = {
|
|
5
|
+
message: MessageType;
|
|
6
|
+
setMessages?: any;
|
|
7
|
+
chatflowid: string;
|
|
8
|
+
chatId: string;
|
|
9
|
+
apiHost?: string;
|
|
10
|
+
onRequest?: (request: RequestInit) => Promise<void>;
|
|
11
|
+
fileAnnotations?: any;
|
|
12
|
+
showAvatar?: boolean;
|
|
13
|
+
avatarSrc?: string;
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
textColor?: string;
|
|
16
|
+
chatFeedbackStatus?: boolean;
|
|
17
|
+
fontSize?: number;
|
|
18
|
+
feedbackColor?: string;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
dateTimeToggle?: DateTimeToggleTheme;
|
|
21
|
+
showAgentMessages?: boolean;
|
|
22
|
+
sourceDocsTitle?: string;
|
|
23
|
+
renderHTML?: boolean;
|
|
24
|
+
handleActionClick: (label: string, action: IAction | undefined | null) => void;
|
|
25
|
+
handleSourceDocumentsClick: (src: any) => void;
|
|
26
|
+
chatwootUrl?: string;
|
|
27
|
+
onConnectToHumanAdvisor?: (id: string, params?: any) => void;
|
|
28
|
+
roomIds?: Record<string, string>;
|
|
29
|
+
question?: string;
|
|
30
|
+
callBackIcon?: string;
|
|
31
|
+
callBackFunction?: (e: any) => void;
|
|
32
|
+
checkShowCallbackBtn?: boolean;
|
|
33
|
+
pendingCharts?: Map<string, Partial<ChartConfig>>;
|
|
34
|
+
completedCharts?: Map<string, ChartConfig>;
|
|
35
|
+
isLastMessage?: boolean;
|
|
36
|
+
onRetry?: () => void;
|
|
37
|
+
};
|
|
38
|
+
export declare const BotBubble: (props: Props) => import("solid-js").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ChartOptions } from 'chart.js';
|
|
2
|
+
import type { ChartBubbleProps, SupportedChartType } from '@/types/chart';
|
|
3
|
+
/**
|
|
4
|
+
* Vietnamese Government Style Color Palette
|
|
5
|
+
* Based on official Vietnamese flag colors and professional government design standards
|
|
6
|
+
* Primary: Red (#C8102E) - symbolizes revolution and sacrifice
|
|
7
|
+
* Secondary: Gold (#FFCD00) - symbolizes prosperity and national identity
|
|
8
|
+
* Supporting colors for multi-series data visualization with accessibility in mind
|
|
9
|
+
*/
|
|
10
|
+
export declare const vnGovColors: {
|
|
11
|
+
primary: string;
|
|
12
|
+
secondary: string;
|
|
13
|
+
palette: string[];
|
|
14
|
+
paletteFill: string[];
|
|
15
|
+
paletteLineFill: string[];
|
|
16
|
+
text: {
|
|
17
|
+
primary: string;
|
|
18
|
+
secondary: string;
|
|
19
|
+
light: string;
|
|
20
|
+
};
|
|
21
|
+
grid: {
|
|
22
|
+
line: string;
|
|
23
|
+
border: string;
|
|
24
|
+
axis: string;
|
|
25
|
+
};
|
|
26
|
+
container: {
|
|
27
|
+
background: string;
|
|
28
|
+
border: string;
|
|
29
|
+
shadow: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Professional Vietnamese government chart typography settings
|
|
34
|
+
* Using system sans-serif fonts for clean, official appearance
|
|
35
|
+
*/
|
|
36
|
+
export declare const vnGovTypography: {
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
title: {
|
|
39
|
+
size: number;
|
|
40
|
+
weight: "bold";
|
|
41
|
+
lineHeight: number;
|
|
42
|
+
};
|
|
43
|
+
legend: {
|
|
44
|
+
size: number;
|
|
45
|
+
weight: "bold";
|
|
46
|
+
};
|
|
47
|
+
axis: {
|
|
48
|
+
size: number;
|
|
49
|
+
weight: "normal";
|
|
50
|
+
};
|
|
51
|
+
tooltip: {
|
|
52
|
+
size: number;
|
|
53
|
+
weight: "normal";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Applies Vietnamese government color palette to chart datasets
|
|
58
|
+
* Ensures consistent, professional appearance across all chart types
|
|
59
|
+
*/
|
|
60
|
+
export declare const applyVnGovColorsToDatasets: (data: ChartBubbleProps['config']['data'], chartType: SupportedChartType) => ChartBubbleProps['config']['data'];
|
|
61
|
+
/**
|
|
62
|
+
* Creates Vietnamese government-styled chart options
|
|
63
|
+
* Professional appearance suitable for official reports and dashboards
|
|
64
|
+
*/
|
|
65
|
+
export declare const createVnGovChartOptions: (chartType: SupportedChartType, title: string | undefined, textColor: string) => ChartOptions;
|
|
66
|
+
/**
|
|
67
|
+
* SolidJS component that renders a Chart.js chart with Vietnamese government styling.
|
|
68
|
+
* Features professional color palette, typography, and visual design appropriate
|
|
69
|
+
* for official government reports, dashboards, and publications.
|
|
70
|
+
*/
|
|
71
|
+
export declare const ChartBubble: (props: ChartBubbleProps) => import("solid-js").JSX.Element;
|
|
72
|
+
export default ChartBubble;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartLoadingPlaceholderProps } from '@/types/chart';
|
|
2
|
+
/**
|
|
3
|
+
* Loading skeleton component displayed while chart data is streaming.
|
|
4
|
+
* Shows an animated placeholder with a chart icon.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ChartLoadingPlaceholder: (props: ChartLoadingPlaceholderProps) => import("solid-js").JSX.Element;
|
|
7
|
+
export default ChartLoadingPlaceholder;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ChartConfig } from '@/types/chart';
|
|
2
|
+
export interface ChartPlaceholderProps {
|
|
3
|
+
chartId: string;
|
|
4
|
+
/** Getter function that returns the chart config. Using a getter ensures reactivity when rendered via SolidJS render(). */
|
|
5
|
+
getConfig?: () => ChartConfig | null | undefined;
|
|
6
|
+
/** Getter function that returns loading state. Using a getter ensures reactivity when rendered via SolidJS render(). */
|
|
7
|
+
getIsLoading?: () => boolean;
|
|
8
|
+
/** Getter function that returns true while streaming is in progress. Using a getter ensures reactivity when rendered via SolidJS render(). */
|
|
9
|
+
isStreaming?: () => boolean;
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
textColor?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Simplified placeholder component that renders charts directly inline.
|
|
15
|
+
* Uses StableChartWrapper to ensure charts are only rendered once when config is available.
|
|
16
|
+
* Includes a fullscreen button to open the chart in a popup modal with zoom/pan capabilities.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ChartPlaceholder: (props: ChartPlaceholderProps) => import("solid-js").JSX.Element;
|
|
19
|
+
export default ChartPlaceholder;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageType } from '../Bot';
|
|
2
|
+
type Props = {
|
|
3
|
+
message: MessageType;
|
|
4
|
+
apiHost?: string;
|
|
5
|
+
chatflowid: string;
|
|
6
|
+
chatId: string;
|
|
7
|
+
showAvatar?: boolean;
|
|
8
|
+
avatarSrc?: string;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
fontSize?: number;
|
|
12
|
+
renderHTML?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const GuestBubble: (props: Props) => import("solid-js").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LeadsConfig, MessageType } from '@/components/Bot';
|
|
2
|
+
type Props = {
|
|
3
|
+
message: MessageType;
|
|
4
|
+
chatflowid: string;
|
|
5
|
+
chatId: string;
|
|
6
|
+
leadsConfig?: LeadsConfig;
|
|
7
|
+
apiHost?: string;
|
|
8
|
+
showAvatar?: boolean;
|
|
9
|
+
avatarSrc?: string;
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
textColor?: string;
|
|
12
|
+
sendButtonColor?: string;
|
|
13
|
+
fontSize?: number;
|
|
14
|
+
isLeadSaved: boolean;
|
|
15
|
+
setIsLeadSaved: (value: boolean) => void;
|
|
16
|
+
setLeadEmail: (value: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const LeadCaptureBubble: (props: Props) => import("solid-js").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChartConfig } from '@/types/chart';
|
|
2
|
+
export interface StableChartWrapperProps {
|
|
3
|
+
chartId: string;
|
|
4
|
+
/** Getter function for reactive config updates */
|
|
5
|
+
getConfig?: () => ChartConfig | null | undefined;
|
|
6
|
+
/** Getter function for reactive loading state updates */
|
|
7
|
+
getIsLoading?: () => boolean;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
textColor?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A stable wrapper component that renders ChartBubble only ONCE when config becomes available.
|
|
13
|
+
* Uses manual DOM rendering via solid-js/web render() to bypass reactive updates.
|
|
14
|
+
* This prevents re-renders during streaming updates.
|
|
15
|
+
*/
|
|
16
|
+
export declare const StableChartWrapper: (props: StableChartWrapperProps) => import("solid-js").JSX.Element;
|
|
17
|
+
export default StableChartWrapper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js/jsx-runtime';
|
|
2
|
+
type FileUploadButtonProps = {
|
|
3
|
+
buttonColor?: string;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const AttachmentUploadButton: (props: FileUploadButtonProps) => JSX.Element;
|
|
9
|
+
export declare const Spinner: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JSX } from 'solid-js/jsx-runtime';
|
|
2
|
+
type CancelButtonProps = {
|
|
3
|
+
buttonColor?: string;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const CancelButton: (props: CancelButtonProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ICopyMessageButtonProps {
|
|
2
|
+
class?: string;
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
onCopy?: (text: string) => void;
|
|
5
|
+
copiedDuration?: number;
|
|
6
|
+
textToCopy: string;
|
|
7
|
+
}
|
|
8
|
+
declare const CopyMessageButton: (props: ICopyMessageButtonProps) => import("solid-js").JSX.Element;
|
|
9
|
+
export default CopyMessageButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
type RatingButtonProps = {
|
|
3
|
+
feedbackColor?: string;
|
|
4
|
+
activeBackgroundColor?: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
disableIcon?: boolean;
|
|
8
|
+
rating?: string;
|
|
9
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
10
|
+
export declare const CopyToClipboardButton: (props: RatingButtonProps) => JSX.Element;
|
|
11
|
+
export declare const ThumbsUpButton: (props: RatingButtonProps) => JSX.Element;
|
|
12
|
+
export declare const ThumbsDownButton: (props: RatingButtonProps) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js/jsx-runtime';
|
|
2
|
+
type ImageUploadButtonProps = {
|
|
3
|
+
buttonColor?: string;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const ImageUploadButton: (props: ImageUploadButtonProps) => JSX.Element;
|
|
9
|
+
export declare const Spinner: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
type LeadCaptureButtonProps = {
|
|
3
|
+
buttonColor?: string;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const CancelLeadCaptureButton: (props: LeadCaptureButtonProps) => JSX.Element;
|
|
9
|
+
export declare const SaveLeadButton: (props: LeadCaptureButtonProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js/jsx-runtime';
|
|
2
|
+
type RecordAudioButtonProps = {
|
|
3
|
+
buttonColor?: string;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const RecordAudioButton: (props: RecordAudioButtonProps) => JSX.Element;
|
|
9
|
+
export declare const Spinner: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'solid-js/jsx-runtime';
|
|
2
|
+
type SendButtonProps = {
|
|
3
|
+
sendButtonColor?: string;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const SendButton: (props: SendButtonProps) => JSX.Element;
|
|
9
|
+
export declare const DeleteButton: (props: SendButtonProps) => JSX.Element;
|
|
10
|
+
export declare const FullScreenButton: (props: SendButtonProps) => JSX.Element;
|
|
11
|
+
export declare const Spinner: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface EditMessageDialogProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
originalMessage: string;
|
|
5
|
+
onSave: (newMessage: string) => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
declare const EditMessageDialog: (props: EditMessageDialogProps) => import("solid-js").JSX.Element;
|
|
8
|
+
export default EditMessageDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TickIcon: () => import("solid-js").JSX.Element;
|