@builder.io/sdk 2.2.7-0 → 2.2.7
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/.yarnrc.yml +1 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.browser.js +40 -50
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +40 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +40 -50
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +40 -50
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.js +39 -49
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/classes/promise.class.js +154 -150
- package/dist/src/classes/query-string.class.js +74 -73
- package/dist/src/classes/query-string.class.test.js +20 -20
- package/dist/src/functions/assign.function.js +19 -19
- package/dist/src/functions/fetch.function.js +75 -97
- package/dist/src/functions/finder.function.js +274 -389
- package/dist/src/functions/get-top-level-domain.js +8 -8
- package/dist/src/functions/next-tick.function.js +23 -26
- package/dist/src/functions/omit.function.js +13 -13
- package/dist/src/functions/server-only-require.function.js +9 -10
- package/dist/src/functions/throttle.function.js +37 -35
- package/dist/src/functions/to-error.js +6 -5
- package/dist/src/functions/uuid.js +8 -9
- package/dist/src/types/api-version.js +3 -3
- package/dist/src/types/element.js +3 -3
- package/dist/src/url.test.js +118 -222
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
package/dist/index.cjs.js
CHANGED
|
@@ -126,7 +126,7 @@ function assertAllowedPropertyName(name) {
|
|
|
126
126
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
var version = "2.2.
|
|
129
|
+
var version = "2.2.7";
|
|
130
130
|
|
|
131
131
|
var Subscription = /** @class */ (function () {
|
|
132
132
|
function Subscription(listeners, listener) {
|
|
@@ -1767,20 +1767,15 @@ var Builder = /** @class */ (function () {
|
|
|
1767
1767
|
};
|
|
1768
1768
|
Builder.prototype.setTestsFromUrl = function () {
|
|
1769
1769
|
var search = this.getLocation().search;
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
this.setTestCookie(key, tests[key]);
|
|
1777
|
-
}
|
|
1770
|
+
var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
|
|
1771
|
+
var tests = params.builder && params.builder.tests;
|
|
1772
|
+
if (tests && typeof tests === 'object') {
|
|
1773
|
+
for (var key in tests) {
|
|
1774
|
+
if (tests.hasOwnProperty(key)) {
|
|
1775
|
+
this.setTestCookie(key, tests[key]);
|
|
1778
1776
|
}
|
|
1779
1777
|
}
|
|
1780
1778
|
}
|
|
1781
|
-
catch (e) {
|
|
1782
|
-
console.debug('Error parsing tests from URL', e);
|
|
1783
|
-
}
|
|
1784
1779
|
};
|
|
1785
1780
|
Builder.prototype.resetOverrides = function () {
|
|
1786
1781
|
// Ugly - pass down instances per request instead using react context
|
|
@@ -1798,46 +1793,41 @@ var Builder = /** @class */ (function () {
|
|
|
1798
1793
|
};
|
|
1799
1794
|
Builder.prototype.getOverridesFromQueryString = function () {
|
|
1800
1795
|
var location = this.getLocation();
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
this.editingModel = editingModel;
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
if (cachebust) {
|
|
1826
|
-
this.cachebust = true;
|
|
1827
|
-
}
|
|
1828
|
-
if (noCache) {
|
|
1829
|
-
this.noCache = true;
|
|
1830
|
-
}
|
|
1831
|
-
if (preview) {
|
|
1832
|
-
this.preview = true;
|
|
1833
|
-
}
|
|
1834
|
-
if (params) {
|
|
1835
|
-
this.overrideParams = overrideParams;
|
|
1796
|
+
var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
|
|
1797
|
+
var builder = params.builder;
|
|
1798
|
+
if (builder) {
|
|
1799
|
+
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;
|
|
1800
|
+
if (userAttributes) {
|
|
1801
|
+
this.setUserAttributes(userAttributes);
|
|
1802
|
+
}
|
|
1803
|
+
if (options) {
|
|
1804
|
+
// picking only locale, includeRefs, and enrich for now
|
|
1805
|
+
this.queryOptions = tslib.__assign(tslib.__assign(tslib.__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
|
|
1806
|
+
}
|
|
1807
|
+
if (overrides) {
|
|
1808
|
+
this.overrides = overrides;
|
|
1809
|
+
}
|
|
1810
|
+
if (validEnvList.indexOf(env || api) > -1) {
|
|
1811
|
+
this.env = env || api;
|
|
1812
|
+
}
|
|
1813
|
+
if (Builder.isEditing) {
|
|
1814
|
+
var editingModel = frameEditing || editing || preview;
|
|
1815
|
+
if (editingModel && editingModel !== 'true') {
|
|
1816
|
+
this.editingModel = editingModel;
|
|
1836
1817
|
}
|
|
1837
1818
|
}
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1819
|
+
if (cachebust) {
|
|
1820
|
+
this.cachebust = true;
|
|
1821
|
+
}
|
|
1822
|
+
if (noCache) {
|
|
1823
|
+
this.noCache = true;
|
|
1824
|
+
}
|
|
1825
|
+
if (preview) {
|
|
1826
|
+
this.preview = true;
|
|
1827
|
+
}
|
|
1828
|
+
if (params) {
|
|
1829
|
+
this.overrideParams = overrideParams;
|
|
1830
|
+
}
|
|
1841
1831
|
}
|
|
1842
1832
|
};
|
|
1843
1833
|
Builder.prototype.messageFrameLoaded = function () {
|