@builder.io/sdk 2.2.6 → 2.2.7-0
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 +50 -40
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +50 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +50 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +50 -40
- package/dist/index.umd.js.map +1 -1
- package/dist/src/builder.class.js +50 -40
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/classes/promise.class.js +150 -154
- package/dist/src/classes/query-string.class.js +73 -74
- 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 +97 -75
- package/dist/src/functions/finder.function.js +389 -274
- package/dist/src/functions/get-top-level-domain.js +8 -8
- package/dist/src/functions/next-tick.function.js +26 -23
- package/dist/src/functions/omit.function.js +13 -13
- package/dist/src/functions/server-only-require.function.js +10 -9
- package/dist/src/functions/throttle.function.js +35 -37
- package/dist/src/functions/to-error.js +5 -6
- package/dist/src/functions/uuid.js +9 -8
- package/dist/src/types/api-version.js +3 -3
- package/dist/src/types/element.js +3 -3
- package/dist/src/url.test.js +222 -118
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/.yarnrc.yml +0 -1
package/dist/index.browser.js
CHANGED
|
@@ -1861,15 +1861,20 @@
|
|
|
1861
1861
|
};
|
|
1862
1862
|
Builder.prototype.setTestsFromUrl = function () {
|
|
1863
1863
|
var search = this.getLocation().search;
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1864
|
+
try {
|
|
1865
|
+
var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
|
|
1866
|
+
var tests = params.builder && params.builder.tests;
|
|
1867
|
+
if (tests && typeof tests === 'object') {
|
|
1868
|
+
for (var key in tests) {
|
|
1869
|
+
if (tests.hasOwnProperty(key)) {
|
|
1870
|
+
this.setTestCookie(key, tests[key]);
|
|
1871
|
+
}
|
|
1870
1872
|
}
|
|
1871
1873
|
}
|
|
1872
1874
|
}
|
|
1875
|
+
catch (e) {
|
|
1876
|
+
console.debug('Error parsing tests from URL', e);
|
|
1877
|
+
}
|
|
1873
1878
|
};
|
|
1874
1879
|
Builder.prototype.resetOverrides = function () {
|
|
1875
1880
|
// Ugly - pass down instances per request instead using react context
|
|
@@ -1887,41 +1892,46 @@
|
|
|
1887
1892
|
};
|
|
1888
1893
|
Builder.prototype.getOverridesFromQueryString = function () {
|
|
1889
1894
|
var location = this.getLocation();
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1895
|
+
try {
|
|
1896
|
+
var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
|
|
1897
|
+
var builder = params.builder;
|
|
1898
|
+
if (builder) {
|
|
1899
|
+
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;
|
|
1900
|
+
if (userAttributes) {
|
|
1901
|
+
this.setUserAttributes(userAttributes);
|
|
1902
|
+
}
|
|
1903
|
+
if (options) {
|
|
1904
|
+
// picking only locale, includeRefs, and enrich for now
|
|
1905
|
+
this.queryOptions = __assign(__assign(__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
|
|
1906
|
+
}
|
|
1907
|
+
if (overrides) {
|
|
1908
|
+
this.overrides = overrides;
|
|
1909
|
+
}
|
|
1910
|
+
if (validEnvList.indexOf(env || api) > -1) {
|
|
1911
|
+
this.env = env || api;
|
|
1912
|
+
}
|
|
1913
|
+
if (Builder.isEditing) {
|
|
1914
|
+
var editingModel = frameEditing || editing || preview;
|
|
1915
|
+
if (editingModel && editingModel !== 'true') {
|
|
1916
|
+
this.editingModel = editingModel;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
if (cachebust) {
|
|
1920
|
+
this.cachebust = true;
|
|
1921
|
+
}
|
|
1922
|
+
if (noCache) {
|
|
1923
|
+
this.noCache = true;
|
|
1924
|
+
}
|
|
1925
|
+
if (preview) {
|
|
1926
|
+
this.preview = true;
|
|
1927
|
+
}
|
|
1928
|
+
if (params) {
|
|
1929
|
+
this.overrideParams = overrideParams;
|
|
1911
1930
|
}
|
|
1912
1931
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
if (noCache) {
|
|
1917
|
-
this.noCache = true;
|
|
1918
|
-
}
|
|
1919
|
-
if (preview) {
|
|
1920
|
-
this.preview = true;
|
|
1921
|
-
}
|
|
1922
|
-
if (params) {
|
|
1923
|
-
this.overrideParams = overrideParams;
|
|
1924
|
-
}
|
|
1932
|
+
}
|
|
1933
|
+
catch (e) {
|
|
1934
|
+
console.debug('Error parsing overrides from URL', e);
|
|
1925
1935
|
}
|
|
1926
1936
|
};
|
|
1927
1937
|
Builder.prototype.messageFrameLoaded = function () {
|
|
@@ -2438,7 +2448,7 @@
|
|
|
2438
2448
|
}
|
|
2439
2449
|
// TODO: merge in the attribute from query string ones
|
|
2440
2450
|
// TODO: make this an option per component/request
|
|
2441
|
-
queryParams.userAttributes =
|
|
2451
|
+
queryParams.userAttributes = userAttributes;
|
|
2442
2452
|
if (!usePastQueue && !useQueue) {
|
|
2443
2453
|
this.priorContentQueue = queue;
|
|
2444
2454
|
this.getContentQueue = null;
|