@next-core/brick-kit 2.194.2 → 2.195.1

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/dist/index.esm.js CHANGED
@@ -10,7 +10,7 @@ import { pipes } from '@next-core/pipes';
10
10
  import i18next, { getFixedT } from 'i18next';
11
11
  import React, { useState, useEffect, useMemo, useContext, createContext, useRef, useReducer, useCallback } from 'react';
12
12
  import { http, HttpResponseError, HttpAbortError, HttpFetchError } from '@next-core/brick-http';
13
- import { userAnalytics, apiAnalyzer } from '@next-core/easyops-analytics';
13
+ import { userAnalytics, apiAnalyzer, SkywalkingAnalysis } from '@next-core/easyops-analytics';
14
14
  import { Modal, message, Empty, ConfigProvider } from 'antd';
15
15
  import { ExclamationCircleOutlined } from '@ant-design/icons';
16
16
  import yaml from 'js-yaml';
@@ -7084,6 +7084,28 @@ var UserAdminApi_searchAllUsersInfo = /*#__PURE__*/function () {
7084
7084
  };
7085
7085
  }();
7086
7086
 
7087
+ function setAppLocales(app) {
7088
+ var _locales, _app$config, _app$config$settings;
7089
+ var locales = (_locales = (_app$config = app.config) === null || _app$config === void 0 ? void 0 : (_app$config$settings = _app$config.settings) === null || _app$config$settings === void 0 ? void 0 : _app$config$settings.locales) !== null && _locales !== void 0 ? _locales : app.locales;
7090
+ if (locales) {
7091
+ // Prefix to avoid conflict between brick package's i18n namespace.
7092
+ var ns = "$tmp-".concat(app.id);
7093
+ // Support any languages in `app.locales`.
7094
+ Object.entries(locales).forEach(_ref => {
7095
+ var [lang, resources] = _ref;
7096
+ i18next.addResourceBundle(lang, ns, resources);
7097
+ });
7098
+ // Use `app.name` as the fallback `app.localeName`.
7099
+ app.localeName = i18next.getFixedT(null, ns)("name", app.name);
7100
+ // Remove the temporary i18n resource bundles.
7101
+ Object.keys(locales).forEach(lang => {
7102
+ i18next.removeResourceBundle(lang, ns);
7103
+ });
7104
+ } else {
7105
+ app.localeName = app.name;
7106
+ }
7107
+ }
7108
+
7087
7109
  /**
7088
7110
  * Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
7089
7111
  *
@@ -7094,6 +7116,7 @@ function processBootstrapResponse(bootstrapResponse) {
7094
7116
  var app = storyboard.app;
7095
7117
  if (app) {
7096
7118
  app.config = deepFreeze(merge({}, app.defaultConfig, app.userConfig));
7119
+ setAppLocales(storyboard.app);
7097
7120
  }
7098
7121
  }
7099
7122
  if (bootstrapResponse.settings) {
@@ -11848,28 +11871,6 @@ function setWatermark() {
11848
11871
  }
11849
11872
  }
11850
11873
 
11851
- function setAppLocales(app) {
11852
- var _locales, _app$config, _app$config$settings;
11853
- var locales = (_locales = (_app$config = app.config) === null || _app$config === void 0 ? void 0 : (_app$config$settings = _app$config.settings) === null || _app$config$settings === void 0 ? void 0 : _app$config$settings.locales) !== null && _locales !== void 0 ? _locales : app.locales;
11854
- if (locales) {
11855
- // Prefix to avoid conflict between brick package's i18n namespace.
11856
- var ns = "$tmp-".concat(app.id);
11857
- // Support any languages in `app.locales`.
11858
- Object.entries(locales).forEach(_ref => {
11859
- var [lang, resources] = _ref;
11860
- i18next.addResourceBundle(lang, ns, resources);
11861
- });
11862
- // Use `app.name` as the fallback `app.localeName`.
11863
- app.localeName = i18next.getFixedT(null, ns)("name", app.name);
11864
- // Remove the temporary i18n resource bundles.
11865
- Object.keys(locales).forEach(lang => {
11866
- i18next.removeResourceBundle(lang, ns);
11867
- });
11868
- } else {
11869
- app.localeName = app.name;
11870
- }
11871
- }
11872
-
11873
11874
  class Router {
11874
11875
  constructor(kernel) {
11875
11876
  _defineProperty$1(this, "defaultCollapsed", false);
@@ -12030,6 +12031,9 @@ class Router {
12030
12031
  // Create the page tracker before page load.
12031
12032
  // And the API Analyzer maybe disabled.
12032
12033
  var tracePageEnd = (_apiAnalyzer$getInsta = apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.tracePage();
12034
+ SkywalkingAnalysis.setPerformance({
12035
+ pagePath: "".concat(location.pathname).concat(location.search)
12036
+ });
12033
12037
  var locationContext = _this3.locationContext = new LocationContext(_this3.kernel, location, renderId);
12034
12038
  if (window.DEVELOPER_PREVIEW) {
12035
12039
  return;
@@ -12588,12 +12592,9 @@ class LegacyErrorBoundary extends React.Component {
12588
12592
  error
12589
12593
  };
12590
12594
  }
12591
-
12592
- /* componentDidCatch(error, info) {
12593
- // You can also log the error to an error reporting service
12594
- logErrorToMyService(error, info);
12595
- } */
12596
-
12595
+ componentDidCatch(error) {
12596
+ SkywalkingAnalysis.reportFrameErrors(error);
12597
+ }
12597
12598
  render() {
12598
12599
  if (this.state.error) {
12599
12600
  // You can render any custom fallback UI
@@ -15128,5 +15129,5 @@ function constructEventListener(handler) {
15128
15129
  });
15129
15130
  }
