@blocklet/discuss-kit-ux 1.6.186 → 1.6.187

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-p8mA3-D0.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-q1fCyaqz.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -3890,6 +3890,7 @@ function Message({ message, prevMessage, showTime = true, ...rest }) {
3890
3890
  !compactMessage && /* @__PURE__ */ jsx(
3891
3891
  AuthorInfo,
3892
3892
  {
3893
+ showBadge: false,
3893
3894
  showProfileCard: true,
3894
3895
  user: message.sender,
3895
3896
  createdAt: showTime ? message.createdAt : void 0,
@@ -4229,20 +4230,47 @@ function MessageList({ chat, ...rest }) {
4229
4230
  },
4230
4231
  ref: containerRef,
4231
4232
  children: [
4232
- chat.nextCursor && /* @__PURE__ */ jsx(Box, { id: "next-cursor", sx: { display: "flex", justifyContent: "center", py: 0.5 }, children: /* @__PURE__ */ jsx(
4233
- Button,
4233
+ chat.nextCursor && /* @__PURE__ */ jsx(
4234
+ Box,
4234
4235
  {
4235
- variant: "text",
4236
- color: "inherit",
4237
- onClick: async () => {
4238
- var _a3;
4239
- (_a3 = document.getElementById("next-cursor")) == null ? void 0 : _a3.scrollIntoView();
4240
- await loadMessages(chat.id, chat.nextCursor);
4236
+ id: "next-cursor",
4237
+ sx: {
4238
+ display: "flex",
4239
+ justifyContent: "center",
4240
+ py: 0.5,
4241
+ // 闪烁
4242
+ "@keyframes fade-in": {
4243
+ "0%": { opacity: 0 },
4244
+ "50%": { opacity: 1 },
4245
+ "100%": { opacity: 0 }
4246
+ }
4241
4247
  },
4242
- startIcon: /* @__PURE__ */ jsx(ArrowUpward, {}),
4243
- children: t("chat.loadMore")
4248
+ children: /* @__PURE__ */ jsx(
4249
+ Button,
4250
+ {
4251
+ variant: "text",
4252
+ color: "inherit",
4253
+ onClick: async () => {
4254
+ await loadMessages(chat.id, chat.nextCursor);
4255
+ setTimeout(() => {
4256
+ var _a3, _b3;
4257
+ const divider = document.createElement("div");
4258
+ divider.style.animation = "fade-in 1s linear";
4259
+ divider.style.animationIterationCount = "5";
4260
+ divider.style.borderTop = "1px solid #e5e5e5";
4261
+ divider.style.opacity = "0";
4262
+ divider.style.height = "0";
4263
+ const insertBeforeElement = document.getElementById(chat.nextCursor);
4264
+ (_a3 = insertBeforeElement == null ? void 0 : insertBeforeElement.parentElement) == null ? void 0 : _a3.insertBefore(divider, insertBeforeElement);
4265
+ (_b3 = containerRef.current) == null ? void 0 : _b3.scrollTo({ top: divider.offsetTop - 140, behavior: "smooth" });
4266
+ }, 100);
4267
+ },
4268
+ startIcon: /* @__PURE__ */ jsx(ArrowUpward, {}),
4269
+ children: t("chat.loadMore")
4270
+ }
4271
+ )
4244
4272
  }
4245
- ) }),
4273
+ ),
4246
4274
  chat.type !== "notification" && ((_a2 = chat.messages) == null ? void 0 : _a2.map((message, index) => {
4247
4275
  var _a3;
4248
4276
  const prev = (_a3 = chat.messages) == null ? void 0 : _a3[index - 1];
@@ -5065,7 +5093,7 @@ function Pagination({
5065
5093
  }
5066
5094
  );
5067
5095
  }
5068
- const Editor = lazy(() => import("./editor-HUTb7nXS.mjs"));
5096
+ const Editor = lazy(() => import("./editor-1S0suIcX.mjs"));
5069
5097
  function LazyEditor(props) {
5070
5098
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
5071
5099
  /* @__PURE__ */ jsx(Skeleton, {}),
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, al, k, Z, $, ad, ag, af, ah, am, J, an, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, ao, _, ae, d } from "./index-p8mA3-D0.mjs";
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, al, k, Z, $, ad, ag, af, ah, am, J, an, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, ao, _, ae, d } from "./index-q1fCyaqz.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -3823,6 +3823,7 @@ var __publicField = (obj, key, value) => {
3823
3823
  !compactMessage && /* @__PURE__ */ jsxRuntime.jsx(
3824
3824
  AuthorInfo,
3825
3825
  {
3826
+ showBadge: false,
3826
3827
  showProfileCard: true,
3827
3828
  user: message.sender,
3828
3829
  createdAt: showTime ? message.createdAt : void 0,
@@ -4162,20 +4163,47 @@ var __publicField = (obj, key, value) => {
4162
4163
  },
4163
4164
  ref: containerRef,
4164
4165
  children: [
4165
- chat.nextCursor && /* @__PURE__ */ jsxRuntime.jsx(Box, { id: "next-cursor", sx: { display: "flex", justifyContent: "center", py: 0.5 }, children: /* @__PURE__ */ jsxRuntime.jsx(
4166
- Button,
4166
+ chat.nextCursor && /* @__PURE__ */ jsxRuntime.jsx(
4167
+ Box,
4167
4168
  {
4168
- variant: "text",
4169
- color: "inherit",
4170
- onClick: async () => {
4171
- var _a3;
4172
- (_a3 = document.getElementById("next-cursor")) == null ? void 0 : _a3.scrollIntoView();
4173
- await loadMessages(chat.id, chat.nextCursor);
4169
+ id: "next-cursor",
4170
+ sx: {
4171
+ display: "flex",
4172
+ justifyContent: "center",
4173
+ py: 0.5,
4174
+ // 闪烁
4175
+ "@keyframes fade-in": {
4176
+ "0%": { opacity: 0 },
4177
+ "50%": { opacity: 1 },
4178
+ "100%": { opacity: 0 }
4179
+ }
4174
4180
  },
4175
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ArrowUpward, {}),
4176
- children: t("chat.loadMore")
4181
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4182
+ Button,
4183
+ {
4184
+ variant: "text",
4185
+ color: "inherit",
4186
+ onClick: async () => {
4187
+ await loadMessages(chat.id, chat.nextCursor);
4188
+ setTimeout(() => {
4189
+ var _a3, _b3;
4190
+ const divider = document.createElement("div");
4191
+ divider.style.animation = "fade-in 1s linear";
4192
+ divider.style.animationIterationCount = "5";
4193
+ divider.style.borderTop = "1px solid #e5e5e5";
4194
+ divider.style.opacity = "0";
4195
+ divider.style.height = "0";
4196
+ const insertBeforeElement = document.getElementById(chat.nextCursor);
4197
+ (_a3 = insertBeforeElement == null ? void 0 : insertBeforeElement.parentElement) == null ? void 0 : _a3.insertBefore(divider, insertBeforeElement);
4198
+ (_b3 = containerRef.current) == null ? void 0 : _b3.scrollTo({ top: divider.offsetTop - 140, behavior: "smooth" });
4199
+ }, 100);
4200
+ },
4201
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ArrowUpward, {}),
4202
+ children: t("chat.loadMore")
4203
+ }
4204
+ )
4177
4205
  }
4178
- ) }),
4206
+ ),
4179
4207
  chat.type !== "notification" && ((_a2 = chat.messages) == null ? void 0 : _a2.map((message, index) => {
4180
4208
  var _a3;
4181
4209
  const prev = (_a3 = chat.messages) == null ? void 0 : _a3[index - 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.186",
3
+ "version": "1.6.187",
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.186",
33
- "@blocklet/labels": "1.6.186",
32
+ "@blocklet/editor": "1.6.187",
33
+ "@blocklet/labels": "1.6.187",
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": "e69b93c8f16dabea9ed1e866780815936250b052"
97
+ "gitHead": "ef33879af45606451039ad019ceed367851d4731"
98
98
  }