@blocklet/discuss-kit-ux 1.6.189 → 1.6.191
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.
|
@@ -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-OmtAwPz3.mjs";
|
|
8
8
|
import "@blocklet/labels";
|
|
9
9
|
import "@mui/material/styles";
|
|
10
10
|
import "@mui/material/Box";
|
|
@@ -518,7 +518,7 @@ const Input = ({
|
|
|
518
518
|
...editorConfig,
|
|
519
519
|
...inSmallView && {
|
|
520
520
|
toolbar: {
|
|
521
|
-
items: ["block", "italic", "bold", "underline", "media", ...((_a2 = editorConfig == null ? void 0 : editorConfig.toolbar) == null ? void 0 : _a2.items) || []]
|
|
521
|
+
items: ["component", "block", "italic", "bold", "underline", "media", ...((_a2 = editorConfig == null ? void 0 : editorConfig.toolbar) == null ? void 0 : _a2.items) || []]
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
};
|
|
@@ -1089,7 +1089,16 @@ function ProfileCard({ user, click, ...rest }) {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
);
|
|
1091
1091
|
}
|
|
1092
|
-
const HtmlTooltip$1 = styled(({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
1092
|
+
const HtmlTooltip$1 = styled(({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
1093
|
+
Tooltip,
|
|
1094
|
+
{
|
|
1095
|
+
PopperProps: {
|
|
1096
|
+
disablePortal: true
|
|
1097
|
+
},
|
|
1098
|
+
...props,
|
|
1099
|
+
classes: { popper: className }
|
|
1100
|
+
}
|
|
1101
|
+
))(() => ({
|
|
1093
1102
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
1094
1103
|
backgroundColor: "transparent",
|
|
1095
1104
|
maxWidth: "initial"
|
|
@@ -1191,10 +1200,11 @@ function AuthorInfo({
|
|
|
1191
1200
|
);
|
|
1192
1201
|
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize }, ...rest, children: [
|
|
1193
1202
|
renderAvatar(),
|
|
1194
|
-
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
1203
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1 }, children: [
|
|
1195
1204
|
/* @__PURE__ */ jsxs(
|
|
1196
1205
|
Box,
|
|
1197
1206
|
{
|
|
1207
|
+
className: "author-info-title",
|
|
1198
1208
|
sx: { display: "flex", alignItems: "center", minHeight: 20, flexWrap: "wrap", lineHeight: 1.5 },
|
|
1199
1209
|
lineHeight: 1,
|
|
1200
1210
|
children: [
|
|
@@ -3873,6 +3883,9 @@ function Message({ message, prevMessage, showTime = true, ...rest }) {
|
|
|
3873
3883
|
}
|
|
3874
3884
|
}
|
|
3875
3885
|
};
|
|
3886
|
+
const renderPostContent = () => {
|
|
3887
|
+
return /* @__PURE__ */ jsx(Box, { className: "author-chat-item", children: /* @__PURE__ */ jsx(PostContent, { content: message.content }) });
|
|
3888
|
+
};
|
|
3876
3889
|
const menuItems = [];
|
|
3877
3890
|
const isSender = message.sender.did === ((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.did);
|
|
3878
3891
|
const messageDate = new Date(message.createdAt);
|
|
@@ -3900,10 +3913,18 @@ function Message({ message, prevMessage, showTime = true, ...rest }) {
|
|
|
3900
3913
|
display: "flex !important"
|
|
3901
3914
|
}
|
|
3902
3915
|
},
|
|
3916
|
+
".author-info-title": {
|
|
3917
|
+
fontSize: 14,
|
|
3918
|
+
fontWeight: 500
|
|
3919
|
+
},
|
|
3920
|
+
".author-chat-item": {
|
|
3921
|
+
ml: compactMessage ? 6 : 0,
|
|
3922
|
+
width: "90%"
|
|
3923
|
+
},
|
|
3903
3924
|
...{
|
|
3904
3925
|
".be-editable": {
|
|
3905
3926
|
"& > *:last-child": {
|
|
3906
|
-
|
|
3927
|
+
mb: "0 !important"
|
|
3907
3928
|
}
|
|
3908
3929
|
}
|
|
3909
3930
|
}
|
|
@@ -3924,17 +3945,21 @@ function Message({ message, prevMessage, showTime = true, ...rest }) {
|
|
|
3924
3945
|
}
|
|
3925
3946
|
}
|
|
3926
3947
|
),
|
|
3927
|
-
!compactMessage
|
|
3948
|
+
!compactMessage ? /* @__PURE__ */ jsx(
|
|
3928
3949
|
AuthorInfo,
|
|
3929
3950
|
{
|
|
3930
3951
|
showBadge: false,
|
|
3931
3952
|
showProfileCard: true,
|
|
3953
|
+
showDID: false,
|
|
3932
3954
|
user: message.sender,
|
|
3933
3955
|
createdAt: showTime ? message.createdAt : void 0,
|
|
3934
|
-
size: "sm"
|
|
3956
|
+
size: "sm",
|
|
3957
|
+
style: {
|
|
3958
|
+
alignItems: "flex-start"
|
|
3959
|
+
},
|
|
3960
|
+
children: renderPostContent()
|
|
3935
3961
|
}
|
|
3936
|
-
)
|
|
3937
|
-
/* @__PURE__ */ jsx(Box, { sx: { ml: 6, width: "90%" }, children: /* @__PURE__ */ jsx(PostContent, { content: message.content }) })
|
|
3962
|
+
) : renderPostContent()
|
|
3938
3963
|
]
|
|
3939
3964
|
}
|
|
3940
3965
|
);
|
|
@@ -4226,6 +4251,7 @@ function MessageList({ chat, ...rest }) {
|
|
|
4226
4251
|
const isActive = isActiveChat(chat.id);
|
|
4227
4252
|
const containerRef = useRef(null);
|
|
4228
4253
|
const [isAtBottom, setIsAtBottom] = useState(true);
|
|
4254
|
+
const [isLoadingMore, setIsLoadingMore] = useState(false);
|
|
4229
4255
|
const scrollToBottom = () => {
|
|
4230
4256
|
var _a3, _b3;
|
|
4231
4257
|
(_b3 = containerRef.current) == null ? void 0 : _b3.scrollTo({ top: ((_a3 = containerRef.current) == null ? void 0 : _a3.scrollHeight) || 0, behavior: "smooth" });
|
|
@@ -4263,7 +4289,23 @@ function MessageList({ chat, ...rest }) {
|
|
|
4263
4289
|
py: 2.5,
|
|
4264
4290
|
px: 1.25,
|
|
4265
4291
|
gap: 1,
|
|
4266
|
-
background: "rgba(249, 250, 251, 1)"
|
|
4292
|
+
background: "rgba(249, 250, 251, 1)",
|
|
4293
|
+
// 闪烁
|
|
4294
|
+
"@keyframes blinking": {
|
|
4295
|
+
"0%": { opacity: 0 },
|
|
4296
|
+
"50%": { opacity: 1 },
|
|
4297
|
+
"100%": { opacity: 0 }
|
|
4298
|
+
},
|
|
4299
|
+
// 渐变显示
|
|
4300
|
+
"@keyframes fade-in": {
|
|
4301
|
+
"0%": { opacity: 0 },
|
|
4302
|
+
"100%": { opacity: 1 }
|
|
4303
|
+
},
|
|
4304
|
+
// 用于弱化消息渲染闪烁
|
|
4305
|
+
".message-item": {
|
|
4306
|
+
animation: "fade-in 0.2s linear",
|
|
4307
|
+
animationIterationCount: 1
|
|
4308
|
+
}
|
|
4267
4309
|
},
|
|
4268
4310
|
ref: containerRef,
|
|
4269
4311
|
children: [
|
|
@@ -4275,32 +4317,37 @@ function MessageList({ chat, ...rest }) {
|
|
|
4275
4317
|
display: "flex",
|
|
4276
4318
|
justifyContent: "center",
|
|
4277
4319
|
py: 0.5,
|
|
4278
|
-
|
|
4279
|
-
"@keyframes fade-in": {
|
|
4280
|
-
"0%": { opacity: 0 },
|
|
4281
|
-
"50%": { opacity: 1 },
|
|
4282
|
-
"100%": { opacity: 0 }
|
|
4283
|
-
}
|
|
4320
|
+
height: 40
|
|
4284
4321
|
},
|
|
4285
4322
|
children: /* @__PURE__ */ jsx(
|
|
4286
|
-
|
|
4323
|
+
LoadingButton,
|
|
4287
4324
|
{
|
|
4288
4325
|
variant: "text",
|
|
4289
4326
|
color: "inherit",
|
|
4327
|
+
loadingPosition: "start",
|
|
4328
|
+
loading: isLoadingMore,
|
|
4290
4329
|
onClick: async () => {
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4330
|
+
var _a3, _b3;
|
|
4331
|
+
try {
|
|
4332
|
+
setIsLoadingMore(true);
|
|
4333
|
+
const firstChatId = (_b3 = (_a3 = chat.messages) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.id;
|
|
4334
|
+
const firstChatMessage = document.getElementById(firstChatId);
|
|
4294
4335
|
const divider = document.createElement("div");
|
|
4295
|
-
divider.style.animation = "
|
|
4336
|
+
divider.style.animation = "blinking 1s linear";
|
|
4296
4337
|
divider.style.animationIterationCount = "5";
|
|
4297
4338
|
divider.style.borderTop = "1px solid #e5e5e5";
|
|
4298
4339
|
divider.style.opacity = "0";
|
|
4299
4340
|
divider.style.height = "0";
|
|
4300
|
-
|
|
4301
|
-
(
|
|
4302
|
-
|
|
4303
|
-
|
|
4341
|
+
await loadMessages(chat.id, chat.nextCursor);
|
|
4342
|
+
setTimeout(() => {
|
|
4343
|
+
var _a4, _b4;
|
|
4344
|
+
(_a4 = containerRef.current) == null ? void 0 : _a4.insertBefore(divider, firstChatMessage);
|
|
4345
|
+
(_b4 = containerRef.current) == null ? void 0 : _b4.scrollTo({ top: divider.offsetTop - 40 - 16 - 1 });
|
|
4346
|
+
}, 20);
|
|
4347
|
+
} catch (error) {
|
|
4348
|
+
} finally {
|
|
4349
|
+
setIsLoadingMore(false);
|
|
4350
|
+
}
|
|
4304
4351
|
},
|
|
4305
4352
|
startIcon: /* @__PURE__ */ jsx(ArrowUpward, {}),
|
|
4306
4353
|
children: t("chat.loadMore")
|
|
@@ -4311,12 +4358,12 @@ function MessageList({ chat, ...rest }) {
|
|
|
4311
4358
|
chat.type !== "notification" && ((_a2 = chat.messages) == null ? void 0 : _a2.map((message, index) => {
|
|
4312
4359
|
var _a3;
|
|
4313
4360
|
const prev = (_a3 = chat.messages) == null ? void 0 : _a3[index - 1];
|
|
4314
|
-
return /* @__PURE__ */ jsx(Box, { id: message.id, children: /* @__PURE__ */ jsx(Message, { message, prevMessage: prev }) }, message.id);
|
|
4361
|
+
return /* @__PURE__ */ jsx(Box, { className: "message-item", id: message.id, children: /* @__PURE__ */ jsx(Message, { message, prevMessage: prev }) }, message.id);
|
|
4315
4362
|
})),
|
|
4316
4363
|
chat.type === "notification" && ((_b2 = chat.messages) == null ? void 0 : _b2.map((message, index) => {
|
|
4317
4364
|
var _a3;
|
|
4318
4365
|
const prev = (_a3 = chat.messages) == null ? void 0 : _a3[index - 1];
|
|
4319
|
-
return /* @__PURE__ */ jsx(Box, { id: message.id, children: /* @__PURE__ */ jsx(
|
|
4366
|
+
return /* @__PURE__ */ jsx(Box, { className: "message-item", id: message.id, children: /* @__PURE__ */ jsx(
|
|
4320
4367
|
NotificationMessage,
|
|
4321
4368
|
{
|
|
4322
4369
|
chat,
|
|
@@ -5129,7 +5176,7 @@ function Pagination({
|
|
|
5129
5176
|
}
|
|
5130
5177
|
);
|
|
5131
5178
|
}
|
|
5132
|
-
const Editor = lazy(() => import("./editor-
|
|
5179
|
+
const Editor = lazy(() => import("./editor-E23ceKmd.mjs"));
|
|
5133
5180
|
function LazyEditor(props) {
|
|
5134
5181
|
const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5135
5182
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { O, k, T, A, j, a9, B, z, H, F, J, al, W, U, X, Z, q, C, v, w, y, a1, a2, ad, a4, L, N, D, ac, ab, E, G, b, h, aa, M, P, ak, o, n, a8, R, S, a5, am, m, _, a0, ae, ah, ag, ai, an, K, ao, l, p, r, f, t, a6, Q, c, Y, x, a3, a7, u, aj, d, ap, $, af, e } from "./index-
|
|
2
|
+
import { O, k, T, A, j, a9, B, z, H, F, J, al, W, U, X, Z, q, C, v, w, y, a1, a2, ad, a4, L, N, D, ac, ab, E, G, b, h, aa, M, P, ak, o, n, a8, R, S, a5, am, m, _, a0, ae, ah, ag, ai, an, K, ao, l, p, r, f, t, a6, Q, c, Y, x, a3, a7, u, aj, d, ap, $, af, e } from "./index-OmtAwPz3.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -451,7 +451,7 @@ var __publicField = (obj, key, value) => {
|
|
|
451
451
|
...editorConfig,
|
|
452
452
|
...inSmallView && {
|
|
453
453
|
toolbar: {
|
|
454
|
-
items: ["block", "italic", "bold", "underline", "media", ...((_a2 = editorConfig == null ? void 0 : editorConfig.toolbar) == null ? void 0 : _a2.items) || []]
|
|
454
|
+
items: ["component", "block", "italic", "bold", "underline", "media", ...((_a2 = editorConfig == null ? void 0 : editorConfig.toolbar) == null ? void 0 : _a2.items) || []]
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
};
|
|
@@ -1022,7 +1022,16 @@ var __publicField = (obj, key, value) => {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
);
|
|
1024
1024
|
}
|
|
1025
|
-
const HtmlTooltip$1 = styles.styled(({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1025
|
+
const HtmlTooltip$1 = styles.styled(({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1026
|
+
Tooltip,
|
|
1027
|
+
{
|
|
1028
|
+
PopperProps: {
|
|
1029
|
+
disablePortal: true
|
|
1030
|
+
},
|
|
1031
|
+
...props,
|
|
1032
|
+
classes: { popper: className }
|
|
1033
|
+
}
|
|
1034
|
+
))(() => ({
|
|
1026
1035
|
[`& .${Tooltip.tooltipClasses.tooltip}`]: {
|
|
1027
1036
|
backgroundColor: "transparent",
|
|
1028
1037
|
maxWidth: "initial"
|
|
@@ -1124,10 +1133,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1124
1133
|
);
|
|
1125
1134
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize }, ...rest, children: [
|
|
1126
1135
|
renderAvatar(),
|
|
1127
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
1136
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1 }, children: [
|
|
1128
1137
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1129
1138
|
Box,
|
|
1130
1139
|
{
|
|
1140
|
+
className: "author-info-title",
|
|
1131
1141
|
sx: { display: "flex", alignItems: "center", minHeight: 20, flexWrap: "wrap", lineHeight: 1.5 },
|
|
1132
1142
|
lineHeight: 1,
|
|
1133
1143
|
children: [
|
|
@@ -3806,6 +3816,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3806
3816
|
}
|
|
3807
3817
|
}
|
|
3808
3818
|
};
|
|
3819
|
+
const renderPostContent = () => {
|
|
3820
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "author-chat-item", children: /* @__PURE__ */ jsxRuntime.jsx(PostContent, { content: message.content }) });
|
|
3821
|
+
};
|
|
3809
3822
|
const menuItems = [];
|
|
3810
3823
|
const isSender = message.sender.did === ((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.did);
|
|
3811
3824
|
const messageDate = new Date(message.createdAt);
|
|
@@ -3833,10 +3846,18 @@ var __publicField = (obj, key, value) => {
|
|
|
3833
3846
|
display: "flex !important"
|
|
3834
3847
|
}
|
|
3835
3848
|
},
|
|
3849
|
+
".author-info-title": {
|
|
3850
|
+
fontSize: 14,
|
|
3851
|
+
fontWeight: 500
|
|
3852
|
+
},
|
|
3853
|
+
".author-chat-item": {
|
|
3854
|
+
ml: compactMessage ? 6 : 0,
|
|
3855
|
+
width: "90%"
|
|
3856
|
+
},
|
|
3836
3857
|
...{
|
|
3837
3858
|
".be-editable": {
|
|
3838
3859
|
"& > *:last-child": {
|
|
3839
|
-
|
|
3860
|
+
mb: "0 !important"
|
|
3840
3861
|
}
|
|
3841
3862
|
}
|
|
3842
3863
|
}
|
|
@@ -3857,17 +3878,21 @@ var __publicField = (obj, key, value) => {
|
|
|
3857
3878
|
}
|
|
3858
3879
|
}
|
|
3859
3880
|
),
|
|
3860
|
-
!compactMessage
|
|
3881
|
+
!compactMessage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3861
3882
|
AuthorInfo,
|
|
3862
3883
|
{
|
|
3863
3884
|
showBadge: false,
|
|
3864
3885
|
showProfileCard: true,
|
|
3886
|
+
showDID: false,
|
|
3865
3887
|
user: message.sender,
|
|
3866
3888
|
createdAt: showTime ? message.createdAt : void 0,
|
|
3867
|
-
size: "sm"
|
|
3889
|
+
size: "sm",
|
|
3890
|
+
style: {
|
|
3891
|
+
alignItems: "flex-start"
|
|
3892
|
+
},
|
|
3893
|
+
children: renderPostContent()
|
|
3868
3894
|
}
|
|
3869
|
-
)
|
|
3870
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { ml: 6, width: "90%" }, children: /* @__PURE__ */ jsxRuntime.jsx(PostContent, { content: message.content }) })
|
|
3895
|
+
) : renderPostContent()
|
|
3871
3896
|
]
|
|
3872
3897
|
}
|
|
3873
3898
|
);
|
|
@@ -4159,6 +4184,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4159
4184
|
const isActive = isActiveChat(chat.id);
|
|
4160
4185
|
const containerRef = react.useRef(null);
|
|
4161
4186
|
const [isAtBottom, setIsAtBottom] = react.useState(true);
|
|
4187
|
+
const [isLoadingMore, setIsLoadingMore] = react.useState(false);
|
|
4162
4188
|
const scrollToBottom = () => {
|
|
4163
4189
|
var _a3, _b3;
|
|
4164
4190
|
(_b3 = containerRef.current) == null ? void 0 : _b3.scrollTo({ top: ((_a3 = containerRef.current) == null ? void 0 : _a3.scrollHeight) || 0, behavior: "smooth" });
|
|
@@ -4196,7 +4222,23 @@ var __publicField = (obj, key, value) => {
|
|
|
4196
4222
|
py: 2.5,
|
|
4197
4223
|
px: 1.25,
|
|
4198
4224
|
gap: 1,
|
|
4199
|
-
background: "rgba(249, 250, 251, 1)"
|
|
4225
|
+
background: "rgba(249, 250, 251, 1)",
|
|
4226
|
+
// 闪烁
|
|
4227
|
+
"@keyframes blinking": {
|
|
4228
|
+
"0%": { opacity: 0 },
|
|
4229
|
+
"50%": { opacity: 1 },
|
|
4230
|
+
"100%": { opacity: 0 }
|
|
4231
|
+
},
|
|
4232
|
+
// 渐变显示
|
|
4233
|
+
"@keyframes fade-in": {
|
|
4234
|
+
"0%": { opacity: 0 },
|
|
4235
|
+
"100%": { opacity: 1 }
|
|
4236
|
+
},
|
|
4237
|
+
// 用于弱化消息渲染闪烁
|
|
4238
|
+
".message-item": {
|
|
4239
|
+
animation: "fade-in 0.2s linear",
|
|
4240
|
+
animationIterationCount: 1
|
|
4241
|
+
}
|
|
4200
4242
|
},
|
|
4201
4243
|
ref: containerRef,
|
|
4202
4244
|
children: [
|
|
@@ -4208,32 +4250,37 @@ var __publicField = (obj, key, value) => {
|
|
|
4208
4250
|
display: "flex",
|
|
4209
4251
|
justifyContent: "center",
|
|
4210
4252
|
py: 0.5,
|
|
4211
|
-
|
|
4212
|
-
"@keyframes fade-in": {
|
|
4213
|
-
"0%": { opacity: 0 },
|
|
4214
|
-
"50%": { opacity: 1 },
|
|
4215
|
-
"100%": { opacity: 0 }
|
|
4216
|
-
}
|
|
4253
|
+
height: 40
|
|
4217
4254
|
},
|
|
4218
4255
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4219
|
-
|
|
4256
|
+
LoadingButton,
|
|
4220
4257
|
{
|
|
4221
4258
|
variant: "text",
|
|
4222
4259
|
color: "inherit",
|
|
4260
|
+
loadingPosition: "start",
|
|
4261
|
+
loading: isLoadingMore,
|
|
4223
4262
|
onClick: async () => {
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4263
|
+
var _a3, _b3;
|
|
4264
|
+
try {
|
|
4265
|
+
setIsLoadingMore(true);
|
|
4266
|
+
const firstChatId = (_b3 = (_a3 = chat.messages) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.id;
|
|
4267
|
+
const firstChatMessage = document.getElementById(firstChatId);
|
|
4227
4268
|
const divider = document.createElement("div");
|
|
4228
|
-
divider.style.animation = "
|
|
4269
|
+
divider.style.animation = "blinking 1s linear";
|
|
4229
4270
|
divider.style.animationIterationCount = "5";
|
|
4230
4271
|
divider.style.borderTop = "1px solid #e5e5e5";
|
|
4231
4272
|
divider.style.opacity = "0";
|
|
4232
4273
|
divider.style.height = "0";
|
|
4233
|
-
|
|
4234
|
-
(
|
|
4235
|
-
|
|
4236
|
-
|
|
4274
|
+
await loadMessages(chat.id, chat.nextCursor);
|
|
4275
|
+
setTimeout(() => {
|
|
4276
|
+
var _a4, _b4;
|
|
4277
|
+
(_a4 = containerRef.current) == null ? void 0 : _a4.insertBefore(divider, firstChatMessage);
|
|
4278
|
+
(_b4 = containerRef.current) == null ? void 0 : _b4.scrollTo({ top: divider.offsetTop - 40 - 16 - 1 });
|
|
4279
|
+
}, 20);
|
|
4280
|
+
} catch (error) {
|
|
4281
|
+
} finally {
|
|
4282
|
+
setIsLoadingMore(false);
|
|
4283
|
+
}
|
|
4237
4284
|
},
|
|
4238
4285
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ArrowUpward, {}),
|
|
4239
4286
|
children: t("chat.loadMore")
|
|
@@ -4244,12 +4291,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4244
4291
|
chat.type !== "notification" && ((_a2 = chat.messages) == null ? void 0 : _a2.map((message, index) => {
|
|
4245
4292
|
var _a3;
|
|
4246
4293
|
const prev = (_a3 = chat.messages) == null ? void 0 : _a3[index - 1];
|
|
4247
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: message.id, children: /* @__PURE__ */ jsxRuntime.jsx(Message, { message, prevMessage: prev }) }, message.id);
|
|
4294
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "message-item", id: message.id, children: /* @__PURE__ */ jsxRuntime.jsx(Message, { message, prevMessage: prev }) }, message.id);
|
|
4248
4295
|
})),
|
|
4249
4296
|
chat.type === "notification" && ((_b2 = chat.messages) == null ? void 0 : _b2.map((message, index) => {
|
|
4250
4297
|
var _a3;
|
|
4251
4298
|
const prev = (_a3 = chat.messages) == null ? void 0 : _a3[index - 1];
|
|
4252
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: message.id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4299
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "message-item", id: message.id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4253
4300
|
NotificationMessage,
|
|
4254
4301
|
{
|
|
4255
4302
|
chat,
|
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.191",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/ws": "^1.18.113",
|
|
32
|
-
"@blocklet/editor": "1.6.
|
|
33
|
-
"@blocklet/labels": "1.6.
|
|
32
|
+
"@blocklet/editor": "1.6.191",
|
|
33
|
+
"@blocklet/labels": "1.6.191",
|
|
34
34
|
"@blocklet/uploader": "^0.0.75",
|
|
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": "e0bfe0bdc7ce8d39f4f3684f7170075025bbcb0a"
|
|
98
98
|
}
|