@builder.io/sdk-react-nextjs 0.22.1 → 0.22.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.2";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.22.1";
1
+ const o = "0.22.2";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../helpers/search/search.cjs"),n=require("./is-browser.cjs");function o(r){const e=r||(n.isBrowser()?window.location.search:void 0);return e?i.getSearchString(e).indexOf("builder.preview=")!==-1:!1}exports.isPreviewing=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../helpers/search/search.cjs"),o=require("./is-browser.cjs");function n(r){const e=r||(o.isBrowser()?window.location.search:void 0);return e?i.getSearchString(e).indexOf("builder.preview=")!==-1:!1}exports.isPreviewing=n;
@@ -1,8 +1,8 @@
1
- import { getSearchString as i } from "../helpers/search/search.mjs";
2
- import { isBrowser as o } from "./is-browser.mjs";
1
+ import { getSearchString as o } from "../helpers/search/search.mjs";
2
+ import { isBrowser as i } from "./is-browser.mjs";
3
3
  function c(e) {
4
- const r = e || (o() ? window.location.search : void 0);
5
- return r ? i(r).indexOf("builder.preview=") !== -1 : !1;
4
+ const r = e || (i() ? window.location.search : void 0);
5
+ return r ? o(r).indexOf("builder.preview=") !== -1 : !1;
6
6
  }
7
7
  export {
8
8
  c as isPreviewing
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.2";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.22.1";
1
+ const o = "0.22.2";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../helpers/search/search.cjs"),n=require("./is-browser.cjs");function o(r){const e=r||(n.isBrowser()?window.location.search:void 0);return e?i.getSearchString(e).indexOf("builder.preview=")!==-1:!1}exports.isPreviewing=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../helpers/search/search.cjs"),o=require("./is-browser.cjs");function n(r){const e=r||(o.isBrowser()?window.location.search:void 0);return e?i.getSearchString(e).indexOf("builder.preview=")!==-1:!1}exports.isPreviewing=n;
@@ -1,8 +1,8 @@
1
- import { getSearchString as i } from "../helpers/search/search.mjs";
2
- import { isBrowser as o } from "./is-browser.mjs";
1
+ import { getSearchString as o } from "../helpers/search/search.mjs";
2
+ import { isBrowser as i } from "./is-browser.mjs";
3
3
  function c(e) {
4
- const r = e || (o() ? window.location.search : void 0);
5
- return r ? i(r).indexOf("builder.preview=") !== -1 : !1;
4
+ const r = e || (i() ? window.location.search : void 0);
5
+ return r ? o(r).indexOf("builder.preview=") !== -1 : !1;
6
6
  }
7
7
  export {
8
8
  c as isPreviewing
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.2";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.22.1";
1
+ const o = "0.22.2";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../helpers/search/search.cjs"),n=require("./is-browser.cjs");function o(r){const e=r||(n.isBrowser()?window.location.search:void 0);return e?i.getSearchString(e).indexOf("builder.preview=")!==-1:!1}exports.isPreviewing=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../helpers/search/search.cjs"),o=require("./is-browser.cjs");function n(r){const e=r||(o.isBrowser()?window.location.search:void 0);return e?i.getSearchString(e).indexOf("builder.preview=")!==-1:!1}exports.isPreviewing=n;
@@ -1,8 +1,8 @@
1
- import { getSearchString as i } from "../helpers/search/search.mjs";
2
- import { isBrowser as o } from "./is-browser.mjs";
1
+ import { getSearchString as o } from "../helpers/search/search.mjs";
2
+ import { isBrowser as i } from "./is-browser.mjs";
3
3
  function c(e) {
4
- const r = e || (o() ? window.location.search : void 0);
5
- return r ? i(r).indexOf("builder.preview=") !== -1 : !1;
4
+ const r = e || (i() ? window.location.search : void 0);
5
+ return r ? o(r).indexOf("builder.preview=") !== -1 : !1;
6
6
  }
7
7
  export {
8
8
  c as isPreviewing
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react-nextjs",
3
3
  "description": "Builder.io RSC SDK for NextJS App Directory",
4
- "version": "0.22.1",
4
+ "version": "0.22.2",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.22.1";
1
+ export declare const SDK_VERSION = "0.22.2";
@@ -1,7 +1,13 @@
1
1
  import type { QueryObject } from '../../helpers/search/search.js';
2
2
  /**
3
- * Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
4
- * relevant to the Builder SDK.
3
+ * Receives a `URLSearchParams` object or a regular query object, and returns
4
+ * the subset of query params that are relevant to the Builder SDK.
5
+ *
6
+ * Outputs a key-value object to be passed to `fetchOneEntry` or `fetchEntries`
7
+ * functions as the `options` argument.
8
+ *
9
+ * NOTE: This function is generally not needed. Instead, it is recommended to use `isPreviewing()`
10
+ * to check if the current page requires previewed content.
5
11
  *
6
12
  * @returns
7
13
  */
@@ -1,2 +1,12 @@
1
1
  import type { Search } from '../helpers/search/search.js';
2
- export declare function isPreviewing(_search?: Search): boolean;
2
+ /**
3
+ * Checks the current URL's search parameters to see if it is attempting to
4
+ * preview Builder Content.
5
+ *
6
+ * When called on the client, it uses `window.location.search`.
7
+ * When called on the server (SSR), it requires a `search` argument.
8
+ *
9
+ * @param search - The search parameters to check. Can be a URL string (containing the search parameters), `URLSearchParams`, or a key-value object containing the search parameters.
10
+ * @returns `true` if the current page is being previewed, `false` otherwise.
11
+ */
12
+ export declare function isPreviewing(search?: Search): boolean;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.22.1";
1
+ export declare const SDK_VERSION = "0.22.2";
@@ -1,7 +1,13 @@
1
1
  import type { QueryObject } from '../../helpers/search/search.js';
2
2
  /**
3
- * Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
4
- * relevant to the Builder SDK.
3
+ * Receives a `URLSearchParams` object or a regular query object, and returns
4
+ * the subset of query params that are relevant to the Builder SDK.
5
+ *
6
+ * Outputs a key-value object to be passed to `fetchOneEntry` or `fetchEntries`
7
+ * functions as the `options` argument.
8
+ *
9
+ * NOTE: This function is generally not needed. Instead, it is recommended to use `isPreviewing()`
10
+ * to check if the current page requires previewed content.
5
11
  *
6
12
  * @returns
7
13
  */
@@ -1,2 +1,12 @@
1
1
  import type { Search } from '../helpers/search/search.js';
2
- export declare function isPreviewing(_search?: Search): boolean;
2
+ /**
3
+ * Checks the current URL's search parameters to see if it is attempting to
4
+ * preview Builder Content.
5
+ *
6
+ * When called on the client, it uses `window.location.search`.
7
+ * When called on the server (SSR), it requires a `search` argument.
8
+ *
9
+ * @param search - The search parameters to check. Can be a URL string (containing the search parameters), `URLSearchParams`, or a key-value object containing the search parameters.
10
+ * @returns `true` if the current page is being previewed, `false` otherwise.
11
+ */
12
+ export declare function isPreviewing(search?: Search): boolean;