impact-ui 5.0.2-alpha.2 → 5.0.2-alpha.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.
Files changed (88) hide show
  1. package/dist/_virtual/Check.js +4 -0
  2. package/dist/_virtual/index4.js +2 -4
  3. package/dist/_virtual/index5.js +3 -3
  4. package/dist/_virtual/index6.js +4 -2
  5. package/dist/components/Badge/index.js +1 -1
  6. package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +1 -1
  7. package/dist/components/Menu/MenuHeaderInfo.d.ts.map +1 -1
  8. package/dist/components/Menu/MenuHeaderInfo.js +4 -3
  9. package/dist/components/Menu/index.d.ts.map +1 -1
  10. package/dist/components/Menu/index.js +1 -1
  11. package/dist/components/Panel/Panel.types.d.ts +7 -0
  12. package/dist/components/Panel/Panel.types.d.ts.map +1 -1
  13. package/dist/components/Panel/index.d.ts +1 -1
  14. package/dist/components/Panel/index.d.ts.map +1 -1
  15. package/dist/components/Panel/index.js +5 -2
  16. package/dist/components/TableChat/EmptyContainer.js +3 -3
  17. package/dist/components/TableChat/TableChatSidePanel.d.ts +2 -1
  18. package/dist/components/TableChat/TableChatSidePanel.d.ts.map +1 -1
  19. package/dist/components/TableChat/TableChatSidePanel.js +216 -23
  20. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +1 -1
  21. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts +7 -2
  22. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts.map +1 -1
  23. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.js +92 -24
  24. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.d.ts.map +1 -1
  25. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.js +3 -2
  26. package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.d.ts +11 -0
  27. package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.d.ts.map +1 -0
  28. package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.js +57 -0
  29. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.d.ts.map +1 -1
  30. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.js +20 -43
  31. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts.map +1 -1
  32. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +37 -2
  33. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  34. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +54 -18
  35. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts +4 -1
  36. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts.map +1 -1
  37. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +90 -81
  38. package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -2
  39. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts.map +1 -1
  40. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +51 -16
  41. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts.map +1 -1
  42. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js +68 -57
  43. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts +8 -1
  44. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts.map +1 -1
  45. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.js +170 -4
  46. package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.d.ts +12 -0
  47. package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.d.ts.map +1 -0
  48. package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.js +132 -0
  49. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts +5 -1
  50. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map +1 -1
  51. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +138 -124
  52. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts +11 -9
  53. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts.map +1 -1
  54. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +102 -106
  55. package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +0 -17
  56. package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.d.ts.map +1 -1
  57. package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +4 -1
  58. package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts +2 -1
  59. package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts.map +1 -1
  60. package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.js +29 -0
  61. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts.map +1 -1
  62. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +327 -215
  63. package/dist/components/TableChat/components/chatConfig.js +0 -1
  64. package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
  65. package/dist/components/TableV36/AgGridHeader.js +3 -22
  66. package/dist/components/TableV36/index.d.ts.map +1 -1
  67. package/dist/components/TableV36/index.js +138 -8
  68. package/dist/components/TableV36/tableHeader.d.ts +6 -1
  69. package/dist/components/TableV36/tableHeader.d.ts.map +1 -1
  70. package/dist/components/TableV36/tableHeader.js +39 -11
  71. package/dist/components/TableV36/withChatIndicator.d.ts +3 -0
  72. package/dist/components/TableV36/withChatIndicator.d.ts.map +1 -0
  73. package/dist/components/TableV36/withChatIndicator.js +89 -0
  74. package/dist/locales/de-DE.json.d.ts +18 -3
  75. package/dist/locales/de-DE.json.js +17 -3
  76. package/dist/locales/en-US.json.d.ts +18 -3
  77. package/dist/locales/en-US.json.js +17 -3
  78. package/dist/locales/es-ES.json.d.ts +18 -3
  79. package/dist/locales/es-ES.json.js +17 -3
  80. package/dist/mcp-component-registry.json +1 -7
  81. package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +3 -1
  82. package/dist/node_modules/@mui/icons-material/Check.js +17 -0
  83. package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
  84. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  85. package/dist/stories/tableV36ChatApiMock.d.ts +226 -74
  86. package/dist/stories/tableV36ChatApiMock.d.ts.map +1 -1
  87. package/package.json +2 -2
  88. package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.js +0 -65
