@builder.io/sdk 1.1.36-1 → 1.1.36

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
@@ -123,7 +123,7 @@ function assertAllowedPropertyName(name) {
123
123
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
124
124
  }
125
125
 
126
- var version = "1.1.36-0";
126
+ var version = "1.1.36";
127
127
 
128
128
  var Subscription = /** @class */ (function () {
129
129
  function Subscription(listeners, listener) {
@@ -473,6 +473,10 @@ function getFetch() {
473
473
  }
474
474
 
475
475
  function assign(target) {
476
+ var args = [];
477
+ for (var _i = 1; _i < arguments.length; _i++) {
478
+ args[_i - 1] = arguments[_i];
479
+ }
476
480
  var to = Object(target);
477
481
  for (var index = 1; index < arguments.length; index++) {
478
482
  var nextSource = arguments[index];
@@ -913,7 +917,7 @@ function emptyUrl() {
913
917
  }
914
918
  // Replacement for `url.parse` using `URL` global object that works with relative paths.
915
919
  // Assumptions: this function operates in a NodeJS environment.
916
- function parse$1(url) {
920
+ function parse(url) {
917
921
  var out = emptyUrl();
918
922
  var u;
919
923
  var pathOnly = url === '' || url[0] === '/';
@@ -1023,12 +1027,12 @@ var urlParser = {
1023
1027
  return out;
1024
1028
  },
1025
1029
  };
1026
- var parse = isReactNative
1030
+ var parse$1 = isReactNative
1027
1031
  ? function () { return emptyUrl(); }
1028
1032
  : typeof window === 'object'
1029
1033
  ? urlParser.parse
1030
- : parse$1;
1031
- function setCookie(name, value, expires) {
1034
+ : parse;
1035
+ function setCookie(name$$1, value, expires) {
1032
1036
  try {
1033
1037
  var expiresString = '';
1034
1038
  // TODO: need to know if secure server side
@@ -1037,7 +1041,7 @@ function setCookie(name, value, expires) {
1037
1041
  }
1038
1042
  var secure = isBrowser ? location.protocol === 'https:' : true;
1039
1043
  document.cookie =
1040
- name +
1044
+ name$$1 +
1041
1045
  '=' +
1042
1046
  (value || '') +
1043
1047
  expiresString +
@@ -1049,10 +1053,10 @@ function setCookie(name, value, expires) {
1049
1053
  console.warn('Could not set cookie', err);
1050
1054
  }
1051
1055
  }
1052
- function getCookie(name) {
1056
+ function getCookie(name$$1) {
1053
1057
  try {
1054
1058
  return (decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' +
1055
- encodeURIComponent(name).replace(/[\-\.\+\*]/g, '\\$&') +
1059
+ encodeURIComponent(name$$1).replace(/[\-\.\+\*]/g, '\\$&') +
1056
1060
  '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null);
1057
1061
  }
1058
1062
  catch (err) {
@@ -1275,11 +1279,11 @@ var Builder = /** @class */ (function () {
1275
1279
  throw new Error("Action not found: ".concat(action));
1276
1280
  }
1277
1281
  };
1278
- Builder.fields = function (name, fields) {
1282
+ Builder.fields = function (name$$1, fields) {
1279
1283
  var _a;
1280
1284
  (_a = window.parent) === null || _a === void 0 ? void 0 : _a.postMessage({
1281
1285
  type: 'builder.fields',
1282
- data: { name: name, fields: fields },
1286
+ data: { name: name$$1, fields: fields },
1283
1287
  }, '*');
1284
1288
  };
1285
1289
  /**
@@ -1772,7 +1776,7 @@ var Builder = /** @class */ (function () {
1772
1776
  var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
1773
1777
  var builder = params.builder;
1774
1778
  if (builder) {
1775
- var userAttributes = builder.userAttributes, overrides = builder.overrides, env = builder.env; builder.host; var api = builder.api, cachebust = builder.cachebust, noCache = builder.noCache, preview = builder.preview, editing = builder.editing, frameEditing = builder.frameEditing, options = builder.options, overrideParams = builder.params;
1779
+ var userAttributes = builder.userAttributes, overrides = builder.overrides, env = builder.env, host = builder.host, api = builder.api, cachebust = builder.cachebust, noCache = builder.noCache, preview = builder.preview, editing = builder.editing, frameEditing = builder.frameEditing, options = builder.options, overrideParams = builder.params;
1776
1780
  if (userAttributes) {
1777
1781
  this.setUserAttributes(userAttributes);
1778
1782
  }
@@ -1820,7 +1824,7 @@ var Builder = /** @class */ (function () {
1820
1824
  if (isBrowser) {
1821
1825
  addEventListener('message', function (event) {
1822
1826
  var _a, _b, _c, _d, _e;
1823
- var url = parse(event.origin);
1827
+ var url = parse$1(event.origin);
1824
1828
  var isRestricted = ['builder.register', 'builder.registerComponent'].indexOf((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) === -1;
1825
1829
  var isTrusted = url.hostname && Builder.isTrustedHost(url.hostname);
1826
1830
  if (isRestricted && !isTrusted) {
@@ -2039,11 +2043,11 @@ var Builder = /** @class */ (function () {
2039
2043
  var parsedLocation = {};
2040
2044
  // in ssr mode
2041
2045
  if (this.request) {
2042
- parsedLocation = parse((_a = this.request.url) !== null && _a !== void 0 ? _a : '');
2046
+ parsedLocation = parse$1((_a = this.request.url) !== null && _a !== void 0 ? _a : '');
2043
2047
  }
2044
2048
  else if (typeof location === 'object') {
2045
2049
  // in the browser
2046
- parsedLocation = parse(location.href);
2050
+ parsedLocation = parse$1(location.href);
2047
2051
  }
2048
2052
  // IE11 bug with parsed path being empty string
2049
2053
  // causes issues with our user targeting
@@ -2284,7 +2288,7 @@ var Builder = /** @class */ (function () {
2284
2288
  }
2285
2289
  var pageQueryParams = typeof location !== 'undefined'
2286
2290
  ? QueryString.parseDeep(location.search.substr(1))
2287
- : {};
2291
+ : undefined || {};
2288
2292
  var userAttributes =
2289
2293
  // FIXME: HACK: only checks first in queue for user attributes overrides, should check all
2290
2294
  // TODO: merge user attributes provided here with defaults and current user attiributes (?)
@@ -2502,20 +2506,20 @@ var Builder = /** @class */ (function () {
2502
2506
  future.setDate(future.getDate() + 30);
2503
2507
  return this.setCookie("".concat(this.testCookiePrefix, ".").concat(contentId), variationId, future);
2504
2508
  };
2505
- Builder.prototype.getCookie = function (name) {
2509
+ Builder.prototype.getCookie = function (name$$1) {
2506
2510
  if (this.cookies) {
2507
- return this.cookies.get(name);
2511
+ return this.cookies.get(name$$1);
2508
2512
  }
2509
- return Builder.isBrowser && getCookie(name);
2513
+ return Builder.isBrowser && getCookie(name$$1);
2510
2514
  };
2511
- Builder.prototype.setCookie = function (name, value, expires) {
2515
+ Builder.prototype.setCookie = function (name$$1, value, expires) {
2512
2516
  if (this.cookies && !(Builder.isServer && Builder.isStatic)) {
2513
- return this.cookies.set(name, value, {
2517
+ return this.cookies.set(name$$1, value, {
2514
2518
  expires: expires,
2515
2519
  secure: this.getLocation().protocol === 'https:',
2516
2520
  });
2517
2521
  }
2518
- return Builder.isBrowser && setCookie(name, value, expires);
2522
+ return Builder.isBrowser && setCookie(name$$1, value, expires);
2519
2523
  };
2520
2524
  Builder.prototype.getContent = function (modelName, options) {
2521
2525
  if (options === void 0) { options = {}; }
@@ -2604,5 +2608,5 @@ var Builder = /** @class */ (function () {
2604
2608
  var builder = new Builder(null, undefined, undefined, true);
2605
2609
  Builder.singletonInstance = builder;
2606
2610
 
2607
- export { BehaviorSubject, Builder, BuilderComponent, Subscription, builder, isBrowser };
2611
+ export { Builder, BuilderComponent, isBrowser, BehaviorSubject, Subscription, builder };
2608
2612
  //# sourceMappingURL=index.esm.js.map