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

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 (61) hide show
  1. package/lib/browser/blocks/columns/columns.cjs +3 -3
  2. package/lib/browser/blocks/columns/columns.mjs +41 -33
  3. package/lib/browser/components/content/components/enable-editor.cjs +1 -1
  4. package/lib/browser/components/content/components/enable-editor.mjs +107 -105
  5. package/lib/browser/components/content/content.cjs +1 -1
  6. package/lib/browser/components/content/content.mjs +23 -21
  7. package/lib/browser/components/content-variants/content-variants.cjs +1 -1
  8. package/lib/browser/components/content-variants/content-variants.mjs +10 -8
  9. package/lib/browser/constants/sdk-version.cjs +1 -1
  10. package/lib/browser/constants/sdk-version.mjs +1 -1
  11. package/lib/browser/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
  12. package/lib/browser/functions/evaluate/node-runtime/node-runtime.mjs +16 -14
  13. package/lib/browser/functions/get-content/generate-content-url.cjs +1 -1
  14. package/lib/browser/functions/get-content/generate-content-url.mjs +24 -23
  15. package/lib/browser/functions/track/index.cjs +1 -1
  16. package/lib/browser/functions/track/index.mjs +21 -19
  17. package/lib/edge/blocks/columns/columns.cjs +3 -3
  18. package/lib/edge/blocks/columns/columns.mjs +41 -33
  19. package/lib/edge/components/content/components/enable-editor.cjs +1 -1
  20. package/lib/edge/components/content/components/enable-editor.mjs +107 -105
  21. package/lib/edge/components/content/content.cjs +1 -1
  22. package/lib/edge/components/content/content.mjs +23 -21
  23. package/lib/edge/components/content-variants/content-variants.cjs +1 -1
  24. package/lib/edge/components/content-variants/content-variants.mjs +10 -8
  25. package/lib/edge/constants/sdk-version.cjs +1 -1
  26. package/lib/edge/constants/sdk-version.mjs +1 -1
  27. package/lib/edge/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
  28. package/lib/edge/functions/evaluate/node-runtime/node-runtime.mjs +16 -14
  29. package/lib/edge/functions/get-content/generate-content-url.cjs +1 -1
  30. package/lib/edge/functions/get-content/generate-content-url.mjs +24 -23
  31. package/lib/edge/functions/track/index.cjs +1 -1
  32. package/lib/edge/functions/track/index.mjs +21 -19
  33. package/lib/node/blocks/columns/columns.cjs +3 -3
  34. package/lib/node/blocks/columns/columns.mjs +41 -33
  35. package/lib/node/components/content/components/enable-editor.cjs +1 -1
  36. package/lib/node/components/content/components/enable-editor.mjs +107 -105
  37. package/lib/node/components/content/content.cjs +1 -1
  38. package/lib/node/components/content/content.mjs +23 -21
  39. package/lib/node/components/content-variants/content-variants.cjs +1 -1
  40. package/lib/node/components/content-variants/content-variants.mjs +10 -8
  41. package/lib/node/constants/sdk-version.cjs +1 -1
  42. package/lib/node/constants/sdk-version.mjs +1 -1
  43. package/lib/node/functions/evaluate/node-runtime/node-runtime.cjs +6 -6
  44. package/lib/node/functions/evaluate/node-runtime/node-runtime.mjs +20 -18
  45. package/lib/node/functions/get-content/generate-content-url.cjs +1 -1
  46. package/lib/node/functions/get-content/generate-content-url.mjs +24 -23
  47. package/lib/node/functions/track/index.cjs +1 -1
  48. package/lib/node/functions/track/index.mjs +21 -19
  49. package/package.json +1 -1
  50. package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
  51. package/types/cjs/components/content-variants/content-variants.types.d.ts +4 -0
  52. package/types/cjs/constants/sdk-version.d.ts +1 -1
  53. package/types/cjs/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
  54. package/types/cjs/functions/get-content/types.d.ts +4 -0
  55. package/types/cjs/functions/track/index.d.ts +3 -1
  56. package/types/esm/components/content/components/enable-editor.d.ts +1 -1
  57. package/types/esm/components/content-variants/content-variants.types.d.ts +4 -0
  58. package/types/esm/constants/sdk-version.d.ts +1 -1
  59. package/types/esm/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
  60. package/types/esm/functions/get-content/types.d.ts +4 -0
  61. package/types/esm/functions/track/index.d.ts +3 -1
