@builder.io/sdk-react-nextjs 0.16.12 → 0.16.14

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 (105) hide show
  1. package/lib/browser/blocks/columns/columns.cjs +2 -2
  2. package/lib/browser/blocks/columns/columns.mjs +2 -2
  3. package/lib/browser/blocks/image/image.cjs +4 -4
  4. package/lib/browser/blocks/image/image.mjs +25 -25
  5. package/lib/browser/components/awaiter.cjs +1 -0
  6. package/lib/browser/components/awaiter.mjs +10 -0
  7. package/lib/browser/components/block/components/interactive-element.cjs +1 -1
  8. package/lib/browser/components/block/components/interactive-element.mjs +19 -9
  9. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  10. package/lib/browser/components/blocks/blocks-wrapper.mjs +5 -5
  11. package/lib/browser/components/content/components/enable-editor.cjs +1 -1
  12. package/lib/browser/components/content/components/enable-editor.mjs +114 -139
  13. package/lib/browser/components/content/content.cjs +1 -1
  14. package/lib/browser/components/content/content.mjs +62 -43
  15. package/lib/browser/constants/sdk-version.cjs +1 -1
  16. package/lib/browser/constants/sdk-version.mjs +1 -1
  17. package/lib/browser/functions/evaluate/browser-runtime/browser.cjs +1 -1
  18. package/lib/browser/functions/evaluate/browser-runtime/browser.mjs +19 -45
  19. package/lib/browser/functions/evaluate/choose-eval.cjs +1 -1
  20. package/lib/browser/functions/evaluate/choose-eval.mjs +5 -3
  21. package/lib/browser/functions/evaluate/helpers.cjs +1 -1
  22. package/lib/browser/functions/evaluate/helpers.mjs +50 -24
  23. package/lib/browser/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
  24. package/lib/browser/functions/evaluate/node-runtime/node-runtime.mjs +7 -7
  25. package/lib/browser/functions/evaluate/should-force-browser-runtime-in-node.cjs +1 -1
  26. package/lib/browser/functions/evaluate/should-force-browser-runtime-in-node.mjs +8 -6
  27. package/lib/browser/init.cjs +1 -1
  28. package/lib/browser/init.mjs +11 -6
  29. package/lib/edge/blocks/columns/columns.cjs +2 -2
  30. package/lib/edge/blocks/columns/columns.mjs +2 -2
  31. package/lib/edge/blocks/image/image.cjs +4 -4
  32. package/lib/edge/blocks/image/image.mjs +25 -25
  33. package/lib/edge/components/awaiter.cjs +1 -0
  34. package/lib/edge/components/awaiter.mjs +10 -0
  35. package/lib/edge/components/block/components/interactive-element.cjs +1 -1
  36. package/lib/edge/components/block/components/interactive-element.mjs +19 -9
  37. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  38. package/lib/edge/components/blocks/blocks-wrapper.mjs +5 -5
  39. package/lib/edge/components/content/components/enable-editor.cjs +1 -1
  40. package/lib/edge/components/content/components/enable-editor.mjs +114 -139
  41. package/lib/edge/components/content/content.cjs +1 -1
  42. package/lib/edge/components/content/content.mjs +62 -43
  43. package/lib/edge/constants/builder-registered-components.cjs +1 -1
  44. package/lib/edge/constants/builder-registered-components.mjs +1 -1
  45. package/lib/edge/constants/extra-components.cjs +1 -1
  46. package/lib/edge/constants/extra-components.mjs +1 -1
  47. package/lib/edge/constants/sdk-version.cjs +1 -1
  48. package/lib/edge/constants/sdk-version.mjs +1 -1
  49. package/lib/edge/functions/evaluate/browser-runtime/browser.cjs +1 -1
  50. package/lib/edge/functions/evaluate/browser-runtime/browser.mjs +19 -45
  51. package/lib/edge/functions/evaluate/choose-eval.cjs +1 -1
  52. package/lib/edge/functions/evaluate/choose-eval.mjs +4 -2
  53. package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.cjs +8 -10
  54. package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.mjs +70 -53
  55. package/lib/edge/functions/evaluate/helpers.cjs +1 -1
  56. package/lib/edge/functions/evaluate/helpers.mjs +50 -24
  57. package/lib/edge/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
  58. package/lib/edge/functions/evaluate/node-runtime/node-runtime.mjs +7 -7
  59. package/lib/edge/functions/evaluate/should-force-browser-runtime-in-node.cjs +1 -1
  60. package/lib/edge/functions/evaluate/should-force-browser-runtime-in-node.mjs +8 -6
  61. package/lib/edge/init.cjs +1 -1
  62. package/lib/edge/init.mjs +11 -6
  63. package/lib/node/blocks/columns/columns.cjs +2 -2
  64. package/lib/node/blocks/columns/columns.mjs +2 -2
  65. package/lib/node/blocks/image/image.cjs +4 -4
  66. package/lib/node/blocks/image/image.mjs +25 -25
  67. package/lib/node/components/awaiter.cjs +1 -0
  68. package/lib/node/components/awaiter.mjs +10 -0
  69. package/lib/node/components/block/components/interactive-element.cjs +1 -1
  70. package/lib/node/components/block/components/interactive-element.mjs +19 -9
  71. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  72. package/lib/node/components/blocks/blocks-wrapper.mjs +5 -5
  73. package/lib/node/components/content/components/enable-editor.cjs +1 -1
  74. package/lib/node/components/content/components/enable-editor.mjs +114 -139
  75. package/lib/node/components/content/content.cjs +1 -1
  76. package/lib/node/components/content/content.mjs +62 -43
  77. package/lib/node/constants/sdk-version.cjs +1 -1
  78. package/lib/node/constants/sdk-version.mjs +1 -1
  79. package/lib/node/functions/evaluate/browser-runtime/browser.cjs +1 -1
  80. package/lib/node/functions/evaluate/browser-runtime/browser.mjs +19 -45
  81. package/lib/node/functions/evaluate/choose-eval.cjs +1 -1
  82. package/lib/node/functions/evaluate/choose-eval.mjs +4 -2
  83. package/lib/node/functions/evaluate/helpers.cjs +1 -1
  84. package/lib/node/functions/evaluate/helpers.mjs +50 -24
  85. package/lib/node/functions/evaluate/node-runtime/node-runtime.cjs +9 -9
  86. package/lib/node/functions/evaluate/node-runtime/node-runtime.mjs +26 -26
  87. package/lib/node/functions/evaluate/should-force-browser-runtime-in-node.cjs +1 -1
  88. package/lib/node/functions/evaluate/should-force-browser-runtime-in-node.mjs +8 -6
  89. package/lib/node/init.cjs +1 -1
  90. package/lib/node/init.mjs +11 -6
  91. package/package.json +1 -1
  92. package/types/cjs/components/awaiter.d.ts +14 -0
  93. package/types/cjs/constants/sdk-version.d.ts +1 -1
  94. package/types/cjs/context/component-reference-types.d.ts +4 -0
  95. package/types/cjs/context/types.d.ts +2 -1
  96. package/types/cjs/functions/evaluate/browser-runtime/browser.d.ts +0 -6
  97. package/types/cjs/functions/evaluate/helpers.d.ts +5 -0
  98. package/types/cjs/functions/evaluate/should-force-browser-runtime-in-node.d.ts +3 -1
  99. package/types/esm/components/awaiter.d.ts +14 -0
  100. package/types/esm/constants/sdk-version.d.ts +1 -1
  101. package/types/esm/context/component-reference-types.d.ts +4 -0
  102. package/types/esm/context/types.d.ts +2 -1
  103. package/types/esm/functions/evaluate/browser-runtime/browser.d.ts +0 -6
  104. package/types/esm/functions/evaluate/helpers.d.ts +5 -0
  105. package/types/esm/functions/evaluate/should-force-browser-runtime-in-node.d.ts +3 -1
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),B=require("../../functions/get-class-prop-name.cjs"),z=require("../../functions/get-style.cjs"),N=require("./helpers.cjs");function A(e){var g,k;const a=typeof e.space=="number"?e.space||0:20,r=e.columns||[],u=e.stackColumnsAt||"tablet",y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var n;return((n=r[t])==null?void 0:n.width)||100/r.length},x=function(t){const n=S(t),l=a*(r.length-1)*(n/100);return`calc(${n}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:n}){return u==="tablet"?t:n},d=function({stackedStyle:t,desktopStyle:n}){return u==="never"?n:t},m=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",C=function(){return{"--flex-dir":m,"--flex-dir-tablet":c({stackedStyle:m,desktopStyle:"row"})}},v=function(t){const n=t===0?0:a,l=x(t),s=`${n}px`,h="100%",f=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:s,"--column-width-mobile":d({stackedStyle:h,desktopStyle:l}),"--column-margin-left-mobile":d({stackedStyle:f,desktopStyle:s}),"--column-width-tablet":c({stackedStyle:h,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:f,desktopStyle:s})}},b=function(t){var l,s;return q.getSizesForBreakpoints(((s=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:s.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
1
+ "use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),B=require("../../functions/get-class-prop-name.cjs"),z=require("../../functions/get-style.cjs"),N=require("./helpers.cjs");function A(e){var g,k;const a=typeof e.space=="number"?e.space||0:20,r=e.columns||[],u=e.stackColumnsAt||"tablet",y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var n;return((n=r[t])==null?void 0:n.width)||100/r.length},x=function(t){const n=S(t),l=a*(r.length-1)*(n/100);return`calc(${n}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:n}){return u==="tablet"?t:n},m=function({stackedStyle:t,desktopStyle:n}){return u==="never"?n:t},d=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",C=function(){return{"--flex-dir":d,"--flex-dir-tablet":c({stackedStyle:d,desktopStyle:"row"})}},v=function(t){const n=t===0?0:a,l=x(t),s=`${n}px`,h="100%",f=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:s,"--column-width-mobile":m({stackedStyle:h,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:f,desktopStyle:s}),"--column-width-tablet":c({stackedStyle:h,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:f,desktopStyle:s})}},b=function(t){var l,s;return q.getSizesForBreakpoints(((s=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:s.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
2
2
  @media (max-width: ${b("medium")}px) {
3
3
  .${e.builderBlock.id}-breakpoints {
4
4
  flex-direction: var(--flex-dir-tablet);
@@ -22,7 +22,7 @@
22
22
  margin-left: var(--column-margin-left-mobile) !important;
23
23
  }
24
24
  },
