@droppii-org/chat-sdk 0.7.4 → 0.7.5
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/assets/images/defaultAvatarGroup.png +0 -0
- package/dist/components/conversation/ConversationByGroupItem.d.ts.map +1 -1
- package/dist/components/conversation/ConversationByGroupItem.js +2 -2
- package/dist/components/conversation/ConversationBySessionItem.d.ts.map +1 -1
- package/dist/components/conversation/ConversationBySessionItem.js +3 -3
- package/dist/components/conversation-inbox/ConversationPeerAvatar.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationPeerAvatar.js +3 -1
- package/dist/components/conversation-inbox/contact-search/PublicGroupResultItem.d.ts.map +1 -1
- package/dist/components/conversation-inbox/contact-search/PublicGroupResultItem.js +3 -2
- package/dist/components/conversation-inbox/contact-search/constants.d.ts +0 -1
- package/dist/components/conversation-inbox/contact-search/constants.d.ts.map +1 -1
- package/dist/components/conversation-inbox/contact-search/constants.js +0 -2
- package/dist/components/conversation-inbox/contact-search/index.d.ts +0 -1
- package/dist/components/conversation-inbox/contact-search/index.d.ts.map +1 -1
- package/dist/components/conversation-inbox/contact-search/index.js +0 -1
- package/dist/components/group/GroupAvatar.d.ts +9 -0
- package/dist/components/group/GroupAvatar.d.ts.map +1 -0
- package/dist/components/group/GroupAvatar.js +13 -0
- package/dist/components/group/JoinGroupConfirmModal.d.ts.map +1 -1
- package/dist/components/group/JoinGroupConfirmModal.js +3 -2
- package/dist/components/message/MessageHeader.d.ts.map +1 -1
- package/dist/components/message/MessageHeader.js +2 -2
- package/dist/components/search-conversation/item/SearchItemAsGroup.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsGroup.js +2 -2
- package/dist/components/search-conversation/item/SearchItemAsMessage.d.ts.map +1 -1
- package/dist/components/search-conversation/item/SearchItemAsMessage.js +3 -1
- package/dist/components/thread/GroupInfoBodyCrm.d.ts +0 -2
- package/dist/components/thread/GroupInfoBodyCrm.d.ts.map +1 -1
- package/dist/components/thread/GroupInfoBodyCrm.js +2 -2
- package/dist/components/thread/GroupThreadInfo.d.ts.map +1 -1
- package/dist/components/thread/GroupThreadInfo.js +2 -2
- package/dist/constants/images.d.ts +1 -0
- package/dist/constants/images.d.ts.map +1 -1
- package/dist/constants/images.js +3 -0
- package/dist/hooks/group/useCreateGroup.d.ts.map +1 -1
- package/dist/hooks/group/useCreateGroup.js +2 -3
- package/package.json +1 -1
- package/dist/components/conversation-inbox/contact-search/PublicGroupAvatar.d.ts +0 -9
- package/dist/components/conversation-inbox/contact-search/PublicGroupAvatar.d.ts.map +0 -1
- package/dist/components/conversation-inbox/contact-search/PublicGroupAvatar.js +0 -19
- package/dist/components/group/GroupCompositeAvatar.d.ts +0 -11
- package/dist/components/group/GroupCompositeAvatar.d.ts.map +0 -1
- package/dist/components/group/GroupCompositeAvatar.js +0 -87
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationByGroupItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationByGroupItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAaxF,UAAU,4BAA4B;IACpC,KAAK,EAAE,4BAA4B,CAAC;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,uBAAuB,GAAI,2BAG9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"ConversationByGroupItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationByGroupItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAaxF,UAAU,4BAA4B;IACpC,KAAK,EAAE,4BAA4B,CAAC;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,uBAAuB,GAAI,2BAG9B,4BAA4B,4CA6D9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import useConversationStore from "../../store/conversation";
|
|
|
5
5
|
import { useChatContext } from "../../context/ChatContext";
|
|
6
6
|
import { useDeskThreadNavigation } from "../../hooks/conversation/useDeskThreadNavigation";
|
|
7
7
|
import { parseLatestMessage } from "../../utils/common";
|
|
8
|
-
import
|
|
8
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
9
9
|
import DeskConversationRow from "./DeskConversationRow";
|
|
10
10
|
import { GroupVisibility } from "@droppii-org/wasm-client-sdk";
|
|
11
11
|
import { StrokeIcon } from "../../components/icon/StrokeIcon";
|
|
@@ -33,6 +33,6 @@ const ConversationByGroupItem = ({ group, latestPreview, }) => {
|
|
|
33
33
|
showName: conversation.showName,
|
|
34
34
|
}), mentionIndicator: _jsx(MentionIndicatorIcon, { groupAtType: conversation.groupAtType }), time: latestMsgSendTime > 0
|
|
35
35
|
? formatListRowTime(latestMsgSendTime, t)
|
|
36
|
-
: undefined, avatar: _jsx(
|
|
36
|
+
: undefined, avatar: _jsx(GroupAvatar, { faceURL: conversation.faceURL, groupName: conversation.showName, size: 40 }), name: conversation.showName, meta: group.visibility === GroupVisibility.Private ? (_jsxs(RowChip, { tone: "primary", children: [_jsx(StrokeIcon, { name: "lock", size: 14 }), t("group_visibility_private")] })) : undefined }));
|
|
37
37
|
};
|
|
38
38
|
export default ConversationByGroupItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationBySessionItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationBySessionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU1C,UAAU,8BAA8B;IACtC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,qFAAqF;IACrF,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAaD,QAAA,MAAM,yBAAyB,GAAI,4CAIhC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ConversationBySessionItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationBySessionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU1C,UAAU,8BAA8B;IACtC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,qFAAqF;IACrF,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAaD,QAAA,MAAM,yBAAyB,GAAI,4CAIhC,8BAA8B,mDAgGhC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -6,10 +6,10 @@ import useConversationStore from "../../store/conversation";
|
|
|
6
6
|
import { useChatContext } from "../../context/ChatContext";
|
|
7
7
|
import { useDeskThreadNavigation } from "../../hooks/conversation/useDeskThreadNavigation";
|
|
8
8
|
import { useConversationDisplayData } from "../../hooks/conversation/useConversation";
|
|
9
|
-
import {
|
|
9
|
+
import { isGroupConversation } from "../../utils/imCommon";
|
|
10
10
|
import { resolveBotSessionOwnerIdentity } from "../../utils/conversation";
|
|
11
11
|
import { SessionTag } from "../../types/chat";
|
|
12
|
-
import
|
|
12
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
13
13
|
import DeskConversationRow from "./DeskConversationRow";
|
|
14
14
|
import { formatListRowTime } from "./rowTime";
|
|
15
15
|
import DeskRowAvatar from "./DeskRowAvatar";
|
|
@@ -69,6 +69,6 @@ const ConversationBySessionItem = ({ sessionItem, latestPreview, folderTag, }) =
|
|
|
69
69
|
showName: conversation.showName,
|
|
70
70
|
}), mentionIndicator: _jsx(MentionIndicatorIcon, { groupAtType: conversation.groupAtType }), time: latestMsgSendTime > 0
|
|
71
71
|
? formatListRowTime(latestMsgSendTime, t)
|
|
72
|
-
: undefined, avatar: !ownerIdentity &&
|
|
72
|
+
: undefined, avatar: !ownerIdentity && isGroupConversation(conversation) ? (_jsx(GroupAvatar, { faceURL: avatar, groupName: displayName, size: 40 })) : (_jsx(DeskRowAvatar, { name: name, src: ownerIdentity ? ownerIdentity.avatarUrl : avatar })), name: name, nameTooltip: fullTitle, meta: tagChip ? (_jsx(RowChip, { tone: tagChip.tone, children: t(tagChip.labelKey) })) : undefined }));
|
|
73
73
|
};
|
|
74
74
|
export default ConversationBySessionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationPeerAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-inbox/ConversationPeerAvatar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationPeerAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-inbox/ConversationPeerAvatar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,sBAAsB,GAAI,mDAK7B,2BAA2B,4CAgC7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Avatar } from "antd";
|
|
5
|
+
import { PeerType } from "../../types/conversation";
|
|
5
6
|
import { resolvePeerBadgeColor } from "../../utils/conversation";
|
|
7
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
6
8
|
const ConversationPeerAvatar = ({ peerType, displayName, avatarUrl, badgeLabel, }) => {
|
|
7
9
|
const badge = badgeLabel ? (_jsx("span", { className: clsx("absolute -bottom-px -right-px flex h-[17px] items-center justify-center gap-2 rounded-md border border-white px-1 text-[10px] font-semibold leading-3 text-white shadow-badge-inset", resolvePeerBadgeColor(peerType)), children: badgeLabel })) : null;
|
|
8
|
-
return (_jsxs("div", { className: "relative h-12 w-12 shrink-0", "data-cp-name": "ConversationPeerAvatar", children: [_jsx(Avatar, { size: 48, src: avatarUrl || undefined, alt: displayName, className: "uppercase", children: (displayName === null || displayName === void 0 ? void 0 : displayName.charAt(0)) || "A" }), badge] }));
|
|
10
|
+
return (_jsxs("div", { className: "relative h-12 w-12 shrink-0", "data-cp-name": "ConversationPeerAvatar", children: [peerType === PeerType.GROUP ? (_jsx(GroupAvatar, { faceURL: avatarUrl, groupName: displayName, size: 48 })) : (_jsx(Avatar, { size: 48, src: avatarUrl || undefined, alt: displayName, className: "uppercase", children: (displayName === null || displayName === void 0 ? void 0 : displayName.charAt(0)) || "A" })), badge] }));
|
|
9
11
|
};
|
|
10
12
|
export default ConversationPeerAvatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicGroupResultItem.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/PublicGroupResultItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"PublicGroupResultItem.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/PublicGroupResultItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAK1E,UAAU,0BAA0B;IAClC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,QAAA,MAAM,qBAAqB,GAAI,oBAG5B,0BAA0B,4CA4E5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -4,7 +4,8 @@ import clsx from "clsx";
|
|
|
4
4
|
import { Spin } from "antd";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { useJoinPublicGroup } from "../../../hooks/group/useJoinPublicGroup";
|
|
7
|
-
import
|
|
7
|
+
import GroupAvatar from "../../../components/group/GroupAvatar";
|
|
8
|
+
import { CONTACT_SEARCH_AVATAR_SIZE } from "./constants";
|
|
8
9
|
const PublicGroupResultItem = ({ group, onOpen, }) => {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
const { t } = useTranslation("conversation-inbox");
|
|
@@ -17,7 +18,7 @@ const PublicGroupResultItem = ({ group, onOpen, }) => {
|
|
|
17
18
|
}
|
|
18
19
|
joinGroup({ groupID: group.groupID }, { onSuccess: () => onOpen(group.groupID) });
|
|
19
20
|
};
|
|
20
|
-
return (_jsxs("div", { "data-cp-name": "PublicGroupResultItem", "data-testid": `contact-search-public-group-${group.groupID}`, className: "flex items-center gap-2 border-b border-gray-25 bg-white p-3", children: [_jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-2 text-left", onClick: () => onOpen(group.groupID), children: [_jsx(
|
|
21
|
+
return (_jsxs("div", { "data-cp-name": "PublicGroupResultItem", "data-testid": `contact-search-public-group-${group.groupID}`, className: "flex items-center gap-2 border-b border-gray-25 bg-white p-3", children: [_jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-2 text-left", onClick: () => onOpen(group.groupID), children: [_jsx(GroupAvatar, { faceURL: group.faceURL, groupName: group.groupName, size: CONTACT_SEARCH_AVATAR_SIZE, className: "shrink-0" }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-1 pb-0.5", children: [_jsx("span", { className: "truncate text-[16px] font-medium leading-[1.6] text-black", children: group.groupName }), _jsxs("span", { className: "flex min-w-0 flex-col text-[14px] leading-[1.6] tracking-[0.14px] text-gray-600", children: [_jsx("span", { className: "truncate", children: t("contact_search.member_count", {
|
|
21
22
|
count: (_a = group.memberCount) !== null && _a !== void 0 ? _a : 0,
|
|
22
23
|
}) }), _jsx("span", { className: "truncate", children: ((_b = group.introduction) === null || _b === void 0 ? void 0 : _b.trim()) ||
|
|
23
24
|
t("contact_search.public_group_fallback") })] })] })] }), _jsxs("button", { type: "button", disabled: isPending, "data-testid": `contact-search-public-group-action-${group.groupID}`, className: clsx("flex h-7 shrink-0 items-center justify-center gap-2 rounded-lg px-3", "whitespace-nowrap text-center text-[12px] font-medium leading-[1.6] tracking-[0.12px]", group.isJoined
|
|
@@ -2,7 +2,6 @@ import { ContactSearchType } from "../../../types/dto";
|
|
|
2
2
|
export declare const CONTACT_SEARCH_DEBOUNCE_MS = 300;
|
|
3
3
|
export declare const CONTACT_SEARCH_ICON_SIZE = 18;
|
|
4
4
|
export declare const CONTACT_SEARCH_AVATAR_SIZE = 48;
|
|
5
|
-
export declare const PUBLIC_GROUP_STACKED_AVATAR_SIZE = 33;
|
|
6
5
|
export declare const CONTACT_SEARCH_PREVIEW_LIMIT = 5;
|
|
7
6
|
export declare enum ContactSearchTab {
|
|
8
7
|
All = "ALL",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,0BAA0B,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAI7C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,oBAAY,gBAAgB;IAC1B,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE;IAChC,GAAG,EAAE,gBAAgB,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,EAKA,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE;IACnC,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB,EAKA,CAAC"}
|
|
@@ -2,8 +2,6 @@ import { ContactSearchType } from "../../../types/dto";
|
|
|
2
2
|
export const CONTACT_SEARCH_DEBOUNCE_MS = 300;
|
|
3
3
|
export const CONTACT_SEARCH_ICON_SIZE = 18;
|
|
4
4
|
export const CONTACT_SEARCH_AVATAR_SIZE = 48;
|
|
5
|
-
// The two overlapping circles of the public-group composite avatar.
|
|
6
|
-
export const PUBLIC_GROUP_STACKED_AVATAR_SIZE = 33;
|
|
7
5
|
// `Tất cả` shows a capped preview of the contact section before handing the
|
|
8
6
|
// seller over to the full `Liên hệ` tab.
|
|
9
7
|
export const CONTACT_SEARCH_PREVIEW_LIMIT = 5;
|
|
@@ -6,7 +6,6 @@ export { default as ContactSearchTabs } from "./ContactSearchTabs";
|
|
|
6
6
|
export { default as ContactSearchSectionHeader } from "./ContactSearchSectionHeader";
|
|
7
7
|
export { default as ContactSearchViewMoreBar } from "./ContactSearchViewMoreBar";
|
|
8
8
|
export { default as PublicGroupResultItem } from "./PublicGroupResultItem";
|
|
9
|
-
export { default as PublicGroupAvatar } from "./PublicGroupAvatar";
|
|
10
9
|
export * from "./constants";
|
|
11
10
|
export * from "./utils";
|
|
12
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -6,6 +6,5 @@ export { default as ContactSearchTabs } from "./ContactSearchTabs";
|
|
|
6
6
|
export { default as ContactSearchSectionHeader } from "./ContactSearchSectionHeader";
|
|
7
7
|
export { default as ContactSearchViewMoreBar } from "./ContactSearchViewMoreBar";
|
|
8
8
|
export { default as PublicGroupResultItem } from "./PublicGroupResultItem";
|
|
9
|
-
export { default as PublicGroupAvatar } from "./PublicGroupAvatar";
|
|
10
9
|
export * from "./constants";
|
|
11
10
|
export * from "./utils";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface GroupAvatarProps {
|
|
2
|
+
faceURL?: string | null;
|
|
3
|
+
groupName?: string;
|
|
4
|
+
size?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const GroupAvatar: ({ faceURL, groupName, size, className }: GroupAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default GroupAvatar;
|
|
9
|
+
//# sourceMappingURL=GroupAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/group/GroupAvatar.tsx"],"names":[],"mappings":"AAMA,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,QAAA,MAAM,WAAW,GAAI,yCAA8C,gBAAgB,4CAclF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { images } from "../../constants/images";
|
|
6
|
+
// DROPPII-30928: a group without a photo (or whose photo fails to load) shows
|
|
7
|
+
// the default group image, replacing the owner + member composite of DROPPII-29976.
|
|
8
|
+
const GroupAvatar = ({ faceURL, groupName, size = 56, className }) => {
|
|
9
|
+
const [failedSrc, setFailedSrc] = useState(null);
|
|
10
|
+
const photo = faceURL && faceURL !== failedSrc ? faceURL : null;
|
|
11
|
+
return (_jsx("img", { src: photo !== null && photo !== void 0 ? photo : images.defaultAvatarGroup, alt: groupName !== null && groupName !== void 0 ? groupName : "", "data-testid": photo ? "group-avatar" : "default-group-avatar", style: { width: size, height: size }, className: clsx("shrink-0 rounded-full object-cover", className), onError: photo ? () => setFailedSrc(photo) : undefined }));
|
|
12
|
+
};
|
|
13
|
+
export default GroupAvatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JoinGroupConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/group/JoinGroupConfirmModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JoinGroupConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/group/JoinGroupConfirmModal.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,qBAAqB,GAAI,6EAQ5B,0BAA0B,4CAqE5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Modal,
|
|
3
|
+
import { Modal, Button } from "antd";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { Icon } from "../../components/icon";
|
|
6
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
6
7
|
const MODAL_WIDTH = 390;
|
|
7
8
|
const AVATAR_SIZE = 96;
|
|
8
9
|
const JoinGroupConfirmModal = ({ open, groupName, groupAvatar, memberCount, loading, onConfirm, onClose, }) => {
|
|
@@ -10,6 +11,6 @@ const JoinGroupConfirmModal = ({ open, groupName, groupAvatar, memberCount, load
|
|
|
10
11
|
return (_jsx(Modal, { "data-cp-name": "JoinGroupConfirmModal", open: open, onCancel: onClose, footer: null, closable: false, centered: true, width: MODAL_WIDTH, maskClosable: !loading, keyboard: !loading, styles: {
|
|
11
12
|
content: { padding: 0, overflow: "hidden", borderRadius: 16 },
|
|
12
13
|
body: { padding: 0 },
|
|
13
|
-
}, children: _jsxs("div", { role: "dialog", "aria-label": t("join_group_confirm_title"), className: "flex flex-col bg-white", children: [_jsxs("div", { className: "flex items-center justify-between gap-4 border-b border-gray-25 p-4", children: [_jsx("p", { className: "flex-1 text-[18px] font-bold leading-[1.6] text-gray-900", children: t("join_group_confirm_title") }), _jsx("button", { type: "button", "aria-label": t("close"), className: "shrink-0", onClick: onClose, disabled: loading, children: _jsx(Icon, { icon: "close-o", size: 24 }) })] }), _jsxs("div", { className: "flex flex-col items-center p-4", children: [_jsx(
|
|
14
|
+
}, children: _jsxs("div", { role: "dialog", "aria-label": t("join_group_confirm_title"), className: "flex flex-col bg-white", children: [_jsxs("div", { className: "flex items-center justify-between gap-4 border-b border-gray-25 p-4", children: [_jsx("p", { className: "flex-1 text-[18px] font-bold leading-[1.6] text-gray-900", children: t("join_group_confirm_title") }), _jsx("button", { type: "button", "aria-label": t("close"), className: "shrink-0", onClick: onClose, disabled: loading, children: _jsx(Icon, { icon: "close-o", size: 24 }) })] }), _jsxs("div", { className: "flex flex-col items-center p-4", children: [_jsx(GroupAvatar, { faceURL: groupAvatar || undefined, groupName: groupName, size: AVATAR_SIZE }), _jsxs("div", { className: "flex flex-col items-center gap-1 pt-3 text-center", children: [_jsx("p", { className: "max-w-[280px] truncate text-[18px] font-bold leading-[1.6] text-black", children: groupName }), _jsx("p", { className: "text-[16px] leading-[1.6] tracking-[0.16px] text-gray-600", children: t("member_count", { count: memberCount }) })] })] }), _jsx("div", { className: "px-4 pb-4", children: _jsx(Button, { "data-testid": "join-group-confirm", type: "primary", className: "h-12 w-full !rounded-lg !border-[var(--dc-color-primary)] !bg-[var(--dc-color-primary)] !text-[16px] !font-medium !text-white hover:!border-[var(--dc-color-primary-hover)] hover:!bg-[var(--dc-color-primary-hover)]", onClick: onConfirm, loading: loading, children: t("join_group_confirm_cta") }) })] }) }));
|
|
14
15
|
};
|
|
15
16
|
export default JoinGroupConfirmModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AASzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgB/C,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,KAAK,sBAAsB,GAAG,aAAa,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,GAAI,kEAMpB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MessageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AASzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgB/C,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,KAAK,sBAAsB,GAAG,aAAa,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,GAAI,kEAMpB,kBAAkB,4CAibpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { useSidePanel } from "../../hooks/common/useSidePanel";
|
|
|
20
20
|
import SearchDrawer from "../../components/search-conversation/SearchDrawer";
|
|
21
21
|
import { isGroupSession, isGroupConversation } from "../../utils/imCommon";
|
|
22
22
|
import { useGroupPermission } from "../../hooks/group/useGroupPermission";
|
|
23
|
-
import
|
|
23
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
24
24
|
import GroupMembersDrawer from "./GroupMembersDrawer";
|
|
25
25
|
import { useGroupMembers } from "../../hooks/group/useGroupMembers";
|
|
26
26
|
import { useBotSessionOwnerIdentity } from "../../hooks/session/useBotSessionOwnerIdentity";
|
|
@@ -203,7 +203,7 @@ const MessageHeader = ({ onClose, currentSession, isJoined, onOpenThreadInfo, on
|
|
|
203
203
|
setCurrentSessionStatus(currentSession.status);
|
|
204
204
|
}
|
|
205
205
|
}, [currentSession]);
|
|
206
|
-
const avatarNode = (_jsx(_Fragment, { children: showOwnerPlaceholder ? (_jsx("span", { "aria-hidden": true, className: "h-10 w-10 shrink-0 animate-pulse rounded-full bg-gray-25" })) : ownerIdentity ? (isCrm ? (_jsx(TintedAvatar, { name: headerShortName, src: ownerIdentity.avatarUrl, size: 40 })) : (_jsx(Avatar, { src: ownerIdentity.avatarUrl, size: "large", alt: "", className: "min-w-10 min-h-10", children: ((_c = headerName === null || headerName === void 0 ? void 0 : headerName.charAt) === null || _c === void 0 ? void 0 : _c.call(headerName, 0)) || "A" }))) :
|
|
206
|
+
const avatarNode = (_jsx(_Fragment, { children: showOwnerPlaceholder ? (_jsx("span", { "aria-hidden": true, className: "h-10 w-10 shrink-0 animate-pulse rounded-full bg-gray-25" })) : ownerIdentity ? (isCrm ? (_jsx(TintedAvatar, { name: headerShortName, src: ownerIdentity.avatarUrl, size: 40 })) : (_jsx(Avatar, { src: ownerIdentity.avatarUrl, size: "large", alt: "", className: "min-w-10 min-h-10", children: ((_c = headerName === null || headerName === void 0 ? void 0 : headerName.charAt) === null || _c === void 0 ? void 0 : _c.call(headerName, 0)) || "A" }))) : isRealGroup ? (_jsx(GroupAvatar, { faceURL: avatar, groupName: displayName, size: 40, className: "min-w-10 min-h-10" })) : isCrm ? (_jsx(TintedAvatar, { name: headerShortName, src: avatar, size: 40 })) : (_jsx(Avatar, { src: avatar, size: "large", alt: "", className: "min-w-10 min-h-10", children: ((_d = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _d === void 0 ? void 0 : _d.call(displayName, 0)) || "A" })) }));
|
|
207
207
|
return (_jsxs("div", { className: `px-4 py-3 flex items-center border-b gap-3 bg-white ${isCrm
|
|
208
208
|
? "flex-nowrap border-gray-25 [container-type:inline-size] max-lg:flex-wrap phone:gap-2 phone:px-3"
|
|
209
209
|
: "flex-wrap"}`, "data-cp-name": "MessageHeader", children: [onBack && (_jsx(Button, { type: "text", shape: "default", "data-desk-back": true, className: "h-10 w-10 shrink-0 p-0 text-gray-900", onClick: onBack, "aria-label": t("back"), children: _jsx(StrokeIcon, { name: "chevron-left", size: 20 }) })), isCrm ? (_jsx("span", { className: "contents phone:hidden", children: avatarNode })) : (avatarNode), _jsxs("div", { className: `flex flex-col overflow-hidden flex-1 ${isCrm ? "min-w-[96px] max-[359px]:min-w-[72px]" : ""}`, children: [showOwnerPlaceholder ? (_jsxs("span", { "aria-hidden": true, className: "flex flex-col gap-1.5 py-0.5", children: [_jsx("span", { className: "h-4 w-36 animate-pulse rounded bg-gray-25" }), _jsx("span", { className: "h-3 w-24 animate-pulse rounded bg-gray-25" })] })) : (_jsx("p", { className: `text-base truncate ${isCrm ? "m-0 font-semibold leading-[normal] text-gray-900" : ""}`, title: headerName || undefined, children: (isCrm ? headerShortName : headerName) || "" })), showMemberCountLine && (_jsx("p", { className: "text-xs text-gray-500 truncate", children: t("member_count", { count: memberCount }) })), isCrm && !showOwnerPlaceholder && metaParts.length > 0 && (_jsx("p", { className: "m-0 flex min-w-0 items-center gap-1 overflow-hidden whitespace-nowrap text-xs text-gray-600 [container-type:inline-size]", "data-testid": "header-meta-line", children: metaParts.map((part, index) => (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { "aria-hidden": true, className: "h-[3px] w-[3px] shrink-0 rounded-full bg-gray-200" })), part] }, index))) }))] }), _jsxs("div", { className: `flex items-center justify-end ${isCrm
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchItemAsGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsGroup.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAUxF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,4BAA4B,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SearchItemAsGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsGroup.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAUxF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,4BAA4B,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CA8FvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { GroupVisibility } from "@droppii-org/wasm-client-sdk";
|
|
|
9
9
|
import useConversationStore from "../../../store/conversation";
|
|
10
10
|
import { useDeskThreadNavigation } from "../../../hooks/conversation/useDeskThreadNavigation";
|
|
11
11
|
import { highlightSearch, sanitizeHtml } from "../../../utils/common";
|
|
12
|
-
import
|
|
12
|
+
import GroupAvatar from "../../../components/group/GroupAvatar";
|
|
13
13
|
import RowChip from "../../../components/conversation/RowChip";
|
|
14
14
|
import { StrokeIcon } from "../../../components/icon/StrokeIcon";
|
|
15
15
|
import { useOpenPdpSearchResult } from "../../../hooks/search/useOpenPdpSearchResult";
|
|
@@ -41,7 +41,7 @@ const SearchItemAsGroup = (props) => {
|
|
|
41
41
|
newSearchParams.delete("botId");
|
|
42
42
|
openThread({ threadId: conversation.conversationID }, `${window.location.pathname}?${newSearchParams.toString()}`);
|
|
43
43
|
};
|
|
44
|
-
return (_jsxs("div", Object.assign({ className: searchRowClass(isCrm) }, clickableProps(onPressItem), { "data-cp-name": "SearchItemAsGroup", children: [_jsx(
|
|
44
|
+
return (_jsxs("div", Object.assign({ className: searchRowClass(isCrm) }, clickableProps(onPressItem), { "data-cp-name": "SearchItemAsGroup", children: [_jsx(GroupAvatar, { faceURL: conversation.faceURL, groupName: conversation.showName, size: isCrm ? 40 : 48 }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0 gap-0.5", children: [_jsx("p", { className: isCrm
|
|
45
45
|
? "m-0 truncate text-sm font-medium text-gray-900"
|
|
46
46
|
: "text-sm font-semibold truncate", dangerouslySetInnerHTML: {
|
|
47
47
|
__html: sanitizeHtml(highlightSearch(conversation.showName || "", searchTerm)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchItemAsMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAA4B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchItemAsMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAA4B,MAAM,8BAA8B,CAAC;AA6BrF,UAAU,wBAAwB;IAChC,OAAO,EAAE,WAAW,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CAqK3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -12,6 +12,8 @@ import { useTranslation } from "react-i18next";
|
|
|
12
12
|
import useConversationStore from "../../../store/conversation";
|
|
13
13
|
import { useMemo } from "react";
|
|
14
14
|
import TintedAvatar from "../../../components/common/TintedAvatar";
|
|
15
|
+
import GroupAvatar from "../../../components/group/GroupAvatar";
|
|
16
|
+
import { isGroupConversation } from "../../../utils/imCommon";
|
|
15
17
|
import RowChip from "../../../components/conversation/RowChip";
|
|
16
18
|
import useAuthStore from "../../../store/auth";
|
|
17
19
|
import { getConversationIdFromMessage } from "../../../utils/conversation";
|
|
@@ -94,7 +96,7 @@ const SearchItemAsMessage = (props) => {
|
|
|
94
96
|
msgContent = message === null || message === void 0 ? void 0 : message.content;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
|
-
return (_jsxs("div", Object.assign({ className: searchRowClass(isCrm) }, clickableProps(onPressItem), { "data-cp-name": "SearchItemAsMessage", children: [_jsx("div", { children: isCrm ? (_jsx(TintedAvatar, { name: (_b = (useConversationDisplay
|
|
99
|
+
return (_jsxs("div", Object.assign({ className: searchRowClass(isCrm) }, clickableProps(onPressItem), { "data-cp-name": "SearchItemAsMessage", children: [_jsx("div", { children: !useConversationDisplay && isGroupConversation(conversationData !== null && conversationData !== void 0 ? conversationData : undefined) ? (_jsx(GroupAvatar, { faceURL: conversationData === null || conversationData === void 0 ? void 0 : conversationData.faceURL, groupName: conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName, size: 40 })) : isCrm ? (_jsx(TintedAvatar, { name: (_b = (useConversationDisplay
|
|
98
100
|
? message.senderNickname
|
|
99
101
|
: conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName)) !== null && _b !== void 0 ? _b : "", src: useConversationDisplay
|
|
100
102
|
? message.senderFaceUrl
|
|
@@ -2,10 +2,8 @@ import type { ChangeEvent } from "react";
|
|
|
2
2
|
export type GroupInfoRow = "member-permission" | "admin-permission" | "invite-link";
|
|
3
3
|
export type GroupInfoConfirm = "leave" | "disband" | "delete";
|
|
4
4
|
export interface GroupInfoBodyCrmProps {
|
|
5
|
-
groupID: string;
|
|
6
5
|
groupName?: string;
|
|
7
6
|
faceURL?: string;
|
|
8
|
-
ownerUserID?: string;
|
|
9
7
|
introduction?: string;
|
|
10
8
|
memberCount?: number;
|
|
11
9
|
isPublic: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupInfoBodyCrm.d.ts","sourceRoot":"","sources":["../../../src/components/thread/GroupInfoBodyCrm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAUzC,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,aAAa,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,
|
|
1
|
+
{"version":3,"file":"GroupInfoBodyCrm.d.ts","sourceRoot":"","sources":["../../../src/components/thread/GroupInfoBodyCrm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAUzC,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,aAAa,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAClD,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,KAAK,IAAI,CAAC;IACrD,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,KAAK,IAAI,CAAC;IACtD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,KAAK,IAAI,CAAC;IACpD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,mBAAmB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC/C;AA6BD,kGAAkG;AAClG,QAAA,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,4CA4JrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { useEffect, useRef } from "react";
|
|
|
4
4
|
import { Input } from "antd";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { CrmIcon as Icon } from "../../components/group/crmIcon";
|
|
7
|
-
import
|
|
7
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
8
8
|
import { ACCEPTED_IMAGE_TYPES } from "../../utils/fileValidation";
|
|
9
9
|
import { FOCUS_RING_CLASS } from "../../utils/a11yClickable";
|
|
10
10
|
import { DangerRow, InfoCard, NavRow, SectionLabel, SwitchRow } from "./GroupInfoRows";
|
|
@@ -29,7 +29,7 @@ const GroupInfoBodyCrm = (props) => {
|
|
|
29
29
|
const nameChanged = props.nameValue.trim() !== "" && props.nameValue.trim() !== ((_a = props.groupName) !== null && _a !== void 0 ? _a : "");
|
|
30
30
|
const descChanged = props.descriptionValue.trim() !== ((_b = props.introduction) !== null && _b !== void 0 ? _b : "");
|
|
31
31
|
const hasAdminRows = props.canConfigPermissions || props.showInviteLink;
|
|
32
|
-
return (_jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "relative block h-[60px] w-[60px] shrink-0", children: [_jsx(
|
|
32
|
+
return (_jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "relative block h-[60px] w-[60px] shrink-0", children: [_jsx(GroupAvatar, { faceURL: props.faceURL, groupName: props.groupName, size: 56 }), props.isAvatarUploading && (_jsx("span", { className: "absolute left-0 top-0 flex h-14 w-14 items-center justify-center rounded-full bg-gray-900/30", children: _jsx("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }) })), props.canEditAvatar && (_jsxs(_Fragment, { children: [_jsx("input", { ref: props.avatarInputRef, type: "file", accept: ACCEPTED_IMAGE_TYPES.join(", "), className: "hidden", onChange: props.onAvatarSelect }), _jsx("button", { type: "button", disabled: props.isAvatarUploading, onClick: props.onAvatarClick, "aria-label": t("group_info_edit_avatar"), title: t("group_info_edit_avatar"), className: `absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full border-2 border-white bg-gray-900 text-white ${FOCUS_RING_CLASS}`, children: _jsx(Icon, { icon: "camera-o", size: 12 }) })] }))] }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [editingField === "name" ? (_jsx(Input, { autoFocus: true, value: props.nameValue, onChange: (event) => props.onNameChange(event.target.value), maxLength: 255, disabled: props.isSaving, "aria-label": t("group_info_edit_name"), onPressEnter: () => nameChanged && props.onSaveEdit("name") })) : (_jsxs("span", { className: "flex items-center gap-0.5", children: [_jsx("span", { className: "truncate text-base font-semibold text-gray-900", title: props.groupName, children: props.groupName }), props.canEditName && (_jsx("button", { type: "button", className: `h-7 w-7 ${ICON_BUTTON}`, onClick: () => props.onStartEdit("name"), "aria-label": t("group_info_edit_name"), title: t("group_info_edit_name"), children: _jsx(Icon, { icon: "edit-o", size: 16 }) }))] })), _jsxs("span", { className: "flex flex-wrap gap-1.5", children: [_jsx(Chip, { icon: props.isPublic ? "globe-o" : "lock-o", tone: "primary", children: t(props.isPublic ? "group_visibility_public" : "group_visibility_private") }), typeof props.memberCount === "number" && (_jsx(Chip, { icon: "user-two-o", tone: "neutral", children: t("member_count", { count: props.memberCount }) }))] })] })] }), editingField === "name" && (_jsx(EditActions, { disabled: props.isSaving, canSave: !props.isSaving && nameChanged, onCancel: () => props.onCancelEdit("name"), onSave: () => props.onSaveEdit("name") })), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-xs font-medium text-gray-600", children: t("description") }), editingField === "description" ? (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Input.TextArea, { ref: descriptionRef, value: props.descriptionValue, onChange: (event) => props.onDescriptionChange(event.target.value), placeholder: t("enter_group_description"), "aria-label": t("description"), autoSize: { minRows: 2, maxRows: 5 }, maxLength: 500, showCount: true, disabled: props.isSaving }), _jsx(EditActions, { disabled: props.isSaving, canSave: !props.isSaving && descChanged, onCancel: () => props.onCancelEdit("description"), onSave: () => props.onSaveEdit("description") })] })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "m-0 whitespace-pre-wrap break-words text-sm text-gray-600", children: hasDescription ? props.introduction : t("group_info_no_description") }), props.canEditDescription && (_jsxs("button", { type: "button", onClick: () => props.onStartEdit("description"), className: `flex h-6 items-center gap-1.5 self-start rounded-lg text-[13px] font-medium text-primary-500 hover:text-primary-600 ${FOCUS_RING_CLASS}`, children: [_jsx(Icon, { icon: hasDescription ? "edit-o" : "plus-o", size: 14 }), t(hasDescription ? "group_info_edit_description" : "group_info_add_description")] }))] }))] }), _jsx(SectionLabel, { children: t("group_settings_section") }), _jsx(InfoCard, { children: [
|
|
33
33
|
_jsx(SwitchRow, { icon: "bell-o", label: t("notification"), checked: props.notifyEnabled, loading: props.isTogglingNotification, onChange: props.onToggleNotification }, "notify"),
|
|
34
34
|
props.showAllowSend && (_jsx(SwitchRow, { icon: "chat-square-o", label: t("members_can_send_message"), hint: t("allow_send_message_hint"), checked: props.allowSendMessage, loading: props.isTogglingSendMessage, onChange: props.onToggleSendMessage }, "send")),
|
|
35
35
|
] }), hasAdminRows && (_jsxs(_Fragment, { children: [_jsx(SectionLabel, { children: t("group_admin_section") }), _jsx(InfoCard, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupThreadInfo.d.ts","sourceRoot":"","sources":["../../../src/components/thread/GroupThreadInfo.tsx"],"names":[],"mappings":"AA0BA,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AASD,QAAA,MAAM,eAAe,GAAI,qBAAqB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"GroupThreadInfo.d.ts","sourceRoot":"","sources":["../../../src/components/thread/GroupThreadInfo.tsx"],"names":[],"mappings":"AA0BA,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AASD,QAAA,MAAM,eAAe,GAAI,qBAAqB,oBAAoB,mDAirBjE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -20,7 +20,7 @@ import AdminPermissionModal from "../../components/group/AdminPermissionModal";
|
|
|
20
20
|
import MemberPermissionPanel from "../../components/group/MemberPermissionPanel";
|
|
21
21
|
import DisableSendPermissionConfirm from "../../components/group/DisableSendPermissionConfirm";
|
|
22
22
|
import InviteLinkPanel from "../../components/group/InviteLinkPanel";
|
|
23
|
-
import
|
|
23
|
+
import GroupAvatar from "../../components/group/GroupAvatar";
|
|
24
24
|
import GroupPanelHeader from "../../components/group/GroupPanelHeader";
|
|
25
25
|
import GroupInfoBodyCrm from "./GroupInfoBodyCrm";
|
|
26
26
|
const GroupThreadInfo = ({ onClose, config }) => {
|
|
@@ -256,7 +256,7 @@ const GroupThreadInfo = ({ onClose, config }) => {
|
|
|
256
256
|
if (!groupID) {
|
|
257
257
|
return null;
|
|
258
258
|
}
|
|
259
|
-
return (_jsxs("div", { className: "h-full w-full bg-white flex flex-col relative overflow-hidden", "data-cp-name": "GroupThreadInfo", children: [isCrm ? (_jsxs(_Fragment, { children: [_jsx(GroupPanelHeader, { title: t("group_info_title"), onClose: onClose }), _jsx(GroupInfoBodyCrm, {
|
|
259
|
+
return (_jsxs("div", { className: "h-full w-full bg-white flex flex-col relative overflow-hidden", "data-cp-name": "GroupThreadInfo", children: [isCrm ? (_jsxs(_Fragment, { children: [_jsx(GroupPanelHeader, { title: t("group_info_title"), onClose: onClose }), _jsx(GroupInfoBodyCrm, { groupName: groupDisplayName, faceURL: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.faceURL, introduction: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction, memberCount: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.memberCount, isPublic: (currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.visibility) === GroupVisibility.Public, canEditAvatar: permissions.updateGroupAvatar, canEditName: permissions.updateGroupName, canEditDescription: permissions.updateGroupDescription, canConfigPermissions: permissions.configGroupPermission, showInviteLink: isInviteLinkFeatureEnabled && !isViewOnlyMember, showAllowSend: Boolean(config === null || config === void 0 ? void 0 : config.showAllowSendMessage) && isOwner, isOwner: isOwner, isAdminOrOwner: isAdminOrOwner, isViewOnlyMember: isViewOnlyMember, notifyEnabled: notifyEnabled, isTogglingNotification: isTogglingNotification, allowSendMessage: allowSendMessage, isTogglingSendMessage: isTogglingSendMessage, isAvatarUploading: isAvatarUploading, isSaving: isSavingGroupInfo, editingField: editingField, nameValue: nameValue, descriptionValue: descriptionValue, avatarInputRef: avatarInputRef, onNameChange: setNameValue, onDescriptionChange: setDescriptionValue, onStartEdit: (field) => (field === "name" ? startEditName() : startEditDescription()), onCancelEdit: (field) => (field === "name" ? cancelEditName() : cancelEditDescription()), onSaveEdit: (field) => (field === "name" ? saveName() : saveDescription()), onAvatarClick: handleAvatarClick, onAvatarSelect: handleAvatarSelect, onToggleNotification: handleToggleNotification, onToggleSendMessage: handleToggleSendMessage, onOpenRow: setActiveRow, onConfirm: setConfirmAction })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-4 border-b border-gray-100", children: [_jsx("span", { className: "text-lg font-medium", children: t("thread_info_title") }), _jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:bg-gray-100", onClick: onClose, children: _jsx(Icon, { icon: "close-o", size: 20 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsxs("div", { className: "flex items-center gap-3 px-4 py-4", children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx(GroupAvatar, { faceURL: currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.faceURL, groupName: groupDisplayName, size: 56 }), isAvatarUploading && (_jsx("span", { className: "absolute inset-0 flex items-center justify-center rounded-full bg-black/30", children: _jsx("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }) })), permissions.updateGroupAvatar && (_jsxs(_Fragment, { children: [_jsx("input", { ref: avatarInputRef, type: "file", accept: ACCEPTED_IMAGE_TYPES.join(", "), className: "hidden", onChange: handleAvatarSelect }), _jsx("button", { type: "button", disabled: isAvatarUploading, onClick: handleAvatarClick, className: "absolute -bottom-1 -right-1 flex items-center justify-center w-5 h-5 rounded-full bg-black text-white", children: _jsx(Icon, { icon: "camera-o", size: 12 }) })] }))] }), _jsx("div", { className: "flex-1 min-w-0", children: editingField !== "name" && (_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("p", { className: "text-base font-medium truncate", children: groupDisplayName }), permissions.updateGroupName && (_jsx(Icon, { icon: "edit-o", size: 16, className: "shrink-0 cursor-pointer text-gray-500", onClick: startEditName }))] })) })] }), editingField === "name" && (_jsx("div", { className: "px-4 pb-4", children: _jsxs("div", { className: "flex flex-col gap-3 bg-[#f5f5f5] rounded-lg p-3", children: [_jsx(Input, { autoFocus: true, value: nameValue, onChange: (event) => setNameValue(event.target.value), maxLength: 255, showCount: true, disabled: isSavingGroupInfo, className: "bg-white" }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg border border-[var(--dc-color-primary-hover)] text-[var(--dc-color-primary-hover)] text-sm font-medium disabled:border-gray-200 disabled:text-gray-300", disabled: isSavingGroupInfo, onClick: cancelEditName, children: t("cancel") }), _jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg bg-[var(--dc-color-primary-hover)] text-white text-sm font-medium disabled:bg-gray-100 disabled:text-gray-300", disabled: isSavingGroupInfo ||
|
|
260
260
|
!nameValue.trim() ||
|
|
261
261
|
nameValue.trim() === ((_c = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.groupName) !== null && _c !== void 0 ? _c : ""), onClick: saveName, children: t("save") })] })] }) })), _jsx("div", { className: "px-4 pb-4", children: editingField === "description" ? (_jsxs("div", { className: "flex flex-col gap-3 bg-[#f5f5f5] rounded-lg p-3", children: [_jsxs("span", { className: "flex items-center gap-2 text-sm font-medium text-gray-900", children: [_jsx(Icon, { icon: "info-circle-o", size: 18, className: "text-gray-500" }), t("description")] }), _jsx(Input.TextArea, { ref: descriptionInputRef, value: descriptionValue, onChange: (event) => setDescriptionValue(event.target.value), placeholder: t("enter_group_description"), autoSize: { minRows: 1, maxRows: 4 }, maxLength: 500, disabled: isSavingGroupInfo, className: "bg-white" }), _jsxs("span", { className: "self-end text-xs text-gray-400", children: [descriptionValue.length, " / 500"] }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg border border-[var(--dc-color-primary-hover)] text-[var(--dc-color-primary-hover)] text-sm font-medium disabled:border-gray-200 disabled:text-gray-300", disabled: isSavingGroupInfo, onClick: cancelEditDescription, children: t("cancel") }), _jsx("button", { type: "button", className: "px-4 py-1.5 rounded-lg bg-[var(--dc-color-primary-hover)] text-white text-sm font-medium disabled:bg-gray-100 disabled:text-gray-300", disabled: isSavingGroupInfo ||
|
|
262
262
|
descriptionValue.trim() === ((_d = currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) !== null && _d !== void 0 ? _d : ""), onClick: saveDescription, children: t("save") })] })] })) : (_jsxs("div", { className: "flex items-start justify-between gap-2 bg-[#f5f5f5] rounded-lg px-3 py-2.5", children: [_jsxs("div", { className: "flex items-start gap-2 flex-1 min-w-0", children: [_jsx(Icon, { icon: "info-circle-o", size: 18, className: "shrink-0 mt-0.5 text-gray-900" }), _jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: t("description") }), _jsx("p", { className: "text-sm text-gray-400 truncate", children: (currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.introduction) || t("no_description") })] })] }), permissions.updateGroupDescription && (_jsx(Icon, { icon: "edit-o", size: 16, className: "shrink-0 cursor-pointer text-gray-500", onClick: startEditDescription }))] })) }), _jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 rounded-lg overflow-hidden", children: [_jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-o", size: 18 }), t("notification")] }), _jsx(Switch, { checked: notifyEnabled, onChange: handleToggleNotification, loading: isTogglingNotification })] }), (config === null || config === void 0 ? void 0 : config.showAllowSendMessage) && isOwner && (_jsxs("div", { className: "flex items-center justify-between px-3 py-3", children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "user-check-o", size: 18 }), t("allow_send_message")] }), _jsx(Switch, { checked: allowSendMessage, onChange: handleToggleSendMessage, loading: isTogglingSendMessage })] })), isAdminOrOwner && (config === null || config === void 0 ? void 0 : config.showMutedChatList) && (_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("muted-chat-list"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "bell-off-o", size: 18 }), t("muted_chat_list")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] })), isAdminOrOwner && (_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("block-list"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t("block_list")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }))] }), permissions.configGroupPermission && (_jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 rounded-lg overflow-hidden", children: [_jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("member-permission"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "shield-o", size: 18 }), t("member_permission_settings")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }), _jsxs("button", { type: "button", className: "flex items-center justify-between px-3 py-3 text-left", onClick: () => setActiveRow("admin-permission"), children: [_jsxs("span", { className: "flex items-center gap-3 text-sm", children: [_jsx(Icon, { icon: "shield-done-o", size: 18 }), t("admin_permission_settings")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] })] })), isInviteLinkFeatureEnabled && !isViewOnlyMember && (_jsx("div", { className: "mx-4 mt-3 rounded-lg overflow-hidden bg-[#f5f5f5]", children: _jsxs("button", { type: "button", className: "w-full flex items-center justify-between px-3 py-3 text-left text-sm", onClick: () => setActiveRow("invite-link"), children: [_jsxs("span", { className: "flex items-center gap-3", children: [_jsx(Icon, { icon: "link-alt-o", size: 18 }), t("invite_via_link")] }), _jsx(Icon, { icon: "angle-right-o", size: 16, className: "text-gray-400" })] }) })), _jsxs("div", { className: "flex flex-col gap-1 bg-[#f5f5f5] mx-4 mt-3 mb-4 rounded-lg overflow-hidden", children: [isAdminOrOwner && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("delete"), children: [_jsx(Icon, { icon: "trash-o", size: 18 }), t("delete_conversation")] })), !isViewOnlyMember && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("leave"), children: [_jsx(Icon, { icon: "logout-o", size: 18 }), t("leave_group")] })), isOwner && (_jsxs("button", { type: "button", className: "flex items-center gap-3 px-3 py-3 text-left text-sm text-red-500", onClick: () => setConfirmAction("disband"), children: [_jsx(Icon, { icon: "user-del-o", size: 18 }), t("disband_group")] }))] })] })] })), _jsx(ConfirmModal, { open: confirmAction === "leave", onOk: handleConfirmLeave, onCancel: () => setConfirmAction(null), title: t("leave_group_confirm_title"), okText: t("leave_group"), cancelText: t(isCrm ? "action_cancel" : "cancel"), okType: "danger", confirmLoading: isLeaving, children: _jsx("p", { children: t("leave_group_confirm_message") }) }), _jsx(ConfirmModal, { open: confirmAction === "disband", onOk: handleConfirmDisband, onCancel: () => setConfirmAction(null), title: t("disband_group_confirm_title"), okText: t("disband_group"), cancelText: t(isCrm ? "action_cancel" : "cancel"), okType: "danger", confirmLoading: isDismissing, children: _jsx("p", { children: t("disband_group_confirm_message") }) }), _jsx(ConfirmModal, { open: confirmAction === "delete", onOk: handleConfirmDelete, onCancel: () => setConfirmAction(null), title: t("delete_conversation_confirm_title"), okText: t("delete_conversation"), cancelText: t(isCrm ? "action_cancel" : "cancel"), okType: "danger", confirmLoading: isDeleting, children: _jsx("p", { children: t("delete_conversation_confirm_message") }) }), _jsx(DisableSendPermissionConfirm, { open: confirmAction === "mute-all", title: t("disable_send_permission_title_all_members"), onConfirm: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/constants/images.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/constants/images.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,MAAM;;;;;;;;CAQlB,CAAC"}
|
package/dist/constants/images.js
CHANGED
|
@@ -5,6 +5,8 @@ const emptyResources = new URL("../assets/images/emptyResources.png", import.met
|
|
|
5
5
|
const muteNotificationWarning = new URL("../assets/images/muteNotificationWarning.png", import.meta.url).href;
|
|
6
6
|
const searchEmpty = new URL("../assets/images/searchEmpty.png", import.meta.url).href;
|
|
7
7
|
const stickerInvalid = new URL("../assets/images/stickerInvalid.png", import.meta.url).href;
|
|
8
|
+
// Default avatar for a group without a photo (DROPPII-30928).
|
|
9
|
+
const defaultAvatarGroup = new URL("../assets/images/defaultAvatarGroup.png", import.meta.url).href;
|
|
8
10
|
export const images = {
|
|
9
11
|
conversationBg,
|
|
10
12
|
imageFailed,
|
|
@@ -12,4 +14,5 @@ export const images = {
|
|
|
12
14
|
muteNotificationWarning,
|
|
13
15
|
searchEmpty,
|
|
14
16
|
stickerInvalid,
|
|
17
|
+
defaultAvatarGroup,
|
|
15
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateGroup.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useCreateGroup.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAqCD,eAAO,MAAM,cAAc;6DAQ2B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"useCreateGroup.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useCreateGroup.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAqCD,eAAO,MAAM,cAAc;6DAQ2B,iBAAiB;CA2DtE,CAAC"}
|
|
@@ -56,9 +56,8 @@ export const useCreateGroup = () => {
|
|
|
56
56
|
firstMemberName: firstMember === null || firstMember === void 0 ? void 0 : firstMember.displayName,
|
|
57
57
|
remainingCount: restMembers.length,
|
|
58
58
|
});
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
// a static placeholder (see GroupCompositeAvatar).
|
|
59
|
+
// No picked avatar → leave faceURL empty; GroupAvatar shows the default
|
|
60
|
+
// group image (DROPPII-30928).
|
|
62
61
|
const resolvedFaceURL = faceURL || "";
|
|
63
62
|
try {
|
|
64
63
|
const { data: group } = await DChatSDK.createGroup({
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SearchPublicGroupMemberInfo } from "@droppii-org/wasm-client-sdk";
|
|
2
|
-
interface PublicGroupAvatarProps {
|
|
3
|
-
faceURL?: string;
|
|
4
|
-
groupName?: string;
|
|
5
|
-
members?: SearchPublicGroupMemberInfo[];
|
|
6
|
-
}
|
|
7
|
-
declare const PublicGroupAvatar: ({ faceURL, groupName, members, }: PublicGroupAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default PublicGroupAvatar;
|
|
9
|
-
//# sourceMappingURL=PublicGroupAvatar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PublicGroupAvatar.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-inbox/contact-search/PublicGroupAvatar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAMhF,UAAU,sBAAsB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,2BAA2B,EAAE,CAAC;CACzC;AAKD,QAAA,MAAM,iBAAiB,GAAI,kCAIxB,sBAAsB,4CAwCxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Avatar } from "antd";
|
|
4
|
-
import { CONTACT_SEARCH_AVATAR_SIZE, PUBLIC_GROUP_STACKED_AVATAR_SIZE, } from "./constants";
|
|
5
|
-
// Public-group results carry their own member list, so the composite is built
|
|
6
|
-
// from that instead of GroupCompositeAvatar — which fetches members and would
|
|
7
|
-
// fail for a group the seller has not joined yet.
|
|
8
|
-
const PublicGroupAvatar = ({ faceURL, groupName, members = [], }) => {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
if (faceURL) {
|
|
11
|
-
return (_jsx(Avatar, { size: CONTACT_SEARCH_AVATAR_SIZE, src: faceURL, alt: groupName, className: "shrink-0 uppercase", children: (groupName === null || groupName === void 0 ? void 0 : groupName.charAt(0)) || "G" }));
|
|
12
|
-
}
|
|
13
|
-
const [first, second] = members;
|
|
14
|
-
return (_jsxs("div", { className: "relative shrink-0", style: {
|
|
15
|
-
height: CONTACT_SEARCH_AVATAR_SIZE,
|
|
16
|
-
width: CONTACT_SEARCH_AVATAR_SIZE,
|
|
17
|
-
}, children: [_jsx(Avatar, { size: PUBLIC_GROUP_STACKED_AVATAR_SIZE, src: (second === null || second === void 0 ? void 0 : second.faceURL) || undefined, className: "absolute right-0 top-0 border border-white bg-gray-400 uppercase", children: ((_a = second === null || second === void 0 ? void 0 : second.nickname) === null || _a === void 0 ? void 0 : _a.charAt(0)) || (groupName === null || groupName === void 0 ? void 0 : groupName.charAt(0)) || "G" }), _jsx(Avatar, { size: PUBLIC_GROUP_STACKED_AVATAR_SIZE, src: (first === null || first === void 0 ? void 0 : first.faceURL) || undefined, className: "absolute bottom-0 left-0 border border-white bg-gray-400 uppercase", children: ((_b = first === null || first === void 0 ? void 0 : first.nickname) === null || _b === void 0 ? void 0 : _b.charAt(0)) || (groupName === null || groupName === void 0 ? void 0 : groupName.charAt(0)) || "G" })] }));
|
|
18
|
-
};
|
|
19
|
-
export default PublicGroupAvatar;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface GroupCompositeAvatarProps {
|
|
2
|
-
groupID?: string;
|
|
3
|
-
faceURL?: string;
|
|
4
|
-
ownerUserID?: string;
|
|
5
|
-
groupName?: string;
|
|
6
|
-
size?: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const GroupCompositeAvatar: ({ groupID, faceURL, ownerUserID, groupName, size, className, }: GroupCompositeAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default GroupCompositeAvatar;
|
|
11
|
-
//# sourceMappingURL=GroupCompositeAvatar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupCompositeAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/group/GroupCompositeAvatar.tsx"],"names":[],"mappings":"AASA,UAAU,yBAAyB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,QAAA,MAAM,oBAAoB,GAAI,gEAO3B,yBAAyB,4CAiJ3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Avatar } from "antd";
|
|
4
|
-
import { GroupMemberRole } from "@droppii-org/wasm-client-sdk";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
|
-
import { useGroupMembers } from "../../hooks/group/useGroupMembers";
|
|
7
|
-
import useAuthStore from "../../store/auth";
|
|
8
|
-
import TintedAvatar from "../../components/common/TintedAvatar";
|
|
9
|
-
// AC-Default2 (DROPPII-29976): when a group is created without a picked
|
|
10
|
-
// avatar, show two overlapping avatars (owner bottom-left, first-joined
|
|
11
|
-
// non-owner member top-right) instead of a static placeholder image —
|
|
12
|
-
// resolved client-side so it always reflects current member avatars,
|
|
13
|
-
// no image compositing/upload needed.
|
|
14
|
-
const GroupCompositeAvatar = ({ groupID, faceURL, ownerUserID, groupName, size = 56, className, }) => {
|
|
15
|
-
var _a, _b;
|
|
16
|
-
const isCrm = useAuthStore((state) => state.isCrm);
|
|
17
|
-
const shouldLoadMembers = !faceURL && Boolean(groupID);
|
|
18
|
-
const { members } = useGroupMembers(shouldLoadMembers ? groupID : undefined);
|
|
19
|
-
const { ownerFaceURL, ownerLetter, ownerName, hasFirstMember, firstMemberFaceURL, firstMemberLetter, firstMemberName, } = useMemo(() => {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21
|
-
if (!members.length) {
|
|
22
|
-
return {
|
|
23
|
-
ownerFaceURL: undefined,
|
|
24
|
-
ownerLetter: undefined,
|
|
25
|
-
ownerName: "",
|
|
26
|
-
hasFirstMember: false,
|
|
27
|
-
firstMemberFaceURL: undefined,
|
|
28
|
-
firstMemberLetter: undefined,
|
|
29
|
-
firstMemberName: "",
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
// Prefer the explicit ownerUserID when the caller has it (e.g. GroupItem);
|
|
33
|
-
// otherwise fall back to roleLevel, which every member list already carries.
|
|
34
|
-
const owner = (_a = members.find((member) => member.userID === ownerUserID)) !== null && _a !== void 0 ? _a : members.find((member) => member.roleLevel === GroupMemberRole.Owner);
|
|
35
|
-
const firstMember = [...members]
|
|
36
|
-
.filter((member) => member.userID !== (owner === null || owner === void 0 ? void 0 : owner.userID))
|
|
37
|
-
.sort((a, b) => a.joinTime - b.joinTime)[0];
|
|
38
|
-
return {
|
|
39
|
-
ownerFaceURL: owner === null || owner === void 0 ? void 0 : owner.faceURL,
|
|
40
|
-
ownerLetter: (_c = (_b = owner === null || owner === void 0 ? void 0 : owner.nickname) === null || _b === void 0 ? void 0 : _b.charAt) === null || _c === void 0 ? void 0 : _c.call(_b, 0),
|
|
41
|
-
ownerName: (_d = owner === null || owner === void 0 ? void 0 : owner.nickname) !== null && _d !== void 0 ? _d : "",
|
|
42
|
-
hasFirstMember: Boolean(firstMember),
|
|
43
|
-
firstMemberFaceURL: firstMember === null || firstMember === void 0 ? void 0 : firstMember.faceURL,
|
|
44
|
-
firstMemberLetter: (_f = (_e = firstMember === null || firstMember === void 0 ? void 0 : firstMember.nickname) === null || _e === void 0 ? void 0 : _e.charAt) === null || _f === void 0 ? void 0 : _f.call(_e, 0),
|
|
45
|
-
firstMemberName: (_g = firstMember === null || firstMember === void 0 ? void 0 : firstMember.nickname) !== null && _g !== void 0 ? _g : "",
|
|
46
|
-
};
|
|
47
|
-
}, [members, ownerUserID]);
|
|
48
|
-
if (faceURL) {
|
|
49
|
-
if (isCrm) {
|
|
50
|
-
return (_jsx(TintedAvatar, { name: groupName !== null && groupName !== void 0 ? groupName : "", src: faceURL, size: size, className: className }));
|
|
51
|
-
}
|
|
52
|
-
return (_jsx(Avatar, { src: faceURL, size: size, className: className, children: ((_a = groupName === null || groupName === void 0 ? void 0 : groupName.charAt) === null || _a === void 0 ? void 0 : _a.call(groupName, 0)) || "G" }));
|
|
53
|
-
}
|
|
54
|
-
// Not enough members yet to compose two avatars (still loading, or a
|
|
55
|
-
// solo group with no other member) — fall back to a single placeholder.
|
|
56
|
-
if (!shouldLoadMembers || !hasFirstMember) {
|
|
57
|
-
if (isCrm) {
|
|
58
|
-
return (_jsx(TintedAvatar, { name: ownerName || groupName || "", size: size, className: className }));
|
|
59
|
-
}
|
|
60
|
-
return (_jsx(Avatar, { size: size, className: className, children: ownerLetter || ((_b = groupName === null || groupName === void 0 ? void 0 : groupName.charAt) === null || _b === void 0 ? void 0 : _b.call(groupName, 0)) || "G" }));
|
|
61
|
-
}
|
|
62
|
-
const subSize = Math.round(size * 0.62);
|
|
63
|
-
// CRM: larger circles with a white gap between them and a hairline ring so photos
|
|
64
|
-
// don't melt into the white header.
|
|
65
|
-
if (isCrm) {
|
|
66
|
-
const crmSubSize = Math.round(size * 0.72);
|
|
67
|
-
const ring = { boxShadow: "0 0 0 2px #FFFFFF, 0 0 0 3px #DDDEDF" };
|
|
68
|
-
return (_jsxs("div", { className: className, style: {
|
|
69
|
-
position: "relative",
|
|
70
|
-
width: size,
|
|
71
|
-
height: size,
|
|
72
|
-
flexShrink: 0,
|
|
73
|
-
}, children: [_jsx("span", { className: "absolute bottom-0 left-0 rounded-full", style: ring, children: _jsx(TintedAvatar, { name: ownerName, src: ownerFaceURL, size: crmSubSize }) }), _jsx("span", { className: "absolute right-0 top-0 rounded-full", style: ring, children: _jsx(TintedAvatar, { name: firstMemberName, src: firstMemberFaceURL, size: crmSubSize }) })] }));
|
|
74
|
-
}
|
|
75
|
-
return (_jsxs("div", { className: className, style: { position: "relative", width: size, height: size, flexShrink: 0 }, children: [_jsx(Avatar, { src: ownerFaceURL, size: subSize, style: {
|
|
76
|
-
position: "absolute",
|
|
77
|
-
left: 0,
|
|
78
|
-
bottom: 0,
|
|
79
|
-
border: "2px solid white",
|
|
80
|
-
}, children: ownerLetter || "A" }), _jsx(Avatar, { src: firstMemberFaceURL, size: subSize, style: {
|
|
81
|
-
position: "absolute",
|
|
82
|
-
right: 0,
|
|
83
|
-
top: 0,
|
|
84
|
-
border: "2px solid white",
|
|
85
|
-
}, children: firstMemberLetter || "A" })] }));
|
|
86
|
-
};
|
|
87
|
-
export default GroupCompositeAvatar;
|