@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.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define('@builder.io/sdk', ['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BuilderIO = {}));
5
- })(this, (function (exports) { 'use strict';
4
+ (factory((global.BuilderIO = {})));
5
+ }(this, (function (exports) { 'use strict';
6
6
 
7
7
  /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -28,11 +28,6 @@
28
28
  return t;
29
29
  };
30
30
  return __assign.apply(this, arguments);
31
- };
32
-
33
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
34
- var e = new Error(message);
35
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
36
31
  };
37
32
 
38
33
  (function () {
@@ -157,7 +152,7 @@
157
152
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
158
153
  }
159
154
 
160
- var version = "1.1.36-0";
155
+ var version = "1.1.36";
161
156
 
162
157
  var Subscription = /** @class */ (function () {
163
158
  function Subscription(listeners, listener) {
@@ -507,6 +502,10 @@
507
502
  }
508
503
 
509
504
  function assign(target) {
505
+ var args = [];
506
+ for (var _i = 1; _i < arguments.length; _i++) {
507
+ args[_i - 1] = arguments[_i];
508
+ }
510
509
  var to = Object(target);
511
510
  for (var index = 1; index < arguments.length; index++) {
512
511
  var nextSource = arguments[index];
@@ -947,7 +946,7 @@
947
946
  }
948
947
  // Replacement for `url.parse` using `URL` global object that works with relative paths.
949
948
  // Assumptions: this function operates in a NodeJS environment.
950
- function parse$1(url) {
949
+ function parse(url) {
951
950
  var out = emptyUrl();
952
951
  var u;
953
952
  var pathOnly = url === '' || url[0] === '/';
@@ -1125,12 +1124,12 @@
1125
1124
  return out;
1126
1125
  },
1127
1126
  };
1128
- var parse = isReactNative
1127
+ var parse$1 = isReactNative
1129
1128
  ? function () { return emptyUrl(); }
1130
1129
  : typeof window === 'object'
1131
1130
  ? urlParser.parse
1132
- : parse$1;
1133
- function setCookie(name, value, expires) {
1131
+ : parse;
1132
+ function setCookie(name$$1, value, expires) {
1134
1133
  try {
1135
1134
  var expiresString = '';
1136
1135
  // TODO: need to know if secure server side
@@ -1139,7 +1138,7 @@
1139
1138
  }
1140
1139
  var secure = isBrowser ? location.protocol === 'https:' : true;
1141
1140
  document.cookie =
1142
- name +
1141
+ name$$1 +
1143
1142
  '=' +
1144
1143
  (value || '') +
1145
1144
  expiresString +
@@ -1151,10 +1150,10 @@
1151
1150
  console.warn('Could not set cookie', err);
1152
1151
  }
1153
1152
  }
1154
- function getCookie(name) {
1153
+ function getCookie(name$$1) {
1155
1154
  try {
1156
1155
  return (decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' +
1157
- encodeURIComponent(name).replace(/[\-\.\+\*]/g, '\\$&') +
1156
+ encodeURIComponent(name$$1).replace(/[\-\.\+\*]/g, '\\$&') +
1158
1157
  '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null);
1159
1158
  }
1160
1159
  catch (err) {
@@ -1377,11 +1376,11 @@
1377
1376
  throw new Error("Action not found: ".concat(action));
1378
1377
  }
1379
1378
  };
1380
- Builder.fields = function (name, fields) {
1379
+ Builder.fields = function (name$$1, fields) {
1381
1380
  var _a;
1382
1381
  (_a = window.parent) === null || _a === void 0 ? void 0 : _a.postMessage({
1383
1382
  type: 'builder.fields',
1384
- data: { name: name, fields: fields },
1383
+ data: { name: name$$1, fields: fields },
1385
1384
  }, '*');
1386
1385
  };
1387
1386
  /**
@@ -1874,7 +1873,7 @@
1874
1873
  var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
1875
1874
  var builder = params.builder;
1876
1875
  if (builder) {
1877
- 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;
1876
+ 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;
1878
1877
  if (userAttributes) {
1879
1878
  this.setUserAttributes(userAttributes);
1880
1879
  }
@@ -1922,7 +1921,7 @@
1922
1921
  if (isBrowser) {
1923
1922
  addEventListener('message', function (event) {
1924
1923
  var _a, _b, _c, _d, _e;
1925
- var url = parse(event.origin);
1924
+ var url = parse$1(event.origin);
1926
1925
  var isRestricted = ['builder.register', 'builder.registerComponent'].indexOf((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) === -1;
1927
1926
  var isTrusted = url.hostname && Builder.isTrustedHost(url.hostname);
1928
1927
  if (isRestricted && !isTrusted) {
@@ -2141,11 +2140,11 @@
2141
2140
  var parsedLocation = {};
2142
2141
  // in ssr mode
2143
2142
  if (this.request) {
2144
- parsedLocation = parse((_a = this.request.url) !== null && _a !== void 0 ? _a : '');
2143
+ parsedLocation = parse$1((_a = this.request.url) !== null && _a !== void 0 ? _a : '');
2145
2144
  }
2146
2145
  else if (typeof location === 'object') {
2147
2146
  // in the browser
2148
- parsedLocation = parse(location.href);
2147
+ parsedLocation = parse$1(location.href);
2149
2148
  }
2150
2149
  // IE11 bug with parsed path being empty string
2151
2150
  // causes issues with our user targeting
@@ -2386,7 +2385,7 @@
2386
2385
  }
2387
2386
  var pageQueryParams = typeof location !== 'undefined'
2388
2387
  ? QueryString.parseDeep(location.search.substr(1))
2389
- : {};
2388
+ : undefined || {};
2390
2389
  var userAttributes =
2391
2390
  // FIXME: HACK: only checks first in queue for user attributes overrides, should check all
2392
2391
  // TODO: merge user attributes provided here with defaults and current user attiributes (?)
@@ -2604,20 +2603,20 @@
2604
2603
  future.setDate(future.getDate() + 30);
2605
2604
  return this.setCookie("".concat(this.testCookiePrefix, ".").concat(contentId), variationId, future);
2606
2605
  };
2607
- Builder.prototype.getCookie = function (name) {
2606
+ Builder.prototype.getCookie = function (name$$1) {
2608
2607
  if (this.cookies) {
2609
- return this.cookies.get(name);
2608
+ return this.cookies.get(name$$1);
2610
2609
  }
2611
- return Builder.isBrowser && getCookie(name);
2610
+ return Builder.isBrowser && getCookie(name$$1);
2612
2611
  };
2613
- Builder.prototype.setCookie = function (name, value, expires) {
2612
+ Builder.prototype.setCookie = function (name$$1, value, expires) {
2614
2613
  if (this.cookies && !(Builder.isServer && Builder.isStatic)) {
2615
- return this.cookies.set(name, value, {
2614
+ return this.cookies.set(name$$1, value, {
2616
2615
  expires: expires,
2617
2616
  secure: this.getLocation().protocol === 'https:',
2618
2617
  });
2619
2618
  }
2620
- return Builder.isBrowser && setCookie(name, value, expires);
2619
+ return Builder.isBrowser && setCookie(name$$1, value, expires);
2621
2620
  };
2622
2621
  Builder.prototype.getContent = function (modelName, options) {
2623
2622
  if (options === void 0) { options = {}; }
@@ -2706,14 +2705,14 @@
2706
2705
  var builder = new Builder(null, undefined, undefined, true);
2707
2706
  Builder.singletonInstance = builder;
2708
2707
 
2709
- exports.BehaviorSubject = BehaviorSubject;
2710
2708
  exports.Builder = Builder;
2711
2709
  exports.BuilderComponent = BuilderComponent;
2710
+ exports.isBrowser = isBrowser;
2711
+ exports.BehaviorSubject = BehaviorSubject;
2712
2712
  exports.Subscription = Subscription;
2713
2713
  exports.builder = builder;
2714
- exports.isBrowser = isBrowser;
2715
2714
 
2716
2715
  Object.defineProperty(exports, '__esModule', { value: true });
2717
2716
 
2718
- }));
2717
+ })));
2719
2718
  //# sourceMappingURL=index.umd.js.map