25
- `},$=function(t,n){return{...t.link?{href:t.link}:{},[B.getClassPropName()]:"builder-column",style:z.mapStyleObjToStrIfNeeded(v(n))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:N.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-2cd13691",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(k=e.columns)==null?void 0:k.map((i,t)=>o.jsx(W,{TagName:y(i),actionAttributes:{},attributes:$(i,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:i.blocks})},t))]}),o.jsx("style",{children:`.div-2cd13691 {
25
+ `},$=function(t,n){return{...t.link?{href:t.link}:{},[B.getClassPropName()]:"builder-column",style:z.mapStyleObjToStrIfNeeded(v(n))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:N.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-153273e4",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(k=e.columns)==null?void 0:k.map((i,t)=>o.jsx(W,{TagName:y(i),actionAttributes:{},attributes:$(i,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:i.blocks})},t))]}),o.jsx("style",{children:`.div-153273e4 {
26
26
  display: flex;
27
27
  line-height: normal;
28
28
  }`})]})}module.exports=A;
@@ -106,7 +106,7 @@ function q(e) {
106
106
  /* @__PURE__ */ y(
107
107
  "div",
108
108
  {
109
- className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-2cd13691",
109
+ className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-153273e4",
110
110
  style: p(),
111
111
  children: [
112
112
  /* @__PURE__ */ r(
@@ -143,7 +143,7 @@ function q(e) {
143
143
  ]
144
144
  }
145
145
  ),
146
- /* @__PURE__ */ r("style", { children: `.div-2cd13691 {
146
+ /* @__PURE__ */ r("style", { children: `.div-153273e4 {
147
147
  display: flex;
148
148
  line-height: normal;
149
149
  }` })
@@ -1,11 +1,11 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),f=require("react"),l=require("./image.helpers.cjs");function b(e){var s,r,d,u,o,g;function n(){var h;const i=e.image||e.src;if(!i||!(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/)))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),l.getSrcSet(i)}else if(e.image&&!e.srcset)return l.getSrcSet(i);return l.getSrcSet(i)}}function a(){var c;return(c=n==null?void 0:n())!=null&&c.match(/builder\.io/)&&!e.noWebp?n().replace(/\?/g,"?format=webp&"):""}function m(){const c={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?c:void 0}return f.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[a()?t.jsx("source",{type:"image/webp",srcSet:a()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-2d6925f2",src:e.image,srcSet:n(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-2d6925f2",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(u=(d=e.builderBlock)==null?void 0:d.children)!=null&&u.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(o=e.builderBlock)==null?void 0:o.children)!=null&&g.length)?t.jsx("div",{className:"div-2d6925f2-2",children:e.children}):null]}),t.jsx("style",{children:`.img-2d6925f2 {
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),b=require("react"),c=require("./image.helpers.cjs");function f(e){var s,r,u,o,d,g;function n(){var h;const i=e.image||e.src;if(!i||!(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/)))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(i)}else if(e.image&&!e.srcset)return c.getSrcSet(i);return c.getSrcSet(i)}}function l(){var a;return(a=n==null?void 0:n())!=null&&a.match(/builder\.io/)&&!e.noWebp?n().replace(/\?/g,"?format=webp&"):""}function m(){const a={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?a:void 0}return b.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[l()?t.jsx("source",{type:"image/webp",srcSet:l()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-7a292ab8",src:e.image,srcSet:n(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-7a292ab8",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(o=(u=e.builderBlock)==null?void 0:u.children)!=null&&o.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(d=e.builderBlock)==null?void 0:d.children)!=null&&g.length)?t.jsx("div",{className:"div-7a292ab8-2",children:e.children}):null]}),t.jsx("style",{children:`.img-7a292ab8 {
2
2
  opacity: 1;
3
3
  transition: opacity 0.2s ease-in-out;
4
- }.div-2d6925f2 {
4
+ }.div-7a292ab8 {
5
5
  width: 100%;
6
6
  pointer-events: none;
7
7
  font-size: 0;
8
- }.div-2d6925f2-2 {
8
+ }.div-7a292ab8-2 {
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  align-items: stretch;
@@ -14,4 +14,4 @@
14
14
  left: 0;
15
15
  width: 100%;
16
16
  height: 100%;
17
- }`})]})}module.exports=b;
17
+ }`})]})}module.exports=f;
@@ -1,44 +1,44 @@
1
1
  "use client";
