@next-core/brick-kit 2.123.5 → 2.123.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.123.8](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.123.7...@next-core/brick-kit@2.123.8) (2022-07-25)
7
+
8
+ **Note:** Version bump only for package @next-core/brick-kit
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.123.7](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.123.6...@next-core/brick-kit@2.123.7) (2022-07-22)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **devtools:** try to emit only in idle time ([0bf3c47](https://github.com/easyops-cn/next-core/commit/0bf3c475cfc41d8badeb24480fc9d441d0dc1003))
20
+
21
+
22
+
23
+
24
+
25
+ ## [2.123.6](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.123.5...@next-core/brick-kit@2.123.6) (2022-07-21)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * some optimization ([b50ed9c](https://github.com/easyops-cn/next-core/commit/b50ed9c16925a3fb6849d337efa301aaa6a62c8d))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [2.123.5](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.123.4...@next-core/brick-kit@2.123.5) (2022-07-20)
7
37
 
8
38
  **Note:** Version bump only for package @next-core/brick-kit
@@ -1136,14 +1136,21 @@
1136
1136
 
1137
1137
  /* istanbul ignore next */
1138
1138
  function devtoolsHookEmit(type, payload) {
1139
- Promise.resolve().then(() => {
1139
+ var emit = () => {
1140
1140
  var _getDevHook, _getDevHook$emit;
1141
1141
 
1142
1142
  (_getDevHook = getDevHook()) === null || _getDevHook === void 0 ? void 0 : (_getDevHook$emit = _getDevHook.emit) === null || _getDevHook$emit === void 0 ? void 0 : _getDevHook$emit.call(_getDevHook, {
1143
1143
  type,
1144
1144
  payload
1145
1145
  });
1146
- });
1146
+ }; // Try to emit only in idle time.
1147
+
1148
+
1149
+ if (typeof window.requestIdleCallback === "function") {
1150
+ window.requestIdleCallback(emit);
1151
+ } else {
1152
+ setTimeout(emit, 0);
1153
+ }
1147
1154
  }
1148
1155
  function listenDevtools() {
1149
1156
  window.addEventListener("message", event => {
@@ -6973,19 +6980,29 @@
6973
6980
  return flag;
6974
6981
  }
6975
6982
  function transformFormData(data) {
6983
+ if (data instanceof FormData) {
6984
+ return data;
6985
+ }
6986
+
6976
6987
  var formData = new FormData();
6977
6988
 
6978
- for (var [key, value] of Object.entries(data)) {
6989
+ var _loop = function (key, value) {
6979
6990
  if (Array.isArray(value)) {
6980
- (function () {
6981
- var k = "".concat(key, "[]");
6982
- value.forEach(v => {
6983
- formData.append(k, v);
6984
- });
6985
- })();
6991
+ value.forEach(v => {
6992
+ formData.append(key, v);
6993
+ });
6994
+ } else if (_.isObject(value) && !(value instanceof Blob) && !(value instanceof Date)) {
6995
+ Object.entries(value).forEach(_ref => {
6996
+ var [k, v] = _ref;
6997
+ formData.append("".concat(key, "[").concat(k, "]"), v);
6998
+ });
6986
6999
  } else {
6987
7000
  formData.append(key, value);
6988
7001
  }
7002
+ };
7003
+
7004
+ for (var [key, value] of Object.entries(data)) {
7005
+ _loop(key, value);
6989
7006
  }
6990
7007
 
6991
7008
  return formData;
@@ -6995,14 +7012,14 @@
6995
7012
  }
6996
7013
 
6997
7014
  function _CustomApi() {
6998
- _CustomApi = _asyncToGenerator__default["default"](function* (_ref) {
7015
+ _CustomApi = _asyncToGenerator__default["default"](function* (_ref2) {
6999
7016
  var {
7000
7017
  url,
7001
7018
  method = "GET",
7002
7019
  responseWrapper = true,
7003
7020
  ext_fields = [],
7004
7021
  request
7005
- } = _ref;
7022
+ } = _ref2;
7006
7023
  var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
7007
7024
  var response;
7008
7025