@builder.io/sdk 2.2.9 → 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 +16 -0
- package/dist/index.browser.js +9 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +9 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +9 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.d.ts +1 -1
- package/dist/src/builder.class.js +8 -5
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/builder.class.test.js +5 -5
- package/dist/src/builder.class.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -118,7 +118,7 @@ function assertAllowedPropertyName(name) {
|
|
|
118
118
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
var version = "
|
|
121
|
+
var version = "3.0.1";
|
|
122
122
|
|
|
123
123
|
var Subscription = /** @class */ (function () {
|
|
124
124
|
function Subscription(listeners, listener) {
|
|
@@ -1218,6 +1218,9 @@ var Builder = /** @class */ (function () {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
Builder.register = function (type, info) {
|
|
1221
|
+
if (type === 'plugin') {
|
|
1222
|
+
info = this.serializeIncludingFunctions(info);
|
|
1223
|
+
}
|
|
1221
1224
|
// TODO: all must have name and can't conflict?
|
|
1222
1225
|
var typeList = this.registry[type];
|
|
1223
1226
|
if (!typeList) {
|
|
@@ -1339,7 +1342,7 @@ var Builder = /** @class */ (function () {
|
|
|
1339
1342
|
enumerable: false,
|
|
1340
1343
|
configurable: true
|
|
1341
1344
|
});
|
|
1342
|
-
Builder.
|
|
1345
|
+
Builder.serializeIncludingFunctions = function (info) {
|
|
1343
1346
|
var serializeFn = function (fnValue) {
|
|
1344
1347
|
var fnStr = fnValue.toString().trim();
|
|
1345
1348
|
// we need to account for a few different fn syntaxes:
|
|
@@ -1357,7 +1360,7 @@ var Builder = /** @class */ (function () {
|
|
|
1357
1360
|
}));
|
|
1358
1361
|
};
|
|
1359
1362
|
Builder.prepareComponentSpecToSend = function (spec) {
|
|
1360
|
-
return __assign(__assign({}, this.
|
|
1363
|
+
return __assign(__assign({}, this.serializeIncludingFunctions(spec)), { class: undefined });
|
|
1361
1364
|
};
|
|
1362
1365
|
Builder.registerBlock = function (component, options) {
|
|
1363
1366
|
this.registerComponent(component, options);
|
|
@@ -2239,7 +2242,7 @@ var Builder = /** @class */ (function () {
|
|
|
2239
2242
|
// even though we only use `fetch()` now, we prefer to keep the old behavior and use the `fetch` that comes from
|
|
2240
2243
|
// the core SDK for consistency
|
|
2241
2244
|
Builder.prototype.requestUrl = function (url, options) {
|
|
2242
|
-
return getFetch()(url,
|
|
2245
|
+
return getFetch()(url, options).then(function (res) { return res.json(); });
|
|
2243
2246
|
};
|
|
2244
2247
|
Object.defineProperty(Builder.prototype, "host", {
|
|
2245
2248
|
get: function () {
|
|
@@ -2335,7 +2338,7 @@ var Builder = /** @class */ (function () {
|
|
|
2335
2338
|
}
|
|
2336
2339
|
// TODO: merge in the attribute from query string ones
|
|
2337
2340
|
// TODO: make this an option per component/request
|
|
2338
|
-
queryParams.userAttributes = userAttributes;
|
|
2341
|
+
queryParams.userAttributes = JSON.stringify(userAttributes);
|
|
2339
2342
|
if (!usePastQueue && !useQueue) {
|
|
2340
2343
|
this.priorContentQueue = queue;
|
|
2341
2344
|
this.getContentQueue = null;
|
|
@@ -2413,7 +2416,7 @@ var Builder = /** @class */ (function () {
|
|
|
2413
2416
|
}
|
|
2414
2417
|
var queryStr = QueryString.stringifyDeep(queryParams);
|
|
2415
2418
|
var format = queryParams.format;
|
|
2416
|
-
var requestOptions = { headers: {}
|
|
2419
|
+
var requestOptions = { headers: {} };
|
|
2417
2420
|
if (this.authToken) {
|
|
2418
2421
|
requestOptions.headers = __assign(__assign({}, requestOptions.headers), { Authorization: "Bearer ".concat(this.authToken) });
|
|
2419
2422
|
}
|