@blocklet/discuss-kit 2.5.35 → 2.5.37

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.
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),i=require("react"),l=require("prop-types"),a=require("@mui/material/Alert"),u=require("@mui/material/AlertTitle"),p=require("@mui/material/Button"),d=require("@mui/material/Collapse"),x=require("@mui/material/Box");function o({error:r}){const[t,n]=i.useState(!1),s=r?.stack||r?.message;return i.useEffect(()=>{console.error(r)},[r]),e.jsxs(a,{severity:"warning",action:s?e.jsx(p,{color:"inherit",size:"small",onClick:()=>n(c=>!c),children:t?"Hide details":"Show details"}):void 0,sx:{".MuiAlert-action":{flex:"0 0 auto"}},children:[e.jsx(u,{children:"Oops!"}),"Discuss Kit is not working properly.",s&&e.jsx(d,{in:t,children:e.jsx(x,{component:"pre",sx:{mt:1,mb:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s})})]})}o.propTypes={error:l.instanceOf(Error).isRequired};module.exports=o;
1
+ "use strict";const s=require("react/jsx-runtime"),i=require("react"),c=require("prop-types"),l=require("@mui/material/Alert"),a=require("@mui/material/AlertTitle"),u=require("@mui/material/Button"),p=require("@mui/material/Collapse"),d=require("@mui/material/Box");function t({error:e}){const[r,n]=i.useState(!1);return i.useEffect(()=>{console.error(e)},[e]),s.jsxs(l,{severity:"warning",action:e?s.jsx(u,{color:"inherit",size:"small",onClick:()=>n(o=>!o),children:r?"Hide details":"Show details"}):void 0,sx:{".MuiAlert-action":{flex:"0 0 auto"}},children:[s.jsx(a,{children:"Oops!"}),"Discuss Kit is not working properly.",e&&s.jsx(p,{in:r,children:s.jsxs(d,{component:"pre",sx:{mt:1,mb:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[e.message,s.jsx("br",{}),e.stack]})})]})}t.propTypes={error:c.instanceOf(Error).isRequired};module.exports=t;
@@ -1,32 +1,36 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useState as l, useEffect as p } from "react";
3
- import a from "prop-types";
4
- import m from "@mui/material/Alert";
5
- import c from "@mui/material/AlertTitle";
6
- import d from "@mui/material/Button";
7
- import f from "@mui/material/Collapse";
8
- import u from "@mui/material/Box";
9
- function x({ error: r }) {
10
- const [i, t] = l(!1), o = r?.stack || r?.message;
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import { useState as n, useEffect as p } from "react";
3
+ import l from "prop-types";
4
+ import a from "@mui/material/Alert";
5
+ import m from "@mui/material/AlertTitle";
6
+ import c from "@mui/material/Button";
7
+ import d from "@mui/material/Collapse";
8
+ import f from "@mui/material/Box";
9
+ function u({ error: e }) {
10
+ const [o, t] = n(!1);
11
11
  return p(() => {
12
- console.error(r);
13
- }, [r]), /* @__PURE__ */ n(
14
- m,
12
+ console.error(e);
13
+ }, [e]), /* @__PURE__ */ i(
14
+ a,
15
15
  {
16
16
  severity: "warning",
17
- action: o ? /* @__PURE__ */ e(d, { color: "inherit", size: "small", onClick: () => t((s) => !s), children: i ? "Hide details" : "Show details" }) : void 0,
17
+ action: e ? /* @__PURE__ */ r(c, { color: "inherit", size: "small", onClick: () => t((s) => !s), children: o ? "Hide details" : "Show details" }) : void 0,
18
18
  sx: { ".MuiAlert-action": { flex: "0 0 auto" } },
19
19
  children: [
20
- /* @__PURE__ */ e(c, { children: "Oops!" }),
20
+ /* @__PURE__ */ r(m, { children: "Oops!" }),
21
21
  "Discuss Kit is not working properly.",
22
- o && /* @__PURE__ */ e(f, { in: i, children: /* @__PURE__ */ e(u, { component: "pre", sx: { mt: 1, mb: 0, whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: o }) })
22
+ e && /* @__PURE__ */ r(d, { in: o, children: /* @__PURE__ */ i(f, { component: "pre", sx: { mt: 1, mb: 0, whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: [
23
+ e.message,
24
+ /* @__PURE__ */ r("br", {}),
25
+ e.stack
26
+ ] }) })
23
27
  ]
24
28
  }
25
29
  );
26
30
  }
27
- x.propTypes = {
28
- error: a.instanceOf(Error).isRequired
31
+ u.propTypes = {
32
+ error: l.instanceOf(Error).isRequired
29
33
  };
30
34
  export {
31
- x as default
35
+ u as default
32
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "2.5.35",
3
+ "version": "2.5.37",
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.5.35",
53
- "@blocklet/editor": "2.5.35"
52
+ "@blocklet/discuss-kit-ux": "2.5.37",
53
+ "@blocklet/editor": "2.5.37"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@arcblock/did-connect-react": "^3.1.5",