@builder.io/sdk-react 3.0.3 → 3.0.6
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 +169 -32
- package/lib/browser/blocks-exports.mjs +1286 -884
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -16
- package/lib/browser/server-entry-a1c64831.cjs +2 -0
- package/lib/browser/{server-entry-c904f136.js → server-entry-df5e89e5.js} +279 -237
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-c786f197.js → accordion-289f3464.js} +1 -1
- package/lib/edge/{accordion-032726a7.cjs → accordion-fbfb71f4.cjs} +1 -1
- package/lib/edge/{blocks-827b0a87.cjs → blocks-459a090b.cjs} +11 -11
- package/lib/edge/{blocks-105e50e5.js → blocks-582a7fd7.js} +87 -88
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +13 -12
- package/lib/edge/{button-f0e0ea72.js → button-9b112da6.js} +2 -2
- package/lib/edge/{button-5cbfe22c.cjs → button-da357144.cjs} +1 -1
- package/lib/edge/{columns-d07da61d.cjs → columns-a211113f.cjs} +2 -2
- package/lib/edge/{columns-9e187314.js → columns-aba58dda.js} +18 -18
- package/lib/edge/{content-variants-59dc0824.js → content-variants-08f4371c.js} +165 -124
- package/lib/edge/content-variants-4b5899b5.cjs +134 -0
- package/lib/edge/dynamic-blocks-exports.cjs +3 -1
- package/lib/edge/dynamic-blocks-exports.mjs +5 -2
- package/lib/edge/form-4d4553c2.js +166 -0
- package/lib/edge/form-e3a3afd4.cjs +1 -0
- package/lib/edge/{get-class-prop-name-6b143ec7.js → get-class-prop-name-38c2baca.js} +1 -1
- package/lib/edge/{get-class-prop-name-8fb0e5ad.cjs → get-class-prop-name-fbe244e3.cjs} +1 -1
- package/lib/edge/{image-2a2b26d2.js → image-38917f45.js} +22 -24
- package/lib/edge/image-590e36ae.cjs +17 -0
- package/lib/edge/{img-72bf9d21.cjs → img-8d549af8.cjs} +1 -1
- package/lib/edge/{img-2c4c6b78.js → img-c49066fa.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +18 -17
- package/lib/edge/{input-6eca8427.cjs → input-1ae3842f.cjs} +1 -1
- package/lib/edge/{input-752f3ce9.js → input-e7301f4e.js} +1 -1
- package/lib/edge/personalization-container-035be6ba.js +384 -0
- package/lib/edge/personalization-container-25cd8b5e.cjs +138 -0
- package/lib/edge/{select-a1d6e80e.js → select-4187b229.js} +1 -1
- package/lib/edge/{select-49a73a0b.cjs → select-64fdaa79.cjs} +1 -1
- package/lib/edge/server-entry-2ef4e66a.cjs +2 -0
- package/lib/edge/{server-entry-35f12729.js → server-entry-61fca4f7.js} +322 -280
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-2327e009.cjs → slot-995f63c2.cjs} +1 -1
- package/lib/edge/{slot-b9bcbd41.js → slot-d6c46a42.js} +3 -3
- package/lib/edge/{symbol-3527699b.cjs → symbol-498daa97.cjs} +1 -1
- package/lib/edge/{symbol-33e7736f.js → symbol-623dc717.js} +2 -2
- package/lib/edge/{tabs-bc422e4c.js → tabs-12ba41b1.js} +3 -3
- package/lib/edge/{tabs-2df0eaa2.cjs → tabs-d39499cd.cjs} +1 -1
- package/lib/edge/video-4ecfd08b.cjs +1 -0
- package/lib/edge/{video-58c2cc8d.js → video-a3f10439.js} +0 -1
- package/lib/node/blocks-exports.cjs +170 -33
- package/lib/node/blocks-exports.mjs +1372 -970
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -16
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-d1ed35c5.js → server-entry-27d9d31e.js} +279 -237
- package/lib/node/server-entry-98ebff74.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-6675714a.js → setIvm-2dde9074.js} +1 -1
- package/lib/node/{setIvm-e4deba11.cjs → setIvm-784fe19f.cjs} +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-75b2b3a0.js → should-force-browser-runtime-in-node-80f081c8.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-03adae17.cjs → should-force-browser-runtime-in-node-cd6baa94.cjs} +1 -1
- package/package.json +2 -2
- package/types/blocks/form/form/form.d.ts +1 -0
- package/types/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/blocks/personalization-container/index.d.ts +1 -0
- package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/user-attributes.d.ts +17 -0
- package/types/index-helpers/blocks-exports.d.ts +1 -0
- package/types/types/components.d.ts +2 -2
- package/types/types/input.d.ts +1 -0
- package/lib/browser/server-entry-5eafc5bd.cjs +0 -2
- package/lib/edge/content-variants-0db90715.cjs +0 -134
- package/lib/edge/form-79639135.cjs +0 -1
- package/lib/edge/form-7a7b98cf.js +0 -176
- package/lib/edge/image-4db81d72.cjs +0 -17
- package/lib/edge/server-entry-6b2058e2.cjs +0 -2
- package/lib/edge/video-e20dcbbc.cjs +0 -1
- package/lib/node/server-entry-606ce65a.cjs +0 -2
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";const f=require("react/jsx-runtime"),r=require("react"),s=require("./server-entry-2ef4e66a.cjs"),k=require("./blocks-exports.cjs"),V=require("./blocks-459a090b.cjs"),H={"@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!"}}}]},U={"@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!"}}}]},G={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:[H]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[U]}],defaultValue:[{title:[H],detail:[U]},{title:[H],detail:[U]}],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}},Q=r.lazy(()=>Promise.resolve().then(()=>require("./accordion-fbfb71f4.cjs"))),X={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}},Z={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(d=>d.get("width"))&&(n.find(m=>!m.get("width"))||n.reduce((o,p)=>o+p.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}},ee={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},N=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],te=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],ne={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:N,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((p,I)=>{const T=document.createElement("img");let E=!1;T.onload=()=>{E=!0,p(T)},T.addEventListener("error",C=>{console.warn("Image load failed",C.error),I(C.error)}),T.src=a,setTimeout(()=>{E||I(new Error("Image load timed out"))},o)})}function i(a){return Math.round(a*1e3)/1e3}const d=e.get("image"),m=e.get("aspectRatio");if(fetch(d).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),d&&(!m||m===.7041))return n(d).then(a=>{const o=e.get("aspectRatio");e.get("image")===d&&(!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}},ae={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]},ie=r.lazy(()=>Promise.resolve().then(()=>require("./personalization-container-25cd8b5e.cjs"))),oe={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>"}}}]},re={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}},le=r.lazy(()=>Promise.resolve().then(()=>require("./slot-995f63c2.cjs"))),se={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}},j={"@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"}}},L={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},de={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[j]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[L]}],defaultValue:[{label:[{...j,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...L,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...j,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...L,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}},ue=r.lazy(()=>Promise.resolve().then(()=>require("./tabs-d39499cd.cjs"))),ce={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"}},me={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}]},pe=r.lazy(()=>Promise.resolve().then(()=>require("./custom-code-8119ea3f.cjs"))),fe={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}]},ge=r.lazy(()=>Promise.resolve().then(()=>require("./embed-32bdd007.cjs"))),he={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}},be=r.lazy(()=>Promise.resolve().then(()=>require("./form-e3a3afd4.cjs"))),ye={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"}},xe=r.lazy(()=>Promise.resolve().then(()=>require("./input-1ae3842f.cjs"))),ve={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},Se=r.lazy(()=>Promise.resolve().then(()=>require("./select-64fdaa79.cjs"))),Te={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},Ie=r.lazy(()=>Promise.resolve().then(()=>require("./submit-button-b363e0ed.cjs"))),ke={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},Ce=r.lazy(()=>Promise.resolve().then(()=>require("./textarea-56a875bc.cjs"))),we={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:N,required:!0}],noWrap:!0,static:!0},Ve=r.lazy(()=>Promise.resolve().then(()=>require("./img-8d549af8.cjs"))),Re={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:te,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:N,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}},Ee=()=>[{component:pe,...me},{component:ge,...fe},{component:be,...he},{component:xe,...ye},{component:Ie,...Te},{component:Se,...ve},{component:Ce,...ke},{component:Ve,...we},{component:k.Video,...Re}],_=()=>[{component:k.Button,...X},{component:k.Columns,...Z},{component:k.Fragment,...ee},{component:k.Image,...ne},{component:k.Section,...oe},{component:le,...re},{component:k.Symbol,...se},{component:k.Text,...ce},{component:ie,...ae},{component:ue,...de},{component:Q,...G},...Ee()],Fe=`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
|
+
}`,Pe=`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",J="builderIoRenderContent",D=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Ae=({canTrack:e,content:t})=>!(!(D(t).length>0)||!e||s.isBrowser()),We=e=>e==="react"||e==="reactNative",Y=We(s.TARGET),Be=()=>`
|
|
92
|
+
window.${M} = ${Fe}
|
|
93
|
+
window.${J} = ${Pe}
|
|
94
|
+
`,De=(e,t)=>`
|
|
95
|
+
window.${M}(
|
|
96
|
+
"${t}",${JSON.stringify(e)}, ${Y}
|
|
97
|
+
)`,qe=({contentId:e,variationId:t})=>`window.${J}(
|
|
98
|
+
"${t}", "${e}", ${Y}
|
|
99
|
+
)`;function q(e){return f.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function $(e){return Math.round(e*1e3)/1e3}const He=(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},Ue=e=>He(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),z=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,d=e.clientY-n.top,m=$(i/n.width),a=$(d/n.height);return{x:m,y:a}},je=e=>{const t=e.target,n=t&&Ue(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?z({event:e,target:t}):void 0,builderTargetOffset:n?z({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}},Le=["svelte","qwik","vue"],O=()=>Le.includes(s.TARGET)&&(s.isEditing()||s.isPreviewing()),Ne=e=>{var m,a;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(a=e.fileUrl)!=null?a:(m=e==null?void 0:e.files)==null?void 0:m.regular;let d="";if(i&&t&&n&&(d+=`
|
|
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 I=e.files[o];I&&I!==i&&(d+=`
|
|
107
|
+
@font-face {
|
|
108
|
+
font-family: "${t}";
|
|
109
|
+
src: url('${I}') format('woff2');
|
|
110
|
+
font-display: fallback;
|
|
111
|
+
font-weight: ${o};
|
|
112
|
+
}
|
|
113
|
+
`.trim())}return d},_e=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>Ne(n)))==null?void 0:t.join(" "))||""},$e=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",ze=`
|
|
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
|
+
`,Oe=e=>e?"":ze,Ke=e=>`variant-${e}`;function Me(e){var y,x,w;const t=r.useRef(null);function n(u){var g,b;const c={...e.builderContextSignal.rootState,...u};e.builderContextSignal.rootSetState?(b=(g=e.builderContextSignal).rootSetState)==null||b.call(g,c):e.setBuilderContextSignal(l=>({...l,rootState:c}))}function i(u){var g,b,l,h,v;const c={...e.builderContextSignal.content,...u,data:{...(g=e.builderContextSignal.content)==null?void 0:g.data,...u==null?void 0:u.data},meta:{...(b=e.builderContextSignal.content)==null?void 0:b.meta,...u==null?void 0:u.meta,breakpoints:((l=u==null?void 0:u.meta)==null?void 0:l.breakpoints)||((v=(h=e.builderContextSignal.content)==null?void 0:h.meta)==null?void 0:v.breakpoints)}};e.setBuilderContextSignal(S=>({...S,content:c}))}function d(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[m,a]=r.useState(()=>e.contentWrapper||"div");function o(u){return s.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:c=>{var l;const{breakpoints:g,contentId:b}=c;!b||b!==((l=e.builderContextSignal.content)==null?void 0:l.id)||g&&i({meta:{breakpoints:g}})},animation:c=>{V.triggerAnimation(c)},contentUpdate:c=>{i(c)}}})(u)}const[p,I]=r.useState(()=>({})),[T,E]=r.useState(()=>({})),[C,P]=r.useState(()=>!1);function A(u){var c,g;if(e.builderContextSignal.content){const b=(c=e.builderContextSignal.content)==null?void 0:c.testVariationId,l=(g=e.builderContextSignal.content)==null?void 0:g.id;s._track({apiHost:e.apiHost,type:"click",canTrack:s.getDefaultCanTrack(e.canTrack),contentId:l,apiKey:e.apiKey,variationId:b!==l?b:void 0,...je(u),unique:!C})}C||P(!0)}function W(){var c,g,b;const u=(b=(g=(c=e.builderContextSignal.content)==null?void 0:c.data)==null?void 0:g.httpRequests)!=null?b:{};Object.entries(u).forEach(([l,h])=>{if(!h||T[l]||p[l]&&!s.isEditing())return;T[l]=!0;const v=h.replace(/{{([^}]+)}}/g,(S,B)=>String(V.evaluate({code:B,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));s.logFetch(v),fetch(v).then(S=>S.json()).then(S=>{n({[l]:S}),p[l]=!0}).catch(S=>{console.error("error fetching dynamic data",h,S)}).finally(()=>{T[l]=!1})})}function R(){s.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:V.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const F=r.useRef(!1);return F.current||(W(),R(),F.current=!0),r.useEffect(()=>{var u,c,g;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(l=>{var h,v;if(!e.model||!((h=l.models)!=null&&h.length)||l.models.includes(e.model)){const S=s.createRegisterComponentMessage(l);(v=window.parent)==null||v.postMessage(S,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",R)),e.builderContextSignal.content&&s.getDefaultCanTrack(e.canTrack)){const l=(u=e.builderContextSignal.content)==null?void 0:u.testVariationId,h=(c=e.builderContextSignal.content)==null?void 0:c.id,v=e.apiKey;s._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:h,apiKey:v,variationId:l!==h?l:void 0})}if(s.isPreviewing()&&!s.isEditing()){const l=new URL(location.href).searchParams,h=l.get("builder.preview"),v=l.get(`builder.overrides.${h}`),S=l.get("apiKey")||l.get("builder.space");(h==="BUILDER_STUDIO"||h===e.model&&S===e.apiKey&&(!e.content||v===e.content.id))&&s.fetchOneEntry({model:e.model||"",apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...h==="BUILDER_STUDIO"&&((g=e.context)!=null&&g.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(B=>{B&&i(B)})}}},[]),r.useEffect(()=>{e.content&&i(e.content)},[e.content]),r.useEffect(()=>{R()},[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",R))},[]),f.jsx(k.BuilderContext.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||O()?f.jsx(m,{ref:t,onClick:u=>A(u),"builder-content-id":(y=e.builderContextSignal.content)==null?void 0:y.id,"builder-model":e.model,className:Ke(((x=e.content)==null?void 0:x.testVariationId)||((w=e.content)==null?void 0:w.id)),style:{display:!e.builderContextSignal.content&&O()?"none":void 0},...d(),...e.contentWrapperProps,children:e.children}):null})}function Je(e){const[t,n]=r.useState(()=>`
|
|
131
|
+
${$e({cssCode:e.cssCode,contentId:e.contentId})}
|
|
132
|
+
${_e({customFonts:e.customFonts})}
|
|
133
|
+
${Oe(e.isNestedRender)}
|
|
134
|
+
`.trim());return f.jsx(V.InlinedStyles,{id:"builderio-content",styles:t,nonce:e.nonce})}const Ye=({content:e,data:t,locale:n})=>{var m,a,o;const i={},d=((m=e==null?void 0:e.data)==null?void 0:m.state)||{};return(o=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||o.forEach(p=>{p.name&&p.defaultValue!==void 0&&(i[p.name]=p.defaultValue)}),{...i,...d,...t,...n?{locale:n}:{}}},Ge=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function K(e){var I,T,E,C,P,A,W,R,F;const[t,n]=r.useState(()=>{var y,x;return qe({variationId:(y=e.content)==null?void 0:y.testVariationId,contentId:(x=e.content)==null?void 0:x.id})});function i(y){o(x=>({...x,rootState:y}))}const[d,m]=r.useState(()=>[..._(),...e.customComponents||[]].reduce((y,{component:x,...w})=>({...y,[w.name]:{component:x,...s.serializeIncludingFunctions(w)}}),{})),[a,o]=r.useState(()=>({content:Ge({content:e.content,data:e.data}),localState:void 0,rootState:Ye({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[..._(),...e.customComponents||[]].reduce((y,{component:x,...w})=>({...y,[w.name]:s.serializeIncludingFunctions(w)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model||""})),p=r.useRef(!1);if(!p.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 y=(T=(I=a.content)==null?void 0:I.data)==null?void 0:T.jsCode;y&&V.evaluate({code:y,context:e.context||{},localState:void 0,rootState:a.rootState,rootSetState:x=>{Object.assign(a.rootState,x)},isExpression:!1}),p.current=!0}return f.jsx(V.ComponentsContext.Provider,{value:{registeredComponents:d},children:f.jsxs(Me,{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?f.jsx(q,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,f.jsx(Je,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(E=a.content)==null?void 0:E.id,cssCode:(P=(C=a.content)==null?void 0:C.data)==null?void 0:P.cssCode,customFonts:(W=(A=a.content)==null?void 0:A.data)==null?void 0:W.customFonts}),f.jsx(V.Blocks,{blocks:(F=(R=a.content)==null?void 0:R.data)==null?void 0:F.blocks,context:a,registeredComponents:d,linkComponent:e.linkComponent})]})})}function Qe(e){var a;const[t,n]=r.useState(()=>Ae({canTrack:s.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var o;return De(D(e.content).map(p=>({id:p.testVariationId,testRatio:p.testRatio})),((o=e.content)==null?void 0:o.id)||"")}function d(){return D(e.content).map(o=>`.variant-${o.testVariationId} { display: none; } `).join("")}function m(){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(()=>{},[]),f.jsxs(f.Fragment,{children:[!e.isNestedRender&&s.TARGET!=="reactNative"?f.jsx(q,{id:"builderio-init-variants-fns",scriptStr:Be(),nonce:e.nonce||""}):null,t?f.jsxs(f.Fragment,{children:[f.jsx(V.InlinedStyles,{id:"builderio-variants",styles:d(),nonce:e.nonce||""}),f.jsx(q,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(a=D(e.content))==null?void 0:a.map(o=>f.jsx(K,{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,f.jsx(K,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:m(),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})]})}const Xe=Object.freeze(Object.defineProperty({__proto__:null,default:Qe},Symbol.toStringTag,{value:"Module"}));exports.InlinedScript=q;exports.contentVariants=Xe;
|
|
@@ -38,7 +38,8 @@ __export(stdin_exports, {
|
|
|
38
38
|
Section: () => Section,
|
|
39
39
|
Symbol: () => Symbol2,
|
|
40
40
|
Text: () => Text,
|
|
41
|
-
Video: () => Video
|
|
41
|
+
Video: () => Video,
|
|
42
|
+
setClientUserAttributes: () => setClientUserAttributes
|
|
42
43
|
});
|
|
43
44
|
module.exports = __toCommonJS(stdin_exports);
|
|
44
45
|
var import_react = __toESM(require("react"));
|
|
@@ -58,3 +59,4 @@ const Video = import_blocks_exports.Video;
|
|
|
58
59
|
const Blocks = (props) => isBrowser() ? /* @__PURE__ */ import_react.default.createElement(BrowserSdk.Blocks, { ...props }) : /* @__PURE__ */ import_react.default.createElement(import_blocks_exports.Blocks, { ...props });
|
|
59
60
|
const Content = (props) => isBrowser() ? /* @__PURE__ */ import_react.default.createElement(BrowserSdk.Content, { ...props }) : /* @__PURE__ */ import_react.default.createElement(import_blocks_exports.Content, { ...props });
|
|
60
61
|
const BuilderContext = import_blocks_exports.BuilderContext;
|
|
62
|
+
const setClientUserAttributes = import_blocks_exports.setClientUserAttributes;
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
Video as EdgeSdkVideo,
|
|
16
16
|
Blocks as EdgeSdkBlocks,
|
|
17
17
|
Content as EdgeSdkContent,
|
|
18
|
-
BuilderContext as EdgeSdkBuilderContext
|
|
18
|
+
BuilderContext as EdgeSdkBuilderContext,
|
|
19
|
+
setClientUserAttributes as EdgeSdksetClientUserAttributes
|
|
19
20
|
} from "./blocks-exports.mjs";
|
|
20
21
|
const Button = EdgeSdkButton;
|
|
21
22
|
const Columns = EdgeSdkColumns;
|
|
@@ -28,6 +29,7 @@ const Video = EdgeSdkVideo;
|
|
|
28
29
|
const Blocks = (props) => isBrowser() ? /* @__PURE__ */ React.createElement(BrowserSdk.Blocks, { ...props }) : /* @__PURE__ */ React.createElement(EdgeSdkBlocks, { ...props });
|
|
29
30
|
const Content = (props) => isBrowser() ? /* @__PURE__ */ React.createElement(BrowserSdk.Content, { ...props }) : /* @__PURE__ */ React.createElement(EdgeSdkContent, { ...props });
|
|
30
31
|
const BuilderContext = EdgeSdkBuilderContext;
|
|
32
|
+
const setClientUserAttributes = EdgeSdksetClientUserAttributes;
|
|
31
33
|
export {
|
|
32
34
|
Blocks,
|
|
33
35
|
BuilderContext,
|
|
@@ -39,5 +41,6 @@ export {
|
|
|
39
41
|
Section,
|
|
40
42
|
Symbol,
|
|
41
43
|
Text,
|
|
42
|
-
Video
|
|
44
|
+
Video,
|
|
45
|
+
setClientUserAttributes
|
|
43
46
|
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsxs as k, Fragment as A, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as j, useState as h } from "react";
|
|
3
|
+
import { Blocks as g, set as J, get as O } from "./blocks-582a7fd7.js";
|
|
4
|
+
import { isEditing as U, logFetch as R } from "./server-entry-61fca4f7.js";
|
|
5
|
+
import "./blocks-exports.mjs";
|
|
6
|
+
import "./get-class-prop-name-38c2baca.js";
|
|
7
|
+
import "./dynamic-renderer-8b343325.js";
|
|
8
|
+
const $ = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], q = () => {
|
|
9
|
+
const e = process.env.NODE_ENV || "production";
|
|
10
|
+
return $.includes(e) ? e : "production";
|
|
11
|
+
};
|
|
12
|
+
function _(e) {
|
|
13
|
+
const r = j(null), [T, b] = h(() => "unsubmitted"), [v, y] = h(() => null), [L, F] = h(() => "");
|
|
14
|
+
function N(s) {
|
|
15
|
+
var u, l;
|
|
16
|
+
const c = {
|
|
17
|
+
...e.builderContext.rootState,
|
|
18
|
+
...s
|
|
19
|
+
};
|
|
20
|
+
e.builderContext.rootSetState ? (l = (u = e.builderContext).rootSetState) == null || l.call(u, c) : e.builderContext.rootState = c;
|
|
21
|
+
}
|
|
22
|
+
function f() {
|
|
23
|
+
return U() && e.previewState || T;
|
|
24
|
+
}
|
|
25
|
+
function w(s) {
|
|
26
|
+
var u;
|
|
27
|
+
const c = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
28
|
+
if (e.sendSubmissionsTo === "zapier")
|
|
29
|
+
s.preventDefault();
|
|
30
|
+
else if (c) {
|
|
31
|
+
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
32
|
+
s.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
s.preventDefault();
|
|
36
|
+
const l = s.currentTarget || s.target, S = e.customHeaders || {};
|
|
37
|
+
let d;
|
|
38
|
+
const D = new FormData(l), E = Array.from(l.querySelectorAll("input,select,textarea")).filter((t) => !!t.name).map((t) => {
|
|
39
|
+
let n;
|
|
40
|
+
const o = t.name;
|
|
41
|
+
if (t instanceof HTMLInputElement)
|
|
42
|
+
if (t.type === "radio") {
|
|
43
|
+
if (t.checked)
|
|
44
|
+
return n = t.name, {
|
|
45
|
+
key: o,
|
|
46
|
+
value: n
|
|
47
|
+
};
|
|
48
|
+
} else if (t.type === "checkbox")
|
|
49
|
+
n = t.checked;
|
|
50
|
+
else if (t.type === "number" || t.type === "range") {
|
|
51
|
+
const i = t.valueAsNumber;
|
|
52
|
+
isNaN(i) || (n = i);
|
|
53
|
+
} else
|
|
54
|
+
t.type === "file" ? n = t.files : n = t.value;
|
|
55
|
+
else
|
|
56
|
+
n = t.value;
|
|
57
|
+
return {
|
|
58
|
+
key: o,
|
|
59
|
+
value: n
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
let a = e.contentType;
|
|
63
|
+
if (e.sendSubmissionsTo === "email" && (a = "multipart/form-data"), Array.from(E).forEach(({ value: t }) => {
|
|
64
|
+
(t instanceof File || Array.isArray(t) && t[0] instanceof File || t instanceof FileList) && (a = "multipart/form-data");
|
|
65
|
+
}), a !== "application/json")
|
|
66
|
+
d = D;
|
|
67
|
+
else {
|
|
68
|
+
const t = {};
|
|
69
|
+
Array.from(E).forEach(({ value: n, key: o }) => {
|
|
70
|
+
J(t, o, n);
|
|
71
|
+
}), d = JSON.stringify(t);
|
|
72
|
+
}
|
|
73
|
+
a && a !== "multipart/form-data" && (c && ((u = e.action) != null && u.includes("zapier.com")) || (S["content-type"] = a));
|
|
74
|
+
const x = new CustomEvent("presubmit", { detail: { body: d } });
|
|
75
|
+
if (r.current && (r.current.dispatchEvent(x), x.defaultPrevented))
|
|
76
|
+
return;
|
|
77
|
+
b("sending");
|
|
78
|
+
const P = `${q() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
79
|
+
e.sendSubmissionsToEmail || ""
|
|
80
|
+
)}&name=${encodeURIComponent(e.name || "")}`, C = e.sendSubmissionsTo === "email" ? P : e.action;
|
|
81
|
+
R(C), fetch(C, { body: d, headers: S, method: e.method || "post" }).then(
|
|
82
|
+
async (t) => {
|
|
83
|
+
let n;
|
|
84
|
+
const o = t.headers.get("content-type");
|
|
85
|
+
if (o && o.indexOf("application/json") !== -1 ? n = await t.json() : n = await t.text(), !t.ok && e.errorMessagePath) {
|
|
86
|
+
let i = O(n, e.errorMessagePath);
|
|
87
|
+
i && (typeof i != "string" && (i = JSON.stringify(i)), F(i), N({ formErrorMessage: i }));
|
|
88
|
+
}
|
|
89
|
+
if (y(n), b(t.ok ? "success" : "error"), t.ok) {
|
|
90
|
+
const i = new CustomEvent("submit:success", {
|
|
91
|
+
detail: { res: t, body: n }
|
|
92
|
+
});
|
|
93
|
+
if (r.current) {
|
|
94
|
+
if (r.current.dispatchEvent(i), i.defaultPrevented)
|
|
95
|
+
return;
|
|
96
|
+
e.resetFormOnSubmit !== !1 && r.current.reset();
|
|
97
|
+
}
|
|
98
|
+
if (e.successUrl)
|
|
99
|
+
if (r.current) {
|
|
100
|
+
const M = new CustomEvent("route", {
|
|
101
|
+
detail: { url: e.successUrl }
|
|
102
|
+
});
|
|
103
|
+
r.current.dispatchEvent(M), M.defaultPrevented || (location.href = e.successUrl);
|
|
104
|
+
} else
|
|
105
|
+
location.href = e.successUrl;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
(t) => {
|
|
109
|
+
const n = new CustomEvent("submit:error", {
|
|
110
|
+
detail: { error: t }
|
|
111
|
+
});
|
|
112
|
+
r.current && (r.current.dispatchEvent(n), n.defaultPrevented) || (y(t), b("error"));
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return /* @__PURE__ */ k(A, { children: [
|
|
118
|
+
" ",
|
|
119
|
+
/* @__PURE__ */ k(
|
|
120
|
+
"form",
|
|
121
|
+
{
|
|
122
|
+
validate: e.validate,
|
|
123
|
+
ref: r,
|
|
124
|
+
action: !e.sendWithJs && e.action,
|
|
125
|
+
method: e.method,
|
|
126
|
+
name: e.name,
|
|
127
|
+
onSubmit: (s) => w(s),
|
|
128
|
+
...e.attributes,
|
|
129
|
+
children: [
|
|
130
|
+
e.children,
|
|
131
|
+
f() === "error" ? /* @__PURE__ */ m(
|
|
132
|
+
g,
|
|
133
|
+
{
|
|
134
|
+
path: "errorMessage",
|
|
135
|
+
blocks: e.errorMessage,
|
|
136
|
+
context: e.builderContext
|
|
137
|
+
}
|
|
138
|
+
) : null,
|
|
139
|
+
f() === "sending" ? /* @__PURE__ */ m(
|
|
140
|
+
g,
|
|
141
|
+
{
|
|
142
|
+
path: "sendingMessage",
|
|
143
|
+
blocks: e.sendingMessage,
|
|
144
|
+
context: e.builderContext
|
|
145
|
+
}
|
|
146
|
+
) : null,
|
|
147
|
+
f() === "error" && v ? /* @__PURE__ */ m("pre", { className: "builder-form-error-text pre-7acc3b46", children: JSON.stringify(v, null, 2) }) : null,
|
|
148
|
+
f() === "success" ? /* @__PURE__ */ m(
|
|
149
|
+
g,
|
|
150
|
+
{
|
|
151
|
+
path: "successMessage",
|
|
152
|
+
blocks: e.successMessage,
|
|
153
|
+
context: e.builderContext
|
|
154
|
+
}
|
|
155
|
+
) : null
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
" ",
|
|
160
|
+
/* @__PURE__ */ m("style", { children: ".pre-7acc3b46 { padding: 10px; color: red; text-align: center; }" }),
|
|
161
|
+
" "
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
_ as default
|
|
166
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),f=require("./blocks-459a090b.cjs"),j=require("./server-entry-2ef4e66a.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-fbe244e3.cjs");require("./dynamic-renderer-b29b45ca.cjs");const P=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return P.includes(e)?e:"production"};function A(e){const s=h.useRef(null),[M,g]=h.useState(()=>"unsubmitted"),[y,S]=h.useState(()=>null),[O,T]=h.useState(()=>"");function q(i){var l,d;const u={...e.builderContext.rootState,...i};e.builderContext.rootSetState?(d=(l=e.builderContext).rootSetState)==null||d.call(l,u):e.builderContext.rootState=u}function m(){return j.isEditing()&&e.previewState||M}function F(i){var l;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")i.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){i.preventDefault();return}i.preventDefault();const d=i.currentTarget||i.target,v=e.customHeaders||{};let b;const N=new FormData(d),x=Array.from(d.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const a=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:a,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const r=t.valueAsNumber;isNaN(r)||(n=r)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:a,value:n}});let c=e.contentType;if(e.sendSubmissionsTo==="email"&&(c="multipart/form-data"),Array.from(x).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(c="multipart/form-data")}),c!=="application/json")b=N;else{const t={};Array.from(x).forEach(({value:n,key:a})=>{f.set(t,a,n)}),b=JSON.stringify(t)}c&&c!=="multipart/form-data"&&(u&&((l=e.action)!=null&&l.includes("zapier.com"))||(v["content-type"]=c));const E=new CustomEvent("presubmit",{detail:{body:b}});if(s.current&&(s.current.dispatchEvent(E),E.defaultPrevented))return;g("sending");const w=`${D()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,C=e.sendSubmissionsTo==="email"?w:e.action;j.logFetch(C),fetch(C,{body:b,headers:v,method:e.method||"post"}).then(async t=>{let n;const a=t.headers.get("content-type");if(a&&a.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let r=f.get(n,e.errorMessagePath);r&&(typeof r!="string"&&(r=JSON.stringify(r)),T(r),q({formErrorMessage:r}))}if(S(n),g(t.ok?"success":"error"),t.ok){const r=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(s.current){if(s.current.dispatchEvent(r),r.defaultPrevented)return;e.resetFormOnSubmit!==!1&&s.current.reset()}if(e.successUrl)if(s.current){const k=new CustomEvent("route",{detail:{url:e.successUrl}});s.current.dispatchEvent(k),k.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});s.current&&(s.current.dispatchEvent(n),n.defaultPrevented)||(S(t),g("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:s,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:i=>F(i),...e.attributes,children:[e.children,m()==="error"?o.jsx(f.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,m()==="sending"?o.jsx(f.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,m()==="error"&&y?o.jsx("pre",{className:"builder-form-error-text pre-7acc3b46",children:JSON.stringify(y,null,2)}):null,m()==="success"?o.jsx(f.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-7acc3b46 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./server-entry-
|
|
1
|
+
"use strict";const e=require("./server-entry-2ef4e66a.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};exports.getClassPropName=s;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useEffect as y } from "react";
|
|
1
|
+
import { jsxs as d, Fragment as m, jsx as o } from "react/jsx-runtime";
|
|
3
2
|
function x(e) {
|
|
4
3
|
return e.replace(/http(s)?:/, "");
|
|
5
4
|
}
|
|
6
|
-
function
|
|
5
|
+
function y(e = "", i, t) {
|
|
7
6
|
const n = new RegExp("([?&])" + i + "=.*?(&|$)", "i"), c = e.indexOf("?") !== -1 ? "&" : "?";
|
|
8
7
|
return e.match(n) ? e.replace(n, "$1" + i + "=" + encodeURIComponent(t) + "$2") : e + c + i + "=" + encodeURIComponent(t);
|
|
9
8
|
}
|
|
10
|
-
function
|
|
9
|
+
function v(e, i) {
|
|
11
10
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !i)
|
|
12
11
|
return e;
|
|
13
12
|
if (i === "master")
|
|
@@ -19,19 +18,19 @@ function $(e, i) {
|
|
|
19
18
|
}
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function u(e) {
|
|
23
22
|
if (!e)
|
|
24
23
|
return e;
|
|
25
24
|
const i = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
26
25
|
if (e.match(/builder\.io/)) {
|
|
27
26
|
let t = e;
|
|
28
27
|
const n = Number(e.split("?width=")[1]);
|
|
29
|
-
return isNaN(n) || (t = `${t} ${n}w`), i.filter((c) => c !== n).map((c) => `${
|
|
28
|
+
return isNaN(n) || (t = `${t} ${n}w`), i.filter((c) => c !== n).map((c) => `${y(e, "width", c)} ${c}w`).concat([t]).join(", ");
|
|
30
29
|
}
|
|
31
|
-
return e.match(/cdn\.shopify\.com/) ? i.map((t) => [
|
|
30
|
+
return e.match(/cdn\.shopify\.com/) ? i.map((t) => [v(e, `${t}x${t}`), t]).filter(([t]) => !!t).map(([t, n]) => `${t} ${n}w`).concat([e]).join(", ") : e;
|
|
32
31
|
}
|
|
33
|
-
function
|
|
34
|
-
var c, r,
|
|
32
|
+
function w(e) {
|
|
33
|
+
var c, r, f, h, s, g;
|
|
35
34
|
function i() {
|
|
36
35
|
var b;
|
|
37
36
|
const a = e.image || e.src;
|
|
@@ -42,10 +41,10 @@ function R(e) {
|
|
|
42
41
|
if (!e.noWebp) {
|
|
43
42
|
if (e.srcset && ((b = e.image) != null && b.includes("builder.io/api/v1/image"))) {
|
|
44
43
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
45
|
-
return console.debug("Removed given srcset"),
|
|
44
|
+
return console.debug("Removed given srcset"), u(a);
|
|
46
45
|
} else if (e.image && !e.srcset)
|
|
47
|
-
return
|
|
48
|
-
return
|
|
46
|
+
return u(a);
|
|
47
|
+
return u(a);
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
function t() {
|
|
@@ -62,10 +61,9 @@ function R(e) {
|
|
|
62
61
|
};
|
|
63
62
|
return e.aspectRatio ? l : void 0;
|
|
64
63
|
}
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */ f("picture", { children: [
|
|
64
|
+
return /* @__PURE__ */ d(m, { children: [
|
|
65
|
+
/* @__PURE__ */ d(m, { children: [
|
|
66
|
+
/* @__PURE__ */ d("picture", { children: [
|
|
69
67
|
t() ? /* @__PURE__ */ o("source", { type: "image/webp", srcSet: t() }) : null,
|
|
70
68
|
/* @__PURE__ */ o(
|
|
71
69
|
"img",
|
|
@@ -79,7 +77,7 @@ function R(e) {
|
|
|
79
77
|
objectFit: e.backgroundSize || "cover",
|
|
80
78
|
...n()
|
|
81
79
|
},
|
|
82
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
80
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-9dac2184",
|
|
83
81
|
src: e.image,
|
|
84
82
|
srcSet: i(),
|
|
85
83
|
sizes: e.sizes
|
|
@@ -89,23 +87,23 @@ function R(e) {
|
|
|
89
87
|
e.aspectRatio && !((r = (c = e.builderBlock) == null ? void 0 : c.children) != null && r.length && e.fitContent) ? /* @__PURE__ */ o(
|
|
90
88
|
"div",
|
|
91
89
|
{
|
|
92
|
-
className: "builder-image-sizer div-
|
|
90
|
+
className: "builder-image-sizer div-9dac2184",
|
|
93
91
|
style: {
|
|
94
92
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
) : null,
|
|
98
|
-
(h = (
|
|
99
|
-
!e.fitContent && ((g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length) ? /* @__PURE__ */ o("div", { className: "div-
|
|
96
|
+
(h = (f = e.builderBlock) == null ? void 0 : f.children) != null && h.length && e.fitContent ? /* @__PURE__ */ o(m, { children: e.children }) : null,
|
|
97
|
+
!e.fitContent && ((g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length) ? /* @__PURE__ */ o("div", { className: "div-9dac2184-2", children: e.children }) : null
|
|
100
98
|
] }),
|
|
101
|
-
/* @__PURE__ */ o("style", { children: `.img-
|
|
99
|
+
/* @__PURE__ */ o("style", { children: `.img-9dac2184 {
|
|
102
100
|
opacity: 1;
|
|
103
101
|
transition: opacity 0.2s ease-in-out;
|
|
104
|
-
}.div-
|
|
102
|
+
}.div-9dac2184 {
|
|
105
103
|
width: 100%;
|
|
106
104
|
pointer-events: none;
|
|
107
105
|
font-size: 0;
|
|
108
|
-
}.div-
|
|
106
|
+
}.div-9dac2184-2 {
|
|
109
107
|
display: flex;
|
|
110
108
|
flex-direction: column;
|
|
111
109
|
align-items: stretch;
|
|
@@ -118,5 +116,5 @@ function R(e) {
|
|
|
118
116
|
] });
|
|
119
117
|
}
|
|
120
118
|
export {
|
|
121
|
-
|
|
119
|
+
w as default
|
|
122
120
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime");function g(e){return e.replace(/http(s)?:/,"")}function b(e="",i,t){const n=new RegExp("([?&])"+i+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(n)?e.replace(n,"$1"+i+"="+encodeURIComponent(t)+"$2"):e+a+i+"="+encodeURIComponent(t)}function x(e,i){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!i)return e;if(i==="master")return g(e);const t=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(t){const n=e.split(t[0]),a=t[3],r=i.match("x")?i:`${i}x`;return g(`${n[0]}_${r}${a}`)}return null}function d(e){if(!e)return e;const i=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let t=e;const n=Number(e.split("?width=")[1]);return isNaN(n)||(t=`${t} ${n}w`),i.filter(a=>a!==n).map(a=>`${b(e,"width",a)} ${a}w`).concat([t]).join(", ")}return e.match(/cdn\.shopify\.com/)?i.map(t=>[x(e,`${t}x${t}`),t]).filter(([t])=>!!t).map(([t,n])=>`${t} ${n}w`).concat([e]).join(", "):e}function y(e){var a,r,s,u,m,f;function i(){var h;const o=e.image||e.src;if(!o||!(typeof o=="string"&&(o.match(/builder\.io/)||o.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"),d(o)}else if(e.image&&!e.srcset)return d(o);return d(o)}}function t(){var l;return(l=i==null?void 0:i())!=null&&l.match(/builder\.io/)&&!e.noWebp?i().replace(/\?/g,"?format=webp&"):""}function n(){const l={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?l:void 0}return c.jsxs(c.Fragment,{children:[c.jsxs(c.Fragment,{children:[c.jsxs("picture",{children:[t()?c.jsx("source",{type:"image/webp",srcSet:t()}):null,c.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",...n()},className:"builder-image"+(e.className?" "+e.className:"")+" img-9dac2184",src:e.image,srcSet:i(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length&&e.fitContent)?c.jsx("div",{className:"builder-image-sizer div-9dac2184",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(u=(s=e.builderBlock)==null?void 0:s.children)!=null&&u.length&&e.fitContent?c.jsx(c.Fragment,{children:e.children}):null,!e.fitContent&&((f=(m=e.builderBlock)==null?void 0:m.children)!=null&&f.length)?c.jsx("div",{className:"div-9dac2184-2",children:e.children}):null]}),c.jsx("style",{children:`.img-9dac2184 {
|
|
2
|
+
opacity: 1;
|
|
3
|
+
transition: opacity 0.2s ease-in-out;
|
|
4
|
+
}.div-9dac2184 {
|
|
5
|
+
width: 100%;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
font-size: 0;
|
|
8
|
+
}.div-9dac2184-2 {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}`})]})}exports.default=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-2ef4e66a.cjs");function n(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},i.isEditing()&&e.imgSrc||"default-key")}exports.default=n;
|
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-2ef4e66a.cjs");require("react");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|