@builder.io/sdk 6.1.1 → 6.1.3
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 +12 -0
- package/dist/index.browser.js +27 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +27 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +27 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +27 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.d.ts +3 -0
- package/dist/src/builder.class.js +26 -1
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/builder.class.test.js +34 -0
- package/dist/src/builder.class.test.js.map +1 -1
- package/dist/src/sdk-version.d.ts +1 -1
- package/dist/src/sdk-version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -950,7 +950,7 @@ function toError(err) {
|
|
|
950
950
|
|
|
951
951
|
var DEFAULT_API_VERSION = 'v3';
|
|
952
952
|
|
|
953
|
-
var SDK_VERSION = '6.1.
|
|
953
|
+
var SDK_VERSION = '6.1.3';
|
|
954
954
|
|
|
955
955
|
function datePlusMinutes(minutes) {
|
|
956
956
|
if (minutes === void 0) { minutes = 30; }
|
|
@@ -1108,6 +1108,7 @@ var Builder = /** @class */ (function () {
|
|
|
1108
1108
|
this.hasOverriddenCanTrack = false;
|
|
1109
1109
|
this.apiKey$ = new BehaviorSubject(null);
|
|
1110
1110
|
this.authToken$ = new BehaviorSubject(null);
|
|
1111
|
+
this.contentId$ = new BehaviorSubject(null);
|
|
1111
1112
|
this.userAttributesChanged = new BehaviorSubject(null);
|
|
1112
1113
|
this.editingMode$ = new BehaviorSubject(isIframe);
|
|
1113
1114
|
// TODO: decorator to do this stuff with the get/set (how do with typing too? compiler?)
|
|
@@ -1703,7 +1704,21 @@ var Builder = /** @class */ (function () {
|
|
|
1703
1704
|
}
|
|
1704
1705
|
var meta = typeof contentId === 'object' ? contentId : customProperties;
|
|
1705
1706
|
var useContentId = typeof contentId === 'string' ? contentId : undefined;
|
|
1706
|
-
|
|
1707
|
+
if (!useContentId && !contentId && this.contentId) {
|
|
1708
|
+
useContentId = this.contentId;
|
|
1709
|
+
}
|
|
1710
|
+
var useVariationId = variationId;
|
|
1711
|
+
if (!useVariationId && useContentId) {
|
|
1712
|
+
useVariationId = this.getTestCookie(useContentId);
|
|
1713
|
+
}
|
|
1714
|
+
this.track('conversion', {
|
|
1715
|
+
amount: amount,
|
|
1716
|
+
variationId: useVariationId && useContentId && useVariationId !== useContentId
|
|
1717
|
+
? useVariationId
|
|
1718
|
+
: undefined,
|
|
1719
|
+
meta: meta,
|
|
1720
|
+
contentId: useContentId,
|
|
1721
|
+
}, context);
|
|
1707
1722
|
};
|
|
1708
1723
|
Object.defineProperty(Builder.prototype, "isDevelopmentEnv", {
|
|
1709
1724
|
// TODO: set this for QA
|
|
@@ -1781,6 +1796,16 @@ var Builder = /** @class */ (function () {
|
|
|
1781
1796
|
enumerable: false,
|
|
1782
1797
|
configurable: true
|
|
1783
1798
|
});
|
|
1799
|
+
Object.defineProperty(Builder.prototype, "contentId", {
|
|
1800
|
+
get: function () {
|
|
1801
|
+
return this.contentId$.value;
|
|
1802
|
+
},
|
|
1803
|
+
set: function (id) {
|
|
1804
|
+
this.contentId$.next(id);
|
|
1805
|
+
},
|
|
1806
|
+
enumerable: false,
|
|
1807
|
+
configurable: true
|
|
1808
|
+
});
|
|
1784
1809
|
Object.defineProperty(Builder.prototype, "authToken", {
|
|
1785
1810
|
get: function () {
|
|
1786
1811
|
return this.authToken$.value;
|