@@ -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$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";
3
+ import default_1 from "../../../../../node_modules/@mui/icons-material/Close.js";
4
+ import default_1$2 from "../../../../../node_modules/@mui/icons-material/ExpandLessOutlined.js";
5
+ import default_1$3 from "../../../../../node_modules/@mui/icons-material/ExpandMoreOutlined.js";
6
+ import default_1$1 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
- const SearchIcon = getAssetUrl("icons/searchIcon.svg");
16
+ 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 = 2,
45
+ maxAvatars = 3,
46
46
  selectedRadioOption,
47
47
  chatId,
48
48
  menuOptions,
@@ -57,9 +57,10 @@ 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 = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.searchPlaceholder,
60
+ searchPlaceholder: searchPlaceholderProp,
61
61
  isAddParticipantsAllowed = chartConfig.tableChatRightSectionConfig.tableChatHeaderConfig.isAddParticipantsAllowed
62
62
  } = restProps;
63
+ const searchPlaceholder = searchPlaceholderProp ?? t("tableChat.header.searchInHere");
63
64
  const [openMenu, setOpenMenu] = useState(false);
64
65
  const [threeDotAnchorEl, setThreeDotAnchorEl] = useState(null);
65
66
  const [anchorEl, setAnchorEl] = useState(null);
@@ -119,7 +120,7 @@ const ChatHeaderAction = ({
119
120
  selectedRadioOption,
120
121
  chatId
121
122
  );
122
- await ((_a = externalHandlers == null ? void 0 : externalHandlers.handleRadioButtonChange) == null ? void 0 : _a.call(externalHandlers, selectedRadioOption));
123
+ await ((_a = externalHandlers == null ? void 0 : externalHandlers.handleRadioButtonChange) == null ? void 0 : _a.call(externalHandlers, selectedRadioOption, { force: true }));
123
124
  }
