@blocklet/discuss-kit 1.5.209 → 1.5.211

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.
@@ -98,6 +98,8 @@ function DiscussKitComments({
98
98
  onChange,
99
99
  onSendComment,
100
100
  commentInputPosition,
101
+ allowEmptyContent,
102
+ initialContent,
101
103
  showTopbar
102
104
  }) {
103
105
  discussKitUx.useDefaultApiErrorHandler({ request: api });
@@ -180,7 +182,16 @@ function DiscussKitComments({
180
182
  " ",
181
183
  /* @__PURE__ */ jsxRuntime.jsx("a", { className: "down-load-wallet", href: "https://www.didwallet.io/", target: "_blank", rel: "noreferrer", children: t("installDIDWallet") })
182
184
  ] }) }),
183
- session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 2, className: "comment-editor", children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentInput, { send: sendComment, draftKey: `object-${object.id}`, autoFocus: false }) })
185
+ session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 2, className: "comment-editor", children: /* @__PURE__ */ jsxRuntime.jsx(
186
+ discussKitUx.CommentInput,
187
+ {
188
+ send: sendComment,
189
+ draftKey: `object-${object.id}`,
190
+ autoFocus: false,
191
+ allowEmptyContent,
192
+ initialContent
193
+ }
194
+ ) })
184
195
  ] }),
185
196
  !!total && showTopbar && /* @__PURE__ */ jsxRuntime.jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [
186
197
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
@@ -213,7 +224,16 @@ function DiscussKitComments({
213
224
  ] })
214
225
  ] }),
215
226
  /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentList, { className: "comment-list" }),
216
- session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 6, children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentInput, { send: sendComment, draftKey: `object-${object.id}`, autoFocus: false }) })
227
+ session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
228
+ discussKitUx.CommentInput,
229
+ {
230
+ send: sendComment,
231
+ draftKey: `object-${object.id}`,
232
+ autoFocus: false,
233
+ allowEmptyContent,
234
+ initialContent
235
+ }
236
+ ) })
217
237
  ] });
218
238
  }
219
239
  DiscussKitComments.propTypes = {
@@ -222,6 +242,8 @@ DiscussKitComments.propTypes = {
222
242
  object: PropTypes.object.isRequired,
223
243
  onChange: PropTypes.func,
224
244
  onSendComment: PropTypes.func,
245
+ allowEmptyContent: PropTypes.bool,
246
+ initialContent: PropTypes.string,
225
247
  commentInputPosition: PropTypes.oneOf(["top", "bottom"]),
226
248
  showTopbar: PropTypes.bool
227
249
  };
@@ -232,6 +254,8 @@ DiscussKitComments.defaultProps = {
232
254
  },
233
255
  onSendComment: () => {
234
256
  },
257
+ allowEmptyContent: false,
258
+ initialContent: "",
235
259
  commentInputPosition: "top",
236
260
  showTopbar: true
237
261
  };
@@ -240,6 +264,7 @@ function Wrapper({
240
264
  prefix,
241
265
  flatView,
242
266
  autoCollapse,
267
+ autoLoadComments,
243
268
  order,
244
269
  allowCopyLink,
245
270
  showProfileCard,
@@ -280,6 +305,7 @@ function Wrapper({
280
305
  flatView,
281
306
  order,
282
307
  autoCollapse,
308
+ autoLoadComments,
283
309
  allowCopyLink,
284
310
  showProfileCard,
285
311
  interactive,
@@ -300,7 +326,9 @@ Wrapper.propTypes = {
300
326
  prefix: PropTypes.string,
301
327
  flatView: PropTypes.bool,
302
328
  autoCollapse: PropTypes.bool,
329
+ autoLoadComments: PropTypes.bool,
303
330
  allowCopyLink: PropTypes.bool,
331
+ allowEmptyContent: PropTypes.bool,
304
332
  showProfileCard: PropTypes.bool,
305
333
  order: PropTypes.oneOf(["asc", "desc"]),
306
334
  interactive: PropTypes.bool
@@ -313,7 +341,9 @@ Wrapper.defaultProps = {
313
341
  prefix: "",
314
342
  flatView: false,
315
343
  autoCollapse: false,
344
+ autoLoadComments: true,
316
345
  allowCopyLink: false,
346
+ allowEmptyContent: false,
317
347
  showProfileCard: false,
318
348
  order: void 0,
319
349
  interactive: true
@@ -20,6 +20,7 @@ const en = flat({
20
20
  deleteCommentDesc: "Confirm delete this comment?",
21
21
  readMore: "Read More",
22
22
  showMoreReplies: "Show more replies",
23
- deleted: "This comment has been deleted"
23
+ deleted: "This comment has been deleted",
24
+ emptyContent: "No comment yet"
24
25
  });
25
26
  module.exports = en;
@@ -20,6 +20,7 @@ const zh = flat({
20
20
  deleteCommentDesc: "确认删除这条评论?",
21
21
  readMore: "更多内容",
22
22
  showMoreReplies: "显示更多回复",
23
- deleted: "该评论已被删除"
23
+ deleted: "该评论已被删除",
24
+ emptyContent: "暂无评论内容"
24
25
  });
25
26
  module.exports = zh;
@@ -97,6 +97,8 @@ function DiscussKitComments({
97
97
  onChange,
98
98
  onSendComment,
99
99
  commentInputPosition,
100
+ allowEmptyContent,
101
+ initialContent,
100
102
  showTopbar
101
103
  }) {
102
104
  useDefaultApiErrorHandler({ request: api });
@@ -179,7 +181,16 @@ function DiscussKitComments({
179
181
  " ",
180
182
  /* @__PURE__ */ jsx("a", { className: "down-load-wallet", href: "https://www.didwallet.io/", target: "_blank", rel: "noreferrer", children: t("installDIDWallet") })
181
183
  ] }) }),
182
- session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsx(Box, { mt: 2, className: "comment-editor", children: /* @__PURE__ */ jsx(CommentInput, { send: sendComment, draftKey: `object-${object.id}`, autoFocus: false }) })
184
+ session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsx(Box, { mt: 2, className: "comment-editor", children: /* @__PURE__ */ jsx(
185
+ CommentInput,
186
+ {
187
+ send: sendComment,
188
+ draftKey: `object-${object.id}`,
189
+ autoFocus: false,
190
+ allowEmptyContent,
191
+ initialContent
192
+ }
193
+ ) })
183
194
  ] }),
184
195
  !!total && showTopbar && /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [
185
196
  /* @__PURE__ */ jsxs("span", { children: [
@@ -212,7 +223,16 @@ function DiscussKitComments({
212
223
  ] })
213
224
  ] }),
214
225
  /* @__PURE__ */ jsx(CommentList, { className: "comment-list" }),
215
- session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, { mt: 6, children: /* @__PURE__ */ jsx(CommentInput, { send: sendComment, draftKey: `object-${object.id}`, autoFocus: false }) })
226
+ session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, { mt: 6, children: /* @__PURE__ */ jsx(
227
+ CommentInput,
228
+ {
229
+ send: sendComment,
230
+ draftKey: `object-${object.id}`,
231
+ autoFocus: false,
232
+ allowEmptyContent,
233
+ initialContent
234
+ }
235
+ ) })
216
236
  ] });
