@blocklet/discuss-kit 1.0.74 → 1.0.76
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/api.js +0 -5
- package/lib/cjs/comments.js +2 -10
- package/lib/es/api.js +0 -5
- package/lib/es/comments.js +4 -12
- package/package.json +4 -4
package/lib/cjs/api.js
CHANGED
|
@@ -38,13 +38,8 @@ const fetchMoreReplies = async ({ commentId, cursor, limit = 10 }) => {
|
|
|
38
38
|
throw e;
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
const getMentions = async (text) => {
|
|
42
|
-
const { data } = await request.get(`/mention?search=${text}`);
|
|
43
|
-
return data;
|
|
44
|
-
};
|
|
45
41
|
exports.default = request;
|
|
46
42
|
exports.fetchComments = fetchComments;
|
|
47
43
|
exports.fetchMoreReplies = fetchMoreReplies;
|
|
48
44
|
exports.fetchRatingStats = fetchRatingStats;
|
|
49
|
-
exports.getMentions = getMentions;
|
|
50
45
|
exports.reply = reply;
|
package/lib/cjs/comments.js
CHANGED
|
@@ -332,15 +332,7 @@ function Wrapper({
|
|
|
332
332
|
react.useEffect(() => {
|
|
333
333
|
setSettings((prev) => ({
|
|
334
334
|
...prev,
|
|
335
|
-
autoCollapse
|
|
336
|
-
async mentionSearch(text) {
|
|
337
|
-
const data = await api.getMentions(text);
|
|
338
|
-
return data.map((e) => ({
|
|
339
|
-
picture: e.avatar,
|
|
340
|
-
name: e.fullName,
|
|
341
|
-
data: e.did
|
|
342
|
-
}));
|
|
343
|
-
}
|
|
335
|
+
autoCollapse
|
|
344
336
|
}));
|
|
345
337
|
}, [autoCollapse, setSettings]);
|
|
346
338
|
const object = react.useMemo(
|
|
@@ -371,7 +363,7 @@ function Wrapper({
|
|
|
371
363
|
translations: locales.translations,
|
|
372
364
|
locale,
|
|
373
365
|
children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.InternalThemeProvider, {
|
|
374
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.
|
|
366
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.DefaultEditorConfigProvider, {
|
|
375
367
|
children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentsProvider, {
|
|
376
368
|
target: object,
|
|
377
369
|
api: commentAPI,
|
package/lib/es/api.js
CHANGED
|
@@ -34,15 +34,10 @@ const fetchMoreReplies = async ({ commentId, cursor, limit = 10 }) => {
|
|
|
34
34
|
throw e;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
const getMentions = async (text) => {
|
|
38
|
-
const { data } = await request.get(`/mention?search=${text}`);
|
|
39
|
-
return data;
|
|
40
|
-
};
|
|
41
37
|
export {
|
|
42
38
|
request as default,
|
|
43
39
|
fetchComments,
|
|
44
40
|
fetchMoreReplies,
|
|
45
41
|
fetchRatingStats,
|
|
46
|
-
getMentions,
|
|
47
42
|
reply
|
|
48
43
|
};
|
package/lib/es/comments.js
CHANGED
|
@@ -11,11 +11,11 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|
|
11
11
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
12
12
|
import { useLocaleContext, LocaleProvider } from "@arcblock/ux/lib/Locale/context";
|
|
13
13
|
import { ErrorBoundary } from "react-error-boundary";
|
|
14
|
-
import { useCommentSettings, InternalThemeProvider,
|
|
14
|
+
import { useCommentSettings, InternalThemeProvider, DefaultEditorConfigProvider, CommentsProvider, useCommentsContext, BinaryThumb, CommentInput, CommentList } from "@blocklet/discuss-kit-ux";
|
|
15
15
|
import ErrorFallback from "./components/error-fallback";
|
|
16
16
|
import { translations } from "./locales";
|
|
17
17
|
import getWsClient, { useSubscription } from "./ws";
|
|
18
|
-
import api, {
|
|
18
|
+
import api, { fetchRatingStats } from "./api";
|
|
19
19
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
20
20
|
const getPrefix = () => {
|
|
21
21
|
var _a, _b;
|
|
@@ -319,15 +319,7 @@ function Wrapper({
|
|
|
319
319
|
useEffect(() => {
|
|
320
320
|
setSettings((prev) => ({
|
|
321
321
|
...prev,
|
|
322
|
-
autoCollapse
|
|
323
|
-
async mentionSearch(text) {
|
|
324
|
-
const data = await getMentions(text);
|
|
325
|
-
return data.map((e) => ({
|
|
326
|
-
picture: e.avatar,
|
|
327
|
-
name: e.fullName,
|
|
328
|
-
data: e.did
|
|
329
|
-
}));
|
|
330
|
-
}
|
|
322
|
+
autoCollapse
|
|
331
323
|
}));
|
|
332
324
|
}, [autoCollapse, setSettings]);
|
|
333
325
|
const object = useMemo(
|
|
@@ -358,7 +350,7 @@ function Wrapper({
|
|
|
358
350
|
translations,
|
|
359
351
|
locale,
|
|
360
352
|
children: /* @__PURE__ */ jsx(InternalThemeProvider, {
|
|
361
|
-
children: /* @__PURE__ */ jsx(
|
|
353
|
+
children: /* @__PURE__ */ jsx(DefaultEditorConfigProvider, {
|
|
362
354
|
children: /* @__PURE__ */ jsx(CommentsProvider, {
|
|
363
355
|
target: object,
|
|
364
356
|
api: commentAPI,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.76",
|
|
4
4
|
"description": "A react component for Discuss Kit blocklet.",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/es/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@arcblock/did-connect": "^2.5.4",
|
|
38
38
|
"@arcblock/ux": "^2.5.4",
|
|
39
39
|
"@arcblock/ws": "^1.18.54",
|
|
40
|
-
"@blocklet/discuss-kit-ux": "1.0.
|
|
41
|
-
"@blocklet/editor": "1.0.
|
|
40
|
+
"@blocklet/discuss-kit-ux": "1.0.76",
|
|
41
|
+
"@blocklet/editor": "1.0.76",
|
|
42
42
|
"@emotion/react": "^11.10.5",
|
|
43
43
|
"@emotion/styled": "^11.10.5",
|
|
44
44
|
"@mui/icons-material": "^5.10.9",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"vite-plugin-build": "^0.7.1",
|
|
78
78
|
"vite-plugin-svgr": "^2.2.2"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "cd40cf288650547c7c1696ff2142ea1875a0568a"
|
|
81
81
|
}
|