@blocklet/discuss-kit 2.3.87 → 2.3.89

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.
@@ -3,9 +3,7 @@ const jsxRuntime = require("react/jsx-runtime");
3
3
  const react = require("react");
4
4
  const Theme = require("@arcblock/ux/lib/Theme");
5
5
  const PropTypes = require("prop-types");
6
- const SessionManager = require("@arcblock/did-connect/lib/SessionManager");
7
6
  const Session = require("@arcblock/did-connect/lib/Session");
8
- const Button = require("@arcblock/ux/lib/Button");
9
7
  const material = require("@mui/material");
10
8
  const context = require("@arcblock/ux/lib/Locale/context");
11
9
  const reactErrorBoundary = require("react-error-boundary");
@@ -103,7 +101,6 @@ const useDiscussKitStatus = () => {
103
101
  };
104
102
  const DiscussKitComments = react.forwardRef(
105
103
  ({
106
- displayConnectButton,
107
104
  displayReaction,
108
105
  object,
109
106
  onChange,
@@ -201,17 +198,9 @@ const DiscussKitComments = react.forwardRef(
201
198
  };
202
199
  return /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref, children: [
203
200
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
204
- /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { display: "flex", justifyContent: "space-between", alignItems: "end", children: [
205
- displayReaction && /* @__PURE__ */ jsxRuntime.jsxs(discussKitUx.IconButtonGroup, { sx: { alignItems: "flex-end" }, children: [
206
- /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.GithubReactionContainer, { id: object.id, request: api, interactive }),
207
- reactionAppend
208
- ] }),
209
- displayConnectButton && (session.user ? /* @__PURE__ */ jsxRuntime.jsx(SessionManager, { style: { padding: 0 }, showText: true, showRole: true, session }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "medium", variant: "contained", color: "primary", onClick: () => session.login(), children: t("connect") }))
210
- ] }),
211
- displayConnectButton && !session.user && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "input-no-connect", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "connect-tip", children: [
212
- t("connectDIDWallet"),
213
- " ",
214
- /* @__PURE__ */ jsxRuntime.jsx("a", { className: "down-load-wallet", href: "https://www.didwallet.io/", target: "_blank", rel: "noreferrer", children: t("installDIDWallet") })
201
+ /* @__PURE__ */ jsxRuntime.jsx(material.Box, { display: "flex", justifyContent: "space-between", alignItems: "end", children: displayReaction && /* @__PURE__ */ jsxRuntime.jsxs(discussKitUx.IconButtonGroup, { sx: { alignItems: "flex-end" }, children: [
202
+ /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.GithubReactionContainer, { id: object.id, request: api, interactive }),
203
+ reactionAppend
215
204
  ] }) }),
216
205
  session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(material.Box, { mt: 2, className: "comment-editor", children: renderCommentInput() })
217
206
  ] }),
@@ -238,7 +227,6 @@ const DiscussKitComments = react.forwardRef(
238
227
  }
239
228
  );