217
237
  }
218
238
  DiscussKitComments.propTypes = {
@@ -221,6 +241,8 @@ DiscussKitComments.propTypes = {
221
241
  object: PropTypes.object.isRequired,
222
242
  onChange: PropTypes.func,
223
243
  onSendComment: PropTypes.func,
244
+ allowEmptyContent: PropTypes.bool,
245
+ initialContent: PropTypes.string,
224
246
  commentInputPosition: PropTypes.oneOf(["top", "bottom"]),
225
247
  showTopbar: PropTypes.bool
226
248
  };
@@ -231,6 +253,8 @@ DiscussKitComments.defaultProps = {
231
253
  },
232
254
  onSendComment: () => {
233
255
  },
256
+ allowEmptyContent: false,
257
+ initialContent: "",
234
258
  commentInputPosition: "top",
235
259
  showTopbar: true
236
260
  };
@@ -239,6 +263,7 @@ function Wrapper({
239
263
  prefix,
240
264
  flatView,
241
265
  autoCollapse,
266
+ autoLoadComments,
242
267
  order,
243
268
  allowCopyLink,
244
269
  showProfileCard,
@@ -279,6 +304,7 @@ function Wrapper({
279
304
  flatView,
280
305
  order,
281
306
  autoCollapse,
307
+ autoLoadComments,
282
308
  allowCopyLink,
283
309
  showProfileCard,
284
310
  interactive,
@@ -299,7 +325,9 @@ Wrapper.propTypes = {
299
325
  prefix: PropTypes.string,
300
326
  flatView: PropTypes.bool,
301
327
  autoCollapse: PropTypes.bool,
328
+ autoLoadComments: PropTypes.bool,
302
329
  allowCopyLink: PropTypes.bool,
330
+ allowEmptyContent: PropTypes.bool,
303
331
  showProfileCard: PropTypes.bool,
304
332
  order: PropTypes.oneOf(["asc", "desc"]),
305
333
  interactive: PropTypes.bool
@@ -312,7 +340,9 @@ Wrapper.defaultProps = {
312
340
  prefix: "",
313
341
  flatView: false,
314
342
  autoCollapse: false,
343
+ autoLoadComments: true,
315
344
  allowCopyLink: false,
345
+ allowEmptyContent: false,
316
346
  showProfileCard: false,
317
347
  order: void 0,
318
348
  interactive: true
@@ -19,7 +19,8 @@ const en = flat({
19
19
  deleteCommentDesc: "Confirm delete this comment?",
20
20
  readMore: "Read More",
21
21
  showMoreReplies: "Show more replies",
22
- deleted: "This comment has been deleted"
22
+ deleted: "This comment has been deleted",
23
+ emptyContent: "No comment yet"
23
24
  });
24
25
  export {
25
26
  en as default
@@ -19,7 +19,8 @@ const zh = flat({
19
19
  deleteCommentDesc: "确认删除这条评论?",
20
20
  readMore: "更多内容",
21
21
  showMoreReplies: "显示更多回复",
22
- deleted: "该评论已被删除"
22
+ deleted: "该评论已被删除",
23
+ emptyContent: "暂无评论内容"
23
24
  });
24
25
  export {
25
26
  zh as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "1.5.209",
3
+ "version": "1.5.211",
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.8.21",
38
38
  "@arcblock/ux": "^2.8.21",
39
39
  "@arcblock/ws": "^1.18.103",
40
- "@blocklet/discuss-kit-ux": "1.5.209",
41
- "@blocklet/editor": "1.5.209",
40
+ "@blocklet/discuss-kit-ux": "1.5.211",
41
+ "@blocklet/editor": "1.5.211",
42
42
  "@emotion/react": "^11.10.5",
43
43
  "@emotion/styled": "^11.10.5",
44
44
  "@mui/icons-material": "^5.14.9",
@@ -76,5 +76,5 @@
76
76
  "vite-plugin-build": "^0.10.0",
77
77
  "vite-plugin-svgr": "^4.1.0"
78
78
  },
79
- "gitHead": "f7734c1cdb053fbe76610aac008ce9fe4853d82b"
79
+ "gitHead": "55c93cea56104840e3d697364c4a93a209989475"
80
80
  }