@blocklet/discuss-kit 2.3.2 → 2.3.4
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.
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const material = require("@mui/material");
|
|
5
|
+
const CloseIcon = require("@mui/icons-material/Close");
|
|
6
|
+
const Comments = require("./comments");
|
|
7
|
+
function CommentsDialog({ title, open, onClose, ...rest }) {
|
|
8
|
+
const fullScreen = material.useMediaQuery((theme) => theme.breakpoints.down("md"));
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(material.Dialog, { fullScreen, onClose, maxWidth: false, ...rest, open, children: [
|
|
10
|
+
/* @__PURE__ */ jsxRuntime.jsxs(material.DialogTitle, { variant: "h4", sx: { position: "relative" }, children: [
|
|
11
|
+
title,
|
|
12
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13
|
+
material.IconButton,
|
|
14
|
+
{
|
|
15
|
+
onClick: onClose,
|
|
16
|
+
sx: { position: "absolute", right: 8, top: "50%", transform: "translateY(-50%)" },
|
|
17
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.DialogContent, { sx: { width: { xs: 1, sm: 800 } }, children: /* @__PURE__ */ jsxRuntime.jsx(Comments, { ...rest }) })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
exports.CommentsDialog = CommentsDialog;
|
|
@@ -34,13 +34,13 @@ function Menu({ items, ...rest }) {
|
|
|
34
34
|
open,
|
|
35
35
|
onClose: handleClose,
|
|
36
36
|
children: items.map(({ onClick, text, ...itemProps }, index) => {
|
|
37
|
-
const
|
|
37
|
+
const handleClick2 = () => {
|
|
38
38
|
onClick();
|
|
39
39
|
handleClose();
|
|
40
40
|
};
|
|
41
41
|
return (
|
|
42
42
|
// eslint-disable-next-line react/no-array-index-key
|
|
43
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { onClick:
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { onClick: handleClick2, ...itemProps, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { minWidth: 100, children: text }) }, index)
|
|
44
44
|
);
|
|
45
45
|
})
|
|
46
46
|
}
|
package/lib/cjs/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const themeProvider = require("./theme-provider");
|
|
|
4
4
|
const commentsInstaller = require("./comments-installer");
|
|
5
5
|
const commentsWithSession = require("./comments-with-session");
|
|
6
6
|
const commentListener = require("./hooks/comment-listener");
|
|
7
|
+
const commentsDialog = require("./comments-dialog");
|
|
7
8
|
exports.ThemeProvider = themeProvider;
|
|
8
9
|
exports.Comments = commentsInstaller;
|
|
9
10
|
exports.CommentsWithSession = commentsWithSession;
|
|
@@ -11,3 +12,7 @@ Object.defineProperty(exports, "useCommentsListener", {
|
|
|
11
12
|
enumerable: true,
|
|
12
13
|
get: () => commentListener.useCommentsListener
|
|
13
14
|
});
|
|
15
|
+
Object.defineProperty(exports, "CommentsDialog", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: () => commentsDialog.CommentsDialog
|
|
18
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMediaQuery, Dialog, DialogTitle, IconButton, DialogContent } from "@mui/material";
|
|
3
|
+
import CloseIcon from "@mui/icons-material/Close";
|
|
4
|
+
import Comments from "./comments";
|
|
5
|
+
function CommentsDialog({ title, open, onClose, ...rest }) {
|
|
6
|
+
const fullScreen = useMediaQuery((theme) => theme.breakpoints.down("md"));
|
|
7
|
+
return /* @__PURE__ */ jsxs(Dialog, { fullScreen, onClose, maxWidth: false, ...rest, open, children: [
|
|
8
|
+
/* @__PURE__ */ jsxs(DialogTitle, { variant: "h4", sx: { position: "relative" }, children: [
|
|
9
|
+
title,
|
|
10
|
+
/* @__PURE__ */ jsx(
|
|
11
|
+
IconButton,
|
|
12
|
+
{
|
|
13
|
+
onClick: onClose,
|
|
14
|
+
sx: { position: "absolute", right: 8, top: "50%", transform: "translateY(-50%)" },
|
|
15
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
] }),
|
|
19
|
+
/* @__PURE__ */ jsx(DialogContent, { sx: { width: { xs: 1, sm: 800 } }, children: /* @__PURE__ */ jsx(Comments, { ...rest }) })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
CommentsDialog
|
|
24
|
+
};
|
|
@@ -33,13 +33,13 @@ function Menu({ items, ...rest }) {
|
|
|
33
33
|
open,
|
|
34
34
|
onClose: handleClose,
|
|
35
35
|
children: items.map(({ onClick, text, ...itemProps }, index) => {
|
|
36
|
-
const
|
|
36
|
+
const handleClick2 = () => {
|
|
37
37
|
onClick();
|
|
38
38
|
handleClose();
|
|
39
39
|
};
|
|
40
40
|
return (
|
|
41
41
|
// eslint-disable-next-line react/no-array-index-key
|
|
42
|
-
/* @__PURE__ */ jsx(StyledMenuItem, { onClick:
|
|
42
|
+
/* @__PURE__ */ jsx(StyledMenuItem, { onClick: handleClick2, ...itemProps, children: /* @__PURE__ */ jsx(Box, { minWidth: 100, children: text }) }, index)
|
|
43
43
|
);
|
|
44
44
|
})
|
|
45
45
|
}
|
package/lib/es/index.js
CHANGED
|
@@ -2,8 +2,10 @@ import { default as default2 } from "./theme-provider";
|
|
|
2
2
|
import { default as default3 } from "./comments-installer";
|
|
3
3
|
import { default as default4 } from "./comments-with-session";
|
|
4
4
|
import { useCommentsListener } from "./hooks/comment-listener";
|
|
5
|
+
import { CommentsDialog } from "./comments-dialog";
|
|
5
6
|
export {
|
|
6
7
|
default3 as Comments,
|
|
8
|
+
CommentsDialog,
|
|
7
9
|
default4 as CommentsWithSession,
|
|
8
10
|
default2 as ThemeProvider,
|
|
9
11
|
useCommentsListener
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
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.
|
|
53
|
-
"@blocklet/editor": "^2.3.
|
|
52
|
+
"@blocklet/discuss-kit-ux": "^2.3.4",
|
|
53
|
+
"@blocklet/editor": "^2.3.4"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@arcblock/did-connect": "^2.10.36",
|