@next-core/brick-kit 2.117.2 → 2.117.5
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 +35 -0
- package/dist/index.bundle.js +35 -23
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +35 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/LocationContext.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
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.117.5](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.4...@next-core/brick-kit@2.117.5) (2022-04-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* useProvider hook 支持query查询provider ([c8581e8](https://github.com/easyops-cn/next-core/commit/c8581e877f740f4218ac296eaa6448ce54be2803))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.117.4](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.3...@next-core/brick-kit@2.117.4) (2022-04-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* bg bricks should have no slot ([0c93d41](https://github.com/easyops-cn/next-core/commit/0c93d417da911b5b7d012d81f73bdeeadbf4f9d2))
|
|
23
|
+
* no menu for template preview ([6f5ed88](https://github.com/easyops-cn/next-core/commit/6f5ed88002f61f105a6e2ab87481ffab2bbb0616))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [2.117.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.2...@next-core/brick-kit@2.117.3) (2022-04-08)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* fix getMenu later ([ebe69b9](https://github.com/easyops-cn/next-core/commit/ebe69b99e565e53d2e649bf6facc601b5cd0d544))
|
|
35
|
+
* update unit test ([104f0d1](https://github.com/easyops-cn/next-core/commit/104f0d1f0b9b741759743095b1e7d34294999803))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [2.117.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.1...@next-core/brick-kit@2.117.2) (2022-04-07)
|
|
7
42
|
|
|
8
43
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -8006,7 +8006,9 @@
|
|
|
8006
8006
|
path: previewPath,
|
|
8007
8007
|
bricks: [_objectSpread__default["default"]({
|
|
8008
8008
|
brick: templateId
|
|
8009
|
-
}, lodash.pick(settings, "properties"))]
|
|
8009
|
+
}, lodash.pick(settings, "properties"))],
|
|
8010
|
+
menu: false,
|
|
8011
|
+
exact: true
|
|
8010
8012
|
};
|
|
8011
8013
|
|
|
8012
8014
|
if (previewRouteIndex === -1) {
|
|
@@ -8948,8 +8950,8 @@
|
|
|
8948
8950
|
yield _this.preFetchMenu(route.context);
|
|
8949
8951
|
yield _this.mountRoutes(route.routes, slotId, mountRoutesResult);
|
|
8950
8952
|
} else if (isRouteConfOfBricks(route) && Array.isArray(route.bricks)) {
|
|
8951
|
-
yield _this.
|
|
8952
|
-
yield _this.
|
|
8953
|
+
yield _this.preFetchMenu(route);
|
|
8954
|
+
yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult); // analytics data (page_view event)
|
|
8953
8955
|
|
|
8954
8956
|
if (route.analyticsData) {
|
|
8955
8957
|
mountRoutesResult.analyticsData = computeRealValue(route.analyticsData, context, true);
|
|
@@ -9230,6 +9232,8 @@
|
|
|
9230
9232
|
}
|
|
9231
9233
|
|
|
9232
9234
|
if (expandedBrickConf.bg) {
|
|
9235
|
+
// A bg brick has no slotId.
|
|
9236
|
+
brick.slotId = undefined;
|
|
9233
9237
|
appendBrick(brick, _this6.kernel.mountPoints.bg);
|
|
9234
9238
|
} else {
|
|
9235
9239
|
if (expandedBrickConf.portal) {
|
|
@@ -10167,7 +10171,9 @@
|
|
|
10167
10171
|
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
10168
10172
|
bricks: [{
|
|
10169
10173
|
brick: "span"
|
|
10170
|
-
}]
|
|
10174
|
+
}],
|
|
10175
|
+
menu: false,
|
|
10176
|
+
exact: true
|
|
10171
10177
|
}), undefined, mountRoutesResult);
|
|
10172
10178
|
} catch (error) {
|
|
10173
10179
|
// eslint-disable-next-line no-console
|
|
@@ -13619,26 +13625,32 @@
|
|
|
13619
13625
|
var response = React.useRef();
|
|
13620
13626
|
var data = React.useRef(defaults.data);
|
|
13621
13627
|
var forceUpdate = React.useReducer(() => ({}), [])[1];
|
|
13622
|
-
var doFetch = React.useCallback( /*#__PURE__*/
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13628
|
+
var doFetch = React.useCallback( /*#__PURE__*/function () {
|
|
13629
|
+
var _ref = _asyncToGenerator__default["default"](function* (provider) {
|
|
13630
|
+
try {
|
|
13631
|
+
error.current = undefined;
|
|
13632
|
+
if (!suspense) setLoading(true);
|
|
13633
|
+
|
|
13634
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
13635
|
+
args[_key - 1] = arguments[_key];
|
|
13636
|
+
}
|
|
13626
13637
|
|
|
13627
|
-
|
|
13628
|
-
|
|
13638
|
+
var newRes = yield fetch(provider, ...args);
|
|
13639
|
+
response.current = newRes;
|
|
13640
|
+
data.current = transform(data.current, newRes);
|
|
13641
|
+
} catch (e) {
|
|
13642
|
+
error.current = e;
|
|
13629
13643
|
}
|
|
13630
13644
|
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
}
|
|
13635
|
-
error.current = e;
|
|
13636
|
-
}
|
|
13645
|
+
if (!suspense) setLoading(false);
|
|
13646
|
+
if (error.current) onError(error.current);
|
|
13647
|
+
return data.current;
|
|
13648
|
+
});
|
|
13637
13649
|
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13641
|
-
}), [provider, customOptions, dependencies, requestInit, suspense, transform, defaults.data, onError]);
|
|
13650
|
+
return function (_x) {
|
|
13651
|
+
return _ref.apply(this, arguments);
|
|
13652
|
+
};
|
|
13653
|
+
}(), [provider, customOptions, dependencies, requestInit, suspense, transform, defaults.data, onError]);
|
|
13642
13654
|
var makeFetch = React.useCallback( /*#__PURE__*/function () {
|
|
13643
13655
|
var _ref2 = _asyncToGenerator__default["default"](function* (providerOrBody, args) {
|
|
13644
13656
|
var providerStr = provider;
|
|
@@ -13658,7 +13670,7 @@
|
|
|
13658
13670
|
|
|
13659
13671
|
if (suspense) {
|
|
13660
13672
|
return _asyncToGenerator__default["default"](function* () {
|
|
13661
|
-
suspender.current = doFetch(...actualArgs).then(newData => {
|
|
13673
|
+
suspender.current = doFetch(providerStr, ...actualArgs).then(newData => {
|
|
13662
13674
|
suspenseStatus.current = "success";
|
|
13663
13675
|
return newData;
|
|
13664
13676
|
}, error => {
|
|
@@ -13671,10 +13683,10 @@
|
|
|
13671
13683
|
})();
|
|
13672
13684
|
}
|
|
13673
13685
|
|
|
13674
|
-
return doFetch(...actualArgs);
|
|
13686
|
+
return doFetch(providerStr, ...actualArgs);
|
|
13675
13687
|
});
|
|
13676
13688
|
|
|
13677
|
-
return function (
|
|
13689
|
+
return function (_x2, _x3) {
|
|
13678
13690
|
return _ref2.apply(this, arguments);
|
|
13679
13691
|
};
|
|
13680
13692
|
}(), [doFetch]);
|