@blocklet/discuss-kit 1.3.23 → 1.3.24

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 CHANGED
@@ -3,23 +3,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const axios = require("axios");
4
4
  const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
5
5
  const axios__default = /* @__PURE__ */ _interopDefaultLegacy(axios);
6
- const request = axios__default.default.create({ baseURL: "/", timeout: 5e3 });
6
+ const request = axios__default.default.create({ baseURL: "/", timeout: 2e4 });
7
7
  request.interceptors.request.use(
8
8
  (config) => {
9
9
  return config;
10
10
  },
11
11
  (error) => Promise.reject(error)
12
12
  );
13
- request.interceptors.response.use(
14
- (response) => {
15
- const { responseType } = response.config;
16
- if ((!responseType || responseType === "json") && response.headers["content-type"] && response.headers["content-type"].indexOf("application/json") === -1) {
17
- throw new Error("Invalid response");
18
- }
19
- return response;
20
- },
21
- (error) => Promise.reject(error)
22
- );
23
13
  const fetchRatingStats = async (id) => {
24
14
  const { data } = await request.get(`/ratings/${id}/stats`);
25
15
  return data;
@@ -364,6 +364,7 @@ function Wrapper({
364
364
  locale,
365
365
  children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.InternalThemeProvider, {
366
366
  children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.DefaultEditorConfigProvider, {
367
+ request: api__default.default,
367
368
  children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.CommentsProvider, {
368
369
  target: object,
369
370
  api: commentAPI,
package/lib/es/api.js CHANGED
@@ -1,21 +1,11 @@
1
1
  import axios from "axios";
2
- const request = axios.create({ baseURL: "/", timeout: 5e3 });
2
+ const request = axios.create({ baseURL: "/", timeout: 2e4 });
3
3
  request.interceptors.request.use(
4
4
  (config) => {
5
5
  return config;
6
6
  },
7
7
  (error) => Promise.reject(error)
8
8
  );
9
- request.interceptors.response.use(
10
- (response) => {
11
- const { responseType } = response.config;
12
- if ((!responseType || responseType === "json") && response.headers["content-type"] && response.headers["content-type"].indexOf("application/json") === -1) {
13
- throw new Error("Invalid response");
14
- }
15
- return response;
16
- },
17
- (error) => Promise.reject(error)
18
- );
19
9
  const fetchRatingStats = async (id) => {
20
10
  const { data } = await request.get(`/ratings/${id}/stats`);
21
11
  return data;
@@ -351,6 +351,7 @@ function Wrapper({
351
351
  locale,
352
352
  children: /* @__PURE__ */ jsx(InternalThemeProvider, {
353
353
  children: /* @__PURE__ */ jsx(DefaultEditorConfigProvider, {
354
+ request: api,
354
355
  children: /* @__PURE__ */ jsx(CommentsProvider, {
355
356
  target: object,
356
357
  api: commentAPI,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "1.3.23",
3
+ "version": "1.3.24",
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.37",
38
38
  "@arcblock/ux": "^2.5.37",
39
39
  "@arcblock/ws": "^1.18.77",
40
- "@blocklet/discuss-kit-ux": "1.3.23",
41
- "@blocklet/editor": "1.3.23",
40
+ "@blocklet/discuss-kit-ux": "1.3.24",
41
+ "@blocklet/editor": "1.3.24",
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": "659463ec06f3e7776d4cf074582c677135726845"
80
+ "gitHead": "4c4c83a412b032b23d3740a28b302aa95e989f4b"
81
81
  }