@builder.io/sdk-react-nextjs 0.24.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";const m=require("react/jsx-runtime"),k=require("../../components/content-variants/content-variants.cjs"),f=require("../../functions/get-class-prop-name.cjs"),v=require("./symbol.helpers.cjs");async function N(e){var o,i,l,a,c,r,s;const d=function(){return"div"},y=function(){return"div"},C=function(){return Object.values(e.builderComponents)},x=function(){var u,b;return[e.attributes[f.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(b=e.symbol)!=null&&b.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await v.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(i=e.symbol)==null||i.entry,m.jsx("div",{...e.attributes,className:x(),children:m.jsx(k,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:C(),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(c=t==null?void 0:t.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(s=(r=e.symbol)==null?void 0:r.model)!=null?s:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:d(),contentWrapper:y()})})}module.exports=N;
1
+ "use strict";const y=require("react/jsx-runtime"),v=require("../../components/content-variants/content-variants.cjs"),N=require("../../functions/get-class-prop-name.cjs"),W=require("./symbol.helpers.cjs");async function j(e){var o,l,i,a,c,r,b,s,m;const C=function(){return"div"},x=function(){return"div"},k=function(){return Object.values(e.builderComponents)},f=function(){var u,d;return[e.attributes[N.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await W.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(l=e.symbol)==null||l.entry,y.jsx("div",{...e.attributes,className:f(),children:y.jsx(v,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:(i=e.symbol)!=null&&i.global&&((a=e.symbol)!=null&&a.ownerId)?e.symbol.ownerId:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:k(),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(b=t==null?void 0:t.data)==null?void 0:b.state},canTrack:e.builderContext.canTrack,model:(m=(s=e.symbol)==null?void 0:s.model)!=null?m:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:C(),contentWrapper:x()})})}module.exports=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../functions/get-content/index.cjs"),c=require("../../helpers/logger.cjs"),i=async({builderContextValue:r,symbol:e})=>{if(e!=null&&e.model&&(r!=null&&r.apiKey))return t.fetchOneEntry({model:e.model,apiKey:r.apiKey,apiVersion:r.apiVersion,...(e==null?void 0:e.entry)&&{query:{id:e.entry}}}).catch(n=>{c.logger.error("Could not fetch symbol content: ",n)})};exports.fetchSymbolContent=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../functions/get-content/index.cjs"),c=require("../../helpers/logger.cjs"),i=async({builderContextValue:r,symbol:e})=>{if(e!=null&&e.model&&(r!=null&&r.apiKey))return t.fetchOneEntry({model:e.model,apiKey:e.global&&e.ownerId?e.ownerId:r.apiKey,apiVersion:r.apiVersion,...(e==null?void 0:e.entry)&&{query:{id:e.entry}}}).catch(n=>{c.logger.error("Could not fetch symbol content: ",n)})};exports.fetchSymbolContent=i;
@@ -1,6 +1,6 @@
1
1
  import { fetchOneEntry as p } from "../../functions/get-content/index.mjs";
