@blocklet/discuss-kit 1.5.196 → 1.5.198

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.
@@ -96,6 +96,7 @@ function DiscussKitComments({
96
96
  displayReaction,
97
97
  object,
98
98
  onChange,
99
+ onSendComment,
99
100
  commentInputPosition,
100
101
  showTopbar
101
102
  }) {
@@ -144,6 +145,7 @@ function DiscussKitComments({
144
145
  const sendComment = async (content) => {
145
146
  const { data } = await api.post("/comments", { content, object });
146
147
  add(formatComment(data));
148
+ onSendComment == null ? void 0 : onSendComment(data);
147
149
  };
148
150
  const handleOnRate = async ({ ratingType, value }) => {
149
151
  if (!session.user) {
@@ -219,6 +221,7 @@ DiscussKitComments.propTypes = {
219
221
  displayReaction: PropTypes.bool,
220
222
  object: PropTypes.object.isRequired,
221
223
  onChange: PropTypes.func,
224
+ onSendComment: PropTypes.func,
222
225
  commentInputPosition: PropTypes.oneOf(["top", "bottom"]),
223
226
  showTopbar: PropTypes.bool
224
227
  };
@@ -227,6 +230,8 @@ DiscussKitComments.defaultProps = {
227
230
  displayReaction: true,
228
231
  onChange: () => {
229
232
  },
233
+ onSendComment: () => {
234
+ },
230
235
  commentInputPosition: "top",
231
236
  showTopbar: true
232
237
  };
@@ -247,9 +252,9 @@ function Wrapper({
247
252
  const { locale = "en" } = context.useLocaleContext() || {};
248
253
  const object = react.useMemo(
249
254
  () => ({
250
- ...target,
251
255
  link: window.location.href,
252
- blockletName: getCurrentBlockletComponentName()
256
+ blockletName: getCurrentBlockletComponentName(),
257
+ ...target
253
258
  }),
254
259
  // eslint-disable-next-line react-hooks/exhaustive-deps
255
260
  [target]
@@ -95,6 +95,7 @@ function DiscussKitComments({
95
95
  displayReaction,
96
96
  object,
97
97
  onChange,
98
+ onSendComment,
98
99
  commentInputPosition,
99
100
  showTopbar
100
101
  }) {
@@ -143,6 +144,7 @@ function DiscussKitComments({
143
144
  const sendComment = async (content) => {
144
145
  const { data } = await api.post("/comments", { content, object });
145
146
  add(formatComment(data));
147
+ onSendComment == null ? void 0 : onSendComment(data);
146
148
  };
147
149
  const handleOnRate = async ({ ratingType, value }) => {
148
150
  if (!session.user) {
@@ -218,6 +220,7 @@ DiscussKitComments.propTypes = {
218
220
  displayReaction: PropTypes.bool,
219
221
  object: PropTypes.object.isRequired,
220
222
  onChange: PropTypes.func,
223
+ onSendComment: PropTypes.func,
221
224
  commentInputPosition: PropTypes.oneOf(["top", "bottom"]),
222
225
  showTopbar: PropTypes.bool
223
226
  };
@@ -226,6 +229,8 @@ DiscussKitComments.defaultProps = {
226
229
  displayReaction: true,
227
230
  onChange: () => {
228
231
  },
232
+ onSendComment: () => {
233
+ },
229
234
  commentInputPosition: "top",
230
235
  showTopbar: true
231
236
  };
@@ -246,9 +251,9 @@ function Wrapper({
246
251
  const { locale = "en" } = useLocaleContext() || {};
247
252
  const object = useMemo(
248
253
  () => ({
249
- ...target,
250
254
  link: window.location.href,
251
- blockletName: getCurrentBlockletComponentName()
255
+ blockletName: getCurrentBlockletComponentName(),
256
+ ...target
252
257
  }),
253
258
  // eslint-disable-next-line react-hooks/exhaustive-deps
254
259
  [target]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "1.5.196",
3
+ "version": "1.5.198",
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.8.19",
38
38
  "@arcblock/ux": "^2.8.19",
39
39
  "@arcblock/ws": "^1.18.102",
40
- "@blocklet/discuss-kit-ux": "1.5.196",
41
- "@blocklet/editor": "1.5.196",
40
+ "@blocklet/discuss-kit-ux": "1.5.198",
41
+ "@blocklet/editor": "1.5.198",
42
42
  "@emotion/react": "^11.10.5",
43
43
  "@emotion/styled": "^11.10.5",
44
44
  "@mui/icons-material": "^5.14.9",
@@ -76,5 +76,5 @@
76
76
  "vite-plugin-build": "^0.10.0",
77
77
  "vite-plugin-svgr": "^4.1.0"
78
78
  },
79
- "gitHead": "52bc4fc982d8a35e1d99598d799061f4008f7d95"
79
+ "gitHead": "fd96c8a8e6ca9b77686120125779a440573b56ff"
80
80
  }