@builder.io/sdk 6.0.3 → 6.0.5

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
@@ -1052,7 +1052,7 @@
1052
1052
 
1053
1053
  var DEFAULT_API_VERSION = 'v3';
1054
1054
 
1055
- var SDK_VERSION = '6.0.3';
1055
+ var SDK_VERSION = '6.0.5';
1056
1056
 
1057
1057
  function datePlusMinutes(minutes) {
1058
1058
  if (minutes === void 0) { minutes = 30; }
@@ -1207,6 +1207,7 @@
1207
1207
  this.apiEndpoint$ = new BehaviorSubject('query');
1208
1208
  this.apiVersion$ = new BehaviorSubject(undefined);
1209
1209
  this.canTrack$ = new BehaviorSubject(!this.browserTrackingDisabled);
1210
+ this.hasOverriddenCanTrack = false;
1210
1211
  this.apiKey$ = new BehaviorSubject(null);
1211
1212
  this.authToken$ = new BehaviorSubject(null);
1212
1213
  this.userAttributesChanged = new BehaviorSubject(null);
@@ -1578,6 +1579,7 @@
1578
1579
  return this.canTrack$.value;
1579
1580
  },
1580
1581
  set: function (canTrack) {
1582
+ this.hasOverriddenCanTrack = true;
1581
1583
  if (this.canTrack !== canTrack) {
1582
1584
  this.canTrack$.next(canTrack);
1583
1585
  }
@@ -2153,7 +2155,9 @@
2153
2155
  if (res) {
2154
2156
  this.response = res;
2155
2157
  }
2156
- this.canTrack = canTrack;
2158
+ if (!this.hasOverriddenCanTrack) {
2159
+ this.canTrack = canTrack;
2160
+ }
2157
2161
  this.apiKey = apiKey;
2158
2162
  if (authToken) {
2159
2163
  this.authToken = authToken;
@@ -2440,7 +2444,7 @@
2440
2444
  };
2441
2445
  Builder.prototype.flushGetContentQueue = function (usePastQueue, useQueue) {
2442
2446
  var _this = this;
2443
- var _a;
2447
+ var _a, _b;
2444
2448
  if (usePastQueue === void 0) { usePastQueue = false; }
2445
2449
  if (!this.apiKey) {
2446
2450
  throw new Error("Fetching content failed, expected apiKey to be defined instead got: ".concat(this.apiKey));
@@ -2461,7 +2465,7 @@
2461
2465
  this.getOverridesFromQueryString();
2462
2466
  var queryParams = __assign(__assign({
2463
2467
  // TODO: way to force a request to be in a separate queue. or just lower queue limit to be 1 by default
2464
- omit: queue[0].omit || 'meta.componentsUsed', apiKey: this.apiKey }, queue[0].options), this.queryOptions);
2468
+ omit: (_a = queue[0].omit) !== null && _a !== void 0 ? _a : 'meta.componentsUsed', apiKey: this.apiKey }, queue[0].options), this.queryOptions);
2465
2469
  if (queue[0].locale) {
2466
2470
  queryParams.locale = queue[0].locale;
2467
2471
  }
@@ -2566,8 +2570,8 @@
2566
2570
  'static',
2567
2571
  'includeRefs',
2568
2572
  ];
2569
- for (var _b = 0, properties_1 = properties; _b < properties_1.length; _b++) {
2570
- var key = properties_1[_b];
2573
+ for (var _c = 0, properties_1 = properties; _c < properties_1.length; _c++) {
2574
+ var key = properties_1[_c];
2571
2575
  var value = options[key];
2572
2576
  if (value !== undefined) {
2573
2577
  if (this.apiEndpoint === 'query') {
@@ -2581,7 +2585,7 @@
2581
2585
  }
2582
2586
  }
2583
2587
  }
2584
- if (this.preview && this.previewingModel === ((_a = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _a === void 0 ? void 0 : _a.model)) {
2588
+ if (this.preview && this.previewingModel === ((_b = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _b === void 0 ? void 0 : _b.model)) {
2585
2589
  queryParams.preview = 'true';
2586
2590
  }
2587
2591
  var hasParams = Object.keys(queryParams).length > 0;