Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d5d9873
init chat component
iamfaran Jun 30, 2025
d1d9b92
refactor component structure
iamfaran Jun 30, 2025
0c132c1
install dependencies
iamfaran Jun 30, 2025
4e7e540
add assistant-ui components
iamfaran Jul 1, 2025
c541393
fix linter error
iamfaran Jul 1, 2025
bf3810f
add thread
iamfaran Jul 1, 2025
11c98fd
add properties for chat component
iamfaran Jul 1, 2025
d6b0ef0
update folder structure and adds component actions to js console
kamalqureshi Jul 1, 2025
5f54598
Merge branch 'dev' into actions_js_console
kamalqureshi Jul 2, 2025
1583b5c
Update read me files
kamalqureshi Jul 2, 2025
aec9485
add query / new hook from assisstant ui
iamfaran Jul 2, 2025
b820f8e
use mock data
iamfaran Jul 2, 2025
0dc85d4
add edit functionality
iamfaran Jul 2, 2025
fd9dc77
fix message json issue
iamfaran Jul 2, 2025
22934c6
Merge branch 'dev' of github.com:lowcoder-org/lowcoder into feat/chat…
iamfaran Jul 2, 2025
52cdcf2
add threads logic
iamfaran Jul 2, 2025
c619f89
add alaSql to chat component
iamfaran Jul 2, 2025
01ed7dd
Updated structure and added support for nested components.
kamalqureshi Jul 2, 2025
f379cac
delete myruntime provider
iamfaran Jul 2, 2025
4197d0b
Merge branch 'dev' into actions_js_console
kamalqureshi Jul 3, 2025
e553d52
add storage support
iamfaran Jul 3, 2025
dbd901c
add delete thread functionality
iamfaran Jul 3, 2025
bf9f269
add rename thread ability
iamfaran Jul 3, 2025
0205c72
[Feat]: Add chat component
iamfaran Jul 4, 2025
be3b3ab
Merge branch 'dev' of github.com:lowcoder-org/lowcoder into feat/chat…
iamfaran Jul 4, 2025
85f8df1
Merge pull request #1841 from iamfaran/feat/chat-component
raheeliftikhar5 Jul 5, 2025
003d38e
Merge pull request #1832 from kamalqureshi/actions_js_console
raheeliftikhar5 Jul 5, 2025
2bb9ae8
update chat component to be used in bottom panel
raheeliftikhar5 Jul 7, 2025
e14a7e7
added chat option in bottom panel
raheeliftikhar5 Jul 7, 2025
18045b9
Added Styling actions (Fixed Constant)
kamalqureshi Jul 7, 2025
734b320
Merge pull request #1846 from kamalqureshi/actions_js_console
raheeliftikhar5 Jul 7, 2025
d6cea0c
workflow integration
raheeliftikhar5 Jul 8, 2025
84c165b
mapped nest_component and set_properties action
raheeliftikhar5 Jul 11, 2025
6d5fbfd
update actions
raheeliftikhar5 Jul 18, 2025
d3142c1
Adds dynamic layer indexing
kamalqureshi Jul 8, 2025
86a12f0
fixed: Layout components issue, children components depth issues
kamalqureshi Jul 8, 2025
79b5e83
Event handlers for all components.
kamalqureshi Jul 9, 2025
d13b799
Update App meta data
kamalqureshi Jul 10, 2025
8afeae1
Publish App, Test App, Apply Global JS and CSS
kamalqureshi Jul 10, 2025
38e770c
Sharing App Permissions
kamalqureshi Jul 11, 2025
caacd01
multiple new actions added
kamalqureshi Jul 14, 2025
1dddc59
Updated Global CSS
kamalqureshi Jul 14, 2025
a380978
Update App meta data
kamalqureshi Jul 10, 2025
4585d15
[feat] replace mock data with query
iamfaran Jul 7, 2025
75e635a
[Feat]: make chat component flexible
iamfaran Jul 7, 2025
56e5247
setup sse http query
iamfaran Jul 8, 2025
4664b5b
fix linter errors
iamfaran Jul 8, 2025
188f9cb
setup http streaming with dummy data
iamfaran Jul 8, 2025
7b68581
setup frontend for ssehttpquery
iamfaran Jul 9, 2025
cf0b99c
chat component refactor
iamfaran Jul 10, 2025
a349af4
add unique storage / expose convo history
iamfaran Jul 11, 2025
5d88dbe
add event listeners for the chat component
iamfaran Jul 14, 2025
ac38c66
add system prompt and improve edit UI
iamfaran Jul 15, 2025
b2dcf3f
add docs button in chat component
iamfaran Jul 15, 2025
35b0614
fix no threads infinite re render
iamfaran Jul 16, 2025
b2d9d11
fix table name for better queries
iamfaran Jul 16, 2025
aa40585
add custom loader
iamfaran Jul 16, 2025
b1bc01a
add translations for the chat component
iamfaran Jul 18, 2025
68b2802
remove console logs
iamfaran Jul 18, 2025
4f9fbba
add file attachments components
iamfaran Jul 22, 2025
2014590
Merge pull request #1853 from kamalqureshi/actions_js_console
raheeliftikhar5 Jul 22, 2025
7c291df
Merge pull request #1850 from iamfaran/feat/chat-component
raheeliftikhar5 Jul 22, 2025
3536b2b
integrations more actions
raheeliftikhar5 Jul 28, 2025
cc90557
handle event handlers
raheeliftikhar5 Aug 11, 2025
25b0f43
added delete_component action
raheeliftikhar5 Aug 20, 2025
0e765e3
updated n8n workflow url
raheeliftikhar5 Aug 20, 2025
5e855a5
Skeleton structure for real time chat component using pluv.io and yjs
kamalqureshi Aug 27, 2025
bc6ea20
test
raheeliftikhar5 Sep 1, 2025
0d5a7ab
added chat controller component to expose chat data/methods
raheeliftikhar5 Sep 12, 2025
86dec70
expose joinUser method from chat controller comp
raheeliftikhar5 Sep 15, 2025
0eb7dd2
added events in chat component
raheeliftikhar5 Sep 15, 2025
2138238
Merge pull request #1997 from kamalqureshi/chat_component
raheeliftikhar5 Sep 15, 2025
132c58a
add file attachments support for chat component
iamfaran Jul 23, 2025
02552c5
fix current message update text
iamfaran Jul 24, 2025
af7185e
optimize history
iamfaran Jul 24, 2025
e101e9b
improve attachment logic
iamfaran Jul 24, 2025
0f0a4d0
replace shadcn dialog with antD modal
iamfaran Jul 25, 2025
b11daa7
Merge pull request #1893 from iamfaran/feat/chat-file-attachments
raheeliftikhar5 Sep 15, 2025
e0a18e0
fix conversation history
iamfaran Feb 10, 2026
74f1787
fix height messages window + add height mode (auto/fixed) for chat co…
iamfaran Feb 10, 2026
b4620e5
add style customization
iamfaran Feb 11, 2026
5875702
seperate chat panel component
iamfaran Feb 12, 2026
11bb844
complete chat styles
iamfaran Feb 12, 2026
a12a9b9
refactor ai chat & chat panel component
iamfaran Feb 13, 2026
e3fe298
fix re rendering issue
iamfaran Feb 16, 2026
c970bc2
fix button forward ref + ChatProvider level
iamfaran Feb 16, 2026
64dddc0
fix styling warninings
iamfaran Feb 17, 2026
5ef4403
refactor styles and add storage cleaner for bottom chat panel
iamfaran Feb 17, 2026
a46c1f7
fix attachment file adaptor for chat component
iamfaran Feb 18, 2026
4d22430
add messageInstance for throwing errors in attachments for AI chat co…
iamfaran Feb 18, 2026
7fd74ca
remove unnecessary settings from the AI chat component
iamfaran Feb 19, 2026
0c4e885
fix image attachments preview and remove attachments from the bottom …
iamfaran Feb 20, 2026
57fd468
add chatCompv2 + new chatData store
iamfaran Feb 25, 2026
18abefb
setup basic data structure for chatv2
iamfaran Feb 26, 2026
d8a8423
add yjs support
iamfaran Feb 27, 2026
362e362
fix linter errors
iamfaran Mar 3, 2026
6a1911b
add typing indicators
iamfaran Mar 3, 2026
bf08ee3
refactor chatbox styles, modes and fix registry
iamfaran Mar 4, 2026
6a0ff47
refactor chatbox to multiple files
iamfaran Mar 5, 2026
0a4fe35
remove duplication of modes
iamfaran Mar 5, 2026
7d40041
add testing chat controller
iamfaran Mar 6, 2026
58598dc
add typing state via awareness protocol
iamfaran Mar 6, 2026
9622f2d
add LLM chat room for chatbox
iamfaran Mar 9, 2026
a8a7522
add room invites + pluv integration
iamfaran Mar 10, 2026
33b9efe
fix pluv integration issues
iamfaran Mar 11, 2026
4da29c4
add chatController architecture
iamfaran Mar 12, 2026
c1030f6
complete chatcontroller architecture
iamfaran Mar 13, 2026
c26d9b1
add rooms in the chatbox UI + fix controller issues
iamfaran Mar 13, 2026
6ae7385
fix TS errors + chatbox context
iamfaran Mar 16, 2026
d5b6b62
add online presence rooms
iamfaran Mar 16, 2026
ab37868
fix message styles, autoscroll and pluv server
iamfaran Mar 17, 2026
c2daad6
add shared state and fix date format
iamfaran Mar 18, 2026
1206216
Add custom styles for the chatbox component
iamfaran Mar 24, 2026
47efd75
fix property view layout + padding/radius issues for the chatbox comp…
iamfaran Mar 25, 2026
44779a6
add hocuspocus server
iamfaran Mar 26, 2026
5f87866
fix hocuspocus integration for chatbox issues
iamfaran Mar 27, 2026
89ce6d8
Delete legacy chatbox and chatControllerComp
iamfaran Mar 30, 2026
68195aa
add translations for chatbox and chatcontroller
iamfaran Mar 30, 2026
1ca4d85
update Chatbox and ChatController name
iamfaran Mar 31, 2026
9016da1
Merge branch 'dev' of github.com:lowcoder-org/lowcoder into feat/ai
iamfaran Mar 31, 2026
a9e37a3
fix type error publishApplication action
iamfaran Mar 31, 2026
342502d
remove outdated readme files
iamfaran Apr 1, 2026
65fc64a
fix: warning eslint unsupported version
iamfaran Apr 1, 2026
5e4127d
fix: search filter navigation in chatbox
iamfaran Apr 2, 2026
0652a07
add docs for the chat components
iamfaran Apr 2, 2026
f082c6e
fix AI Assistant flow
raheeliftikhar5 Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"shelljs": "^0.8.5",
"svgo": "^3.0.0",
"ts-node": "^10.4.0",
"typescript": "^4.8.4",
"typescript": "^5.6.2",
"whatwg-fetch": "^3.6.2"
},
"lint-staged": {
Expand Down
3 changes: 3 additions & 0 deletions client/packages/lowcoder-design/src/icons/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { lazy, Suspense } from "react";

export { ReactComponent as AIGenerate } from "./remix/ai-generate.svg";
export { ReactComponent as AIGenerate2 } from "./remix/ai-generate-2.svg";
export { ReactComponent as AIGenerateText } from "./remix/ai-generate-text.svg";
export { ReactComponent as AppSnapshotIcon } from "./v1/app-snapshot.svg";
export { ReactComponent as ArchiveIcon } from "./remix/archive-fill.svg";
export { ReactComponent as HookCompDropIcon } from "./v1/hook-comp-drop.svg";
Expand Down
3 changes: 3 additions & 0 deletions client/packages/lowcoder/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": ["react-app"],
"plugins": ["only-ascii"],
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false
},
"rules": {
// "react-hooks/exhaustive-deps": "off"
//"only-ascii/only-ascii": "error"
Expand Down
84 changes: 84 additions & 0 deletions client/packages/lowcoder/hocuspocus-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env node

/**
* Hocuspocus (Yjs WebSocket) Server for ChatBox v2
*
* Provides real-time shared state via Yjs documents served over WebSocket.
* Each application room maps to a Yjs document. Presence is handled through
* Hocuspocus awareness on the client side.
*
* Env vars:
* PORT - HTTP/WebSocket port (default 3006)
* HOST - Bind address (default 0.0.0.0)
* HOCUSPOCUS_SECRET - Optional shared secret for token auth
*
* Usage: node hocuspocus-server.js
*/

import { Server } from "@hocuspocus/server";

const PORT = parseInt(process.env.PORT || "3006", 10);
const HOST = process.env.HOST || "0.0.0.0";
const SECRET = process.env.HOCUSPOCUS_SECRET || "";

function writeJson(response, statusCode, payload) {
response.writeHead(statusCode, { "Content-Type": "application/json" });
response.end(JSON.stringify(payload));
}

const server = new Server({
name: "lowcoder-hocuspocus",
quiet: true,
address: HOST,
port: PORT,

async onListen() {
console.log(`[hocuspocus] listening on ws://${HOST}:${PORT}`);
},

async onRequest({ request, response }) {
if (request.url === "/health") {
writeJson(response, 200, {
status: "ok",
host: HOST,
port: PORT,
auth: SECRET ? "enabled" : "disabled",
});
return;
}

if (request.url === "/") {
writeJson(response, 200, {
name: "lowcoder-hocuspocus",
websocket: `ws://${HOST}:${PORT}`,
health: "/health",
});
}
},

async onAuthenticate({ token, documentName }) {
if (!SECRET) {
return;
}

if (token !== SECRET) {
console.warn(`[hocuspocus] rejected connection for ${documentName}: invalid token`);
throw new Error("Unauthorized");
}
},

async onConnect({ documentName, socketId }) {
console.log(`[hocuspocus] connect socket=${socketId} document=${documentName}`);
},

async onDisconnect({ documentName, socketId }) {
console.log(`[hocuspocus] disconnect socket=${socketId} document=${documentName}`);
},
});

try {
await server.listen();
} catch (error) {
console.error("[hocuspocus] failed to start", error);
process.exit(1);
}
29 changes: 26 additions & 3 deletions client/packages/lowcoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"main": "src/index.sdk.ts",
"types": "src/index.sdk.ts",
"dependencies": {
"@ai-sdk/openai": "^1.3.22",
"@ant-design/icons": "^5.3.0",
"@assistant-ui/react": "^0.10.24",
"@assistant-ui/react-ai-sdk": "^0.10.14",
"@assistant-ui/react-markdown": "^0.10.5",
"@assistant-ui/styles": "^0.1.13",
"@bany/curl-to-json": "^1.2.8",
"@codemirror/autocomplete": "^6.11.1",
"@codemirror/commands": "^6.3.2",
Expand All @@ -25,9 +30,15 @@
"@fortawesome/free-regular-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "latest",
"@hocuspocus/provider": "^3.4.4",
"@hocuspocus/server": "^3.4.4",
"@jsonforms/core": "^3.5.1",
"@lottiefiles/dotlottie-react": "^0.13.0",
"@manaflair/redux-batch": "^1.0.0",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-tooltip": "^1.2.7",
"@rjsf/antd": "^5.24.9",
"@rjsf/core": "^5.24.9",
"@rjsf/utils": "^5.24.9",
Expand All @@ -37,22 +48,27 @@
"@types/react-signature-canvas": "^1.0.2",
"@types/react-test-renderer": "^18.0.0",
"@types/react-virtualized": "^9.21.21",
"@y/websocket-server": "^0.1.1",
"ai": "^4.3.16",
"alasql": "^4.6.6",
"animate.css": "^4.1.1",
"antd": "^5.25.2",
"axios": "^1.7.7",
"buffer": "^6.0.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.0.0",
"cnchar": "^3.2.4",
"coolshapes-react": "lowcoder-org/coolshapes-react",
"copy-to-clipboard": "^3.3.3",
"core-js": "^3.25.2",
"cors": "^2.8.6",
"dayjs": "^1.11.13",
"dnd-kit-sortable-tree": "^0.1.73",
"echarts": "^5.4.3",
"echarts-for-react": "^3.0.2",
"echarts-wordcloud": "^2.1.0",
"eslint4b-prebuilt-2": "^7.32.0",
"express": "^5.2.1",
"file-saver": "^2.0.5",
"github-markdown-css": "^5.1.0",
"hotkeys-js": "^3.8.7",
Expand All @@ -62,6 +78,7 @@
"loglevel": "^1.8.0",
"lowcoder-core": "workspace:^",
"lowcoder-design": "workspace:^",
"lucide-react": "^0.525.0",
"mime": "^3.0.0",
"moment": "^2.29.4",
"numbro": "^2.3.6",
Expand Down Expand Up @@ -99,7 +116,7 @@
"regenerator-runtime": "^0.13.9",
"rehype-raw": "^6.1.1",
"rehype-sanitize": "^5.0.1",
"remark-gfm": "^4.0.0",
"remark-gfm": "^4.0.1",
"resize-observer-polyfill": "^1.5.1",
"simplebar-react": "^3.2.4",
"sql-formatter": "^8.2.0",
Expand All @@ -111,7 +128,13 @@
"ua-parser-js": "^1.0.33",
"uuid": "^9.0.0",
"web-vitals": "^2.1.0",
"xlsx": "^0.18.5"
"ws": "^8.18.3",
"xlsx": "^0.18.5",
"y-indexeddb": "^9.0.12",
"y-protocols": "^1.0.6",
"y-websocket": "^3.0.0",
"yjs": "^13.6.27",
"zod": "^3.25.76"
},
"scripts": {
"supportedBrowsers": "yarn dlx browserslist-useragent-regexp --allowHigherVersions '>0.2%,not dead,not op_mini all,chrome >=69'",
Expand All @@ -137,7 +160,7 @@
"http-proxy-middleware": "^2.0.6",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^4.8.4",
"typescript": "^5.6.2",
"vite": "^4.5.5",
"vite-plugin-checker": "^0.5.1",
"vite-plugin-dynamic-import": "^1.5.0",
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/app-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ declare var REACT_APP_ENV: string;
declare var REACT_APP_BUILD_ID: string;
declare var REACT_APP_LOG_LEVEL: string;
declare var REACT_APP_SERVER_IPS: string;
declare var REACT_APP_HOCUSPOCUS_URL: string;
declare var REACT_APP_HOCUSPOCUS_SECRET: string;
declare var REACT_APP_BUNDLE_TYPE: "sdk" | "app";
declare var REACT_APP_DISABLE_JS_SANDBOX: string;
declare var REACT_APP_BUNDLE_BUILTIN_PLUGIN: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ExposingCompletionSource extends CompletionSource {
return null;
}
const matchPath = context.matchBefore(
/(?:[A-Za-z_$][\w$]*(?:\[\s*(?:\d+|(["'])(?:[^\1\\]|\\.)*?\1)\s*\])*\.)*(?:[A-Za-z_$][\w$]*)?/
/(?:[A-Za-z_$][\w$]*(?:\[\s*(?:\d+|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")\s*\])*\.)*(?:[A-Za-z_$][\w$]*)?/
);
if (!matchPath) {
return null;
Expand Down
12 changes: 11 additions & 1 deletion client/packages/lowcoder/src/components/ResCreatePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { BottomResTypeEnum } from "types/bottomRes";
import { LargeBottomResIconWrapper } from "util/bottomResUtils";
import type { PageType } from "../constants/pageConstants";
import type { SizeType } from "antd/es/config-provider/SizeContext";
import { Datasource } from "constants/datasourceConstants";
import { Datasource, QUICK_SSE_HTTP_API_ID } from "constants/datasourceConstants";
import {
QUICK_GRAPHQL_ID,
QUICK_REST_API_ID,
Expand Down Expand Up @@ -172,13 +172,22 @@ const ResButton = (props: {
compType: "streamApi",
},
},

alasql: {
label: trans("query.quickAlasql"),
type: BottomResTypeEnum.Query,
extra: {
compType: "alasql",
},
},
sseHttpApi: {
label: trans("query.quickSseHttpAPI"),
type: BottomResTypeEnum.Query,
extra: {
compType: "sseHttpApi",
dataSourceId: QUICK_SSE_HTTP_API_ID,
},
},
graphql: {
label: trans("query.quickGraphql"),
type: BottomResTypeEnum.Query,
Expand Down Expand Up @@ -339,6 +348,7 @@ export function ResCreatePanel(props: ResCreateModalProps) {
<DataSourceListWrapper $placement={placement}>
<ResButton size={buttonSize} identifier={"restApi"} onSelect={onSelect} />
<ResButton size={buttonSize} identifier={"streamApi"} onSelect={onSelect} />
<ResButton size={buttonSize} identifier={"sseHttpApi"} onSelect={onSelect} />
<ResButton size={buttonSize} identifier={"alasql"} onSelect={onSelect} />
<ResButton size={buttonSize} identifier={"graphql"} onSelect={onSelect} />
<DataSourceButton size={buttonSize} onClick={() => setCurlModalVisible(true)}>
Expand Down
3 changes: 2 additions & 1 deletion client/packages/lowcoder/src/components/StepModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export interface StepModalProps extends CustomModalProps {
export default function StepModal(props: StepModalProps) {
const { steps, activeStepKey, onStepChange, ...modalProps } = props;
const [current, setCurrent] = useState(steps[0]?.key);
const currentStepIndex = steps.findIndex((i) => i.key === (activeStepKey ?? current));
const currentStepKey = activeStepKey ?? current;
const currentStepIndex = steps.findIndex((i) => i.key === currentStepKey);
const currentStep = currentStepIndex >= 0 ? steps[currentStepIndex] : null;

const handleChangeStep = (key: string) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { createContext, useContext } from "react";
import type { ChatRoom, OnlineUser, PendingRoomInvite } from "./store";
import type {
ChatBoxContainerStyleType,
ChatBoxSidebarStyleType,
ChatBoxHeaderStyleType,
ChatBoxMessageStyleType,
ChatBoxInputStyleType,
AnimationStyleType,
} from "comps/controls/styleControlConstants";

type ChatEventName =
| "messageSent"
| "startTyping"
| "stopTyping"
| "roomSwitch"
| "roomLeave"
| "roomCreate"
| "inviteSend"
| "inviteAccept"
| "inviteDecline";

interface ExposedState {
value: string;
onChange: (v: string) => void;
}

export interface ChatBoxContextValue {
// Data
messages: any[];
rooms: ChatRoom[];
currentRoomId: string;
currentRoom: ChatRoom | null;
currentUserId: string;
currentUserName: string;
typingUsers: any[];
onlineUsers: OnlineUser[];
pendingInvites: PendingRoomInvite[];
isAiThinking: boolean;

// Exposed state
chatTitle: ExposedState;
messageText: ExposedState;
lastSentMessageText: ExposedState;

// UI config
showHeader: boolean;
showRoomsPanel: boolean;
roomsPanelWidth: string;
allowRoomCreation: boolean;
allowRoomSearch: boolean;
style: ChatBoxContainerStyleType;
animationStyle: AnimationStyleType;
sidebarStyle: ChatBoxSidebarStyleType;
headerStyle: ChatBoxHeaderStyleType;
messageStyle: ChatBoxMessageStyleType;
inputStyle: ChatBoxInputStyleType;

// Events
onEvent: (event: ChatEventName) => any;

// Room actions
onRoomSwitch: (roomId: string) => void;
onRoomLeave: (roomId: string) => void;
onRoomCreate: (
name: string,
type: "public" | "private" | "llm",
description?: string,
llmQueryName?: string,
) => void;
onInviteSend: (toUserId: string) => void;
onInviteAccept: (inviteId: string) => void;
onInviteDecline: (inviteId: string) => void;
}

export const ChatBoxContext = createContext<ChatBoxContextValue | null>(null);

export function useChatBox(): ChatBoxContextValue {
const ctx = useContext(ChatBoxContext);
if (!ctx) {
throw new Error("useChatBox must be used within a ChatBoxProvider");
}
return ctx;
}
Loading
Loading