@next-core/brick-utils 2.35.1 → 2.36.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/CHANGELOG.md +30 -0
- package/dist/index.bundle.js +29 -3
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +29 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/types/debounceByAnimationFrame.d.ts +2 -0
- package/dist/types/debounceByAnimationFrame.spec.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -20275,11 +20275,13 @@ function getDllAndDepsByResource(_ref, brickPackages) {
|
|
|
20275
20275
|
// istanbul ignore else
|
|
20276
20276
|
if (editor.includes(".")) {
|
|
20277
20277
|
var namespace = editor.split(".")[0];
|
|
20278
|
-
var find = brickMap.get(namespace);
|
|
20278
|
+
var find = brickMap.get(namespace); // There maybe no `editorsJsFilePath`.
|
|
20279
20279
|
|
|
20280
20280
|
if (find) {
|
|
20281
|
-
|
|
20282
|
-
|
|
20281
|
+
if (find.editorsJsFilePath) {
|
|
20282
|
+
deps.add(find.editorsJsFilePath);
|
|
20283
|
+
dll.add("editor-bricks-helper");
|
|
20284
|
+
}
|
|
20283
20285
|
} else {
|
|
20284
20286
|
// eslint-disable-next-line no-console
|
|
20285
20287
|
console.error("the name of editor is `".concat(editor, "` and it don't match any editor package"));
|
|
@@ -22136,5 +22138,28 @@ function track(raw, trackText, variableName) {
|
|
|
22136
22138
|
return false;
|
|
22137
22139
|
}
|
|
22138
22140
|
|
|
22139
|
-
|
|
22141
|
+
// The debounce function receives our function as a parameter
|
|
22142
|
+
function debounceByAnimationFrame(fn) {
|
|
22143
|
+
// This holds the requestAnimationFrame reference, so we can cancel it if we wish
|
|
22144
|
+
var frame; // The debounce function returns a new function that can receive a variable number of arguments
|
|
22145
|
+
|
|
22146
|
+
return function () {
|
|
22147
|
+
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22148
|
+
params[_key] = arguments[_key];
|
|
22149
|
+
}
|
|
22150
|
+
|
|
22151
|
+
// If the frame variable has been defined, clear it now, and queue for next frame
|
|
22152
|
+
if (frame) {
|
|
22153
|
+
cancelAnimationFrame(frame);
|
|
22154
|
+
} // Queue our function call for the next frame
|
|
22155
|
+
|
|
22156
|
+
|
|
22157
|
+
frame = requestAnimationFrame(() => {
|
|
22158
|
+
// Call our function and pass any params we received
|
|
22159
|
+
fn(...params);
|
|
22160
|
+
});
|
|
22161
|
+
};
|
|
22162
|
+
}
|
|
22163
|
+
|
|
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 };
|
|
22140
22165
|
//# sourceMappingURL=index.esm.js.map
|