@builder.io/sdk 3.0.0 → 3.0.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @builder.io/sdk
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 69859d4: serialize functions for registering plugins so you can have showIf on fields as functions
8
+
3
9
  ## 3.0.0
4
10
 
5
11
  ### Major Changes
@@ -152,7 +152,7 @@
152
152
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
153
153
  }
154
154
 
155
- var version = "3.0.0";
155
+ var version = "3.0.1";
156
156
 
157
157
  var Subscription = /** @class */ (function () {
158
158
  function Subscription(listeners, listener) {
@@ -1320,6 +1320,9 @@
1320
1320
  }
1321
1321
  }
1322
1322
  Builder.register = function (type, info) {
1323
+ if (type === 'plugin') {
1324
+ info = this.serializeIncludingFunctions(info);
1325
+ }
1323
1326
  // TODO: all must have name and can't conflict?
1324
1327
  var typeList = this.registry[type];
1325
1328
  if (!typeList) {
@@ -1441,7 +1444,7 @@
1441
1444
  enumerable: false,
1442
1445
  configurable: true
1443
1446
  });
1444
- Builder.serializeComponentInfo = function (info) {
1447
+ Builder.serializeIncludingFunctions = function (info) {
1445
1448
  var serializeFn = function (fnValue) {
1446
1449
  var fnStr = fnValue.toString().trim();
1447
1450
  // we need to account for a few different fn syntaxes:
@@ -1459,7 +1462,7 @@
1459
1462
  }));
1460
1463
  };
1461
1464
  Builder.prepareComponentSpecToSend = function (spec) {
1462
- return __assign(__assign({}, this.serializeComponentInfo(spec)), { class: undefined });
1465
+ return __assign(__assign({}, this.serializeIncludingFunctions(spec)), { class: undefined });
1463
1466
  };
1464
1467
  Builder.registerBlock = function (component, options) {
1465
1468
  this.registerComponent(component, options);