@builder.io/sdk 2.1.1 → 2.2.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +31 -17
  2. package/coverage/clover.xml +3918 -0
  3. package/coverage/coverage-final.json +19 -0
  4. package/coverage/lcov-report/base.css +224 -0
  5. package/coverage/lcov-report/block-navigation.js +87 -0
  6. package/coverage/lcov-report/favicon.png +0 -0
  7. package/coverage/lcov-report/index.html +176 -0
  8. package/coverage/lcov-report/prettify.css +1 -0
  9. package/coverage/lcov-report/prettify.js +2 -0
  10. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  11. package/coverage/lcov-report/sorter.js +196 -0
  12. package/coverage/lcov-report/src/builder.class.ts.html +8323 -0
  13. package/coverage/lcov-report/src/classes/animator.class.ts.html +847 -0
  14. package/coverage/lcov-report/src/classes/cookies.class.ts.html +559 -0
  15. package/coverage/lcov-report/src/classes/index.html +176 -0
  16. package/coverage/lcov-report/src/classes/observable.class.ts.html +400 -0
  17. package/coverage/lcov-report/src/classes/promise.class.ts.html +607 -0
  18. package/coverage/lcov-report/src/classes/query-string.class.ts.html +328 -0
  19. package/coverage/lcov-report/src/functions/assign.function.ts.html +139 -0
  20. package/coverage/lcov-report/src/functions/fetch.function.ts.html +427 -0
  21. package/coverage/lcov-report/src/functions/get-top-level-domain.ts.html +121 -0
  22. package/coverage/lcov-report/src/functions/index.html +236 -0
  23. package/coverage/lcov-report/src/functions/next-tick.function.ts.html +166 -0
  24. package/coverage/lcov-report/src/functions/omit.function.ts.html +106 -0
  25. package/coverage/lcov-report/src/functions/server-only-require.function.ts.html +121 -0
  26. package/coverage/lcov-report/src/functions/throttle.function.ts.html +181 -0
  27. package/coverage/lcov-report/src/functions/to-error.ts.html +133 -0
  28. package/coverage/lcov-report/src/functions/uuid.ts.html +136 -0
  29. package/coverage/lcov-report/src/index.html +131 -0
  30. package/coverage/lcov-report/src/polyfills/custom-event-polyfill.js.html +121 -0
  31. package/coverage/lcov-report/src/polyfills/index.html +116 -0
  32. package/coverage/lcov-report/src/types/api-version.ts.html +91 -0
  33. package/coverage/lcov-report/src/types/index.html +116 -0
  34. package/coverage/lcov-report/src/url.ts.html +253 -0
  35. package/coverage/lcov.info +4426 -0
  36. package/dist/index.browser.js +20 -4
  37. package/dist/index.browser.js.map +1 -1
  38. package/dist/index.cjs.js +20 -4
  39. package/dist/index.cjs.js.map +1 -1
  40. package/dist/index.esm.js +20 -4
  41. package/dist/index.esm.js.map +1 -1
  42. package/dist/index.umd.js +20 -4
  43. package/dist/index.umd.js.map +1 -1
  44. package/dist/package.json +2 -1
  45. package/dist/src/builder.class.d.ts +39 -8
  46. package/dist/src/builder.class.js +19 -3
  47. package/dist/src/builder.class.js.map +1 -1
  48. package/dist/src/builder.class.test.d.ts +1 -0
  49. package/dist/src/builder.class.test.js +23 -0
  50. package/dist/src/builder.class.test.js.map +1 -0
  51. package/dist/src/classes/cookies.class.d.ts +1 -1
  52. package/dist/src/functions/server-only-require.function.d.ts +1 -1
  53. package/dist/src/url.d.ts +1 -1
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +2 -1
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.1.1-0";
129
+ var version = "2.1.2";
130
130
 
131
131
  var Subscription = /** @class */ (function () {
132
132
  function Subscription(listeners, listener) {
@@ -1055,7 +1055,7 @@ function setCookie(name, value, expires) {
1055
1055
  expiresString +
1056
1056
  '; path=/' +
1057
1057
  "; domain=".concat(getTopLevelDomain(location.hostname)) +
1058
- (secure ? ';secure ; SameSite=None' : '');
1058
+ (secure ? '; secure; SameSite=None' : '');
1059
1059
  }
1060
1060
  catch (err) {
1061
1061
  console.warn('Could not set cookie', err);
@@ -1285,7 +1285,11 @@ var Builder = /** @class */ (function () {
1285
1285
  this.serverContext = context;
1286
1286
  };
1287
1287
  Builder.isTrustedHost = function (hostname) {
1288
- return (this.trustedHosts.findIndex(function (trustedHost) { return trustedHost === hostname || hostname.endsWith(".".concat(trustedHost)); }) > -1);
1288
+ return (this.trustedHosts.findIndex(function (trustedHost) {
1289
+ return trustedHost.startsWith('*.')
1290
+ ? hostname.endsWith(trustedHost.slice(1))
1291
+ : trustedHost === hostname;
1292
+ }) > -1);
1289
1293
  };
1290
1294
  Builder.runAction = function (action) {
1291
1295
  // TODO
@@ -2307,6 +2311,12 @@ var Builder = /** @class */ (function () {
2307
2311
  if ('noTraverse' in queue[0]) {
2308
2312
  queryParams.noTraverse = queue[0].noTraverse;
2309
2313
  }
2314
+ if ('includeUnpublished' in queue[0]) {
2315
+ queryParams.includeUnpublished = queue[0].includeUnpublished;
2316
+ }
2317
+ if (queue[0].sort) {
2318
+ queryParams.sort = queue[0].sort;
2319
+ }
2310
2320
  var pageQueryParams = typeof location !== 'undefined'
2311
2321
  ? QueryString.parseDeep(location.search.substr(1))
2312
2322
  : {}; // TODO: WHAT about SSR (this.request) ?
@@ -2595,7 +2605,13 @@ var Builder = /** @class */ (function () {
2595
2605
  Builder.nextTick = nextTick;
2596
2606
  Builder.throttle = throttle;
2597
2607
  Builder.editors = [];
2598
- Builder.trustedHosts = ['builder.io', 'localhost'];
2608
+ Builder.trustedHosts = [
2609
+ '*.beta.builder.io',
2610
+ 'beta.builder.io',
2611
+ 'builder.io',
2612
+ 'localhost',
2613
+ 'qa.builder.io',
2614
+ ];
2599
2615
  Builder.plugins = [];
2600
2616
  Builder.actions = [];
2601
2617
  Builder.registry = {};