@next-core/brick-utils 2.36.0 → 2.37.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 +30 -0
- package/dist/index.bundle.js +43 -1
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +42 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/scanAppInStoryboard.d.ts +3 -0
- package/dist/types/scanAppInStoryboard.spec.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -21053,6 +21053,46 @@ function beforeVisitI18nFactory(collection) {
|
|
|
21053
21053
|
};
|
|
21054
21054
|
}
|
|
21055
21055
|
|
|
21056
|
+
var APP = "APP";
|
|
21057
|
+
var GET_MENUS = "getMenu";
|
|
21058
|
+
function scanAppGetMenuInStoryboard(storyboard) {
|
|
21059
|
+
var _storyboard$meta;
|
|
21060
|
+
|
|
21061
|
+
var collection = new Set();
|
|
21062
|
+
var beforeVisitPermissions = beforeVisitAppFactory(collection);
|
|
21063
|
+
var {
|
|
21064
|
+
customTemplates,
|
|
21065
|
+
functions
|
|
21066
|
+
} = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};
|
|
21067
|
+
visitStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, APP);
|
|
21068
|
+
visitStoryboardFunctions(functions, beforeVisitPermissions);
|
|
21069
|
+
return Array.from(collection);
|
|
21070
|
+
}
|
|
21071
|
+
function scanAppGetMenuInAny(data) {
|
|
21072
|
+
var collection = new Set();
|
|
21073
|
+
visitStoryboardExpressions(data, beforeVisitAppFactory(collection), APP);
|
|
21074
|
+
return Array.from(collection);
|
|
21075
|
+
}
|
|
21076
|
+
|
|
21077
|
+
function beforeVisitAppFactory(collection) {
|
|
21078
|
+
return function beforeVisitAPP(node, parent) {
|
|
21079
|
+
if (node.name === APP) {
|
|
21080
|
+
var memberParent = parent[parent.length - 1];
|
|
21081
|
+
var callParent = parent[parent.length - 2];
|
|
21082
|
+
|
|
21083
|
+
if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === "CallExpression" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === "callee" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === "MemberExpression" && memberParent.key === "object" && !memberParent.node.computed && memberParent.node.property.type === "Identifier" && memberParent.node.property.name === GET_MENUS) {
|
|
21084
|
+
if (callParent.node.arguments.length === 1) {
|
|
21085
|
+
var menuId = callParent.node.arguments[0];
|
|
21086
|
+
|
|
21087
|
+
if (menuId.type === "Literal" && typeof menuId.value === "string") {
|
|
21088
|
+
collection.add(menuId.value);
|
|
21089
|
+
}
|
|
21090
|
+
}
|
|
21091
|
+
}
|
|
21092
|
+
}
|
|
21093
|
+
};
|
|
21094
|
+
}
|
|
21095
|
+
|
|
21056
21096
|
var LexicalStatus;
|
|
21057
21097
|
|
|
21058
21098
|
(function (LexicalStatus) {
|
|
@@ -21955,7 +21995,7 @@ var jsonFieldsInBrick = ["properties", "events", "lifeCycle", "params", "if", "t
|
|
|
21955
21995
|
|
|
21956
21996
|
var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"]; // Fields started with `_` will be removed by default.
|
|
21957
21997
|
|
|
21958
|
-
var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
21998
|
+
var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
21959
21999
|
var fieldsToRemoveInRoute = baseFieldsToRemove.concat("instanceId");
|
|
21960
22000
|
var fieldsToRemoveInBrick = baseFieldsToRemove.concat("type", "alias"); // Those fields can be disposed if value is null.
|
|
21961
22001
|
|
|
@@ -22161,5 +22201,5 @@ function debounceByAnimationFrame(fn) {
|
|
|
22161
22201
|
};
|
|
22162
22202
|
}
|
|
22163
22203
|
|
|
22164
|
-
export { JsonStorage, PrecookFunctionVisitor, PrecookVisitor, asyncProcessBrick, asyncProcessStoryboard, computeRealRoutePath, convertValueByPrecision, cook, createProviderClass, debounceByAnimationFrame, deepFreeze, formatValue, getDependencyMapOfContext, getDepsOfTemplates, getDllAndDepsByResource, getDllAndDepsOfBricks, getDllAndDepsOfStoryboard, getTemplateDepsOfStoryboard, hasOwnProperty$1 as hasOwnProperty, inject, isBrickNode, isCustomTemplateNode, isEvaluable, isObject, isRouteNode, isSnippetNode, lint, loadScript, mapCustomApisToNameAndNamespace, matchPath, normalizeBuilderNode, normalizeMenu, parseForAnalysis, precook, precookFunction, preevaluate, prefetchScript, resolveContextConcurrently, restoreDynamicTemplates, scanBricksInBrickConf, scanBricksInStoryboard, scanCustomApisInStoryboard, scanI18NInAny, scanI18NInStoryboard, scanPermissionActionsInAny, scanPermissionActionsInStoryboard, scanProcessorsInAny, scanProcessorsInStoryboard, scanRouteAliasInStoryboard, scanStoryboard, scanTemplatesInBrick, scanTemplatesInStoryboard, shouldAllowRecursiveEvaluations, smartDisplayForEvaluableString, syncResolveContextConcurrently, toPath, tokTypes_1 as tokTypes, trackContext, trackState, transform, transformAndInject, visitStoryboardExpressions, visitStoryboardFunctions };
|
|
22204
|
+
export { JsonStorage, PrecookFunctionVisitor, PrecookVisitor, asyncProcessBrick, asyncProcessStoryboard, computeRealRoutePath, convertValueByPrecision, cook, createProviderClass, debounceByAnimationFrame, deepFreeze, formatValue, getDependencyMapOfContext, getDepsOfTemplates, getDllAndDepsByResource, getDllAndDepsOfBricks, getDllAndDepsOfStoryboard, getTemplateDepsOfStoryboard, hasOwnProperty$1 as hasOwnProperty, inject, isBrickNode, isCustomTemplateNode, isEvaluable, isObject, isRouteNode, isSnippetNode, lint, loadScript, mapCustomApisToNameAndNamespace, matchPath, normalizeBuilderNode, normalizeMenu, parseForAnalysis, precook, precookFunction, preevaluate, prefetchScript, resolveContextConcurrently, restoreDynamicTemplates, scanAppGetMenuInAny, scanAppGetMenuInStoryboard, scanBricksInBrickConf, scanBricksInStoryboard, scanCustomApisInStoryboard, scanI18NInAny, scanI18NInStoryboard, scanPermissionActionsInAny, scanPermissionActionsInStoryboard, scanProcessorsInAny, scanProcessorsInStoryboard, scanRouteAliasInStoryboard, scanStoryboard, scanTemplatesInBrick, scanTemplatesInStoryboard, shouldAllowRecursiveEvaluations, smartDisplayForEvaluableString, syncResolveContextConcurrently, toPath, tokTypes_1 as tokTypes, trackContext, trackState, transform, transformAndInject, visitStoryboardExpressions, visitStoryboardFunctions };
|
|
22165
22205
|
//# sourceMappingURL=index.esm.js.map
|