@next-core/brick-kit 2.178.3 → 2.178.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/dist/index.bundle.js +74 -273
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +72 -270
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts +4 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/Runtime.d.ts +2 -1
- package/dist/types/core/Runtime.d.ts.map +1 -1
- package/dist/types/core/interfaces.d.ts +8 -1
- package/dist/types/core/interfaces.d.ts.map +1 -1
- package/dist/types/developHelper.d.ts +2 -1
- package/dist/types/developHelper.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/index.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
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/defineProperty'), require('@babel/runtime/helpers/asyncToGenerator'), require('lodash'), require('@next-core/brick-utils'), require('react'), require('@next-core/brick-http'), require('antd'), require('@ant-design/icons'), require('i18next'), require('moment'), require('@next-core/pipes'), require('@next-core/easyops-analytics'), require('js-yaml'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/asyncToGenerator', 'lodash', '@next-core/brick-utils', 'react', '@next-core/brick-http', 'antd', '@ant-design/icons', 'i18next', 'moment', '@next-core/pipes', '@next-core/easyops-analytics', 'js-yaml', '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._defineProperty$1, global._asyncToGenerator$3, global._, global.brickUtils, global.React, global.brickHttp, global.antd, global.icons, global.i18next, global.moment, global.pipes, global.easyopsAnalytics, global.yaml, global.reactI18next, global._extends, global.illustrations, global._decorate));
|
|
5
|
-
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _defineProperty$1, _asyncToGenerator$3, _, brickUtils, React, brickHttp, antd, icons, i18next, moment, pipes, easyopsAnalytics, yaml, reactI18next, _extends, illustrations, _decorate) { 'use strict';
|
|
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/defineProperty'), require('@babel/runtime/helpers/asyncToGenerator'), require('lodash'), require('@next-core/brick-utils'), require('react'), require('@next-core/brick-http'), require('antd'), require('@ant-design/icons'), require('i18next'), require('moment'), require('@next-core/pipes'), require('@next-core/easyops-analytics'), require('js-yaml'), require('@next-core/loader'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/asyncToGenerator', 'lodash', '@next-core/brick-utils', 'react', '@next-core/brick-http', 'antd', '@ant-design/icons', 'i18next', 'moment', '@next-core/pipes', '@next-core/easyops-analytics', 'js-yaml', '@next-core/loader', '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._defineProperty$1, global._asyncToGenerator$3, global._, global.brickUtils, global.React, global.brickHttp, global.antd, global.icons, global.i18next, global.moment, global.pipes, global.easyopsAnalytics, global.yaml, global.loader, global.reactI18next, global._extends, global.illustrations, global._decorate));
|
|
5
|
+
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _defineProperty$1, _asyncToGenerator$3, _, brickUtils, React, brickHttp, antd, icons, i18next, moment, pipes, easyopsAnalytics, yaml, loader, reactI18next, _extends, illustrations, _decorate) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -3527,6 +3527,11 @@
|
|
|
3527
3527
|
kernel._dev_only_updateStoryboardBySnippet(appId, newSnippet, settings);
|
|
3528
3528
|
}
|
|
3529
3529
|
|
|
3530
|
+
/* istanbul ignore next */
|
|
3531
|
+
function _dev_only_getAddedContracts(storyboardPatch, options) {
|
|
3532
|
+
return kernel._dev_only_getAddedContracts(storyboardPatch, options);
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3530
3535
|
/* istanbul ignore next */
|
|
3531
3536
|
function _dev_only_getContextValue(name, _ref) {
|
|
3532
3537
|
var {
|
|
@@ -6878,267 +6883,6 @@
|
|
|
6878
6883
|
};
|
|
6879
6884
|
}();
|
|
6880
6885
|
|
|
6881
|
-
var cache$1 = new Map();
|
|
6882
|
-
function loadScript(src, prefix) {
|
|
6883
|
-
if (Array.isArray(src)) {
|
|
6884
|
-
return Promise.all(src.map(item => loadScript(item, prefix)));
|
|
6885
|
-
}
|
|
6886
|
-
var fixedSrc = prefix ? "".concat(prefix).concat(src) : src;
|
|
6887
|
-
var cachedPromise = cache$1.get(fixedSrc);
|
|
6888
|
-
if (cachedPromise) {
|
|
6889
|
-
return cachedPromise;
|
|
6890
|
-
}
|
|
6891
|
-
var promise = new Promise((resolve, reject) => {
|
|
6892
|
-
var end = () => {
|
|
6893
|
-
window.dispatchEvent(new Event("request.end"));
|
|
6894
|
-
};
|
|
6895
|
-
var script = document.createElement("script");
|
|
6896
|
-
script.src = fixedSrc;
|
|
6897
|
-
script.type = "text/javascript";
|
|
6898
|
-
script.async = true;
|
|
6899
|
-
script.onload = () => {
|
|
6900
|
-
resolve(fixedSrc);
|
|
6901
|
-
end();
|
|
6902
|
-
};
|
|
6903
|
-
script.onerror = e => {
|
|
6904
|
-
reject(e);
|
|
6905
|
-
end();
|
|
6906
|
-
};
|
|
6907
|
-
var firstScript = document.currentScript || document.getElementsByTagName("script")[0];
|
|
6908
|
-
firstScript.parentNode.insertBefore(script, firstScript);
|
|
6909
|
-
window.dispatchEvent(new Event("request.start"));
|
|
6910
|
-
});
|
|
6911
|
-
cache$1.set(fixedSrc, promise);
|
|
6912
|
-
return promise;
|
|
6913
|
-
}
|
|
6914
|
-
|
|
6915
|
-
// https://github.com/module-federation/module-federation-examples/blob/eda9493f3991a423479fd834cfb1d7b241d9d1f0/advanced-api/dynamic-remotes/app1/src/App.js
|
|
6916
|
-
function loadSharedModule(_x, _x2) {
|
|
6917
|
-
return _loadSharedModule.apply(this, arguments);
|
|
6918
|
-
}
|
|
6919
|
-
function _loadSharedModule() {
|
|
6920
|
-
_loadSharedModule = _asyncToGenerator__default["default"](function* (scope, module) {
|
|
6921
|
-
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
|
6922
|
-
yield __webpack_init_sharing__("default");
|
|
6923
|
-
var container = window[scope]; // or get the container somewhere else
|
|
6924
|
-
// Initialize the container, it may provide shared modules
|
|
6925
|
-
yield container.init(__webpack_share_scopes__.default);
|
|
6926
|
-
var factory = yield container.get(module);
|
|
6927
|
-
return factory();
|
|
6928
|
-
});
|
|
6929
|
-
return _loadSharedModule.apply(this, arguments);
|
|
6930
|
-
}
|
|
6931
|
-
|
|
6932
|
-
var resolveBasicPkg;
|
|
6933
|
-
var basicPkgWillBeResolved = false;
|
|
6934
|
-
var waitBasicPkg = new Promise(resolve => {
|
|
6935
|
-
resolveBasicPkg = resolve;
|
|
6936
|
-
});
|
|
6937
|
-
function flushStableLoadBricks() {
|
|
6938
|
-
if (!basicPkgWillBeResolved) {
|
|
6939
|
-
resolveBasicPkg();
|
|
6940
|
-
}
|
|
6941
|
-
}
|
|
6942
|
-
function loadBricksImperatively(_x, _x2) {
|
|
6943
|
-
return _loadBricksImperatively.apply(this, arguments);
|
|
6944
|
-
}
|
|
6945
|
-
function _loadBricksImperatively() {
|
|
6946
|
-
_loadBricksImperatively = _asyncToGenerator__default["default"](function* (bricks, brickPackages) {
|
|
6947
|
-
var promise = enqueueStableLoad("bricks", bricks, brickPackages);
|
|
6948
|
-
flushStableLoadBricks();
|
|
6949
|
-
return dispatchRequestStatus(promise);
|
|
6950
|
-
});
|
|
6951
|
-
return _loadBricksImperatively.apply(this, arguments);
|
|
6952
|
-
}
|
|
6953
|
-
function loadProcessorsImperatively(processors, brickPackages) {
|
|
6954
|
-
var promise = enqueueStableLoad("processors", processors, brickPackages);
|
|
6955
|
-
flushStableLoadBricks();
|
|
6956
|
-
return dispatchRequestStatus(promise);
|
|
6957
|
-
}
|
|
6958
|
-
var v2AdapterPromise;
|
|
6959
|
-
var V2_ADAPTER_LOAD_BRICKS = "v2-adapter.load-bricks";
|
|
6960
|
-
|
|
6961
|
-
// Get brick/processor items including their dependencies
|
|
6962
|
-
function getItemsByPkg(type, list, brickPackagesMap) {
|
|
6963
|
-
var itemsByPkg = new Map();
|
|
6964
|
-
var listToLoad = new Set();
|
|
6965
|
-
var add = item => {
|
|
6966
|
-
var _pkg$dependencies;
|
|
6967
|
-
if (listToLoad.has(item)) {
|
|
6968
|
-
return;
|
|
6969
|
-
}
|
|
6970
|
-
listToLoad.add(item);
|
|
6971
|
-
var pkg;
|
|
6972
|
-
var namespace;
|
|
6973
|
-
var itemName;
|
|
6974
|
-
if (type === "processors" || item.includes(".")) {
|
|
6975
|
-
[namespace, itemName] = item.split(".");
|
|
6976
|
-
var pkgId = "bricks/".concat(type === "processors" ? getProcessorPackageName(namespace) : namespace);
|
|
6977
|
-
pkg = brickPackagesMap.get(pkgId);
|
|
6978
|
-
} else {
|
|
6979
|
-
itemName = item;
|
|
6980
|
-
for (var p of brickPackagesMap.values()) {
|
|
6981
|
-
var _p$elements;
|
|
6982
|
-
if ((_p$elements = p.elements) !== null && _p$elements !== void 0 && _p$elements.some(e => e === itemName)) {
|
|
6983
|
-
pkg = p;
|
|
6984
|
-
break;
|
|
6985
|
-
}
|
|
6986
|
-
}
|
|
6987
|
-
}
|
|
6988
|
-
if (!pkg) {
|
|
6989
|
-
throw new Error("Package for ".concat(item, " not found."));
|
|
6990
|
-
}
|
|
6991
|
-
var groupItems = itemsByPkg.get(pkg);
|
|
6992
|
-
if (!groupItems) {
|
|
6993
|
-
groupItems = [];
|
|
6994
|
-
itemsByPkg.set(pkg, groupItems);
|
|
6995
|
-
}
|
|
6996
|
-
groupItems.push(itemName);
|
|
6997
|
-
|
|
6998
|
-
// Load their dependencies too
|
|
6999
|
-
var deps = (_pkg$dependencies = pkg.dependencies) === null || _pkg$dependencies === void 0 ? void 0 : _pkg$dependencies[item];
|
|
7000
|
-
if (deps) {
|
|
7001
|
-
for (var dep of deps) {
|
|
7002
|
-
add(dep);
|
|
7003
|
-
}
|
|
7004
|
-
}
|
|
7005
|
-
};
|
|
7006
|
-
for (var item of list) {
|
|
7007
|
-
add(item);
|
|
7008
|
-
}
|
|
7009
|
-
return itemsByPkg;
|
|
7010
|
-
}
|
|
7011
|
-
function loadBrickModule(_x3, _x4, _x5) {
|
|
7012
|
-
return _loadBrickModule.apply(this, arguments);
|
|
7013
|
-
}
|
|
7014
|
-
function _loadBrickModule() {
|
|
7015
|
-
_loadBrickModule = _asyncToGenerator__default["default"](function* (type, pkgId, itemName) {
|
|
7016
|
-
var moduleName = "".concat(type === "processors" ? "./processors/" : "./").concat(itemName);
|
|
7017
|
-
try {
|
|
7018
|
-
yield loadSharedModule(pkgId, moduleName);
|
|
7019
|
-
} catch (error) {
|
|
7020
|
-
// eslint-disable-next-line no-console
|
|
7021
|
-
console.error(error);
|
|
7022
|
-
throw new Error("Load ".concat(type, " of \"").concat(pkgId.split("/").pop(), ".").concat(moduleName.split("/").pop(), "\" failed"));
|
|
7023
|
-
}
|
|
7024
|
-
});
|
|
7025
|
-
return _loadBrickModule.apply(this, arguments);
|
|
7026
|
-
}
|
|
7027
|
-
function loadRestBricks(type, pkgs, itemsMap) {
|
|
7028
|
-
return pkgs.map( /*#__PURE__*/function () {
|
|
7029
|
-
var _ref = _asyncToGenerator__default["default"](function* (pkg) {
|
|
7030
|
-
var _window$PUBLIC_ROOT;
|
|
7031
|
-
yield loadScript(pkg.filePath, (_window$PUBLIC_ROOT = window.PUBLIC_ROOT) !== null && _window$PUBLIC_ROOT !== void 0 ? _window$PUBLIC_ROOT : "");
|
|
7032
|
-
yield waitBasicPkg;
|
|
7033
|
-
return Promise.all(
|
|
7034
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7035
|
-
itemsMap.get(pkg).map(itemName => loadBrickModule(type, pkg.id, itemName)));
|
|
7036
|
-
});
|
|
7037
|
-
return function (_x6) {
|
|
7038
|
-
return _ref.apply(this, arguments);
|
|
7039
|
-
};
|
|
7040
|
-
}());
|
|
7041
|
-
}
|
|
7042
|
-
function enqueueStableLoad(_x7, _x8, _x9) {
|
|
7043
|
-
return _enqueueStableLoad.apply(this, arguments);
|
|
7044
|
-
}
|
|
7045
|
-
function _enqueueStableLoad() {
|
|
7046
|
-
_enqueueStableLoad = _asyncToGenerator__default["default"](function* (type, list, brickPackages) {
|
|
7047
|
-
var brickPackagesMap = new Map();
|
|
7048
|
-
for (var pkg of brickPackages) {
|
|
7049
|
-
var _pkg$id;
|
|
7050
|
-
var pkgId = (_pkg$id = pkg.id) !== null && _pkg$id !== void 0 ? _pkg$id : getPkgIdByFilePath(pkg.filePath);
|
|
7051
|
-
brickPackagesMap.set(pkgId, pkg);
|
|
7052
|
-
}
|
|
7053
|
-
var itemsByPkg = getItemsByPkg(type, list, brickPackagesMap);
|
|
7054
|
-
var foundBasicPkg;
|
|
7055
|
-
var v2Packages = [];
|
|
7056
|
-
var v3PackagesOtherThanBasic = [];
|
|
7057
|
-
var maybeV2Adapter;
|
|
7058
|
-
for (var _pkg of itemsByPkg.keys()) {
|
|
7059
|
-
if (_pkg.id) {
|
|
7060
|
-
if (_pkg.id === "bricks/basic") {
|
|
7061
|
-
foundBasicPkg = _pkg;
|
|
7062
|
-
} else {
|
|
7063
|
-
v3PackagesOtherThanBasic.push(_pkg);
|
|
7064
|
-
}
|
|
7065
|
-
} else {
|
|
7066
|
-
// Brick packages of v2 has no `id`
|
|
7067
|
-
v2Packages.push(_pkg);
|
|
7068
|
-
maybeV2Adapter = brickPackagesMap.get("bricks/v2-adapter");
|
|
7069
|
-
if (!maybeV2Adapter) {
|
|
7070
|
-
// eslint-disable-next-line no-console
|
|
7071
|
-
console.error("Using v2 bricks, but v2-adapter not found");
|
|
7072
|
-
}
|
|
7073
|
-
}
|
|
7074
|
-
}
|
|
7075
|
-
var v2Adapter = maybeV2Adapter;
|
|
7076
|
-
var basicPkgPromise;
|
|
7077
|
-
var basicPkg = foundBasicPkg;
|
|
7078
|
-
if (basicPkg) {
|
|
7079
|
-
var _window$PUBLIC_ROOT2;
|
|
7080
|
-
var tempPromise = loadScript(basicPkg.filePath, (_window$PUBLIC_ROOT2 = window.PUBLIC_ROOT) !== null && _window$PUBLIC_ROOT2 !== void 0 ? _window$PUBLIC_ROOT2 : "");
|
|
7081
|
-
// Packages other than BASIC will wait for an extra micro-task tick.
|
|
7082
|
-
if (!basicPkgWillBeResolved) {
|
|
7083
|
-
basicPkgWillBeResolved = true;
|
|
7084
|
-
tempPromise.then(() => Promise.resolve()).then(resolveBasicPkg);
|
|
7085
|
-
}
|
|
7086
|
-
basicPkgPromise = tempPromise.then(() => Promise.all(
|
|
7087
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7088
|
-
itemsByPkg.get(basicPkg).map(itemName => loadBrickModule(type, basicPkg.id, itemName))));
|
|
7089
|
-
}
|
|
7090
|
-
var pkgPromises = [basicPkgPromise].concat(loadRestBricks(type, v3PackagesOtherThanBasic, itemsByPkg));
|
|
7091
|
-
if (v2Adapter && v2Packages.length > 0) {
|
|
7092
|
-
if (!v2AdapterPromise) {
|
|
7093
|
-
// Load `v2-adapter.load-bricks` and its dependencies
|
|
7094
|
-
var v2AdapterItemsByPkg = getItemsByPkg("bricks", [V2_ADAPTER_LOAD_BRICKS], brickPackagesMap);
|
|
7095
|
-
var v2AdapterPackages = [...v2AdapterItemsByPkg.keys()];
|
|
7096
|
-
var loadV2Adapter = /*#__PURE__*/function () {
|
|
7097
|
-
var _ref2 = _asyncToGenerator__default["default"](function* () {
|
|
7098
|
-
yield Promise.all(loadRestBricks("bricks", v2AdapterPackages, v2AdapterItemsByPkg));
|
|
7099
|
-
return document.createElement(V2_ADAPTER_LOAD_BRICKS);
|
|
7100
|
-
});
|
|
7101
|
-
return function loadV2Adapter() {
|
|
7102
|
-
return _ref2.apply(this, arguments);
|
|
7103
|
-
};
|
|
7104
|
-
}();
|
|
7105
|
-
v2AdapterPromise = loadV2Adapter();
|
|
7106
|
-
}
|
|
7107
|
-
pkgPromises.push(v2AdapterPromise.then(adapter => Promise.all(v2Packages.map(pkg => {
|
|
7108
|
-
var pkgId = getPkgIdByFilePath(pkg.filePath);
|
|
7109
|
-
var pkgNamespace = pkgId.split("/")[1];
|
|
7110
|
-
return adapter.resolve(v2Adapter.filePath, pkg.filePath, type === "bricks" ?
|
|
7111
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7112
|
-
itemsByPkg.get(pkg).map(itemName => "".concat(pkgNamespace, ".").concat(itemName)) : [], pkg.dll,
|
|
7113
|
-
// Todo: remove `brickPackages` as an argument
|
|
7114
|
-
brickPackages);
|
|
7115
|
-
}))));
|
|
7116
|
-
}
|
|
7117
|
-
yield Promise.all(pkgPromises);
|
|
7118
|
-
});
|
|
7119
|
-
return _enqueueStableLoad.apply(this, arguments);
|
|
7120
|
-
}
|
|
7121
|
-
function dispatchRequestStatus(_x10) {
|
|
7122
|
-
return _dispatchRequestStatus.apply(this, arguments);
|
|
7123
|
-
}
|
|
7124
|
-
function _dispatchRequestStatus() {
|
|
7125
|
-
_dispatchRequestStatus = _asyncToGenerator__default["default"](function* (promise) {
|
|
7126
|
-
window.dispatchEvent(new Event("request.start"));
|
|
7127
|
-
try {
|
|
7128
|
-
yield promise;
|
|
7129
|
-
} finally {
|
|
7130
|
-
window.dispatchEvent(new Event("request.end"));
|
|
7131
|
-
}
|
|
7132
|
-
});
|
|
7133
|
-
return _dispatchRequestStatus.apply(this, arguments);
|
|
7134
|
-
}
|
|
7135
|
-
function getProcessorPackageName(camelPackageName) {
|
|
7136
|
-
return camelPackageName.replace(/[A-Z]/g, match => "-".concat(match[0].toLocaleLowerCase())).replace(/_[0-9]/g, match => "-".concat(match[1]));
|
|
7137
|
-
}
|
|
7138
|
-
function getPkgIdByFilePath(filePath) {
|
|
7139
|
-
return filePath.split("/").slice(0, 2).join("/");
|
|
7140
|
-
}
|
|
7141
|
-
|
|
7142
6886
|
/**
|
|
7143
6887
|
* Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
|
|
7144
6888
|
*
|
|
@@ -8926,13 +8670,13 @@
|
|
|
8926
8670
|
yield loadScriptOfDll(eager.dll);
|
|
8927
8671
|
yield loadScriptOfBricksOrTemplates(eager.deps);
|
|
8928
8672
|
if ((_eager$v3Bricks = eager.v3Bricks) !== null && _eager$v3Bricks !== void 0 && _eager$v3Bricks.length) {
|
|
8929
|
-
yield loadBricksImperatively(eager.v3Bricks, brickPackages);
|
|
8673
|
+
yield loader.loadBricksImperatively(eager.v3Bricks, brickPackages);
|
|
8930
8674
|
}
|
|
8931
8675
|
// 加载构件资源时,不再阻塞后续业务数据的加载,在挂载构件时再等待该任务完成。
|
|
8932
8676
|
// 挂载构件可能包括:Provider 构件实时挂载、路由准备完成后的统一挂载等。
|
|
8933
8677
|
return {
|
|
8934
8678
|
pendingTask: loadScriptOfDll(dll).then(() => loadScriptOfBricksOrTemplates(deps)).then( /*#__PURE__*/_asyncToGenerator__default["default"](function* () {
|
|
8935
|
-
yield Promise.all([loadLazyBricks(bricks), (v3Bricks === null || v3Bricks === void 0 ? void 0 : v3Bricks.length) && loadBricksImperatively(v3Bricks, brickPackages), (v3Processors === null || v3Processors === void 0 ? void 0 : v3Processors.length) && loadProcessorsImperatively(v3Processors, brickPackages)]);
|
|
8679
|
+
yield Promise.all([loadLazyBricks(bricks), (v3Bricks === null || v3Bricks === void 0 ? void 0 : v3Bricks.length) && loader.loadBricksImperatively(v3Bricks, brickPackages), (v3Processors === null || v3Processors === void 0 ? void 0 : v3Processors.length) && loader.loadProcessorsImperatively(v3Processors, brickPackages)]);
|
|
8936
8680
|
}))
|
|
8937
8681
|
};
|
|
8938
8682
|
}
|
|
@@ -8961,7 +8705,7 @@
|
|
|
8961
8705
|
}, _this.bootstrapData.brickPackages);
|
|
8962
8706
|
yield loadScriptOfDll(dll);
|
|
8963
8707
|
yield loadScriptOfBricksOrTemplates(deps);
|
|
8964
|
-
yield Promise.all([loadLazyBricks(filteredBricks), (v3Bricks === null || v3Bricks === void 0 ? void 0 : v3Bricks.length) && loadBricksImperatively(v3Bricks, brickPackages), (v3Processors === null || v3Processors === void 0 ? void 0 : v3Processors.length) && loadProcessorsImperatively(v3Processors, brickPackages)]);
|
|
8708
|
+
yield Promise.all([loadLazyBricks(filteredBricks), (v3Bricks === null || v3Bricks === void 0 ? void 0 : v3Bricks.length) && loader.loadBricksImperatively(v3Bricks, brickPackages), (v3Processors === null || v3Processors === void 0 ? void 0 : v3Processors.length) && loader.loadProcessorsImperatively(v3Processors, brickPackages)]);
|
|
8965
8709
|
});
|
|
8966
8710
|
return function (_x2, _x3) {
|
|
8967
8711
|
return _ref3.apply(this, arguments);
|
|
@@ -9263,12 +9007,15 @@
|
|
|
9263
9007
|
routes.splice(previewRouteIndex, 1, newPreviewRoute);
|
|
9264
9008
|
}
|
|
9265
9009
|
}
|
|
9010
|
+
_dev_only_getSnippetPreviewPath(snippetId) {
|
|
9011
|
+
return "${APP.homepage}/_dev_only_/snippet-preview/".concat(snippetId);
|
|
9012
|
+
}
|
|
9266
9013
|
_dev_only_updateSnippetPreviewSettings(appId, snippetData, settings) {
|
|
9267
9014
|
var {
|
|
9268
9015
|
routes,
|
|
9269
9016
|
app
|
|
9270
9017
|
} = this.bootstrapData.storyboards.find(item => item.app.id === appId);
|
|
9271
|
-
var previewPath =
|
|
9018
|
+
var previewPath = this._dev_only_getSnippetPreviewPath(snippetData.snippetId);
|
|
9272
9019
|
var previewRouteIndex = routes.findIndex(route => route.path === previewPath);
|
|
9273
9020
|
try {
|
|
9274
9021
|
var _parsedSnippetData$br;
|
|
@@ -9337,11 +9084,14 @@
|
|
|
9337
9084
|
_dev_only_updateStoryboardBySnippet(appId, newSnippet, settings) {
|
|
9338
9085
|
this._dev_only_updateSnippetPreviewSettings(appId, newSnippet, settings);
|
|
9339
9086
|
}
|
|
9087
|
+
_dev_only_getFormPreviewPath(formId) {
|
|
9088
|
+
return "${APP.homepage}/_dev_only_/form-preview/".concat(formId);
|
|
9089
|
+
}
|
|
9340
9090
|
_dev_only_updateFormPreviewSettings(appId, formId, formData) {
|
|
9341
9091
|
var {
|
|
9342
9092
|
routes
|
|
9343
9093
|
} = this.bootstrapData.storyboards.find(item => item.app.id === appId);
|
|
9344
|
-
var previewPath =
|
|
9094
|
+
var previewPath = this._dev_only_getFormPreviewPath(formId);
|
|
9345
9095
|
var previewRouteIndex = routes.findIndex(route => route.path === previewPath);
|
|
9346
9096
|
var newPreviewRoute = {
|
|
9347
9097
|
path: previewPath,
|
|
@@ -9361,6 +9111,56 @@
|
|
|
9361
9111
|
routes.splice(previewRouteIndex, 1, newPreviewRoute);
|
|
9362
9112
|
}
|
|
9363
9113
|
}
|
|
9114
|
+
_dev_only_getAddedContracts(storyboardPatch, _ref6) {
|
|
9115
|
+
var {
|
|
9116
|
+
appId,
|
|
9117
|
+
updateStoryboardType,
|
|
9118
|
+
formId
|
|
9119
|
+
} = _ref6;
|
|
9120
|
+
var storyboard = this.bootstrapData.storyboards.find(item => item.app.id === appId);
|
|
9121
|
+
var updatedStoryboard;
|
|
9122
|
+
|
|
9123
|
+
// 拿到更新部分的 storyboard 配置,然后扫描一遍,找到新增的 contracts
|
|
9124
|
+
if (updateStoryboardType === "route") {
|
|
9125
|
+
updatedStoryboard = {
|
|
9126
|
+
routes: [storyboardPatch]
|
|
9127
|
+
};
|
|
9128
|
+
} else if (updateStoryboardType === "template") {
|
|
9129
|
+
updatedStoryboard = {
|
|
9130
|
+
meta: {
|
|
9131
|
+
customTemplates: [storyboardPatch]
|
|
9132
|
+
}
|
|
9133
|
+
};
|
|
9134
|
+
} else if (updateStoryboardType === "snippet") {
|
|
9135
|
+
var _storyboard$routes;
|
|
9136
|
+
// snippet 和 form 是放在挂载 route 里预览,通过 previewPath 拿到当前修改 route
|
|
9137
|
+
var snippetPreviewPath = this._dev_only_getSnippetPreviewPath(storyboardPatch.snippetId);
|
|
9138
|
+
var currentRoute = (_storyboard$routes = storyboard.routes) === null || _storyboard$routes === void 0 ? void 0 : _storyboard$routes.find(route => route.path === snippetPreviewPath);
|
|
9139
|
+
updatedStoryboard = {
|
|
9140
|
+
routes: [currentRoute]
|
|
9141
|
+
};
|
|
9142
|
+
} else if (updateStoryboardType === "form") {
|
|
9143
|
+
var _storyboard$routes2;
|
|
9144
|
+
var formPreviewPath = this._dev_only_getFormPreviewPath(formId);
|
|
9145
|
+
var _currentRoute = (_storyboard$routes2 = storyboard.routes) === null || _storyboard$routes2 === void 0 ? void 0 : _storyboard$routes2.find(route => route.path === formPreviewPath);
|
|
9146
|
+
updatedStoryboard = {
|
|
9147
|
+
routes: [_currentRoute]
|
|
9148
|
+
};
|
|
9149
|
+
}
|
|
9150
|
+
var addedContracts = [];
|
|
9151
|
+
if (updatedStoryboard) {
|
|
9152
|
+
var _scanCustomApisInStor;
|
|
9153
|
+
var contractApis = (_scanCustomApisInStor = brickUtils.scanCustomApisInStoryboard(updatedStoryboard)) === null || _scanCustomApisInStor === void 0 ? void 0 : _scanCustomApisInStor.filter(api => api.includes(":"));
|
|
9154
|
+
contractApis.forEach(api => {
|
|
9155
|
+
var _storyboard$meta$cont;
|
|
9156
|
+
var [_, namespaceId, name] = api.match(/(.*)@(.*):\d\.\d\.\d/);
|
|
9157
|
+
if (!((_storyboard$meta$cont = storyboard.meta.contracts) !== null && _storyboard$meta$cont !== void 0 && _storyboard$meta$cont.some(contract => contract.namespaceId === namespaceId && contract.name === name))) {
|
|
9158
|
+
addedContracts.push(api);
|
|
9159
|
+
}
|
|
9160
|
+
});
|
|
9161
|
+
}
|
|
9162
|
+
return addedContracts;
|
|
9163
|
+
}
|
|
9364
9164
|
loadDepsOfStoryboard(storyboard) {
|
|
9365
9165
|
return this.gracefullyLoadDeps(this._loadDepsOfStoryboard, storyboard);
|
|
9366
9166
|
}
|
|
@@ -9615,8 +9415,8 @@
|
|
|
9615
9415
|
});
|
|
9616
9416
|
});
|
|
9617
9417
|
if (!filterMenus.length) {
|
|
9618
|
-
var
|
|
9619
|
-
filterMenus = (
|
|
9418
|
+
var _ref7, _yield$InstanceApi_po;
|
|
9419
|
+
filterMenus = (_ref7 = _this12.getFeatureFlags()["three-level-menu-layout"] ? (yield InstalledMicroAppApi_getMenusInfo(menuId, {
|
|
9620
9420
|
menuObjectId: "STANDALONE_MENU@EASYOPS"
|
|
9621
9421
|
})).menus : (_yield$InstanceApi_po = yield InstanceApi_postSearch("STANDALONE_MENU@EASYOPS", {
|
|
9622
9422
|
page: 1,
|
|
@@ -9647,7 +9447,7 @@
|
|
|
9647
9447
|
$eq: true
|
|
9648
9448
|
}
|
|
9649
9449
|
}
|
|
9650
|
-
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null &&
|
|
9450
|
+
})) === null || _yield$InstanceApi_po === void 0 ? void 0 : _yield$InstanceApi_po.list) !== null && _ref7 !== void 0 ? _ref7 : [];
|
|
9651
9451
|
}
|
|
9652
9452
|
return filterMenus;
|
|
9653
9453
|
})();
|
|
@@ -14231,6 +14031,7 @@
|
|
|
14231
14031
|
updateTemplatePreviewSettings: _dev_only_updateTemplatePreviewSettings,
|
|
14232
14032
|
updateSnippetPreviewSettings: _dev_only_updateSnippetPreviewSettings,
|
|
14233
14033
|
updateFormPreviewSettings: _dev_only_updateFormPreviewSettings,
|
|
14034
|
+
getAddedContracts: _dev_only_getAddedContracts,
|
|
14234
14035
|
getContextValue: _dev_only_getContextValue,
|
|
14235
14036
|
getAllContextValues: _dev_only_getAllContextValues,
|
|
14236
14037
|
render: _dev_only_render
|