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.
- package/dist/_virtual/Check.js +4 -0
- package/dist/_virtual/index4.js +2 -4
- package/dist/_virtual/index5.js +3 -3
- package/dist/_virtual/index6.js +4 -2
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +1 -1
- package/dist/components/Menu/MenuHeaderInfo.d.ts.map +1 -1
- package/dist/components/Menu/MenuHeaderInfo.js +4 -3
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Panel/Panel.types.d.ts +7 -0
- 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 +5 -2
- package/dist/components/TableChat/EmptyContainer.js +3 -3
- package/dist/components/TableChat/TableChatSidePanel.d.ts +2 -1
- package/dist/components/TableChat/TableChatSidePanel.d.ts.map +1 -1
- package/dist/components/TableChat/TableChatSidePanel.js +216 -23
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts +7 -2
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.js +92 -24
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.js +3 -2
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.d.ts +11 -0
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.d.ts.map +1 -0
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.js +57 -0
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.js +20 -43
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +37 -2
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +54 -18
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts +4 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +90 -81
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -2
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +51 -16
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js +68 -57
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts +8 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.js +170 -4
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.d.ts +12 -0
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.d.ts.map +1 -0
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.js +132 -0
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts +5 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +138 -124
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts +11 -9
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +102 -106
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +0 -17
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +4 -1
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.js +29 -0
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +327 -215
- package/dist/components/TableChat/components/chatConfig.js +0 -1
- package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
- package/dist/components/TableV36/AgGridHeader.js +3 -22
- package/dist/components/TableV36/index.d.ts.map +1 -1
- package/dist/components/TableV36/index.js +138 -8
- package/dist/components/TableV36/tableHeader.d.ts +6 -1
- package/dist/components/TableV36/tableHeader.d.ts.map +1 -1
- package/dist/components/TableV36/tableHeader.js +39 -11
- package/dist/components/TableV36/withChatIndicator.d.ts +3 -0
- package/dist/components/TableV36/withChatIndicator.d.ts.map +1 -0
- package/dist/components/TableV36/withChatIndicator.js +89 -0
- package/dist/locales/de-DE.json.d.ts +18 -3
- package/dist/locales/de-DE.json.js +17 -3
- package/dist/locales/en-US.json.d.ts +18 -3
- package/dist/locales/en-US.json.js +17 -3
- package/dist/locales/es-ES.json.d.ts +18 -3
- package/dist/locales/es-ES.json.js +17 -3
- package/dist/mcp-component-registry.json +1 -7
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +3 -1
- package/dist/node_modules/@mui/icons-material/Check.js +17 -0
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/stories/tableV36ChatApiMock.d.ts +226 -74
- package/dist/stories/tableV36ChatApiMock.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.js +0 -65
|
@@ -1,6 +1,8 @@
|
|
|
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}
|
|
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}.table-chat-panel .impact_drawer_container{background:#f8f9fb}.table-chat-panel .impact_drawer_header{background:#fff;border-bottom:1px solid #d9dde7;box-sizing:border-box;height:auto;padding:12px 16px}.table-chat-panel .impact_drawer_header .impact_drawer_heading{color:#1f2b4d;font-size:20px;font-weight:800;line-height:30px}.table-chat-panel .impact_drawer_header .table-chat-panel-close{height:26px;min-width:26px;padding:0;width:26px}.table-chat-panel .impact_drawer_body{height:calc(100% - 56px)!important;padding:6px}.table-chat-container{box-sizing:border-box;display:flex;flex-direction:row;gap:10px;height:100%;overflow:hidden;padding:4px;width:100%}.table-chat-container .table-left-panel-container{flex:0 0 350px;flex-shrink:0;max-width:350px;width:350px;z-index:2}.empty-container{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;gap:4px;justify-content:center;max-width:100%;padding:16px;text-align:center;width:100%}.empty-container img{height:197px;object-fit:contain;width:190px}.empty-container__title{color:#1f2b4d;font-size:20px;font-style:normal;font-weight:800;line-height:30px}.empty-container__subtitle{color:#7a8294;font-size:16px;font-style:normal;font-weight:500;line-height:1.25;text-align:center}.loader-padding{padding:16px;width:100%}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
2
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useCallback, useMemo, useEffect } from "react";
|
|
4
|
+
import default_1 from "../../node_modules/@mui/icons-material/Close.js";
|
|
5
|
+
import { Button } from "../Button/index.js";
|
|
4
6
|
import { Panel } from "../Panel/index.js";
|
|
5
7
|
import { Prompt } from "../Prompt/index.js";
|
|
6
8
|
import { Toast } from "../Toast/index.js";
|
|
@@ -13,8 +15,8 @@ import { EmptyContainer } from "./EmptyContainer.js";
|
|
|
13
15
|
import { formatChatHeaderTimestamp } from "./utils/formatChatTimestamp.js";
|
|
14
16
|
|
|
15
17
|
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
16
|
-
const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
|
|
18
|
+
const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration, entryContext = null }) => {
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R;
|
|
18
20
|
const { t } = useTranslation();
|
|
19
21
|
const [selectedChannelId, setSelectedChannelId] = useState(null);
|
|
20
22
|
const [selectedChannelInfo, setSelectedChannelInfo] = useState(null);
|
|
@@ -171,9 +173,14 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
171
173
|
setToastVariant("info");
|
|
172
174
|
}
|
|
173
175
|
};
|
|
174
|
-
const handleChatClick = async (chatId, selectedChatData) => {
|
|
176
|
+
const handleChatClick = async (chatId, selectedChatData, options = {}) => {
|
|
175
177
|
var _a2;
|
|
176
|
-
|
|
178
|
+
const { screen, keepScreen = false } = options;
|
|
179
|
+
if (screen) {
|
|
180
|
+
setCurrentSelectedScreen(screen);
|
|
181
|
+
} else if (!keepScreen) {
|
|
182
|
+
setCurrentSelectedScreen("chats");
|
|
183
|
+
}
|
|
177
184
|
setLoadingMessages(true);
|
|
178
185
|
setSelectedChatId(chatId);
|
|
179
186
|
setSelectedChatInfo(selectedChatData);
|
|
@@ -189,7 +196,7 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
189
196
|
setLoadingMessages(false);
|
|
190
197
|
}
|
|
191
198
|
};
|
|
192
|
-
const fetchChatList = async (currentActiveChannelInfo) => {
|
|
199
|
+
const fetchChatList = async (currentActiveChannelInfo, { autoOpenFirst = true } = {}) => {
|
|
193
200
|
var _a2;
|
|
194
201
|
setCurrentSelectedScreen("chats");
|
|
195
202
|
setSelectedChat([]);
|
|
@@ -199,6 +206,10 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
199
206
|
const chatList2 = await chatConfiguration.leftPanel.loadChatList(currentActiveChannelInfo);
|
|
200
207
|
setChatList(chatList2);
|
|
201
208
|
setOriginalChatList(chatList2);
|
|
209
|
+
if (autoOpenFirst && (chatList2 == null ? void 0 : chatList2.length) > 0) {
|
|
210
|
+
const firstChat = chatList2[0];
|
|
211
|
+
await handleChatClick(firstChat.id, firstChat, { keepScreen: true });
|
|
212
|
+
}
|
|
202
213
|
return chatList2;
|
|
203
214
|
} catch (err) {
|
|
204
215
|
console.error("[TableChatSidePanel] [fetchChatList] [error]:", err);
|
|
@@ -225,7 +236,7 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
225
236
|
title: t("tableChat.sidePanel.chatList"),
|
|
226
237
|
objectType: (_e2 = newChat == null ? void 0 : newChat.otherProps) == null ? void 0 : _e2.object_type
|
|
227
238
|
};
|
|
228
|
-
await fetchChatList(newChannelInfo);
|
|
239
|
+
await fetchChatList(newChannelInfo, { autoOpenFirst: false });
|
|
229
240
|
setSelectedChannelInfo(newChannelInfo);
|
|
230
241
|
setSelectedChannelId((_g2 = (_f2 = newChat == null ? void 0 : newChat.otherProps) == null ? void 0 : _f2.object_ids) == null ? void 0 : _g2[0]);
|
|
231
242
|
await handleChatClick(newChat.id, newChat);
|
|
@@ -241,6 +252,12 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
241
252
|
};
|
|
242
253
|
const fetchChannelList = async () => {
|
|
243
254
|
setCurrentSelectedScreen("channels");
|
|
255
|
+
setSelectedChannelId(null);
|
|
256
|
+
setSelectedChannelInfo(null);
|
|
257
|
+
setSelectedChatId(null);
|
|
258
|
+
setSelectedChatInfo(null);
|
|
259
|
+
setChatList([]);
|
|
260
|
+
setOriginalChatList([]);
|
|
244
261
|
setLoadingChannelsOrChats(true);
|
|
245
262
|
try {
|
|
246
263
|
const channelList = await chatConfiguration.leftPanel.loadChannelsList();
|
|
@@ -296,11 +313,90 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
296
313
|
setLoadingChannelsOrChats(false);
|
|
297
314
|
}
|
|
298
315
|
};
|
|
316
|
+
const openChatFromSelection = async (selectedRows = [], { isSpace = false } = {}) => {
|
|
317
|
+
var _a2;
|
|
318
|
+
setLoadingChannelsOrChats(true);
|
|
319
|
+
setLoadingMessages(true);
|
|
320
|
+
setIsCreateNewChatOpen(false);
|
|
321
|
+
try {
|
|
322
|
+
const onStartNewChat = (_a2 = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _a2.onStartNewChat;
|
|
323
|
+
if (typeof onStartNewChat !== "function") {
|
|
324
|
+
await fetchChannelList();
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const result = await onStartNewChat(selectedRows, { isSpace });
|
|
328
|
+
const channel = result == null ? void 0 : result.channel;
|
|
329
|
+
const chatToOpen = (result == null ? void 0 : result.openChat) || (result == null ? void 0 : result.formattedChat);
|
|
330
|
+
if (!(result == null ? void 0 : result.success) || !channel || !(chatToOpen == null ? void 0 : chatToOpen.id)) {
|
|
331
|
+
await fetchChannelList();
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const nextChannels = Array.isArray(result.channelsList) ? result.channelsList : [channel];
|
|
335
|
+
const nextScreen = result.screen === "channels" ? "channels" : "chats";
|
|
336
|
+
const nextChatList = Array.isArray(result.chatList) ? result.chatList : [chatToOpen];
|
|
337
|
+
setChannelsList(nextChannels);
|
|
338
|
+
setOriginalChanelList(nextChannels);
|
|
339
|
+
setSelectedChannelId(channel.id);
|
|
340
|
+
setSelectedChannelInfo(channel);
|
|
341
|
+
setChatList(nextChatList);
|
|
342
|
+
setOriginalChatList(nextChatList);
|
|
343
|
+
setCurrentSelectedScreen(nextScreen);
|
|
344
|
+
await handleChatClick(chatToOpen.id, chatToOpen, { screen: nextScreen });
|
|
345
|
+
} catch (error) {
|
|
346
|
+
console.error("[TableChatSidePanel] [openChatFromSelection] [error]:", error);
|
|
347
|
+
handleToast(true, t("tableChat.sidePanel.errorLoadingChat"), "error");
|
|
348
|
+
await fetchChannelList();
|
|
349
|
+
} finally {
|
|
350
|
+
setLoadingChannelsOrChats(false);
|
|
351
|
+
setLoadingMessages(false);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
const openChannelFromRow = async (selectedRows = []) => {
|
|
355
|
+
var _a2, _b2;
|
|
356
|
+
setLoadingChannelsOrChats(true);
|
|
357
|
+
setIsCreateNewChatOpen(false);
|
|
358
|
+
setSelectedChatId(null);
|
|
359
|
+
setSelectedChatInfo(null);
|
|
360
|
+
try {
|
|
361
|
+
const onOpenChannelFromRow = (_a2 = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _a2.onOpenChannelFromRow;
|
|
362
|
+
if (typeof onOpenChannelFromRow !== "function") {
|
|
363
|
+
await fetchChannelList();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
const result = await onOpenChannelFromRow(selectedRows);
|
|
367
|
+
if (!(result == null ? void 0 : result.success) || !(result == null ? void 0 : result.channel)) {
|
|
368
|
+
await fetchChannelList();
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
const nextChannels = Array.isArray(result.channelsList) ? result.channelsList : [result.channel];
|
|
372
|
+
const nextChatList = Array.isArray(result.chatList) ? result.chatList : [];
|
|
373
|
+
const nextScreen = result.screen === "channels" ? "channels" : "chats";
|
|
374
|
+
setChannelsList(nextChannels);
|
|
375
|
+
setOriginalChanelList(nextChannels);
|
|
376
|
+
setSelectedChannelId(result.channel.id);
|
|
377
|
+
setSelectedChannelInfo(result.channel);
|
|
378
|
+
setChatList(nextChatList);
|
|
379
|
+
setOriginalChatList(nextChatList);
|
|
380
|
+
setCurrentSelectedScreen(nextScreen);
|
|
381
|
+
const chatToOpen = ((_b2 = result.openChat) == null ? void 0 : _b2.id) != null ? result.openChat : nextChatList.length > 0 ? nextChatList[0] : null;
|
|
382
|
+
if (chatToOpen == null ? void 0 : chatToOpen.id) {
|
|
383
|
+
await handleChatClick(chatToOpen.id, chatToOpen, { screen: nextScreen });
|
|
384
|
+
}
|
|
385
|
+
} catch (error) {
|
|
386
|
+
console.error("[TableChatSidePanel] [openChannelFromRow] [error]:", error);
|
|
387
|
+
handleToast(true, t("tableChat.sidePanel.errorLoadingChat"), "error");
|
|
388
|
+
await fetchChannelList();
|
|
389
|
+
} finally {
|
|
390
|
+
setLoadingChannelsOrChats(false);
|
|
391
|
+
}
|
|
392
|
+
};
|
|
299
393
|
const clearnupLocalStates = () => {
|
|
300
394
|
setSelectedChannelId(null);
|
|
301
395
|
setSelectedChannelInfo(null);
|
|
302
396
|
setSelectedChatInfo(null);
|
|
303
397
|
setSelectedChatId(null);
|
|
398
|
+
setChannelsList([]);
|
|
399
|
+
setOriginalChanelList([]);
|
|
304
400
|
setChatList([]);
|
|
305
401
|
setOriginalChatList([]);
|
|
306
402
|
setSelectedChat([]);
|
|
@@ -312,6 +408,7 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
312
408
|
setIsMoreOpen(false);
|
|
313
409
|
setHighlightMessageId(null);
|
|
314
410
|
setIsCreateNewChatOpen(false);
|
|
411
|
+
setCurrentSelectedScreen("channels");
|
|
315
412
|
};
|
|
316
413
|
const handleBackToChannels = async () => {
|
|
317
414
|
var _a2;
|
|
@@ -322,10 +419,19 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
322
419
|
await fetchChannelList();
|
|
323
420
|
};
|
|
324
421
|
useEffect(() => {
|
|
325
|
-
if (isOpen) {
|
|
422
|
+
if (!isOpen) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
if ((entryContext == null ? void 0 : entryContext.mode) === "startNewChat" || (entryContext == null ? void 0 : entryContext.mode) === "createSpace") {
|
|
426
|
+
openChatFromSelection(entryContext.selectedRows, {
|
|
427
|
+
isSpace: entryContext.mode === "createSpace"
|
|
428
|
+
});
|
|
429
|
+
} else if ((entryContext == null ? void 0 : entryContext.mode) === "openChannel") {
|
|
430
|
+
openChannelFromRow(entryContext.selectedRows);
|
|
431
|
+
} else {
|
|
326
432
|
fetchChannelsOrChats();
|
|
327
433
|
}
|
|
328
|
-
}, [isOpen]);
|
|
434
|
+
}, [isOpen, entryContext == null ? void 0 : entryContext.mode, entryContext == null ? void 0 : entryContext.openedAt]);
|
|
329
435
|
useEffect(() => {
|
|
330
436
|
var _a2;
|
|
331
437
|
if (!isOpen) {
|
|
@@ -373,13 +479,42 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
373
479
|
setHighlightTrigger((prev) => prev + 1);
|
|
374
480
|
};
|
|
375
481
|
const handleChannelClick = async (selectedChannelId2, selectedChannelInfo2) => {
|
|
482
|
+
var _a2, _b2, _c2;
|
|
376
483
|
setSelectedChannelId(selectedChannelId2);
|
|
377
484
|
setSelectedChannelInfo(selectedChannelInfo2);
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
485
|
+
setSelectedChatId(null);
|
|
486
|
+
setSelectedChatInfo(null);
|
|
487
|
+
setSelectedChat([]);
|
|
488
|
+
const onChannelOpen = (_a2 = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _a2.onChannelOpen;
|
|
489
|
+
if (typeof onChannelOpen === "function") {
|
|
490
|
+
try {
|
|
491
|
+
const result = await onChannelOpen(selectedChannelInfo2);
|
|
492
|
+
if (Array.isArray(result == null ? void 0 : result.channelsList)) {
|
|
493
|
+
setChannelsList(result.channelsList);
|
|
494
|
+
setOriginalChanelList(result.channelsList);
|
|
495
|
+
}
|
|
496
|
+
if (Array.isArray(result == null ? void 0 : result.chatList)) {
|
|
497
|
+
setCurrentSelectedScreen(result.screen === "channels" ? "channels" : "chats");
|
|
498
|
+
setChatList(result.chatList);
|
|
499
|
+
setOriginalChatList(result.chatList);
|
|
500
|
+
} else {
|
|
501
|
+
await fetchChatList(selectedChannelInfo2);
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
const chatToOpen = ((_b2 = result == null ? void 0 : result.openChat) == null ? void 0 : _b2.id) != null ? result.openChat : ((_c2 = result == null ? void 0 : result.chatList) == null ? void 0 : _c2.length) > 0 ? result.chatList[0] : null;
|
|
505
|
+
if (chatToOpen == null ? void 0 : chatToOpen.id) {
|
|
506
|
+
await handleChatClick(chatToOpen.id, chatToOpen, {
|
|
507
|
+
screen: result.screen === "channels" ? "channels" : "chats"
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return;
|
|
511
|
+
} catch (error) {
|
|
512
|
+
console.error("[TableChatSidePanel] [onChannelOpen] [error]:", error);
|
|
513
|
+
handleToast(true, t("tableChat.sidePanel.errorLoadingChat"), "error");
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
382
516
|
}
|
|
517
|
+
await fetchChatList(selectedChannelInfo2);
|
|
383
518
|
};
|
|
384
519
|
const handleChatSelect = (selectedChatId2) => {
|
|
385
520
|
setSelectedChat(
|
|
@@ -469,10 +604,22 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
469
604
|
{
|
|
470
605
|
anchor: "right",
|
|
471
606
|
className: "table-chat-panel",
|
|
607
|
+
headerRightContent: /* @__PURE__ */ jsx(
|
|
608
|
+
Button,
|
|
609
|
+
{
|
|
610
|
+
"aria-label": t("common.close"),
|
|
611
|
+
className: "table-chat-panel-close",
|
|
612
|
+
icon: /* @__PURE__ */ jsx(default_1, { fontSize: "small" }),
|
|
613
|
+
size: "medium",
|
|
614
|
+
variant: "text",
|
|
615
|
+
onClick: handleClose
|
|
616
|
+
}
|
|
617
|
+
),
|
|
472
618
|
open: isOpen,
|
|
473
619
|
setIsOpen: () => {
|
|
474
620
|
setIsChatOpen(!isChatOpen);
|
|
475
621
|
},
|
|
622
|
+
showCloseButton: false,
|
|
476
623
|
size: "medium",
|
|
477
624
|
title: chatConfiguration == null ? void 0 : chatConfiguration.title,
|
|
478
625
|
width: pinnedMsg || showThread ? 1450 : 985,
|
|
@@ -497,7 +644,7 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
497
644
|
showAddChatBtn: (_u = (_t = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _t.leftHeaderPanel) == null ? void 0 : _u.showAddChat,
|
|
498
645
|
showChannelList: isChannelsScreen,
|
|
499
646
|
showCheckbox: (_w = (_v = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _v.leftChatPanel) == null ? void 0 : _w.showCheckbox,
|
|
500
|
-
title: isChannelsScreen ? t("tableChat.sidePanel.channelsList") : selectedChannelInfo == null ? void 0 : selectedChannelInfo.title,
|
|
647
|
+
title: isChannelsScreen ? ((_x = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _x.channelListTitle) ?? t("tableChat.sidePanel.channelsList") : selectedChannelInfo == null ? void 0 : selectedChannelInfo.title,
|
|
501
648
|
onBack: handleBackToChannels,
|
|
502
649
|
onChannelSelect: (id, selectedChannelOrChat) => {
|
|
503
650
|
if (isChannelsScreen) {
|
|
@@ -509,21 +656,67 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
509
656
|
onDeleteTopics: handleDeletePromptOpen,
|
|
510
657
|
onMenuClick: toggleMenu,
|
|
511
658
|
onMoreClick: showMore,
|
|
512
|
-
onPinnedChatClick: (
|
|
659
|
+
onPinnedChatClick: (_y = chatConfiguration == null ? void 0 : chatConfiguration.headerChatConfig) == null ? void 0 : _y.onPinnedChatClick,
|
|
513
660
|
onSearchClick: openSearch
|
|
514
661
|
}
|
|
515
662
|
),
|
|
516
663
|
loadingMessages ? /* @__PURE__ */ jsx(ChatSkeleton, { text: t("tableChat.loadingMessages") }) : /* @__PURE__ */ jsx(Fragment, { children: !selectedChannelId || !selectedChatId ? /* @__PURE__ */ jsx(
|
|
517
664
|
EmptyContainer,
|
|
518
665
|
{
|
|
519
|
-
subTitle: !selectedChannelId ? (
|
|
520
|
-
title: !selectedChannelId ? (
|
|
666
|
+
subTitle: !selectedChannelId ? (_z = chatConfiguration == null ? void 0 : chatConfiguration.messageChatConfig) == null ? void 0 : _z.emptyChannelStateSubTitle : !selectedChatId ? (_A = chatConfiguration == null ? void 0 : chatConfiguration.messageChatConfig) == null ? void 0 : _A.emptyChatStateSubTitle : "",
|
|
667
|
+
title: !selectedChannelId ? (_B = chatConfiguration == null ? void 0 : chatConfiguration.messageChatConfig) == null ? void 0 : _B.emptyChannelStateTitle : !selectedChatId ? (_C = chatConfiguration == null ? void 0 : chatConfiguration.messageChatConfig) == null ? void 0 : _C.emptyChatStateTitle : ""
|
|
521
668
|
}
|
|
522
669
|
) : /* @__PURE__ */ jsx(
|
|
523
670
|
TableChatRightSection,
|
|
524
671
|
{
|
|
525
672
|
chatHeaderConfig: {
|
|
526
673
|
...chatConfiguration == null ? void 0 : chatConfiguration.headerChatConfig,
|
|
674
|
+
isResolved: (selectedChatInfo == null ? void 0 : selectedChatInfo.isResolved) ?? ((_D = selectedChatInfo == null ? void 0 : selectedChatInfo.otherProps) == null ? void 0 : _D.is_resolved) ?? ((_E = chatConfiguration == null ? void 0 : chatConfiguration.headerChatConfig) == null ? void 0 : _E.isResolved),
|
|
675
|
+
chatDisplayId: (selectedChatInfo == null ? void 0 : selectedChatInfo.displayId) ?? ((_F = selectedChatInfo == null ? void 0 : selectedChatInfo.otherProps) == null ? void 0 : _F.reference_id) ?? ((_G = selectedChatInfo == null ? void 0 : selectedChatInfo.otherProps) == null ? void 0 : _G.display_id) ?? ((_H = chatConfiguration == null ? void 0 : chatConfiguration.headerChatConfig) == null ? void 0 : _H.chatDisplayId),
|
|
676
|
+
onResolve: async (resolvedChatId) => {
|
|
677
|
+
var _a2, _b2;
|
|
678
|
+
const result = await ((_b2 = (_a2 = chatConfiguration == null ? void 0 : chatConfiguration.headerChatConfig) == null ? void 0 : _a2.onResolve) == null ? void 0 : _b2.call(_a2, resolvedChatId));
|
|
679
|
+
setSelectedChatInfo(
|
|
680
|
+
(prev) => prev ? {
|
|
681
|
+
...prev,
|
|
682
|
+
isResolved: true,
|
|
683
|
+
otherProps: { ...prev.otherProps, is_resolved: true }
|
|
684
|
+
} : prev
|
|
685
|
+
);
|
|
686
|
+
return result;
|
|
687
|
+
},
|
|
688
|
+
onTitleChange: async (renamedChatId, nextTitle) => {
|
|
689
|
+
var _a2, _b2, _c2;
|
|
690
|
+
const result = await ((_b2 = (_a2 = chatConfiguration == null ? void 0 : chatConfiguration.headerChatConfig) == null ? void 0 : _a2.onTitleChange) == null ? void 0 : _b2.call(
|
|
691
|
+
_a2,
|
|
692
|
+
renamedChatId,
|
|
693
|
+
nextTitle
|
|
694
|
+
));
|
|
695
|
+
const resolvedTitle = (result == null ? void 0 : result.title) ?? ((_c2 = result == null ? void 0 : result.formattedChat) == null ? void 0 : _c2.title) ?? nextTitle;
|
|
696
|
+
setSelectedChatInfo(
|
|
697
|
+
(prev) => prev ? {
|
|
698
|
+
...prev,
|
|
699
|
+
title: resolvedTitle,
|
|
700
|
+
otherProps: {
|
|
701
|
+
...prev.otherProps,
|
|
702
|
+
name: resolvedTitle
|
|
703
|
+
}
|
|
704
|
+
} : prev
|
|
705
|
+
);
|
|
706
|
+
const patchChatTitle = (list = []) => list.map(
|
|
707
|
+
(chat) => (chat == null ? void 0 : chat.id) === renamedChatId ? {
|
|
708
|
+
...chat,
|
|
709
|
+
title: resolvedTitle,
|
|
710
|
+
otherProps: {
|
|
711
|
+
...chat.otherProps,
|
|
712
|
+
name: resolvedTitle
|
|
713
|
+
}
|
|
714
|
+
} : chat
|
|
715
|
+
);
|
|
716
|
+
setChatList((prev) => patchChatTitle(prev));
|
|
717
|
+
setOriginalChatList((prev) => patchChatTitle(prev));
|
|
718
|
+
return result;
|
|
719
|
+
},
|
|
527
720
|
onPinnedClick: (chatId) => {
|
|
528
721
|
setShowThread(false);
|
|
529
722
|
setShowPinnedMsg(true);
|
|
@@ -531,18 +724,18 @@ const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
|
531
724
|
}
|
|
532
725
|
},
|
|
533
726
|
chatId: selectedChatId,
|
|
534
|
-
CreatedBy: (selectedChatInfo == null ? void 0 : selectedChatInfo.createdBy) || (selectedChatInfo == null ? void 0 : selectedChatInfo.user) || ((
|
|
727
|
+
CreatedBy: (selectedChatInfo == null ? void 0 : selectedChatInfo.createdBy) || (selectedChatInfo == null ? void 0 : selectedChatInfo.user) || ((_I = selectedChatInfo == null ? void 0 : selectedChatInfo.otherProps) == null ? void 0 : _I.created_by_user),
|
|
535
728
|
handleToast,
|
|
536
729
|
inputChatConfig: {
|
|
537
730
|
...chatConfiguration.inputChatConfig
|
|
538
731
|
},
|
|
539
732
|
messageConfig: memoizedMessageConfig,
|
|
540
733
|
setPinnedMessages,
|
|
541
|
-
showActionBtn: (
|
|
542
|
-
showParticipantsList: (
|
|
543
|
-
showPinnedChat: (
|
|
544
|
-
showSearch: (
|
|
545
|
-
createdAt: (selectedChatInfo == null ? void 0 : selectedChatInfo.createdAt) || formatChatHeaderTimestamp((
|
|
734
|
+
showActionBtn: (_K = (_J = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _J.rightHeaderPanel) == null ? void 0 : _K.showActionBtn,
|
|
735
|
+
showParticipantsList: (_M = (_L = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _L.rightHeaderPanel) == null ? void 0 : _M.showParticipants,
|
|
736
|
+
showPinnedChat: (_O = (_N = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _N.rightHeaderPanel) == null ? void 0 : _O.showPinnedChat,
|
|
737
|
+
showSearch: (_Q = (_P = chatConfiguration == null ? void 0 : chatConfiguration.leftPanel) == null ? void 0 : _P.rightHeaderPanel) == null ? void 0 : _Q.showChatSearch,
|
|
738
|
+
createdAt: (selectedChatInfo == null ? void 0 : selectedChatInfo.createdAt) || formatChatHeaderTimestamp((_R = selectedChatInfo == null ? void 0 : selectedChatInfo.otherProps) == null ? void 0 : _R.created_at),
|
|
546
739
|
title: selectedChatInfo == null ? void 0 : selectedChatInfo.title
|
|
547
740
|
}
|
|
548
741
|
) }),
|
|
@@ -1,4 +1,4 @@
|
|
|
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}.chatcontainer{background:#fff;border-radius:10px;box-shadow:0 0 4px #0000001f;display:grid;grid-auto-flow:row;padding:10px;
|
|
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}.chatcontainer{background:#fff;border-radius:10px;box-shadow:0 0 4px #0000001f;box-sizing:border-box;display:grid;grid-auto-flow:row;padding:10px;row-gap:10px;width:231px}.chatcontainer .MuiInputBase-root input.MuiInputBase-input{min-width:210px!important}.chatFooterContainer{display:flex;gap:8px;justify-content:flex-end}.addChat_container{position:absolute;right:0;top:calc(100% + 4px);z-index:10}.chat_save_btn{background-color:#4259ee!important}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useRef, useEffect } from "react";
|
|
4
4
|
import { useForm, Controller } from "react-hook-form";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export declare const ChatChannelItem: ({ id, title, subtitle, timestamp, unreadCount, avatar, isSelected, isMuted, onClick, showChannelList, showCheckbox, handleChatSelect, selectedChat, onPinnedChatClick, onPinnedChange, handleToast, isPinned: isPinnedProp, ...rest }: {
|
|
1
|
+
export declare const ChatChannelItem: ({ id, title, subtitle, timestamp, time, unreadCount, chatCount, avatar, isSelected, isMuted, onClick, showChannelList, showCheckbox, handleChatSelect, selectedChat, onPinnedChatClick, onPinnedChange, handleToast, isPinned: isPinnedProp, isSpace, badge, badgeLabel, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
id: any;
|
|
4
4
|
title: any;
|
|
5
|
-
subtitle
|
|
5
|
+
subtitle?: string | undefined;
|
|
6
6
|
timestamp: any;
|
|
7
|
+
time: any;
|
|
7
8
|
unreadCount: any;
|
|
9
|
+
chatCount: any;
|
|
8
10
|
avatar: any;
|
|
9
11
|
isSelected: any;
|
|
10
12
|
isMuted: any;
|
|
@@ -19,5 +21,8 @@ export declare const ChatChannelItem: ({ id, title, subtitle, timestamp, unreadC
|
|
|
19
21
|
onPinnedChange: any;
|
|
20
22
|
handleToast: any;
|
|
21
23
|
isPinned: any;
|
|
24
|
+
isSpace?: boolean | undefined;
|
|
25
|
+
badge: any;
|
|
26
|
+
badgeLabel: any;
|
|
22
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
28
|
//# sourceMappingURL=ChatChannelItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatChannelItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableChat/components/TableChatLeftSection/ChatChannelItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatChannelItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableChat/components/TableChatLeftSection/ChatChannelItem.tsx"],"names":[],"mappings":"AAuCA,eAAO,MAAM,eAAe,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB/B,4CAiIA,CAAC"}
|
|
@@ -1,17 +1,41 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import default_1 from "../../../../node_modules/@mui/icons-material/NotificationsOff.js";
|
|
3
3
|
import { getAssetUrl } from "../../../../utils/assetBase.js";
|
|
4
4
|
import { ChannelCheckbox } from "./ChannelCheckbox/ChannelCheckbox.js";
|
|
5
5
|
import { UnreadBadge } from "./UnreadBadge/UnreadBadge.js";
|
|
6
6
|
import { Avatar } from "../../../Avatar/index.js";
|
|
7
|
+
import { Badge } from "../../../Badge/index.js";
|
|
7
8
|
import { useTranslation } from "../../../../i18n/useTranslation.js";
|
|
8
9
|
const PinnedIcon = getAssetUrl("icons/pinedIcon.svg");
|
|
10
|
+
const formatBadgeCountLabel = (count, maxCount = 99) => {
|
|
11
|
+
if (!count || count <= 0) return null;
|
|
12
|
+
return count > maxCount ? `${maxCount}+` : String(count);
|
|
13
|
+
};
|
|
14
|
+
const resolveLabelBadge = (badge, badgeLabel, isSpace, spaceLabel) => {
|
|
15
|
+
if (badge && typeof badge === "object" && badge.label) {
|
|
16
|
+
return {
|
|
17
|
+
label: badge.label,
|
|
18
|
+
variant: badge.variant || "stroke",
|
|
19
|
+
color: badge.color,
|
|
20
|
+
size: badge.size || "small"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (typeof badgeLabel === "string" && badgeLabel.trim()) {
|
|
24
|
+
return { label: badgeLabel, variant: "stroke", size: "small" };
|
|
25
|
+
}
|
|
26
|
+
if (isSpace) {
|
|
27
|
+
return { label: spaceLabel, variant: "stroke", size: "small" };
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
9
31
|
const ChatChannelItem = ({
|
|
10
32
|
id,
|
|
11
33
|
title,
|
|
12
|
-
subtitle,
|
|
34
|
+
subtitle = "",
|
|
13
35
|
timestamp,
|
|
36
|
+
time,
|
|
14
37
|
unreadCount,
|
|
38
|
+
chatCount,
|
|
15
39
|
avatar,
|
|
16
40
|
isSelected,
|
|
17
41
|
isMuted,
|
|
@@ -24,10 +48,21 @@ const ChatChannelItem = ({
|
|
|
24
48
|
onPinnedChange,
|
|
25
49
|
handleToast,
|
|
26
50
|
isPinned: isPinnedProp,
|
|
51
|
+
isSpace = false,
|
|
52
|
+
badge,
|
|
53
|
+
badgeLabel,
|
|
27
54
|
...rest
|
|
28
55
|
}) => {
|
|
29
56
|
const { t } = useTranslation();
|
|
30
57
|
const isPinned = Boolean(isPinnedProp ?? rest.isPinned);
|
|
58
|
+
const displayTime = timestamp ?? time;
|
|
59
|
+
const channelBadgeLabel = formatBadgeCountLabel(chatCount);
|
|
60
|
+
const labelBadge = resolveLabelBadge(
|
|
61
|
+
badge,
|
|
62
|
+
badgeLabel,
|
|
63
|
+
Boolean(isSpace ?? rest.isSpace),
|
|
64
|
+
t("tableChat.channelItem.spaceBadge")
|
|
65
|
+
);
|
|
31
66
|
const handlePinnedChatClick = async (chatId, newPinned) => {
|
|
32
67
|
if (onPinnedChatClick) {
|
|
33
68
|
onPinnedChange == null ? void 0 : onPinnedChange(chatId, newPinned);
|
|
@@ -41,31 +76,64 @@ const ChatChannelItem = ({
|
|
|
41
76
|
}
|
|
42
77
|
}
|
|
43
78
|
};
|
|
79
|
+
const handleActivate = (e) => {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
onClick == null ? void 0 : onClick(id);
|
|
82
|
+
};
|
|
83
|
+
const handleKeyDown = (e) => {
|
|
84
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
onClick == null ? void 0 : onClick(id);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
if (showChannelList) {
|
|
90
|
+
return /* @__PURE__ */ jsxs(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: `channel-list-item${isSelected ? " channel-list-item--selected" : ""}${isMuted ? " channel-list-item--muted" : ""}`,
|
|
94
|
+
role: "button",
|
|
95
|
+
tabIndex: 0,
|
|
96
|
+
onClick: handleActivate,
|
|
97
|
+
onKeyDown: handleKeyDown,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "channel-list-item__content", children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "channel-list-item__title-row", children: [
|
|
101
|
+
/* @__PURE__ */ jsx("span", { className: "channel-list-item__title", children: title }),
|
|
102
|
+
labelBadge ? /* @__PURE__ */ jsx(
|
|
103
|
+
Badge,
|
|
104
|
+
{
|
|
105
|
+
color: labelBadge.color,
|
|
106
|
+
label: labelBadge.label,
|
|
107
|
+
size: labelBadge.size,
|
|
108
|
+
variant: labelBadge.variant
|
|
109
|
+
}
|
|
110
|
+
) : null
|
|
111
|
+
] }),
|
|
112
|
+
displayTime ? /* @__PURE__ */ jsx("span", { className: "channel-list-item__time", children: displayTime }) : null
|
|
113
|
+
] }),
|
|
114
|
+
!labelBadge && channelBadgeLabel ? /* @__PURE__ */ jsx(Badge, { color: "info", label: channelBadgeLabel, size: "small", variant: "filled" }) : null
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
44
119
|
return /* @__PURE__ */ jsxs(
|
|
45
120
|
"div",
|
|
46
121
|
{
|
|
47
|
-
className:
|
|
122
|
+
className: `chat_list${isSelected ? " selected" : ""}${isMuted ? " muted" : ""}`,
|
|
48
123
|
role: "button",
|
|
49
124
|
tabIndex: 0,
|
|
50
|
-
onClick:
|
|
51
|
-
|
|
52
|
-
onClick == null ? void 0 : onClick(id);
|
|
53
|
-
},
|
|
54
|
-
onKeyPress: (e) => {
|
|
55
|
-
if (e.key === "Enter" || e.key === " ") onClick == null ? void 0 : onClick(id);
|
|
56
|
-
},
|
|
125
|
+
onClick: handleActivate,
|
|
126
|
+
onKeyDown: handleKeyDown,
|
|
57
127
|
children: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */ jsx("div", { className: "channel-avatar", children: /* @__PURE__ */ jsx(Avatar, { label: (avatar == null ? void 0 : avatar.label) || title, size: "medium", src: avatar == null ? void 0 : avatar.src }) })
|
|
68
|
-
] }),
|
|
128
|
+
showCheckbox && /* @__PURE__ */ jsx(
|
|
129
|
+
ChannelCheckbox,
|
|
130
|
+
{
|
|
131
|
+
handleChatSelect,
|
|
132
|
+
id,
|
|
133
|
+
selectedChat
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ jsx("div", { className: "channel-avatar", children: /* @__PURE__ */ jsx(Avatar, { label: (avatar == null ? void 0 : avatar.label) || title, size: "medium", src: avatar == null ? void 0 : avatar.src }) }),
|
|
69
137
|
/* @__PURE__ */ jsxs("div", { className: "channel-content", children: [
|
|
70
138
|
/* @__PURE__ */ jsxs("div", { className: "channel-header", children: [
|
|
71
139
|
/* @__PURE__ */ jsx("h3", { className: "channel-title", children: title }),
|
|
@@ -74,10 +142,10 @@ const ChatChannelItem = ({
|
|
|
74
142
|
/* @__PURE__ */ jsx(UnreadBadge, { count: unreadCount })
|
|
75
143
|
] })
|
|
76
144
|
] }),
|
|
77
|
-
/* @__PURE__ */ jsx("p", { className: "channel-subtitle", children: subtitle }),
|
|
145
|
+
subtitle ? /* @__PURE__ */ jsx("p", { className: "channel-subtitle", children: subtitle }) : null,
|
|
78
146
|
/* @__PURE__ */ jsxs("div", { className: "pinnedChat_container", children: [
|
|
79
|
-
/* @__PURE__ */ jsx("span", { className: "channel-time", children:
|
|
80
|
-
|
|
147
|
+
/* @__PURE__ */ jsx("span", { className: "channel-time", children: displayTime }),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
81
149
|
"img",
|
|
82
150
|
{
|
|
83
151
|
alt: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatChannelList.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableChat/components/TableChatLeftSection/ChatChannelList.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,GAAI;;;;;;;;;;CAU/B,
|
|
1
|
+
{"version":3,"file":"ChatChannelList.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableChat/components/TableChatLeftSection/ChatChannelList.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,GAAI;;;;;;;;;;CAU/B,4CAqFA,CAAC"}
|
|
@@ -51,7 +51,8 @@ const ChatChannelList = ({
|
|
|
51
51
|
if (aPinned === bPinned) return 0;
|
|
52
52
|
return aPinned ? -1 : 1;
|
|
53
53
|
}) : [];
|
|
54
|
-
|
|
54
|
+
const listClassName = showChannelList ? "channel-list" : "chat-channel-list";
|
|
55
|
+
return /* @__PURE__ */ jsx("div", { className: listClassName, children: sortedChannels.length > 0 ? sortedChannels.map((channel, index) => /* @__PURE__ */ jsx(
|
|
55
56
|
ChatChannelItem,
|
|
56
57
|
{
|
|
57
58
|
...channel,
|
|
@@ -62,7 +63,7 @@ const ChatChannelList = ({
|
|
|
62
63
|
selectedChat,
|
|
63
64
|
showChannelList,
|
|
64
65
|
showCheckbox,
|
|
65
|
-
onClick: (
|
|
66
|
+
onClick: () => onChannelSelect(channel == null ? void 0 : channel.id, channel),
|
|
66
67
|
onPinnedChange: handlePinnedChange,
|
|
67
68
|
onPinnedChatClick
|
|
68
69
|
},
|