@next-core/brick-kit 2.89.1 → 2.90.2

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,54 @@
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.90.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.90.1...@next-core/brick-kit@2.90.2) (2021-12-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * remove flags ([ed7f66b](https://github.com/easyops-cn/next-core/commit/ed7f66b40c5be427171ec5fc8817eee64c499f60))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.90.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.90.0...@next-core/brick-kit@2.90.1) (2021-11-29)
18
+
19
+ **Note:** Version bump only for package @next-core/brick-kit
20
+
21
+
22
+
23
+
24
+
25
+ # [2.90.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.89.2...@next-core/brick-kit@2.90.0) (2021-11-26)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * fix a regression of caching resolves ([e9cd56d](https://github.com/easyops-cn/next-core/commit/e9cd56d882d0a13ee1cb13c4ed752a15f2c15bfd))
31
+
32
+
33
+ ### Features
34
+
35
+ * support i18n in storyboard functions ([5891932](https://github.com/easyops-cn/next-core/commit/589193250f22735b20e93d32c807896f4ae0932b))
36
+ * support i18n in widgets ([6020545](https://github.com/easyops-cn/next-core/commit/60205457fedbc7c000bb60b1e97729e3151be33d))
37
+ * support img in widgets ([f19ad53](https://github.com/easyops-cn/next-core/commit/f19ad5329b95c71e612f4be0ffa57b5a3d9ec570))
38
+
39
+
40
+
41
+
42
+
43
+ ## [2.89.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.89.1...@next-core/brick-kit@2.89.2) (2021-11-25)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * get stroyboard v2 ([602d086](https://github.com/easyops-cn/next-core/commit/602d0860fc6c7c9e5ffc116ff023addb0f57efe1))
49
+
50
+
51
+
52
+
53
+
6
54
  ## [2.89.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.89.0...@next-core/brick-kit@2.89.1) (2021-11-25)
7
55
 
8
56
 
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('history'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/helpers/defineProperty'), require('react'), require('lodash'), require('@next-core/brick-utils'), require('@next-core/brick-http'), require('i18next'), require('moment'), require('@next-core/pipes'), require('@next-core/easyops-analytics'), require('js-yaml'), require('antd'), require('@ant-design/icons'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/helpers/defineProperty', 'react', 'lodash', '@next-core/brick-utils', '@next-core/brick-http', 'i18next', 'moment', '@next-core/pipes', '@next-core/easyops-analytics', 'js-yaml', 'antd', '@ant-design/icons', 'react-i18next', '@babel/runtime/helpers/esm/extends', '@next-core/illustrations', '@babel/runtime/helpers/decorate'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._asyncToGenerator$4, global._defineProperty$2, global.React, global.lodash, global.brickUtils, global.brickHttp, global.i18next, global.moment, global.pipes, global.easyopsAnalytics, global.yaml, global.antd, global.icons, global.reactI18next, global._extends$2, global.illustrations, global._decorate));
5
- })(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _asyncToGenerator$4, _defineProperty$2, React, lodash, brickUtils, brickHttp, i18next, moment, pipes, easyopsAnalytics, yaml, antd, icons, reactI18next, _extends$2, illustrations, _decorate) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._asyncToGenerator$4, global._defineProperty$1, global.React, global.lodash, global.brickUtils, global.brickHttp, global.i18next, global.moment, global.pipes, global.easyopsAnalytics, global.yaml, global.antd, global.icons, global.reactI18next, global._extends$2, global.illustrations, global._decorate));
5
+ })(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _asyncToGenerator$4, _defineProperty$1, React, lodash, brickUtils, brickHttp, i18next, moment, pipes, easyopsAnalytics, yaml, antd, icons, reactI18next, _extends$2, illustrations, _decorate) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -27,7 +27,7 @@
27
27
  var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
28
28
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
29
29
  var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator$4);
30
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty$2);
30
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty$1);
31
31
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
  var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
@@ -426,7 +426,7 @@
426
426
  };
427
427
  }
428
428
 
