@cognizant-ai-lab/ui-common 1.3.3
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/dist/components/AgentChat/ChatCommon.d.ts +94 -0
- package/dist/components/AgentChat/ChatCommon.js +581 -0
- package/dist/components/AgentChat/ControlButtons.d.ts +16 -0
- package/dist/components/AgentChat/ControlButtons.js +24 -0
- package/dist/components/AgentChat/FormattedMarkdown.d.ts +32 -0
- package/dist/components/AgentChat/FormattedMarkdown.js +82 -0
- package/dist/components/AgentChat/Greetings.d.ts +1 -0
- package/dist/components/AgentChat/Greetings.js +38 -0
- package/dist/components/AgentChat/LlmChatButton.d.ts +12 -0
- package/dist/components/AgentChat/LlmChatButton.js +33 -0
- package/dist/components/AgentChat/SendButton.d.ts +12 -0
- package/dist/components/AgentChat/SendButton.js +28 -0
- package/dist/components/AgentChat/SyntaxHighlighterThemes.d.ts +14 -0
- package/dist/components/AgentChat/SyntaxHighlighterThemes.js +27 -0
- package/dist/components/AgentChat/Types.d.ts +17 -0
- package/dist/components/AgentChat/Types.js +26 -0
- package/dist/components/AgentChat/UserQueryDisplay.d.ts +5 -0
- package/dist/components/AgentChat/UserQueryDisplay.js +33 -0
- package/dist/components/AgentChat/Utils.d.ts +11 -0
- package/dist/components/AgentChat/Utils.js +64 -0
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.d.ts +29 -0
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.js +55 -0
- package/dist/components/AgentChat/VoiceChat/VoiceChat.d.ts +33 -0
- package/dist/components/AgentChat/VoiceChat/VoiceChat.js +180 -0
- package/dist/components/Authentication/Auth.d.ts +14 -0
- package/dist/components/Authentication/Auth.js +58 -0
- package/dist/components/ChatBot/ChatBot.d.ts +20 -0
- package/dist/components/ChatBot/ChatBot.js +75 -0
- package/dist/components/Common/Breadcrumbs.d.ts +6 -0
- package/dist/components/Common/Breadcrumbs.js +36 -0
- package/dist/components/Common/LlmChatOptionsButton.d.ts +9 -0
- package/dist/components/Common/LlmChatOptionsButton.js +31 -0
- package/dist/components/Common/LoadingSpinner.d.ts +10 -0
- package/dist/components/Common/LoadingSpinner.js +24 -0
- package/dist/components/Common/MUIAccordion.d.ts +17 -0
- package/dist/components/Common/MUIAccordion.js +76 -0
- package/dist/components/Common/MUIAlert.d.ts +11 -0
- package/dist/components/Common/MUIAlert.js +41 -0
- package/dist/components/Common/MUIDialog.d.ts +16 -0
- package/dist/components/Common/MUIDialog.js +40 -0
- package/dist/components/Common/Navbar.d.ts +15 -0
- package/dist/components/Common/Navbar.js +137 -0
- package/dist/components/Common/PageLoader.d.ts +5 -0
- package/dist/components/Common/PageLoader.js +26 -0
- package/dist/components/Common/Snackbar.d.ts +5 -0
- package/dist/components/Common/Snackbar.js +84 -0
- package/dist/components/Common/confirmationModal.d.ts +14 -0
- package/dist/components/Common/confirmationModal.js +65 -0
- package/dist/components/Common/notification.d.ts +18 -0
- package/dist/components/Common/notification.js +79 -0
- package/dist/components/ErrorPage/ErrorBoundary.d.ts +38 -0
- package/dist/components/ErrorPage/ErrorBoundary.js +77 -0
- package/dist/components/ErrorPage/ErrorPage.d.ts +12 -0
- package/dist/components/ErrorPage/ErrorPage.js +46 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow.d.ts +21 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow.js +394 -0
- package/dist/components/MultiAgentAccelerator/AgentNode.d.ts +18 -0
- package/dist/components/MultiAgentAccelerator/AgentNode.js +129 -0
- package/dist/components/MultiAgentAccelerator/GraphLayouts.d.ts +33 -0
- package/dist/components/MultiAgentAccelerator/GraphLayouts.js +297 -0
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.d.ts +17 -0
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +208 -0
- package/dist/components/MultiAgentAccelerator/PlasmaEdge.d.ts +3 -0
- package/dist/components/MultiAgentAccelerator/PlasmaEdge.js +124 -0
- package/dist/components/MultiAgentAccelerator/Sidebar.d.ts +12 -0
- package/dist/components/MultiAgentAccelerator/Sidebar.js +204 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleEdge.d.ts +12 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleEdge.js +15 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.d.ts +11 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.js +466 -0
- package/dist/components/MultiAgentAccelerator/const.d.ts +7 -0
- package/dist/components/MultiAgentAccelerator/const.js +39 -0
- package/dist/const.d.ts +10 -0
- package/dist/const.js +30 -0
- package/dist/controller/agent/Agent.d.ts +56 -0
- package/dist/controller/agent/Agent.js +162 -0
- package/dist/controller/llm/LlmChat.d.ts +18 -0
- package/dist/controller/llm/LlmChat.js +65 -0
- package/dist/controller/llm/endpoints.d.ts +1 -0
- package/dist/controller/llm/endpoints.js +17 -0
- package/dist/generated/neuro-san/NeuroSanClient.d.ts +413 -0
- package/dist/generated/neuro-san/NeuroSanClient.js +28 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +52 -0
- package/dist/state/UserInfo.d.ts +16 -0
- package/dist/state/UserInfo.js +27 -0
- package/dist/state/environment.d.ts +18 -0
- package/dist/state/environment.js +33 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/Authentication.d.ts +31 -0
- package/dist/utils/Authentication.js +94 -0
- package/dist/utils/BrowserNavigation.d.ts +5 -0
- package/dist/utils/BrowserNavigation.js +22 -0
- package/dist/utils/Theme.d.ts +7 -0
- package/dist/utils/Theme.js +7 -0
- package/dist/utils/agentConversations.d.ts +24 -0
- package/dist/utils/agentConversations.js +113 -0
- package/dist/utils/text.d.ts +28 -0
- package/dist/utils/text.js +64 -0
- package/dist/utils/title.d.ts +1 -0
- package/dist/utils/title.js +20 -0
- package/dist/utils/types.d.ts +17 -0
- package/dist/utils/types.js +16 -0
- package/dist/utils/useLocalStorage.d.ts +1 -0
- package/dist/utils/useLocalStorage.js +55 -0
- package/dist/utils/zIndexLayers.d.ts +2 -0
- package/dist/utils/zIndexLayers.js +29 -0
- package/package.json +69 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2025 Cognizant Technology Solutions Corp, www.cognizant.com.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
|
|
18
|
+
import ClearIcon from "@mui/icons-material/Clear";
|
|
19
|
+
import HighlightOff from "@mui/icons-material/HighlightOff";
|
|
20
|
+
import SettingsIcon from "@mui/icons-material/Settings";
|
|
21
|
+
import { IconButton, InputAdornment, styled, useColorScheme, useTheme } from "@mui/material";
|
|
22
|
+
import Box from "@mui/material/Box";
|
|
23
|
+
import Button from "@mui/material/Button";
|
|
24
|
+
import List from "@mui/material/List";
|
|
25
|
+
import ListItemButton from "@mui/material/ListItemButton";
|
|
26
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
27
|
+
import Popover from "@mui/material/Popover";
|
|
28
|
+
import TextField from "@mui/material/TextField";
|
|
29
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
30
|
+
import Typography from "@mui/material/Typography";
|
|
31
|
+
import { useEffect, useRef, useState, } from "react";
|
|
32
|
+
import { testConnection } from "../../controller/agent/Agent.js";
|
|
33
|
+
import { useEnvironmentStore } from "../../state/environment.js";
|
|
34
|
+
import { isDarkMode } from "../../utils/Theme.js";
|
|
35
|
+
import { getZIndex } from "../../utils/zIndexLayers.js";
|
|
36
|
+
import { cleanUpAgentName } from "../AgentChat/Utils.js";
|
|
37
|
+
// #region: Styled Components
|
|
38
|
+
const PrimaryButton = styled(Button, {
|
|
39
|
+
shouldForwardProp: (prop) => prop !== "darkMode",
|
|
40
|
+
})(({ darkMode }) => ({
|
|
41
|
+
backgroundColor: "var(--bs-primary)",
|
|
42
|
+
marginLeft: "0.5rem",
|
|
43
|
+
marginTop: "2px",
|
|
44
|
+
"&:hover": {
|
|
45
|
+
backgroundColor: "var(--bs-primary)",
|
|
46
|
+
},
|
|
47
|
+
"&.Mui-disabled": {
|
|
48
|
+
color: darkMode ? "rgba(255, 255, 255, 0.25)" : undefined,
|
|
49
|
+
backgroundColor: undefined,
|
|
50
|
+
},
|
|
51
|
+
}));
|
|
52
|
+
// #endregion: Styled Components
|
|
53
|
+
// #region: Types
|
|
54
|
+
var CONNECTION_STATUS;
|
|
55
|
+
(function (CONNECTION_STATUS) {
|
|
56
|
+
CONNECTION_STATUS["IDLE"] = "idle";
|
|
57
|
+
CONNECTION_STATUS["SUCCESS"] = "success";
|
|
58
|
+
CONNECTION_STATUS["ERROR"] = "error";
|
|
59
|
+
})(CONNECTION_STATUS || (CONNECTION_STATUS = {}));
|
|
60
|
+
// #endregion: Types
|
|
61
|
+
export const Sidebar = ({ customURLCallback, customURLLocalStorage, id, isAwaitingLlm, networks, selectedNetwork, setSelectedNetwork, }) => {
|
|
62
|
+
// Get default URL from the environment store.
|
|
63
|
+
const { backendNeuroSanApiUrl } = useEnvironmentStore();
|
|
64
|
+
const [urlInput, setUrlInput] = useState(customURLLocalStorage || backendNeuroSanApiUrl);
|
|
65
|
+
const [connectionStatus, setConnectionStatus] = useState(CONNECTION_STATUS.IDLE);
|
|
66
|
+
const [testConnectionResult, setTestConnectionResult] = useState(null);
|
|
67
|
+
const connectionStatusSuccess = connectionStatus === CONNECTION_STATUS.SUCCESS;
|
|
68
|
+
const connectionStatusError = connectionStatus === CONNECTION_STATUS.ERROR;
|
|
69
|
+
const isDefaultUrl = urlInput === backendNeuroSanApiUrl;
|
|
70
|
+
// Enable the Save button if the URL input is not empty and the connection status is successful,
|
|
71
|
+
// OR if the URL input is the default URL and connection status is not error
|
|
72
|
+
const saveEnabled = urlInput && (connectionStatusSuccess || (isDefaultUrl && !connectionStatusError));
|
|
73
|
+
const selectedNetworkRef = useRef(null);
|
|
74
|
+
const [settingsAnchorEl, setSettingsAnchorEl] = useState(null);
|
|
75
|
+
const settingsPopoverOpen = Boolean(settingsAnchorEl);
|
|
76
|
+
// Theming/Dark mode
|
|
77
|
+
const theme = useTheme();
|
|
78
|
+
const { mode, systemMode } = useColorScheme();
|
|
79
|
+
const darkMode = isDarkMode(mode, systemMode);
|
|
80
|
+
const handleSettingsClick = (event) => {
|
|
81
|
+
// On open of Settings popover, reset the connection status to idle
|
|
82
|
+
setConnectionStatus(CONNECTION_STATUS.IDLE);
|
|
83
|
+
setSettingsAnchorEl(event.currentTarget);
|
|
84
|
+
};
|
|
85
|
+
const handleSettingsClose = (cancel = false) => {
|
|
86
|
+
setSettingsAnchorEl(null);
|
|
87
|
+
// If the user cancels, reset the custom URL input to the local storage value, or the default URL
|
|
88
|
+
if (cancel) {
|
|
89
|
+
setUrlInput(customURLLocalStorage || backendNeuroSanApiUrl);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const handleURLChange = (event) => {
|
|
93
|
+
setUrlInput(event.target.value);
|
|
94
|
+
// Reset connection check since URL input was changed
|
|
95
|
+
setConnectionStatus(CONNECTION_STATUS.IDLE);
|
|
96
|
+
};
|
|
97
|
+
const handleDefaultSettings = () => {
|
|
98
|
+
// Clear input but don't close the popover
|
|
99
|
+
setUrlInput(backendNeuroSanApiUrl);
|
|
100
|
+
// Reset connection check since URL input was cleared
|
|
101
|
+
setConnectionStatus(CONNECTION_STATUS.IDLE);
|
|
102
|
+
};
|
|
103
|
+
const handleSaveSettings = () => {
|
|
104
|
+
let tempUrl = urlInput;
|
|
105
|
+
if (tempUrl.endsWith("/")) {
|
|
106
|
+
tempUrl = tempUrl.slice(0, -1);
|
|
107
|
+
}
|
|
108
|
+
if (tempUrl && !tempUrl.startsWith("http://") && !tempUrl.startsWith("https://")) {
|
|
109
|
+
tempUrl = `https://${tempUrl}`;
|
|
110
|
+
}
|
|
111
|
+
// Call setSelectedNetwork(null) otherwise it can cause issues when switching agent networks (i.e. for Save)
|
|
112
|
+
setSelectedNetwork(null);
|
|
113
|
+
handleSettingsClose();
|
|
114
|
+
customURLCallback(tempUrl);
|
|
115
|
+
};
|
|
116
|
+
const handleSettingsSaveEnterKey = (event) => {
|
|
117
|
+
if (event.key === "Enter" && saveEnabled) {
|
|
118
|
+
handleSaveSettings();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const handleTestConnection = async () => {
|
|
122
|
+
const result = await testConnection(urlInput);
|
|
123
|
+
setTestConnectionResult(result);
|
|
124
|
+
if (result.success) {
|
|
125
|
+
setConnectionStatus(CONNECTION_STATUS.SUCCESS);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
setConnectionStatus(CONNECTION_STATUS.ERROR);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const handleClearInput = () => {
|
|
132
|
+
setUrlInput("");
|
|
133
|
+
setConnectionStatus(CONNECTION_STATUS.IDLE);
|
|
134
|
+
};
|
|
135
|
+
// Make sure selected network in the list is always in view
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (selectedNetworkRef.current) {
|
|
138
|
+
selectedNetworkRef.current.scrollIntoView({ behavior: "instant", block: "nearest" });
|
|
139
|
+
}
|
|
140
|
+
}, [selectedNetwork]);
|
|
141
|
+
// Get Neuro-san version on initial load
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
const fetchVersion = async () => {
|
|
144
|
+
// We aren't really trying to test the connection here, just getting the version.
|
|
145
|
+
const result = await testConnection(urlInput);
|
|
146
|
+
if (result.success) {
|
|
147
|
+
setTestConnectionResult(result);
|
|
148
|
+
setConnectionStatus(CONNECTION_STATUS.SUCCESS);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
void fetchVersion();
|
|
152
|
+
}, []);
|
|
153
|
+
const selectNetworkHandler = (network) => {
|
|
154
|
+
setSelectedNetwork(network);
|
|
155
|
+
};
|
|
156
|
+
return (_jsxs(_Fragment, { children: [_jsxs("aside", { id: `${id}-sidebar`, style: {
|
|
157
|
+
borderRightColor: "var(--bs-gray-light)",
|
|
158
|
+
borderRightStyle: "solid",
|
|
159
|
+
borderRightWidth: "1px",
|
|
160
|
+
height: "100%",
|
|
161
|
+
overflowY: "auto",
|
|
162
|
+
paddingRight: "0.75rem",
|
|
163
|
+
}, children: [_jsxs("h2", { id: `${id}-heading`, style: {
|
|
164
|
+
borderBottomColor: "var(--bs-gray-light)",
|
|
165
|
+
borderBottomStyle: "solid",
|
|
166
|
+
borderBottomWidth: "1px",
|
|
167
|
+
fontSize: "1.125rem",
|
|
168
|
+
fontWeight: "bold",
|
|
169
|
+
marginBottom: "0.25rem",
|
|
170
|
+
paddingBottom: "0.75rem",
|
|
171
|
+
position: "sticky",
|
|
172
|
+
top: 0,
|
|
173
|
+
zIndex: getZIndex(1, theme),
|
|
174
|
+
}, children: ["Agent Networks", _jsx(Button, { "aria-label": "Agent Network Settings", disabled: isAwaitingLlm, id: "agent-network-settings-btn", onClick: handleSettingsClick, sx: { display: "inline-block", minWidth: "40px" }, children: _jsx(Tooltip, { id: "agent-network-settings-tooltip", placement: "top", title: `${customURLLocalStorage || backendNeuroSanApiUrl}\nversion: ${testConnectionResult?.version || "unknown"}`, children: _jsx(SettingsIcon, { id: "agent-network-settings-icon", sx: {
|
|
175
|
+
color: isAwaitingLlm ? "rgba(0, 0, 0, 0.12)" : "var(--bs-secondary)",
|
|
176
|
+
} }) }) })] }), _jsx(List, { id: `${id}-network-list`, sx: { padding: 0, margin: 0 }, children: networks?.map((network) => (_jsx(ListItemButton, { id: `${network}-btn`, onClick: () => selectNetworkHandler(network), sx: { textAlign: "left" }, selected: selectedNetwork === network, disabled: isAwaitingLlm, ref: selectedNetwork === network ? selectedNetworkRef : null, children: _jsx(ListItemText, { id: `${network}-text`, slotProps: {
|
|
177
|
+
primary: {
|
|
178
|
+
fontSize: "0.75rem",
|
|
179
|
+
},
|
|
180
|
+
}, primary: cleanUpAgentName(network) }) }, network))) })] }), _jsxs(Popover, { id: "agent-network-settings-popover", open: settingsPopoverOpen, anchorEl: settingsAnchorEl, onClose: () => handleSettingsClose(true), anchorOrigin: {
|
|
181
|
+
vertical: "bottom",
|
|
182
|
+
horizontal: "left",
|
|
183
|
+
}, slotProps: {
|
|
184
|
+
paper: {
|
|
185
|
+
sx: {
|
|
186
|
+
paddingTop: "0.75rem",
|
|
187
|
+
paddingLeft: "0.5rem",
|
|
188
|
+
paddingRight: "0.5rem",
|
|
189
|
+
paddingBottom: "0.2rem",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
}, children: [_jsx(TextField, { autoComplete: "off", label: "Agent server address", id: "agent-network-settings-url", onChange: handleURLChange, onKeyUp: handleSettingsSaveEnterKey, placeholder: "https://my_server_address:port", size: "small", sx: { marginBottom: "0.5rem", minWidth: "400px" }, type: "url", variant: "outlined", value: urlInput, slotProps: {
|
|
193
|
+
input: {
|
|
194
|
+
endAdornment: urlInput && urlInput !== backendNeuroSanApiUrl ? (_jsx(InputAdornment, { id: "clear-input-adornment", position: "end", children: _jsx(IconButton, { id: "clear-input-icon-button", edge: "end", onClick: handleClearInput, size: "small", "aria-label": "Clear input", children: _jsx(ClearIcon, { fontSize: "small", id: "clear-input-icon" }) }) })) : undefined,
|
|
195
|
+
},
|
|
196
|
+
} }), _jsx(PrimaryButton, { disabled: !urlInput, id: "agent-network-settings-test-btn", onClick: handleTestConnection, variant: "contained", darkMode: darkMode, children: "Test" }), _jsx(PrimaryButton, { disabled: !saveEnabled, id: "agent-network-settings-save-btn", onClick: handleSaveSettings, variant: "contained", darkMode: darkMode, children: "Save" }), _jsx(PrimaryButton, { id: "agent-network-settings-cancel-btn", onClick: () => handleSettingsClose(true), variant: "contained", darkMode: darkMode, children: "Cancel" }), _jsx(Button, { id: "agent-network-settings-default-btn", onClick: handleDefaultSettings, sx: {
|
|
197
|
+
marginLeft: "0.35rem",
|
|
198
|
+
marginTop: "2px",
|
|
199
|
+
color: darkMode ? "var(--bs-dark-mode-link)" : undefined,
|
|
200
|
+
}, variant: "text", children: "Default" }), (connectionStatusSuccess || connectionStatusError) && (_jsxs(Box, { id: "connection-status-box", display: "flex", alignItems: "center", sx: {
|
|
201
|
+
marginLeft: "0.25rem",
|
|
202
|
+
marginBottom: "0.5rem",
|
|
203
|
+
}, children: [connectionStatusSuccess && (_jsxs(_Fragment, { children: [_jsx(CheckCircleOutlineIcon, { id: "connection-status-success-icon", sx: { color: "var(--bs-green)", fontSize: "1.2rem", marginRight: "0.25rem" } }), _jsx(Typography, { id: "connection-status-success-msg", variant: "body2", color: "var(--bs-green)", children: "Connected successfully" })] })), connectionStatusError && (_jsxs(_Fragment, { children: [_jsx(HighlightOff, { id: "connection-status-error-icon", sx: { color: "var(--bs-red)", fontSize: "1.2rem", marginRight: "0.25rem" } }), _jsx(Typography, { id: "connection-status-failed-msg", variant: "body2", color: "var(--bs-red)", children: `Connection failed: "${testConnectionResult?.status || "unknown error"}"` })] }))] }))] })] }));
|
|
204
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { EdgeProps } from "reactflow";
|
|
3
|
+
interface ThoughtBubbleEdgeProps extends EdgeProps {
|
|
4
|
+
data?: {
|
|
5
|
+
text?: string;
|
|
6
|
+
showAlways?: boolean;
|
|
7
|
+
conversationId?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const ThoughtBubbleEdge: FC<ThoughtBubbleEdgeProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { getBezierPath } from "reactflow";
|
|
3
|
+
// Simplified edge component - visual rendering is handled by ThoughtBubbleOverlay
|
|
4
|
+
export const ThoughtBubbleEdge = ({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, }) => {
|
|
5
|
+
const conversationId = data?.conversationId || "";
|
|
6
|
+
const [edgePath] = getBezierPath({
|
|
7
|
+
sourceX,
|
|
8
|
+
sourceY,
|
|
9
|
+
targetX,
|
|
10
|
+
targetY,
|
|
11
|
+
sourcePosition,
|
|
12
|
+
targetPosition,
|
|
13
|
+
});
|
|
14
|
+
return (_jsx(_Fragment, { children: _jsx("path", { id: `thought-bubble-hover-${conversationId}`, d: edgePath, fill: "none", stroke: "transparent", strokeWidth: "20", style: { pointerEvents: "stroke" } }) }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import type { Edge, Node as RFNode } from "reactflow";
|
|
3
|
+
interface ThoughtBubbleOverlayProps {
|
|
4
|
+
readonly nodes: RFNode[];
|
|
5
|
+
readonly edges: Edge[];
|
|
6
|
+
readonly showThoughtBubbles?: boolean;
|
|
7
|
+
readonly isStreaming?: boolean;
|
|
8
|
+
readonly onBubbleHoverChange?: (bubbleId: string | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const ThoughtBubbleOverlay: FC<ThoughtBubbleOverlayProps>;
|
|
11
|
+
export {};
|