@builder.io/sdk-react-nextjs 0.16.16 → 0.16.18

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 (45) hide show
  1. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  2. package/lib/browser/components/blocks/blocks-wrapper.mjs +15 -11
  3. package/lib/browser/components/blocks/blocks.cjs +1 -1
  4. package/lib/browser/components/blocks/blocks.mjs +5 -4
  5. package/lib/browser/constants/sdk-version.cjs +1 -1
  6. package/lib/browser/constants/sdk-version.mjs +1 -1
  7. package/lib/browser/functions/get-content/index.cjs +1 -1
  8. package/lib/browser/functions/get-content/index.mjs +50 -43
  9. package/lib/browser/functions/track/index.cjs +1 -1
  10. package/lib/browser/functions/track/index.mjs +23 -21
  11. package/lib/browser/helpers/sdk-headers.cjs +1 -0
  12. package/lib/browser/helpers/sdk-headers.mjs +10 -0
  13. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  14. package/lib/edge/components/blocks/blocks-wrapper.mjs +15 -11
  15. package/lib/edge/components/blocks/blocks.cjs +1 -1
  16. package/lib/edge/components/blocks/blocks.mjs +5 -4
  17. package/lib/edge/constants/sdk-version.cjs +1 -1
  18. package/lib/edge/constants/sdk-version.mjs +1 -1
  19. package/lib/edge/functions/get-content/index.cjs +1 -1
  20. package/lib/edge/functions/get-content/index.mjs +50 -43
  21. package/lib/edge/functions/track/index.cjs +1 -1
  22. package/lib/edge/functions/track/index.mjs +23 -21
  23. package/lib/edge/helpers/sdk-headers.cjs +1 -0
  24. package/lib/edge/helpers/sdk-headers.mjs +10 -0
  25. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  26. package/lib/node/components/blocks/blocks-wrapper.mjs +15 -11
  27. package/lib/node/components/blocks/blocks.cjs +1 -1
  28. package/lib/node/components/blocks/blocks.mjs +5 -4
  29. package/lib/node/constants/sdk-version.cjs +1 -1
  30. package/lib/node/constants/sdk-version.mjs +1 -1
  31. package/lib/node/functions/get-content/index.cjs +1 -1
  32. package/lib/node/functions/get-content/index.mjs +50 -43
  33. package/lib/node/functions/track/index.cjs +1 -1
  34. package/lib/node/functions/track/index.mjs +23 -21
  35. package/lib/node/helpers/sdk-headers.cjs +1 -0
  36. package/lib/node/helpers/sdk-headers.mjs +10 -0
  37. package/package.json +1 -1
  38. package/types/cjs/components/blocks/blocks-wrapper.d.ts +1 -0
  39. package/types/cjs/components/blocks/blocks.types.d.ts +2 -1
  40. package/types/cjs/constants/sdk-version.d.ts +1 -1
  41. package/types/cjs/helpers/sdk-headers.d.ts +5 -0
  42. package/types/esm/components/blocks/blocks-wrapper.d.ts +1 -0
  43. package/types/esm/components/blocks/blocks.types.d.ts +2 -1
  44. package/types/esm/constants/sdk-version.d.ts +1 -1
  45. package/types/esm/helpers/sdk-headers.d.ts +5 -0
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const l=require("react/jsx-runtime"),r=require("react"),s=require("../../functions/is-editing.cjs");function d(e){const i=r.useRef(null);function a(){var t;return"builder-blocks"+((t=e.blocks)!=null&&t.length?"":" no-blocks")}function c(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return r.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:i,className:a()+" props-blocks-wrapper-77bdc7c6","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>c(),onMouseEnter:t=>o(),onKeyPress:t=>c(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-77bdc7c6 {
1
+ "use client";"use strict";const l=require("react/jsx-runtime"),c=require("react"),i=require("../../functions/is-editing.cjs");function d(e){const r=c.useRef(null);function s(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function a(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return c.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:r,className:s()+" props-blocks-wrapper-43ec7ac8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>a(),onMouseEnter:t=>o(),onKeyPress:t=>a(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-43ec7ac8 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,16 +1,20 @@
1
1
  "use client";
2
- import { jsxs as o, Fragment as d, jsx as r } from "react/jsx-runtime";
2
+ import { jsxs as s, Fragment as d, jsx as a } from "react/jsx-runtime";
3
3
  import { useRef as u, useEffect as f } from "react";
4
- import { isEditing as a } from "../../functions/is-editing.mjs";
4
+ import { isEditing as r } from "../../functions/is-editing.mjs";
5
5
  function h(e) {
6
6
  const c = u(null);
7
7
  function i() {
8
8
  var t;
9
- return "builder-blocks" + ((t = e.blocks) != null && t.length ? "" : " no-blocks");
9
+ return [
10
+ "builder-blocks",
11
+ (t = e.blocks) != null && t.length ? "" : "no-blocks",
12
+ e.classNameProp
13
+ ].filter(Boolean).join(" ");
10
14
  }
11
15
  function l() {
12
16
  var t, n;
13
- a() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
17
+ r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
14
18
  {
15
19
  type: "builder.clickEmptyBlocks",
16
20
  data: {
@@ -21,9 +25,9 @@ function h(e) {
21
25
  "*"
22
26
  ));
23
27
  }
24
- function s() {
28
+ function o() {
25
29
  var t, n;
26
- a() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
30
+ r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
27
31
  {
28
32
  type: "builder.hoverEmptyBlocks",
29
33
  data: {
@@ -35,23 +39,23 @@ function h(e) {
35
39
  ));
36
40
  }
37
41
  return f(() => {
38
- }, []), /* @__PURE__ */ o(d, { children: [
39
- /* @__PURE__ */ r(
42
+ }, []), /* @__PURE__ */ s(d, { children: [
43
+ /* @__PURE__ */ a(
40
44
  e.BlocksWrapper,
41
45
  {
42
46
  ref: c,
43
- className: i() + " props-blocks-wrapper-77bdc7c6",
47
+ className: i() + " props-blocks-wrapper-43ec7ac8",
44
48
  "builder-path": e.path,
45
49
  "builder-parent-id": e.parent,
46
50
  style: e.styleProp,
47
51
  onClick: (t) => l(),
48
- onMouseEnter: (t) => s(),
52
+ onMouseEnter: (t) => o(),
49
53
  onKeyPress: (t) => l(),
50
54
  ...e.BlocksWrapperProps,
51
55
  children: e.children
52
56
  }
53
57
  ),
54
- /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-77bdc7c6 {
58
+ /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-43ec7ac8 {
55
59
  display: flex;
56
60
  flex-direction: column;
57
61
  align-items: stretch;
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function i(e){var n,r,c;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(r=e.context)==null?void 0:r.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(c=e.blocks)==null?void 0:c.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=i;
1
+ "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function a(e){var n,c,r;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,classNameProp:e.className,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(c=e.context)==null?void 0:c.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(r=e.blocks)==null?void 0:r.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=a;
@@ -1,15 +1,16 @@
1
1
  import { jsx as t, Fragment as c } from "react/jsx-runtime";
2
2
  import a from "../block/block.mjs";
3
- import k from "./blocks-wrapper.mjs";
4
- function p(e) {
3
+ import m from "./blocks-wrapper.mjs";
4
+ function B(e) {
5
5
  var o, n, r;
6
6
  return /* @__PURE__ */ t(
7
- k,
7
+ m,
8
8
  {
9
9
  blocks: e.blocks,
10
10
  parent: e.parent,
11
11
  path: e.path,
12
12
  styleProp: e.styleProp,
13
+ classNameProp: e.className,
13
14
  BlocksWrapper: (o = e.context) == null ? void 0 : o.BlocksWrapper,
14
15
  BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
15
16
  children: e.blocks ? /* @__PURE__ */ t(c, { children: (r = e.blocks) == null ? void 0 : r.map((l) => /* @__PURE__ */ t(
@@ -26,5 +27,5 @@ function p(e) {
26
27
  );
27
28
  }
28
29
  export {
29
- p as default
30
+ B as default
30
31
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.16";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.18";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.16.16";
1
+ const o = "0.16.18";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants/target.cjs"),h=require("../../helpers/ab-tests.cjs"),w=require("../../helpers/canTrack.cjs"),o=require("../../helpers/logger.cjs"),C=require("../../helpers/preview-lru-cache/get.cjs"),y=require("../get-fetch.cjs"),T=require("../is-browser.cjs"),a=require("./generate-content-url.cjs"),q=t=>"results"in t;async function d(t){const e=await i({...t,limit:1});return e&&e[0]||null}const v=async t=>{var r;const e=a.generateContentUrl(t);return await(await((r=t.fetch)!=null?r:y.fetch)(e.href,t.fetchOptions)).json()},u=async(t,e,n=a.generateContentUrl(t))=>{const s=w.getDefaultCanTrack(t.canTrack);if(n.search.includes("preview=")){const r=[];for(const c of e.results){const f=C.getPreviewContent(n.searchParams);r.push(f||c)}e.results=r}if(!s||!(T.isBrowser()||g.TARGET==="reactNative"))return e.results;try{const r=[];for(const c of e.results)r.push(await h.handleABTesting({item:c,canTrack:s}));e.results=r}catch(r){o.logger.error("Could not process A/B tests. ",r)}return e.results};async function i(t){try{const e=a.generateContentUrl(t),n=await v(t);return q(n)?u(t,n):(o.logger.error("Error fetching data. ",{url:e,content:n,options:t}),null)}catch(e){return o.logger.error("Error fetching data. ",e),null}}exports._processContentResult=u;exports.fetchEntries=i;exports.fetchOneEntry=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants/target.cjs"),h=require("../../helpers/ab-tests.cjs"),w=require("../../helpers/canTrack.cjs"),o=require("../../helpers/logger.cjs"),d=require("../../helpers/preview-lru-cache/get.cjs"),C=require("../../helpers/sdk-headers.cjs"),y=require("../get-fetch.cjs"),T=require("../is-browser.cjs"),u=require("./generate-content-url.cjs"),q=e=>"results"in e;async function k(e){const t=await l({...e,limit:1});return t&&t[0]||null}const v=async e=>{var s,a;const t=u.generateContentUrl(e),r=(s=e.fetch)!=null?s:y.fetch,c={...e.fetchOptions,headers:{...(a=e.fetchOptions)==null?void 0:a.headers,...C.getSdkHeaders()}};return await(await r(t.href,c)).json()},i=async(e,t,r=u.generateContentUrl(e))=>{const c=w.getDefaultCanTrack(e.canTrack);if(r.search.includes("preview=")){const n=[];for(const s of t.results){const a=d.getPreviewContent(r.searchParams);n.push(a||s)}t.results=n}if(!c||!(T.isBrowser()||g.TARGET==="reactNative"))return t.results;try{const n=[];for(const s of t.results)n.push(await h.handleABTesting({item:s,canTrack:c}));t.results=n}catch(n){o.logger.error("Could not process A/B tests. ",n)}return t.results};async function l(e){try{const t=u.generateContentUrl(e),r=await v(e);return q(r)?i(e,r):(o.logger.error("Error fetching data. ",{url:t,content:r,options:e}),null)}catch(t){return o.logger.error("Error fetching data. ",t),null}}exports._processContentResult=i;exports.fetchEntries=l;exports.fetchOneEntry=k;
@@ -1,62 +1,69 @@
1
- import { TARGET as f } from "../../constants/target.mjs";
1
+ import { TARGET as u } from "../../constants/target.mjs";
2
2
  import { handleABTesting as l } from "../../helpers/ab-tests.mjs";
3
- import { getDefaultCanTrack as m } from "../../helpers/canTrack.mjs";
4
- import { logger as o } from "../../helpers/logger.mjs";
5
- import { getPreviewContent as h } from "../../helpers/preview-lru-cache/get.mjs";
6
- import { fetch as w } from "../get-fetch.mjs";
3
+ import { getDefaultCanTrack as h } from "../../helpers/canTrack.mjs";
4
+ import { logger as a } from "../../helpers/logger.mjs";
5
+ import { getPreviewContent as m } from "../../helpers/preview-lru-cache/get.mjs";
6
+ import { getSdkHeaders as w } from "../../helpers/sdk-headers.mjs";
7
+ import { fetch as p } from "../get-fetch.mjs";
7
8
  import { isBrowser as g } from "../is-browser.mjs";
8
- import { generateContentUrl as a } from "./generate-content-url.mjs";
9
- const p = (t) => "results" in t;
10
- async function B(t) {
11
- const r = await v({
12
- ...t,
9
+ import { generateContentUrl as i } from "./generate-content-url.mjs";
10
+ const d = (r) => "results" in r;
11
+ async function H(r) {
12
+ const t = await v({
13
+ ...r,
13
14
  limit: 1
14
15
  });
15
- return r && r[0] || null;
16
+ return t && t[0] || null;
16
17
  }
17
- const C = async (t) => {
18
- var e;
19
- const r = a(t);
20
- return await (await ((e = t.fetch) != null ? e : w)(r.href, t.fetchOptions)).json();
21
- }, y = async (t, r, s = a(t)) => {
22
- const n = m(t.canTrack);
23
- if (s.search.includes("preview=")) {
24
- const e = [];
25
- for (const c of r.results) {
26
- const u = h(s.searchParams);
27
- e.push(u || c);
18
+ const C = async (r) => {
19
+ var n, o;
20
+ const t = i(r), e = (n = r.fetch) != null ? n : p, c = {
21
+ ...r.fetchOptions,
22
+ headers: {
23
+ ...(o = r.fetchOptions) == null ? void 0 : o.headers,
24
+ ...w()
28
25
  }
29
- r.results = e;
26
+ };
27
+ return await (await e(t.href, c)).json();
28
+ }, y = async (r, t, e = i(r)) => {
29
+ const c = h(r.canTrack);
30
+ if (e.search.includes("preview=")) {
31
+ const s = [];
32
+ for (const n of t.results) {
33
+ const o = m(e.searchParams);
34
+ s.push(o || n);
35
+ }
36
+ t.results = s;
30
37
  }
31
- if (!n || !(g() || f === "reactNative"))
32
- return r.results;
38
+ if (!c || !(g() || u === "reactNative"))
39
+ return t.results;
33
40
  try {
34
- const e = [];
35
- for (const c of r.results)
36
- e.push(await l({
37
- item: c,
38
- canTrack: n
41
+ const s = [];
42
+ for (const n of t.results)
43
+ s.push(await l({
44
+ item: n,
45
+ canTrack: c
39
46
  }));
40
- r.results = e;
41
- } catch (e) {
42
- o.error("Could not process A/B tests. ", e);
47
+ t.results = s;
48
+ } catch (s) {
49
+ a.error("Could not process A/B tests. ", s);
43
50
  }
44
- return r.results;
51
+ return t.results;
45
52
  };
46
- async function v(t) {
53
+ async function v(r) {
47
54
  try {
48
- const r = a(t), s = await C(t);
49
- return p(s) ? y(t, s) : (o.error("Error fetching data. ", {
50
- url: r,
51
- content: s,
52
- options: t
55
+ const t = i(r), e = await C(r);
56
+ return d(e) ? y(r, e) : (a.error("Error fetching data. ", {
57
+ url: t,
58
+ content: e,
59
+ options: r
53
60
  }), null);
54
- } catch (r) {
55
- return o.error("Error fetching data. ", r), null;
61
+ } catch (t) {
62
+ return a.error("Error fetching data. ", t), null;
56
63
  }
57
64
  }
58
65
  export {
59
66
  y as _processContentResult,
60
67
  v as fetchEntries,
61
- B as fetchOneEntry
68
+ H as fetchOneEntry
62
69
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sessionId.cjs"),d=require("../../helpers/visitorId.cjs"),u=require("../is-browser.cjs"),g=require("../is-editing.cjs"),l=require("./helpers.cjs"),y=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await c.getSessionId({canTrack:t}),r=d.getVisitorId({canTrack:t});return{sessionId:e,visitorId:r}},I=async({type:t,canTrack:e,apiKey:r,metadata:s,...o})=>({type:t,data:{...o,metadata:{url:location.href,...s},...await y({canTrack:e}),userAttributes:l.getUserAttributes(),ownerId:r}});async function i(t){if(!t.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(t.canTrack&&!g.isEditing()&&(u.isBrowser()||n.TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await I(t)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(e=>{console.error("Failed to track: ",e)})}const f=t=>i({...t,canTrack:!0});exports._track=i;exports.track=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sdk-headers.cjs"),d=require("../../helpers/sessionId.cjs"),u=require("../../helpers/visitorId.cjs"),g=require("../is-browser.cjs"),l=require("../is-editing.cjs"),y=require("./helpers.cjs"),I=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await d.getSessionId({canTrack:e}),r=u.getVisitorId({canTrack:e});return{sessionId:t,visitorId:r}},k=async({type:e,canTrack:t,apiKey:r,metadata:s,...o})=>({type:e,data:{...o,metadata:{url:location.href,...s},...await I({canTrack:t}),userAttributes:y.getUserAttributes(),ownerId:r}});async function i(e){if(!e.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!l.isEditing()&&(g.isBrowser()||n.TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await k(e)]}),headers:{"content-type":"application/json",...c.getSdkHeaders()},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const f=e=>i({...e,canTrack:!0});exports._track=i;exports.track=f;
@@ -1,11 +1,12 @@
1
1
  import { TARGET as a } from "../../constants/target.mjs";
2
2
  import { logger as s } from "../../helpers/logger.mjs";
3
- import { getSessionId as n } from "../../helpers/sessionId.mjs";
4
- import { getVisitorId as c } from "../../helpers/visitorId.mjs";
5
- import { isBrowser as d } from "../is-browser.mjs";
3
+ import { getSdkHeaders as n } from "../../helpers/sdk-headers.mjs";
4
+ import { getSessionId as c } from "../../helpers/sessionId.mjs";
5
+ import { getVisitorId as d } from "../../helpers/visitorId.mjs";
6
+ import { isBrowser as m } from "../is-browser.mjs";
6
7
  import { isEditing as f } from "../is-editing.mjs";
7
- import { getUserAttributes as m } from "./helpers.mjs";
8
- const p = async ({
8
+ import { getUserAttributes as p } from "./helpers.mjs";
9
+ const u = async ({
9
10
  canTrack: t
10
11
  }) => {
11
12
  if (!t)
@@ -13,60 +14,61 @@ const p = async ({
13
14
  visitorId: void 0,
14
15
  sessionId: void 0
15
16
  };
16
- const r = await n({
17
+ const r = await c({
17
18
  canTrack: t
18
- }), e = c({
19
+ }), e = d({
19
20
  canTrack: t
20
21
  });
21
22
  return {
22
23
  sessionId: r,
23
24
  visitorId: e
24
25
  };
25
- }, u = async ({
26
+ }, y = async ({
26
27
  type: t,
27
28
  canTrack: r,
28
29
  apiKey: e,
29
- metadata: i,
30
- ...o
30
+ metadata: o,
31
+ ...i
31
32
  }) => ({
32
33
  type: t,
33
34
  data: {
34
- ...o,
35
+ ...i,
35
36
  metadata: {
36
37
  url: location.href,
37
- ...i
38
+ ...o
38
39
  },
39
- ...await p({
40
+ ...await u({
40
41
  canTrack: r
41
42
  }),
42
- userAttributes: m(),
43
+ userAttributes: p(),
43
44
  ownerId: e
44
45
  }
45
46
  });
46
- async function y(t) {
47
+ async function g(t) {
47
48
  if (!t.apiKey) {
48
49
  s.error("Missing API key for track call. Please provide your API key.");
49
50
  return;
50
51
  }
51
- if (t.canTrack && !f() && (d() || a === "reactNative"))
52
+ if (t.canTrack && !f() && (m() || a === "reactNative"))
52
53
  return fetch("https://cdn.builder.io/api/v1/track", {
53
54
  method: "POST",
54
55
  body: JSON.stringify({
55
- events: [await u(t)]
56
+ events: [await y(t)]
56
57
  }),
57
58
  headers: {
58
- "content-type": "application/json"
59
+ "content-type": "application/json",
60
+ ...n()
59
61
  },
60
62
  mode: "cors"
61
63
  }).catch((r) => {
62
64
  console.error("Failed to track: ", r);
63
65
  });
64
66
  }
65
- const A = (t) => y({
67
+ const E = (t) => g({
66
68
  ...t,
67
69
  canTrack: !0
68
70
  });
69
71
  export {
70
- y as _track,
71
- A as track
72
+ g as _track,
73
+ E as track
72
74
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants/sdk-version.cjs"),r=require("../constants/target.cjs"),t=()=>({"X-Builder-SDK":r.TARGET,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":e.SDK_VERSION});exports.getSdkHeaders=t;
@@ -0,0 +1,10 @@
1
+ import { SDK_VERSION as r } from "../constants/sdk-version.mjs";
2
+ import { TARGET as e } from "../constants/target.mjs";
3
+ const S = () => ({
4
+ "X-Builder-SDK": e,
5
+ "X-Builder-SDK-GEN": "2",
6
+ "X-Builder-SDK-Version": r
7
+ });
8
+ export {
9
+ S as getSdkHeaders
10
+ };
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const l=require("react/jsx-runtime"),r=require("react"),s=require("../../functions/is-editing.cjs");function d(e){const i=r.useRef(null);function a(){var t;return"builder-blocks"+((t=e.blocks)!=null&&t.length?"":" no-blocks")}function c(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return r.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:i,className:a()+" props-blocks-wrapper-77bdc7c6","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>c(),onMouseEnter:t=>o(),onKeyPress:t=>c(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-77bdc7c6 {
1
+ "use client";"use strict";const l=require("react/jsx-runtime"),c=require("react"),i=require("../../functions/is-editing.cjs");function d(e){const r=c.useRef(null);function s(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function a(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return c.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:r,className:s()+" props-blocks-wrapper-43ec7ac8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>a(),onMouseEnter:t=>o(),onKeyPress:t=>a(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-43ec7ac8 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,16 +1,20 @@
1
1
  "use client";
2
- import { jsxs as o, Fragment as d, jsx as r } from "react/jsx-runtime";
2
+ import { jsxs as s, Fragment as d, jsx as a } from "react/jsx-runtime";
3
3
  import { useRef as u, useEffect as f } from "react";
4
- import { isEditing as a } from "../../functions/is-editing.mjs";
4
+ import { isEditing as r } from "../../functions/is-editing.mjs";
5
5
  function h(e) {
6
6
  const c = u(null);
7
7
  function i() {
8
8
  var t;
9
- return "builder-blocks" + ((t = e.blocks) != null && t.length ? "" : " no-blocks");
9
+ return [
10
+ "builder-blocks",
11
+ (t = e.blocks) != null && t.length ? "" : "no-blocks",
12
+ e.classNameProp
13
+ ].filter(Boolean).join(" ");
10
14
  }
11
15
  function l() {
12
16
  var t, n;
13
- a() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
17
+ r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
14
18
  {
15
19
  type: "builder.clickEmptyBlocks",
16
20
  data: {
@@ -21,9 +25,9 @@ function h(e) {
21
25
  "*"
22
26
  ));
23
27
  }
24
- function s() {
28
+ function o() {
25
29
  var t, n;
26
- a() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
30
+ r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
27
31
  {
28
32
  type: "builder.hoverEmptyBlocks",
29
33
  data: {
@@ -35,23 +39,23 @@ function h(e) {
35
39
  ));
36
40
  }
37
41
  return f(() => {
38
- }, []), /* @__PURE__ */ o(d, { children: [
39
- /* @__PURE__ */ r(
42
+ }, []), /* @__PURE__ */ s(d, { children: [
43
+ /* @__PURE__ */ a(
40
44
  e.BlocksWrapper,
41
45
  {
42
46
  ref: c,
43
- className: i() + " props-blocks-wrapper-77bdc7c6",
47
+ className: i() + " props-blocks-wrapper-43ec7ac8",
44
48
  "builder-path": e.path,
45
49
  "builder-parent-id": e.parent,
46
50
  style: e.styleProp,
47
51
  onClick: (t) => l(),
48
- onMouseEnter: (t) => s(),
52
+ onMouseEnter: (t) => o(),
49
53
  onKeyPress: (t) => l(),
50
54
  ...e.BlocksWrapperProps,
51
55
  children: e.children
52
56
  }
53
57
  ),
54
- /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-77bdc7c6 {
58
+ /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-43ec7ac8 {
55
59
  display: flex;
56
60
  flex-direction: column;
57
61
  align-items: stretch;
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function i(e){var n,r,c;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(r=e.context)==null?void 0:r.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(c=e.blocks)==null?void 0:c.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=i;
1
+ "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function a(e){var n,c,r;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,classNameProp:e.className,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(c=e.context)==null?void 0:c.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(r=e.blocks)==null?void 0:r.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=a;
@@ -1,15 +1,16 @@
1
1
  import { jsx as t, Fragment as c } from "react/jsx-runtime";
2
2
  import a from "../block/block.mjs";
3
- import k from "./blocks-wrapper.mjs";
4
- function p(e) {
3
+ import m from "./blocks-wrapper.mjs";
4
+ function B(e) {
5
5
  var o, n, r;
6
6
  return /* @__PURE__ */ t(
7
- k,
7
+ m,
8
8
  {
9
9
  blocks: e.blocks,
10
10
  parent: e.parent,
11
11
  path: e.path,
12
12
  styleProp: e.styleProp,
13
+ classNameProp: e.className,
13
14
  BlocksWrapper: (o = e.context) == null ? void 0 : o.BlocksWrapper,
14
15
  BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
15
16
  children: e.blocks ? /* @__PURE__ */ t(c, { children: (r = e.blocks) == null ? void 0 : r.map((l) => /* @__PURE__ */ t(
@@ -26,5 +27,5 @@ function p(e) {
26
27
  );
27
28
  }
28
29
  export {
29
- p as default
30
+ B as default
30
31
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.16";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.18";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.16.16";
1
+ const o = "0.16.18";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants/target.cjs"),h=require("../../helpers/ab-tests.cjs"),w=require("../../helpers/canTrack.cjs"),o=require("../../helpers/logger.cjs"),C=require("../../helpers/preview-lru-cache/get.cjs"),y=require("../get-fetch.cjs"),T=require("../is-browser.cjs"),a=require("./generate-content-url.cjs"),q=t=>"results"in t;async function d(t){const e=await i({...t,limit:1});return e&&e[0]||null}const v=async t=>{var r;const e=a.generateContentUrl(t);return await(await((r=t.fetch)!=null?r:y.fetch)(e.href,t.fetchOptions)).json()},u=async(t,e,n=a.generateContentUrl(t))=>{const s=w.getDefaultCanTrack(t.canTrack);if(n.search.includes("preview=")){const r=[];for(const c of e.results){const f=C.getPreviewContent(n.searchParams);r.push(f||c)}e.results=r}if(!s||!(T.isBrowser()||g.TARGET==="reactNative"))return e.results;try{const r=[];for(const c of e.results)r.push(await h.handleABTesting({item:c,canTrack:s}));e.results=r}catch(r){o.logger.error("Could not process A/B tests. ",r)}return e.results};async function i(t){try{const e=a.generateContentUrl(t),n=await v(t);return q(n)?u(t,n):(o.logger.error("Error fetching data. ",{url:e,content:n,options:t}),null)}catch(e){return o.logger.error("Error fetching data. ",e),null}}exports._processContentResult=u;exports.fetchEntries=i;exports.fetchOneEntry=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants/target.cjs"),h=require("../../helpers/ab-tests.cjs"),w=require("../../helpers/canTrack.cjs"),o=require("../../helpers/logger.cjs"),d=require("../../helpers/preview-lru-cache/get.cjs"),C=require("../../helpers/sdk-headers.cjs"),y=require("../get-fetch.cjs"),T=require("../is-browser.cjs"),u=require("./generate-content-url.cjs"),q=e=>"results"in e;async function k(e){const t=await l({...e,limit:1});return t&&t[0]||null}const v=async e=>{var s,a;const t=u.generateContentUrl(e),r=(s=e.fetch)!=null?s:y.fetch,c={...e.fetchOptions,headers:{...(a=e.fetchOptions)==null?void 0:a.headers,...C.getSdkHeaders()}};return await(await r(t.href,c)).json()},i=async(e,t,r=u.generateContentUrl(e))=>{const c=w.getDefaultCanTrack(e.canTrack);if(r.search.includes("preview=")){const n=[];for(const s of t.results){const a=d.getPreviewContent(r.searchParams);n.push(a||s)}t.results=n}if(!c||!(T.isBrowser()||g.TARGET==="reactNative"))return t.results;try{const n=[];for(const s of t.results)n.push(await h.handleABTesting({item:s,canTrack:c}));t.results=n}catch(n){o.logger.error("Could not process A/B tests. ",n)}return t.results};async function l(e){try{const t=u.generateContentUrl(e),r=await v(e);return q(r)?i(e,r):(o.logger.error("Error fetching data. ",{url:t,content:r,options:e}),null)}catch(t){return o.logger.error("Error fetching data. ",t),null}}exports._processContentResult=i;exports.fetchEntries=l;exports.fetchOneEntry=k;
@@ -1,62 +1,69 @@
1
- import { TARGET as f } from "../../constants/target.mjs";
1
+ import { TARGET as u } from "../../constants/target.mjs";
2
2
  import { handleABTesting as l } from "../../helpers/ab-tests.mjs";
3
- import { getDefaultCanTrack as m } from "../../helpers/canTrack.mjs";
4
- import { logger as o } from "../../helpers/logger.mjs";
5
- import { getPreviewContent as h } from "../../helpers/preview-lru-cache/get.mjs";
6
- import { fetch as w } from "../get-fetch.mjs";
3
+ import { getDefaultCanTrack as h } from "../../helpers/canTrack.mjs";
4
+ import { logger as a } from "../../helpers/logger.mjs";
5
+ import { getPreviewContent as m } from "../../helpers/preview-lru-cache/get.mjs";
6
+ import { getSdkHeaders as w } from "../../helpers/sdk-headers.mjs";
7
+ import { fetch as p } from "../get-fetch.mjs";
7
8
  import { isBrowser as g } from "../is-browser.mjs";
8
- import { generateContentUrl as a } from "./generate-content-url.mjs";
9
- const p = (t) => "results" in t;
10
- async function B(t) {
11
- const r = await v({
12
- ...t,
9
+ import { generateContentUrl as i } from "./generate-content-url.mjs";
10
+ const d = (r) => "results" in r;
11
+ async function H(r) {
12
+ const t = await v({
13
+ ...r,
13
14
  limit: 1
14
15
  });
15
- return r && r[0] || null;
16
+ return t && t[0] || null;
16
17
  }
17
- const C = async (t) => {
18
- var e;
19
- const r = a(t);
20
- return await (await ((e = t.fetch) != null ? e : w)(r.href, t.fetchOptions)).json();
21
- }, y = async (t, r, s = a(t)) => {
22
- const n = m(t.canTrack);
23
- if (s.search.includes("preview=")) {
24
- const e = [];
25
- for (const c of r.results) {
26
- const u = h(s.searchParams);
27
- e.push(u || c);
18
+ const C = async (r) => {
19
+ var n, o;
20
+ const t = i(r), e = (n = r.fetch) != null ? n : p, c = {
21
+ ...r.fetchOptions,
22
+ headers: {
23
+ ...(o = r.fetchOptions) == null ? void 0 : o.headers,
24
+ ...w()
28
25
  }
29
- r.results = e;
26
+ };
27
+ return await (await e(t.href, c)).json();
28
+ }, y = async (r, t, e = i(r)) => {
29
+ const c = h(r.canTrack);
30
+ if (e.search.includes("preview=")) {
31
+ const s = [];
32
+ for (const n of t.results) {
33
+ const o = m(e.searchParams);
34
+ s.push(o || n);
35
+ }
36
+ t.results = s;
30
37
  }
31
- if (!n || !(g() || f === "reactNative"))
32
- return r.results;
38
+ if (!c || !(g() || u === "reactNative"))
39
+ return t.results;
33
40
  try {
34
- const e = [];
35
- for (const c of r.results)
36
- e.push(await l({
37
- item: c,
38
- canTrack: n
41
+ const s = [];
42
+ for (const n of t.results)
43
+ s.push(await l({
44
+ item: n,
45
+ canTrack: c
39
46
  }));
40
- r.results = e;
41
- } catch (e) {
42
- o.error("Could not process A/B tests. ", e);
47
+ t.results = s;
48
+ } catch (s) {
49
+ a.error("Could not process A/B tests. ", s);
43
50
  }
44
- return r.results;
51
+ return t.results;
45
52
  };
46
- async function v(t) {
53
+ async function v(r) {
47
54
  try {
48
- const r = a(t), s = await C(t);
49
- return p(s) ? y(t, s) : (o.error("Error fetching data. ", {
50
- url: r,
51
- content: s,
52
- options: t
55
+ const t = i(r), e = await C(r);
56
+ return d(e) ? y(r, e) : (a.error("Error fetching data. ", {
57
+ url: t,
58
+ content: e,
59
+ options: r
53
60
  }), null);
54
- } catch (r) {
55
- return o.error("Error fetching data. ", r), null;
61
+ } catch (t) {
62
+ return a.error("Error fetching data. ", t), null;
56
63
  }
57
64
  }
58
65
  export {
59
66
  y as _processContentResult,
60
67
  v as fetchEntries,
61
- B as fetchOneEntry
68
+ H as fetchOneEntry
62
69
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sessionId.cjs"),d=require("../../helpers/visitorId.cjs"),u=require("../is-browser.cjs"),g=require("../is-editing.cjs"),l=require("./helpers.cjs"),y=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await c.getSessionId({canTrack:t}),r=d.getVisitorId({canTrack:t});return{sessionId:e,visitorId:r}},I=async({type:t,canTrack:e,apiKey:r,metadata:s,...o})=>({type:t,data:{...o,metadata:{url:location.href,...s},...await y({canTrack:e}),userAttributes:l.getUserAttributes(),ownerId:r}});async function i(t){if(!t.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(t.canTrack&&!g.isEditing()&&(u.isBrowser()||n.TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await I(t)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(e=>{console.error("Failed to track: ",e)})}const f=t=>i({...t,canTrack:!0});exports._track=i;exports.track=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sdk-headers.cjs"),d=require("../../helpers/sessionId.cjs"),u=require("../../helpers/visitorId.cjs"),g=require("../is-browser.cjs"),l=require("../is-editing.cjs"),y=require("./helpers.cjs"),I=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await d.getSessionId({canTrack:e}),r=u.getVisitorId({canTrack:e});return{sessionId:t,visitorId:r}},k=async({type:e,canTrack:t,apiKey:r,metadata:s,...o})=>({type:e,data:{...o,metadata:{url:location.href,...s},...await I({canTrack:t}),userAttributes:y.getUserAttributes(),ownerId:r}});async function i(e){if(!e.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!l.isEditing()&&(g.isBrowser()||n.TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await k(e)]}),headers:{"content-type":"application/json",...c.getSdkHeaders()},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const f=e=>i({...e,canTrack:!0});exports._track=i;exports.track=f;
@@ -1,11 +1,12 @@
1
1
  import { TARGET as a } from "../../constants/target.mjs";
2
2
  import { logger as s } from "../../helpers/logger.mjs";
3
- import { getSessionId as n } from "../../helpers/sessionId.mjs";
4
- import { getVisitorId as c } from "../../helpers/visitorId.mjs";
5
- import { isBrowser as d } from "../is-browser.mjs";
3
+ import { getSdkHeaders as n } from "../../helpers/sdk-headers.mjs";
4
+ import { getSessionId as c } from "../../helpers/sessionId.mjs";
5
+ import { getVisitorId as d } from "../../helpers/visitorId.mjs";
6
+ import { isBrowser as m } from "../is-browser.mjs";
6
7
  import { isEditing as f } from "../is-editing.mjs";
7
- import { getUserAttributes as m } from "./helpers.mjs";
8
- const p = async ({
8
+ import { getUserAttributes as p } from "./helpers.mjs";
9
+ const u = async ({
9
10
  canTrack: t
10
11
  }) => {
11
12
  if (!t)
@@ -13,60 +14,61 @@ const p = async ({
13
14
  visitorId: void 0,
14
15
  sessionId: void 0
15
16
  };
16
- const r = await n({
17
+ const r = await c({
17
18
  canTrack: t
18
- }), e = c({
19
+ }), e = d({
19
20
  canTrack: t
20
21
  });
21
22
  return {
22
23
  sessionId: r,
23
24
  visitorId: e
24
25
  };
25
- }, u = async ({
26
+ }, y = async ({
26
27
  type: t,
27
28
  canTrack: r,
28
29
  apiKey: e,
29
- metadata: i,
30
- ...o
30
+ metadata: o,
31
+ ...i
31
32
  }) => ({
32
33
  type: t,
33
34
  data: {
34
- ...o,
35
+ ...i,
35
36
  metadata: {
36
37
  url: location.href,
37
- ...i
38
+ ...o
38
39
  },
39
- ...await p({
40
+ ...await u({
40
41
  canTrack: r
41
42
  }),
42
- userAttributes: m(),
43
+ userAttributes: p(),
43
44
  ownerId: e
44
45
  }
45
46
  });
46
- async function y(t) {
47
+ async function g(t) {
47
48
  if (!t.apiKey) {
48
49
  s.error("Missing API key for track call. Please provide your API key.");
49
50
  return;
50
51
  }
51
- if (t.canTrack && !f() && (d() || a === "reactNative"))
52
+ if (t.canTrack && !f() && (m() || a === "reactNative"))
52
53
  return fetch("https://cdn.builder.io/api/v1/track", {
53
54
  method: "POST",
54
55
  body: JSON.stringify({
55
- events: [await u(t)]
56
+ events: [await y(t)]
56
57
  }),
57
58
  headers: {
58
- "content-type": "application/json"
59
+ "content-type": "application/json",
60
+ ...n()
59
61
  },
60
62
  mode: "cors"
61
63
  }).catch((r) => {
62
64
  console.error("Failed to track: ", r);
63
65
  });
64
66
  }
65
- const A = (t) => y({
67
+ const E = (t) => g({
66
68
  ...t,
67
69
  canTrack: !0
68
70
  });
69
71
  export {
70
- y as _track,
71
- A as track
72
+ g as _track,
73
+ E as track
72
74
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants/sdk-version.cjs"),r=require("../constants/target.cjs"),t=()=>({"X-Builder-SDK":r.TARGET,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":e.SDK_VERSION});exports.getSdkHeaders=t;
@@ -0,0 +1,10 @@
1
+ import { SDK_VERSION as r } from "../constants/sdk-version.mjs";
2
+ import { TARGET as e } from "../constants/target.mjs";
3
+ const S = () => ({
4
+ "X-Builder-SDK": e,
5
+ "X-Builder-SDK-GEN": "2",
6
+ "X-Builder-SDK-Version": r
7
+ });
8
+ export {
9
+ S as getSdkHeaders
10
+ };
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const l=require("react/jsx-runtime"),r=require("react"),s=require("../../functions/is-editing.cjs");function d(e){const i=r.useRef(null);function a(){var t;return"builder-blocks"+((t=e.blocks)!=null&&t.length?"":" no-blocks")}function c(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return r.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:i,className:a()+" props-blocks-wrapper-77bdc7c6","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>c(),onMouseEnter:t=>o(),onKeyPress:t=>c(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-77bdc7c6 {
1
+ "use client";"use strict";const l=require("react/jsx-runtime"),c=require("react"),i=require("../../functions/is-editing.cjs");function d(e){const r=c.useRef(null);function s(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function a(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return c.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:r,className:s()+" props-blocks-wrapper-43ec7ac8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>a(),onMouseEnter:t=>o(),onKeyPress:t=>a(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-43ec7ac8 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,16 +1,20 @@
1
1
  "use client";
2
- import { jsxs as o, Fragment as d, jsx as r } from "react/jsx-runtime";
2
+ import { jsxs as s, Fragment as d, jsx as a } from "react/jsx-runtime";
3
3
  import { useRef as u, useEffect as f } from "react";
4
- import { isEditing as a } from "../../functions/is-editing.mjs";
4
+ import { isEditing as r } from "../../functions/is-editing.mjs";
5
5
  function h(e) {
6
6
  const c = u(null);
7
7
  function i() {
8
8
  var t;
9
- return "builder-blocks" + ((t = e.blocks) != null && t.length ? "" : " no-blocks");
9
+ return [
10
+ "builder-blocks",
11
+ (t = e.blocks) != null && t.length ? "" : "no-blocks",
12
+ e.classNameProp
13
+ ].filter(Boolean).join(" ");
10
14
  }
11
15
  function l() {
12
16
  var t, n;
13
- a() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
17
+ r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
14
18
  {
15
19
  type: "builder.clickEmptyBlocks",
16
20
  data: {
@@ -21,9 +25,9 @@ function h(e) {
21
25
  "*"
22
26
  ));
23
27
  }
24
- function s() {
28
+ function o() {
25
29
  var t, n;
26
- a() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
30
+ r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
27
31
  {
28
32
  type: "builder.hoverEmptyBlocks",
29
33
  data: {
@@ -35,23 +39,23 @@ function h(e) {
35
39
  ));
36
40
  }
37
41
  return f(() => {
38
- }, []), /* @__PURE__ */ o(d, { children: [
39
- /* @__PURE__ */ r(
42
+ }, []), /* @__PURE__ */ s(d, { children: [
43
+ /* @__PURE__ */ a(
40
44
  e.BlocksWrapper,
41
45
  {
42
46
  ref: c,
43
- className: i() + " props-blocks-wrapper-77bdc7c6",
47
+ className: i() + " props-blocks-wrapper-43ec7ac8",
44
48
  "builder-path": e.path,
45
49
  "builder-parent-id": e.parent,
46
50
  style: e.styleProp,
47
51
  onClick: (t) => l(),
48
- onMouseEnter: (t) => s(),
52
+ onMouseEnter: (t) => o(),
49
53
  onKeyPress: (t) => l(),
50
54
  ...e.BlocksWrapperProps,
51
55
  children: e.children
52
56
  }
53
57
  ),
54
- /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-77bdc7c6 {
58
+ /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-43ec7ac8 {
55
59
  display: flex;
56
60
  flex-direction: column;
57
61
  align-items: stretch;
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function i(e){var n,r,c;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(r=e.context)==null?void 0:r.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(c=e.blocks)==null?void 0:c.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=i;
1
+ "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function a(e){var n,c,r;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,classNameProp:e.className,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(c=e.context)==null?void 0:c.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(r=e.blocks)==null?void 0:r.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=a;
@@ -1,15 +1,16 @@
1
1
  import { jsx as t, Fragment as c } from "react/jsx-runtime";
2
2
  import a from "../block/block.mjs";
3
- import k from "./blocks-wrapper.mjs";
4
- function p(e) {
3
+ import m from "./blocks-wrapper.mjs";
4
+ function B(e) {
5
5
  var o, n, r;
6
6
  return /* @__PURE__ */ t(
7
- k,
7
+ m,
8
8
  {
9
9
  blocks: e.blocks,
10
10
  parent: e.parent,
11
11
  path: e.path,
12
12
  styleProp: e.styleProp,
13
+ classNameProp: e.className,
13
14
  BlocksWrapper: (o = e.context) == null ? void 0 : o.BlocksWrapper,
14
15
  BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
15
16
  children: e.blocks ? /* @__PURE__ */ t(c, { children: (r = e.blocks) == null ? void 0 : r.map((l) => /* @__PURE__ */ t(
@@ -26,5 +27,5 @@ function p(e) {
26
27
  );
27
28
  }
28
29
  export {
29
- p as default
30
+ B as default
30
31
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.16";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.18";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.16.16";
1
+ const o = "0.16.18";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants/target.cjs"),h=require("../../helpers/ab-tests.cjs"),w=require("../../helpers/canTrack.cjs"),o=require("../../helpers/logger.cjs"),C=require("../../helpers/preview-lru-cache/get.cjs"),y=require("../get-fetch.cjs"),T=require("../is-browser.cjs"),a=require("./generate-content-url.cjs"),q=t=>"results"in t;async function d(t){const e=await i({...t,limit:1});return e&&e[0]||null}const v=async t=>{var r;const e=a.generateContentUrl(t);return await(await((r=t.fetch)!=null?r:y.fetch)(e.href,t.fetchOptions)).json()},u=async(t,e,n=a.generateContentUrl(t))=>{const s=w.getDefaultCanTrack(t.canTrack);if(n.search.includes("preview=")){const r=[];for(const c of e.results){const f=C.getPreviewContent(n.searchParams);r.push(f||c)}e.results=r}if(!s||!(T.isBrowser()||g.TARGET==="reactNative"))return e.results;try{const r=[];for(const c of e.results)r.push(await h.handleABTesting({item:c,canTrack:s}));e.results=r}catch(r){o.logger.error("Could not process A/B tests. ",r)}return e.results};async function i(t){try{const e=a.generateContentUrl(t),n=await v(t);return q(n)?u(t,n):(o.logger.error("Error fetching data. ",{url:e,content:n,options:t}),null)}catch(e){return o.logger.error("Error fetching data. ",e),null}}exports._processContentResult=u;exports.fetchEntries=i;exports.fetchOneEntry=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants/target.cjs"),h=require("../../helpers/ab-tests.cjs"),w=require("../../helpers/canTrack.cjs"),o=require("../../helpers/logger.cjs"),d=require("../../helpers/preview-lru-cache/get.cjs"),C=require("../../helpers/sdk-headers.cjs"),y=require("../get-fetch.cjs"),T=require("../is-browser.cjs"),u=require("./generate-content-url.cjs"),q=e=>"results"in e;async function k(e){const t=await l({...e,limit:1});return t&&t[0]||null}const v=async e=>{var s,a;const t=u.generateContentUrl(e),r=(s=e.fetch)!=null?s:y.fetch,c={...e.fetchOptions,headers:{...(a=e.fetchOptions)==null?void 0:a.headers,...C.getSdkHeaders()}};return await(await r(t.href,c)).json()},i=async(e,t,r=u.generateContentUrl(e))=>{const c=w.getDefaultCanTrack(e.canTrack);if(r.search.includes("preview=")){const n=[];for(const s of t.results){const a=d.getPreviewContent(r.searchParams);n.push(a||s)}t.results=n}if(!c||!(T.isBrowser()||g.TARGET==="reactNative"))return t.results;try{const n=[];for(const s of t.results)n.push(await h.handleABTesting({item:s,canTrack:c}));t.results=n}catch(n){o.logger.error("Could not process A/B tests. ",n)}return t.results};async function l(e){try{const t=u.generateContentUrl(e),r=await v(e);return q(r)?i(e,r):(o.logger.error("Error fetching data. ",{url:t,content:r,options:e}),null)}catch(t){return o.logger.error("Error fetching data. ",t),null}}exports._processContentResult=i;exports.fetchEntries=l;exports.fetchOneEntry=k;
@@ -1,62 +1,69 @@
1
- import { TARGET as f } from "../../constants/target.mjs";
1
+ import { TARGET as u } from "../../constants/target.mjs";
2
2
  import { handleABTesting as l } from "../../helpers/ab-tests.mjs";
3
- import { getDefaultCanTrack as m } from "../../helpers/canTrack.mjs";
4
- import { logger as o } from "../../helpers/logger.mjs";
5
- import { getPreviewContent as h } from "../../helpers/preview-lru-cache/get.mjs";
6
- import { fetch as w } from "../get-fetch.mjs";
3
+ import { getDefaultCanTrack as h } from "../../helpers/canTrack.mjs";
4
+ import { logger as a } from "../../helpers/logger.mjs";
5
+ import { getPreviewContent as m } from "../../helpers/preview-lru-cache/get.mjs";
6
+ import { getSdkHeaders as w } from "../../helpers/sdk-headers.mjs";
7
+ import { fetch as p } from "../get-fetch.mjs";
7
8
  import { isBrowser as g } from "../is-browser.mjs";
8
- import { generateContentUrl as a } from "./generate-content-url.mjs";
9
- const p = (t) => "results" in t;
10
- async function B(t) {
11
- const r = await v({
12
- ...t,
9
+ import { generateContentUrl as i } from "./generate-content-url.mjs";
10
+ const d = (r) => "results" in r;
11
+ async function H(r) {
12
+ const t = await v({
13
+ ...r,
13
14
  limit: 1
14
15
  });
15
- return r && r[0] || null;
16
+ return t && t[0] || null;
16
17
  }
17
- const C = async (t) => {
18
- var e;
19
- const r = a(t);
20
- return await (await ((e = t.fetch) != null ? e : w)(r.href, t.fetchOptions)).json();
21
- }, y = async (t, r, s = a(t)) => {
22
- const n = m(t.canTrack);
23
- if (s.search.includes("preview=")) {
24
- const e = [];
25
- for (const c of r.results) {
26
- const u = h(s.searchParams);
27
- e.push(u || c);
18
+ const C = async (r) => {
19
+ var n, o;
20
+ const t = i(r), e = (n = r.fetch) != null ? n : p, c = {
21
+ ...r.fetchOptions,
22
+ headers: {
23
+ ...(o = r.fetchOptions) == null ? void 0 : o.headers,
24
+ ...w()
28
25
  }
29
- r.results = e;
26
+ };
27
+ return await (await e(t.href, c)).json();
28
+ }, y = async (r, t, e = i(r)) => {
29
+ const c = h(r.canTrack);
30
+ if (e.search.includes("preview=")) {
31
+ const s = [];
32
+ for (const n of t.results) {
33
+ const o = m(e.searchParams);
34
+ s.push(o || n);
35
+ }
36
+ t.results = s;
30
37
  }
31
- if (!n || !(g() || f === "reactNative"))
32
- return r.results;
38
+ if (!c || !(g() || u === "reactNative"))
39
+ return t.results;
33
40
  try {
34
- const e = [];
35
- for (const c of r.results)
36
- e.push(await l({
37
- item: c,
38
- canTrack: n
41
+ const s = [];
42
+ for (const n of t.results)
43
+ s.push(await l({
44
+ item: n,
45
+ canTrack: c
39
46
  }));
40
- r.results = e;
41
- } catch (e) {
42
- o.error("Could not process A/B tests. ", e);
47
+ t.results = s;
48
+ } catch (s) {
49
+ a.error("Could not process A/B tests. ", s);
43
50
  }
44
- return r.results;
51
+ return t.results;
45
52
  };
46
- async function v(t) {
53
+ async function v(r) {
47
54
  try {
48
- const r = a(t), s = await C(t);
49
- return p(s) ? y(t, s) : (o.error("Error fetching data. ", {
50
- url: r,
51
- content: s,
52
- options: t
55
+ const t = i(r), e = await C(r);
56
+ return d(e) ? y(r, e) : (a.error("Error fetching data. ", {
57
+ url: t,
58
+ content: e,
59
+ options: r
53
60
  }), null);
54
- } catch (r) {
55
- return o.error("Error fetching data. ", r), null;
61
+ } catch (t) {
62
+ return a.error("Error fetching data. ", t), null;
56
63
  }
57
64
  }
58
65
  export {
59
66
  y as _processContentResult,
60
67
  v as fetchEntries,
61
- B as fetchOneEntry
68
+ H as fetchOneEntry
62
69
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sessionId.cjs"),d=require("../../helpers/visitorId.cjs"),u=require("../is-browser.cjs"),g=require("../is-editing.cjs"),l=require("./helpers.cjs"),y=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await c.getSessionId({canTrack:t}),r=d.getVisitorId({canTrack:t});return{sessionId:e,visitorId:r}},I=async({type:t,canTrack:e,apiKey:r,metadata:s,...o})=>({type:t,data:{...o,metadata:{url:location.href,...s},...await y({canTrack:e}),userAttributes:l.getUserAttributes(),ownerId:r}});async function i(t){if(!t.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(t.canTrack&&!g.isEditing()&&(u.isBrowser()||n.TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await I(t)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(e=>{console.error("Failed to track: ",e)})}const f=t=>i({...t,canTrack:!0});exports._track=i;exports.track=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sdk-headers.cjs"),d=require("../../helpers/sessionId.cjs"),u=require("../../helpers/visitorId.cjs"),g=require("../is-browser.cjs"),l=require("../is-editing.cjs"),y=require("./helpers.cjs"),I=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await d.getSessionId({canTrack:e}),r=u.getVisitorId({canTrack:e});return{sessionId:t,visitorId:r}},k=async({type:e,canTrack:t,apiKey:r,metadata:s,...o})=>({type:e,data:{...o,metadata:{url:location.href,...s},...await I({canTrack:t}),userAttributes:y.getUserAttributes(),ownerId:r}});async function i(e){if(!e.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!l.isEditing()&&(g.isBrowser()||n.TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await k(e)]}),headers:{"content-type":"application/json",...c.getSdkHeaders()},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const f=e=>i({...e,canTrack:!0});exports._track=i;exports.track=f;
@@ -1,11 +1,12 @@
1
1
  import { TARGET as a } from "../../constants/target.mjs";
2
2
  import { logger as s } from "../../helpers/logger.mjs";
3
- import { getSessionId as n } from "../../helpers/sessionId.mjs";
4
- import { getVisitorId as c } from "../../helpers/visitorId.mjs";
5
- import { isBrowser as d } from "../is-browser.mjs";
3
+ import { getSdkHeaders as n } from "../../helpers/sdk-headers.mjs";
4
+ import { getSessionId as c } from "../../helpers/sessionId.mjs";
5
+ import { getVisitorId as d } from "../../helpers/visitorId.mjs";
6
+ import { isBrowser as m } from "../is-browser.mjs";
6
7
  import { isEditing as f } from "../is-editing.mjs";
7
- import { getUserAttributes as m } from "./helpers.mjs";
8
- const p = async ({
8
+ import { getUserAttributes as p } from "./helpers.mjs";
9
+ const u = async ({
9
10
  canTrack: t
10
11
  }) => {
11
12
  if (!t)
@@ -13,60 +14,61 @@ const p = async ({
13
14
  visitorId: void 0,
14
15
  sessionId: void 0
15
16
  };
16
- const r = await n({
17
+ const r = await c({
17
18
  canTrack: t
18
- }), e = c({
19
+ }), e = d({
19
20
  canTrack: t
20
21
  });
21
22
  return {
22
23
  sessionId: r,
23
24
  visitorId: e
24
25
  };
25
- }, u = async ({
26
+ }, y = async ({
26
27
  type: t,
27
28
  canTrack: r,
28
29
  apiKey: e,
29
- metadata: i,
30
- ...o
30
+ metadata: o,
31
+ ...i
31
32
  }) => ({
32
33
  type: t,
33
34
  data: {
34
- ...o,
35
+ ...i,
35
36
  metadata: {
36
37
  url: location.href,
37
- ...i
38
+ ...o
38
39
  },
39
- ...await p({
40
+ ...await u({
40
41
  canTrack: r
41
42
  }),
42
- userAttributes: m(),
43
+ userAttributes: p(),
43
44
  ownerId: e
44
45
  }
45
46
  });
46
- async function y(t) {
47
+ async function g(t) {
47
48
  if (!t.apiKey) {
48
49
  s.error("Missing API key for track call. Please provide your API key.");
49
50
  return;
50
51
  }
51
- if (t.canTrack && !f() && (d() || a === "reactNative"))
52
+ if (t.canTrack && !f() && (m() || a === "reactNative"))
52
53
  return fetch("https://cdn.builder.io/api/v1/track", {
53
54
  method: "POST",
54
55
  body: JSON.stringify({
55
- events: [await u(t)]
56
+ events: [await y(t)]
56
57
  }),
57
58
  headers: {
58
- "content-type": "application/json"
59
+ "content-type": "application/json",
60
+ ...n()
59
61
  },
60
62
  mode: "cors"
61
63
  }).catch((r) => {
62
64
  console.error("Failed to track: ", r);
63
65
  });
64
66
  }
65
- const A = (t) => y({
67
+ const E = (t) => g({
66
68
  ...t,
67
69
  canTrack: !0
68
70
  });
69
71
  export {
70
- y as _track,
71
- A as track
72
+ g as _track,
73
+ E as track
72
74
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants/sdk-version.cjs"),r=require("../constants/target.cjs"),t=()=>({"X-Builder-SDK":r.TARGET,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":e.SDK_VERSION});exports.getSdkHeaders=t;
@@ -0,0 +1,10 @@
1
+ import { SDK_VERSION as r } from "../constants/sdk-version.mjs";
2
+ import { TARGET as e } from "../constants/target.mjs";
3
+ const S = () => ({
4
+ "X-Builder-SDK": e,
5
+ "X-Builder-SDK-GEN": "2",
6
+ "X-Builder-SDK-Version": r
7
+ });
8
+ export {
9
+ S as getSdkHeaders
10
+ };
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.16.16",
4
+ "version": "0.16.18",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -13,6 +13,7 @@ export type BlocksWrapperProps = {
13
13
  */
14
14
  BlocksWrapperProps: any;
15
15
  children?: any;
16
+ classNameProp?: string;
16
17
  };
17
18
  import type { BuilderBlock } from "../../types/builder-block.js";
18
19
  declare function BlocksWrapper(props: BlocksWrapperProps): React.JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import type { BuilderContextInterface, RegisteredComponents } from '../../context/types.js';
2
2
  import type { BlocksWrapperProps } from './blocks-wrapper.js';
3
- export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
3
+ export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps' | 'classNameProp'>> & {
4
4
  context?: BuilderContextInterface;
5
5
  registeredComponents?: RegisteredComponents;
6
6
  linkComponent?: any;
7
+ className?: string;
7
8
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.16.16";
1
+ export declare const SDK_VERSION = "0.16.18";
@@ -0,0 +1,5 @@
1
+ export declare const getSdkHeaders: () => {
2
+ 'X-Builder-SDK': any;
3
+ 'X-Builder-SDK-GEN': string;
4
+ 'X-Builder-SDK-Version': string;
5
+ };
@@ -13,6 +13,7 @@ export type BlocksWrapperProps = {
13
13
  */
14
14
  BlocksWrapperProps: any;
15
15
  children?: any;
16
+ classNameProp?: string;
16
17
  };
17
18
  import type { BuilderBlock } from "../../types/builder-block.js";
18
19
  declare function BlocksWrapper(props: BlocksWrapperProps): React.JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import type { BuilderContextInterface, RegisteredComponents } from '../../context/types.js';
2
2
  import type { BlocksWrapperProps } from './blocks-wrapper.js';
3
- export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
3
+ export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps' | 'classNameProp'>> & {
4
4
  context?: BuilderContextInterface;
5
5
  registeredComponents?: RegisteredComponents;
6
6
  linkComponent?: any;
7
+ className?: string;
7
8
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.16.16";
1
+ export declare const SDK_VERSION = "0.16.18";
@@ -0,0 +1,5 @@
1
+ export declare const getSdkHeaders: () => {
2
+ 'X-Builder-SDK': any;
3
+ 'X-Builder-SDK-GEN': string;
4
+ 'X-Builder-SDK-Version': string;
5
+ };