@blocklet/discuss-kit 2.4.107 → 2.4.109

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 r=require("react/jsx-runtime"),i=require("prop-types"),o=require("@mui/material/Alert"),t=require("@mui/material/AlertTitle");function e({error:s}){const n=process.env.NODE_ENV==="production"?null:r.jsx("pre",{children:s.message});return r.jsxs(o,{severity:"warning",children:[r.jsx(t,{children:"Oops!"}),"Discuss Kit is not working properly.",n]})}e.propTypes={error:i.instanceOf(Error).isRequired};module.exports=e;
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,18 +1,32 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import i from "prop-types";
3
- import t from "@mui/material/Alert";
4
- import n from "@mui/material/AlertTitle";
5
- function p({ error: e }) {
6
- const o = process.env.NODE_ENV === "production" ? null : /* @__PURE__ */ r("pre", { children: e.message });
7
- return /* @__PURE__ */ s(t, { severity: "warning", children: [
8
- /* @__PURE__ */ r(n, { children: "Oops!" }),
9
- "Discuss Kit is not working properly.",
10
- o
11
- ] });
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;
11
+ return p(() => {
12
+ console.error(r);
13
+ }, [r]), /* @__PURE__ */ n(
14
+ m,
15
+ {
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,
18
+ sx: { ".MuiAlert-action": { flex: "0 0 auto" } },
19
+ children: [
20
+ /* @__PURE__ */ e(c, { children: "Oops!" }),
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 }) })
23
+ ]
24
+ }
25
+ );
12
26
  }
13
- p.propTypes = {
14
- error: i.instanceOf(Error).isRequired
27
+ x.propTypes = {
28
+ error: a.instanceOf(Error).isRequired
15
29
  };
16
30
  export {
17
- p as default
31
+ x as default
18
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "2.4.107",
3
+ "version": "2.4.109",
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.4.107",
53
- "@blocklet/editor": "2.4.107"
52
+ "@blocklet/discuss-kit-ux": "2.4.109",
53
+ "@blocklet/editor": "2.4.109"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@arcblock/did-connect-react": "^3.1.5",