@next-core/brick-utils 2.51.0 → 2.51.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/dist/index.bundle.js
CHANGED
|
@@ -18265,10 +18265,21 @@
|
|
|
18265
18265
|
var v3Processors = new Set();
|
|
18266
18266
|
if ((bricks === null || bricks === void 0 ? void 0 : bricks.length) > 0 || (processors === null || processors === void 0 ? void 0 : processors.length) > 0 || (editorBricks === null || editorBricks === void 0 ? void 0 : editorBricks.length) > 0) {
|
|
18267
18267
|
var brickMap = getBrickToPackageMap(brickPackages);
|
|
18268
|
+
var v3DefinedBricks = new Set();
|
|
18269
|
+
for (var pkg of brickPackages) {
|
|
18270
|
+
var {
|
|
18271
|
+
id,
|
|
18272
|
+
elements
|
|
18273
|
+
} = pkg;
|
|
18274
|
+
if (id && elements !== null && elements !== void 0 && elements.length) {
|
|
18275
|
+
for (var element of elements) {
|
|
18276
|
+
v3DefinedBricks.add(element);
|
|
18277
|
+
}
|
|
18278
|
+
}
|
|
18279
|
+
}
|
|
18268
18280
|
[...(bricks !== null && bricks !== void 0 ? bricks : []).map(n => [n]), ...(processors !== null && processors !== void 0 ? processors : []).map(n => [n, true])].forEach(_ref2 => {
|
|
18269
18281
|
var [name, isProcessor] = _ref2;
|
|
18270
18282
|
// ignore custom template
|
|
18271
|
-
// istanbul ignore else
|
|
18272
18283
|
if (name.includes(".")) {
|
|
18273
18284
|
var namespace = name.split(".")[0];
|
|
18274
18285
|
// processor 是 camelCase 格式,转成 brick 的 param-case 格式,统一去判断
|
|
@@ -18291,6 +18302,8 @@
|
|
|
18291
18302
|
// eslint-disable-next-line no-console
|
|
18292
18303
|
console.error("".concat(isProcessor ? "Processor" : "Brick", " `").concat(name, "` does not match any brick package"));
|
|
18293
18304
|
}
|
|
18305
|
+
} else if (!name.startsWith("tpl-") && v3DefinedBricks.has(name)) {
|
|
18306
|
+
v3Bricks.add(name);
|
|
18294
18307
|
}
|
|
18295
18308
|
});
|
|
18296
18309
|
editorBricks === null || editorBricks === void 0 ? void 0 : editorBricks.forEach(editor => {
|
|
@@ -20018,11 +20031,12 @@
|
|
|
20018
20031
|
var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"];
|
|
20019
20032
|
|
|
20020
20033
|
// Fields started with `_` will be removed by default.
|
|
20021
|
-
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20034
|
+
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "lock", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20022
20035
|
var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type", "alias");
|
|
20023
20036
|
|
|
20024
20037
|
// Those fields can be disposed if value is null.
|
|
20025
|
-
var disposableNullFields = ["alias", "documentId", "
|
|
20038
|
+
var disposableNullFields = ["alias", "documentId", "context", "exports", "ref", "analyticsData"];
|
|
20039
|
+
var disposableFalseOrNullFields = ["hybrid", "bg", "portal", "public", "exact"];
|
|
20026
20040
|
function normalizeBuilderNode(node) {
|
|
20027
20041
|
if (isBrickNode(node)) {
|
|
20028
20042
|
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, "brick");
|
|
@@ -20038,7 +20052,7 @@
|
|
|
20038
20052
|
// Consider fields started with `_` as unused.
|
|
20039
20053
|
.filter(_ref => {
|
|
20040
20054
|
var [key, value] = _ref;
|
|
20041
|
-
return !(key[0] === "_" || fieldsToRemove.includes(key) || value === null && disposableNullFields.includes(key));
|
|
20055
|
+
return !(key[0] === "_" || fieldsToRemove.includes(key) || (value === false || value === null) && disposableFalseOrNullFields.includes(key) || value === null && disposableNullFields.includes(key) || value === true && key === "injectDeep");
|
|
20042
20056
|
})
|
|
20043
20057
|
// Parse specific fields.
|
|
20044
20058
|
.map(_ref2 => {
|
|
@@ -20352,7 +20366,7 @@
|
|
|
20352
20366
|
}
|
|
20353
20367
|
function computeConstantCondition(ifContainer) {
|
|
20354
20368
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
20355
|
-
if (hasOwnProperty$1(ifContainer, "if")) {
|
|
20369
|
+
if (hasOwnProperty$1(ifContainer, "if") && ifContainer.if !== undefined) {
|
|
20356
20370
|
if (typeof ifContainer.if === "string" && isEvaluable(ifContainer.if)) {
|
|
20357
20371
|
try {
|
|
20358
20372
|
var {
|