2
- import { logger as i } from "../../helpers/logger.mjs";
3
- const e = async ({
2
+ import { logger as e } from "../../helpers/logger.mjs";
3
+ const f = async ({
4
4
  builderContextValue: n,
5
5
  symbol: r
6
6
  }) => {
@@ -8,7 +8,7 @@ const e = async ({
8
8
  (n != null && n.apiKey))
9
9
  return p({
10
10
  model: r.model,
11
- apiKey: n.apiKey,
11
+ apiKey: r.global && r.ownerId ? r.ownerId : n.apiKey,
12
12
  apiVersion: n.apiVersion,
13
13
  ...(r == null ? void 0 : r.entry) && {
14
14
  query: {
@@ -16,9 +16,9 @@ const e = async ({
16
16
  }
17
17
  }
18
18
  }).catch((c) => {
19
- i.error("Could not fetch symbol content: ", c);
19
+ e.error("Could not fetch symbol content: ", c);
20
20
  });
21
21
  };
22
22
  export {
23
- e as fetchSymbolContent
23
+ f as fetchSymbolContent
24
24
  };
@@ -1,50 +1,50 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import x from "../../components/content-variants/content-variants.mjs";
3
- import { getClassPropName as k } from "../../functions/get-class-prop-name.mjs";
4
- import { fetchSymbolContent as v } from "./symbol.helpers.mjs";
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import v from "../../components/content-variants/content-variants.mjs";
3
+ import { getClassPropName as W } from "../../functions/get-class-prop-name.mjs";
4
+ import { fetchSymbolContent as N } from "./symbol.helpers.mjs";
5
5
  async function S(t) {
6
- var o, i, l, a, c, m, r;
7
- const s = function() {
6
+ var o, l, i, a, m, c, b, r, d;
7
+ const C = function() {
8
8
  return "div";
9
- }, y = function() {
9
+ }, f = function() {
10
10
  return "div";
11
- }, C = function() {
11
+ }, x = function() {
12
12
  return Object.values(t.builderComponents);
13
- }, f = function() {
14
- var b, d;
13
+ }, k = function() {
14
+ var u, s;
15
15
  return [
16
- t.attributes[k()],
16
+ t.attributes[W()],
17
17
  "builder-symbol",
18
- (b = t.symbol) != null && b.inline ? "builder-inline-symbol" : void 0,
19
- (d = t.symbol) != null && d.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
18
+ (u = t.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
19
+ (s = t.symbol) != null && s.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
20
20
  ].filter(Boolean).join(" ");
21
- }, e = ((o = t.symbol) == null ? void 0 : o.content) || await v({
21
+ }, e = ((o = t.symbol) == null ? void 0 : o.content) || await N({
22
22
  symbol: t.symbol,
23
23
  builderContextValue: t.builderContext
24
24
  });
25
- return (i = t.symbol) == null || i.entry, /* @__PURE__ */ u("div", { ...t.attributes, className: f(), children: /* @__PURE__ */ u(
26
- x,
25
+ return (l = t.symbol) == null || l.entry, /* @__PURE__ */ y("div", { ...t.attributes, className: k(), children: /* @__PURE__ */ y(
26
+ v,
27
27
  {
28
28
  nonce: t.builderContext.nonce,
29
29
  isNestedRender: !0,
30
30
  apiVersion: t.builderContext.apiVersion,
31
- apiKey: t.builderContext.apiKey,
31
+ apiKey: (i = t.symbol) != null && i.global && ((a = t.symbol) != null && a.ownerId) ? t.symbol.ownerId : t.builderContext.apiKey,
32
32
  context: {
33
33
  ...t.builderContext.context,
34
- symbolId: (l = t.builderBlock) == null ? void 0 : l.id
34
+ symbolId: (m = t.builderBlock) == null ? void 0 : m.id
35
35
  },
36
- customComponents: C(),
36
+ customComponents: x(),
37
37
  data: {
38
- ...(a = t.symbol) == null ? void 0 : a.data,
38
+ ...(c = t.symbol) == null ? void 0 : c.data,
39
39
  ...t.builderContext.localState,
40
- ...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state
40
+ ...(b = e == null ? void 0 : e.data) == null ? void 0 : b.state
41
41
  },
42
42
  canTrack: t.builderContext.canTrack,
43
- model: (r = (m = t.symbol) == null ? void 0 : m.model) != null ? r : "",
43
+ model: (d = (r = t.symbol) == null ? void 0 : r.model) != null ? d : "",
44
44
  content: e,
45
45
  linkComponent: t.builderLinkComponent,
46
- blocksWrapper: s(),
47
- contentWrapper: y()
46
+ blocksWrapper: C(),
47
+ contentWrapper: f()
48
48
  }
49
49
  ) });
50
50
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.24.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.25.0";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.24.1";
1
+ const o = "0.25.0";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";const m=require("react/jsx-runtime"),k=require("../../components/content-variants/content-variants.cjs"),f=require("../../functions/get-class-prop-name.cjs"),v=require("./symbol.helpers.cjs");async function N(e){var o,i,l,a,c,r,s;const d=function(){return"div"},y=function(){return"div"},C=function(){return Object.values(e.builderComponents)},x=function(){var u,b;return[e.attributes[f.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(b=e.symbol)!=null&&b.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await v.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(i=e.symbol)==null||i.entry,m.jsx("div",{...e.attributes,className:x(),children:m.jsx(k,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:C(),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(c=t==null?void 0:t.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(s=(r=e.symbol)==null?void 0:r.model)!=null?s:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:d(),contentWrapper:y()})})}module.exports=N;
1
+ "use strict";const y=require("react/jsx-runtime"),v=require("../../components/content-variants/content-variants.cjs"),N=require("../../functions/get-class-prop-name.cjs"),W=require("./symbol.helpers.cjs");async function j(e){var o,l,i,a,c,r,b,s,m;const C=function(){return"div"},x=function(){return"div"},k=function(){return Object.values(e.builderComponents)},f=function(){var u,d;return[e.attributes[N.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await W.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(l=e.symbol)==null||l.entry,y.jsx("div",{...e.attributes,className:f(),children:y.jsx(v,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:(i=e.symbol)!=null&&i.global&&((a=e.symbol)!=null&&a.ownerId)?e.symbol.ownerId:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:k(),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(b=t==null?void 0:t.data)==null?void 0:b.state},canTrack:e.builderContext.canTrack,model:(m=(s=e.symbol)==null?void 0:s.model)!=null?m:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:C(),contentWrapper:x()})})}module.exports=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../functions/get-content/index.cjs"),c=require("../../helpers/logger.cjs"),i=async({builderContextValue:r,symbol:e})=>{if(e!=null&&e.model&&(r!=null&&r.apiKey))return t.fetchOneEntry({model:e.model,apiKey:r.apiKey,apiVersion:r.apiVersion,...(e==null?void 0:e.entry)&&{query:{id:e.entry}}}).catch(n=>{c.logger.error("Could not fetch symbol content: ",n)})};exports.fetchSymbolContent=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../functions/get-content/index.cjs"),c=require("../../helpers/logger.cjs"),i=async({builderContextValue:r,symbol:e})=>{if(e!=null&&e.model&&(r!=null&&r.apiKey))return t.fetchOneEntry({model:e.model,apiKey:e.global&&e.ownerId?e.ownerId:r.apiKey,apiVersion:r.apiVersion,...(e==null?void 0:e.entry)&&{query:{id:e.entry}}}).catch(n=>{c.logger.error("Could not fetch symbol content: ",n)})};exports.fetchSymbolContent=i;
@@ -1,6 +1,6 @@
1
1
  import { fetchOneEntry as p } from "../../functions/get-content/index.mjs";
2
- import { logger as i } from "../../helpers/logger.mjs";
3
- const e = async ({
2
+ import { logger as e } from "../../helpers/logger.mjs";
3
+ const f = async ({
4
4
  builderContextValue: n,
5
5
  symbol: r
6
6
  }) => {
@@ -8,7 +8,7 @@ const e = async ({
8
8
  (n != null && n.apiKey))
9
9
  return p({
10
10
  model: r.model,
11
- apiKey: n.apiKey,
11
+ apiKey: r.global && r.ownerId ? r.ownerId : n.apiKey,
12
12
  apiVersion: n.apiVersion,
13
13
  ...(r == null ? void 0 : r.entry) && {
14
14
  query: {
@@ -16,9 +16,9 @@ const e = async ({
16
16
  }
17
17
  }
18
18
  }).catch((c) => {
19
- i.error("Could not fetch symbol content: ", c);
19
+ e.error("Could not fetch symbol content: ", c);
20
20
  });
21
21
  };
22
22
  export {
23
- e as fetchSymbolContent
23
+ f as fetchSymbolContent
24
24
  };
@@ -1,50 +1,50 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import x from "../../components/content-variants/content-variants.mjs";
3
- import { getClassPropName as k } from "../../functions/get-class-prop-name.mjs";
4
- import { fetchSymbolContent as v } from "./symbol.helpers.mjs";
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import v from "../../components/content-variants/content-variants.mjs";
3
+ import { getClassPropName as W } from "../../functions/get-class-prop-name.mjs";
4
+ import { fetchSymbolContent as N } from "./symbol.helpers.mjs";
5
5
  async function S(t) {
6
- var o, i, l, a, c, m, r;
7
- const s = function() {
6
+ var o, l, i, a, m, c, b, r, d;
7
+ const C = function() {
8
8
  return "div";
9
- }, y = function() {
9
+ }, f = function() {
10
10
  return "div";
11
- }, C = function() {
11
+ }, x = function() {
12
12
  return Object.values(t.builderComponents);
13
- }, f = function() {
14
- var b, d;
13
+ }, k = function() {
14
+ var u, s;
15
15
  return [
16
- t.attributes[k()],
16
+ t.attributes[W()],
17
17
  "builder-symbol",
18
- (b = t.symbol) != null && b.inline ? "builder-inline-symbol" : void 0,
19
- (d = t.symbol) != null && d.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
18
+ (u = t.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
19
+ (s = t.symbol) != null && s.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
20
20
  ].filter(Boolean).join(" ");
21
- }, e = ((o = t.symbol) == null ? void 0 : o.content) || await v({
21
+ }, e = ((o = t.symbol) == null ? void 0 : o.content) || await N({
22
22
  symbol: t.symbol,
23
23
  builderContextValue: t.builderContext
24
24
  });
25
- return (i = t.symbol) == null || i.entry, /* @__PURE__ */ u("div", { ...t.attributes, className: f(), children: /* @__PURE__ */ u(
26
- x,
25
+ return (l = t.symbol) == null || l.entry, /* @__PURE__ */ y("div", { ...t.attributes, className: k(), children: /* @__PURE__ */ y(
26
+ v,
27
27
  {
28
28
  nonce: t.builderContext.nonce,
29
29
  isNestedRender: !0,
30
30
  apiVersion: t.builderContext.apiVersion,
31
- apiKey: t.builderContext.apiKey,
31
+ apiKey: (i = t.symbol) != null && i.global && ((a = t.symbol) != null && a.ownerId) ? t.symbol.ownerId : t.builderContext.apiKey,
32
32
  context: {
33
33
  ...t.builderContext.context,
34
- symbolId: (l = t.builderBlock) == null ? void 0 : l.id
34
+ symbolId: (m = t.builderBlock) == null ? void 0 : m.id
35
35
  },
36
- customComponents: C(),
36
+ customComponents: x(),
37
37
  data: {
38
- ...(a = t.symbol) == null ? void 0 : a.data,
38
+ ...(c = t.symbol) == null ? void 0 : c.data,
39
39
  ...t.builderContext.localState,
40
- ...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state
40
+ ...(b = e == null ? void 0 : e.data) == null ? void 0 : b.state
41
41
  },
42
42
  canTrack: t.builderContext.canTrack,
43
- model: (r = (m = t.symbol) == null ? void 0 : m.model) != null ? r : "",
43
+ model: (d = (r = t.symbol) == null ? void 0 : r.model) != null ? d : "",
44
44
  content: e,
45
45
  linkComponent: t.builderLinkComponent,
46
- blocksWrapper: s(),
47
- contentWrapper: y()
46
+ blocksWrapper: C(),
47
+ contentWrapper: f()
48
48
  }
49
49
  ) });
50
50
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.24.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.25.0";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.24.1";
1
+ const o = "0.25.0";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- "use strict";const m=require("react/jsx-runtime"),k=require("../../components/content-variants/content-variants.cjs"),f=require("../../functions/get-class-prop-name.cjs"),v=require("./symbol.helpers.cjs");async function N(e){var o,i,l,a,c,r,s;const d=function(){return"div"},y=function(){return"div"},C=function(){return Object.values(e.builderComponents)},x=function(){var u,b;return[e.attributes[f.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(b=e.symbol)!=null&&b.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await v.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(i=e.symbol)==null||i.entry,m.jsx("div",{...e.attributes,className:x(),children:m.jsx(k,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:C(),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(c=t==null?void 0:t.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(s=(r=e.symbol)==null?void 0:r.model)!=null?s:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:d(),contentWrapper:y()})})}module.exports=N;
1
+ "use strict";const y=require("react/jsx-runtime"),v=require("../../components/content-variants/content-variants.cjs"),N=require("../../functions/get-class-prop-name.cjs"),W=require("./symbol.helpers.cjs");async function j(e){var o,l,i,a,c,r,b,s,m;const C=function(){return"div"},x=function(){return"div"},k=function(){return Object.values(e.builderComponents)},f=function(){var u,d;return[e.attributes[N.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await W.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(l=e.symbol)==null||l.entry,y.jsx("div",{...e.attributes,className:f(),children:y.jsx(v,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:(i=e.symbol)!=null&&i.global&&((a=e.symbol)!=null&&a.ownerId)?e.symbol.ownerId:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:k(),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(b=t==null?void 0:t.data)==null?void 0:b.state},canTrack:e.builderContext.canTrack,model:(m=(s=e.symbol)==null?void 0:s.model)!=null?m:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:C(),contentWrapper:x()})})}module.exports=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../functions/get-content/index.cjs"),c=require("../../helpers/logger.cjs"),i=async({builderContextValue:r,symbol:e})=>{if(e!=null&&e.model&&(r!=null&&r.apiKey))return t.fetchOneEntry({model:e.model,apiKey:r.apiKey,apiVersion:r.apiVersion,...(e==null?void 0:e.entry)&&{query:{id:e.entry}}}).catch(n=>{c.logger.error("Could not fetch symbol content: ",n)})};exports.fetchSymbolContent=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../functions/get-content/index.cjs"),c=require("../../helpers/logger.cjs"),i=async({builderContextValue:r,symbol:e})=>{if(e!=null&&e.model&&(r!=null&&r.apiKey))return t.fetchOneEntry({model:e.model,apiKey:e.global&&e.ownerId?e.ownerId:r.apiKey,apiVersion:r.apiVersion,...(e==null?void 0:e.entry)&&{query:{id:e.entry}}}).catch(n=>{c.logger.error("Could not fetch symbol content: ",n)})};exports.fetchSymbolContent=i;
@@ -1,6 +1,6 @@
1
1
  import { fetchOneEntry as p } from "../../functions/get-content/index.mjs";
2
- import { logger as i } from "../../helpers/logger.mjs";
3
- const e = async ({
2
+ import { logger as e } from "../../helpers/logger.mjs";
3
+ const f = async ({
4
4
  builderContextValue: n,
5
5
  symbol: r
6
6
  }) => {
@@ -8,7 +8,7 @@ const e = async ({
8
8
  (n != null && n.apiKey))
9
9
  return p({
10
10
  model: r.model,
11
- apiKey: n.apiKey,
11
+ apiKey: r.global && r.ownerId ? r.ownerId : n.apiKey,
12
12
  apiVersion: n.apiVersion,
13
13
  ...(r == null ? void 0 : r.entry) && {
14
14
  query: {
@@ -16,9 +16,9 @@ const e = async ({
16
16
  }
17
17
  }
18
18
  }).catch((c) => {
19
- i.error("Could not fetch symbol content: ", c);
19
+ e.error("Could not fetch symbol content: ", c);
20
20
  });
21
21
  };
22
22
  export {
23
- e as fetchSymbolContent
23
+ f as fetchSymbolContent
24
24
  };
@@ -1,50 +1,50 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import x from "../../components/content-variants/content-variants.mjs";
3
- import { getClassPropName as k } from "../../functions/get-class-prop-name.mjs";
4
- import { fetchSymbolContent as v } from "./symbol.helpers.mjs";
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import v from "../../components/content-variants/content-variants.mjs";
3
+ import { getClassPropName as W } from "../../functions/get-class-prop-name.mjs";
4
+ import { fetchSymbolContent as N } from "./symbol.helpers.mjs";
5
5
  async function S(t) {
6
- var o, i, l, a, c, m, r;
7
- const s = function() {
6
+ var o, l, i, a, m, c, b, r, d;
7
+ const C = function() {
8
8
  return "div";
9
- }, y = function() {
9
+ }, f = function() {
10
10
  return "div";
11
- }, C = function() {
11
+ }, x = function() {
12
12
  return Object.values(t.builderComponents);
13
- }, f = function() {
14
- var b, d;
13
+ }, k = function() {
14
+ var u, s;
15
15
  return [
16
- t.attributes[k()],
16
+ t.attributes[W()],
17
17
  "builder-symbol",
18
- (b = t.symbol) != null && b.inline ? "builder-inline-symbol" : void 0,
19
- (d = t.symbol) != null && d.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
18
+ (u = t.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
19
+ (s = t.symbol) != null && s.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
20
20
  ].filter(Boolean).join(" ");
21
- }, e = ((o = t.symbol) == null ? void 0 : o.content) || await v({
21
+ }, e = ((o = t.symbol) == null ? void 0 : o.content) || await N({
22
22
  symbol: t.symbol,
23
23
  builderContextValue: t.builderContext
24
24
  });
25
- return (i = t.symbol) == null || i.entry, /* @__PURE__ */ u("div", { ...t.attributes, className: f(), children: /* @__PURE__ */ u(
26
- x,
25
+ return (l = t.symbol) == null || l.entry, /* @__PURE__ */ y("div", { ...t.attributes, className: k(), children: /* @__PURE__ */ y(
26
+ v,
27
27
  {
28
28
  nonce: t.builderContext.nonce,
29
29
  isNestedRender: !0,
30
30
  apiVersion: t.builderContext.apiVersion,
31
- apiKey: t.builderContext.apiKey,
31
+ apiKey: (i = t.symbol) != null && i.global && ((a = t.symbol) != null && a.ownerId) ? t.symbol.ownerId : t.builderContext.apiKey,
32
32
  context: {
33
33
  ...t.builderContext.context,
34
- symbolId: (l = t.builderBlock) == null ? void 0 : l.id
34
+ symbolId: (m = t.builderBlock) == null ? void 0 : m.id
35
35
  },
36
- customComponents: C(),
36
+ customComponents: x(),
37
37
  data: {
38
- ...(a = t.symbol) == null ? void 0 : a.data,
38
+ ...(c = t.symbol) == null ? void 0 : c.data,
39
39
  ...t.builderContext.localState,
40
- ...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state
40
+ ...(b = e == null ? void 0 : e.data) == null ? void 0 : b.state
41
41
  },
42
42
  canTrack: t.builderContext.canTrack,
43
- model: (r = (m = t.symbol) == null ? void 0 : m.model) != null ? r : "",
43
+ model: (d = (r = t.symbol) == null ? void 0 : r.model) != null ? d : "",
44
44
  content: e,
45
45
  linkComponent: t.builderLinkComponent,
46
- blocksWrapper: s(),
47
- contentWrapper: y()
46
+ blocksWrapper: C(),
47
+ contentWrapper: f()
48
48
  }
49
49
  ) });
50
50
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.24.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.25.0";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.24.1";
1
+ const o = "0.25.0";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
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.24.1",
4
+ "version": "0.25.0",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -7,6 +7,8 @@ export interface SymbolInfo {
7
7
  content?: BuilderContent;
8
8
  inline?: boolean;
9
9
  dynamic?: boolean;
10
+ ownerId?: string;
11
+ global?: boolean;
10
12
  }
11
13
  export declare const fetchSymbolContent: ({ builderContextValue, symbol }: {
12
14
  symbol: SymbolInfo | undefined;
@@ -7,6 +7,8 @@ export interface SymbolInfo {
7
7
  content?: BuilderContent;
8
8
  inline?: boolean;
9
9
  dynamic?: boolean;
10
+ ownerId?: string;
11
+ global?: boolean;
10
12
  }
11
13
  export interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp {
12
14
  symbol?: SymbolInfo;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.24.1";
1
+ export declare const SDK_VERSION = "0.25.0";
@@ -7,6 +7,8 @@ export interface SymbolInfo {
7
7
  content?: BuilderContent;
8
8
  inline?: boolean;
9
9
  dynamic?: boolean;
10
+ ownerId?: string;
11
+ global?: boolean;
10
12
  }
11
13
  export declare const fetchSymbolContent: ({ builderContextValue, symbol }: {
12
14
  symbol: SymbolInfo | undefined;
@@ -7,6 +7,8 @@ export interface SymbolInfo {
7
7
  content?: BuilderContent;
8
8
  inline?: boolean;
9
9
  dynamic?: boolean;
10
+ ownerId?: string;
11
+ global?: boolean;
10
12
  }
11
13
  export interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp {
12
14
  symbol?: SymbolInfo;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.24.1";
1
+ export declare const SDK_VERSION = "0.25.0";