15130
15131
 
15131
- export { BrickAsComponent, BrickAsComponentFactory, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ForwardRefSingleBrickAsComponentFactory, ModalElement, SingleBrickAsComponent, SingleBrickAsComponentFactory, StoryboardFunctionRegistryFactory, UpdatingElement, WebsocketMessageRequest, WebsocketMessageResponse, abortController, applyTheme, authenticate, batchSetAppsLocalTheme, checkIf, checkIfByTransform, clearDebugContract, collectDebugContract, constructEventListener, createHistory, createRuntime, createWebSocket, developHelper, doTransform, event, getAuth, getCssPropertyValue, getCurrentTheme, getHistory, getMockInfo, getRealValue, getRuntime, getRuntimeMisc, getWebSocket, handleHttpError, httpErrorToString, i18nText, initI18n, isLoggedIn, logout, looseCheckIf$1 as looseCheckIf, looseCheckIfByTransform, looseCheckIfOfComputed, method, preprocessTransformProperties, property, reTransformForDevtools, renderEasyopsEmpty, transformElementProperties, transformIntermediateData, transformProperties, useApplyPageTitle, useCurrentApp, useCurrentMode, useCurrentTheme, useFeatureFlags, useLocation, useProvider, useRecentApps };
15132
+ export { BrickAsComponent, BrickAsComponentFactory, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ForwardRefSingleBrickAsComponentFactory, ModalElement, SingleBrickAsComponent, SingleBrickAsComponentFactory, StoryboardFunctionRegistryFactory, UpdatingElement, WebsocketMessageRequest, WebsocketMessageResponse, abortController, applyTheme, authenticate, batchSetAppsLocalTheme, checkIf, checkIfByTransform, clearDebugContract, collectDebugContract, constructEventListener, createHistory, createRuntime, createWebSocket, developHelper, doTransform, event, getAuth, getCssPropertyValue, getCurrentTheme, getHistory, getMockInfo, getRealValue, getRuntime, getRuntimeMisc, getWebSocket, handleHttpError, httpErrorToString, i18nText, initI18n, isLoggedIn, logout, looseCheckIf$1 as looseCheckIf, looseCheckIfByTransform, looseCheckIfOfComputed, method, preprocessTransformProperties, property, reTransformForDevtools, renderEasyopsEmpty, setAppLocales, transformElementProperties, transformIntermediateData, transformProperties, useApplyPageTitle, useCurrentApp, useCurrentMode, useCurrentTheme, useFeatureFlags, useLocation, useProvider, useRecentApps };
15132
15133
  //# sourceMappingURL=index.esm.js.map