240
229
  DiscussKitComments.propTypes = {
241
- displayConnectButton: PropTypes.bool,
242
230
  displayReaction: PropTypes.bool,
243
231
  object: PropTypes.object.isRequired,
244
232
  onChange: PropTypes.func,
@@ -261,7 +249,6 @@ DiscussKitComments.propTypes = {
261
249
  disableCmdEnter: PropTypes.bool
262
250
  };
263
251
  DiscussKitComments.defaultProps = {
264
- displayConnectButton: false,
265
252
  displayReaction: true,
266
253
  onChange: () => {
267
254
  },
@@ -353,7 +340,6 @@ Wrapper.propTypes = {
353
340
  desc: PropTypes.string,
354
341
  owner: PropTypes.string
355
342
  }).isRequired,
356
- displayConnectButton: PropTypes.bool,
357
343
  displayReaction: PropTypes.bool,
358
344
  onChange: PropTypes.func,
359
345
  flatView: PropTypes.bool,
@@ -374,7 +360,6 @@ Wrapper.propTypes = {
374
360
  reactionAppend: PropTypes.any
375
361
  };
376
362
  Wrapper.defaultProps = {
377
- displayConnectButton: false,
378
363
  displayReaction: true,
379
364
  onChange: () => {
380
365
  },
@@ -402,28 +387,5 @@ const Container = Theme.styled("div")`
402
387
  padding: ${(props) => props.padding ? "20px" : "0"};
403
388
  border: ${(props) => props.border ? "1px solid rgb(208, 215, 222)" : "none"};
404
389
  border-radius: 6px;
405
- .input-no-connect {
406
- margin: 24px 0 0 0;
407
- display: flex;
408
- font-size: 16px;
409
- width: 100%;
410
- text-align: start;
411
- word-break: break-all;
412
- flex-direction: column;
413
- .connect-tip {
414
- background: ${({ theme }) => theme.palette.grey[100]};
415
- padding: 10px;
416
- border-radius: 4px;
417
- box-sizing: border-box;
418
- color: ${({ theme }) => theme.palette.grey[600]};
419
- margin-bottom: 10px;
420
- }
421
- .down-load-wallet {
422
- color: ${({ theme }) => theme.palette.primary.main};
423
- }
424
- @media (max-width: 768px) {
425
- font-size: 14px;
426
- }
427
- }
428
390
  `;
429
391
  module.exports = Wrapper;
@@ -2,9 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useRef, useMemo, useEffect, useState } from "react";
3
3
  import { styled } from "@arcblock/ux/lib/Theme";
4
4
  import PropTypes from "prop-types";
5
- import SessionManager from "@arcblock/did-connect/lib/SessionManager";
6
5
  import { SessionContext } from "@arcblock/did-connect/lib/Session";
7
- import Button from "@arcblock/ux/lib/Button";
8
6
  import { Alert, AlertTitle, Box, CircularProgress } from "@mui/material";
9
7
  import { useLocaleContext, LocaleProvider } from "@arcblock/ux/lib/Locale/context";
10
8
  import { ErrorBoundary } from "react-error-boundary";
@@ -102,7 +100,6 @@ const useDiscussKitStatus = () => {
102
100
  };
103
101
  const DiscussKitComments = forwardRef(
104
102
  ({
105
- displayConnectButton,
106
103
  displayReaction,
107
104
  object,
108
105
  onChange,
@@ -200,17 +197,9 @@ const DiscussKitComments = forwardRef(
200
197
  };
201
198
  return /* @__PURE__ */ jsxs(Container, { ref, children: [
202
199
  /* @__PURE__ */ jsxs(Fragment, { children: [
203
- /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", children: [
204
- displayReaction && /* @__PURE__ */ jsxs(IconButtonGroup, { sx: { alignItems: "flex-end" }, children: [
205
- /* @__PURE__ */ jsx(GithubReactionContainer, { id: object.id, request: api, interactive }),
206
- reactionAppend
207
- ] }),
208
- displayConnectButton && (session.user ? /* @__PURE__ */ jsx(SessionManager, { style: { padding: 0 }, showText: true, showRole: true, session }) : /* @__PURE__ */ jsx(Button, { size: "medium", variant: "contained", color: "primary", onClick: () => session.login(), children: t("connect") }))
209
- ] }),
210
- displayConnectButton && !session.user && /* @__PURE__ */ jsx("div", { className: "input-no-connect", children: /* @__PURE__ */ jsxs("span", { className: "connect-tip", children: [
211
- t("connectDIDWallet"),
212
- " ",
213
- /* @__PURE__ */ jsx("a", { className: "down-load-wallet", href: "https://www.didwallet.io/", target: "_blank", rel: "noreferrer", children: t("installDIDWallet") })
200
+ /* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", children: displayReaction && /* @__PURE__ */ jsxs(IconButtonGroup, { sx: { alignItems: "flex-end" }, children: [
201
+ /* @__PURE__ */ jsx(GithubReactionContainer, { id: object.id, request: api, interactive }),
202
+ reactionAppend
214
203
  ] }) }),
215
204
  session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsx(Box, { mt: 2, className: "comment-editor", children: renderCommentInput() })
216
205
  ] }),
@@ -237,7 +226,6 @@ const DiscussKitComments = forwardRef(
237
226
  }
238
227
  );
239
228
  DiscussKitComments.propTypes = {
240
- displayConnectButton: PropTypes.bool,
241
229
  displayReaction: PropTypes.bool,
242
230
  object: PropTypes.object.isRequired,
243
231
  onChange: PropTypes.func,
@@ -260,7 +248,6 @@ DiscussKitComments.propTypes = {
260
248
  disableCmdEnter: PropTypes.bool
261
249
  };
262
250
  DiscussKitComments.defaultProps = {
263
- displayConnectButton: false,
264
251
  displayReaction: true,
265
252
  onChange: () => {
266
253
  },
@@ -352,7 +339,6 @@ Wrapper.propTypes = {
352
339
  desc: PropTypes.string,
353
340
  owner: PropTypes.string
354
341
  }).isRequired,
355
- displayConnectButton: PropTypes.bool,
356
342
  displayReaction: PropTypes.bool,
357
343
  onChange: PropTypes.func,
358
344
  flatView: PropTypes.bool,
@@ -373,7 +359,6 @@ Wrapper.propTypes = {
373
359
  reactionAppend: PropTypes.any
374
360
  };
375
361
  Wrapper.defaultProps = {
376
- displayConnectButton: false,
377
362
  displayReaction: true,
378
363
  onChange: () => {
379
364
  },
@@ -401,29 +386,6 @@ const Container = styled("div")`
401
386
  padding: ${(props) => props.padding ? "20px" : "0"};
402
387
  border: ${(props) => props.border ? "1px solid rgb(208, 215, 222)" : "none"};
403
388
  border-radius: 6px;
404
- .input-no-connect {
405
- margin: 24px 0 0 0;
406
- display: flex;
407
- font-size: 16px;
408
- width: 100%;
409
- text-align: start;
410
- word-break: break-all;
411
- flex-direction: column;
412
- .connect-tip {
413
- background: ${({ theme }) => theme.palette.grey[100]};
414
- padding: 10px;
415
- border-radius: 4px;
416
- box-sizing: border-box;
417
- color: ${({ theme }) => theme.palette.grey[600]};
418
- margin-bottom: 10px;
419
- }
420
- .down-load-wallet {
421
- color: ${({ theme }) => theme.palette.primary.main};
422
- }
423
- @media (max-width: 768px) {
424
- font-size: 14px;
425
- }
426
- }
427
389
  `;
428
390
  export {
429
391
  Wrapper as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "2.3.87",
3
+ "version": "2.3.89",
4
4
  "description": "A react component for Discuss Kit blocklet.",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/es/index.js",
@@ -49,8 +49,8 @@
49
49
  "rehype-sanitize": "^5.0.1",
50
50
  "timeago.js": "^4.0.2",
51
51
  "url-join": "^4.0.1",
52
- "@blocklet/discuss-kit-ux": "^2.3.87",
53
- "@blocklet/editor": "^2.3.87"
52
+ "@blocklet/discuss-kit-ux": "^2.3.89",
53
+ "@blocklet/editor": "^2.3.89"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@arcblock/did-connect": "^2.10.36",