@blocklet/discuss-kit 1.5.75 → 1.5.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/comments.js +11 -3
- package/lib/es/comments.js +12 -4
- package/package.json +4 -4
package/lib/cjs/comments.js
CHANGED
|
@@ -106,11 +106,16 @@ const commentAPI = {
|
|
|
106
106
|
return data;
|
|
107
107
|
},
|
|
108
108
|
updateComment: async ({
|
|
109
|
-
id
|
|
109
|
+
id,
|
|
110
|
+
updatedAt
|
|
110
111
|
}, content) => {
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
const {
|
|
113
|
+
data
|
|
114
|
+
} = await api__default.default.put(`/comments/${id}`, {
|
|
115
|
+
content,
|
|
116
|
+
updatedAt
|
|
113
117
|
});
|
|
118
|
+
return formatComment(data);
|
|
114
119
|
},
|
|
115
120
|
reply: async ({
|
|
116
121
|
id,
|
|
@@ -149,6 +154,9 @@ function DiscussKitComments({
|
|
|
149
154
|
commentInputPosition,
|
|
150
155
|
showTopbar
|
|
151
156
|
}) {
|
|
157
|
+
discussKitUx.useDefaultApiErrorHandler({
|
|
158
|
+
request: api__default.default
|
|
159
|
+
});
|
|
152
160
|
const {
|
|
153
161
|
session
|
|
154
162
|
} = react.useContext(Session.SessionContext) || {};
|
package/lib/es/comments.js
CHANGED
|
@@ -10,7 +10,7 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|
|
10
10
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
11
11
|
import { useLocaleContext, LocaleProvider } from "@arcblock/ux/lib/Locale/context";
|
|
12
12
|
import { ErrorBoundary } from "react-error-boundary";
|
|
13
|
-
import { InternalThemeProvider, DefaultEditorConfigProvider, CommentsProvider, useCommentsContext, GithubReaction, CommentInput, CommentList } from "@blocklet/discuss-kit-ux";
|
|
13
|
+
import { InternalThemeProvider, DefaultEditorConfigProvider, CommentsProvider, useDefaultApiErrorHandler, useCommentsContext, GithubReaction, CommentInput, CommentList } 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";
|
|
@@ -94,11 +94,16 @@ const commentAPI = {
|
|
|
94
94
|
return data;
|
|
95
95
|
},
|
|
96
96
|
updateComment: async ({
|
|
97
|
-
id
|
|
97
|
+
id,
|
|
98
|
+
updatedAt
|
|
98
99
|
}, content) => {
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
const {
|
|
101
|
+
data
|
|
102
|
+
} = await api.put(`/comments/${id}`, {
|
|
103
|
+
content,
|
|
104
|
+
updatedAt
|
|
101
105
|
});
|
|
106
|
+
return formatComment(data);
|
|
102
107
|
},
|
|
103
108
|
reply: async ({
|
|
104
109
|
id,
|
|
@@ -137,6 +142,9 @@ function DiscussKitComments({
|
|
|
137
142
|
commentInputPosition,
|
|
138
143
|
showTopbar
|
|
139
144
|
}) {
|
|
145
|
+
useDefaultApiErrorHandler({
|
|
146
|
+
request: api
|
|
147
|
+
});
|
|
140
148
|
const {
|
|
141
149
|
session
|
|
142
150
|
} = useContext(SessionContext) || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.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.7.13",
|
|
38
38
|
"@arcblock/ux": "^2.7.13",
|
|
39
39
|
"@arcblock/ws": "^1.18.89",
|
|
40
|
-
"@blocklet/discuss-kit-ux": "1.5.
|
|
41
|
-
"@blocklet/editor": "1.5.
|
|
40
|
+
"@blocklet/discuss-kit-ux": "1.5.76",
|
|
41
|
+
"@blocklet/editor": "1.5.76",
|
|
42
42
|
"@emotion/react": "^11.10.5",
|
|
43
43
|
"@emotion/styled": "^11.10.5",
|
|
44
44
|
"@mui/icons-material": "^5.14.3",
|
|
@@ -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": "af235a44a9d3bd22111750959dec94d687594130"
|
|
81
81
|
}
|