@builder.io/sdk-react 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +31 -31
- package/lib/browser/blocks-exports.mjs +1008 -962
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-75ce8600.cjs +2 -0
- package/lib/browser/server-entry-a2495a20.js +748 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-98d9699d.cjs → accordion-1c16f65e.cjs} +1 -1
- package/lib/edge/{accordion-19141399.js → accordion-c020e15b.js} +1 -1
- package/lib/edge/blocks-27ac5b23.js +3534 -0
- package/lib/edge/blocks-cd946d16.cjs +30 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +8 -7
- package/lib/edge/{button-a335b33d.js → button-5cdb4f26.js} +2 -2
- package/lib/edge/{button-90d3b8fd.cjs → button-8572fca5.cjs} +1 -1
- package/lib/edge/{columns-34eb4f77.js → columns-3ac1fa96.js} +5 -6
- package/lib/edge/columns-c8a9cb89.cjs +28 -0
- package/lib/edge/{content-variants-eb0b71da.js → content-variants-23c8eec6.js} +348 -344
- package/lib/edge/content-variants-caa23bf7.cjs +134 -0
- package/lib/edge/form-3d9bf265.cjs +1 -0
- package/lib/edge/{form-f468b835.js → form-7fc5691b.js} +14 -15
- package/lib/edge/{get-class-prop-name-f431302d.cjs → get-class-prop-name-29fd576a.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-79a17608.js → get-class-prop-name-a4845b04.js} +1 -1
- package/lib/edge/{image-6970c193.js → image-5c9e156f.js} +28 -28
- package/lib/edge/image-94922c87.cjs +17 -0
- package/lib/edge/{img-da07f7ae.cjs → img-102acaa2.cjs} +1 -1
- package/lib/edge/{img-0d66e9e1.js → img-388698cb.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-f7f73607.cjs → input-10e350a9.cjs} +1 -1
- package/lib/edge/{input-5962ba3b.js → input-5484e9e7.js} +1 -1
- package/lib/edge/{select-74305b69.js → select-b8406bcf.js} +1 -1
- package/lib/edge/{select-1f1bb9a6.cjs → select-f11be7a7.cjs} +1 -1
- package/lib/edge/server-entry-1879cbc4.cjs +2 -0
- package/lib/edge/server-entry-7ce03a4e.js +746 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-ad2d5248.js → slot-23f75377.js} +5 -6
- package/lib/edge/slot-4ab390ec.cjs +1 -0
- package/lib/edge/{symbol-70bb59b7.js → symbol-2eafb4e0.js} +2 -2
- package/lib/edge/{symbol-5baac842.cjs → symbol-fa343d77.cjs} +1 -1
- package/lib/edge/{tabs-0244ee23.js → tabs-4c9c64f6.js} +15 -16
- package/lib/edge/tabs-7d258d82.cjs +1 -0
- package/lib/edge/text-5915f038.js +17 -0
- package/lib/edge/text-e6dbb721.cjs +1 -0
- package/lib/node/blocks-exports.cjs +29 -29
- package/lib/node/blocks-exports.mjs +903 -857
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/server-entry-2b263dde.js +749 -0
- package/lib/node/server-entry-ec330556.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-97b6edac.cjs → setIvm-1e6f0b60.cjs} +1 -1
- package/lib/node/{setIvm-bcada801.js → setIvm-7eb67cd6.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-16d6b365.cjs → should-force-browser-runtime-in-node-23218b19.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-f1c78223.js → should-force-browser-runtime-in-node-cdae9360.js} +1 -1
- package/package.json +1 -1
- package/types/components/block/block.helpers.d.ts +6 -3
- package/types/components/content/components/enable-editor.helpers.d.ts +11 -0
- package/types/constants/file-types.d.ts +2 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/types.d.ts +1 -0
- package/types/functions/extract-localized-values.d.ts +2 -0
- package/types/functions/get-block-component-options.d.ts +2 -1
- package/types/functions/get-processed-block.d.ts +1 -6
- package/types/functions/traverse.d.ts +34 -0
- package/types/helpers/flatten.d.ts +6 -0
- package/types/server-index.d.ts +1 -1
- package/types/types/components.d.ts +3 -0
- package/lib/browser/server-entry-52c69986.js +0 -717
- package/lib/browser/server-entry-f3c2ac77.cjs +0 -2
- package/lib/edge/blocks-672d29ca.cjs +0 -12
- package/lib/edge/blocks-7299cf1f.js +0 -870
- package/lib/edge/columns-96859531.cjs +0 -28
- package/lib/edge/content-variants-30e475b2.cjs +0 -134
- package/lib/edge/evaluate-0793c18a.js +0 -2612
- package/lib/edge/evaluate-84062c52.cjs +0 -19
- package/lib/edge/form-99fe0879.cjs +0 -1
- package/lib/edge/image-54d2f755.cjs +0 -17
- package/lib/edge/server-entry-4f813956.cjs +0 -2
- package/lib/edge/server-entry-c793e7d2.js +0 -715
- package/lib/edge/slot-0add1d03.cjs +0 -1
- package/lib/edge/tabs-a4146223.cjs +0 -1
- package/lib/edge/text-214ed248.cjs +0 -1
- package/lib/edge/text-2e3cf22b.js +0 -37
- package/lib/node/server-entry-60acf7c6.js +0 -718
- package/lib/node/server-entry-e3ec26c9.cjs +0 -2
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("./blocks-672d29ca.cjs"),j=require("./dynamic-renderer-b29b45ca.cjs"),q=require("./get-class-prop-name-f431302d.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-4f813956.cjs");require("./evaluate-84062c52.cjs");const B=t=>`builder-columns ${t}-breakpoints`;function p(t){var f,k;function a(){return typeof t.space=="number"?t.space||0:20}function s(){return t.columns||[]}function u(){return t.stackColumnsAt||"tablet"}function y(e){return e.link?t.builderLinkComponent||"a":"div"}function x(e){var n;return((n=s()[e])==null?void 0:n.width)||100/s().length}function S(e){const n=x(e),i=a()*(s().length-1)*(n/100);return`calc(${n}% - ${i}px)`}function c({stackedStyle:e,desktopStyle:n}){return u()==="tablet"?e:n}function d({stackedStyle:e,desktopStyle:n}){return u()==="never"?n:e}function m(){return t.stackColumnsAt==="never"?"row":t.reverseColumnsWhenStacked?"column-reverse":"column"}function C(){return{"--flex-dir":m(),"--flex-dir-tablet":c({stackedStyle:m(),desktopStyle:"row"})}}function v(e){const n=e===0?0:a(),i=S(e),r=`${n}px`,g="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:i,["marginLeft"]:r,"--column-width-mobile":d({stackedStyle:g,desktopStyle:i}),"--column-margin-left-mobile":d({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:g,desktopStyle:i}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}}function b(e){var i,r;return o.getSizesForBreakpoints(((r=(i=t.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[e].max}function w(){const e=`.${t.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
2
|
-
@media (max-width: ${b("medium")}px) {
|
|
3
|
-
.${t.builderBlock.id}-breakpoints {
|
|
4
|
-
flex-direction: var(--flex-dir-tablet);
|
|
5
|
-
align-items: stretch;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
${e} {
|
|
9
|
-
width: var(--column-width-tablet) !important;
|
|
10
|
-
margin-left: var(--column-margin-left-tablet) !important;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@media (max-width: ${b("small")}px) {
|
|
15
|
-
.${t.builderBlock.id}-breakpoints {
|
|
16
|
-
flex-direction: var(--flex-dir);
|
|
17
|
-
align-items: stretch;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
${e} {
|
|
21
|
-
width: var(--column-width-mobile) !important;
|
|
22
|
-
margin-left: var(--column-margin-left-mobile) !important;
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
`}function $(e,n){return{...e.link?{href:e.link}:{},[q.getClassPropName()]:"builder-column",style:o.mapStyleObjToStrIfNeeded(v(n))}}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:B((f=t.builderBlock)==null?void 0:f.id)+" div-49f40bae",style:C(),children:[l.jsx(o.InlinedStyles,{id:"builderio-columns",styles:w(),nonce:t.builderContext.nonce}),(k=t.columns)==null?void 0:k.map((e,n)=>l.jsx(j.DynamicRenderer,{TagName:y(e),actionAttributes:{},attributes:$(e,n),children:l.jsx(o.Blocks,{path:`columns.${n}.blocks`,parent:t.builderBlock.id,styleProp:{flexGrow:"1"},context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent,blocks:e.blocks})},n))]}),l.jsx("style",{children:`.div-49f40bae {
|
|
26
|
-
display: flex;
|
|
27
|
-
line-height: normal;
|
|
28
|
-
}`})]})}exports.default=p;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),r=require("react"),s=require("./server-entry-4f813956.cjs"),k=require("./blocks-exports.cjs"),R=require("./blocks-672d29ca.cjs"),K=require("./evaluate-84062c52.cjs");require("./get-class-prop-name-f431302d.cjs");require("./dynamic-renderer-b29b45ca.cjs");const q={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},D={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},Y={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[q]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[D]}],defaultValue:[{title:[q],detail:[D]},{title:[q],detail:[D]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},G=r.lazy(()=>Promise.resolve().then(()=>require("./accordion-98d9699d.cjs"))),Q={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0,shouldReceiveBuilderProps:{builderLinkComponent:!0}},X={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(c=>c.get("width"))&&(n.find(g=>!g.get("width"))||n.reduce((o,f)=>o+f.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Z={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ee={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg","webp"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(a,o=6e4){return new Promise((f,T)=>{const v=document.createElement("img");let V=!1;v.onload=()=>{V=!0,f(v)},v.addEventListener("error",I=>{console.warn("Image load failed",I.error),T(I.error)}),v.src=a,setTimeout(()=>{V||T(new Error("Image load timed out"))},o)})}function i(a){return Math.round(a*1e3)/1e3}const c=e.get("image"),g=e.get("aspectRatio");if(fetch(c).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),c&&(!g||g===.7041))return n(c).then(a=>{const o=e.get("aspectRatio");e.get("image")===c&&(!o||o===.7041)&&a.width&&a.height&&(e.set("aspectRatio",i(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}],shouldReceiveBuilderProps:{builderBlock:!0}},te={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},ne={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}},ae=r.lazy(()=>Promise.resolve().then(()=>require("./slot-0add1d03.cjs"))),ie={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},H={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},j={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},oe={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[H]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[j]}],defaultValue:[{label:[{...H,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...j,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...H,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...j,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},re=r.lazy(()=>Promise.resolve().then(()=>require("./tabs-a4146223.cjs"))),le={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}},se={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},de=r.lazy(()=>Promise.resolve().then(()=>require("./custom-code-6d9730ff.cjs"))),ue={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},ce=r.lazy(()=>Promise.resolve().then(()=>require("./embed-32bdd007.cjs"))),me={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},pe=r.lazy(()=>Promise.resolve().then(()=>require("./form-99fe0879.cjs"))),ge={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}},fe=r.lazy(()=>Promise.resolve().then(()=>require("./input-f7f73607.cjs"))),he={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0},be=r.lazy(()=>Promise.resolve().then(()=>require("./select-1f1bb9a6.cjs"))),ye={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0},xe=r.lazy(()=>Promise.resolve().then(()=>require("./submit-button-b363e0ed.cjs"))),ve={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0},Se=r.lazy(()=>Promise.resolve().then(()=>require("./textarea-56a875bc.cjs"))),Te={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0},ke=r.lazy(()=>Promise.resolve().then(()=>require("./img-da07f7ae.cjs"))),Ie={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}},Ce=()=>[{component:de,...se},{component:ce,...ue},{component:pe,...me},{component:fe,...ge},{component:xe,...ye},{component:be,...he},{component:Se,...ve},{component:ke,...Te},{component:k.Video,...Ie}],L=()=>[{component:k.Button,...Q},{component:k.Columns,...X},{component:k.Fragment,...Z},{component:k.Image,...ee},{component:k.Section,...te},{component:ae,...ne},{component:k.Symbol,...ie},{component:k.Text,...le},{component:re,...oe},{component:G,...Y},...Ce()],we=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
2
|
-
function getAndSetVariantId() {
|
|
3
|
-
function setCookie(name, value, days) {
|
|
4
|
-
let expires = '';
|
|
5
|
-
if (days) {
|
|
6
|
-
const date = new Date();
|
|
7
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
8
|
-
expires = '; expires=' + date.toUTCString();
|
|
9
|
-
}
|
|
10
|
-
document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
|
|
11
|
-
}
|
|
12
|
-
function getCookie(name) {
|
|
13
|
-
const nameEQ = name + '=';
|
|
14
|
-
const ca = document.cookie.split(';');
|
|
15
|
-
for (let i = 0; i < ca.length; i++) {
|
|
16
|
-
let c = ca[i];
|
|
17
|
-
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
18
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const cookieName = \`builder.tests.\${contentId}\`;
|
|
23
|
-
const variantInCookie = getCookie(cookieName);
|
|
24
|
-
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
25
|
-
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
26
|
-
return variantInCookie;
|
|
27
|
-
}
|
|
28
|
-
let n = 0;
|
|
29
|
-
const random = Math.random();
|
|
30
|
-
for (let i = 0; i < variants.length; i++) {
|
|
31
|
-
const variant = variants[i];
|
|
32
|
-
const testRatio = variant.testRatio;
|
|
33
|
-
n += testRatio;
|
|
34
|
-
if (random < n) {
|
|
35
|
-
setCookie(cookieName, variant.id);
|
|
36
|
-
return variant.id;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
setCookie(cookieName, contentId);
|
|
40
|
-
return contentId;
|
|
41
|
-
}
|
|
42
|
-
const winningVariantId = getAndSetVariantId();
|
|
43
|
-
const styleEl = document.currentScript?.previousElementSibling;
|
|
44
|
-
if (isHydrationTarget) {
|
|
45
|
-
styleEl.remove();
|
|
46
|
-
const thisScriptEl = document.currentScript;
|
|
47
|
-
thisScriptEl?.remove();
|
|
48
|
-
} else {
|
|
49
|
-
const newStyleStr = variants.concat({
|
|
50
|
-
id: contentId
|
|
51
|
-
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
52
|
-
return \`.variant-\${value.id} { display: none; }
|
|
53
|
-
\`;
|
|
54
|
-
}).join('');
|
|
55
|
-
styleEl.innerHTML = newStyleStr;
|
|
56
|
-
}
|
|
57
|
-
}`,Ve=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
58
|
-
if (!navigator.cookieEnabled) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
function getCookie(name) {
|
|
62
|
-
const nameEQ = name + '=';
|
|
63
|
-
const ca = document.cookie.split(';');
|
|
64
|
-
for (let i = 0; i < ca.length; i++) {
|
|
65
|
-
let c = ca[i];
|
|
66
|
-
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
67
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
68
|
-
}
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
const cookieName = \`builder.tests.\${defaultContentId}\`;
|
|
72
|
-
const winningVariant = getCookie(cookieName);
|
|
73
|
-
const parentDiv = document.currentScript?.parentElement;
|
|
74
|
-
const isDefaultContent = variantContentId === defaultContentId;
|
|
75
|
-
const isWinningVariant = winningVariant === variantContentId;
|
|
76
|
-
if (isWinningVariant && !isDefaultContent) {
|
|
77
|
-
parentDiv?.removeAttribute('hidden');
|
|
78
|
-
parentDiv?.removeAttribute('aria-hidden');
|
|
79
|
-
} else if (!isWinningVariant && isDefaultContent) {
|
|
80
|
-
parentDiv?.setAttribute('hidden', 'true');
|
|
81
|
-
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
82
|
-
}
|
|
83
|
-
if (isHydrationTarget) {
|
|
84
|
-
if (!isWinningVariant) {
|
|
85
|
-
parentDiv?.remove();
|
|
86
|
-
}
|
|
87
|
-
const thisScriptEl = document.currentScript;
|
|
88
|
-
thisScriptEl?.remove();
|
|
89
|
-
}
|
|
90
|
-
return;
|
|
91
|
-
}`,M="builderIoAbTest",O="builderIoRenderContent",B=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Re=({canTrack:e,content:t})=>!(!(B(t).length>0)||!e||s.isBrowser()),Ee=e=>e==="react"||e==="reactNative",_=Ee(s.TARGET),Fe=()=>`
|
|
92
|
-
window.${M} = ${we}
|
|
93
|
-
window.${O} = ${Ve}
|
|
94
|
-
`,Pe=(e,t)=>`
|
|
95
|
-
window.${M}(
|
|
96
|
-
"${t}",${JSON.stringify(e)}, ${_}
|
|
97
|
-
)`,We=({contentId:e,variationId:t})=>`window.${O}(
|
|
98
|
-
"${t}", "${e}", ${_}
|
|
99
|
-
)`;function U(e){return h.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function N(e){return Math.round(e*1e3)/1e3}const Ae=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},Be=e=>Ae(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),$=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,c=e.clientY-n.top,g=N(i/n.width),a=N(c/n.height);return{x:g,y:a}},qe=e=>{const t=e.target,n=t&&Be(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?$({event:e,target:t}):void 0,builderTargetOffset:n?$({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}},De=e=>{var g,a;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(a=e.fileUrl)!=null?a:(g=e==null?void 0:e.files)==null?void 0:g.regular;let c="";if(i&&t&&n&&(c+=`
|
|
100
|
-
@font-face {
|
|
101
|
-
font-family: "${t}";
|
|
102
|
-
src: local("${n}"), url('${i}') format('woff2');
|
|
103
|
-
font-display: fallback;
|
|
104
|
-
font-weight: 400;
|
|
105
|
-
}
|
|
106
|
-
`.trim()),e.files)for(const o in e.files){if(!(String(Number(o))===o))continue;const T=e.files[o];T&&T!==i&&(c+=`
|
|
107
|
-
@font-face {
|
|
108
|
-
font-family: "${t}";
|
|
109
|
-
src: url('${T}') format('woff2');
|
|
110
|
-
font-display: fallback;
|
|
111
|
-
font-weight: ${o};
|
|
112
|
-
}
|
|
113
|
-
`.trim())}return c},He=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>De(n)))==null?void 0:t.join(" "))||""},je=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",Ue=`
|
|
114
|
-
.builder-button {
|
|
115
|
-
all: unset;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
119
|
-
margin: 0;
|
|
120
|
-
}
|
|
121
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
122
|
-
color: inherit;
|
|
123
|
-
line-height: inherit;
|
|
124
|
-
letter-spacing: inherit;
|
|
125
|
-
font-weight: inherit;
|
|
126
|
-
font-size: inherit;
|
|
127
|
-
text-align: inherit;
|
|
128
|
-
font-family: inherit;
|
|
129
|
-
}
|
|
130
|
-
`,Le=e=>e?"":Ue,Ne=e=>`variant-${e}`;function $e(e){var b,m,F;const t=r.useRef(null);function n(l){var y,u;const p={...e.builderContextSignal.rootState,...l};e.builderContextSignal.rootSetState?(u=(y=e.builderContextSignal).rootSetState)==null||u.call(y,p):e.setBuilderContextSignal(d=>({...d,rootState:p}))}function i(l){var y,u,d,x,w;const p={...e.builderContextSignal.content,...l,data:{...(y=e.builderContextSignal.content)==null?void 0:y.data,...l==null?void 0:l.data},meta:{...(u=e.builderContextSignal.content)==null?void 0:u.meta,...l==null?void 0:l.meta,breakpoints:((d=l==null?void 0:l.meta)==null?void 0:d.breakpoints)||((w=(x=e.builderContextSignal.content)==null?void 0:x.meta)==null?void 0:w.breakpoints)}};e.setBuilderContextSignal(S=>({...S,content:p}))}function c(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[g,a]=r.useState(()=>e.contentWrapper||"div");function o(l){return s.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:p=>{var d;const{breakpoints:y,contentId:u}=p;!u||u!==((d=e.builderContextSignal.content)==null?void 0:d.id)||y&&i({meta:{breakpoints:y}})},animation:p=>{R.triggerAnimation(p)},contentUpdate:p=>{i(p)}}})(l)}const[f,T]=r.useState(()=>({})),[v,V]=r.useState(()=>({})),[I,P]=r.useState(()=>!1);function W(l){var p,y;if(e.builderContextSignal.content){const u=(p=e.builderContextSignal.content)==null?void 0:p.testVariationId,d=(y=e.builderContextSignal.content)==null?void 0:y.id;s._track({apiHost:e.apiHost,type:"click",canTrack:s.getDefaultCanTrack(e.canTrack),contentId:d,apiKey:e.apiKey,variationId:u!==d?u:void 0,...qe(l),unique:!I})}I||P(!0)}function A(){var p,y,u;const l=(u=(y=(p=e.builderContextSignal.content)==null?void 0:p.data)==null?void 0:y.httpRequests)!=null?u:{};Object.entries(l).forEach(([d,x])=>{if(!x||v[d]||f[d]&&!s.isEditing())return;v[d]=!0;const w=x.replace(/{{([^}]+)}}/g,(S,J)=>String(K.evaluate({code:J,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));s.logFetch(w),fetch(w).then(S=>S.json()).then(S=>{n({[d]:S}),f[d]=!0}).catch(S=>{console.error("error fetching dynamic data",x,S)}).finally(()=>{v[d]=!1})})}function C(){s.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:R.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const E=r.useRef(!1);return E.current||(A(),C(),E.current=!0),r.useEffect(()=>{var l,p;if(s.isBrowser()){if(s.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",o),s.registerInsertMenu(),s.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(u=>{var x;const d=s.createRegisterComponentMessage(u);(x=window.parent)==null||x.postMessage(d,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)),e.builderContextSignal.content&&s.getDefaultCanTrack(e.canTrack)){const u=(l=e.builderContextSignal.content)==null?void 0:l.testVariationId,d=(p=e.builderContextSignal.content)==null?void 0:p.id,x=e.apiKey;s._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:d,apiKey:x,variationId:u!==d?u:void 0})}if(s.isPreviewing()&&!s.isEditing()){const u=new URL(location.href).searchParams,d=u.get("builder.preview"),x=u.get(`builder.overrides.${d}`),w=u.get("apiKey")||u.get("builder.space");d===e.model&&w===e.apiKey&&(!e.content||x===e.content.id)&&s.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(S=>{S&&i(S)})}}},[]),r.useEffect(()=>{e.content&&i(e.content)},[e.content]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&n(e.data)},[e.data]),r.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{s.isBrowser()&&(window.removeEventListener("message",o),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),h.jsx(k.BuilderContext.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?h.jsx(g,{ref:t,onClick:l=>W(l),"builder-content-id":(b=e.builderContextSignal.content)==null?void 0:b.id,"builder-model":e.model,className:Ne(((m=e.content)==null?void 0:m.testVariationId)||((F=e.content)==null?void 0:F.id)),...c(),...e.contentWrapperProps,children:e.children}):null})}function ze(e){const[t,n]=r.useState(()=>`
|
|
131
|
-
${je({cssCode:e.cssCode,contentId:e.contentId})}
|
|
132
|
-
${He({customFonts:e.customFonts})}
|
|
133
|
-
${Le(e.isNestedRender)}
|
|
134
|
-
`.trim());return h.jsx(R.InlinedStyles,{id:"builderio-content",styles:t,nonce:e.nonce})}const Ke=({content:e,data:t,locale:n})=>{var g,a,o;const i={},c=((g=e==null?void 0:e.data)==null?void 0:g.state)||{};return(o=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||o.forEach(f=>{f.name&&f.defaultValue!==void 0&&(i[f.name]=f.defaultValue)}),{...i,...c,...t,...n?{locale:n}:{}}},Me=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function z(e){var T,v,V,I,P,W,A,C,E;const[t,n]=r.useState(()=>{var b,m;return We({variationId:(b=e.content)==null?void 0:b.testVariationId,contentId:(m=e.content)==null?void 0:m.id})});function i(b){o(m=>({...m,rootState:b}))}const[c,g]=r.useState(()=>{var b;return[...L(),...((b=e.customComponents)==null?void 0:b.filter(({models:m})=>!(m!=null&&m.length)||!e.model?!0:m.includes(e.model)))||[]].reduce((m,{component:F,...l})=>({...m,[l.name]:{component:F,...s.serializeIncludingFunctions(l)}}),{})}),[a,o]=r.useState(()=>{var b;return{content:Me({content:e.content,data:e.data}),localState:void 0,rootState:Ke({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...L(),...((b=e.customComponents)==null?void 0:b.filter(({models:m})=>!(m!=null&&m.length)||!e.model?!0:m.includes(e.model)))||[]].reduce((m,{component:F,...l})=>({...m,[l.name]:s.serializeIncludingFunctions(l)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""}}),f=r.useRef(!1);if(!f.current){e.apiKey||s.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const b=(v=(T=a.content)==null?void 0:T.data)==null?void 0:v.jsCode;b&&K.evaluate({code:b,context:e.context||{},localState:void 0,rootState:a.rootState,rootSetState:m=>{Object.assign(a.rootState,m)},isExpression:!1}),f.current=!0}return h.jsx(R.ComponentsContext.Provider,{value:{registeredComponents:c},children:h.jsxs($e,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:a,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:o,children:[e.isSsrAbTest?h.jsx(U,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,h.jsx(ze,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(V=a.content)==null?void 0:V.id,cssCode:(P=(I=a.content)==null?void 0:I.data)==null?void 0:P.cssCode,customFonts:(A=(W=a.content)==null?void 0:W.data)==null?void 0:A.customFonts}),h.jsx(R.Blocks,{blocks:(E=(C=a.content)==null?void 0:C.data)==null?void 0:E.blocks,context:a,registeredComponents:c,linkComponent:e.linkComponent})]})})}function Oe(e){var a;const[t,n]=r.useState(()=>Re({canTrack:s.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var o;return Pe(B(e.content).map(f=>({id:f.testVariationId,testRatio:f.testRatio})),((o=e.content)==null?void 0:o.id)||"")}function c(){return B(e.content).map(o=>`.variant-${o.testVariationId} { display: none; } `).join("")}function g(){var o;return t?{...e.content,testVariationId:(o=e.content)==null?void 0:o.id}:s.handleABTestingSync({item:e.content,canTrack:s.getDefaultCanTrack(e.canTrack)})}return r.useEffect(()=>{},[]),h.jsxs(h.Fragment,{children:[!e.isNestedRender&&s.TARGET!=="reactNative"?h.jsx(U,{id:"builderio-init-variants-fns",scriptStr:Fe(),nonce:e.nonce||""}):null,t?h.jsxs(h.Fragment,{children:[h.jsx(R.InlinedStyles,{id:"builderio-variants",styles:c(),nonce:e.nonce||""}),h.jsx(U,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(a=B(e.content))==null?void 0:a.map(o=>h.jsx(z,{apiHost:e.apiHost,isNestedRender:e.isNestedRender,nonce:e.nonce,content:o,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},o.testVariationId))]}):null,h.jsx(z,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:g(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}exports.default=Oe;
|