@builder.io/sdk 3.0.2-0 → 3.0.2-2
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.browser.js +8 -16
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +8 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +49 -13
- package/dist/index.umd.js +8 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +2 -3
- package/dist/src/builder.class.d.ts +3 -1
- package/dist/src/builder.class.js +7 -2
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/builder.class.test.js +171 -153
- package/dist/src/classes/animator.class.js +218 -195
- package/dist/src/classes/cookies.class.js +0 -2
- package/dist/src/classes/cookies.class.js.map +1 -1
- package/dist/src/classes/observable.class.js +102 -97
- package/dist/src/constants/builder.js +4 -4
- package/dist/src/functions/get-top-level-domain.d.ts +6 -6
- package/dist/src/types/content.js +3 -3
- package/dist/src/url.js +41 -42
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.builder =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.builder =
|
|
4
|
+
exports.Subscription =
|
|
5
|
+
exports.BehaviorSubject =
|
|
6
|
+
exports.isBrowser =
|
|
7
|
+
exports.BuilderComponent =
|
|
8
|
+
exports.Builder =
|
|
9
|
+
void 0;
|
|
10
|
+
var builder_class_1 = require('./src/builder.class');
|
|
11
|
+
Object.defineProperty(exports, 'Builder', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return builder_class_1.Builder;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, 'BuilderComponent', {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return builder_class_1.BuilderComponent;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, 'isBrowser', {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return builder_class_1.isBrowser;
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
var observable_class_1 = require('./src/classes/observable.class');
|
|
30
|
+
Object.defineProperty(exports, 'BehaviorSubject', {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return observable_class_1.BehaviorSubject;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, 'Subscription', {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return observable_class_1.Subscription;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
var builder_1 = require('./src/constants/builder');
|
|
43
|
+
Object.defineProperty(exports, 'builder', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return builder_1.builder;
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.umd.js
CHANGED
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
var version = "3.0.2-
|
|
155
|
+
var version = "3.0.2-1";
|
|
156
156
|
|
|
157
157
|
var Subscription = /** @class */ (function () {
|
|
158
158
|
function Subscription(listeners, listener) {
|
|
@@ -767,19 +767,6 @@
|
|
|
767
767
|
return Animator;
|
|
768
768
|
}());
|
|
769
769
|
|
|
770
|
-
/**
|
|
771
|
-
* Only gets one level up from hostname
|
|
772
|
-
* wwww.example.com -> example.com
|
|
773
|
-
* www.example.co.uk -> example.co.uk
|
|
774
|
-
*/
|
|
775
|
-
function getTopLevelDomain(host) {
|
|
776
|
-
var parts = host.split('.');
|
|
777
|
-
if (parts.length > 2) {
|
|
778
|
-
return parts.slice(1).join('.');
|
|
779
|
-
}
|
|
780
|
-
return host;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
770
|
/**
|
|
784
771
|
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
785
772
|
*
|
|
@@ -824,7 +811,6 @@
|
|
|
824
811
|
if (opts && 'secure' in opts) {
|
|
825
812
|
cookie.secure = !!opts.secure;
|
|
826
813
|
}
|
|
827
|
-
cookie.domain = req.headers.host && getTopLevelDomain(req.headers.host);
|
|
828
814
|
pushCookie(headers, cookie);
|
|
829
815
|
var setHeader = res.setHeader;
|
|
830
816
|
setHeader.call(res, 'Set-Cookie', headers);
|
|
@@ -1149,7 +1135,6 @@
|
|
|
1149
1135
|
(value || '') +
|
|
1150
1136
|
expiresString +
|
|
1151
1137
|
'; path=/' +
|
|
1152
|
-
"; domain=".concat(getTopLevelDomain(location.hostname)) +
|
|
1153
1138
|
(secure ? '; secure; SameSite=None' : '');
|
|
1154
1139
|
}
|
|
1155
1140
|
catch (err) {
|
|
@@ -2206,6 +2191,12 @@
|
|
|
2206
2191
|
};
|
|
2207
2192
|
Builder.prototype.setUserAttributes = function (options) {
|
|
2208
2193
|
assign(Builder.overrideUserAttributes, options);
|
|
2194
|
+
try {
|
|
2195
|
+
this.setCookie(Builder.attributesCookieName, JSON.stringify(this.getUserAttributes()));
|
|
2196
|
+
}
|
|
2197
|
+
catch (_a) {
|
|
2198
|
+
// Ignore
|
|
2199
|
+
}
|
|
2209
2200
|
this.userAttributesChanged.next(options);
|
|
2210
2201
|
};
|
|
2211
2202
|
/**
|
|
@@ -2712,6 +2703,7 @@
|
|
|
2712
2703
|
Builder.plugins = [];
|
|
2713
2704
|
Builder.actions = [];
|
|
2714
2705
|
Builder.registry = {};
|
|
2706
|
+
Builder.attributesCookieName = 'builder.userAttributes';
|
|
2715
2707
|
Builder.registryChange = new BehaviorSubject({});
|
|
2716
2708
|
Builder._editingPage = false;
|
|
2717
2709
|
Builder.isIframe = isIframe;
|