@blocklet/discuss-kit-ux 1.6.170 → 1.6.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/types.d.ts +5 -1
- package/dist/components/locale/en.d.ts +3 -0
- package/dist/components/locale/index.d.ts +6 -0
- package/dist/components/locale/zh.d.ts +3 -0
- package/dist/components/profile-card/profile-card.d.ts +2 -1
- package/dist/{editor-z1JytlS7.mjs → editor-8X1A2syI.mjs} +1 -1
- package/dist/{index-ANEtAk47.mjs → index-XTjHijc6.mjs} +145 -131
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +143 -129
- package/package.json +4 -4
|
@@ -50,7 +50,11 @@ interface TaskNotificationMessage extends INotificationMessage {
|
|
|
50
50
|
subtype: 'open' | 'close' | 'assign' | 'unassign';
|
|
51
51
|
post: Pick<Post, 'id' | 'title' | 'excerpt' | 'cover'>;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
interface PostCreateNotificationMessage extends INotificationMessage {
|
|
54
|
+
type: 'post_create';
|
|
55
|
+
post: Pick<Post, 'id' | 'title' | 'excerpt'>;
|
|
56
|
+
}
|
|
57
|
+
export type NotificationMessage = CommentNotificationMessage | ReplyNotificationMessage | MentionInCommentNotificationMessage | MentionInPostNotificationMessage | PointUpNotificationMessage | TaskNotificationMessage | PostCreateNotificationMessage;
|
|
54
58
|
interface CommonChat {
|
|
55
59
|
id: string;
|
|
56
60
|
participants: User[];
|
|
@@ -41,6 +41,9 @@ export declare const translations: {
|
|
|
41
41
|
timeout: string;
|
|
42
42
|
error: string;
|
|
43
43
|
};
|
|
44
|
+
message: {
|
|
45
|
+
newPost: string;
|
|
46
|
+
};
|
|
44
47
|
};
|
|
45
48
|
en: {
|
|
46
49
|
cancel: string;
|
|
@@ -83,5 +86,8 @@ export declare const translations: {
|
|
|
83
86
|
timeout: string;
|
|
84
87
|
error: string;
|
|
85
88
|
};
|
|
89
|
+
message: {
|
|
90
|
+
newPost: string;
|
|
91
|
+
};
|
|
86
92
|
};
|
|
87
93
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { User } from '../../types';
|
|
2
2
|
interface ProfileCardProps {
|
|
3
3
|
user: User;
|
|
4
|
+
click: () => void;
|
|
4
5
|
}
|
|
5
|
-
export default function ProfileCard({ user, ...rest }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default function ProfileCard({ user, click, ...rest }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
|
|
|
4
4
|
import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
|
|
5
5
|
import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
|
|
6
6
|
import { lazy } from "react";
|
|
7
|
-
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-XTjHijc6.mjs";
|
|
8
8
|
import "@blocklet/labels";
|
|
9
9
|
import "@mui/material/styles";
|
|
10
10
|
import "@mui/material/Box";
|
|
@@ -30,7 +30,7 @@ import DidAvatar from "@arcblock/did-connect/lib/Avatar";
|
|
|
30
30
|
import useMediaQuery$1 from "@mui/material/useMediaQuery";
|
|
31
31
|
import DID from "@arcblock/ux/lib/DID";
|
|
32
32
|
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
|
|
33
|
-
import {
|
|
33
|
+
import { Link, useNavigate, useLocation, useSearchParams, unstable_useBlocker, useParams } from "react-router-dom";
|
|
34
34
|
import UxRelativeTime from "@arcblock/ux/lib/RelativeTime";
|
|
35
35
|
import Chip from "@mui/material/Chip";
|
|
36
36
|
import Stack from "@mui/material/Stack";
|
|
@@ -912,10 +912,9 @@ const useResponsiveValue = (values2) => {
|
|
|
912
912
|
const r = useResponsive();
|
|
913
913
|
return r(values2);
|
|
914
914
|
};
|
|
915
|
-
function ProfileCard({ user, ...rest }) {
|
|
915
|
+
function ProfileCard({ user, click, ...rest }) {
|
|
916
916
|
var _a2, _b2;
|
|
917
917
|
const { session } = useSessionContext();
|
|
918
|
-
const navigate = useNavigate();
|
|
919
918
|
return /* @__PURE__ */ jsxs(
|
|
920
919
|
Box,
|
|
921
920
|
{
|
|
@@ -932,60 +931,51 @@ function ProfileCard({ user, ...rest }) {
|
|
|
932
931
|
},
|
|
933
932
|
...rest,
|
|
934
933
|
children: [
|
|
935
|
-
/* @__PURE__ */ jsxs(
|
|
936
|
-
|
|
937
|
-
{
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
style: { marginTop: 4, lineHeight: 1, height: 14, maxWidth: 250, color: "inherit !important" },
|
|
981
|
-
size: 14,
|
|
982
|
-
did: user.did
|
|
983
|
-
}
|
|
984
|
-
)
|
|
985
|
-
] })
|
|
986
|
-
]
|
|
987
|
-
}
|
|
988
|
-
),
|
|
934
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 2, cursor: "pointer" }, onClick: click, children: [
|
|
935
|
+
/* @__PURE__ */ jsx(Avatar, { did: user.did, src: user.avatar, size: 44, shape: "circle", variant: "circle" }),
|
|
936
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1 }, children: [
|
|
937
|
+
/* @__PURE__ */ jsxs(
|
|
938
|
+
Box,
|
|
939
|
+
{
|
|
940
|
+
component: "span",
|
|
941
|
+
sx: {
|
|
942
|
+
display: "flex",
|
|
943
|
+
justifyContent: "space-between",
|
|
944
|
+
alignItems: "center",
|
|
945
|
+
lineHeight: 1.3
|
|
946
|
+
},
|
|
947
|
+
children: [
|
|
948
|
+
/* @__PURE__ */ jsx(Box, { sx: { fontWeight: "bold" }, children: user.fullName }),
|
|
949
|
+
user.role && /* @__PURE__ */ jsx(
|
|
950
|
+
Box,
|
|
951
|
+
{
|
|
952
|
+
sx: {
|
|
953
|
+
px: 1.25,
|
|
954
|
+
border: 1,
|
|
955
|
+
borderColor: green[600],
|
|
956
|
+
color: green[600],
|
|
957
|
+
fontSize: 12,
|
|
958
|
+
fontWeight: "bold",
|
|
959
|
+
lineHeight: 1.5,
|
|
960
|
+
borderRadius: "100vh",
|
|
961
|
+
textTransform: "capitalize"
|
|
962
|
+
},
|
|
963
|
+
children: user.role
|
|
964
|
+
}
|
|
965
|
+
)
|
|
966
|
+
]
|
|
967
|
+
}
|
|
968
|
+
),
|
|
969
|
+
/* @__PURE__ */ jsx(
|
|
970
|
+
DID,
|
|
971
|
+
{
|
|
972
|
+
style: { marginTop: 4, lineHeight: 1, height: 14, maxWidth: 250, color: "inherit !important" },
|
|
973
|
+
size: 14,
|
|
974
|
+
did: user.did
|
|
975
|
+
}
|
|
976
|
+
)
|
|
977
|
+
] })
|
|
978
|
+
] }),
|
|
989
979
|
((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.did) && ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) !== user.did && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
990
980
|
/* @__PURE__ */ jsx(Box, { sx: { my: 2, borderTop: "1px solid #eee" } }),
|
|
991
981
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
@@ -1027,6 +1017,7 @@ function AuthorInfo({
|
|
|
1027
1017
|
const theme = useTheme();
|
|
1028
1018
|
const downMd = useMediaQuery$1(theme.breakpoints.down("md"));
|
|
1029
1019
|
const navigate = useNavigate();
|
|
1020
|
+
const [open, setOpen] = useState(false);
|
|
1030
1021
|
const sm = size === "sm";
|
|
1031
1022
|
let fontSize = sm ? 12 : 14;
|
|
1032
1023
|
let avatarSize = profileUse ? 24 : sm ? 32 : 40;
|
|
@@ -1044,16 +1035,22 @@ function AuthorInfo({
|
|
|
1044
1035
|
createdAt = typeof createdAt === "string" ? new Date(createdAt) : createdAt;
|
|
1045
1036
|
return /* @__PURE__ */ jsx(RelativeTime, { value: createdAt });
|
|
1046
1037
|
};
|
|
1038
|
+
const click = () => {
|
|
1039
|
+
setOpen(false);
|
|
1040
|
+
setTimeout(() => {
|
|
1041
|
+
navigate(`/profile/${user == null ? void 0 : user.did}`);
|
|
1042
|
+
}, 100);
|
|
1043
|
+
};
|
|
1047
1044
|
const renderAvatar = () => {
|
|
1048
1045
|
if (showProfileCard) {
|
|
1049
|
-
return /* @__PURE__ */ jsx(
|
|
1050
|
-
|
|
1046
|
+
return /* @__PURE__ */ jsx(
|
|
1047
|
+
HtmlTooltip$1,
|
|
1051
1048
|
{
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1056
|
-
children: /* @__PURE__ */ jsx(
|
|
1049
|
+
open,
|
|
1050
|
+
onClose: () => setOpen(false),
|
|
1051
|
+
onOpen: () => setOpen(true),
|
|
1052
|
+
title: /* @__PURE__ */ jsx(ProfileCard, { user, click }),
|
|
1053
|
+
children: /* @__PURE__ */ jsx(Box, { sx: { display: "flex", cursor: "pointer" }, onClick: click, children: /* @__PURE__ */ jsx(
|
|
1057
1054
|
Avatar,
|
|
1058
1055
|
{
|
|
1059
1056
|
did: user == null ? void 0 : user.did,
|
|
@@ -1065,9 +1062,9 @@ function AuthorInfo({
|
|
|
1065
1062
|
width: avatarSize
|
|
1066
1063
|
}
|
|
1067
1064
|
}
|
|
1068
|
-
)
|
|
1065
|
+
) })
|
|
1069
1066
|
}
|
|
1070
|
-
)
|
|
1067
|
+
);
|
|
1071
1068
|
}
|
|
1072
1069
|
return /* @__PURE__ */ jsx(
|
|
1073
1070
|
Avatar,
|
|
@@ -3698,6 +3695,7 @@ const getUrlHost = (url) => {
|
|
|
3698
3695
|
};
|
|
3699
3696
|
function NotificationMessage({ chat, message, prevMessage, ...rest }) {
|
|
3700
3697
|
const { session } = useSessionContext();
|
|
3698
|
+
const { t } = useLocaleContext();
|
|
3701
3699
|
const renderQuote = ({ title, excerpt, cover }) => {
|
|
3702
3700
|
if ("post" in message) {
|
|
3703
3701
|
return /* @__PURE__ */ jsxs(Box, { sx: { mt: 1.5, pl: 1, borderLeft: "4px solid #ddd", color: 14 }, children: [
|
|
@@ -3738,7 +3736,14 @@ function NotificationMessage({ chat, message, prevMessage, ...rest }) {
|
|
|
3738
3736
|
return null;
|
|
3739
3737
|
};
|
|
3740
3738
|
const render = () => {
|
|
3741
|
-
var _a2, _b2, _c
|
|
3739
|
+
var _a2, _b2, _c;
|
|
3740
|
+
if (message.type === "post_create") {
|
|
3741
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
3742
|
+
/* @__PURE__ */ jsx(Box, { component: "span", sx: { fontWeight: "bold" }, children: message.sourceUser.fullName }),
|
|
3743
|
+
/* @__PURE__ */ jsx("span", { children: t("message.newPost") }),
|
|
3744
|
+
renderQuote(message.post)
|
|
3745
|
+
] });
|
|
3746
|
+
}
|
|
3742
3747
|
if (message.type === "comment") {
|
|
3743
3748
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
3744
3749
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
@@ -3753,7 +3758,7 @@ function NotificationMessage({ chat, message, prevMessage, ...rest }) {
|
|
|
3753
3758
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
3754
3759
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
3755
3760
|
/* @__PURE__ */ jsx(Box, { component: "span", sx: { color: "grey.600", fontWeight: "bold" }, children: message.sourceUser.fullName }),
|
|
3756
|
-
/* @__PURE__ */ jsx("span", { children: (
|
|
3761
|
+
/* @__PURE__ */ jsx("span", { children: (message == null ? void 0 : message.recipient) === ((_c = session == null ? void 0 : session.user) == null ? void 0 : _c.did) ? " replied your comment:" : " replied comment:" })
|
|
3757
3762
|
] }),
|
|
3758
3763
|
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: message.reply.excerpt }),
|
|
3759
3764
|
renderQuote({ title: message.post.title, excerpt: message.comment.excerpt })
|
|
@@ -4578,7 +4583,7 @@ function Pagination({
|
|
|
4578
4583
|
}
|
|
4579
4584
|
);
|
|
4580
4585
|
}
|
|
4581
|
-
const Editor = lazy(() => import("./editor-
|
|
4586
|
+
const Editor = lazy(() => import("./editor-8X1A2syI.mjs"));
|
|
4582
4587
|
function LazyEditor(props) {
|
|
4583
4588
|
const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4584
4589
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
@@ -4726,6 +4731,9 @@ const en = {
|
|
|
4726
4731
|
staleTip: "You may need to save your changes manually",
|
|
4727
4732
|
timeout: "Request timeout: please retry the request later",
|
|
4728
4733
|
error: "Oops, your request failed. Please try again"
|
|
4734
|
+
},
|
|
4735
|
+
message: {
|
|
4736
|
+
newPost: " create a new post:"
|
|
4729
4737
|
}
|
|
4730
4738
|
};
|
|
4731
4739
|
const zh = {
|
|
@@ -4769,6 +4777,9 @@ const zh = {
|
|
|
4769
4777
|
staleTip: "您可能需要手动备份你的更改",
|
|
4770
4778
|
timeout: "请求超时: 请稍后重试",
|
|
4771
4779
|
error: "哎呀,您的请求失败了,请稍后重试"
|
|
4780
|
+
},
|
|
4781
|
+
message: {
|
|
4782
|
+
newPost: " 创建了一个新的帖子:"
|
|
4772
4783
|
}
|
|
4773
4784
|
};
|
|
4774
4785
|
const translations = { zh, en };
|
|
@@ -10518,73 +10529,76 @@ function ButtonGroup({
|
|
|
10518
10529
|
if (onSelectTab)
|
|
10519
10530
|
onSelectTab(selectTab);
|
|
10520
10531
|
}, [selectTab, selectedArray, boardId]);
|
|
10521
|
-
return
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
onClick: handleSelectAll,
|
|
10541
|
-
sx: {
|
|
10542
|
-
backgroundColor: selectAll ? "#ffffff" : "",
|
|
10543
|
-
color: selectAll ? "#030712" : "#4b5563",
|
|
10544
|
-
border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
|
|
10545
|
-
},
|
|
10546
|
-
...rest,
|
|
10547
|
-
children: t("all")
|
|
10548
|
-
}
|
|
10549
|
-
),
|
|
10550
|
-
dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
|
|
10551
|
-
const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
|
|
10552
|
-
return /* @__PURE__ */ jsx(
|
|
10532
|
+
return (
|
|
10533
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
10534
|
+
/* @__PURE__ */ jsxs(Box$1, { className: Group, children: [
|
|
10535
|
+
/* @__PURE__ */ jsxs(
|
|
10536
|
+
Box$1,
|
|
10537
|
+
{
|
|
10538
|
+
sx: {
|
|
10539
|
+
bgcolor: theme === "dark" ? "#F9FAFB" : "",
|
|
10540
|
+
width: "fit-content",
|
|
10541
|
+
maxWidth: "calc(100% - 16px)",
|
|
10542
|
+
borderRadius: "99999px",
|
|
10543
|
+
borderTopRightRadius: downSm ? 0 : "99999px",
|
|
10544
|
+
borderBottomRightRadius: downSm ? 0 : "99999px",
|
|
10545
|
+
overflow: "scroll",
|
|
10546
|
+
whiteSpace: "nowrap",
|
|
10547
|
+
mr: 2
|
|
10548
|
+
},
|
|
10549
|
+
children: [
|
|
10550
|
+
allButton && /* @__PURE__ */ jsx(
|
|
10553
10551
|
Button$1,
|
|
10554
10552
|
{
|
|
10555
|
-
onClick:
|
|
10553
|
+
onClick: handleSelectAll,
|
|
10556
10554
|
sx: {
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
border: "1px solid #e5e7eb!important"
|
|
10561
|
-
}
|
|
10555
|
+
backgroundColor: selectAll ? "#ffffff" : "",
|
|
10556
|
+
color: selectAll ? "#030712" : "#4b5563",
|
|
10557
|
+
border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
|
|
10562
10558
|
},
|
|
10563
10559
|
...rest,
|
|
10564
|
-
children:
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10560
|
+
children: t("all")
|
|
10561
|
+
}
|
|
10562
|
+
),
|
|
10563
|
+
dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
|
|
10564
|
+
const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
|
|
10565
|
+
return /* @__PURE__ */ jsx(
|
|
10566
|
+
Button$1,
|
|
10567
|
+
{
|
|
10568
|
+
onClick: () => handleClick(item),
|
|
10569
|
+
sx: {
|
|
10570
|
+
...isActive && {
|
|
10571
|
+
backgroundColor: "#ffffff",
|
|
10572
|
+
color: "#030712",
|
|
10573
|
+
border: "1px solid #e5e7eb!important"
|
|
10574
|
+
}
|
|
10575
|
+
},
|
|
10576
|
+
...rest,
|
|
10577
|
+
children: /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
10578
|
+
item == null ? void 0 : item.icon,
|
|
10579
|
+
" ",
|
|
10580
|
+
item == null ? void 0 : item.title
|
|
10581
|
+
] })
|
|
10582
|
+
},
|
|
10583
|
+
index
|
|
10584
|
+
);
|
|
10585
|
+
})
|
|
10586
|
+
]
|
|
10587
|
+
}
|
|
10588
|
+
),
|
|
10589
|
+
urlName !== "type" && /* @__PURE__ */ jsx(AccessControl, { roles: ["admin", "owner"], children: /* @__PURE__ */ jsx(
|
|
10590
|
+
IconButton$1,
|
|
10591
|
+
{
|
|
10592
|
+
component: Link,
|
|
10593
|
+
color: "inherit",
|
|
10594
|
+
size: "small",
|
|
10595
|
+
to: `/boards?type=${type}`,
|
|
10596
|
+
sx: { color: "grey.500" },
|
|
10597
|
+
children: /* @__PURE__ */ jsx(BorderColorOutlined, { sx: { fontSize: 16 } })
|
|
10598
|
+
}
|
|
10599
|
+
) })
|
|
10600
|
+
] })
|
|
10601
|
+
);
|
|
10588
10602
|
}
|
|
10589
10603
|
const Group = css`
|
|
10590
10604
|
display: flex;
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { N, j, Q, A, h, a8, B, y, F, z, H, ak, U, T, W, Y, o, C, q, v, x, a0, a1, ac, a3, K, L, D, ab, aa, E, G, b, f, a9, M, P, aj, n, m, a7, R, S, a4, k, Z, $, ad, ag, af, ah, al, J, am, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, an, _, ae, d } from "./index-
|
|
2
|
+
import { N, j, Q, A, h, a8, B, y, F, z, H, ak, U, T, W, Y, o, C, q, v, x, a0, a1, ac, a3, K, L, D, ab, aa, E, G, b, f, a9, M, P, aj, n, m, a7, R, S, a4, k, Z, $, ad, ag, af, ah, al, J, am, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, an, _, ae, d } from "./index-XTjHijc6.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -849,10 +849,9 @@ var __publicField = (obj, key, value) => {
|
|
|
849
849
|
const r = useResponsive();
|
|
850
850
|
return r(values2);
|
|
851
851
|
};
|
|
852
|
-
function ProfileCard({ user, ...rest }) {
|
|
852
|
+
function ProfileCard({ user, click, ...rest }) {
|
|
853
853
|
var _a2, _b2;
|
|
854
854
|
const { session } = useSessionContext();
|
|
855
|
-
const navigate = reactRouterDom.useNavigate();
|
|
856
855
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
857
856
|
Box,
|
|
858
857
|
{
|
|
@@ -869,60 +868,51 @@ var __publicField = (obj, key, value) => {
|
|
|
869
868
|
},
|
|
870
869
|
...rest,
|
|
871
870
|
children: [
|
|
872
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
873
|
-
|
|
874
|
-
{
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
style: { marginTop: 4, lineHeight: 1, height: 14, maxWidth: 250, color: "inherit !important" },
|
|
918
|
-
size: 14,
|
|
919
|
-
did: user.did
|
|
920
|
-
}
|
|
921
|
-
)
|
|
922
|
-
] })
|
|
923
|
-
]
|
|
924
|
-
}
|
|
925
|
-
),
|
|
871
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 2, cursor: "pointer" }, onClick: click, children: [
|
|
872
|
+
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { did: user.did, src: user.avatar, size: 44, shape: "circle", variant: "circle" }),
|
|
873
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1 }, children: [
|
|
874
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
875
|
+
Box,
|
|
876
|
+
{
|
|
877
|
+
component: "span",
|
|
878
|
+
sx: {
|
|
879
|
+
display: "flex",
|
|
880
|
+
justifyContent: "space-between",
|
|
881
|
+
alignItems: "center",
|
|
882
|
+
lineHeight: 1.3
|
|
883
|
+
},
|
|
884
|
+
children: [
|
|
885
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { fontWeight: "bold" }, children: user.fullName }),
|
|
886
|
+
user.role && /* @__PURE__ */ jsxRuntime.jsx(
|
|
887
|
+
Box,
|
|
888
|
+
{
|
|
889
|
+
sx: {
|
|
890
|
+
px: 1.25,
|
|
891
|
+
border: 1,
|
|
892
|
+
borderColor: colors.green[600],
|
|
893
|
+
color: colors.green[600],
|
|
894
|
+
fontSize: 12,
|
|
895
|
+
fontWeight: "bold",
|
|
896
|
+
lineHeight: 1.5,
|
|
897
|
+
borderRadius: "100vh",
|
|
898
|
+
textTransform: "capitalize"
|
|
899
|
+
},
|
|
900
|
+
children: user.role
|
|
901
|
+
}
|
|
902
|
+
)
|
|
903
|
+
]
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
907
|
+
DID,
|
|
908
|
+
{
|
|
909
|
+
style: { marginTop: 4, lineHeight: 1, height: 14, maxWidth: 250, color: "inherit !important" },
|
|
910
|
+
size: 14,
|
|
911
|
+
did: user.did
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
] })
|
|
915
|
+
] }),
|
|
926
916
|
((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.did) && ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) !== user.did && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
927
917
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { my: 2, borderTop: "1px solid #eee" } }),
|
|
928
918
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -964,6 +954,7 @@ var __publicField = (obj, key, value) => {
|
|
|
964
954
|
const theme = styles.useTheme();
|
|
965
955
|
const downMd = useMediaQuery(theme.breakpoints.down("md"));
|
|
966
956
|
const navigate = reactRouterDom.useNavigate();
|
|
957
|
+
const [open, setOpen] = react.useState(false);
|
|
967
958
|
const sm = size === "sm";
|
|
968
959
|
let fontSize = sm ? 12 : 14;
|
|
969
960
|
let avatarSize = profileUse ? 24 : sm ? 32 : 40;
|
|
@@ -981,16 +972,22 @@ var __publicField = (obj, key, value) => {
|
|
|
981
972
|
createdAt = typeof createdAt === "string" ? new Date(createdAt) : createdAt;
|
|
982
973
|
return /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { value: createdAt });
|
|
983
974
|
};
|
|
975
|
+
const click = () => {
|
|
976
|
+
setOpen(false);
|
|
977
|
+
setTimeout(() => {
|
|
978
|
+
navigate(`/profile/${user == null ? void 0 : user.did}`);
|
|
979
|
+
}, 100);
|
|
980
|
+
};
|
|
984
981
|
const renderAvatar = () => {
|
|
985
982
|
if (showProfileCard) {
|
|
986
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
987
|
-
|
|
983
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
984
|
+
HtmlTooltip$1,
|
|
988
985
|
{
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
},
|
|
993
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
986
|
+
open,
|
|
987
|
+
onClose: () => setOpen(false),
|
|
988
|
+
onOpen: () => setOpen(true),
|
|
989
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(ProfileCard, { user, click }),
|
|
990
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", cursor: "pointer" }, onClick: click, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
994
991
|
Avatar,
|
|
995
992
|
{
|
|
996
993
|
did: user == null ? void 0 : user.did,
|
|
@@ -1002,9 +999,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1002
999
|
width: avatarSize
|
|
1003
1000
|
}
|
|
1004
1001
|
}
|
|
1005
|
-
)
|
|
1002
|
+
) })
|
|
1006
1003
|
}
|
|
1007
|
-
)
|
|
1004
|
+
);
|
|
1008
1005
|
}
|
|
1009
1006
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1010
1007
|
Avatar,
|
|
@@ -3635,6 +3632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3635
3632
|
};
|
|
3636
3633
|
function NotificationMessage({ chat, message, prevMessage, ...rest }) {
|
|
3637
3634
|
const { session } = useSessionContext();
|
|
3635
|
+
const { t } = context.useLocaleContext();
|
|
3638
3636
|
const renderQuote = ({ title, excerpt, cover }) => {
|
|
3639
3637
|
if ("post" in message) {
|
|
3640
3638
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { mt: 1.5, pl: 1, borderLeft: "4px solid #ddd", color: 14 }, children: [
|
|
@@ -3675,7 +3673,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3675
3673
|
return null;
|
|
3676
3674
|
};
|
|
3677
3675
|
const render = () => {
|
|
3678
|
-
var _a2, _b2, _c
|
|
3676
|
+
var _a2, _b2, _c;
|
|
3677
|
+
if (message.type === "post_create") {
|
|
3678
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
3679
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontWeight: "bold" }, children: message.sourceUser.fullName }),
|
|
3680
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("message.newPost") }),
|
|
3681
|
+
renderQuote(message.post)
|
|
3682
|
+
] });
|
|
3683
|
+
}
|
|
3679
3684
|
if (message.type === "comment") {
|
|
3680
3685
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
3681
3686
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
@@ -3690,7 +3695,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3690
3695
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
3691
3696
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
3692
3697
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "grey.600", fontWeight: "bold" }, children: message.sourceUser.fullName }),
|
|
3693
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: (
|
|
3698
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: (message == null ? void 0 : message.recipient) === ((_c = session == null ? void 0 : session.user) == null ? void 0 : _c.did) ? " replied your comment:" : " replied comment:" })
|
|
3694
3699
|
] }),
|
|
3695
3700
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", children: message.reply.excerpt }),
|
|
3696
3701
|
renderQuote({ title: message.post.title, excerpt: message.comment.excerpt })
|
|
@@ -4663,6 +4668,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4663
4668
|
staleTip: "You may need to save your changes manually",
|
|
4664
4669
|
timeout: "Request timeout: please retry the request later",
|
|
4665
4670
|
error: "Oops, your request failed. Please try again"
|
|
4671
|
+
},
|
|
4672
|
+
message: {
|
|
4673
|
+
newPost: " create a new post:"
|
|
4666
4674
|
}
|
|
4667
4675
|
};
|
|
4668
4676
|
const zh = {
|
|
@@ -4706,6 +4714,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4706
4714
|
staleTip: "您可能需要手动备份你的更改",
|
|
4707
4715
|
timeout: "请求超时: 请稍后重试",
|
|
4708
4716
|
error: "哎呀,您的请求失败了,请稍后重试"
|
|
4717
|
+
},
|
|
4718
|
+
message: {
|
|
4719
|
+
newPost: " 创建了一个新的帖子:"
|
|
4709
4720
|
}
|
|
4710
4721
|
};
|
|
4711
4722
|
const translations = { zh, en };
|
|
@@ -10455,73 +10466,76 @@ var __publicField = (obj, key, value) => {
|
|
|
10455
10466
|
if (onSelectTab)
|
|
10456
10467
|
onSelectTab(selectTab);
|
|
10457
10468
|
}, [selectTab, selectedArray, boardId]);
|
|
10458
|
-
return
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
onClick: handleSelectAll,
|
|
10478
|
-
sx: {
|
|
10479
|
-
backgroundColor: selectAll ? "#ffffff" : "",
|
|
10480
|
-
color: selectAll ? "#030712" : "#4b5563",
|
|
10481
|
-
border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
|
|
10482
|
-
},
|
|
10483
|
-
...rest,
|
|
10484
|
-
children: t("all")
|
|
10485
|
-
}
|
|
10486
|
-
),
|
|
10487
|
-
dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
|
|
10488
|
-
const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
|
|
10489
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10469
|
+
return (
|
|
10470
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
10471
|
+
/* @__PURE__ */ jsxRuntime.jsxs(material.Box, { className: Group, children: [
|
|
10472
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10473
|
+
material.Box,
|
|
10474
|
+
{
|
|
10475
|
+
sx: {
|
|
10476
|
+
bgcolor: theme === "dark" ? "#F9FAFB" : "",
|
|
10477
|
+
width: "fit-content",
|
|
10478
|
+
maxWidth: "calc(100% - 16px)",
|
|
10479
|
+
borderRadius: "99999px",
|
|
10480
|
+
borderTopRightRadius: downSm ? 0 : "99999px",
|
|
10481
|
+
borderBottomRightRadius: downSm ? 0 : "99999px",
|
|
10482
|
+
overflow: "scroll",
|
|
10483
|
+
whiteSpace: "nowrap",
|
|
10484
|
+
mr: 2
|
|
10485
|
+
},
|
|
10486
|
+
children: [
|
|
10487
|
+
allButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10490
10488
|
material.Button,
|
|
10491
10489
|
{
|
|
10492
|
-
onClick:
|
|
10490
|
+
onClick: handleSelectAll,
|
|
10493
10491
|
sx: {
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
border: "1px solid #e5e7eb!important"
|
|
10498
|
-
}
|
|
10492
|
+
backgroundColor: selectAll ? "#ffffff" : "",
|
|
10493
|
+
color: selectAll ? "#030712" : "#4b5563",
|
|
10494
|
+
border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
|
|
10499
10495
|
},
|
|
10500
10496
|
...rest,
|
|
10501
|
-
children:
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10497
|
+
children: t("all")
|
|
10498
|
+
}
|
|
10499
|
+
),
|
|
10500
|
+
dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
|
|
10501
|
+
const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
|
|
10502
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10503
|
+
material.Button,
|
|
10504
|
+
{
|
|
10505
|
+
onClick: () => handleClick(item),
|
|
10506
|
+
sx: {
|
|
10507
|
+
...isActive && {
|
|
10508
|
+
backgroundColor: "#ffffff",
|
|
10509
|
+
color: "#030712",
|
|
10510
|
+
border: "1px solid #e5e7eb!important"
|
|
10511
|
+
}
|
|
10512
|
+
},
|
|
10513
|
+
...rest,
|
|
10514
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
10515
|
+
item == null ? void 0 : item.icon,
|
|
10516
|
+
" ",
|
|
10517
|
+
item == null ? void 0 : item.title
|
|
10518
|
+
] })
|
|
10519
|
+
},
|
|
10520
|
+
index
|
|
10521
|
+
);
|
|
10522
|
+
})
|
|
10523
|
+
]
|
|
10524
|
+
}
|
|
10525
|
+
),
|
|
10526
|
+
urlName !== "type" && /* @__PURE__ */ jsxRuntime.jsx(AccessControl, { roles: ["admin", "owner"], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10527
|
+
IconButton$1,
|
|
10528
|
+
{
|
|
10529
|
+
component: reactRouterDom.Link,
|
|
10530
|
+
color: "inherit",
|
|
10531
|
+
size: "small",
|
|
10532
|
+
to: `/boards?type=${type}`,
|
|
10533
|
+
sx: { color: "grey.500" },
|
|
10534
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.BorderColorOutlined, { sx: { fontSize: 16 } })
|
|
10535
|
+
}
|
|
10536
|
+
) })
|
|
10537
|
+
] })
|
|
10538
|
+
);
|
|
10525
10539
|
}
|
|
10526
10540
|
const Group = css.css`
|
|
10527
10541
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.172",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/ws": "^1.18.112",
|
|
32
|
-
"@blocklet/editor": "1.6.
|
|
33
|
-
"@blocklet/labels": "1.6.
|
|
32
|
+
"@blocklet/editor": "1.6.172",
|
|
33
|
+
"@blocklet/labels": "1.6.172",
|
|
34
34
|
"@blocklet/uploader": "^0.0.74",
|
|
35
35
|
"@emotion/css": "^11.10.5",
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"resolutions": {
|
|
95
95
|
"react": "^18.2.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "201729156add15057b9350e2ed4f759b744ccb30"
|
|
98
98
|
}
|