Skip to content

Commit 1ca4d85

Browse files
committed
update Chatbox and ChatController name
1 parent 68195aa commit 1ca4d85

26 files changed

+366
-367
lines changed

client/packages/lowcoder/src/comps/comps/chatBoxComponentv2/ChatBoxContext.tsx renamed to client/packages/lowcoder/src/comps/comps/chatBoxComponent/ChatBoxContext.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { createContext, useContext } from "react";
22
import type { ChatRoom, OnlineUser, PendingRoomInvite } from "./store";
33
import type {
4-
ChatBoxV2ContainerStyleType,
5-
ChatBoxV2SidebarStyleType,
6-
ChatBoxV2HeaderStyleType,
7-
ChatBoxV2MessageStyleType,
8-
ChatBoxV2InputStyleType,
4+
ChatBoxContainerStyleType,
5+
ChatBoxSidebarStyleType,
6+
ChatBoxHeaderStyleType,
7+
ChatBoxMessageStyleType,
8+
ChatBoxInputStyleType,
99
AnimationStyleType,
1010
} from "comps/controls/styleControlConstants";
1111

@@ -50,12 +50,12 @@ export interface ChatBoxContextValue {
5050
roomsPanelWidth: string;
5151
allowRoomCreation: boolean;
5252
allowRoomSearch: boolean;
53-
style: ChatBoxV2ContainerStyleType;
53+
style: ChatBoxContainerStyleType;
5454
animationStyle: AnimationStyleType;
55-
sidebarStyle: ChatBoxV2SidebarStyleType;
56-
headerStyle: ChatBoxV2HeaderStyleType;
57-
messageStyle: ChatBoxV2MessageStyleType;
58-
inputStyle: ChatBoxV2InputStyleType;
55+
sidebarStyle: ChatBoxSidebarStyleType;
56+
headerStyle: ChatBoxHeaderStyleType;
57+
messageStyle: ChatBoxMessageStyleType;
58+
inputStyle: ChatBoxInputStyleType;
5959

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

client/packages/lowcoder/src/comps/comps/chatBoxComponentv2/README.md renamed to client/packages/lowcoder/src/comps/comps/chatBoxComponent/README.md

File renamed without changes.

client/packages/lowcoder/src/comps/comps/chatBoxComponentv2/READMEv2.md renamed to client/packages/lowcoder/src/comps/comps/chatBoxComponent/READMEv2.md

File renamed without changes.

client/packages/lowcoder/src/comps/comps/chatBoxComponentv2/UPDATED_MESSAGE_SENT_EXAMPLE.js renamed to client/packages/lowcoder/src/comps/comps/chatBoxComponent/UPDATED_MESSAGE_SENT_EXAMPLE.js

File renamed without changes.

client/packages/lowcoder/src/comps/comps/chatBoxComponentv2/chatBoxComp.tsx renamed to client/packages/lowcoder/src/comps/comps/chatBoxComponent/chatBoxComp.tsx

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import { eventHandlerControl } from "comps/controls/eventHandlerControl";
1414
import { styleControl } from "comps/controls/styleControl";
1515
import {
1616
AnimationStyle,
17-
ChatBoxV2ContainerStyle,
18-
ChatBoxV2SidebarStyle,
19-
ChatBoxV2HeaderStyle,
20-
ChatBoxV2MessageStyle,
21-
ChatBoxV2InputStyle,
17+
ChatBoxContainerStyle,
18+
ChatBoxSidebarStyle,
19+
ChatBoxHeaderStyle,
20+
ChatBoxMessageStyle,
21+
ChatBoxInputStyle,
2222
} from "comps/controls/styleControlConstants";
2323
import { hiddenPropertyView } from "comps/utils/propertyUtils";
2424
import { EditorContext } from "comps/editorState";
@@ -32,66 +32,66 @@ import type { ChatRoom, PendingRoomInvite } from "./store";
3232

3333
const ChatEvents = [
3434
{
35-
label: trans("chatBoxV2.messageSent"),
35+
label: trans("chatBox.messageSent"),
3636
value: "messageSent",
37-
description: trans("chatBoxV2.messageSentDesc"),
37+
description: trans("chatBox.messageSentDesc"),
3838
},
3939
{
40-
label: trans("chatBoxV2.startTyping"),
40+
label: trans("chatBox.startTyping"),
4141
value: "startTyping",
42-
description: trans("chatBoxV2.startTypingDesc"),
42+
description: trans("chatBox.startTypingDesc"),
4343
},
4444
{
45-
label: trans("chatBoxV2.stopTyping"),
45+
label: trans("chatBox.stopTyping"),
4646
value: "stopTyping",
47-
description: trans("chatBoxV2.stopTypingDesc"),
47+
description: trans("chatBox.stopTypingDesc"),
4848
},
4949
{
50-
label: trans("chatBoxV2.roomSwitch"),
50+
label: trans("chatBox.roomSwitch"),
5151
value: "roomSwitch",
52-
description: trans("chatBoxV2.roomSwitchDesc"),
52+
description: trans("chatBox.roomSwitchDesc"),
5353
},
5454
{
55-
label: trans("chatBoxV2.roomJoin"),
55+
label: trans("chatBox.roomJoin"),
5656
value: "roomJoin",
57-
description: trans("chatBoxV2.roomJoinDesc"),
57+
description: trans("chatBox.roomJoinDesc"),
5858
},
5959
{
60-
label: trans("chatBoxV2.roomLeave"),
60+
label: trans("chatBox.roomLeave"),
6161
value: "roomLeave",
62-
description: trans("chatBoxV2.roomLeaveDesc"),
62+
description: trans("chatBox.roomLeaveDesc"),
6363
},
6464
{
65-
label: trans("chatBoxV2.roomCreate"),
65+
label: trans("chatBox.roomCreate"),
6666
value: "roomCreate",
67-
description: trans("chatBoxV2.roomCreateDesc"),
67+
description: trans("chatBox.roomCreateDesc"),
6868
},
6969
{
70-
label: trans("chatBoxV2.inviteSend"),
70+
label: trans("chatBox.inviteSend"),
7171
value: "inviteSend",
72-
description: trans("chatBoxV2.inviteSendDesc"),
72+
description: trans("chatBox.inviteSendDesc"),
7373
},
7474
{
75-
label: trans("chatBoxV2.inviteAccept"),
75+
label: trans("chatBox.inviteAccept"),
7676
value: "inviteAccept",
77-
description: trans("chatBoxV2.inviteAcceptDesc"),
77+
description: trans("chatBox.inviteAcceptDesc"),
7878
},
7979
{
80-
label: trans("chatBoxV2.inviteDecline"),
80+
label: trans("chatBox.inviteDecline"),
8181
value: "inviteDecline",
82-
description: trans("chatBoxV2.inviteDeclineDesc"),
82+
description: trans("chatBox.inviteDeclineDesc"),
8383
},
8484
] as const;
8585

8686
// ─── Children map ────────────────────────────────────────────────────────────
8787

8888
const childrenMap = {
8989
// ── Chat content ─────────────────────────────────────────────────
90-
chatTitle: stringExposingStateControl("chatTitle", trans("chatBoxV2.chatTitleDefault")),
90+
chatTitle: stringExposingStateControl("chatTitle", trans("chatBox.chatTitleDefault")),
9191
showHeader: withDefault(BoolControl, true),
9292
messages: jsonArrayControl([]),
9393
currentUserId: withDefault(StringControl, "user_1"),
94-
currentUserName: withDefault(StringControl, trans("chatBoxV2.currentUserNameDefault")),
94+
currentUserName: withDefault(StringControl, trans("chatBox.currentUserNameDefault")),
9595
typingUsers: jsonArrayControl([]),
9696
isAiThinking: withDefault(BoolControl, false),
9797
lastSentMessageText: stringExposingStateControl("lastSentMessageText", ""),
@@ -119,12 +119,12 @@ const childrenMap = {
119119
// ── Style / layout ────────────────────────────────────────────────
120120
autoHeight: AutoHeightControl,
121121
onEvent: eventHandlerControl(ChatEvents),
122-
style: styleControl(ChatBoxV2ContainerStyle, "style"),
122+
style: styleControl(ChatBoxContainerStyle, "style"),
123123
animationStyle: styleControl(AnimationStyle, "animationStyle"),
124-
sidebarStyle: styleControl(ChatBoxV2SidebarStyle, "sidebarStyle"),
125-
headerStyle: styleControl(ChatBoxV2HeaderStyle, "headerStyle"),
126-
messageStyle: styleControl(ChatBoxV2MessageStyle, "messageStyle"),
127-
inputStyle: styleControl(ChatBoxV2InputStyle, "inputStyle"),
124+
sidebarStyle: styleControl(ChatBoxSidebarStyle, "sidebarStyle"),
125+
headerStyle: styleControl(ChatBoxHeaderStyle, "headerStyle"),
126+
messageStyle: styleControl(ChatBoxMessageStyle, "messageStyle"),
127+
inputStyle: styleControl(ChatBoxInputStyle, "inputStyle"),
128128
};
129129

130130
// ─── Property panel ──────────────────────────────────────────────────────────
@@ -137,62 +137,62 @@ const ChatBoxPropertyView = React.memo((props: { children: any }) => {
137137
<>
138138
<Section name={sectionNames.basic}>
139139
{children.chatTitle.propertyView({
140-
label: trans("chatBoxV2.chatTitleLabel"),
141-
tooltip: trans("chatBoxV2.chatTitleTooltip"),
140+
label: trans("chatBox.chatTitleLabel"),
141+
tooltip: trans("chatBox.chatTitleTooltip"),
142142
})}
143143
{children.messages.propertyView({
144-
label: trans("chatBoxV2.messagesLabel"),
145-
tooltip: trans("chatBoxV2.messagesTooltip"),
144+
label: trans("chatBox.messagesLabel"),
145+
tooltip: trans("chatBox.messagesTooltip"),
146146
})}
147147
{children.currentUserId.propertyView({
148-
label: trans("chatBoxV2.currentUserIdLabel"),
149-
tooltip: trans("chatBoxV2.currentUserIdTooltip"),
148+
label: trans("chatBox.currentUserIdLabel"),
149+
tooltip: trans("chatBox.currentUserIdTooltip"),
150150
})}
151151
{children.currentUserName.propertyView({
152-
label: trans("chatBoxV2.currentUserNameLabel"),
153-
tooltip: trans("chatBoxV2.currentUserNameTooltip"),
152+
label: trans("chatBox.currentUserNameLabel"),
153+
tooltip: trans("chatBox.currentUserNameTooltip"),
154154
})}
155155
</Section>
156156

157-
<Section name={trans("chatBoxV2.roomsPanelSection")}>
158-
{children.showRoomsPanel.propertyView({ label: trans("chatBoxV2.showRoomsPanelLabel") })}
157+
<Section name={trans("chatBox.roomsPanelSection")}>
158+
{children.showRoomsPanel.propertyView({ label: trans("chatBox.showRoomsPanelLabel") })}
159159
{children.roomsPanelWidth.propertyView({
160-
label: trans("chatBoxV2.panelWidthLabel"),
161-
tooltip: trans("chatBoxV2.panelWidthTooltip"),
160+
label: trans("chatBox.panelWidthLabel"),
161+
tooltip: trans("chatBox.panelWidthTooltip"),
162162
})}
163163
{children.rooms.propertyView({
164-
label: trans("chatBoxV2.roomsLabel"),
165-
tooltip: trans("chatBoxV2.roomsTooltip"),
164+
label: trans("chatBox.roomsLabel"),
165+
tooltip: trans("chatBox.roomsTooltip"),
166166
})}
167167
{children.currentRoomId.propertyView({
168-
label: trans("chatBoxV2.currentRoomIdLabel"),
169-
tooltip: trans("chatBoxV2.currentRoomIdTooltip"),
168+
label: trans("chatBox.currentRoomIdLabel"),
169+
tooltip: trans("chatBox.currentRoomIdTooltip"),
170170
})}
171171
{children.pendingInvites.propertyView({
172-
label: trans("chatBoxV2.pendingInvitesLabel"),
173-
tooltip: trans("chatBoxV2.pendingInvitesTooltip"),
172+
label: trans("chatBox.pendingInvitesLabel"),
173+
tooltip: trans("chatBox.pendingInvitesTooltip"),
174174
})}
175-
{children.allowRoomCreation.propertyView({ label: trans("chatBoxV2.allowRoomCreationLabel") })}
176-
{children.allowRoomSearch.propertyView({ label: trans("chatBoxV2.allowRoomSearchLabel") })}
175+
{children.allowRoomCreation.propertyView({ label: trans("chatBox.allowRoomCreationLabel") })}
176+
{children.allowRoomSearch.propertyView({ label: trans("chatBox.allowRoomSearchLabel") })}
177177
</Section>
178178

179-
<Section name={trans("chatBoxV2.realTimeSection")}>
179+
<Section name={trans("chatBox.realTimeSection")}>
180180
{children.typingUsers.propertyView({
181-
label: trans("chatBoxV2.typingUsersLabel"),
182-
tooltip: trans("chatBoxV2.typingUsersTooltip"),
181+
label: trans("chatBox.typingUsersLabel"),
182+
tooltip: trans("chatBox.typingUsersTooltip"),
183183
})}
184184
{children.isAiThinking.propertyView({
185-
label: trans("chatBoxV2.aiIsThinkingLabel"),
186-
tooltip: trans("chatBoxV2.aiIsThinkingTooltip"),
185+
label: trans("chatBox.aiIsThinkingLabel"),
186+
tooltip: trans("chatBox.aiIsThinkingTooltip"),
187187
})}
188188
{children.onlineUsers.propertyView({
189-
label: trans("chatBoxV2.onlineUsersLabel"),
190-
tooltip: trans("chatBoxV2.onlineUsersTooltip"),
189+
label: trans("chatBox.onlineUsersLabel"),
190+
tooltip: trans("chatBox.onlineUsersTooltip"),
191191
})}
192192
</Section>
193193

194-
<Section name={trans("chatBoxV2.displaySection")}>
195-
{children.showHeader.propertyView({ label: trans("chatBoxV2.showHeaderLabel") })}
194+
<Section name={trans("chatBox.displaySection")}>
195+
{children.showHeader.propertyView({ label: trans("chatBox.showHeaderLabel") })}
196196
</Section>
197197

198198
{["logic", "both"].includes(editorMode) && (
@@ -210,16 +210,16 @@ const ChatBoxPropertyView = React.memo((props: { children: any }) => {
210210
<Section name={sectionNames.style}>
211211
{children.style.getPropertyView()}
212212
</Section>
213-
<Section name={trans("chatBoxV2.sidebarStyleSection")}>
213+
<Section name={trans("chatBox.sidebarStyleSection")}>
214214
{children.sidebarStyle.getPropertyView()}
215215
</Section>
216-
<Section name={trans("chatBoxV2.headerStyleSection")}>
216+
<Section name={trans("chatBox.headerStyleSection")}>
217217
{children.headerStyle.getPropertyView()}
218218
</Section>
219-
<Section name={trans("chatBoxV2.messageStyleSection")}>
219+
<Section name={trans("chatBox.messageStyleSection")}>
220220
{children.messageStyle.getPropertyView()}
221221
</Section>
222-
<Section name={trans("chatBoxV2.inputStyleSection")}>
222+
<Section name={trans("chatBox.inputStyleSection")}>
223223
{children.inputStyle.getPropertyView()}
224224
</Section>
225225
<Section name={sectionNames.animationStyle} hasTooltip={true}>
@@ -231,11 +231,11 @@ const ChatBoxPropertyView = React.memo((props: { children: any }) => {
231231
);
232232
});
233233

234-
ChatBoxPropertyView.displayName = "ChatBoxV2PropertyView";
234+
ChatBoxPropertyView.displayName = "ChatBoxPropertyView";
235235

236236
// ─── Component ───────────────────────────────────────────────────────────────
237237

238-
let ChatBoxV2Tmp = (function () {
238+
let ChatBoxTmp = (function () {
239239
return new UICompBuilder(childrenMap, (props) => {
240240
const messages = Array.isArray(props.messages) ? props.messages : [];
241241
const rooms = (Array.isArray(props.rooms) ? props.rooms : []) as unknown as ChatRoom[];
@@ -327,41 +327,41 @@ let ChatBoxV2Tmp = (function () {
327327
.build();
328328
})();
329329

330-
ChatBoxV2Tmp = class extends ChatBoxV2Tmp {
330+
ChatBoxTmp = class extends ChatBoxTmp {
331331
override autoHeight(): boolean {
332332
return this.children.autoHeight.getView();
333333
}
334334
};
335335

336-
export const ChatBoxV2Comp = withExposingConfigs(ChatBoxV2Tmp, [
337-
new NameConfig("chatTitle", trans("chatBoxV2.chatTitleExposed")),
336+
export const ChatBoxComp = withExposingConfigs(ChatBoxTmp, [
337+
new NameConfig("chatTitle", trans("chatBox.chatTitleExposed")),
338338
new NameConfig(
339339
"lastSentMessageText",
340-
trans("chatBoxV2.lastSentMessageTextExposed"),
340+
trans("chatBox.lastSentMessageTextExposed"),
341341
),
342-
new NameConfig("messageText", trans("chatBoxV2.messageTextExposed")),
343-
new NameConfig("currentRoomId", trans("chatBoxV2.currentRoomIdExposed")),
342+
new NameConfig("messageText", trans("chatBox.messageTextExposed")),
343+
new NameConfig("currentRoomId", trans("chatBox.currentRoomIdExposed")),
344344
new NameConfig(
345345
"pendingRoomId",
346-
trans("chatBoxV2.pendingRoomIdExposed"),
346+
trans("chatBox.pendingRoomIdExposed"),
347347
),
348-
new NameConfig("newRoomName", trans("chatBoxV2.newRoomNameExposed")),
348+
new NameConfig("newRoomName", trans("chatBox.newRoomNameExposed")),
349349
new NameConfig(
350350
"newRoomType",
351-
trans("chatBoxV2.newRoomTypeExposed"),
351+
trans("chatBox.newRoomTypeExposed"),
352352
),
353-
new NameConfig("newRoomDescription", trans("chatBoxV2.newRoomDescriptionExposed")),
353+
new NameConfig("newRoomDescription", trans("chatBox.newRoomDescriptionExposed")),
354354
new NameConfig(
355355
"newRoomLlmQuery",
356-
trans("chatBoxV2.newRoomLlmQueryExposed"),
356+
trans("chatBox.newRoomLlmQueryExposed"),
357357
),
358358
new NameConfig(
359359
"inviteTargetUserId",
360-
trans("chatBoxV2.inviteTargetUserIdExposed"),
360+
trans("chatBox.inviteTargetUserIdExposed"),
361361
),
362362
new NameConfig(
363363
"pendingInviteId",
364-
trans("chatBoxV2.pendingInviteIdExposed"),
364+
trans("chatBox.pendingInviteIdExposed"),
365365
),
366366
NameConfigHidden,
367367
]);

client/packages/lowcoder/src/comps/comps/chatBoxComponentv2/components/ChatBoxView.tsx renamed to client/packages/lowcoder/src/comps/comps/chatBoxComponent/components/ChatBoxView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const ChatBoxView = React.memo(() => {
6262
{ctx.currentRoomId && roomOnlineCount > 0 && (
6363
<OnlineCountBadge>
6464
<OnlineCountDot />
65-
{trans("chatBoxV2.onlineCount", { count: roomOnlineCount })}
65+
{trans("chatBox.onlineCount", { count: roomOnlineCount })}
6666
</OnlineCountBadge>
6767
)}
6868
</ChatHeaderBar>
@@ -122,4 +122,4 @@ export const ChatBoxView = React.memo(() => {
122122
);
123123
});
124124

125-
ChatBoxView.displayName = "ChatBoxV2View";
125+
ChatBoxView.displayName = "ChatBoxView";

0 commit comments

Comments
 (0)