@blocklet/discuss-kit-ux 1.6.173 → 1.6.175
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/avatars/avatars.d.ts +3 -2
- package/dist/components/avatars/channel-group.d.ts +7 -0
- package/dist/components/avatars/index.d.ts +1 -0
- package/dist/components/avatars/system-user.d.ts +2 -1
- package/dist/components/chat/types.d.ts +1 -0
- package/dist/components/lexical.d.ts +1 -1
- package/dist/components/locale/en.d.ts +30 -1
- package/dist/components/locale/index.d.ts +60 -2
- package/dist/components/locale/zh.d.ts +30 -1
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/utils.d.ts +4 -0
- package/dist/{editor-8X1A2syI.mjs → editor-tuTpD7pf.mjs} +6 -2
- package/dist/{index-XTjHijc6.mjs → index-7VREaKfa.mjs} +538 -195
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +57 -51
- package/dist/index.umd.js +483 -144
- package/package.json +4 -4
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("react"), require("@mui/material/Box"), require("@arcblock/ux/lib/Theme"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@mui/material
|
|
3
|
-
})(this, function(exports2, labels, jsxRuntime, styles, react, Box, Theme, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$1,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("react"), require("@mui/material/Box"), require("@arcblock/ux/lib/Theme"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("@mui/material"), require("@arcblock/did-connect/lib/Address"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@mui/icons-material/Groups2Rounded"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("url-join"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("react-dom"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "react", "@mui/material/Box", "@arcblock/ux/lib/Theme", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "@mui/material", "@arcblock/did-connect/lib/Address", "@mui/icons-material/NotificationsActiveOutlined", "@mui/icons-material/Groups2Rounded", "@blocklet/editor/lib/ext/CheckboxPlugin", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "url-join", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "@mui/icons-material/Add", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.react, global.Box, global.Theme, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$1, global.Session, global.material, global.DIDAddress, global.NotificationsActiveOutlinedIcon, global.Groups2RoundedIcon, global.CheckboxPlugin, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.joinUrl, global.orderBy, global.Typography, global.Skeleton, global.reactDom, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.Fab, global.debounce, global.TextField, global.AddIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
|
|
3
|
+
})(this, function(exports2, labels, jsxRuntime, styles, react, Box, Theme, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$1, Session, material, DIDAddress, NotificationsActiveOutlinedIcon, Groups2RoundedIcon, CheckboxPlugin, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, joinUrl, orderBy, Typography, Skeleton, reactDom, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, Fab, debounce, TextField, AddIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin, SafeAreaPlugin, text, ImageNode, VideoNode) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -127,16 +127,58 @@ var __publicField = (obj, key, value) => {
|
|
|
127
127
|
const getDraftSessionKeyPrefix = () => {
|
|
128
128
|
return "comment-draft-";
|
|
129
129
|
};
|
|
130
|
+
function lexicalRootToText(data) {
|
|
131
|
+
let parsedRoot = data;
|
|
132
|
+
if (typeof data === "string") {
|
|
133
|
+
try {
|
|
134
|
+
parsedRoot = JSON.parse(data).root;
|
|
135
|
+
if (typeof parsedRoot !== "object") {
|
|
136
|
+
return data;
|
|
137
|
+
}
|
|
138
|
+
} catch {
|
|
139
|
+
parsedRoot = {};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
let text2 = "";
|
|
143
|
+
if (parsedRoot == null ? void 0 : parsedRoot.children) {
|
|
144
|
+
try {
|
|
145
|
+
parsedRoot.children.forEach((e) => {
|
|
146
|
+
if (e.text) {
|
|
147
|
+
text2 += e.text;
|
|
148
|
+
} else {
|
|
149
|
+
if (e.direction && text2 !== "") {
|
|
150
|
+
text2 += "\n";
|
|
151
|
+
}
|
|
152
|
+
text2 += lexicalRootToText(e);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
} catch (err) {
|
|
156
|
+
console.error(`lexicalRootToText ${err == null ? void 0 : err.toString()}`);
|
|
157
|
+
console.error(err);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return text2;
|
|
161
|
+
}
|
|
162
|
+
const getExcerptFromLexicalContent = (content, size = 150) => {
|
|
163
|
+
const textContent = (lexicalRootToText(content) || "").trim();
|
|
164
|
+
return textContent.length > size ? `${textContent.slice(0, size)}` : textContent;
|
|
165
|
+
};
|
|
166
|
+
const mergeSx = (initial, sx) => {
|
|
167
|
+
const mergedSx = [initial, ...Array.isArray(sx) ? sx : [sx]];
|
|
168
|
+
return mergedSx;
|
|
169
|
+
};
|
|
130
170
|
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
131
171
|
__proto__: null,
|
|
132
172
|
blockletExists,
|
|
133
173
|
copy,
|
|
134
174
|
getBlockletMountPointInfo,
|
|
135
175
|
getDraftSessionKeyPrefix,
|
|
176
|
+
getExcerptFromLexicalContent,
|
|
136
177
|
getLastItem,
|
|
137
178
|
getPreference,
|
|
138
179
|
getResizedAvatar,
|
|
139
180
|
inferDiscussKitApiPrefix,
|
|
181
|
+
mergeSx,
|
|
140
182
|
minDelay,
|
|
141
183
|
protectLogin,
|
|
142
184
|
repairBase64Avatar,
|
|
@@ -584,28 +626,47 @@ var __publicField = (obj, key, value) => {
|
|
|
584
626
|
}
|
|
585
627
|
return /* @__PURE__ */ jsxRuntime.jsx(DidAvatar, { src: src ? getResizedAvatar(src) : src, ...rest });
|
|
586
628
|
}
|
|
587
|
-
const Root$4 = Theme.styled(
|
|
629
|
+
const Root$4 = Theme.styled(AvatarGroup)`
|
|
588
630
|
display: flex;
|
|
631
|
+
align-items: center;
|
|
589
632
|
position: relative;
|
|
590
633
|
z-index: 0;
|
|
591
634
|
line-height: 1;
|
|
592
635
|
.avatars-item {
|
|
593
636
|
width: 16px;
|
|
594
637
|
transition: width 0.1s ease-in-out;
|
|
638
|
+
& .image {
|
|
639
|
+
box-shadow: 0 0 0 2px #fff !important;
|
|
640
|
+
}
|
|
595
641
|
}
|
|
596
|
-
|
|
597
|
-
|
|
642
|
+
|
|
643
|
+
// use avatarGroup first is last
|
|
644
|
+
.avatars-item:first-child {
|
|
645
|
+
width: 24px;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
.MuiAvatar-root {
|
|
649
|
+
width: 24px;
|
|
650
|
+
height: 24px;
|
|
651
|
+
z-index: 100;
|
|
652
|
+
margin-left: 0px;
|
|
653
|
+
font-size: 12px;
|
|
654
|
+
background-color: ${colors.grey[400]};
|
|
655
|
+
font-weight: 500;
|
|
656
|
+
border: none;
|
|
657
|
+
box-shadow: 0 0 0 2px #fff !important;
|
|
598
658
|
}
|
|
659
|
+
|
|
599
660
|
/* &:hover {
|
|
600
661
|
gap: 4px;
|
|
601
662
|
.avatars-item {
|
|
602
|
-
width:
|
|
663
|
+
width: 24px;
|
|
603
664
|
}
|
|
604
665
|
} */
|
|
605
666
|
`;
|
|
606
|
-
function Avatars({ users, variant = "circle" }) {
|
|
607
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root$4, { sx: { ".avatars-item + .avatars-item .image": { boxShadow: "0 0 0 2px #fff" } }, children: users.map((user, index) => {
|
|
608
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "avatars-item", sx: { position: "relative", zIndex: index + 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Avatar, { did: user.did, src: user.avatar, size:
|
|
667
|
+
function Avatars({ users, variant = "circle", ...restProps }) {
|
|
668
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root$4, { sx: { ".avatars-item + .avatars-item .image": { boxShadow: "0 0 0 2px #fff" } }, max: 999, ...restProps, children: users.map((user, index) => {
|
|
669
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "avatars-item", sx: { position: "relative", zIndex: index + 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Avatar, { did: user.did, src: user.avatar, size: 24, shape: "circle", variant }) }, index);
|
|
609
670
|
}) });
|
|
610
671
|
}
|
|
611
672
|
function RelativeTime({ value, ...rest }) {
|
|
@@ -970,7 +1031,7 @@ var __publicField = (obj, key, value) => {
|
|
|
970
1031
|
return createdAt;
|
|
971
1032
|
}
|
|
972
1033
|
createdAt = typeof createdAt === "string" ? new Date(createdAt) : createdAt;
|
|
973
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { value: createdAt });
|
|
1034
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { component: RelativeTime, sx: { color: "text.secondary" }, value: createdAt });
|
|
974
1035
|
};
|
|
975
1036
|
const click = () => {
|
|
976
1037
|
setOpen(false);
|
|
@@ -1046,16 +1107,22 @@ var __publicField = (obj, key, value) => {
|
|
|
1046
1107
|
}
|
|
1047
1108
|
),
|
|
1048
1109
|
showBadge && downMd && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 0.5, children: BadgeRender }),
|
|
1049
|
-
showDID && !(responsive && downMd) && /* @__PURE__ */ jsxRuntime.jsx(DID, { style: { lineHeight: 1.
|
|
1110
|
+
showDID && !(responsive && downMd) && /* @__PURE__ */ jsxRuntime.jsx(DID, { style: { lineHeight: 1.4, minHeight: 20, maxWidth: 250 }, size: 14, did: user == null ? void 0 : user.did })
|
|
1050
1111
|
] })
|
|
1051
1112
|
] });
|
|
1052
1113
|
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1114
|
+
function SystemUser({
|
|
1115
|
+
name = "System",
|
|
1116
|
+
showDidAddress = true,
|
|
1117
|
+
showIcon = true,
|
|
1118
|
+
size = "normal",
|
|
1119
|
+
icon,
|
|
1120
|
+
...rest
|
|
1121
|
+
}) {
|
|
1055
1122
|
const sm = size === "sm";
|
|
1056
|
-
const iconSize = sm ?
|
|
1123
|
+
const iconSize = sm ? 36 : 40;
|
|
1057
1124
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize: 14 }, ...rest, children: [
|
|
1058
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1125
|
+
showIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1059
1126
|
Box,
|
|
1060
1127
|
{
|
|
1061
1128
|
sx: {
|
|
@@ -1065,10 +1132,10 @@ var __publicField = (obj, key, value) => {
|
|
|
1065
1132
|
width: iconSize,
|
|
1066
1133
|
height: iconSize,
|
|
1067
1134
|
color: "#fff",
|
|
1068
|
-
bgcolor: "
|
|
1135
|
+
bgcolor: "secondary.main",
|
|
1069
1136
|
borderRadius: "100%"
|
|
1070
1137
|
},
|
|
1071
|
-
children: icon || /* @__PURE__ */ jsxRuntime.jsx(
|
|
1138
|
+
children: icon || /* @__PURE__ */ jsxRuntime.jsx(NotificationsActiveOutlinedIcon, { sx: { fontSize: size === "sm" ? 16 : 18 } })
|
|
1072
1139
|
}
|
|
1073
1140
|
),
|
|
1074
1141
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
@@ -1077,6 +1144,49 @@ var __publicField = (obj, key, value) => {
|
|
|
1077
1144
|
] })
|
|
1078
1145
|
] });
|
|
1079
1146
|
}
|
|
1147
|
+
function ChannelGroup({ size = "normal", chat, ...rest }) {
|
|
1148
|
+
var _a2;
|
|
1149
|
+
const sm = size === "sm";
|
|
1150
|
+
const iconSize = sm ? 36 : 40;
|
|
1151
|
+
const lastMessage = chat && chat.messages && chat.messages[chat.messages.length - 1];
|
|
1152
|
+
const messageText = lastMessage ? `${(_a2 = lastMessage == null ? void 0 : lastMessage.sender) == null ? void 0 : _a2.fullName}: ${getExcerptFromLexicalContent(lastMessage == null ? void 0 : lastMessage.content)}` : "";
|
|
1153
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize: 14 }, ...rest, children: [
|
|
1154
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1155
|
+
Box,
|
|
1156
|
+
{
|
|
1157
|
+
sx: {
|
|
1158
|
+
display: "flex",
|
|
1159
|
+
justifyContent: "center",
|
|
1160
|
+
alignItems: "center",
|
|
1161
|
+
width: iconSize,
|
|
1162
|
+
height: iconSize,
|
|
1163
|
+
color: "#fff",
|
|
1164
|
+
bgcolor: colors.amber[200],
|
|
1165
|
+
borderRadius: "100%"
|
|
1166
|
+
},
|
|
1167
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Groups2RoundedIcon, { sx: { fontSize: size === "sm" ? 16 : 18, color: colors.amber[700] } })
|
|
1168
|
+
}
|
|
1169
|
+
),
|
|
1170
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", height: "100%", justifyContent: "space-between" }, children: [
|
|
1171
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "center" }, lineHeight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontWeight: "bold" }, children: chat == null ? void 0 : chat.name }) }),
|
|
1172
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1173
|
+
Box,
|
|
1174
|
+
{
|
|
1175
|
+
className: "message-content-text",
|
|
1176
|
+
sx: {
|
|
1177
|
+
overflow: "hidden",
|
|
1178
|
+
textOverflow: "ellipsis",
|
|
1179
|
+
whiteSpace: "nowrap",
|
|
1180
|
+
width: 220,
|
|
1181
|
+
fontWeight: "regular",
|
|
1182
|
+
fontSize: 14
|
|
1183
|
+
},
|
|
1184
|
+
children: messageText
|
|
1185
|
+
}
|
|
1186
|
+
)
|
|
1187
|
+
] })
|
|
1188
|
+
] });
|
|
1189
|
+
}
|
|
1080
1190
|
const MAX_HEIGHT = 200;
|
|
1081
1191
|
const Root$3 = Theme.styled("div")`
|
|
1082
1192
|
&.markdown-viewer-collapsed .markdown-viewer-md-wrapper {
|
|
@@ -1303,7 +1413,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1303
1413
|
menuItems = customMenu ? customMenu(menuItems, postContext) : menuItems;
|
|
1304
1414
|
const renderTime = () => {
|
|
1305
1415
|
if (allowCopyLink) {
|
|
1306
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "a", href: `#${post.id}`, sx: { color: "
|
|
1416
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "a", href: `#${post.id}`, sx: { color: "text.secondary", textDecoration: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { value: post.createdAt }) });
|
|
1307
1417
|
}
|
|
1308
1418
|
return /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { value: post.createdAt });
|
|
1309
1419
|
};
|
|
@@ -2110,7 +2220,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2110
2220
|
setState({ initialized: true });
|
|
2111
2221
|
return;
|
|
2112
2222
|
}
|
|
2113
|
-
setState({ ...getInitialState(
|
|
2223
|
+
setState({ ...getInitialState(), order: state.order, initialized: false });
|
|
2114
2224
|
const fetchCommentPosition = () => api.fetchCommentPosition({
|
|
2115
2225
|
id: highlightedRef.current,
|
|
2116
2226
|
objectId: target.id,
|
|
@@ -2554,7 +2664,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2554
2664
|
}
|
|
2555
2665
|
}
|
|
2556
2666
|
),
|
|
2557
|
-
!!url &&
|
|
2667
|
+
!!url && // add box because img can't add :after
|
|
2668
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2558
2669
|
"img",
|
|
2559
2670
|
{
|
|
2560
2671
|
src: url ? composeImageUrl(url, width) : "",
|
|
@@ -2574,7 +2685,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2574
2685
|
onLoad: () => setLoaded(true),
|
|
2575
2686
|
onError: () => setErrored(true)
|
|
2576
2687
|
}
|
|
2577
|
-
),
|
|
2688
|
+
) }),
|
|
2578
2689
|
(!url || errored) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2579
2690
|
material.Box,
|
|
2580
2691
|
{
|
|
@@ -3522,20 +3633,18 @@ var __publicField = (obj, key, value) => {
|
|
|
3522
3633
|
return /* @__PURE__ */ jsxRuntime.jsx(ChatContext.Provider, { value, children });
|
|
3523
3634
|
}
|
|
3524
3635
|
function ChatList(props) {
|
|
3636
|
+
const { t } = context.useLocaleContext();
|
|
3525
3637
|
const { orderedChats, activeChatId, setActiveChat, getOppositeUser, hasUnreadMessages } = useChatContext();
|
|
3526
3638
|
const renderItem = (chat) => {
|
|
3527
3639
|
if (chat.type === "notification") {
|
|
3528
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SystemUser, { name: "
|
|
3640
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SystemUser, { name: t("chat.notification") });
|
|
3529
3641
|
}
|
|
3530
3642
|
if (chat.type === "dm") {
|
|
3531
3643
|
const oppositeUser = getOppositeUser(chat);
|
|
3532
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AuthorInfo, { user: oppositeUser, showProfileCard: false });
|
|
3644
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AuthorInfo, { user: oppositeUser, showProfileCard: false, showBadge: false, showDID: false });
|
|
3533
3645
|
}
|
|
3534
3646
|
if (chat.type === "channel") {
|
|
3535
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3536
|
-
"# ",
|
|
3537
|
-
chat.name
|
|
3538
|
-
] });
|
|
3647
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", children: /* @__PURE__ */ jsxRuntime.jsx(ChannelGroup, { chat }) });
|
|
3539
3648
|
}
|
|
3540
3649
|
return null;
|
|
3541
3650
|
};
|
|
@@ -3547,13 +3656,18 @@ var __publicField = (obj, key, value) => {
|
|
|
3547
3656
|
{
|
|
3548
3657
|
sx: {
|
|
3549
3658
|
position: "relative",
|
|
3550
|
-
|
|
3659
|
+
m: 1,
|
|
3660
|
+
py: 1.5,
|
|
3661
|
+
px: 2,
|
|
3551
3662
|
fontWeight: "bold",
|
|
3552
|
-
color: isActiveChat ? "
|
|
3553
|
-
bgcolor: isActiveChat ? "
|
|
3554
|
-
borderRadius:
|
|
3663
|
+
color: isActiveChat ? "secondary.main" : "grey.700",
|
|
3664
|
+
bgcolor: isActiveChat ? "action.selected" : "",
|
|
3665
|
+
borderRadius: 1,
|
|
3555
3666
|
cursor: "pointer",
|
|
3556
|
-
...isActiveChat && {
|
|
3667
|
+
...isActiveChat && {
|
|
3668
|
+
".did-address-text": { color: "grey.500" },
|
|
3669
|
+
".message-content-text": { color: "grey.500" }
|
|
3670
|
+
}
|
|
3557
3671
|
},
|
|
3558
3672
|
onClick: () => setActiveChat(chat),
|
|
3559
3673
|
children: [
|
|
@@ -3622,21 +3736,12 @@ var __publicField = (obj, key, value) => {
|
|
|
3622
3736
|
}
|
|
3623
3737
|
);
|
|
3624
3738
|
}
|
|
3625
|
-
const getUrlHost = (url) => {
|
|
3626
|
-
try {
|
|
3627
|
-
const { host } = new URL(url);
|
|
3628
|
-
return host;
|
|
3629
|
-
} catch (e) {
|
|
3630
|
-
return url;
|
|
3631
|
-
}
|
|
3632
|
-
};
|
|
3633
3739
|
function NotificationMessage({ chat, message, prevMessage, ...rest }) {
|
|
3634
3740
|
const { session } = useSessionContext();
|
|
3635
3741
|
const { t } = context.useLocaleContext();
|
|
3636
3742
|
const renderQuote = ({ title, excerpt, cover }) => {
|
|
3637
3743
|
if ("post" in message) {
|
|
3638
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: {
|
|
3639
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { fontSize: 13, color: "grey.500" }, children: getUrlHost(message.link) }),
|
|
3744
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { color: 14, mt: 1 }, children: [
|
|
3640
3745
|
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3641
3746
|
Typography,
|
|
3642
3747
|
{
|
|
@@ -3644,11 +3749,10 @@ var __publicField = (obj, key, value) => {
|
|
|
3644
3749
|
variant: "h6",
|
|
3645
3750
|
href: message.link,
|
|
3646
3751
|
target: "_blank",
|
|
3647
|
-
style: { fontSize: 14, color: "#2fafff" },
|
|
3752
|
+
style: { fontSize: 14, color: "#2fafff", textDecoration: "none" },
|
|
3648
3753
|
children: title
|
|
3649
3754
|
}
|
|
3650
3755
|
),
|
|
3651
|
-
excerpt && /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { overflow: "hidden" }, children: excerpt }),
|
|
3652
3756
|
cover && // cover image
|
|
3653
3757
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { maxWidth: 200, mt: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3654
3758
|
Box,
|
|
@@ -3673,58 +3777,138 @@ var __publicField = (obj, key, value) => {
|
|
|
3673
3777
|
return null;
|
|
3674
3778
|
};
|
|
3675
3779
|
const render = () => {
|
|
3676
|
-
var _a2, _b2, _c;
|
|
3780
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
3677
3781
|
if (message.type === "post_create") {
|
|
3678
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3782
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3783
|
+
Box,
|
|
3784
|
+
{
|
|
3785
|
+
sx: {
|
|
3786
|
+
py: 1.5,
|
|
3787
|
+
px: 2,
|
|
3788
|
+
background: "#fff",
|
|
3789
|
+
width: "fit-content",
|
|
3790
|
+
maxWidth: "calc(100% - 16px)",
|
|
3791
|
+
wordWrap: "break-word",
|
|
3792
|
+
borderRadius: 1
|
|
3793
|
+
},
|
|
3794
|
+
children: [
|
|
3795
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", color: "primary.light" }, children: [
|
|
3796
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { icon: "tabler:news", style: { height: 15, width: 15, marginRight: 4 } }),
|
|
3797
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { mr: 0.5 }, children: message.sourceUser.fullName }),
|
|
3798
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("chat.newPost") })
|
|
3799
|
+
] }),
|
|
3800
|
+
renderQuote(message.post)
|
|
3801
|
+
]
|
|
3802
|
+
}
|
|
3803
|
+
);
|
|
3683
3804
|
}
|
|
3684
3805
|
if (message.type === "comment") {
|
|
3685
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3806
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3807
|
+
Box,
|
|
3808
|
+
{
|
|
3809
|
+
sx: {
|
|
3810
|
+
py: 1.5,
|
|
3811
|
+
px: 2,
|
|
3812
|
+
background: "#fff",
|
|
3813
|
+
width: "fit-content",
|
|
3814
|
+
maxWidth: "calc(100% - 16px)",
|
|
3815
|
+
wordWrap: "break-word",
|
|
3816
|
+
borderRadius: 1
|
|
3817
|
+
},
|
|
3818
|
+
children: [
|
|
3819
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", color: "primary.light" }, children: [
|
|
3820
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { icon: "tabler:message-circle-2", style: { height: 15, width: 15, marginRight: 4 } }),
|
|
3821
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { mr: 0.5 }, children: message.sourceUser.fullName }),
|
|
3822
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: ((_a2 = message == null ? void 0 : message.sourceUser) == null ? void 0 : _a2.did) === ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) ? t("chat.commentedYourPost") : t("chat.commentedPost") })
|
|
3823
|
+
] }),
|
|
3824
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", sx: { fontSize: 16 }, children: (_c = message == null ? void 0 : message.comment) == null ? void 0 : _c.excerpt }),
|
|
3825
|
+
renderQuote(message.post)
|
|
3826
|
+
]
|
|
3827
|
+
}
|
|
3828
|
+
);
|
|
3693
3829
|
}
|
|
3694
3830
|
if (message.type === "reply") {
|
|
3695
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3831
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3832
|
+
Box,
|
|
3833
|
+
{
|
|
3834
|
+
sx: {
|
|
3835
|
+
py: 1.5,
|
|
3836
|
+
px: 2,
|
|
3837
|
+
background: "#fff",
|
|
3838
|
+
width: "fit-content",
|
|
3839
|
+
maxWidth: "calc(100% - 16px)",
|
|
3840
|
+
wordWrap: "break-word",
|
|
3841
|
+
borderRadius: 1
|
|
3842
|
+
},
|
|
3843
|
+
children: [
|
|
3844
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", color: "primary.light" }, children: [
|
|
3845
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { icon: "tabler:message-circle-2", style: { height: 15, width: 15, marginRight: 4 } }),
|
|
3846
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { mr: 0.5 }, children: message.sourceUser.fullName }),
|
|
3847
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: (message == null ? void 0 : message.recipient) === ((_d = session == null ? void 0 : session.user) == null ? void 0 : _d.did) ? t("chat.replyYourComment") : t("chat.replyComment") })
|
|
3848
|
+
] }),
|
|
3849
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", children: message.reply.excerpt }),
|
|
3850
|
+
renderQuote({ title: message.post.title, excerpt: message.comment.excerpt })
|
|
3851
|
+
]
|
|
3852
|
+
}
|
|
3853
|
+
);
|
|
3703
3854
|
}
|
|
3704
3855
|
if (message.type === "mentionInComment") {
|
|
3705
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3856
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3857
|
+
Box,
|
|
3858
|
+
{
|
|
3859
|
+
sx: {
|
|
3860
|
+
py: 1.5,
|
|
3861
|
+
px: 2,
|
|
3862
|
+
background: "#fff",
|
|
3863
|
+
width: "fit-content",
|
|
3864
|
+
maxWidth: "calc(100% - 16px)",
|
|
3865
|
+
wordWrap: "break-word",
|
|
3866
|
+
borderRadius: 1
|
|
3867
|
+
},
|
|
3868
|
+
children: [
|
|
3869
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", color: "primary.light" }, children: [
|
|
3870
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { icon: "tabler:message-circle-2", style: { height: 15, width: 15, marginRight: 4 } }),
|
|
3871
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { mr: 0.5 }, children: message.sourceUser.fullName }),
|
|
3872
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
3873
|
+
" ",
|
|
3874
|
+
t("chat.mentionInComment")
|
|
3875
|
+
] })
|
|
3876
|
+
] }),
|
|
3877
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", sx: { fontSize: 16 }, children: (_g = (_e = message == null ? void 0 : message.comment) == null ? void 0 : _e.excerpt) == null ? void 0 : _g.replace((_f = session == null ? void 0 : session.user) == null ? void 0 : _f.fullName, "") }),
|
|
3878
|
+
renderQuote(message.post)
|
|
3879
|
+
]
|
|
3880
|
+
}
|
|
3881
|
+
);
|
|
3713
3882
|
}
|
|
3714
3883
|
if (message.type === "mentionInPost") {
|
|
3715
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3884
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3885
|
+
Box,
|
|
3886
|
+
{
|
|
3887
|
+
sx: {
|
|
3888
|
+
py: 1.5,
|
|
3889
|
+
px: 2,
|
|
3890
|
+
borderRadius: 1,
|
|
3891
|
+
background: "#fff",
|
|
3892
|
+
width: "fit-content",
|
|
3893
|
+
maxWidth: "calc(100% - 16px)",
|
|
3894
|
+
wordWrap: "break-word"
|
|
3895
|
+
},
|
|
3896
|
+
children: [
|
|
3897
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", color: "primary.light" }, children: [
|
|
3898
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { icon: "tabler:message-circle-2", style: { height: 15, width: 15, marginRight: 4 } }),
|
|
3899
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { mr: 0.5 }, children: message.sourceUser.fullName }),
|
|
3900
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("chat.mentionInPost") })
|
|
3901
|
+
] }),
|
|
3902
|
+
renderQuote(message.post)
|
|
3903
|
+
]
|
|
3904
|
+
}
|
|
3905
|
+
);
|
|
3722
3906
|
}
|
|
3723
3907
|
if (message.type === "pointUp") {
|
|
3724
3908
|
const { points, post, comment, eventKey = "" } = message;
|
|
3725
|
-
const unit = points > 1 ? "points" : "point";
|
|
3909
|
+
const unit = points > 1 ? t("chat.points") : t("chat.point");
|
|
3726
3910
|
const event = eventKey ? `for ${eventKey.toLowerCase().replaceAll("-", " ")}: ` : ": ";
|
|
3727
|
-
const tip =
|
|
3911
|
+
const tip = t("chat.pointUp", { points, unit, event });
|
|
3728
3912
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
3729
3913
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "grey.600" }, children: tip }),
|
|
3730
3914
|
comment && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", children: comment.excerpt }),
|
|
@@ -3733,24 +3917,39 @@ var __publicField = (obj, key, value) => {
|
|
|
3733
3917
|
}
|
|
3734
3918
|
if (message.type === "task") {
|
|
3735
3919
|
const titles = {
|
|
3736
|
-
open: "
|
|
3737
|
-
close: "
|
|
3738
|
-
assign: "
|
|
3739
|
-
unassign: "
|
|
3920
|
+
open: t("chat.openTask"),
|
|
3921
|
+
close: t("chat.closeTask"),
|
|
3922
|
+
assign: t("chat.assignTask"),
|
|
3923
|
+
unassign: t("chat.unassignTask")
|
|
3740
3924
|
};
|
|
3741
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3925
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3926
|
+
Box,
|
|
3927
|
+
{
|
|
3928
|
+
sx: {
|
|
3929
|
+
py: 1.5,
|
|
3930
|
+
px: 2,
|
|
3931
|
+
borderRadius: 1,
|
|
3932
|
+
background: "#fff",
|
|
3933
|
+
width: "fit-content",
|
|
3934
|
+
maxWidth: "calc(100% - 16px)",
|
|
3935
|
+
wordWrap: "break-word"
|
|
3936
|
+
},
|
|
3937
|
+
children: [
|
|
3938
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", color: "primary.light" }, children: [
|
|
3939
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { icon: "tabler:arrow-forward-up", style: { height: 15, width: 15, marginRight: 4 } }),
|
|
3940
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { mr: 0.5 }, children: message.sourceUser.fullName }),
|
|
3941
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: titles[message.subtype] })
|
|
3942
|
+
] }),
|
|
3943
|
+
renderQuote(message.post)
|
|
3944
|
+
]
|
|
3945
|
+
}
|
|
3946
|
+
);
|
|
3748
3947
|
}
|
|
3749
3948
|
return /* @__PURE__ */ jsxRuntime.jsx(Message, { message, showTime: false });
|
|
3750
3949
|
};
|
|
3751
3950
|
const messageInterval = message.createdAt.getTime() - ((prevMessage == null ? void 0 : prevMessage.createdAt.getTime()) || 0);
|
|
3752
3951
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { ...rest, sx: { mt: 2 }, children: [
|
|
3753
|
-
messageInterval > 6e4 && /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { my: 2, textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "inline-block", px: 1, fontSize: 12, bgcolor: "grey.300", borderRadius:
|
|
3952
|
+
messageInterval > 6e4 && /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { my: 2, textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "inline-block", px: 1, fontSize: 12, bgcolor: "grey.300", borderRadius: 0.5 }, children: dayjs(message.createdAt).format("MM-DD HH:mm") }) }),
|
|
3754
3953
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { p: 2, fontSize: 14, "&:hover": { bgcolor: "grey.50" } }, children: render() })
|
|
3755
3954
|
] });
|
|
3756
3955
|
}
|
|
@@ -3918,7 +4117,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3918
4117
|
}
|
|
3919
4118
|
function ChatRoom({ chat, ...rest }) {
|
|
3920
4119
|
var _a2;
|
|
3921
|
-
const
|
|
4120
|
+
const { t } = context.useLocaleContext();
|
|
4121
|
+
const theme = styles.useTheme();
|
|
4122
|
+
const downSm = material.useMediaQuery((currentTheme) => currentTheme.breakpoints.down("sm"));
|
|
3922
4123
|
const { initChatRoom, isActiveChat, getOppositeUser, sendMessage, joinChannel, leaveChannel, deleteChannel } = useChatContext();
|
|
3923
4124
|
const { confirm } = useConfirm();
|
|
3924
4125
|
const isActive = isActiveChat(chat.id);
|
|
@@ -3931,8 +4132,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3931
4132
|
}, [chat.isActivated]);
|
|
3932
4133
|
const handleDeleteChannel = async () => {
|
|
3933
4134
|
const proceed = await confirm({
|
|
3934
|
-
title: "
|
|
3935
|
-
description: "
|
|
4135
|
+
title: t("chat.deleteChannelTitle"),
|
|
4136
|
+
description: t("chat.deleteChannelDesc"),
|
|
3936
4137
|
okButtonProps: { color: "error" }
|
|
3937
4138
|
});
|
|
3938
4139
|
if (proceed) {
|
|
@@ -3941,38 +4142,32 @@ var __publicField = (obj, key, value) => {
|
|
|
3941
4142
|
};
|
|
3942
4143
|
const renderRoomHeader = () => {
|
|
3943
4144
|
if (chat.type === "notification") {
|
|
3944
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "center", gap: 1, flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(SystemUser, { name: "
|
|
4145
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "center", gap: 1, flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(SystemUser, { name: t("chat.notification"), showDidAddress: false, size: "sm", showIcon: false }) });
|
|
3945
4146
|
}
|
|
3946
4147
|
if (chat.type === "dm") {
|
|
3947
4148
|
const oppositeUser = getOppositeUser(chat);
|
|
3948
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3949
|
-
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { did: oppositeUser.did, src: oppositeUser.avatar, size: 28, shape: "circle", variant: "circle" }),
|
|
3950
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, color: "grey.600", fontWeight: "bold" }, children: oppositeUser.fullName })
|
|
3951
|
-
] });
|
|
4149
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "center", gap: 1, flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, color: "grey.600", fontWeight: "bold" }, children: oppositeUser.fullName }) });
|
|
3952
4150
|
}
|
|
3953
4151
|
if (chat.type === "channel") {
|
|
3954
4152
|
const menuItems = [];
|
|
3955
4153
|
if (chat.hasJoined && !isCreator) {
|
|
3956
4154
|
menuItems.push(
|
|
3957
|
-
/* @__PURE__ */ jsxRuntime.jsx(Menu.Item, { onClick: () => leaveChannel(chat.id), children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "error.main" }, children: "
|
|
4155
|
+
/* @__PURE__ */ jsxRuntime.jsx(Menu.Item, { onClick: () => leaveChannel(chat.id), children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "error.main" }, children: t("chat.leaveChannel") }) }, "leave")
|
|
3958
4156
|
);
|
|
3959
4157
|
}
|
|
3960
4158
|
if (isAdmin || isCreator) {
|
|
3961
4159
|
menuItems.push(
|
|
3962
|
-
/* @__PURE__ */ jsxRuntime.jsx(Menu.Item, { onClick: handleDeleteChannel, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "error.main" }, children: "
|
|
4160
|
+
/* @__PURE__ */ jsxRuntime.jsx(Menu.Item, { onClick: handleDeleteChannel, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "error.main" }, children: t("chat.deleteChannel") }) }, "delete")
|
|
3963
4161
|
);
|
|
3964
4162
|
}
|
|
3965
4163
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", width: 1, flex: 1 }, children: [
|
|
3966
4164
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
3967
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3968
|
-
"# ",
|
|
3969
|
-
chat.name
|
|
3970
|
-
] }),
|
|
4165
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, fontWeight: "bold", color: "grey.700" }, children: chat.name }),
|
|
3971
4166
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { fontSize: 12, color: "grey.500" }, children: chat.description })
|
|
3972
4167
|
] }),
|
|
3973
4168
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
3974
|
-
!chat.hasJoined && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "contained", color: "primary", onClick: () => joinChannel(chat.id), children: "
|
|
3975
|
-
|
|
4169
|
+
!chat.hasJoined && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "contained", color: "primary", onClick: () => joinChannel(chat.id), children: t("chat.joinChannel") }),
|
|
4170
|
+
chat.hasJoined && /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(Participants, { users: chat.participants, sx: { border: "none" } }) }),
|
|
3976
4171
|
/* @__PURE__ */ jsxRuntime.jsx(Menu, { items: menuItems })
|
|
3977
4172
|
] })
|
|
3978
4173
|
] });
|
|
@@ -4000,7 +4195,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4000
4195
|
]
|
|
4001
4196
|
}
|
|
4002
4197
|
),
|
|
4003
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(MessageList, { chat }) }),
|
|
4198
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { flex: 1, overflow: "hidden", background: theme.palette.grey[50] }, children: /* @__PURE__ */ jsxRuntime.jsx(MessageList, { chat }) }),
|
|
4004
4199
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4005
4200
|
Box,
|
|
4006
4201
|
{
|
|
@@ -4027,6 +4222,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4027
4222
|
name: "",
|
|
4028
4223
|
description: ""
|
|
4029
4224
|
});
|
|
4225
|
+
const { t } = context.useLocaleContext();
|
|
4226
|
+
const theme = styles.useTheme();
|
|
4030
4227
|
const canSubmit = react.useMemo(() => {
|
|
4031
4228
|
return state.name;
|
|
4032
4229
|
}, [state]);
|
|
@@ -4039,35 +4236,70 @@ var __publicField = (obj, key, value) => {
|
|
|
4039
4236
|
open,
|
|
4040
4237
|
showCloseButton: true,
|
|
4041
4238
|
maxWidth: "lg",
|
|
4042
|
-
title: "
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4239
|
+
title: t("chat.newChannel"),
|
|
4240
|
+
sx: {
|
|
4241
|
+
"& .MuiDialogContent-root": {
|
|
4242
|
+
borderTop: `1px solid ${theme.palette.divider}`,
|
|
4243
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
4244
|
+
}
|
|
4245
|
+
},
|
|
4246
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4247
|
+
Button,
|
|
4248
|
+
{
|
|
4249
|
+
color: "primary",
|
|
4250
|
+
sx: { mt: 1 },
|
|
4251
|
+
variant: "contained",
|
|
4252
|
+
size: "small",
|
|
4253
|
+
onClick: handleSubmit,
|
|
4254
|
+
disabled: !canSubmit,
|
|
4255
|
+
children: [
|
|
4256
|
+
/* @__PURE__ */ jsxRuntime.jsx(AddIcon, { sx: { mr: 0.375 } }),
|
|
4257
|
+
t("chat.create")
|
|
4258
|
+
]
|
|
4259
|
+
}
|
|
4260
|
+
),
|
|
4047
4261
|
onClose,
|
|
4048
4262
|
...rest,
|
|
4049
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { width: { xs: "100%", md:
|
|
4263
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { width: { xs: "100%", md: 560 }, minHeight: 140, children: [
|
|
4264
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { fontSize: 14, lineHeight: 3, fontWeight: "medium", mb: 1 }, children: t("chat.channel") }),
|
|
4050
4265
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4051
4266
|
TextField,
|
|
4052
4267
|
{
|
|
4053
|
-
label: "Name",
|
|
4054
4268
|
value: state.name,
|
|
4055
|
-
placeholder: "
|
|
4269
|
+
placeholder: t("chat.channelName"),
|
|
4056
4270
|
size: "small",
|
|
4057
4271
|
fullWidth: true,
|
|
4272
|
+
sx: {
|
|
4273
|
+
"& .MuiInputBase-root": {
|
|
4274
|
+
height: 40,
|
|
4275
|
+
backgroundColor: theme.palette.grey[100]
|
|
4276
|
+
}
|
|
4277
|
+
},
|
|
4058
4278
|
onChange: (e) => setState({ name: e.target.value })
|
|
4059
4279
|
}
|
|
4060
4280
|
),
|
|
4281
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { fontSize: 14, lineHeight: 3, fontWeight: "medium", mt: 1 }, children: t("chat.description") }),
|
|
4061
4282
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4062
4283
|
TextField,
|
|
4063
4284
|
{
|
|
4064
|
-
label: "Description",
|
|
4065
4285
|
value: state.description,
|
|
4066
|
-
placeholder: "
|
|
4067
|
-
size: "small",
|
|
4286
|
+
placeholder: t("chat.channelDescription"),
|
|
4068
4287
|
fullWidth: true,
|
|
4288
|
+
multiline: true,
|
|
4069
4289
|
onChange: (e) => setState({ description: e.target.value }),
|
|
4070
|
-
sx: {
|
|
4290
|
+
sx: {
|
|
4291
|
+
my: 1,
|
|
4292
|
+
"& .MuiInputBase-root": {
|
|
4293
|
+
height: 64,
|
|
4294
|
+
display: "flex",
|
|
4295
|
+
alignItems: "flex-start",
|
|
4296
|
+
backgroundColor: theme.palette.grey[100]
|
|
4297
|
+
},
|
|
4298
|
+
"& .MuiInputBase-inputMultiline": {
|
|
4299
|
+
maxHeight: "100%",
|
|
4300
|
+
overflowY: "auto"
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4071
4303
|
}
|
|
4072
4304
|
)
|
|
4073
4305
|
] })
|
|
@@ -4075,6 +4307,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4075
4307
|
);
|
|
4076
4308
|
}
|
|
4077
4309
|
function Empty({ sx }) {
|
|
4310
|
+
const { t } = context.useLocaleContext();
|
|
4078
4311
|
const mergedSx = [
|
|
4079
4312
|
{
|
|
4080
4313
|
display: "flex",
|
|
@@ -4088,26 +4321,27 @@ var __publicField = (obj, key, value) => {
|
|
|
4088
4321
|
];
|
|
4089
4322
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: mergedSx, children: [
|
|
4090
4323
|
/* @__PURE__ */ jsxRuntime.jsx(iconoirChatBubbleEmpty, { style: { fontSize: 32 } }),
|
|
4091
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, fontWeight: "bold" }, children: "
|
|
4324
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, fontWeight: "bold" }, children: t("chat.noChats") })
|
|
4092
4325
|
] });
|
|
4093
4326
|
}
|
|
4094
4327
|
function Chat({ sx, ...rest }) {
|
|
4095
4328
|
const { client: client2, initialized, chats, activeChatId, addChat, setActiveChat, refresh, getOppositeUser } = useChatContext();
|
|
4096
4329
|
const [newChannelVisible, setNewChannelVisible] = react.useState(false);
|
|
4097
4330
|
const downMd = material.useMediaQuery((theme) => theme.breakpoints.down("sm"));
|
|
4331
|
+
const { t } = context.useLocaleContext();
|
|
4098
4332
|
const activeChat = chats.filter((chat) => (chat == null ? void 0 : chat.id) === activeChatId)[0];
|
|
4099
4333
|
const webTitleMap = {
|
|
4100
4334
|
dm: () => {
|
|
4101
4335
|
var _a2;
|
|
4102
|
-
return ((_a2 = getOppositeUser(activeChat)) == null ? void 0 : _a2.fullName) || "
|
|
4336
|
+
return ((_a2 = getOppositeUser(activeChat)) == null ? void 0 : _a2.fullName) || t("chat.unknown");
|
|
4103
4337
|
},
|
|
4104
|
-
notification: () => "
|
|
4105
|
-
channel: () => (activeChat == null ? void 0 : activeChat.type) === "channel" ? `#${activeChat.name}` : "
|
|
4106
|
-
default: () => "
|
|
4338
|
+
notification: () => t("chat.notification"),
|
|
4339
|
+
channel: () => (activeChat == null ? void 0 : activeChat.type) === "channel" ? `#${activeChat.name}` : t("chat.unknownChannel"),
|
|
4340
|
+
default: () => t("chat.chats")
|
|
4107
4341
|
};
|
|
4108
4342
|
const getWebTitle = () => {
|
|
4109
4343
|
if (!activeChat) {
|
|
4110
|
-
return "
|
|
4344
|
+
return t("chat.chats");
|
|
4111
4345
|
}
|
|
4112
4346
|
const getTitle = webTitleMap[activeChat.type] || webTitleMap.default;
|
|
4113
4347
|
return getTitle();
|
|
@@ -4130,10 +4364,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4130
4364
|
if (!initialized) {
|
|
4131
4365
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {});
|
|
4132
4366
|
}
|
|
4133
|
-
const mergedSx = [
|
|
4134
|
-
{ display: "flex", height: "100%", bgcolor: "#fff", borderRadius: 1 },
|
|
4135
|
-
...Array.isArray(sx) ? sx : [sx]
|
|
4136
|
-
];
|
|
4367
|
+
const mergedSx = [{ display: "flex", height: "100%", bgcolor: "#fff" }, ...Array.isArray(sx) ? sx : [sx]];
|
|
4137
4368
|
const handleNewChannel = async ({ name, description }) => {
|
|
4138
4369
|
const saved = await client2.createChannel(name, description);
|
|
4139
4370
|
const newChannel = { ...saved, hasJoined: true };
|
|
@@ -4165,11 +4396,15 @@ var __publicField = (obj, key, value) => {
|
|
|
4165
4396
|
borderBottom: "1px solid #e5e5e5"
|
|
4166
4397
|
},
|
|
4167
4398
|
children: [
|
|
4168
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4399
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { component: "span", variant: "subtitle1", sx: { fontSize: 16, fontWeight: "bold" }, children: t("chat.chats") }) }),
|
|
4400
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccessControl, { roles: ["owner", "admin"], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4401
|
+
IconButton$1,
|
|
4402
|
+
{
|
|
4403
|
+
onClick: () => setNewChannelVisible(true),
|
|
4404
|
+
sx: { p: 1, borderRadius: 1, border: `1px solid ${colors.grey[200]}` },
|
|
4405
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.Add, { sx: { color: "#000" } })
|
|
4406
|
+
}
|
|
4407
|
+
) })
|
|
4173
4408
|
]
|
|
4174
4409
|
}
|
|
4175
4410
|
),
|
|
@@ -4596,7 +4831,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4596
4831
|
function ConfirmNavigation() {
|
|
4597
4832
|
const { t } = context.useLocaleContext();
|
|
4598
4833
|
const { dirty, reset } = DirtyPromptContainer.useContainer();
|
|
4599
|
-
const blocker = reactRouterDom.
|
|
4834
|
+
const blocker = reactRouterDom.useBlocker(dirty);
|
|
4600
4835
|
react.useEffect(() => {
|
|
4601
4836
|
if (blocker.state === "blocked" && !dirty) {
|
|
4602
4837
|
blocker.reset();
|
|
@@ -4669,8 +4904,37 @@ var __publicField = (obj, key, value) => {
|
|
|
4669
4904
|
timeout: "Request timeout: please retry the request later",
|
|
4670
4905
|
error: "Oops, your request failed. Please try again"
|
|
4671
4906
|
},
|
|
4672
|
-
|
|
4673
|
-
|
|
4907
|
+
chat: {
|
|
4908
|
+
notification: "Notification",
|
|
4909
|
+
unknown: "Unknown",
|
|
4910
|
+
chats: "Chats",
|
|
4911
|
+
create: "Create",
|
|
4912
|
+
channel: "Channel",
|
|
4913
|
+
description: "Description",
|
|
4914
|
+
newChannel: "New channel",
|
|
4915
|
+
noChats: "No chats",
|
|
4916
|
+
unknownChannel: "Unknown Channel",
|
|
4917
|
+
channelDescription: "Channel Description",
|
|
4918
|
+
channelName: "Channel Name",
|
|
4919
|
+
deleteChannel: "Delete Channel",
|
|
4920
|
+
commentedYourPost: "commented your post",
|
|
4921
|
+
commentedPost: "commented post",
|
|
4922
|
+
newPost: "create a new post",
|
|
4923
|
+
mentionInComment: "mentioned you in a comment",
|
|
4924
|
+
mentionInPost: "mentioned you in a post",
|
|
4925
|
+
replyYourComment: "replied your comment",
|
|
4926
|
+
replyComment: "replied comment",
|
|
4927
|
+
deleteChannelTitle: "Delete this channel?",
|
|
4928
|
+
deleteChannelDesc: "If you delete this channel, all messages in the channel will be deleted immediately.",
|
|
4929
|
+
leaveChannel: "Leave channel",
|
|
4930
|
+
joinChannel: "Join channel",
|
|
4931
|
+
openTask: "opened a post",
|
|
4932
|
+
closeTask: "closed a post",
|
|
4933
|
+
assignTask: "assigned you to a post",
|
|
4934
|
+
unassignTask: "unassigned you from a post",
|
|
4935
|
+
points: "points",
|
|
4936
|
+
point: "point",
|
|
4937
|
+
pointUp: "🎉 You got {points} {unit} {event}"
|
|
4674
4938
|
}
|
|
4675
4939
|
};
|
|
4676
4940
|
const zh = {
|
|
@@ -4715,8 +4979,37 @@ var __publicField = (obj, key, value) => {
|
|
|
4715
4979
|
timeout: "请求超时: 请稍后重试",
|
|
4716
4980
|
error: "哎呀,您的请求失败了,请稍后重试"
|
|
4717
4981
|
},
|
|
4718
|
-
|
|
4719
|
-
|
|
4982
|
+
chat: {
|
|
4983
|
+
notification: "通知",
|
|
4984
|
+
unknown: "未命名",
|
|
4985
|
+
chats: "聊天",
|
|
4986
|
+
create: "创建",
|
|
4987
|
+
channel: "频道",
|
|
4988
|
+
description: "描述",
|
|
4989
|
+
newChannel: "新的频道",
|
|
4990
|
+
noChats: "暂无对话",
|
|
4991
|
+
unknownChannel: "未命名的频道",
|
|
4992
|
+
channelDescription: "频道描述",
|
|
4993
|
+
channelName: "频道名称",
|
|
4994
|
+
deleteChannel: "删除频道",
|
|
4995
|
+
commentedYourPost: "评论了你的帖子",
|
|
4996
|
+
commentedPost: "评论了帖子",
|
|
4997
|
+
newPost: "创建了一个新的帖子:",
|
|
4998
|
+
mentionInComment: "在评论里提及了你",
|
|
4999
|
+
mentionInPost: "在帖子里提及了你",
|
|
5000
|
+
replyYourComment: "回复了你的评论",
|
|
5001
|
+
replyComment: "回复了评论",
|
|
5002
|
+
deleteChannelTitle: "确认删除这个频道?",
|
|
5003
|
+
deleteChannelDesc: "如果你要删除这个频道, 所有频道的消息都会立刻消除。",
|
|
5004
|
+
leaveChannel: "离开频道",
|
|
5005
|
+
joinChannel: "加入频道",
|
|
5006
|
+
openTask: "创建了一个任务",
|
|
5007
|
+
closeTask: "关闭了一个任务",
|
|
5008
|
+
assignTask: "分配给你一个任务",
|
|
5009
|
+
unassignTask: "取消给你分配的一个任务",
|
|
5010
|
+
points: "分",
|
|
5011
|
+
point: "分",
|
|
5012
|
+
pointUp: "🎉 您获得了 {points} {unit} {event}"
|
|
4720
5013
|
}
|
|
4721
5014
|
};
|
|
4722
5015
|
const translations = { zh, en };
|
|
@@ -10573,6 +10866,50 @@ var __publicField = (obj, key, value) => {
|
|
|
10573
10866
|
display: none; /* Chrome, Safari and Opera */
|
|
10574
10867
|
}
|
|
10575
10868
|
`;
|
|
10869
|
+
function SegmentedControl({ value, options, onChange, sx, ...rest }) {
|
|
10870
|
+
const mergedSx = mergeSx(
|
|
10871
|
+
{
|
|
10872
|
+
display: "inline-flex",
|
|
10873
|
+
borderRadius: "100vh",
|
|
10874
|
+
bgcolor: "grey.100"
|
|
10875
|
+
},
|
|
10876
|
+
sx
|
|
10877
|
+
);
|
|
10878
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Paper, { elevation: 0, sx: mergedSx, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10879
|
+
material.ToggleButtonGroup,
|
|
10880
|
+
{
|
|
10881
|
+
size: "small",
|
|
10882
|
+
value,
|
|
10883
|
+
exclusive: true,
|
|
10884
|
+
onChange: (_, v2) => onChange == null ? void 0 : onChange(v2),
|
|
10885
|
+
sx: {
|
|
10886
|
+
".MuiToggleButtonGroup-grouped": {
|
|
10887
|
+
m: 0.5,
|
|
10888
|
+
px: 1.5,
|
|
10889
|
+
border: 0,
|
|
10890
|
+
borderRadius: "100vh",
|
|
10891
|
+
lineHeight: 1.3,
|
|
10892
|
+
textTransform: "none"
|
|
10893
|
+
},
|
|
10894
|
+
".MuiToggleButtonGroup-grouped.Mui-selected": {
|
|
10895
|
+
bgcolor: "#fff",
|
|
10896
|
+
border: 1,
|
|
10897
|
+
borderColor: "divider",
|
|
10898
|
+
":hover": {
|
|
10899
|
+
bgcolor: "grey.50"
|
|
10900
|
+
}
|
|
10901
|
+
},
|
|
10902
|
+
".MuiToggleButtonGroup-middleButton, .MuiToggleButtonGroup-lastButton": {
|
|
10903
|
+
marginLeft: "-1px",
|
|
10904
|
+
borderLeft: "1px solid transparent"
|
|
10905
|
+
}
|
|
10906
|
+
},
|
|
10907
|
+
children: options.map((x) => {
|
|
10908
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.ToggleButton, { value: x.value, children: x.label }, x.value);
|
|
10909
|
+
})
|
|
10910
|
+
}
|
|
10911
|
+
) });
|
|
10912
|
+
}
|
|
10576
10913
|
const BlockletEditor = react.lazy(() => import("@blocklet/editor"));
|
|
10577
10914
|
const Root = material.styled(material.Box)`
|
|
10578
10915
|
.be-editable,
|
|
@@ -10616,6 +10953,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10616
10953
|
exports2.BlogList = BlogListWrapper;
|
|
10617
10954
|
exports2.BlogPermaLink = BlogPermaLink;
|
|
10618
10955
|
exports2.ButtonGroup = ButtonGroup;
|
|
10956
|
+
exports2.ChannelGroup = ChannelGroup;
|
|
10619
10957
|
exports2.Chat = Chat;
|
|
10620
10958
|
exports2.ChatClient = ChatClient;
|
|
10621
10959
|
exports2.ChatHeaderAddon = ChatHeaderAddon;
|
|
@@ -10648,6 +10986,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10648
10986
|
exports2.RelativeTime = RelativeTime;
|
|
10649
10987
|
exports2.ScrollableEditorWrapper = ScrollableEditorWrapper;
|
|
10650
10988
|
exports2.SecureLabelPicker = SecureLabelPicker;
|
|
10989
|
+
exports2.SegmentedControl = SegmentedControl;
|
|
10651
10990
|
exports2.SystemUser = SystemUser;
|
|
10652
10991
|
exports2.UnreadNotificationContext = UnreadNotificationContext;
|
|
10653
10992
|
exports2.UnreadNotificationProvider = UnreadNotificationProvider;
|