@blocklet/discuss-kit 1.5.30 → 1.5.32

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.
@@ -182,7 +182,12 @@ function DiscussKitComments({
182
182
  (_a = handlers[event]) == null ? void 0 : _a.call(handlers, data);
183
183
  }, [object.id, state]);
184
184
  if (!initialized) {
185
- return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress__default.default, {});
185
+ return /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, {
186
+ width: "100%",
187
+ display: "flex",
188
+ justifyContent: "center",
189
+ children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgress__default.default, {})
190
+ });
186
191
  }
187
192
  const sendComment = async (content) => {
188
193
  const {
@@ -214,6 +219,7 @@ function DiscussKitComments({
214
219
  await api__default.default.delete(`/topics/${object.id}/ratings`);
215
220
  };
216
221
  return /* @__PURE__ */ jsxRuntime.jsxs(Container, {
222
+ className: "comment-container",
217
223
  children: [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
218
224
  children: [/* @__PURE__ */ jsxRuntime.jsxs(Box__default.default, {
219
225
  display: "flex",
@@ -258,6 +264,7 @@ function DiscussKitComments({
258
264
  })
259
265
  }), session.user && commentInputPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, {
260
266
  mt: 2,
267
+ className: "comment-editor",
261
268
  children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentInput, {
262
269
  send: sendComment,
263
270
  draftKey: `object-${object.id}`,
@@ -276,16 +283,20 @@ function DiscussKitComments({
276
283
  color: order !== "desc" ? "primary" : "inherit",
277
284
  size: "small",
278
285
  onClick: () => sort("asc"),
286
+ className: order !== "desc" ? "" : "unselected-button",
279
287
  children: t("oldest")
280
288
  }), /* @__PURE__ */ jsxRuntime.jsx(Button__default.default, {
281
289
  variant: "contained",
282
290
  color: order === "desc" ? "primary" : "inherit",
283
291
  size: "small",
284
292
  onClick: () => sort("desc"),
293
+ className: order === "desc" ? "" : "unselected-button",
285
294
  children: t("newest")
286
295
  })]
287
296
  })]
288
- }), /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentList, {}), session.user && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, {
297
+ }), /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentList, {
298
+ className: "comment-list"
299
+ }), session.user && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, {
289
300
  mt: 6,
290
301
  children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentInput, {
291
302
  send: sendComment,
@@ -169,7 +169,12 @@ function DiscussKitComments({
169
169
  (_a = handlers[event]) == null ? void 0 : _a.call(handlers, data);
170
170
  }, [object.id, state]);
171
171
  if (!initialized) {
172
- return /* @__PURE__ */ jsx(CircularProgress, {});
172
+ return /* @__PURE__ */ jsx(Box, {
173
+ width: "100%",
174
+ display: "flex",
175
+ justifyContent: "center",
176
+ children: /* @__PURE__ */ jsx(CircularProgress, {})
177
+ });
173
178
  }
174
179
  const sendComment = async (content) => {
175
180
  const {
@@ -201,6 +206,7 @@ function DiscussKitComments({
201
206
  await api.delete(`/topics/${object.id}/ratings`);
202
207
  };
203
208
  return /* @__PURE__ */ jsxs(Container, {
209
+ className: "comment-container",
204
210
  children: [/* @__PURE__ */ jsxs(Fragment, {
205
211
  children: [/* @__PURE__ */ jsxs(Box, {
206
212
  display: "flex",
@@ -245,6 +251,7 @@ function DiscussKitComments({
245
251
  })
246
252
  }), session.user && commentInputPosition === "top" && /* @__PURE__ */ jsx(Box, {
247
253
  mt: 2,
254
+ className: "comment-editor",
248
255
  children: /* @__PURE__ */ jsx(CommentInput, {
249
256
  send: sendComment,
250
257
  draftKey: `object-${object.id}`,
@@ -263,16 +270,20 @@ function DiscussKitComments({
263
270
  color: order !== "desc" ? "primary" : "inherit",
264
271
  size: "small",
265
272
  onClick: () => sort("asc"),
273
+ className: order !== "desc" ? "" : "unselected-button",
266
274
  children: t("oldest")
267
275
  }), /* @__PURE__ */ jsx(Button, {
268
276
  variant: "contained",
269
277
  color: order === "desc" ? "primary" : "inherit",
270
278
  size: "small",
271
279
  onClick: () => sort("desc"),
280
+ className: order === "desc" ? "" : "unselected-button",
272
281
  children: t("newest")
273
282
  })]
274
283
  })]
275
- }), /* @__PURE__ */ jsx(CommentList, {}), session.user && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, {
284
+ }), /* @__PURE__ */ jsx(CommentList, {
285
+ className: "comment-list"
286
+ }), session.user && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, {
276
287
  mt: 6,
277
288
  children: /* @__PURE__ */ jsx(CommentInput, {
278
289
  send: sendComment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "1.5.30",
3
+ "version": "1.5.32",
4
4
  "description": "A react component for Discuss Kit blocklet.",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/es/index.js",
@@ -37,8 +37,8 @@
37
37
  "@arcblock/did-connect": "^2.7.6",
38
38
  "@arcblock/ux": "^2.7.6",
39
39
  "@arcblock/ws": "^1.18.89",
40
- "@blocklet/discuss-kit-ux": "1.5.30",
41
- "@blocklet/editor": "1.5.30",
40
+ "@blocklet/discuss-kit-ux": "1.5.32",
41
+ "@blocklet/editor": "1.5.32",
42
42
  "@emotion/react": "^11.10.5",
43
43
  "@emotion/styled": "^11.10.5",
44
44
  "@mui/icons-material": "^5.10.9",
@@ -77,5 +77,5 @@
77
77
  "vite-plugin-build": "^0.7.1",
78
78
  "vite-plugin-svgr": "^2.2.2"
79
79
  },
80
- "gitHead": "3c53b3435ad8916e0781c8274f99babf46dbb2dc"
80
+ "gitHead": "054e1277c3587a95dca1093345e18e3e5662b291"
81
81
  }