@next-core/brick-utils 2.35.2 → 2.37.0

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
@@ -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) {
@@ -22138,5 +22178,28 @@ function track(raw, trackText, variableName) {
22138
22178
  return false;
22139
22179
  }
22140
22180
 
22141
- export { JsonStorage, PrecookFunctionVisitor, PrecookVisitor, asyncProcessBrick, asyncProcessStoryboard, computeRealRoutePath, convertValueByPrecision, cook, createProviderClass, 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 };
22181
+ // The debounce function receives our function as a parameter
22182
+ function debounceByAnimationFrame(fn) {
22183
+ // This holds the requestAnimationFrame reference, so we can cancel it if we wish
22184
+ var frame; // The debounce function returns a new function that can receive a variable number of arguments
22185
+
22186
+ return function () {
22187
+ for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
22188
+ params[_key] = arguments[_key];
22189
+ }
22190
+
22191
+ // If the frame variable has been defined, clear it now, and queue for next frame
22192
+ if (frame) {
22193
+ cancelAnimationFrame(frame);
22194
+ } // Queue our function call for the next frame
22195
+
22196
+
22197
+ frame = requestAnimationFrame(() => {
22198
+ // Call our function and pass any params we received
22199
+ fn(...params);
22200
+ });
22201
+ };
22202
+ }
22203
+
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 };
22142
22205
  //# sourceMappingURL=index.esm.js.map