@next-core/brick-kit 2.199.2 → 2.199.4
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.bundle.js +26 -24
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +27 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/LocationContext.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/core/StoryboardFunctionRegistryFactory.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
4
4
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _asyncToGenerator$3 from '@babel/runtime/helpers/asyncToGenerator';
|
|
6
6
|
import _, { escapeRegExp, set, get, difference, identity, uniqueId, isNil, isEmpty, merge, sortBy, cloneDeep, clamp, orderBy, pick, isObject as isObject$1, uniq, omit, findLastIndex, noop, isString as isString$1 } from 'lodash';
|
|
7
|
-
import { toPath, computeRealRoutePath, hasOwnProperty, isObject, isEvaluable, isTrackAll, trackAll, trackContext, trackState, trackFormState, transformAndInject, transform, JsonStorage, scanPermissionActionsInStoryboard, precookFunction, cook, collectContextUsage, deferResolveContextConcurrently, resolveContextConcurrently, syncResolveContextConcurrently, trackUsedFormState, trackUsedState, trackUsedContext, scanPermissionActionsInAny, deepFreeze, scanProcessorsInAny, preevaluate, shouldAllowRecursiveEvaluations, inject, matchPath, asyncProcessBrick, createProviderClass, removeDeadConditionsInTpl, getTemplateDepsOfStoryboard, getDllAndDepsOfStoryboard, asyncProcessStoryboard, getDllAndDepsByResource, scanRouteAliasInStoryboard, snippetEvaluate, scanCustomApisInStoryboard, prefetchScript, scanBricksInBrickConf, loadScript, scanAppGetMenuInAny, scanInstalledAppsInStoryboard, removeDeadConditions, restoreDynamicTemplates, scanStoryboard, mapCustomApisToNameAndNamespace } from '@next-core/brick-utils';
|
|
7
|
+
import { toPath, computeRealRoutePath, hasOwnProperty, isObject, isEvaluable, isTrackAll, trackAll, trackContext, trackState, trackFormState, transformAndInject, transform, JsonStorage, scanPermissionActionsInStoryboard, precookFunction, cook, collectContextUsage, deferResolveContextConcurrently, resolveContextConcurrently, syncResolveContextConcurrently, trackUsedFormState, trackUsedState, trackUsedContext, scanPermissionActionsInAny, deepFreeze, scanProcessorsInAny, preevaluate, shouldAllowRecursiveEvaluations, inject, matchPath, asyncProcessBrick, createProviderClass, removeDeadConditionsInTpl, getTemplateDepsOfStoryboard, getDllAndDepsOfStoryboard, asyncProcessStoryboard, getDllAndDepsByResource, scanRouteAliasInStoryboard, snippetEvaluate, scanCustomApisInStoryboard, prefetchScript, scanBricksInBrickConf, loadScript, scanAppGetMenuInAny, scanInstalledAppsInStoryboard, clearExpressionASTCache, clearFunctionASTCache, removeDeadConditions, restoreDynamicTemplates, scanStoryboard, mapCustomApisToNameAndNamespace } from '@next-core/brick-utils';
|
|
8
8
|
import moment from 'moment';
|
|
9
9
|
import { pipes } from '@next-core/pipes';
|
|
10
10
|
import i18next, { getFixedT } from 'i18next';
|
|
@@ -1466,6 +1466,7 @@ function StoryboardFunctionRegistryFactory() {
|
|
|
1466
1466
|
collector = collectCoverage.createCollector(name);
|
|
1467
1467
|
}
|
|
1468
1468
|
var precooked = precookFunction(fn.source, {
|
|
1469
|
+
cacheKey: fn,
|
|
1469
1470
|
typescript: fn.typescript,
|
|
1470
1471
|
hooks: collector && {
|
|
1471
1472
|
beforeVisit: collector.beforeVisit
|
|
@@ -2728,7 +2729,9 @@ function attemptToVisit(data, globals) {
|
|
|
2728
2729
|
if (globals.some(key => data.includes(key))) {
|
|
2729
2730
|
var {
|
|
2730
2731
|
attemptToVisitGlobals
|
|
2731
|
-
} = preevaluate(data
|
|
2732
|
+
} = preevaluate(data, {
|
|
2733
|
+
cache: true
|
|
2734
|
+
});
|
|
2732
2735
|
return globals.some(key => attemptToVisitGlobals.has(key));
|
|
2733
2736
|
}
|
|
2734
2737
|
} else if (globals.includes("APP")) {
|
|
@@ -2897,7 +2900,9 @@ function evaluate(raw) {
|
|
|
2897
2900
|
// A `SyntaxError` maybe thrown.
|
|
2898
2901
|
var precooked;
|
|
2899
2902
|
try {
|
|
2900
|
-
precooked = preevaluate(raw
|
|
2903
|
+
precooked = preevaluate(raw, {
|
|
2904
|
+
cache: true
|
|
2905
|
+
});
|
|
2901
2906
|
} catch (error) {
|
|
2902
2907
|
var message = "".concat(error.message, ", in \"").concat(raw, "\"");
|
|
2903
2908
|
if (options.isReEvaluation) {
|
|
@@ -10576,21 +10581,13 @@ class LocationContext {
|
|
|
10576
10581
|
tplContextId,
|
|
10577
10582
|
formContextId
|
|
10578
10583
|
} = _ref;
|
|
10579
|
-
var auth = getAuth();
|
|
10580
10584
|
var context = {
|
|
10581
10585
|
hash: this.location.hash,
|
|
10582
10586
|
pathname: this.location.pathname,
|
|
10583
10587
|
query: this.query,
|
|
10584
10588
|
match,
|
|
10585
10589
|
app: this.kernel.nextApp,
|
|
10586
|
-
sys: _objectSpread({
|
|
10587
|
-
org: auth.org,
|
|
10588
|
-
username: auth.username,
|
|
10589
|
-
userInstanceId: auth.userInstanceId,
|
|
10590
|
-
loginFrom: auth.loginFrom,
|
|
10591
|
-
accessRule: auth.accessRule,
|
|
10592
|
-
isAdmin: auth.isAdmin
|
|
10593
|
-
}, getRuntimeMisc()),
|
|
10590
|
+
sys: _objectSpread(_objectSpread({}, getAuth()), getRuntimeMisc()),
|
|
10594
10591
|
flags: this.kernel.getFeatureFlags(),
|
|
10595
10592
|
segues: this.segues,
|
|
10596
10593
|
storyboardContext: this.storyboardContextWrapper.get(),
|
|
@@ -12093,7 +12090,7 @@ class Router {
|
|
|
12093
12090
|
render(location) {
|
|
12094
12091
|
var _this3 = this;
|
|
12095
12092
|
return _asyncToGenerator$3(function* () {
|
|
12096
|
-
var _apiAnalyzer$getInsta, _storyboard$app, _this3$kernel$previou, _currentApp$config,
|
|
12093
|
+
var _apiAnalyzer$getInsta, _storyboard$app, _this3$kernel$previou, _currentApp, _currentApp2, _currentApp2$config, _currentApp2$config$_, _this3$kernel$bootstr, _this3$kernel$bootstr2, _getLocalAppsTheme, _currentApp3, _currentApp4, _storyboard$app$homep, _storyboard$app2;
|
|
12097
12094
|
_this3.state = "initial";
|
|
12098
12095
|
var renderId = _this3.renderId = uniqueId("render-id-");
|
|
12099
12096
|
resetAllInjected();
|
|
@@ -12125,6 +12122,14 @@ class Router {
|
|
|
12125
12122
|
version: storyboard.app.currentVersion
|
|
12126
12123
|
});
|
|
12127
12124
|
}
|
|
12125
|
+
var previousApp = _this3.kernel.currentApp;
|
|
12126
|
+
var currentApp = storyboard ? storyboard.app : undefined;
|
|
12127
|
+
// Storyboard maybe re-assigned, e.g. when open launchpad.
|
|
12128
|
+
var appChanged = previousApp && currentApp ? previousApp.id !== currentApp.id : previousApp !== currentApp;
|
|
12129
|
+
clearExpressionASTCache();
|
|
12130
|
+
if (appChanged) {
|
|
12131
|
+
clearFunctionASTCache();
|
|
12132
|
+
}
|
|
12128
12133
|
|
|
12129
12134
|
/** Pending task for loading bricks */
|
|
12130
12135
|
var pendingTask;
|
|
@@ -12171,18 +12176,15 @@ class Router {
|
|
|
12171
12176
|
registerMock((_storyboard$meta2 = storyboard.meta) === null || _storyboard$meta2 === void 0 ? void 0 : _storyboard$meta2.mocks);
|
|
12172
12177
|
registerFormRenderer();
|
|
12173
12178
|
collectContract((_storyboard$meta3 = storyboard.meta) === null || _storyboard$meta3 === void 0 ? void 0 : _storyboard$meta3.contracts);
|
|
12179
|
+
|
|
12180
|
+
// `app` maybe fulfilled
|
|
12181
|
+
currentApp = storyboard.app;
|
|
12174
12182
|
}
|
|
12175
|
-
var
|
|
12176
|
-
mountPoints,
|
|
12177
|
-
currentApp: previousApp
|
|
12178
|
-
} = _this3.kernel;
|
|
12179
|
-
var currentApp = storyboard ? storyboard.app : undefined;
|
|
12180
|
-
// Storyboard maybe re-assigned, e.g. when open launchpad.
|
|
12181
|
-
var appChanged = previousApp && currentApp ? previousApp.id !== currentApp.id : previousApp !== currentApp;
|
|
12183
|
+
var mountPoints = _this3.kernel.mountPoints;
|
|
12182
12184
|
var legacy = currentApp ? currentApp.legacy : undefined;
|
|
12183
|
-
var layoutType = (currentApp === null ||
|
|
12185
|
+
var layoutType = ((_currentApp = currentApp) === null || _currentApp === void 0 ? void 0 : _currentApp.layoutType) || "console";
|
|
12184
12186
|
var faviconElement = document.querySelector("link[rel='shortcut icon']");
|
|
12185
|
-
var customFaviconHref = currentApp === null ||
|
|
12187
|
+
var customFaviconHref = (_currentApp2 = currentApp) === null || _currentApp2 === void 0 ? void 0 : (_currentApp2$config = _currentApp2.config) === null || _currentApp2$config === void 0 ? void 0 : (_currentApp2$config$_ = _currentApp2$config._easyops_app_favicon) === null || _currentApp2$config$_ === void 0 ? void 0 : _currentApp2$config$_.default;
|
|
12186
12188
|
var settingsFaviconHref = (_this3$kernel$bootstr = _this3.kernel.bootstrapData.settings) === null || _this3$kernel$bootstr === void 0 ? void 0 : (_this3$kernel$bootstr2 = _this3$kernel$bootstr.brand) === null || _this3$kernel$bootstr2 === void 0 ? void 0 : _this3$kernel$bootstr2.favicon;
|
|
12187
12189
|
if (faviconElement) {
|
|
12188
12190
|
if (customFaviconHref) {
|
|
@@ -12201,7 +12203,7 @@ class Router {
|
|
|
12201
12203
|
transform: "translateY(-100px)",
|
|
12202
12204
|
height: "calc(100vh - var(--app-bar-height))"
|
|
12203
12205
|
};
|
|
12204
|
-
setTheme(((_getLocalAppsTheme = getLocalAppsTheme()) === null || _getLocalAppsTheme === void 0 ? void 0 : _getLocalAppsTheme[currentApp === null ||
|
|
12206
|
+
setTheme(((_getLocalAppsTheme = getLocalAppsTheme()) === null || _getLocalAppsTheme === void 0 ? void 0 : _getLocalAppsTheme[(_currentApp3 = currentApp) === null || _currentApp3 === void 0 ? void 0 : _currentApp3.id]) || ((_currentApp4 = currentApp) === null || _currentApp4 === void 0 ? void 0 : _currentApp4.theme) || "light");
|
|
12205
12207
|
getRuntime().getFeatureFlags()["support-ui-8.2-compact-layout"] ? document.body.classList.add("compact-layout") : document.body.classList.remove("compact-layout");
|
|
12206
12208
|
setMode("default");
|
|
12207
12209
|
devtoolsHookEmit("rendering");
|
|
@@ -12397,12 +12399,12 @@ class Router {
|
|
|
12397
12399
|
// When we have a matched route other than an abstract route,
|
|
12398
12400
|
// we say *page found*, otherwise, *page not found*.
|
|
12399
12401
|
if (route && route.type !== "routes" || failed) {
|
|
12400
|
-
var _this3$kernel$bootstr3, _this3$kernel$bootstr4, _getAuth$license;
|
|
12402
|
+
var _currentApp5, _this3$kernel$bootstr3, _this3$kernel$bootstr4, _getAuth$license;
|
|
12401
12403
|
if (!failed) {
|
|
12402
12404
|
yield pendingTask;
|
|
12403
12405
|
}
|
|
12404
12406
|
window.DISABLE_REACT_FLUSH_SYNC = false;
|
|
12405
|
-
setUIVersion(currentApp === null ||
|
|
12407
|
+
setUIVersion((_currentApp5 = currentApp) === null || _currentApp5 === void 0 ? void 0 : _currentApp5.uiVersion);
|
|
12406
12408
|
main.length > 0 && mountTree(main, mountPoints.main);
|
|
12407
12409
|
portal.length > 0 && mountTree(portal, mountPoints.portal);
|
|
12408
12410
|
afterMountTree(mountPoints.main);
|