@next-core/brick-kit 2.150.0 → 2.151.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.
@@ -15088,6 +15088,43 @@
15088
15088
  }));
15089
15089
  }
15090
15090
 
15091
+ /**
15092
+ * An equivalent of `computeRealValue` but for external usages, with no custom
15093
+ * context or options.
15094
+ *
15095
+ * @param value - Any value which may contains evaluations or placeholders.
15096
+ * @returns Computed real value.
15097
+ */
15098
+
15099
+ function getRealValue(value) {
15100
+ var compute = (data, ctx) => {
15101
+ if (typeof data === "string") {
15102
+ if (brickUtils.isEvaluable(data)) {
15103
+ var result = evaluate(data);
15104
+ recursiveMarkAsInjected(result);
15105
+ return result;
15106
+ }
15107
+
15108
+ return brickUtils.inject(data, ctx);
15109
+ }
15110
+
15111
+ if (!brickUtils.isObject(data) || haveBeenInjected(value)) {
15112
+ return data;
15113
+ }
15114
+
15115
+ if (Array.isArray(data)) {
15116
+ return data.map(v => compute(v, ctx));
15117
+ }
15118
+
15119
+ return Object.fromEntries(Object.entries(data).map(_ref => {
15120
+ var [k, v] = _ref;
15121
+ return [compute(k, ctx), compute(v, ctx)];
15122
+ }));
15123
+ };
15124
+
15125
+ return compute(value, _internalApiGetCurrentContext());
15126
+ }
15127
+
15091
15128
  exports.BrickAsComponent = BrickAsComponent;
15092
15129
  exports.BrickWrapper = BrickWrapper;
15093
15130
  exports.DisplayByFeatureFlags = DisplayByFeatureFlags;
@@ -15114,6 +15151,7 @@
15114
15151
  exports.getCurrentTheme = getCurrentTheme;
15115
15152
  exports.getHistory = getHistory;
15116
15153
  exports.getMockInfo = getMockInfo;
15154
+ exports.getRealValue = getRealValue;
15117
15155
  exports.getRuntime = getRuntime;
15118
15156
  exports.getRuntimeMisc = getRuntimeMisc;
15119
15157
  exports.handleHttpError = handleHttpError;