@@ -1,6 +1,6 @@
1
- import { SDK_NAME as s } from "../../../constants/sdk-name.mjs";
2
- import { logger as j, MSG_PREFIX as x } from "../../../helpers/logger.mjs";
3
- import { fastClone as R } from "../../fast-clone.mjs";
1
+ import { SDK_NAME as c } from "../../../constants/sdk-name.mjs";
2
+ import { logger as j, MSG_PREFIX as R } from "../../../helpers/logger.mjs";
3
+ import { fastClone as x } from "../../fast-clone.mjs";
4
4
  import { set as k } from "../../set.mjs";
5
5
  import { getFunctionArguments as A } from "../helpers.mjs";
6
6
  import { safeDynamicRequire as h } from "./safeDynamicRequire.mjs";
@@ -51,24 +51,24 @@ if (typeof output === 'object' && output !== null) {
51
51
  }
52
52
  `;
53
53
  };
54
- let a = null, y = null;
54
+ let u = null, y = null;
55
55
  const V = (e, t = {}) => {
56
- a = e, E(t);
57
- }, O = s === "@builder.io/sdk-react-nextjs" || s === "@builder.io/sdk-react" || s === "@builder.io/sdk-qwik" || s === "@builder.io/sdk-vue", g = () => {
56
+ u || (u = e, E(t));
57
+ }, O = c === "@builder.io/sdk-react-nextjs" || c === "@builder.io/sdk-react" || c === "@builder.io/sdk-qwik" || c === "@builder.io/sdk-vue", g = () => {
58
58
  try {
59
- if (a)
60
- return a;
59
+ if (u)
60
+ return u;
61
61
  const t = h("isolated-vm");
62
62
  if (t)
63
63
  return t;
64
64
  } catch (t) {
65
65
  j.error("isolated-vm import error.", t);
66
66
  }
67
- const e = `${x}could not import \`isolated-vm\` module for safe script execution on a Node server.
67
+ const e = `${R}could not import \`isolated-vm\` module for safe script execution on a Node server.
68
68
 
69
69
  SOLUTION: In a server-only execution path within your application, do one of the following:
70
70
 
71
- ${O ? `- import and call \`initializeNodeRuntime()\` from "${s}/node/init".` : ""}
71
+ ${O ? `- import and call \`initializeNodeRuntime()\` from "${c}/node/init".` : ""}
72
72
  - add the following import: \`await import('isolated-vm')\`.
73
73
 
74
74
  For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
@@ -77,22 +77,24 @@ const V = (e, t = {}) => {
77
77
  function E(e = {
78
78
  memoryLimit: 128
79
79
  }) {
80
+ if (y)
81
+ return y;
80
82
  const t = g(), o = new t.Isolate(e).createContextSync(), n = o.global;
81
- return n.setSync("global", n.derefInto()), n.setSync("log", function(...c) {
82
- console.log(...c);
83
+ return n.setSync("global", n.derefInto()), n.setSync("log", function(...s) {
84
+ console.log(...s);
83
85
  }), n.setSync(I, t), y = o, o;
84
86
  }
85
- const $ = () => y || E(), B = ({
87
+ const $ = () => E(), B = ({
86
88
  code: e,
87
89
  builder: t,
88
90
  context: l,
89
91
  event: o,
90
92
  localState: n,
91
- rootSetState: c,
92
- rootState: u
93
+ rootSetState: s,
94
+ rootState: a
93
95
  }) => {
94
- const S = g(), _ = R({
95
- ...u,
96
+ const S = g(), _ = x({
97
+ ...a,
96
98
  ...n
97
99
  }), f = A({
98
100
  builder: t,
@@ -101,7 +103,7 @@ const $ = () => y || E(), B = ({
101
103
  state: _
102
104
  }), m = $(), p = m.global;
103
105
  p.setSync(b, function(r, i) {
104
- k(u, r, i), c == null || c(u);
106
+ k(a, r, i), s == null || s(a);
105
107
  }), f.forEach(([r, i]) => {
106
108
  const N = typeof i == "object" ? new S.Reference(
107
109
  // workaround: methods with default values for arguments is not being cloned over
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../helpers/flatten.cjs"),q=require("../../helpers/search/search.cjs"),w=require("../../types/api-version.cjs"),O=require("../get-builder-search-params/index.cjs"),y=s=>typeof s=="number"&&!isNaN(s)&&s>=0,A=s=>{const{limit:f=30,userAttributes:l,query:m,model:b,apiKey:h,enrich:u,locale:d,apiVersion:a=w.DEFAULT_API_VERSION,fields:P,omit:v,offset:i,cacheSeconds:n,staleCacheSeconds:o,sort:S,includeUnpublished:g}=s;if(!h)throw new Error("Missing API key");if(!["v3"].includes(a))throw new Error(`Invalid apiVersion: expected 'v3', received '${a}'`);const N=f!==1,e=new URL(`https://cdn.builder.io/api/${a}/content/${b}`);if(e.searchParams.set("apiKey",h),e.searchParams.set("limit",String(f)),e.searchParams.set("noTraverse",String(N)),e.searchParams.set("includeRefs",String(!0)),d&&e.searchParams.set("locale",d),u&&e.searchParams.set("enrich",String(u)),e.searchParams.set("omit",v||"meta.componentsUsed"),P&&e.searchParams.set("fields",P),Number.isFinite(i)&&i>-1&&e.searchParams.set("offset",String(Math.floor(i))),typeof g=="boolean"&&e.searchParams.set("includeUnpublished",String(g)),n&&y(n)&&e.searchParams.set("cacheSeconds",String(n)),o&&y(o)&&e.searchParams.set("staleCacheSeconds",String(o)),S){const r=c.flatten({sort:S});for(const t in r)e.searchParams.set(t,JSON.stringify(r[t]))}const U={...O.getBuilderSearchParamsFromWindow(),...q.normalizeSearchParams(s.options||{})},p=c.flatten(U);for(const r in p)e.searchParams.set(r,String(p[r]));if(l&&e.searchParams.set("userAttributes",JSON.stringify(l)),m){const r=c.flattenMongoQuery({query:m});for(const t in r)e.searchParams.set(t,JSON.stringify(r[t]))}return e};exports.generateContentUrl=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../helpers/flatten.cjs"),O=require("../../helpers/search/search.cjs"),A=require("../../types/api-version.cjs"),V=require("../get-builder-search-params/index.cjs"),y=r=>typeof r=="number"&&!isNaN(r)&&r>=0,$=r=>{const{limit:l=30,userAttributes:f,query:m,model:b,apiKey:h,enrich:u,locale:d,apiVersion:a=A.DEFAULT_API_VERSION,fields:P,omit:v,offset:i,cacheSeconds:n,staleCacheSeconds:o,sort:S,includeUnpublished:g,apiHost:N}=r;if(!h)throw new Error("Missing API key");if(!["v3"].includes(a))throw new Error(`Invalid apiVersion: expected 'v3', received '${a}'`);const U=l!==1,q=N||"https://cdn.builder.io",e=new URL(`${q}/api/${a}/content/${b}`);if(e.searchParams.set("apiKey",h),e.searchParams.set("limit",String(l)),e.searchParams.set("noTraverse",String(U)),e.searchParams.set("includeRefs",String(!0)),d&&e.searchParams.set("locale",d),u&&e.searchParams.set("enrich",String(u)),e.searchParams.set("omit",v||"meta.componentsUsed"),P&&e.searchParams.set("fields",P),Number.isFinite(i)&&i>-1&&e.searchParams.set("offset",String(Math.floor(i))),typeof g=="boolean"&&e.searchParams.set("includeUnpublished",String(g)),n&&y(n)&&e.searchParams.set("cacheSeconds",String(n)),o&&y(o)&&e.searchParams.set("staleCacheSeconds",String(o)),S){const s=c.flatten({sort:S});for(const t in s)e.searchParams.set(t,JSON.stringify(s[t]))}const w={...V.getBuilderSearchParamsFromWindow(),...O.normalizeSearchParams(r.options||{})},p=c.flatten(w);for(const s in p)e.searchParams.set(s,String(p[s]));if(f&&e.searchParams.set("userAttributes",JSON.stringify(f)),m){const s=c.flattenMongoQuery({query:m});for(const t in s)e.searchParams.set(t,JSON.stringify(s[t]))}return e};exports.generateContentUrl=$;
@@ -1,8 +1,8 @@
1
- import { flatten as g, flattenMongoQuery as U } from "../../helpers/flatten.mjs";
2
- import { normalizeSearchParams as A } from "../../helpers/search/search.mjs";
3
- import { DEFAULT_API_VERSION as O } from "../../types/api-version.mjs";
4
- import { getBuilderSearchParamsFromWindow as k } from "../get-builder-search-params/index.mjs";
5
- const y = (s) => typeof s == "number" && !isNaN(s) && s >= 0, J = (s) => {
1
+ import { flatten as g, flattenMongoQuery as O } from "../../helpers/flatten.mjs";
2
+ import { normalizeSearchParams as k } from "../../helpers/search/search.mjs";
3
+ import { DEFAULT_API_VERSION as E } from "../../types/api-version.mjs";
4
+ import { getBuilderSearchParamsFromWindow as I } from "../get-builder-search-params/index.mjs";
5
+ const y = (r) => typeof r == "number" && !isNaN(r) && r >= 0, M = (r) => {
6
6
  const {
7
7
  limit: c = 30,
8
8
  userAttributes: m,
@@ -11,42 +11,43 @@ const y = (s) => typeof s == "number" && !isNaN(s) && s >= 0, J = (s) => {
11
11
  apiKey: l,
12
12
  enrich: h,
13
13
  locale: d,
14
- apiVersion: a = O,
14
+ apiVersion: a = E,
15
15
  fields: u,
16
16
  omit: N,
17
17
  offset: i,
18
18
  cacheSeconds: n,
19
19
  staleCacheSeconds: o,
20
20
  sort: P,
21
- includeUnpublished: S
22
- } = s;
21
+ includeUnpublished: p,
22
+ apiHost: v
23
+ } = r;
23
24
  if (!l)
24
25
  throw new Error("Missing API key");
25
26
  if (!["v3"].includes(a))
26
27
  throw new Error(`Invalid apiVersion: expected 'v3', received '${a}'`);
27
- const v = c !== 1, e = new URL(`https://cdn.builder.io/api/${a}/content/${b}`);
28
- if (e.searchParams.set("apiKey", l), e.searchParams.set("limit", String(c)), e.searchParams.set("noTraverse", String(v)), e.searchParams.set("includeRefs", String(!0)), d && e.searchParams.set("locale", d), h && e.searchParams.set("enrich", String(h)), e.searchParams.set("omit", N || "meta.componentsUsed"), u && e.searchParams.set("fields", u), Number.isFinite(i) && i > -1 && e.searchParams.set("offset", String(Math.floor(i))), typeof S == "boolean" && e.searchParams.set("includeUnpublished", String(S)), n && y(n) && e.searchParams.set("cacheSeconds", String(n)), o && y(o) && e.searchParams.set("staleCacheSeconds", String(o)), P) {
29
- const r = g({
28
+ const U = c !== 1, w = v || "https://cdn.builder.io", e = new URL(`${w}/api/${a}/content/${b}`);
29
+ if (e.searchParams.set("apiKey", l), e.searchParams.set("limit", String(c)), e.searchParams.set("noTraverse", String(U)), e.searchParams.set("includeRefs", String(!0)), d && e.searchParams.set("locale", d), h && e.searchParams.set("enrich", String(h)), e.searchParams.set("omit", N || "meta.componentsUsed"), u && e.searchParams.set("fields", u), Number.isFinite(i) && i > -1 && e.searchParams.set("offset", String(Math.floor(i))), typeof p == "boolean" && e.searchParams.set("includeUnpublished", String(p)), n && y(n) && e.searchParams.set("cacheSeconds", String(n)), o && y(o) && e.searchParams.set("staleCacheSeconds", String(o)), P) {
30
+ const s = g({
30
31
  sort: P
31
32
  });
32
- for (const t in r)
33
- e.searchParams.set(t, JSON.stringify(r[t]));
33
+ for (const t in s)
34
+ e.searchParams.set(t, JSON.stringify(s[t]));
34
35
  }
35
- const w = {
36
- ...k(),
37
- ...A(s.options || {})
38
- }, p = g(w);
39
- for (const r in p)
40
- e.searchParams.set(r, String(p[r]));
36
+ const A = {
37
+ ...I(),
38
+ ...k(r.options || {})
39
+ }, S = g(A);
40
+ for (const s in S)
41
+ e.searchParams.set(s, String(S[s]));
41
42
  if (m && e.searchParams.set("userAttributes", JSON.stringify(m)), f) {
42
- const r = U({
43
+ const s = O({
43
44
  query: f
44
45
  });
45
- for (const t in r)
46
- e.searchParams.set(t, JSON.stringify(r[t]));
46
+ for (const t in s)
47
+ e.searchParams.set(t, JSON.stringify(s[t]));
47
48
  }
48
49
  return e;
49
50
  };
50
51
  export {
51
- J as generateContentUrl
52
+ M as generateContentUrl
52
53
  };
@@ -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/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
+ "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:i,...o})=>({type:e,data:{...o,metadata:{url:location.href,...i},...await I({canTrack:t}),userAttributes:y.getUserAttributes(),ownerId:r}});async function s({apiHost:e,...t}){if(!t.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}return!t.canTrack||l.isEditing()||!(g.isBrowser()||n.TARGET==="reactNative")?void 0:fetch(`${e||"https://cdn.builder.io"}/api/v1/track`,{method:"POST",body:JSON.stringify({events:[await k(t)]}),headers:{"content-type":"application/json",...c.getSdkHeaders()},mode:"cors"}).catch(i=>{console.error("Failed to track: ",i)})}const f=e=>s({...e,canTrack:!0});exports._track=s;exports.track=f;
@@ -23,7 +23,7 @@ const u = async ({
23
23
  sessionId: r,
24
24
  visitorId: e
25
25
  };
26
- }, y = async ({
26
+ }, l = async ({
27
27
  type: t,
28
28
  canTrack: r,
29
29
  apiKey: e,
@@ -44,31 +44,33 @@ const u = async ({
44
44
  ownerId: e
45
45
  }
46
46
  });
47
- async function g(t) {
48
- if (!t.apiKey) {
47
+ async function y({
48
+ apiHost: t,
49
+ ...r
50
+ }) {
51
+ if (!r.apiKey) {
49
52
  s.error("Missing API key for track call. Please provide your API key.");
50
53
  return;
51
54
  }
52
- if (t.canTrack && !f() && (m() || a === "reactNative"))
53
- return fetch("https://cdn.builder.io/api/v1/track", {
54
- method: "POST",
55
- body: JSON.stringify({
56
- events: [await y(t)]
57
- }),
58
- headers: {
59
- "content-type": "application/json",
60
- ...n()
61
- },
62
- mode: "cors"
63
- }).catch((r) => {
64
- console.error("Failed to track: ", r);
65
- });
55
+ return !r.canTrack || f() || !(m() || a === "reactNative") ? void 0 : fetch(`${t || "https://cdn.builder.io"}/api/v1/track`, {
56
+ method: "POST",
57
+ body: JSON.stringify({
58
+ events: [await l(r)]
59
+ }),
60
+ headers: {
61
+ "content-type": "application/json",
62
+ ...n()
63
+ },
64
+ mode: "cors"
65
+ }).catch((o) => {
66
+ console.error("Failed to track: ", o);
67
+ });
66
68
  }
67
- const E = (t) => g({
69
+ const E = (t) => y({
68
70
  ...t,
69
71
  canTrack: !0
70
72
  });
71
73
  export {
72
- g as _track,
74
+ y as _track,
73
75
  E as track
74
76
  };
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.18",
4
+ "version": "0.16.20",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps" | "isNestedRender" | "linkComponent"> & {
2
+ type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps" | "linkComponent"> & {
3
3
  builderContextSignal: BuilderContextInterface;
4
4
  setBuilderContextSignal?: (signal: any) => any;
5
5
  children?: any;
@@ -26,6 +26,10 @@ export interface ContentVariantsPrps extends ExtraFrameworkProps {
26
26
  * Your API Key: needed to enable visual editing, and to dynamically fetch symbols (required).
27
27
  */
28
28
  apiKey: string;
29
+ /**
30
+ * Sets the host of Builder API calls. (Defaults to global `https://cdn.builder.io`)
31
+ */
32
+ apiHost?: string;
29
33
  apiVersion?: ApiVersion;
30
34
  /**
31
35
  * An array of custom components to register (optional).
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.16.18";
1
+ export declare const SDK_VERSION = "0.16.20";
@@ -0,0 +1 @@
1
+ export { setIvm } from './node-runtime.js';
@@ -136,4 +136,8 @@ export interface GetContentOptions {
136
136
  * Optional fetch options to be passed as the second argument to the `fetch` function.
137
137
  */
138
138
  fetchOptions?: object;
139
+ /**
140
+ * Sets the host of Builder API calls. (Defaults to global `https://cdn.builder.io`)
141
+ */
142
+ apiHost?: string;
139
143
  }
@@ -46,6 +46,8 @@ type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | '
46
46
  [index: string]: any;
47
47
  };
48
48
  export type EventProps = EventProperties & CanTrack;
49
- export declare function _track(eventProps: EventProps): Promise<void | Response>;
49
+ export declare function _track({ apiHost, ...eventProps }: EventProps & {
50
+ apiHost?: string;
51
+ }): Promise<void | Response>;
50
52
  export declare const track: (args: EventProperties) => Promise<void | Response>;
51
53
  export {};
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps" | "isNestedRender" | "linkComponent"> & {
2
+ type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps" | "linkComponent"> & {
3
3
  builderContextSignal: BuilderContextInterface;
4
4
  setBuilderContextSignal?: (signal: any) => any;
5
5
  children?: any;
@@ -26,6 +26,10 @@ export interface ContentVariantsPrps extends ExtraFrameworkProps {
26
26
  * Your API Key: needed to enable visual editing, and to dynamically fetch symbols (required).
27
27
  */
28
28
  apiKey: string;
29
+ /**
30
+ * Sets the host of Builder API calls. (Defaults to global `https://cdn.builder.io`)
31
+ */
32
+ apiHost?: string;
29
33
  apiVersion?: ApiVersion;
30
34
  /**
31
35
  * An array of custom components to register (optional).
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.16.18";
1
+ export declare const SDK_VERSION = "0.16.20";
@@ -0,0 +1 @@
1
+ export { setIvm } from './node-runtime.js';
@@ -136,4 +136,8 @@ export interface GetContentOptions {
136
136
  * Optional fetch options to be passed as the second argument to the `fetch` function.
137
137
  */
138
138
  fetchOptions?: object;
139
+ /**
140
+ * Sets the host of Builder API calls. (Defaults to global `https://cdn.builder.io`)
141
+ */
142
+ apiHost?: string;
139
143
  }
@@ -46,6 +46,8 @@ type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | '
46
46
  [index: string]: any;
47
47
  };
48
48
  export type EventProps = EventProperties & CanTrack;
49
- export declare function _track(eventProps: EventProps): Promise<void | Response>;
49
+ export declare function _track({ apiHost, ...eventProps }: EventProps & {
50
+ apiHost?: string;
51
+ }): Promise<void | Response>;
50
52
  export declare const track: (args: EventProperties) => Promise<void | Response>;
51
53
  export {};