429
- function _defineProperty$1(obj, key, value) {
429
+ function _defineProperty(obj, key, value) {
430
430
  if (key in obj) {
431
431
  Object.defineProperty(obj, key, {
432
432
  value: value,
@@ -441,7 +441,7 @@
441
441
  return obj;
442
442
  }
443
443
 
444
- function ownKeys$1(object, enumerableOnly) {
444
+ function ownKeys(object, enumerableOnly) {
445
445
  var keys = Object.keys(object);
446
446
 
447
447
  if (Object.getOwnPropertySymbols) {
@@ -455,18 +455,18 @@
455
455
  return keys;
456
456
  }
457
457
 
458
- function _objectSpread2$1(target) {
458
+ function _objectSpread2(target) {
459
459
  for (var i = 1; i < arguments.length; i++) {
460
460
  var source = arguments[i] != null ? arguments[i] : {};
461
461
 
462
462
  if (i % 2) {
463
- ownKeys$1(Object(source), true).forEach(function (key) {
464
- _defineProperty$1(target, key, source[key]);
463
+ ownKeys(Object(source), true).forEach(function (key) {
464
+ _defineProperty(target, key, source[key]);
465
465
  });
466
466
  } else if (Object.getOwnPropertyDescriptors) {
467
467
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
468
468
  } else {
469
- ownKeys$1(Object(source)).forEach(function (key) {
469
+ ownKeys(Object(source)).forEach(function (key) {
470
470
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
471
471
  });
472
472
  }
@@ -484,7 +484,7 @@
484
484
  var _ref = _asyncToGenerator$3(function* (objectId, instanceId, params, options) {
485
485
  return (
486
486
  /**! @contract easyops.api.cmdb.instance.GetDetail */
487
- (yield brickHttp.http.get("api/gateway/cmdb.instance.GetDetail/object/".concat(objectId, "/instance/").concat(instanceId), _objectSpread2$1(_objectSpread2$1({}, options), {}, {
487
+ (yield brickHttp.http.get("api/gateway/cmdb.instance.GetDetail/object/".concat(objectId, "/instance/").concat(instanceId), _objectSpread2(_objectSpread2({}, options), {}, {
488
488
  params
489
489
  }))).data
490
490
  );
@@ -685,12 +685,12 @@
685
685
  };
686
686
  }
687
687
 
688
- function imagesFactory(app) {
688
+ function imagesFactory(appId, isBuildPush) {
689
689
  return {
690
690
  get(name) {
691
691
  var _window$PUBLIC_ROOT;
692
692
 
693
- return app.isBuildPush ? "api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/".concat(name) : "".concat((_window$PUBLIC_ROOT = window.PUBLIC_ROOT) !== null && _window$PUBLIC_ROOT !== void 0 ? _window$PUBLIC_ROOT : "", "micro-apps/").concat(app.id, "/images/").concat(name);
693
+ return isBuildPush ? "api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/".concat(name) : "".concat((_window$PUBLIC_ROOT = window.PUBLIC_ROOT) !== null && _window$PUBLIC_ROOT !== void 0 ? _window$PUBLIC_ROOT : "", "micro-apps/").concat(appId, "/images/").concat(name);
694
694
  }
695
695
 
696
696
  };
@@ -1389,11 +1389,55 @@
1389
1389
  }
1390
1390
  }
1391
1391
 
1392
+ var locale$7 = {
1393
+ [K.REQUEST_FAILED]: "Request Failed",
1394
+ [K.MODAL_OK]: "Ok",
1395
+ [K.MODAL_CANCEL]: "Cancel",
1396
+ [K.SOMETHING_WENT_WRONG]: "Something went wrong!",
1397
+ [K.LOGIN_TIMEOUT_MESSAGE]: "You haven't logged in or your login session has expired. Login right now?",
1398
+ [K.NETWORK_ERROR]: "Network error, please check your network."
1399
+ };
1400
+ var en = locale$7;
1401
+
1402
+ var locale$6 = {
1403
+ [K.REQUEST_FAILED]: "请求失败",
1404
+ [K.MODAL_OK]: "确认",
1405
+ [K.MODAL_CANCEL]: "取消",
1406
+ [K.SOMETHING_WENT_WRONG]: "出现了一些问题!",
1407
+ [K.LOGIN_TIMEOUT_MESSAGE]: "您还未登录或登录信息已过期,现在重新登录?",
1408
+ [K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。"
1409
+ };
1410
+ var zh = locale$6;
1411
+
1412
+ /** @internal */
1413
+
1414
+ var initI18n = () => {
1415
+ i18next__default["default"].addResourceBundle("en", NS_BRICK_KIT, en);
1416
+ i18next__default["default"].addResourceBundle("zh", NS_BRICK_KIT, zh);
1417
+ };
1418
+ /** @internal */
1419
+
1420
+ function getI18nNamespace(type, id) {
1421
+ return "$".concat(type, "-").concat(id);
1422
+ }
1423
+
1424
+ function registerWidgetI18n(widgetId, i18n) {
1425
+ var ns = getI18nNamespace("widget", widgetId);
1426
+ Object.entries(i18n).forEach(_ref => {
1427
+ var [lang, resources] = _ref;
1428
+ i18next__default["default"].addResourceBundle(lang, ns, resources);
1429
+ });
1430
+ }
1431
+ function widgetI18nFactory(widgetId) {
1432
+ return i18next.getFixedT(null, getI18nNamespace("widget", widgetId));
1433
+ }
1434
+
1392
1435
  /** @internal */
1393
1436
 
1394
1437
  /** @internal */
1395
1438
  function StoryboardFunctionRegistryFactory() {
1396
1439
  var {
1440
+ widgetId,
1397
1441
  collectCoverage
1398
1442
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1399
1443
  var registeredFunctions = new Map(); // Use `Proxy` with a frozen target, to make a readonly function registry.
@@ -1405,7 +1449,30 @@
1405
1449
 
1406
1450
  });
1407
1451
 
1408
- function registerStoryboardFunctions(functions) {
1452
+ var builtinSupply = _objectSpread__default["default"]({
1453
+ // Functions can call other functions.
1454
+ FN: storyboardFunctions
1455
+ }, collectCoverage ? {
1456
+ // Fake builtin methods for tests.
1457
+ I18N: lodash.identity,
1458
+ I18N_TEXT: fakeI18nText,
1459
+ IMG: fakeImageFactory()
1460
+ } : widgetId ? {
1461
+ I18N: widgetI18nFactory(widgetId),
1462
+ I18N_TEXT: i18nText,
1463
+ IMG: widgetImagesFactory(widgetId)
1464
+ } : {
1465
+ I18N_TEXT: i18nText
1466
+ });
1467
+
1468
+ function registerStoryboardFunctions(functions, app) {
1469
+ if (app) {
1470
+ Object.assign(builtinSupply, {
1471
+ I18N: i18next.getFixedT(null, getI18nNamespace("app", app.id)),
1472
+ IMG: imagesFactory(app.id, app.isBuildPush)
1473
+ });
1474
+ }
1475
+
1409
1476
  registeredFunctions.clear();
1410
1477
 
1411
1478
  if (Array.isArray(functions)) {
@@ -1445,10 +1512,7 @@
1445
1512
  rules: {
1446
1513
  noVar: true
1447
1514
  },
1448
- globalVariables: supply(precooked.attemptToVisitGlobals, {
1449
- // Functions can call other functions.
1450
- FN: storyboardFunctions
1451
- }),
1515
+ globalVariables: supply(precooked.attemptToVisitGlobals, builtinSupply),
1452
1516
  hooks: collector && {
1453
1517
  beforeEvaluate: collector.beforeEvaluate,
1454
1518
  beforeCall: collector.beforeCall,
@@ -1473,6 +1537,19 @@
1473
1537
  };
1474
1538
  }
1475
1539
 
1540
+ function fakeI18nText(data) {
1541
+ return data === null || data === void 0 ? void 0 : data.en;
1542
+ }
1543
+
1544
+ function fakeImageFactory() {
1545
+ return {
1546
+ get(name) {
1547
+ return "mock/images/".concat(name);
1548
+ }
1549
+
1550
+ };
1551
+ }
1552
+
1476
1553
  var {
1477
1554
  storyboardFunctions,
1478
1555
  registerStoryboardFunctions
@@ -1494,7 +1571,9 @@
1494
1571
  var {
1495
1572
  storyboardFunctions,
1496
1573
  registerStoryboardFunctions
1497
- } = StoryboardFunctionRegistryFactory();
1574
+ } = StoryboardFunctionRegistryFactory({
1575
+ widgetId
1576
+ });
1498
1577
  widgetFunctionRegistry.set(widgetId, storyboardFunctions);
1499
1578
  registerStoryboardFunctions(functions);
1500
1579
  }
@@ -1665,7 +1744,7 @@
1665
1744
  }
1666
1745
 
1667
1746
  if (attemptToVisitGlobals.has("IMG")) {
1668
- globalVariables.IMG = imagesFactory(app);
1747
+ globalVariables.IMG = imagesFactory(app.id, app.isBuildPush);
1669
1748
  }
1670
1749
 
1671
1750
  if (attemptToVisitGlobals.has("__WIDGET_IMG__")) {
@@ -1673,7 +1752,11 @@
1673
1752
  }
1674
1753
 
1675
1754
  if (attemptToVisitGlobals.has("I18N")) {
1676
- globalVariables.I18N = i18next__default["default"].getFixedT(null, "$app-".concat(app.id));
1755
+ globalVariables.I18N = i18next__default["default"].getFixedT(null, getI18nNamespace("app", app.id));
1756
+ }
1757
+
1758
+ if (attemptToVisitGlobals.has("__WIDGET_I18N__")) {
1759
+ globalVariables.__WIDGET_I18N__ = widgetI18nFactory;
1677
1760
  }
1678
1761
 
1679
1762
  if (attemptToVisitGlobals.has("I18N_TEXT")) {
@@ -2465,6 +2548,8 @@
2465
2548
 
2466
2549
  _defineProperty__default["default"](this, "registerWidgetFunctions", registerWidgetFunctions);
2467
2550
 
2551
+ _defineProperty__default["default"](this, "registerWidgetI18n", registerWidgetI18n);
2552
+
2468
2553
  _defineProperty__default["default"](this, "getBasePath", getBasePath);
2469
2554
 
2470
2555
  _defineProperty__default["default"](this, "getCurrentTheme", getCurrentTheme);
@@ -4769,6 +4854,26 @@
4769
4854
  return _ref.apply(this, arguments);
4770
4855
  };
4771
4856
  }();
4857
+ /**
4858
+ * @description 获取app storyboard初始化信息
4859
+ * @endpoint GET /api/auth/v2/bootstrap/:appId
4860
+ */
4861
+
4862
+
4863
+ var BootstrapV2Api_getAppStoryboardV2 = /*#__PURE__*/function () {
4864
+ var _ref = _asyncToGenerator__default["default"](function* (appId, params, options) {
4865
+ return (
4866
+ /**! @contract easyops.api.api_gateway.bootstrap_v2.GetAppStoryboardV2@1.0.0 */
4867
+ (yield brickHttp.http.get("api/auth/v2/bootstrap/".concat(appId), _objectSpread__default["default"](_objectSpread__default["default"]({}, options), {}, {
4868
+ params
4869
+ }))).data
4870
+ );
4871
+ });
4872
+
4873
+ return function BootstrapV2Api_getAppStoryboardV2(_x, _x2, _x3) {
4874
+ return _ref.apply(this, arguments);
4875
+ };
4876
+ }();
4772
4877
  /**
4773
4878
  * @description 通过defaultOrg查找单个契约信息
4774
4879
  * @endpoint POST /api/contract/single_search
@@ -5723,55 +5828,6 @@
5723
5828
  };
5724
5829
  }
5725
5830
 
5726
- function _defineProperty(obj, key, value) {
5727
- if (key in obj) {
5728
- Object.defineProperty(obj, key, {
5729
- value: value,
5730
- enumerable: true,
5731
- configurable: true,
5732
- writable: true
5733
- });
5734
- } else {
5735
- obj[key] = value;
5736
- }
5737
-
5738
- return obj;
5739
- }
5740
-
5741
- function ownKeys(object, enumerableOnly) {
5742
- var keys = Object.keys(object);
5743
-
5744
- if (Object.getOwnPropertySymbols) {
5745
- var symbols = Object.getOwnPropertySymbols(object);
5746
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
5747
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
5748
- });
5749
- keys.push.apply(keys, symbols);
5750
- }
5751
-
5752
- return keys;
5753
- }
5754
-
5755
- function _objectSpread2(target) {
5756
- for (var i = 1; i < arguments.length; i++) {
5757
- var source = arguments[i] != null ? arguments[i] : {};
5758
-
5759
- if (i % 2) {
5760
- ownKeys(Object(source), true).forEach(function (key) {
5761
- _defineProperty(target, key, source[key]);
5762
- });
5763
- } else if (Object.getOwnPropertyDescriptors) {
5764
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5765
- } else {
5766
- ownKeys(Object(source)).forEach(function (key) {
5767
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5768
- });
5769
- }
5770
- }
5771
-
5772
- return target;
5773
- }
5774
-
5775
5831
  var checkLogin = /*#__PURE__*/function () {
5776
5832
  var _ref2 = _asyncToGenerator$1(function* (options) {
5777
5833
  return (yield brickHttp.http.get("api/auth/login", options)).data;
@@ -5782,30 +5838,6 @@
5782
5838
  };
5783
5839
  }();
5784
5840
 
5785
- var bootstrap = /*#__PURE__*/function () {
5786
- var _ref3 = _asyncToGenerator$1(function* (params, options) {
5787
- return (yield brickHttp.http.get("api/auth/bootstrap", _objectSpread2(_objectSpread2({}, options), {}, {
5788
- params
5789
- }))).data;
5790
- });
5791
-
5792
- return function bootstrap(_x4, _x5) {
5793
- return _ref3.apply(this, arguments);
5794
- };
5795
- }();
5796
-
5797
- var getAppStoryboard = /*#__PURE__*/function () {
5798
- var _ref4 = _asyncToGenerator$1(function* (appId, params, options) {
5799
- return (yield brickHttp.http.get("api/auth/bootstrap/".concat(appId), _objectSpread2(_objectSpread2({}, options), {}, {
5800
- params
5801
- }))).data;
5802
- });
5803
-
5804
- return function getAppStoryboard(_x6, _x7, _x8) {
5805
- return _ref4.apply(this, arguments);
5806
- };
5807
- }();
5808
-
5809
5841
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
5810
5842
  try {
5811
5843
  var info = gen[key](arg);
@@ -6231,17 +6263,12 @@
6231
6263
  var _this3 = this;
6232
6264
 
6233
6265
  return _asyncToGenerator__default["default"](function* () {
6234
- // Todo(jojiang): boostrap V2 接口测试通过后移除 V1 版本的兼容
6235
- var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
6266
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
6236
6267
  appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6237
6268
  ignoreTemplateFields: "templates",
6238
6269
  ignoreBrickFields: "bricks,processors,providers,editors"
6239
6270
  }, params), {
6240
6271
  interceptorParams
6241
- }) : bootstrap(_objectSpread__default["default"]({
6242
- brief: true
6243
- }, params), {
6244
- interceptorParams
6245
6272
  });
6246
6273
 
6247
6274
  var bootstrapResponse = _objectSpread__default["default"]({
@@ -6292,7 +6319,7 @@
6292
6319
  routes,
6293
6320
  meta,
6294
6321
  app
6295
- } = yield getAppStoryboard(storyboard.app.id);
6322
+ } = yield BootstrapV2Api_getAppStoryboardV2(storyboard.app.id, {});
6296
6323
  Object.assign(storyboard, {
6297
6324
  routes,
6298
6325
  meta,
@@ -6305,7 +6332,7 @@
6305
6332
 
6306
6333
  if ((_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 && _storyboard$meta.i18n) {
6307
6334
  // Prefix to avoid conflict between brick package's i18n namespace.
6308
- var i18nNamespace = "$app-".concat(storyboard.app.id); // Support any language in `meta.i18n`.
6335
+ var i18nNamespace = getI18nNamespace("app", storyboard.app.id); // Support any language in `meta.i18n`.
6309
6336
 
6310
6337
  Object.entries(storyboard.meta.i18n).forEach(_ref => {
6311
6338
  var [lang, resources] = _ref;
@@ -8955,12 +8982,13 @@
8955
8982
  } else {
8956
8983
  var actualArgs = args ? ref ? args // `args` are already computed for `defineResolves`
8957
8984
  : context ? computeRealValue(args, context, true) : args : providerBrick.args || [];
8985
+ promise = _asyncToGenerator__default["default"](function* () {
8986
+ if (useProvider) {
8987
+ actualArgs = yield getArgsOfCustomApi(useProvider, actualArgs);
8988
+ }
8958
8989
 
8959
- if (useProvider) {
8960
- actualArgs = yield getArgsOfCustomApi(useProvider, actualArgs);
8961
- }
8962
-
8963
- promise = providerBrick[method](...actualArgs);
8990
+ return providerBrick[method](...actualArgs);
8991
+ })();
8964
8992
 
8965
8993
  _this2.cache.set(cacheKey, promise);
8966
8994
  }
@@ -9028,7 +9056,7 @@
9028
9056
 
9029
9057
  var _loop = function (providerBrick, interval) {
9030
9058
  var request = /*#__PURE__*/function () {
9031
- var _ref = _asyncToGenerator__default["default"](function* () {
9059
+ var _ref2 = _asyncToGenerator__default["default"](function* () {
9032
9060
  yield providerBrick.$refresh({
9033
9061
  ignoreErrors: interval.ignoreErrors,
9034
9062
  throwErrors: true,
@@ -9042,7 +9070,7 @@
9042
9070
  });
9043
9071
 
9044
9072
  return function request() {
9045
- return _ref.apply(this, arguments);
9073
+ return _ref2.apply(this, arguments);
9046
9074
  };
9047
9075
  }();
9048
9076
 
@@ -9284,7 +9312,7 @@
9284
9312
 
9285
9313
  _this3.kernel.registerCustomTemplatesInStoryboard(storyboard);
9286
9314
 
9287
- registerStoryboardFunctions((_storyboard$meta = storyboard.meta) === null || _storyboard$meta === void 0 ? void 0 : _storyboard$meta.functions);
9315
+ registerStoryboardFunctions((_storyboard$meta = storyboard.meta) === null || _storyboard$meta === void 0 ? void 0 : _storyboard$meta.functions, storyboard.app);
9288
9316
  }
9289
9317
 
9290
9318
  var {
@@ -9610,33 +9638,6 @@
9610
9638
  return runtime;
9611
9639
  }
9612
9640
 
9613
- var locale$7 = {
9614
- [K.REQUEST_FAILED]: "Request Failed",
9615
- [K.MODAL_OK]: "Ok",
9616
- [K.MODAL_CANCEL]: "Cancel",
9617
- [K.SOMETHING_WENT_WRONG]: "Something went wrong!",
9618
- [K.LOGIN_TIMEOUT_MESSAGE]: "You haven't logged in or your login session has expired. Login right now?",
9619
- [K.NETWORK_ERROR]: "Network error, please check your network."
9620
- };
9621
- var en = locale$7;
9622
-
9623
- var locale$6 = {
9624
- [K.REQUEST_FAILED]: "请求失败",
9625
- [K.MODAL_OK]: "确认",
9626
- [K.MODAL_CANCEL]: "取消",
9627
- [K.SOMETHING_WENT_WRONG]: "出现了一些问题!",
9628
- [K.LOGIN_TIMEOUT_MESSAGE]: "您还未登录或登录信息已过期,现在重新登录?",
9629
- [K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。"
9630
- };
9631
- var zh = locale$6;
9632
-
9633
- /** @internal */
9634
-
9635
- var initI18n = () => {
9636
- i18next__default["default"].addResourceBundle("en", NS_BRICK_KIT, en);
9637
- i18next__default["default"].addResourceBundle("zh", NS_BRICK_KIT, zh);
9638
- };
9639
-
9640
9641
  // Ref https://reactjs.org/docs/error-boundaries.html
9641
9642
  class LegacyErrorBoundary extends React__default["default"].Component {
9642
9643
  constructor(props) {