@blocklet/discuss-kit 1.4.1 → 1.4.3

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.
@@ -133,7 +133,8 @@ const commentAPI = {
133
133
  }
134
134
  };
135
135
  function DiscussKitComments({
136
- showConnectBtn,
136
+ displayConnectButton,
137
+ displayReaction,
137
138
  object,
138
139
  onChange,
139
140
  commentInputPosition,
@@ -218,7 +219,7 @@ function DiscussKitComments({
218
219
  display: "flex",
219
220
  justifyContent: "space-between",
220
221
  alignItems: "center",
221
- children: [/* @__PURE__ */ jsxRuntime.jsx(Box__default.default, {
222
+ children: [displayReaction && /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, {
222
223
  mb: 1,
223
224
  children: objectRatingState.value && /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.BinaryThumb, {
224
225
  selectedValue: objectRatingState.value.myRating,
@@ -229,7 +230,7 @@ function DiscussKitComments({
229
230
  size: "lg",
230
231
  fetchRatings: () => commentAPI.fetchRatings(object.id)
231
232
  })
232
- }), showConnectBtn && (session.user ? /* @__PURE__ */ jsxRuntime.jsx(SessionManager__default.default, {
233
+ }), displayConnectButton && (session.user ? /* @__PURE__ */ jsxRuntime.jsx(SessionManager__default.default, {
233
234
  style: {
234
235
  padding: 0
235
236
  },
@@ -242,14 +243,8 @@ function DiscussKitComments({
242
243
  color: "primary",
243
244
  onClick: () => session.login(),
244
245
  children: t("connect")
245
- })), !showConnectBtn && !session.user && /* @__PURE__ */ jsxRuntime.jsx(Button__default.default, {
246
- size: "medium",
247
- variant: "contained",
248
- color: "primary",
249
- onClick: () => session.login(),
250
- children: t("connect")
251
- })]
252
- }), !session.user && /* @__PURE__ */ jsxRuntime.jsx("div", {
246
+ }))]
247
+ }), displayConnectButton && !session.user && /* @__PURE__ */ jsxRuntime.jsx("div", {
253
248
  className: "input-no-connect",
254
249
  children: /* @__PURE__ */ jsxRuntime.jsxs("span", {
255
250
  className: "connect-tip",
@@ -301,14 +296,16 @@ function DiscussKitComments({
301
296
  });
302
297
  }
303
298
  DiscussKitComments.propTypes = {
304
- showConnectBtn: PropTypes__default.default.bool,
299
+ displayConnectButton: PropTypes__default.default.bool,
300
+ displayReaction: PropTypes__default.default.bool,
305
301
  object: PropTypes__default.default.object.isRequired,
306
302
  onChange: PropTypes__default.default.func,
307
303
  commentInputPosition: PropTypes__default.default.oneOf(["top", "bottom"]),
308
304
  showTopbar: PropTypes__default.default.bool
309
305
  };
310
306
  DiscussKitComments.defaultProps = {
311
- showConnectBtn: false,
307
+ displayConnectButton: false,
308
+ displayReaction: true,
312
309
  onChange: () => {
313
310
  },
314
311
  commentInputPosition: "top",
@@ -387,7 +384,8 @@ Wrapper.propTypes = {
387
384
  desc: PropTypes__default.default.string,
388
385
  owner: PropTypes__default.default.string
389
386
  }).isRequired,
390
- showConnectBtn: PropTypes__default.default.bool,
387
+ displayConnectButton: PropTypes__default.default.bool,
388
+ displayReaction: PropTypes__default.default.bool,
391
389
  onChange: PropTypes__default.default.func,
392
390
  prefix: PropTypes__default.default.string,
393
391
  flatView: PropTypes__default.default.bool,
@@ -395,7 +393,8 @@ Wrapper.propTypes = {
395
393
  order: PropTypes__default.default.oneOf(["asc", "desc"])
396
394
  };
397
395
  Wrapper.defaultProps = {
398
- showConnectBtn: false,
396
+ displayConnectButton: false,
397
+ displayReaction: true,
399
398
  onChange: () => {
400
399
  },
401
400
  prefix: "",
@@ -120,7 +120,8 @@ const commentAPI = {
120
120
  }
121
121
  };
122
122
  function DiscussKitComments({
123
- showConnectBtn,
123
+ displayConnectButton,
124
+ displayReaction,
124
125
  object,
125
126
  onChange,
126
127
  commentInputPosition,
@@ -205,7 +206,7 @@ function DiscussKitComments({
205
206
  display: "flex",
206
207
  justifyContent: "space-between",
207
208
  alignItems: "center",
208
- children: [/* @__PURE__ */ jsx(Box, {
209
+ children: [displayReaction && /* @__PURE__ */ jsx(Box, {
209
210
  mb: 1,
210
211
  children: objectRatingState.value && /* @__PURE__ */ jsx(BinaryThumb, {
211
212
  selectedValue: objectRatingState.value.myRating,
@@ -216,7 +217,7 @@ function DiscussKitComments({
216
217
  size: "lg",
217
218
  fetchRatings: () => commentAPI.fetchRatings(object.id)
218
219
  })
219
- }), showConnectBtn && (session.user ? /* @__PURE__ */ jsx(SessionManager, {
220
+ }), displayConnectButton && (session.user ? /* @__PURE__ */ jsx(SessionManager, {
220
221
  style: {
221
222
  padding: 0
222
223
  },
@@ -229,14 +230,8 @@ function DiscussKitComments({
229
230
  color: "primary",
230
231
  onClick: () => session.login(),
231
232
  children: t("connect")
232
- })), !showConnectBtn && !session.user && /* @__PURE__ */ jsx(Button, {
233
- size: "medium",
234
- variant: "contained",
235
- color: "primary",
236
- onClick: () => session.login(),
237
- children: t("connect")
238
- })]
239
- }), !session.user && /* @__PURE__ */ jsx("div", {
233
+ }))]
234
+ }), displayConnectButton && !session.user && /* @__PURE__ */ jsx("div", {
240
235
  className: "input-no-connect",
241
236
  children: /* @__PURE__ */ jsxs("span", {
242
237
  className: "connect-tip",
@@ -288,14 +283,16 @@ function DiscussKitComments({
288
283
  });
289
284
  }
290
285
  DiscussKitComments.propTypes = {
291
- showConnectBtn: PropTypes.bool,
286
+ displayConnectButton: PropTypes.bool,
287
+ displayReaction: PropTypes.bool,
292
288
  object: PropTypes.object.isRequired,
293
289
  onChange: PropTypes.func,
294
290
  commentInputPosition: PropTypes.oneOf(["top", "bottom"]),
295
291
  showTopbar: PropTypes.bool
296
292
  };
297
293
  DiscussKitComments.defaultProps = {
298
- showConnectBtn: false,
294
+ displayConnectButton: false,
295
+ displayReaction: true,
299
296
  onChange: () => {
300
297
  },
301
298
  commentInputPosition: "top",
@@ -374,7 +371,8 @@ Wrapper.propTypes = {
374
371
  desc: PropTypes.string,
375
372
  owner: PropTypes.string
376
373
  }).isRequired,
377
- showConnectBtn: PropTypes.bool,
374
+ displayConnectButton: PropTypes.bool,
375
+ displayReaction: PropTypes.bool,
378
376
  onChange: PropTypes.func,
379
377
  prefix: PropTypes.string,
380
378
  flatView: PropTypes.bool,
@@ -382,7 +380,8 @@ Wrapper.propTypes = {
382
380
  order: PropTypes.oneOf(["asc", "desc"])
383
381
  };
384
382
  Wrapper.defaultProps = {
385
- showConnectBtn: false,
383
+ displayConnectButton: false,
384
+ displayReaction: true,
386
385
  onChange: () => {
387
386
  },
388
387
  prefix: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
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.5.48",
38
38
  "@arcblock/ux": "^2.5.48",
39
39
  "@arcblock/ws": "^1.18.80",
40
- "@blocklet/discuss-kit-ux": "1.4.1",
41
- "@blocklet/editor": "1.4.1",
40
+ "@blocklet/discuss-kit-ux": "1.4.3",
41
+ "@blocklet/editor": "1.4.3",
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": "6a7f5497cb0783def1bc4a70ea7548913f732e81"
80
+ "gitHead": "2afbc4ea6b82b7b4d1e4f8b68bedcc56440d1a5e"
81
81
  }