2
- import { jsxs as l, Fragment as a, jsx as t } from "react/jsx-runtime";
2
+ import { jsxs as c, Fragment as l, jsx as t } from "react/jsx-runtime";
3
3
  import { useEffect as v } from "react";
4
- import { getSrcSet as d } from "./image.helpers.mjs";
4
+ import { getSrcSet as o } from "./image.helpers.mjs";
5
5
  function w(e) {
6
- var r, u, s, m, g, f;
6
+ var d, u, s, m, g, h;
7
7
  function n() {
8
- var h;
8
+ var f;
9
9
  const i = e.image || e.src;
10
10
  if (!i || // We can auto add srcset for cdn.builder.io and shopify
11
11
  // images, otherwise you can supply this prop manually
12
12
  !(i.match(/builder\.io/) || i.match(/cdn\.shopify\.com/)))
13
13
  return e.srcset;
14
14
  if (!e.noWebp) {
15
- if (e.srcset && ((h = e.image) != null && h.includes("builder.io/api/v1/image"))) {
15
+ if (e.srcset && ((f = e.image) != null && f.includes("builder.io/api/v1/image"))) {
16
16
  if (!e.srcset.includes(e.image.split("?")[0]))
17
- return console.debug("Removed given srcset"), d(i);
17
+ return console.debug("Removed given srcset"), o(i);
18
18
  } else if (e.image && !e.srcset)
19
- return d(i);
20
- return d(i);
19
+ return o(i);
20
+ return o(i);
21
21
  }
22
22
  }
23
- function o() {
24
- var c;
25
- return (c = n == null ? void 0 : n()) != null && c.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
23
+ function r() {
24
+ var a;
25
+ return (a = n == null ? void 0 : n()) != null && a.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
26
26
  }
27
27
  function b() {
28
- const c = {
28
+ const a = {
29
29
  position: "absolute",
30
30
  height: "100%",
31
31
  width: "100%",
32
32
  left: "0px",
33
33
  top: "0px"
34
34
  };
35
- return e.aspectRatio ? c : void 0;
35
+ return e.aspectRatio ? a : void 0;
36
36
  }
37
37
  return v(() => {
38
- }, []), /* @__PURE__ */ l(a, { children: [
39
- /* @__PURE__ */ l(a, { children: [
40
- /* @__PURE__ */ l("picture", { children: [
41
- o() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: o() }) : null,
38
+ }, []), /* @__PURE__ */ c(l, { children: [
39
+ /* @__PURE__ */ c(l, { children: [
40
+ /* @__PURE__ */ c("picture", { children: [
41
+ r() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: r() }) : null,
42
42
  /* @__PURE__ */ t(
43
43
  "img",
44
44
  {
@@ -51,33 +51,33 @@ function w(e) {
51
51
  objectFit: e.backgroundSize || "cover",
52
52
  ...b()
53
53
  },
54
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-2d6925f2",
54
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-7a292ab8",
55
55
  src: e.image,
56
56
  srcSet: n(),
57
57
  sizes: e.sizes
58
58
  }
59
59
  )
60
60
  ] }),
61
- e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
61
+ e.aspectRatio && !((u = (d = e.builderBlock) == null ? void 0 : d.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
62
62
  "div",
63
63
  {
64
- className: "builder-image-sizer div-2d6925f2",
64
+ className: "builder-image-sizer div-7a292ab8",
65
65
  style: {
66
66
  paddingTop: e.aspectRatio * 100 + "%"
67
67
  }
68
68
  }
69
69
  ) : null,
70
- (m = (s = e.builderBlock) == null ? void 0 : s.children) != null && m.length && e.fitContent ? /* @__PURE__ */ t(a, { children: e.children }) : null,
71
- !e.fitContent && ((f = (g = e.builderBlock) == null ? void 0 : g.children) != null && f.length) ? /* @__PURE__ */ t("div", { className: "div-2d6925f2-2", children: e.children }) : null
70
+ (m = (s = e.builderBlock) == null ? void 0 : s.children) != null && m.length && e.fitContent ? /* @__PURE__ */ t(l, { children: e.children }) : null,
71
+ !e.fitContent && ((h = (g = e.builderBlock) == null ? void 0 : g.children) != null && h.length) ? /* @__PURE__ */ t("div", { className: "div-7a292ab8-2", children: e.children }) : null
72
72
  ] }),
73
- /* @__PURE__ */ t("style", { children: `.img-2d6925f2 {
73
+ /* @__PURE__ */ t("style", { children: `.img-7a292ab8 {
74
74
  opacity: 1;
75
75
  transition: opacity 0.2s ease-in-out;
76
- }.div-2d6925f2 {
76
+ }.div-7a292ab8 {
77
77
  width: 100%;
78
78
  pointer-events: none;
79
79
  font-size: 0;
80
- }.div-2d6925f2-2 {
80
+ }.div-7a292ab8-2 {
81
81
  display: flex;
82
82
  flex-direction: column;
83
83
  align-items: stretch;
@@ -0,0 +1 @@
1
+ "use client";"use strict";const e=require("react/jsx-runtime"),t=require("react");function n(r){return t.useEffect(()=>{},[]),e.jsx(e.Fragment,{children:r.children})}module.exports=n;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsx as r, Fragment as t } from "react/jsx-runtime";
3
+ import { useEffect as i } from "react";
4
+ function o(e) {
5
+ return i(() => {
6
+ }, []), /* @__PURE__ */ r(t, { children: e.children });
7
+ }
8
+ export {
9
+ o as default
10
+ };
@@ -1 +1 @@
1
- "use client";"use strict";const c=require("react/jsx-runtime"),o=require("../../../functions/get-block-actions.cjs"),n=require("../../../functions/get-block-properties.cjs");function r(t){function e(){return t.includeBlockProps?{...n.getBlockProperties({block:t.block,context:t.context}),...o.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}return c.jsx(t.Wrapper,{...t.wrapperProps,attributes:e(),children:t.children})}module.exports=r;
1
+ "use client";"use strict";const e=require("react/jsx-runtime"),r=require("../../../functions/get-block-actions.cjs"),n=require("../../../functions/get-block-properties.cjs"),o=require("../../awaiter.cjs");function a(t){function c(){return t.includeBlockProps?{...n.getBlockProperties({block:t.block,context:t.context}),...r.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}return e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(o,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:c(),children:t.children})}):e.jsx(t.Wrapper,{...t.wrapperProps,attributes:c(),children:t.children})})}module.exports=a;
@@ -1,15 +1,16 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { getBlockActions as c } from "../../../functions/get-block-actions.mjs";
4
- import { getBlockProperties as n } from "../../../functions/get-block-properties.mjs";
5
- function i(t) {
6
- function e() {
2
+ import { jsx as e, Fragment as c } from "react/jsx-runtime";
3
+ import { getBlockActions as o } from "../../../functions/get-block-actions.mjs";
4
+ import { getBlockProperties as a } from "../../../functions/get-block-properties.mjs";
5
+ import l from "../../awaiter.mjs";
6
+ function u(t) {
7
+ function r() {
7
8
  return t.includeBlockProps ? {
8
- ...n({
9
+ ...a({
9
10
  block: t.block,
10
11
  context: t.context
11
12
  }),
12
- ...c({
13
+ ...o({
13
14
  block: t.block,
14
15
  rootState: t.context.rootState,
15
16
  rootSetState: t.context.rootSetState,
@@ -18,8 +19,17 @@ function i(t) {
18
19
  })
19
20
  } : {};
20
21
  }
21
- return /* @__PURE__ */ o(t.Wrapper, { ...t.wrapperProps, attributes: e(), children: t.children });
22
+ return /* @__PURE__ */ e(c, { children: t.Wrapper.load ? /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
23
+ l,
24
+ {
25
+ load: t.Wrapper.load,
26
+ fallback: t.Wrapper.fallback,
27
+ props: t.wrapperProps,
28
+ attributes: r(),
29
+ children: t.children
30
+ }
31
+ ) }) : /* @__PURE__ */ e(t.Wrapper, { ...t.wrapperProps, attributes: r(), children: t.children }) });
22
32
  }
23
33
  export {
24
- i as default
34
+ u as default
25
35
  };
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const l=require("react/jsx-runtime"),s=require("react"),i=require("../../functions/is-editing.cjs");function d(e){const a=s.useRef(null);function c(){var t;return"builder-blocks"+((t=e.blocks)!=null&&t.length?"":" no-blocks")}function r(){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 s.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:a,className:c()+" props-blocks-wrapper-51ef31b4","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>r(),onMouseEnter:t=>o(),onKeyPress:t=>r(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-51ef31b4 {
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 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsxs as o, Fragment as d, jsx as r } from "react/jsx-runtime";
3
- import { useRef as f, useEffect as u } from "react";
3
+ import { useRef as u, useEffect as f } from "react";
4
4
  import { isEditing as a } from "../../functions/is-editing.mjs";
5
5
  function h(e) {
6
- const c = f(null);
6
+ const c = u(null);
7
7
  function i() {
8
8
  var t;
9
9
  return "builder-blocks" + ((t = e.blocks) != null && t.length ? "" : " no-blocks");
@@ -34,13 +34,13 @@ function h(e) {
34
34
  "*"
35
35
  ));
36
36
  }
37
- return u(() => {
37
+ return f(() => {
38
38
  }, []), /* @__PURE__ */ o(d, { children: [
39
39
  /* @__PURE__ */ r(
40
40
  e.BlocksWrapper,
41
41
  {
42
42
  ref: c,
43
- className: i() + " props-blocks-wrapper-51ef31b4",
43
+ className: i() + " props-blocks-wrapper-77bdc7c6",
44
44
  "builder-path": e.path,
45
45
  "builder-parent-id": e.parent,
46
46
  style: e.styleProp,
@@ -51,7 +51,7 @@ function h(e) {
51
51
  children: e.children
52
52
  }
53
53
  ),
54
- /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-51ef31b4 {
54
+ /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-77bdc7c6 {
55
55
  display: flex;
56
56
  flex-direction: column;
57
57
  align-items: stretch;
@@ -1 +1 @@
1
- "use client";"use strict";const L=require("react/jsx-runtime"),o=require("react"),U=require("../../../context/builder.context.cjs"),T=require("../../../functions/evaluate/evaluate.cjs"),F=require("../../../functions/fast-clone.cjs"),O=require("../../../functions/get-content/index.cjs"),$=require("../../../functions/get-fetch.cjs"),j=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),J=require("../../../functions/is-previewing.cjs"),z=require("../../../functions/register-component.cjs"),H=require("../../../functions/track/index.cjs"),G=require("../../../functions/track/interaction.cjs"),_=require("../../../helpers/canTrack.cjs"),Q=require("../../../helpers/logger.cjs"),X=require("../../../helpers/preview-lru-cache/set.cjs"),Y=require("../../../helpers/subscribe-to-editor.cjs"),A=require("../../../scripts/init-editing.cjs"),Z=require("../../block/animator.cjs"),p=require("./styles.helpers.cjs"),ee=require("next/navigation");function te(e){var k,I,w,P,y,R,K;const d=o.useRef(null);function f(n){var i,a;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(a=(i=e.builderContextSignal).rootSetState)==null||a.call(i,t):e.builderContextSignal.rootState=t}function S(n){var i,a,r,c,u;const t={...e.builderContextSignal.content,...n,data:{...(i=e.builderContextSignal.content)==null?void 0:i.data,...n==null?void 0:n.data},meta:{...(a=e.builderContextSignal.content)==null?void 0:a.meta,...n==null?void 0:n.meta,breakpoints:((r=n==null?void 0:n.meta)==null?void 0:r.breakpoints)||((u=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:u.breakpoints)}};X.postPreviewContent({value:t,key:t.id}).then(()=>{B.refresh()})}function V(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[M,ne]=o.useState(()=>e.contentWrapper||"div");function m(n){return Y.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var r;const{breakpoints:i,contentId:a}=t;!a||a!==((r=e.builderContextSignal.content)==null?void 0:r.id)||i&&S({meta:{breakpoints:i}})},animation:t=>{Z.triggerAnimation(t)},contentUpdate:t=>{S(t)}}})(n)}function v(){var t,i;const n=(i=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.jsCode;n&&T.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[h,ie]=o.useState(()=>({})),[b,ae]=o.useState(()=>({})),[C,N]=o.useState(()=>!1);function W(n){var t,i;if(e.builderContextSignal.content){const a=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,r=(i=e.builderContextSignal.content)==null?void 0:i.id;H._track({type:"click",canTrack:_.getDefaultCanTrack(e.canTrack),contentId:r,apiKey:e.apiKey,variationId:a!==r?a:void 0,...G.getInteractionPropertiesForEvent(n),unique:!C})}C||N(!0)}function x(){var t,i,a;const n=(a=(i=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.httpRequests)!=null?a:{};Object.entries(n).forEach(([r,c])=>{if(!c||b[r]||h[r]&&!g.isEditing())return;b[r]=!0;const u=c.replace(/{{([^}]+)}}/g,(l,D)=>String(T.evaluate({code:D,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));$.fetch(u).then(l=>l.json()).then(l=>{f({[r]:l}),h[r]=!0}).catch(l=>{console.error("error fetching dynamic data",c,l)}).finally(()=>{b[r]=!1})})}function s(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:F.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",m),A.registerInsertMenu(),A.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var a;const i=z.createRegisterComponentMessage(t);(a=window.parent)==null||a.postMessage(i,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",s)}function q(n){const t=new URL(location.href).searchParams,i=t.get("builder.preview"),a=t.get(`builder.overrides.${i}`),r=t.get("apiKey")||t.get("builder.space");i===e.model&&r===e.apiKey&&(!e.content||a===e.content.id)&&O.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&S(c)})}const B=ee.useRouter();return o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initpreviewingbldr",q),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initpreviewingbldr",q)}},[]),o.useEffect(()=>{var n,t;if(j.isBrowser()){if(g.isEditing()&&d.current&&d.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&_.getDefaultCanTrack(e.canTrack)){const a=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,r=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;H._track({type:"impression",canTrack:!0,contentId:r,apiKey:c,variationId:a!==r?a:void 0})}J.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{e.apiKey||Q.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."),v(),x(),s()},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{v()},[(I=(k=e.builderContextSignal.content)==null?void 0:k.data)==null?void 0:I.jsCode]),o.useEffect(()=>{x()},[(P=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:P.httpRequests]),o.useEffect(()=>{s()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{j.isBrowser()&&(window.removeEventListener("message",m),window.removeEventListener("builder:component:stateChangeListenerActivated",s))},[]),L.jsx(U.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?L.jsx(M,{ref:d,onClick:n=>W(n),"builder-content-id":(y=e.builderContextSignal.content)==null?void 0:y.id,"builder-model":e.model,...V(),...e.contentWrapperProps,className:p.getWrapperClassName(((R=e.content)==null?void 0:R.testVariationId)||((K=e.content)==null?void 0:K.id)),children:e.children}):null})}module.exports=te;
1
+ "use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),W=require("../../../context/builder.context.cjs"),A=require("../../../functions/evaluate/evaluate.cjs"),B=require("../../../functions/fast-clone.cjs"),D=require("../../../functions/get-content/index.cjs"),P=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),N=require("../../../functions/is-previewing.cjs"),U=require("../../../functions/register-component.cjs"),R=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),F=require("../../../helpers/preview-lru-cache/set.cjs"),$=require("../../../helpers/subscribe-to-editor.cjs"),L=require("../../../scripts/init-editing.cjs"),z=require("../../block/animator.cjs"),G=require("./styles.helpers.cjs"),J=require("next/navigation");function Q(e){var q,w,I;const d=o.useRef(null);function f(n){var r,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(r=e.builderContextSignal).rootSetState)==null||i.call(r,t):e.builderContextSignal.rootState=t}function b(n){var r,i,a,c,u;const t={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((a=n==null?void 0:n.meta)==null?void 0:a.breakpoints)||((u=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:u.breakpoints)}};F.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function K(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[T,X]=o.useState(()=>e.contentWrapper||"div");function S(n){return $.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var a;const{breakpoints:r,contentId:i}=t;!i||i!==((a=e.builderContextSignal.content)==null?void 0:a.id)||r&&b({meta:{breakpoints:r}})},animation:t=>{z.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Y]=o.useState(()=>({})),[m,Z]=o.useState(()=>({})),[h,H]=o.useState(()=>!1);function _(n){var t,r;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,a=(r=e.builderContextSignal.content)==null?void 0:r.id;R._track({type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:a,apiKey:e.apiKey,variationId:i!==a?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||H(!0)}function j(){var t,r,i;const n=(i=(r=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:r.httpRequests)!=null?i:{};Object.entries(n).forEach(([a,c])=>{if(!c||m[a]||v[a]&&!g.isEditing())return;m[a]=!0;const u=c.replace(/{{([^}]+)}}/g,(s,M)=>String(A.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));fetch(u).then(s=>s.json()).then(s=>{f({[a]:s}),v[a]=!0}).catch(s=>{console.error("error fetching dynamic data",c,s)}).finally(()=>{m[a]=!1})})}function l(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:B.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),L.registerInsertMenu(),L.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var i;const r=U.createRegisterComponentMessage(t);(i=window.parent)==null||i.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",l)}function x(n){const t=new URL(location.href).searchParams,r=t.get("builder.preview"),i=t.get(`builder.overrides.${r}`),a=t.get("apiKey")||t.get("builder.space");r===e.model&&a===e.apiKey&&(!e.content||i===e.content.id)&&D.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&b(c)})}const V=J.useRouter(),C=o.useRef(!1);return C.current||(j(),l(),C.current=!0),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(P.isBrowser()){if(g.isEditing()&&d.current&&d.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const i=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,a=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;R._track({type:"impression",canTrack:!0,contentId:a,apiKey:c,variationId:i!==a?i:void 0})}N.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{l()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{P.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",l))},[]),k.jsx(W.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?k.jsx(T,{ref:d,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:G.getWrapperClassName(((w=e.content)==null?void 0:w.testVariationId)||((I=e.content)==null?void 0:I.id)),...K(),...e.contentWrapperProps,children:e.children}):null})}module.exports=Q;