124
125
  } catch (error) {
125
126
  console.error("Error adding participants:", error);
@@ -128,73 +129,83 @@ const ChatHeaderAction = ({
128
129
  }
129
130
  };
130
131
  return /* @__PURE__ */ jsxs("div", { className: `chat-header-right ${className} ${enableSearch ? "search-enabled" : ""}`, children: [
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(
132
+ showSearch && /* @__PURE__ */ jsx("div", { className: `chat-search-container${enableSearch ? " chat-search-container--active" : ""}`, children: enableSearch ? /* @__PURE__ */ jsxs(Fragment, { children: [
133
+ /* @__PURE__ */ jsx("div", { className: "chat-search-input-container", children: /* @__PURE__ */ jsx(
134
+ Input,
135
+ {
136
+ autoFocus: true,
137
+ className: "chat-header-search-input",
138
+ leftIcon: /* @__PURE__ */ jsx(default_1$1, { className: "chat-header-search-input__icon" }),
139
+ placeholder: searchPlaceholder,
140
+ rightIcon: /* @__PURE__ */ jsx(
139
141
  default_1,
140
142
  {
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
- }
143
+ "aria-label": t("common.close"),
144
+ className: "chat-header-search-input__close",
145
+ fontSize: "inherit"
147
146
  }
148
147
  ),
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(
148
+ rightIconClick: handleCloseMessageSearch,
149
+ size: "small",
150
+ type: "text",
151
+ value: messageSearchValue,
152
+ width: "100%",
153
+ onChange: (e) => handleMessageSearchChange(e)
154
+ }
155
+ ) }),
156
+ /* @__PURE__ */ jsxs("div", { className: "chat-search-nav", role: "group", "aria-label": t("tableChat.header.searchNavigate"), children: [
157
+ /* @__PURE__ */ jsx(
158
+ "button",
159
+ {
160
+ "aria-label": t("tableChat.header.searchPrevious"),
161
+ className: "chat-search-nav__btn",
162
+ type: "button",
163
+ onClick: (e) => {
164
+ var _a;
165
+ e.stopPropagation();
166
+ (_a = chatHeaderConfig == null ? void 0 : chatHeaderConfig.onSearchUp) == null ? void 0 : _a.call(chatHeaderConfig, messageSearchValue, chatId);
167
+ },
168
+ children: /* @__PURE__ */ jsx(default_1$2, { fontSize: "inherit" })
169
+ }
170
+ ),
171
+ /* @__PURE__ */ jsx(
172
+ "button",
173
+ {
174
+ "aria-label": t("tableChat.header.searchNext"),
175
+ className: "chat-search-nav__btn",
176
+ type: "button",
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(
178
189
  Button,
179
190
  {
180
191
  className: "pinned_img",
181
192
  icon: /* @__PURE__ */ jsx("img", { className: "participants-img", src: PinnedIcon }),
182
193
  iconPlacement: "left",
183
- size: "large",
194
+ size: "small",
184
195
  type: "default",
185
196
  variant: "tertiary",
186
197
  onClick: onPinnedClick
187
198
  }
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(
199
+ ),
200
+ showParticipants && /* @__PURE__ */ jsxs("div", { className: "chat-participants-container", children: [
201
+ participantsList.length > 0 && /* @__PURE__ */ jsx(
191
202
  AvatarGroup,
192
203
  {
193
204
  avatars: participantsList,
194
205
  maxAvatars,
195
206
  size: "sm"
196
207
  }
197
- ) }),
208
+ ),
198
209
  isAddParticipantsAllowed ? /* @__PURE__ */ jsxs(Fragment, { children: [
199
210
  /* @__PURE__ */ jsx(
200
211
  Button,
@@ -285,7 +296,7 @@ const ChatHeaderAction = ({
285
296
  }
286
297
  )
287
298
  ] }) : null
288
- ] }) }),
299
+ ] }),
289
300
  showThreeDotMenu ? /* @__PURE__ */ jsx(
290
301
  Button,
291
302
  {
@@ -1,9 +1,16 @@
1
- declare const ChatHeaderInfo: ({ title, createdBy, createdAt, chatId, showChatId }: {
1
+ declare const ChatHeaderInfo: ({ title, createdBy, createdAt, chatId, showChatId, showResolve, isResolved, onResolve, resolveLabel, displayId, isTitleEditable, onTitleChange, }: {
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;
7
14
  }) => import("react/jsx-runtime").JSX.Element;
8
15
  export default ChatHeaderInfo;
9
16
  //# 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":"AAKA,QAAA,MAAM,cAAc,GAAI;;;;;;CAA2D,4CAyClF,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ChatHeaderInfo.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,cAAc,GAAI;;;;;;;;;;;;;CAavB,4CAsMA,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,17 +1,183 @@
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";
2
6
  import { useTextOverflow } from "../../../../../utils/useTextOverflow.js";
7
+ import { Input } from "../../../../Input/index.js";
3
8
  import { Tooltip } from "../../../../Tooltip/index.js";
4
9
  import { useTranslation } from "../../../../../i18n/useTranslation.js";
5
- const ChatHeaderInfo = ({ title, createdBy, createdAt, chatId, showChatId = false }) => {
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
+ }) => {
6
24
  const { t } = useTranslation();
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 }) : ""}`;
25
+ const idForMeta = displayId ?? chatId;
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 }) : ""}`;
8
31
  const { textRef: fullTextRef, isOverflowing: isFullTextOverflowing } = useTextOverflow([
9
32
  fullText,
10
33
  title
11
34
  ]);
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
+ };
12
103
  return /* @__PURE__ */ jsxs("div", { className: "chat-header-content", children: [
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(
104
+ /* @__PURE__ */ jsxs("div", { className: "chat-title-row", children: [
105
+ isEditing ? /* @__PURE__ */ jsx(
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(
15
181
  Tooltip,
16
182
  {
17
183
  isHoverEnabled: isFullTextOverflowing,
@@ -0,0 +1,12 @@
1
+
2
+ export declare const ChatInlineEdit: ({ content, timestamp, pinned, isPinChatIconvisible, onPin, onCancel, onUpdate, }: {
3
+ content: any;
4
+ timestamp: any;
5
+ pinned?: boolean | undefined;
6
+ isPinChatIconvisible?: boolean | undefined;
7
+ onPin: any;
8
+ onCancel: any;
9
+ onUpdate: any;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export default ChatInlineEdit;
12
+ //# sourceMappingURL=ChatInlineEdit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInlineEdit.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.tsx"],"names":[],"mappings":"AAKA,OAAO,8BAA8B,CAAC;AA0BtC,eAAO,MAAM,cAAc,GAAI;;;;;;;;CAQ9B,4CAkHA,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,132 @@
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@keyframes ia-shimmer-horizontal{0%{background-position:100% 0}to{background-position:0 0}}@keyframes ia-shimmer-vertical{0%{background-position:0 100%}to{background-position:0 0}}@property --ia-shimmer-angle{syntax:"<angle>";inherits:false;initial-value:0deg}@keyframes ia-shimmer-circular{0%{--ia-shimmer-angle:0deg}to{--ia-shimmer-angle:360deg}}.ia-shimmer{animation:ia-shimmer-horizontal 1.6s ease-in-out infinite;animation-direction:normal;background-color:#e8edf5;background-image:linear-gradient(90deg,#e8edf5,#eceef4 22%,#e8edf5 48%,#d5dbe8 62%,#e8edf5);background-repeat:no-repeat;background-size:300% 100%}@media (prefers-reduced-motion:reduce){.ia-shimmer{animation:none;background-image:linear-gradient(90deg,#e8edf5,#eceef4 40%,#d5dbe8);background-size:100% 100%}}.ia-shimmer--ltr{animation:ia-shimmer-horizontal 1.6s ease-in-out infinite;animation-direction:normal;background-color:#e8edf5;background-image:linear-gradient(90deg,#e8edf5,#eceef4 22%,#e8edf5 48%,#d5dbe8 62%,#e8edf5);background-repeat:no-repeat;background-size:300% 100%}@media (prefers-reduced-motion:reduce){.ia-shimmer--ltr{animation:none;background-image:linear-gradient(90deg,#e8edf5,#eceef4 40%,#d5dbe8);background-size:100% 100%}}.ia-shimmer--rtl{animation:ia-shimmer-horizontal 1.6s ease-in-out infinite;animation-direction:reverse;background-color:#e8edf5;background-image:linear-gradient(270deg,#e8edf5,#eceef4 22%,#e8edf5 48%,#d5dbe8 62%,#e8edf5);background-repeat:no-repeat;background-size:300% 100%}@media (prefers-reduced-motion:reduce){.ia-shimmer--rtl{animation:none;background-image:linear-gradient(270deg,#e8edf5,#eceef4 40%,#d5dbe8);background-size:100% 100%}}.ia-shimmer--btt{animation:ia-shimmer-vertical 1.6s ease-in-out infinite;animation-direction:reverse;background-color:#e8edf5;background-image:linear-gradient(0deg,#e8edf5,#eceef4 22%,#e8edf5 48%,#d5dbe8 62%,#e8edf5);background-repeat:no-repeat;background-size:100% 300%}@media (prefers-reduced-motion:reduce){.ia-shimmer--btt{animation:none;background-image:linear-gradient(0deg,#e8edf5,#eceef4 40%,#d5dbe8);background-size:100% 100%}}.ia-shimmer--ttb{animation:ia-shimmer-vertical 1.6s ease-in-out infinite;animation-direction:normal;background-color:#e8edf5;background-image:linear-gradient(0deg,#e8edf5,#eceef4 22%,#e8edf5 48%,#d5dbe8 62%,#e8edf5);background-repeat:no-repeat;background-size:100% 300%}@media (prefers-reduced-motion:reduce){.ia-shimmer--ttb{animation:none;background-image:linear-gradient(0deg,#e8edf5,#eceef4 40%,#d5dbe8);background-size:100% 100%}}.ia-shimmer--circular{background-color:#e8edf5;background-repeat:no-repeat;--ia-shimmer-angle:0deg;animation:ia-shimmer-circular 1.6s linear infinite;background-image:conic-gradient(from var(--ia-shimmer-angle),#eceef4 0deg,#e8edf5 80deg,#d5dbe8 160deg,#e8edf5 260deg,#eceef4 1turn);background-size:100% 100%}@media (prefers-reduced-motion:reduce){.ia-shimmer--circular{animation:none;background-image:conic-gradient(from 0deg,#eceef4,#e8edf5,#d5dbe8,#e8edf5 1turn)}}:root{--ia-focus-color:#4259ee;--ia-focus-bg:#fff;--ia-focus-ring-width:2px;--ia-focus-ring-offset:2px;--ia-modal-backdrop:#0d152ccc}*,:after,:before{box-sizing:border-box}body,textarea{font-style:normal;font-weight:500}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font-size:100%;font:inherit;margin:0;padding:0;vertical-align:initial}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}table{border-collapse:collapse;border-spacing:0}body{font-family:Manrope,sans-serif}.impact-notification-separator{background-color:#d9dde7;display:inline-block;height:16px;width:1.5px}.impact-notification-horizontal-separator{background-color:#d9dde7;display:inline-block;height:1px;width:100%}ul.storybook-order-list{list-style-type:disc;padding-left:12px}ul.storybook-order-list li{font-size:12px;line-height:20px;padding-bottom:8px}ul.storybook-order-list li strong{font-weight:800}ul.storybook-order-child-list{list-style-type:circle;padding-left:20px}ul.storybook-order-child-list li{font-size:12px;line-height:20px;padding-bottom:8px}ul.storybook-order-child-list li strong{font-weight:800}.chat-inline-edit{align-items:flex-end;box-sizing:border-box;display:flex;flex-direction:column;gap:20px;max-width:529px;width:100%}.chat-inline-edit__meta{align-items:center;display:flex;gap:8px;justify-content:flex-end;min-height:24px;width:100%}.chat-inline-edit__pin{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;height:16px;justify-content:center;padding:0;width:16px}.chat-inline-edit__pin img{display:block;height:16px;width:16px}.chat-inline-edit__timestamp{color:#60697d;font-size:12px;font-weight:500;letter-spacing:.12px;line-height:1.6;white-space:nowrap}.chat-inline-edit__field{background:#fff;border:1px solid #4259ee;border-radius:8px;box-sizing:border-box;min-height:66px;padding:5px;width:100%}.chat-inline-edit__textarea{background:#0000;border:none;box-sizing:border-box;color:#1f2b4d;display:block;font-family:Manrope,sans-serif;font-size:14px;font-weight:500;letter-spacing:.14px;line-height:1.6;margin:0;max-height:200px;min-height:54px;outline:none;overflow-y:auto;padding:0;resize:none;width:100%}.chat-inline-edit__actions{align-items:flex-start;display:flex;gap:12px;justify-content:flex-end}.chat-inline-edit__actions .ia-styles.ia-btn{max-height:28px;min-height:28px;padding:4px 12px}.chat-message.user-message>.message-content .chat-inline-edit{margin-left:auto}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { useRef, useState, useEffect } from "react";
4
+ import { getAssetUrl } from "../../../../../utils/assetBase.js";
5
+ import { Button } from "../../../../Button/index.js";
6
+
7
+ import { useTranslation } from "../../../../../i18n/useTranslation.js";
8
+ const PinnedIcon = getAssetUrl("icons/pinedIcon.svg");
9
+ const UnpinIcon = getAssetUrl("icons/unpinedIcon.svg");
10
+ const stripHtml = (raw) => {
11
+ if (typeof raw !== "string") return "";
12
+ return raw.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<[^>]*>/g, "").replace(/\n{3,}/g, "\n\n").trim();
13
+ };
14
+ const toHtmlContent = (plain) => {
15
+ const escaped = plain.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
16
+ return escaped.split(/\n/).map((line) => `<p>${line || "<br>"}</p>`).join("");
17
+ };
18
+ const ChatInlineEdit = ({
19
+ content,
20
+ timestamp,
21
+ pinned = false,
22
+ isPinChatIconvisible = false,
23
+ onPin,
24
+ onCancel,
25
+ onUpdate
26
+ }) => {
27
+ const { t } = useTranslation();
28
+ const textareaRef = useRef(null);
29
+ const [value, setValue] = useState(() => stripHtml(content));
30
+ const [saving, setSaving] = useState(false);
31
+ const [showPinned, setShowPinned] = useState(pinned);
32
+ useEffect(() => {
33
+ setValue(stripHtml(content));
34
+ }, [content]);
35
+ useEffect(() => {
36
+ setShowPinned(pinned);
37
+ }, [pinned]);
38
+ useEffect(() => {
39
+ const el = textareaRef.current;
40
+ if (!el) return;
41
+ el.focus();
42
+ el.setSelectionRange(el.value.length, el.value.length);
43
+ el.style.height = "auto";
44
+ el.style.height = `${Math.max(66, el.scrollHeight)}px`;
45
+ }, []);
46
+ const handleChange = (e) => {
47
+ setValue(e.target.value);
48
+ const el = e.target;
49
+ el.style.height = "auto";
50
+ el.style.height = `${Math.max(66, el.scrollHeight)}px`;
51
+ };
52
+ const handlePin = async () => {
53
+ if (!onPin) return;
54
+ try {
55
+ const response = await onPin(!showPinned);
56
+ if (response != null) {
57
+ setShowPinned(Boolean((response == null ? void 0 : response.isPinned) ?? !showPinned));
58
+ } else {
59
+ setShowPinned(!showPinned);
60
+ }
61
+ } catch (error) {
62
+ console.error("[ChatInlineEdit] Pin failed:", error);
63
+ }
64
+ };
65
+ const handleUpdate = async () => {
66
+ const trimmed = value.trim();
67
+ if (!trimmed || saving) return;
68
+ setSaving(true);
69
+ try {
70
+ await (onUpdate == null ? void 0 : onUpdate(toHtmlContent(trimmed)));
71
+ } catch (error) {
72
+ console.error("[ChatInlineEdit] Update failed:", error);
73
+ } finally {
74
+ setSaving(false);
75
+ }
76
+ };
77
+ const handleKeyDown = (e) => {
78
+ if (e.key === "Escape") {
79
+ e.preventDefault();
80
+ onCancel == null ? void 0 : onCancel();
81
+ }
82
+ if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
83
+ e.preventDefault();
84
+ handleUpdate();
85
+ }
86
+ };
87
+ return /* @__PURE__ */ jsxs("div", { className: "chat-inline-edit", children: [
88
+ /* @__PURE__ */ jsxs("div", { className: "chat-inline-edit__meta", children: [
89
+ isPinChatIconvisible ? /* @__PURE__ */ jsx(
90
+ "button",
91
+ {
92
+ "aria-label": showPinned ? t("tableChat.channelItem.unpinChat") : t("tableChat.channelItem.pinChat"),
93
+ className: "chat-inline-edit__pin",
94
+ type: "button",
95
+ onClick: handlePin,
96
+ children: /* @__PURE__ */ jsx("img", { alt: "", src: showPinned ? PinnedIcon : UnpinIcon })
97
+ }
98
+ ) : null,
99
+ timestamp ? /* @__PURE__ */ jsx("span", { className: "chat-inline-edit__timestamp", children: timestamp }) : null
100
+ ] }),
101
+ /* @__PURE__ */ jsx("div", { className: "chat-inline-edit__field", children: /* @__PURE__ */ jsx(
102
+ "textarea",
103
+ {
104
+ ref: textareaRef,
105
+ "aria-label": t("tableChat.input.editingMessage"),
106
+ className: "chat-inline-edit__textarea",
107
+ rows: 2,
108
+ value,
109
+ onChange: handleChange,
110
+ onKeyDown: handleKeyDown
111
+ }
112
+ ) }),
113
+ /* @__PURE__ */ jsxs("div", { className: "chat-inline-edit__actions", children: [
114
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "default", variant: "secondary", onClick: onCancel, children: t("common.cancel") }),
115
+ /* @__PURE__ */ jsx(
116
+ Button,
117
+ {
118
+ disabled: !value.trim() || saving,
119
+ loading: saving,
120
+ size: "small",
121
+ type: "default",
122
+ variant: "primary",
123
+ onClick: handleUpdate,
124
+ children: t("tableChat.message.update")
125
+ }
126
+ )
127
+ ] })
128
+ ] });
129
+ };
130
+ export {
131
+ ChatInlineEdit
132
+ };
@@ -1,5 +1,5 @@
1
1
 
2
- export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttach, onImageUpload, onEmojiClick, showFormatting, showQuickAction, quickActionLabel, disabled, maxLength, className, messageConfig, isEditMode, editingMessage, onCancelEdit, chatId, }: {
2
+ export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttach, onImageUpload, onEmojiClick, onQuickAction, showFormatting, showQuickAction, quickActionLabel, disabled, maxLength, className, messageConfig, isEditMode, editingMessage, onCancelEdit, isReplyMode, replyingToMessage, onCancelReply, chatId, }: {
3
3
  placeholder: any;
4
4
  value: any;
5
5
  onChange: any;
@@ -7,6 +7,7 @@ export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttac
7
7
  onAttach: any;
8
8
  onImageUpload: any;
9
9
  onEmojiClick: any;
10
+ onQuickAction: any;
10
11
  showFormatting?: boolean | undefined;
11
12
  showQuickAction?: boolean | undefined;
12
13
  quickActionLabel: any;
@@ -17,6 +18,9 @@ export declare const ChatInput: ({ placeholder, value, onChange, onSend, onAttac
17
18
  isEditMode?: boolean | undefined;
18
19
  editingMessage?: null | undefined;
19
20
  onCancelEdit: any;
21
+ isReplyMode?: boolean | undefined;
22
+ replyingToMessage?: null | undefined;
23
+ onCancelReply: any;
20
24
  chatId: any;
21
25
  }) => import("react/jsx-runtime").JSX.Element;
22
26
  //# sourceMappingURL=ChatInput.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.tsx"],"names":[],"mappings":"AAYA,OAAO,yBAAyB,CAAC;AAcjC,eAAO,MAAM,SAAS,GAAI;;;;;;;;;;;;;;;;;;;;;;;CAuBzB,4CA6tBA,CAAC"}