impact-ui 5.0.2-alpha.1 → 5.0.2-alpha.2
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/Badge/index.js +1 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +1 -1
- package/dist/components/Panel/Panel.types.d.ts +0 -7
- package/dist/components/Panel/Panel.types.d.ts.map +1 -1
- package/dist/components/Panel/index.d.ts +1 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +2 -5
- package/dist/components/TableChat/EmptyContainer.js +3 -3
- package/dist/components/TableChat/TableChatSidePanel.d.ts +1 -2
- package/dist/components/TableChat/TableChatSidePanel.d.ts.map +1 -1
- package/dist/components/TableChat/TableChatSidePanel.js +23 -214
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts +2 -4
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.js +24 -55
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.js +2 -3
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.js +43 -20
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +2 -37
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +18 -54
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts +1 -4
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +81 -90
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -2
- package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.js +65 -0
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +4 -11
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js +56 -67
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts +1 -8
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.js +4 -170
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts +1 -5
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +124 -138
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts +9 -11
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +106 -102
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +17 -0
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +1 -4
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts +1 -2
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +215 -327
- package/dist/components/TableChat/components/chatConfig.js +1 -0
- package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
- package/dist/components/TableV36/AgGridHeader.js +22 -3
- package/dist/components/TableV36/index.d.ts.map +1 -1
- package/dist/components/TableV36/index.js +8 -135
- package/dist/components/TableV36/tableHeader.d.ts +1 -5
- package/dist/components/TableV36/tableHeader.d.ts.map +1 -1
- package/dist/components/TableV36/tableHeader.js +11 -36
- package/dist/locales/de-DE.json.d.ts +3 -16
- package/dist/locales/de-DE.json.js +3 -15
- package/dist/locales/en-US.json.d.ts +3 -16
- package/dist/locales/en-US.json.js +3 -15
- package/dist/locales/es-ES.json.d.ts +3 -16
- package/dist/locales/es-ES.json.js +3 -15
- package/dist/mcp-component-registry.json +7 -1
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +156 -250
- package/dist/stories/tableV36ChatApiMock.d.ts +74 -222
- package/dist/stories/tableV36ChatApiMock.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/_virtual/Check.js +0 -4
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.d.ts +0 -11
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.d.ts.map +0 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.js +0 -57
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.d.ts +0 -12
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.d.ts.map +0 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.js +0 -132
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.js +0 -29
- package/dist/components/TableV36/withChatIndicator.d.ts +0 -3
- package/dist/components/TableV36/withChatIndicator.d.ts.map +0 -1
- package/dist/components/TableV36/withChatIndicator.js +0 -89
- package/dist/node_modules/@mui/icons-material/Check.js +0 -17
package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import default_1 from "../../../../../node_modules/@mui/icons-material/Close.js";
|
|
4
|
-
import default_1
|
|
5
|
-
import default_1$
|
|
6
|
-
import default_1$
|
|
3
|
+
import default_1$2 from "../../../../../node_modules/@mui/icons-material/Close.js";
|
|
4
|
+
import default_1 from "../../../../../node_modules/@mui/icons-material/ExpandLessOutlined.js";
|
|
5
|
+
import default_1$1 from "../../../../../node_modules/@mui/icons-material/ExpandMoreOutlined.js";
|
|
6
|
+
import default_1$3 from "../../../../../node_modules/@mui/icons-material/Search.js";
|
|
7
7
|
import { getAssetUrl } from "../../../../../utils/assetBase.js";
|
|
8
8
|
import { Button } from "../../../../Button/index.js";
|
|
9
9
|
import { Input } from "../../../../Input/index.js";
|
|
@@ -13,7 +13,7 @@ import AvatarGroup from "../AvatarGroup/AvatarGroup.js";
|
|
|
13
13
|
import { ChatNotificationSettings } from "../ChatNotificationSettings/ChatNotificationSettings.js";
|
|
14
14
|
import { useTranslation } from "../../../../../i18n/useTranslation.js";
|
|
15
15
|
const PinnedIcon = getAssetUrl("icons/pinnedIcon.svg");
|
|
16
|
-
getAssetUrl("icons/searchIcon.svg");
|
|
16
|
+
const SearchIcon = getAssetUrl("icons/searchIcon.svg");
|
|
17
17
|
const UserPlusIcon = getAssetUrl("icons/userPlusIcon1.svg");
|
|
18
18
|
const ThreedotIcon = getAssetUrl("icons/treedotIcon.svg");
|
|
19
19
|
const ChatHeaderAction = ({
|
|
@@ -42,7 +42,7 @@ const ChatHeaderAction = ({
|
|
|
42
42
|
setSelectedMenuItems,
|
|
43
43
|
handleThreeDotMenuClose,
|
|
44
44
|
notificationSettings,
|
|
45
|
-
maxAvatars =
|
|
45
|
+
maxAvatars = 2,
|
|
46
46
|
selectedRadioOption,
|
|
47
47
|
chatId,
|
|
48
48
|
menuOptions,
|
|
@@ -57,10 +57,9 @@ const ChatHeaderAction = ({
|
|
|
57
57
|
showParticipants = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.showParticipants,
|
|
58
58
|
showThreeDotMenu = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.showThreeDotMenu,
|
|
59
59
|
className = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.className,
|
|
60
|
-
searchPlaceholder
|
|
60
|
+
searchPlaceholder = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.searchPlaceholder,
|
|
61
61
|
isAddParticipantsAllowed = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.isAddParticipantsAllowed
|
|
62
62
|
} = restProps;
|
|
63
|
-
const searchPlaceholder = searchPlaceholderProp ?? t("tableChat.header.searchInHere");
|
|
64
63
|
const [openMenu, setOpenMenu] = useState(false);
|
|
65
64
|
const [threeDotAnchorEl, setThreeDotAnchorEl] = useState(null);
|
|
66
65
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
@@ -129,83 +128,73 @@ const ChatHeaderAction = ({
|
|
|
129
128
|
}
|
|
130
129
|
};
|
|
131
130
|
return /* @__PURE__ */ jsxs("div", { className: `chat-header-right ${className} ${enableSearch ? "search-enabled" : ""}`, children: [
|
|
132
|
-
showSearch && /* @__PURE__ */ jsx("div", { className:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
rightIcon: /* @__PURE__ */ jsx(
|
|
131
|
+
showSearch && /* @__PURE__ */ jsx("div", { className: "chat-search-container", children: enableSearch ? /* @__PURE__ */ jsx("div", { className: "chat-search-input-container", children: /* @__PURE__ */ jsx(
|
|
132
|
+
Input,
|
|
133
|
+
{
|
|
134
|
+
autoFocus: true,
|
|
135
|
+
leftIcon: /* @__PURE__ */ jsx(default_1$3, {}),
|
|
136
|
+
placeholder: searchPlaceholder,
|
|
137
|
+
rightIcon: (messageSearchValue == null ? void 0 : messageSearchValue.length) > 0 ? /* @__PURE__ */ jsxs("div", { className: "chat-search-right-icon-container", children: [
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
141
139
|
default_1,
|
|
142
140
|
{
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
onClick: (e) => {
|
|
142
|
+
var _a;
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
(_a = chatHeaderConfig == null ? void 0 : chatHeaderConfig.onSearchUp) == null ? void 0 : _a.call(chatHeaderConfig, messageSearchValue, chatId);
|
|
146
|
+
}
|
|
146
147
|
}
|
|
147
148
|
),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
onClick: (e) => {
|
|
178
|
-
var _a;
|
|
179
|
-
e.stopPropagation();
|
|
180
|
-
(_a = chatHeaderConfig == null ? void 0 : chatHeaderConfig.onSearchDown) == null ? void 0 : _a.call(chatHeaderConfig, messageSearchValue, chatId);
|
|
181
|
-
},
|
|
182
|
-
children: /* @__PURE__ */ jsx(default_1$3, { fontSize: "inherit" })
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
] })
|
|
186
|
-
] }) : /* @__PURE__ */ jsx(default_1$1, { onClick: handleOpenMessageSearch, sx: { color: "#60697D", cursor: "pointer" }, fontSize: "" }) }),
|
|
187
|
-
// <div className="chat-pinned">
|
|
188
|
-
/* @__PURE__ */ jsx(
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
default_1$1,
|
|
151
|
+
{
|
|
152
|
+
onClick: (e) => {
|
|
153
|
+
var _a;
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
(_a = chatHeaderConfig == null ? void 0 : chatHeaderConfig.onSearchDown) == null ? void 0 : _a.call(chatHeaderConfig, messageSearchValue, chatId);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ jsx(default_1$2, {})
|
|
161
|
+
] }) : null,
|
|
162
|
+
rightIconClick: handleCloseMessageSearch,
|
|
163
|
+
type: "text",
|
|
164
|
+
value: messageSearchValue,
|
|
165
|
+
width: "100%",
|
|
166
|
+
onChange: (e) => handleMessageSearchChange(e)
|
|
167
|
+
}
|
|
168
|
+
) }) : /* @__PURE__ */ jsx(
|
|
169
|
+
"img",
|
|
170
|
+
{
|
|
171
|
+
alt: "search",
|
|
172
|
+
className: "search-icon",
|
|
173
|
+
src: SearchIcon,
|
|
174
|
+
onClick: handleOpenMessageSearch
|
|
175
|
+
}
|
|
176
|
+
) }),
|
|
177
|
+
showPinned && /* @__PURE__ */ jsx("div", { className: "chat-pinned", children: /* @__PURE__ */ jsx(
|
|
189
178
|
Button,
|
|
190
179
|
{
|
|
191
180
|
className: "pinned_img",
|
|
192
181
|
icon: /* @__PURE__ */ jsx("img", { className: "participants-img", src: PinnedIcon }),
|
|
193
182
|
iconPlacement: "left",
|
|
194
|
-
size: "
|
|
183
|
+
size: "large",
|
|
195
184
|
type: "default",
|
|
196
185
|
variant: "tertiary",
|
|
197
186
|
onClick: onPinnedClick
|
|
198
187
|
}
|
|
199
|
-
),
|
|
200
|
-
showParticipants && /* @__PURE__ */ jsxs("div", { className: "chat-participants-container", children: [
|
|
201
|
-
participantsList.length > 0 && /* @__PURE__ */ jsx(
|
|
188
|
+
) }),
|
|
189
|
+
showParticipants && /* @__PURE__ */ jsx("div", { className: "chat-participants", children: /* @__PURE__ */ jsxs("div", { className: "chat-participants-container", children: [
|
|
190
|
+
participantsList.length > 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
202
191
|
AvatarGroup,
|
|
203
192
|
{
|
|
204
193
|
avatars: participantsList,
|
|
205
194
|
maxAvatars,
|
|
206
195
|
size: "sm"
|
|
207
196
|
}
|
|
208
|
-
),
|
|
197
|
+
) }),
|
|
209
198
|
isAddParticipantsAllowed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
210
199
|
/* @__PURE__ */ jsx(
|
|
211
200
|
Button,
|
|
@@ -296,7 +285,7 @@ const ChatHeaderAction = ({
|
|
|
296
285
|
}
|
|
297
286
|
)
|
|
298
287
|
] }) : null
|
|
299
|
-
] }),
|
|
288
|
+
] }) }),
|
|
300
289
|
showThreeDotMenu ? /* @__PURE__ */ jsx(
|
|
301
290
|
Button,
|
|
302
291
|
{
|
package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
declare const ChatHeaderInfo: ({ title, createdBy, createdAt, chatId, showChatId
|
|
1
|
+
declare const ChatHeaderInfo: ({ title, createdBy, createdAt, chatId, showChatId }: {
|
|
2
2
|
title: any;
|
|
3
3
|
createdBy: any;
|
|
4
4
|
createdAt: any;
|
|
5
5
|
chatId: any;
|
|
6
6
|
showChatId?: boolean | undefined;
|
|
7
|
-
showResolve?: boolean | undefined;
|
|
8
|
-
isResolved?: boolean | undefined;
|
|
9
|
-
onResolve: any;
|
|
10
|
-
resolveLabel: any;
|
|
11
|
-
displayId: any;
|
|
12
|
-
isTitleEditable: any;
|
|
13
|
-
onTitleChange: any;
|
|
14
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
8
|
export default ChatHeaderInfo;
|
|
16
9
|
//# sourceMappingURL=ChatHeaderInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatHeaderInfo.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatHeaderInfo.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,GAAI;;;;;;CAA2D,4CAyClF,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.js
CHANGED
|
@@ -1,183 +1,17 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState, useEffect } from "react";
|
|
3
|
-
import default_1$1 from "../../../../../node_modules/@mui/icons-material/Check.js";
|
|
4
|
-
import default_1$2 from "../../../../../node_modules/@mui/icons-material/CheckCircle.js";
|
|
5
|
-
import default_1 from "../../../../../node_modules/@mui/icons-material/Close.js";
|
|
6
2
|
import { useTextOverflow } from "../../../../../utils/useTextOverflow.js";
|
|
7
|
-
import { Input } from "../../../../Input/index.js";
|
|
8
3
|
import { Tooltip } from "../../../../Tooltip/index.js";
|
|
9
4
|
import { useTranslation } from "../../../../../i18n/useTranslation.js";
|
|
10
|
-
const ChatHeaderInfo = ({
|
|
11
|
-
title,
|
|
12
|
-
createdBy,
|
|
13
|
-
createdAt,
|
|
14
|
-
chatId,
|
|
15
|
-
showChatId = false,
|
|
16
|
-
showResolve = false,
|
|
17
|
-
isResolved = false,
|
|
18
|
-
onResolve,
|
|
19
|
-
resolveLabel,
|
|
20
|
-
displayId,
|
|
21
|
-
isTitleEditable,
|
|
22
|
-
onTitleChange
|
|
23
|
-
}) => {
|
|
5
|
+
const ChatHeaderInfo = ({ title, createdBy, createdAt, chatId, showChatId = false }) => {
|
|
24
6
|
const { t } = useTranslation();
|
|
25
|
-
const
|
|
26
|
-
const isCommittingRef = useRef(false);
|
|
27
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
28
|
-
const [draftTitle, setDraftTitle] = useState(title ?? "");
|
|
29
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
30
|
-
const fullText = `${idForMeta && showChatId ? t("tableChat.header.idSegment", { id: idForMeta }) : ""}${createdBy ? t("tableChat.header.createdBySegment", { createdBy }) : ""}${createdAt ? t("tableChat.header.atSegment", { createdAt }) : ""}`;
|
|
7
|
+
const fullText = `${chatId && showChatId ? t("tableChat.header.idSegment", { id: chatId.slice(0, 6) }) : ""}${createdBy ? t("tableChat.header.createdBySegment", { createdBy }) : ""}${createdAt ? t("tableChat.header.atSegment", { createdAt }) : ""}`;
|
|
31
8
|
const { textRef: fullTextRef, isOverflowing: isFullTextOverflowing } = useTextOverflow([
|
|
32
9
|
fullText,
|
|
33
10
|
title
|
|
34
11
|
]);
|
|
35
|
-
const shouldShowResolve = Boolean(showResolve || onResolve);
|
|
36
|
-
const canEditTitle = Boolean(isTitleEditable ?? onTitleChange);
|
|
37
|
-
const canConfirm = Boolean(draftTitle.trim()) && !isSaving;
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (!isEditing) {
|
|
40
|
-
setDraftTitle(title ?? "");
|
|
41
|
-
}
|
|
42
|
-
}, [title, isEditing]);
|
|
43
|
-
const handleResolveClick = (e) => {
|
|
44
|
-
e.stopPropagation();
|
|
45
|
-
onResolve == null ? void 0 : onResolve(chatId);
|
|
46
|
-
};
|
|
47
|
-
const exitEditing = () => {
|
|
48
|
-
setDraftTitle(title ?? "");
|
|
49
|
-
setIsEditing(false);
|
|
50
|
-
};
|
|
51
|
-
const commitTitle = async () => {
|
|
52
|
-
if (isCommittingRef.current) return;
|
|
53
|
-
const nextTitle = draftTitle.trim();
|
|
54
|
-
if (!nextTitle || nextTitle === (title ?? "").trim()) {
|
|
55
|
-
exitEditing();
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (!onTitleChange || isSaving) {
|
|
59
|
-
exitEditing();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
isCommittingRef.current = true;
|
|
63
|
-
setIsSaving(true);
|
|
64
|
-
try {
|
|
65
|
-
await onTitleChange(chatId, nextTitle);
|
|
66
|
-
setIsEditing(false);
|
|
67
|
-
} catch (error) {
|
|
68
|
-
console.error("[ChatHeaderInfo] Title update failed:", error);
|
|
69
|
-
setDraftTitle(title ?? "");
|
|
70
|
-
} finally {
|
|
71
|
-
setIsSaving(false);
|
|
72
|
-
isCommittingRef.current = false;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const handleTitleClick = () => {
|
|
76
|
-
if (!canEditTitle || isEditing || isSaving) return;
|
|
77
|
-
setDraftTitle(title ?? "");
|
|
78
|
-
setIsEditing(true);
|
|
79
|
-
};
|
|
80
|
-
const handleTitleKeyDown = (e) => {
|
|
81
|
-
if (e.key === "Enter") {
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
if (canConfirm) {
|
|
84
|
-
commitTitle();
|
|
85
|
-
}
|
|
86
|
-
} else if (e.key === "Escape") {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
exitEditing();
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const handleConfirmClick = (e) => {
|
|
92
|
-
e.preventDefault();
|
|
93
|
-
e.stopPropagation();
|
|
94
|
-
if (!canConfirm) return;
|
|
95
|
-
commitTitle();
|
|
96
|
-
};
|
|
97
|
-
const handleCancelClick = (e) => {
|
|
98
|
-
e.preventDefault();
|
|
99
|
-
e.stopPropagation();
|
|
100
|
-
if (isSaving) return;
|
|
101
|
-
exitEditing();
|
|
102
|
-
};
|
|
103
12
|
return /* @__PURE__ */ jsxs("div", { className: "chat-header-content", children: [
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
Input,
|
|
107
|
-
{
|
|
108
|
-
autoFocus: true,
|
|
109
|
-
"aria-label": t("tableChat.header.editTitle"),
|
|
110
|
-
className: "chat-title-input",
|
|
111
|
-
disabled: isSaving,
|
|
112
|
-
rightIcon: /* @__PURE__ */ jsxs("div", { className: "chat-title-input__actions", children: [
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
-
"button",
|
|
115
|
-
{
|
|
116
|
-
"aria-label": t("common.cancel"),
|
|
117
|
-
className: "chat-title-input__btn chat-title-input__btn--cancel",
|
|
118
|
-
disabled: isSaving,
|
|
119
|
-
type: "button",
|
|
120
|
-
onClick: handleCancelClick,
|
|
121
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
122
|
-
children: /* @__PURE__ */ jsx(default_1, { fontSize: "inherit" })
|
|
123
|
-
}
|
|
124
|
-
),
|
|
125
|
-
/* @__PURE__ */ jsx(
|
|
126
|
-
"button",
|
|
127
|
-
{
|
|
128
|
-
"aria-label": t("common.save"),
|
|
129
|
-
className: "chat-title-input__btn chat-title-input__btn--confirm",
|
|
130
|
-
disabled: !canConfirm,
|
|
131
|
-
type: "button",
|
|
132
|
-
onClick: handleConfirmClick,
|
|
133
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
134
|
-
children: /* @__PURE__ */ jsx(default_1$1, { fontSize: "inherit" })
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
] }),
|
|
138
|
-
size: "small",
|
|
139
|
-
type: "text",
|
|
140
|
-
value: draftTitle,
|
|
141
|
-
width: "100%",
|
|
142
|
-
onChange: (e) => setDraftTitle(e.target.value),
|
|
143
|
-
onFocus: (e) => e.target.select(),
|
|
144
|
-
onKeyDown: handleTitleKeyDown
|
|
145
|
-
}
|
|
146
|
-
) : /* @__PURE__ */ jsx(
|
|
147
|
-
"h1",
|
|
148
|
-
{
|
|
149
|
-
"aria-label": canEditTitle ? t("tableChat.header.editTitle") : void 0,
|
|
150
|
-
className: `chat-title chat-text-ellipsis${canEditTitle ? " chat-title--editable" : ""}`,
|
|
151
|
-
role: canEditTitle ? "button" : void 0,
|
|
152
|
-
tabIndex: canEditTitle ? 0 : void 0,
|
|
153
|
-
title,
|
|
154
|
-
onClick: handleTitleClick,
|
|
155
|
-
onKeyDown: (e) => {
|
|
156
|
-
if (!canEditTitle) return;
|
|
157
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
158
|
-
e.preventDefault();
|
|
159
|
-
handleTitleClick();
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
children: title
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
shouldShowResolve && !isEditing ? /* @__PURE__ */ jsxs(
|
|
166
|
-
"button",
|
|
167
|
-
{
|
|
168
|
-
type: "button",
|
|
169
|
-
className: `chat-resolve${isResolved ? " chat-resolve--resolved" : ""}`,
|
|
170
|
-
disabled: isResolved,
|
|
171
|
-
"aria-disabled": isResolved,
|
|
172
|
-
onClick: isResolved ? void 0 : handleResolveClick,
|
|
173
|
-
children: [
|
|
174
|
-
/* @__PURE__ */ jsx(default_1$2, { className: "chat-resolve__icon", fontSize: "inherit" }),
|
|
175
|
-
/* @__PURE__ */ jsx("span", { className: "chat-resolve__label", children: resolveLabel ?? (isResolved ? t("tableChat.header.resolved") : t("tableChat.header.resolve")) })
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
) : null
|
|
179
|
-
] }),
|
|
180
|
-
fullText && !isEditing ? /* @__PURE__ */ jsx("div", { className: "chat-info-outer", children: /* @__PURE__ */ jsx(
|
|
13
|
+
/* @__PURE__ */ jsx("h1", { className: "chat-title chat-text-ellipsis", title, children: title }),
|
|
14
|
+
fullText ? /* @__PURE__ */ jsx("div", { className: "chat-info-outer", children: /* @__PURE__ */ jsx(
|
|
181
15
|
Tooltip,
|
|
182
16
|
{
|
|
183
17
|
isHoverEnabled: isFullTextOverflowing,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttach, onImageUpload, onEmojiClick,
|
|
2
|
+
export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttach, onImageUpload, onEmojiClick, showFormatting, showQuickAction, quickActionLabel, disabled, maxLength, className, messageConfig, isEditMode, editingMessage, onCancelEdit, chatId, }: {
|
|
3
3
|
placeholder: any;
|
|
4
4
|
value: any;
|
|
5
5
|
onChange: any;
|
|
@@ -7,7 +7,6 @@ export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttac
|
|
|
7
7
|
onAttach: any;
|
|
8
8
|
onImageUpload: any;
|
|
9
9
|
onEmojiClick: any;
|
|
10
|
-
onQuickAction: any;
|
|
11
10
|
showFormatting?: boolean | undefined;
|
|
12
11
|
showQuickAction?: boolean | undefined;
|
|
13
12
|
quickActionLabel: any;
|
|
@@ -18,9 +17,6 @@ export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttac
|
|
|
18
17
|
isEditMode?: boolean | undefined;
|
|
19
18
|
editingMessage?: null | undefined;
|
|
20
19
|
onCancelEdit: any;
|
|
21
|
-
isReplyMode?: boolean | undefined;
|
|
22
|
-
replyingToMessage?: null | undefined;
|
|
23
|
-
onCancelReply: any;
|
|
24
20
|
chatId: any;
|
|
25
21
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
22
|
//# sourceMappingURL=ChatInput.d.ts.map
|
package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.tsx"],"names":[],"mappings":"AAWA,OAAO,yBAAyB,CAAC;AAcjC,eAAO,MAAM,SAAS,GAAI;;;;;;;;;;;;;;;;;;;CAmBzB,4CAmuBA,CAAC"}
|