@blocklet/discuss-kit 1.6.177 → 1.6.179
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.
- package/lib/cjs/comments.js +16 -24
- package/lib/es/comments.js +17 -25
- package/package.json +7 -7
package/lib/cjs/comments.js
CHANGED
|
@@ -166,6 +166,20 @@ const DiscussKitComments = react.forwardRef(
|
|
|
166
166
|
}
|
|
167
167
|
await api.delete(`/topics/${object.id}/ratings`);
|
|
168
168
|
};
|
|
169
|
+
const renderCommentInput = () => {
|
|
170
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
171
|
+
discussKitUx.CommentInput,
|
|
172
|
+
{
|
|
173
|
+
send: sendComment,
|
|
174
|
+
draftKey: `object-${object.id}`,
|
|
175
|
+
autoFocus,
|
|
176
|
+
disabledSend,
|
|
177
|
+
initialContent,
|
|
178
|
+
sendText,
|
|
179
|
+
sendIcon
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
};
|
|
169
183
|
return /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref, children: [
|
|
170
184
|
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
171
185
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", children: [
|
|
@@ -185,18 +199,7 @@ const DiscussKitComments = react.forwardRef(
|
|
|
185
199
|
" ",
|
|
186
200
|
/* @__PURE__ */ jsxRuntime.jsx("a", { className: "down-load-wallet", href: "https://www.didwallet.io/", target: "_blank", rel: "noreferrer", children: t("installDIDWallet") })
|
|
187
201
|
] }) }),
|
|
188
|
-
session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 2, className: "comment-editor", children:
|
|
189
|
-
discussKitUx.CommentInput,
|
|
190
|
-
{
|
|
191
|
-
send: sendComment,
|
|
192
|
-
draftKey: `object-${object.id}`,
|
|
193
|
-
autoFocus,
|
|
194
|
-
disabledSend,
|
|
195
|
-
initialContent,
|
|
196
|
-
sendText,
|
|
197
|
-
sendIcon
|
|
198
|
-
}
|
|
199
|
-
) })
|
|
202
|
+
session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 2, className: "comment-editor", children: renderCommentInput() })
|
|
200
203
|
] }),
|
|
201
204
|
!!total && showTopbar && /* @__PURE__ */ jsxRuntime.jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [
|
|
202
205
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { fontWeight: "medium" }, children: [
|
|
@@ -216,18 +219,7 @@ const DiscussKitComments = react.forwardRef(
|
|
|
216
219
|
)
|
|
217
220
|
] }),
|
|
218
221
|
/* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentList, { className: "comment-list" }),
|
|
219
|
-
session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 6, children:
|
|
220
|
-
discussKitUx.CommentInput,
|
|
221
|
-
{
|
|
222
|
-
send: sendComment,
|
|
223
|
-
draftKey: `object-${object.id}`,
|
|
224
|
-
autoFocus,
|
|
225
|
-
disabledSend,
|
|
226
|
-
initialContent,
|
|
227
|
-
sendText,
|
|
228
|
-
sendIcon
|
|
229
|
-
}
|
|
230
|
-
) })
|
|
222
|
+
session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 6, children: renderCommentInput() })
|
|
231
223
|
] });
|
|
232
224
|
}
|
|
233
225
|
);
|
package/lib/es/comments.js
CHANGED
|
@@ -10,7 +10,7 @@ import Box from "@mui/material/Box";
|
|
|
10
10
|
import CircularProgress from "@mui/material/CircularProgress";
|
|
11
11
|
import { useLocaleContext, LocaleProvider } from "@arcblock/ux/lib/Locale/context";
|
|
12
12
|
import { ErrorBoundary } from "react-error-boundary";
|
|
13
|
-
import { useDefaultApiErrorHandler, useCommentsContext, useSubscription, GithubReaction,
|
|
13
|
+
import { useDefaultApiErrorHandler, useCommentsContext, useSubscription, GithubReaction, SegmentedControl, CommentList, getWsClient, UploaderProvider, InternalThemeProvider, ConfirmProvider, DefaultEditorConfigProvider, CommentsProvider, CommentInput } from "@blocklet/discuss-kit-ux";
|
|
14
14
|
import { useRequest } from "ahooks";
|
|
15
15
|
import ErrorFallback from "./components/error-fallback";
|
|
16
16
|
import { translations } from "./locales";
|
|
@@ -165,6 +165,20 @@ const DiscussKitComments = forwardRef(
|
|
|
165
165
|
}
|
|
166
166
|
await api.delete(`/topics/${object.id}/ratings`);
|
|
167
167
|
};
|
|
168
|
+
const renderCommentInput = () => {
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
CommentInput,
|
|
171
|
+
{
|
|
172
|
+
send: sendComment,
|
|
173
|
+
draftKey: `object-${object.id}`,
|
|
174
|
+
autoFocus,
|
|
175
|
+
disabledSend,
|
|
176
|
+
initialContent,
|
|
177
|
+
sendText,
|
|
178
|
+
sendIcon
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
};
|
|
168
182
|
return /* @__PURE__ */ jsxs(Container, { ref, children: [
|
|
169
183
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
170
184
|
/* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", children: [
|
|
@@ -184,18 +198,7 @@ const DiscussKitComments = forwardRef(
|
|
|
184
198
|
" ",
|
|
185
199
|
/* @__PURE__ */ jsx("a", { className: "down-load-wallet", href: "https://www.didwallet.io/", target: "_blank", rel: "noreferrer", children: t("installDIDWallet") })
|
|
186
200
|
] }) }),
|
|
187
|
-
session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsx(Box, { mt: 2, className: "comment-editor", children:
|
|
188
|
-
CommentInput,
|
|
189
|
-
{
|
|
190
|
-
send: sendComment,
|
|
191
|
-
draftKey: `object-${object.id}`,
|
|
192
|
-
autoFocus,
|
|
193
|
-
disabledSend,
|
|
194
|
-
initialContent,
|
|
195
|
-
sendText,
|
|
196
|
-
sendIcon
|
|
197
|
-
}
|
|
198
|
-
) })
|
|
201
|
+
session.user && interactive && commentInputPosition === "top" && /* @__PURE__ */ jsx(Box, { mt: 2, className: "comment-editor", children: renderCommentInput() })
|
|
199
202
|
] }),
|
|
200
203
|
!!total && showTopbar && /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [
|
|
201
204
|
/* @__PURE__ */ jsxs(Box, { sx: { fontWeight: "medium" }, children: [
|
|
@@ -215,18 +218,7 @@ const DiscussKitComments = forwardRef(
|
|
|
215
218
|
)
|
|
216
219
|
] }),
|
|
217
220
|
/* @__PURE__ */ jsx(CommentList, { className: "comment-list" }),
|
|
218
|
-
session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, { mt: 6, children:
|
|
219
|
-
CommentInput,
|
|
220
|
-
{
|
|
221
|
-
send: sendComment,
|
|
222
|
-
draftKey: `object-${object.id}`,
|
|
223
|
-
autoFocus,
|
|
224
|
-
disabledSend,
|
|
225
|
-
initialContent,
|
|
226
|
-
sendText,
|
|
227
|
-
sendIcon
|
|
228
|
-
}
|
|
229
|
-
) })
|
|
221
|
+
session.user && interactive && commentInputPosition === "bottom" && /* @__PURE__ */ jsx(Box, { mt: 6, children: renderCommentInput() })
|
|
230
222
|
] });
|
|
231
223
|
}
|
|
232
224
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.179",
|
|
4
4
|
"description": "A react component for Discuss Kit blocklet.",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/es/index.js",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"author": "Nate <nate@arcblock.io> (http://github.com/NateRobinson)",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@arcblock/did-connect": "^2.9.
|
|
38
|
-
"@arcblock/ux": "^2.9.
|
|
37
|
+
"@arcblock/did-connect": "^2.9.58",
|
|
38
|
+
"@arcblock/ux": "^2.9.58",
|
|
39
39
|
"@arcblock/ws": "^1.18.113",
|
|
40
|
-
"@blocklet/discuss-kit-ux": "1.6.
|
|
41
|
-
"@blocklet/editor": "1.6.
|
|
42
|
-
"@blocklet/ui-react": "^2.9.
|
|
40
|
+
"@blocklet/discuss-kit-ux": "1.6.179",
|
|
41
|
+
"@blocklet/editor": "1.6.179",
|
|
42
|
+
"@blocklet/ui-react": "^2.9.58",
|
|
43
43
|
"@emotion/react": "^11.10.5",
|
|
44
44
|
"@emotion/styled": "^11.10.5",
|
|
45
45
|
"@mui/icons-material": "^5.14.9",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"vite-plugin-build": "^0.10.0",
|
|
78
78
|
"vite-plugin-svgr": "^4.2.0"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "611ee56df5d8bbd5b763645b9086aada27e555e5"
|
|
81
81
|
}
|