@builder.io/sdk-react 1.0.23 → 1.0.25
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 +1042 -826
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +8 -1
- package/lib/browser/init.mjs +37 -2
- package/lib/browser/{server-entry-4ca9f249.js → server-entry-d15ee928.js} +2 -1
- package/lib/browser/{server-entry-f69e2b2a.cjs → server-entry-f28ec73b.cjs} +2 -2
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-93608689.js → blocks-7c1422af.js} +682 -685
- package/lib/edge/blocks-8c31869c.cjs +32 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/button-3439cb1b.js +31 -0
- package/lib/edge/button-96857fcf.cjs +1 -0
- package/lib/edge/columns-0d152875.js +163 -0
- package/lib/edge/columns-930c3d9a.cjs +28 -0
- package/lib/edge/{content-variants-f416bff5.js → content-variants-1ff6980e.js} +404 -262
- package/lib/edge/content-variants-d62785c6.cjs +134 -0
- package/lib/edge/{form-8526db32.js → form-1dbd32d7.js} +3 -3
- package/lib/edge/{form-44ceed15.cjs → form-69ed6cc5.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-e85bf7a3.js → get-class-prop-name-58140fb7.js} +2 -1
- package/lib/edge/get-class-prop-name-c793129b.cjs +1 -0
- package/lib/edge/image-764070f8.cjs +17 -0
- package/lib/edge/{image-0008c792.js → image-9d24a962.js} +24 -24
- package/lib/edge/{img-a5802e2b.cjs → img-305b1676.cjs} +1 -1
- package/lib/edge/{img-5ef224a8.js → img-d4b1130f.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +8 -1
- package/lib/edge/init.mjs +37 -2
- package/lib/edge/{input-f1aa0191.cjs → input-28dd9b60.cjs} +1 -1
- package/lib/edge/{input-3f85283b.js → input-a7054c28.js} +1 -1
- package/lib/edge/{select-d4c018c0.cjs → select-57b6e444.cjs} +1 -1
- package/lib/edge/{select-4fe889b6.js → select-dd83a040.js} +1 -1
- package/lib/edge/{server-entry-e1e18fd2.js → server-entry-cb8ad418.js} +2 -1
- package/lib/edge/{server-entry-c4b7844d.cjs → server-entry-d9413c6f.cjs} +2 -2
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-2a11e808.cjs → slot-3f6aff1b.cjs} +1 -1
- package/lib/edge/{slot-97599025.js → slot-7dbe2bcb.js} +3 -3
- package/lib/edge/symbol-63f3b56e.cjs +1 -0
- package/lib/edge/{symbol-a90a41a3.js → symbol-a20aae0e.js} +32 -26
- package/lib/edge/tabs-f559c3bf.cjs +1 -0
- package/lib/edge/tabs-f5fd67a5.js +69 -0
- package/lib/node/blocks-exports.cjs +32 -32
- package/lib/node/blocks-exports.mjs +1158 -942
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +8 -6
- package/lib/node/node-runtime-79a56b80.cjs +48 -0
- package/lib/node/{node-runtime-8062cfb8.js → node-runtime-def43b7b.js} +49 -47
- package/lib/node/{server-entry-3e54c767.js → server-entry-28bf4f4c.js} +1 -1
- package/lib/node/{server-entry-461bfaf9.cjs → server-entry-c4d16d70.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/columns/columns.types.d.ts +1 -1
- package/types/blocks/columns/helpers.d.ts +1 -0
- package/types/blocks/tabs/component-info.d.ts +2 -0
- package/types/blocks/tabs/index.d.ts +1 -0
- package/types/blocks/tabs/tabs.d.ts +4 -0
- package/types/blocks/tabs/tabs.types.d.ts +13 -0
- package/types/blocks/text/text.types.d.ts +2 -1
- package/types/components/block/block.helpers.d.ts +4 -2
- package/types/components/content/components/styles.helpers.d.ts +1 -0
- package/types/components/dynamic-div.d.ts +15 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/init.d.ts +4 -1
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +4 -1
- package/types/types/targets.d.ts +1 -1
- package/lib/edge/blocks-5539f58f.cjs +0 -32
- package/lib/edge/button-7e98d8f3.cjs +0 -1
- package/lib/edge/button-8816ab35.js +0 -28
- package/lib/edge/columns-8db639b5.cjs +0 -28
- package/lib/edge/columns-d065e3c4.js +0 -156
- package/lib/edge/content-variants-44d061f2.cjs +0 -134
- package/lib/edge/get-class-prop-name-7b951501.cjs +0 -1
- package/lib/edge/image-ee3dd857.cjs +0 -17
- package/lib/edge/symbol-dbb5c95e.cjs +0 -1
- package/lib/node/node-runtime-11a8cdfe.cjs +0 -48
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),r=require("react"),s=require("./server-entry-d9413c6f.cjs"),k=require("./blocks-exports.cjs"),w=require("./blocks-8c31869c.cjs");require("./get-class-prop-name-c793129b.cjs");require("./dynamic-renderer-b29b45ca.cjs");const G={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},Q={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(a=>{a.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(u=>u.get("width"))&&(n.find(p=>!p.get("width"))||n.reduce((o,g)=>o+g.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}]},X={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Z={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"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(i,o=6e4){return new Promise((g,y)=>{const C=document.createElement("img");let I=!1;C.onload=()=>{I=!0,g(C)},C.addEventListener("error",V=>{console.warn("Image load failed",V.error),y(V.error)}),C.src=i,setTimeout(()=>{I||y(new Error("Image load timed out"))},o)})}function a(i){return Math.round(i*1e3)/1e3}const u=e.get("image"),p=e.get("aspectRatio");if(fetch(u).then(i=>i.blob()).then(i=>{i.type.includes("svg")&&e.set("noWebp",!0)}),u&&(!p||p===.7041))return n(u).then(i=>{const o=e.get("aspectRatio");e.get("image")===u&&(!o||o===.7041)&&i.width&&i.height&&(e.set("aspectRatio",a(i.height/i.width)),e.set("height",i.height),e.set("width",i.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:"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}]},ee={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>"}}}]},te={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"}]},ne=r.lazy(()=>Promise.resolve().then(()=>require("./slot-3f6aff1b.cjs"))),ae={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"}]},W={"@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"}}},A={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},ie={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[W]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[A]}],defaultValue:[{label:[{...W,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...A,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...W,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...A,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"}]}]},oe=r.lazy(()=>Promise.resolve().then(()=>require("./tabs-f559c3bf.cjs"))),re={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}]},le=r.lazy(()=>Promise.resolve().then(()=>require("./custom-code-6d9730ff.cjs"))),de={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(a=>a.json()).then(a=>{e.get("url")===t&&(a.html?e.set("content",a.html):e.set("content","Invalid url, please try another"))}).catch(a=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{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"))),ue={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"}}}]},me=r.lazy(()=>Promise.resolve().then(()=>require("./form-69ed6cc5.cjs"))),pe={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"}},ge=r.lazy(()=>Promise.resolve().then(()=>require("./input-28dd9b60.cjs"))),fe={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},he=r.lazy(()=>Promise.resolve().then(()=>require("./select-57b6e444.cjs"))),be={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},ye=r.lazy(()=>Promise.resolve().then(()=>require("./submit-button-b363e0ed.cjs"))),xe={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},ve=r.lazy(()=>Promise.resolve().then(()=>require("./img-305b1676.cjs"))),Se={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}]},Te=()=>[{component:le,...se},{component:ce,...de},{component:me,...ue},{component:ge,...pe},{component:ye,...be},{component:he,...fe},{component:ve,...xe},{component:k.Video,...Se}],B=()=>[{component:k.Button,...G},{component:k.Columns,...Q},{component:k.Fragment,...X},{component:k.Image,...Z},{component:k.Section,...ee},{component:ne,...te},{component:k.Symbol,...ae},{component:k.Text,...re},{component:oe,...ie},...Te()],Ie=`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
|
+
}`,ke=`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",P=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Ce=({canTrack:e,content:t})=>!(!(P(t).length>0)||!e||s.isBrowser()),we=e=>e==="react"||e==="reactNative",J=we(s.TARGET),Ve=()=>`
|
|
92
|
+
window.${M} = ${Ie}
|
|
93
|
+
window.${O} = ${ke}
|
|
94
|
+
`,Ee=(e,t)=>`
|
|
95
|
+
window.${M}(
|
|
96
|
+
"${t}",${JSON.stringify(e)}, ${J}
|
|
97
|
+
)`,Re=({contentId:e,variationId:t})=>`window.${O}(
|
|
98
|
+
"${t}", "${e}", ${J}
|
|
99
|
+
)`;function j(e){return h.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}function K(e){return Math.round(e*1e3)/1e3}const Fe=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let a=n?e:e.parentElement;do{if(!a)return null;if(t(a))return a}while(a=a.parentElement);return null},Pe=e=>Fe(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(),a=e.clientX-n.left,u=e.clientY-n.top,p=K(a/n.width),i=K(u/n.height);return{x:p,y:i}},We=e=>{const t=e.target,n=t&&Pe(t),a=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:a||void 0,metadata:{targetOffset:t?_({event:e,target:t}):void 0,builderTargetOffset:n?_({event:e,target:n}):void 0,builderElementIndex:n&&a?[].slice.call(document.getElementsByClassName(a)).indexOf(n):void 0}}},Ae=e=>{var p,i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],a=(i=e.fileUrl)!=null?i:(p=e==null?void 0:e.files)==null?void 0:p.regular;let u="";if(a&&t&&n&&(u+=`
|
|
100
|
+
@font-face {
|
|
101
|
+
font-family: "${t}";
|
|
102
|
+
src: local("${n}"), url('${a}') 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 y=e.files[o];y&&y!==a&&(u+=`
|
|
107
|
+
@font-face {
|
|
108
|
+
font-family: "${t}";
|
|
109
|
+
src: url('${y}') format('woff2');
|
|
110
|
+
font-display: fallback;
|
|
111
|
+
font-weight: ${o};
|
|
112
|
+
}
|
|
113
|
+
`.trim())}return u},je=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>Ae(n)))==null?void 0:t.join(" "))||""},qe=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",De=`
|
|
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
|
+
`,Ue=e=>e?"":De,Le=e=>`variant-${e}`;function He(e){var q,D,U,L,H,$,N;const t=r.useRef(null);function n(l){var f,c;const m={...e.builderContextSignal.rootState,...l};e.builderContextSignal.rootSetState?(c=(f=e.builderContextSignal).rootSetState)==null||c.call(f,m):e.setBuilderContextSignal(d=>({...d,rootState:m}))}function a(l){var f,c,d,b,E;const m={...e.builderContextSignal.content,...l,data:{...(f=e.builderContextSignal.content)==null?void 0:f.data,...l==null?void 0:l.data},meta:{...(c=e.builderContextSignal.content)==null?void 0:c.meta,...l==null?void 0:l.meta,breakpoints:((d=l==null?void 0:l.meta)==null?void 0:d.breakpoints)||((E=(b=e.builderContextSignal.content)==null?void 0:b.meta)==null?void 0:E.breakpoints)}};e.setBuilderContextSignal(x=>({...x,content:m}))}function u(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[p,i]=r.useState(()=>e.contentWrapper||"div");function o(l){return s.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:m=>{var d;const{breakpoints:f,contentId:c}=m;!c||c!==((d=e.builderContextSignal.content)==null?void 0:d.id)||f&&a({meta:{breakpoints:f}})},animation:m=>{w.triggerAnimation(m)},contentUpdate:m=>{a(m)}}})(l)}function g(){var m,f;const l=(f=(m=e.builderContextSignal.content)==null?void 0:m.data)==null?void 0:f.jsCode;l&&w.evaluate({code:l,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[y,C]=r.useState(()=>({})),[I,V]=r.useState(()=>({})),[R,F]=r.useState(()=>!1);function v(l){var m,f;if(e.builderContextSignal.content){const c=(m=e.builderContextSignal.content)==null?void 0:m.testVariationId,d=(f=e.builderContextSignal.content)==null?void 0:f.id;s._track({type:"click",canTrack:s.getDefaultCanTrack(e.canTrack),contentId:d,apiKey:e.apiKey,variationId:c!==d?c:void 0,...We(l),unique:!R})}R||F(!0)}function S(){var m,f,c;const l=(c=(f=(m=e.builderContextSignal.content)==null?void 0:m.data)==null?void 0:f.httpRequests)!=null?c:{};Object.entries(l).forEach(([d,b])=>{if(!b||I[d]||y[d]&&!s.isEditing())return;I[d]=!0;const E=b.replace(/{{([^}]+)}}/g,(x,Y)=>String(w.evaluate({code:Y,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));s.fetch(E).then(x=>x.json()).then(x=>{n({[d]:x}),y[d]=!0}).catch(x=>{console.error("error fetching dynamic data",b,x)}).finally(()=>{I[d]=!1})})}function T(){s.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:s.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return r.useEffect(()=>{var l,m;if(s.isBrowser()){if(s.isEditing()&&(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(c=>{var b;const d=s.createRegisterComponentMessage(c);(b=window.parent)==null||b.postMessage(d,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",T)),e.builderContextSignal.content&&s.getDefaultCanTrack(e.canTrack)){const c=(l=e.builderContextSignal.content)==null?void 0:l.testVariationId,d=(m=e.builderContextSignal.content)==null?void 0:m.id,b=e.apiKey;s._track({type:"impression",canTrack:!0,contentId:d,apiKey:b,variationId:c!==d?c:void 0})}if(s.isPreviewing()&&!s.isEditing()){const c=new URL(location.href).searchParams,d=c.get("builder.preview"),b=c.get(`builder.preview.${d}`),E=c.get("apiKey")||c.get("builder.space");d===e.model&&E===e.apiKey&&(!e.content||b===e.content.id)&&s.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(x=>{x&&a(x)})}}},[]),r.useEffect(()=>{e.apiKey||s.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),g(),S(),T()},[]),r.useEffect(()=>{e.content&&a(e.content)},[e.content]),r.useEffect(()=>{g()},[(D=(q=e.builderContextSignal.content)==null?void 0:q.data)==null?void 0:D.jsCode]),r.useEffect(()=>{S()},[(L=(U=e.builderContextSignal.content)==null?void 0:U.data)==null?void 0:L.httpRequests]),r.useEffect(()=>{T()},[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",T))},[]),h.jsx(k.BuilderContext.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?h.jsx(p,{ref:t,onClick:l=>v(l),"builder-content-id":(H=e.builderContextSignal.content)==null?void 0:H.id,"builder-model":e.model,...u(),...e.contentWrapperProps,className:Le((($=e.content)==null?void 0:$.testVariationId)||((N=e.content)==null?void 0:N.id)),children:e.children}):null})}function $e(e){const[t,n]=r.useState(()=>`
|
|
131
|
+
${qe({cssCode:e.cssCode,contentId:e.contentId})}
|
|
132
|
+
${je({customFonts:e.customFonts})}
|
|
133
|
+
${Ue(e.isNestedRender)}
|
|
134
|
+
`.trim());return h.jsx(w.InlinedStyles,{id:"builderio-content",styles:t})}const Ne=({content:e,data:t,locale:n})=>{var p,i,o;const a={},u=((p=e==null?void 0:e.data)==null?void 0:p.state)||{};return(o=(i=e==null?void 0:e.data)==null?void 0:i.inputs)==null||o.forEach(g=>{g.name&&g.defaultValue!==void 0&&(a[g.name]=g.defaultValue)}),{...a,...u,...t,...n?{locale:n}:{}}},Be=({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 g,y,C,I,V,R,F;const[t,n]=r.useState(()=>{var v,S;return Re({variationId:(v=e.content)==null?void 0:v.testVariationId,contentId:(S=e.content)==null?void 0:S.id})});function a(v){o(S=>({...S,rootState:v}))}const[u,p]=r.useState(()=>[...B(),...e.customComponents||[]].reduce((v,{component:S,...T})=>({...v,[T.name]:{component:S,...s.serializeComponentInfo(T)}}),{})),[i,o]=r.useState(()=>({content:Be({content:e.content,data:e.data}),localState:void 0,rootState:Ne({content:e.content,data:e.data,locale:e.locale}),rootSetState:a,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...B(),...e.customComponents||[]].reduce((v,{component:S,...T})=>({...v,[T.name]:s.serializeComponentInfo(T)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}}));return h.jsx(w.ComponentsContext.Provider,{value:{registeredComponents:u},children:h.jsxs(He,{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:i,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,setBuilderContextSignal:o,children:[e.isSsrAbTest?h.jsx(j,{id:"builderio-variant-visibility",scriptStr:t}):null,h.jsx($e,{isNestedRender:e.isNestedRender,contentId:(g=i.content)==null?void 0:g.id,cssCode:(C=(y=i.content)==null?void 0:y.data)==null?void 0:C.cssCode,customFonts:(V=(I=i.content)==null?void 0:I.data)==null?void 0:V.customFonts}),h.jsx(w.Blocks,{blocks:(F=(R=i.content)==null?void 0:R.data)==null?void 0:F.blocks,context:i,registeredComponents:u,linkComponent:e.linkComponent})]})})}function Ke(e){var i;const[t,n]=r.useState(()=>Ce({canTrack:s.getDefaultCanTrack(e.canTrack),content:e.content}));function a(){var o;return Ee(P(e.content).map(g=>({id:g.testVariationId,testRatio:g.testRatio})),((o=e.content)==null?void 0:o.id)||"")}function u(){return P(e.content).map(o=>`.variant-${o.testVariationId} { display: none; } `).join("")}function p(){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(j,{id:"builderio-init-variants-fns",scriptStr:Ve()}):null,t?h.jsxs(h.Fragment,{children:[h.jsx(w.InlinedStyles,{id:"builderio-variants",styles:u()}),h.jsx(j,{id:"builderio-variants-visibility",scriptStr:a()}),(i=P(e.content))==null?void 0:i.map(o=>h.jsx(z,{isNestedRender:e.isNestedRender,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,{isNestedRender:e.isNestedRender,content:p(),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=Ke;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as N, Fragment as w, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as J, useState as y } from "react";
|
|
3
|
-
import { Block as O, Blocks as S, set as U } from "./blocks-
|
|
4
|
-
import { isEditing as j } from "./server-entry-
|
|
3
|
+
import { Block as O, Blocks as S, set as U } from "./blocks-7c1422af.js";
|
|
4
|
+
import { isEditing as j } from "./server-entry-cb8ad418.js";
|
|
5
5
|
import "./blocks-exports.mjs";
|
|
6
|
-
import "./get-class-prop-name-
|
|
6
|
+
import "./get-class-prop-name-58140fb7.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
const R = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], $ = () => {
|
|
9
9
|
const e = process.env.NODE_ENV || "production";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),m=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),m=require("./blocks-8c31869c.cjs"),P=require("./server-entry-d9413c6f.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-c793129b.cjs");require("./dynamic-renderer-b29b45ca.cjs");const B=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return B.includes(e)?e:"production"},A=(e,i,S)=>{const a=String.prototype.split.call(i,/[,[\].]+?/).filter(Boolean).reduce((c,b)=>c!=null?c[b]:c,e);return a===void 0||a===e?S:a};function O(e){var x,E;const i=y.useRef(null),[S,a]=y.useState(()=>"unsubmitted"),[c,b]=y.useState(()=>null),[J,T]=y.useState(()=>"");function q(s){var f,g;const u={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(g=(f=e.builderContext).rootSetState)==null||g.call(f,u):e.builderContext.rootState=u}function h(){return P.isEditing()&&e.previewState||S}function F(s){var f;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const g=s.currentTarget,k=e.customHeaders||{};let v;const N=new FormData(g),C=Array.from(s.currentTarget.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const l=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:l,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:l,value:n}});let d=e.contentType;if(e.sendSubmissionsTo==="email"&&(d="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(d="multipart/form-data")}),d!=="application/json")v=N;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{m.set(t,l,n)}),v=JSON.stringify(t)}d&&d!=="multipart/form-data"&&(u&&((f=e.action)!=null&&f.includes("zapier.com"))||(k["content-type"]=d));const j=new CustomEvent("presubmit",{detail:{body:v}});if(i.current&&(i.current.dispatchEvent(j),j.defaultPrevented))return;a("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||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:v,headers:k,method:e.method||"post"}).then(async t=>{let n;const l=t.headers.get("content-type");if(l&&l.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let r=A(n,e.errorMessagePath);r&&(typeof r!="string"&&(r=JSON.stringify(r)),T(r),q({formErrorMessage:r}))}if(b(n),a(t.ok?"success":"error"),t.ok){const r=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(i.current){if(i.current.dispatchEvent(r),r.defaultPrevented)return;e.resetFormOnSubmit!==!1&&i.current.reset()}if(e.successUrl)if(i.current){const M=new CustomEvent("route",{detail:{url:e.successUrl}});i.current.dispatchEvent(M),M.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});i.current&&(i.current.dispatchEvent(n),n.defaultPrevented)||(b(t),a("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:i,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>F(s),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(E=(x=e.builderBlock)==null?void 0:x.children)==null?void 0:E.map((s,u)=>o.jsx(m.Block,{block:s,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null,h()==="error"?o.jsx(m.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,h()==="sending"?o.jsx(m.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,h()==="error"&&c?o.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(c,null,2)}):null,h()==="success"?o.jsx(m.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TARGET as e } from "./server-entry-
|
|
1
|
+
import { TARGET as e } from "./server-entry-cb8ad418.js";
|
|
2
2
|
const a = () => {
|
|
3
3
|
switch (e) {
|
|
4
4
|
case "react":
|
|
@@ -9,6 +9,7 @@ const a = () => {
|
|
|
9
9
|
case "vue":
|
|
10
10
|
case "solid":
|
|
11
11
|
case "qwik":
|
|
12
|
+
case "angular":
|
|
12
13
|
return "class";
|
|
13
14
|
}
|
|
14
15
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./server-entry-d9413c6f.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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime");function h(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 h(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],d=i.match("x")?i:`${i}x`;return h(`${n[0]}_${d}${a}`)}return null}function r(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 j(e){var a,d,s,m,u,f;function i(){var g;const o=e.image||e.src;if(!o||!(o.match(/builder\.io/)||o.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((g=e.image)!=null&&g.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),r(o)}else if(e.image&&!e.srcset)return r(o);return r(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:"lazy",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-3ac67dd4",src:e.image,srcSet:i(),sizes:e.sizes})]}),e.aspectRatio&&!((d=(a=e.builderBlock)==null?void 0:a.children)!=null&&d.length&&e.fitContent)?c.jsx("div",{className:"builder-image-sizer div-3ac67dd4",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length&&e.fitContent?c.jsx(c.Fragment,{children:e.children}):null,!e.fitContent&&((f=(u=e.builderBlock)==null?void 0:u.children)!=null&&f.length)?c.jsx("div",{className:"div-3ac67dd4-2",children:e.children}):null]}),c.jsx("style",{children:`.img-3ac67dd4 {
|
|
2
|
+
opacity: 1;
|
|
3
|
+
transition: opacity 0.2s ease-in-out;
|
|
4
|
+
}.div-3ac67dd4 {
|
|
5
|
+
width: 100%;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
font-size: 0;
|
|
8
|
+
}.div-3ac67dd4-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=j;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
function
|
|
1
|
+
import { jsxs as r, Fragment as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
function x(e) {
|
|
3
3
|
return e.replace(/http(s)?:/, "");
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function $(e = "", i, t) {
|
|
6
6
|
const n = new RegExp("([?&])" + i + "=.*?(&|$)", "i"), c = e.indexOf("?") !== -1 ? "&" : "?";
|
|
7
7
|
return e.match(n) ? e.replace(n, "$1" + i + "=" + encodeURIComponent(t) + "$2") : e + c + i + "=" + encodeURIComponent(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function v(e, i) {
|
|
10
10
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !i)
|
|
11
11
|
return e;
|
|
12
12
|
if (i === "master")
|
|
13
|
-
return
|
|
13
|
+
return x(e);
|
|
14
14
|
const t = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
15
15
|
if (t) {
|
|
16
|
-
const n = e.split(t[0]), c = t[3],
|
|
17
|
-
return
|
|
16
|
+
const n = e.split(t[0]), c = t[3], d = i.match("x") ? i : `${i}x`;
|
|
17
|
+
return x(`${n[0]}_${d}${c}`);
|
|
18
18
|
}
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
@@ -25,20 +25,20 @@ function s(e) {
|
|
|
25
25
|
if (e.match(/builder\.io/)) {
|
|
26
26
|
let t = e;
|
|
27
27
|
const n = Number(e.split("?width=")[1]);
|
|
28
|
-
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) => `${$(e, "width", c)} ${c}w`).concat([t]).join(", ");
|
|
29
29
|
}
|
|
30
|
-
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;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
var c,
|
|
32
|
+
function y(e) {
|
|
33
|
+
var c, d, u, f, h, g;
|
|
34
34
|
function i() {
|
|
35
|
-
var
|
|
35
|
+
var b;
|
|
36
36
|
const a = e.image || e.src;
|
|
37
37
|
if (!a || // We can auto add srcset for cdn.builder.io and shopify
|
|
38
38
|
// images, otherwise you can supply this prop manually
|
|
39
39
|
!(a.match(/builder\.io/) || a.match(/cdn\.shopify\.com/)))
|
|
40
40
|
return e.srcset;
|
|
41
|
-
if (e.srcset && ((
|
|
41
|
+
if (e.srcset && ((b = e.image) != null && b.includes("builder.io/api/v1/image"))) {
|
|
42
42
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
43
43
|
return console.debug("Removed given srcset"), s(a);
|
|
44
44
|
} else if (e.image && !e.srcset)
|
|
@@ -59,9 +59,9 @@ function v(e) {
|
|
|
59
59
|
};
|
|
60
60
|
return e.aspectRatio ? l : void 0;
|
|
61
61
|
}
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ r(m, { children: [
|
|
63
|
+
/* @__PURE__ */ r(m, { children: [
|
|
64
|
+
/* @__PURE__ */ r("picture", { children: [
|
|
65
65
|
t() ? /* @__PURE__ */ o("source", { type: "image/webp", srcSet: t() }) : null,
|
|
66
66
|
/* @__PURE__ */ o(
|
|
67
67
|
"img",
|
|
@@ -74,33 +74,33 @@ function v(e) {
|
|
|
74
74
|
objectFit: e.backgroundSize || "cover",
|
|
75
75
|
...n()
|
|
76
76
|
},
|
|
77
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
77
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-3ac67dd4",
|
|
78
78
|
src: e.image,
|
|
79
79
|
srcSet: i(),
|
|
80
80
|
sizes: e.sizes
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
] }),
|
|
84
|
-
e.aspectRatio && !((
|
|
84
|
+
e.aspectRatio && !((d = (c = e.builderBlock) == null ? void 0 : c.children) != null && d.length && e.fitContent) ? /* @__PURE__ */ o(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
|
-
className: "builder-image-sizer div-
|
|
87
|
+
className: "builder-image-sizer div-3ac67dd4",
|
|
88
88
|
style: {
|
|
89
89
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
) : null,
|
|
93
93
|
(f = (u = e.builderBlock) == null ? void 0 : u.children) != null && f.length && e.fitContent ? /* @__PURE__ */ o(m, { children: e.children }) : null,
|
|
94
|
-
!e.fitContent && e.children ? /* @__PURE__ */ o("div", { className: "div-
|
|
94
|
+
!e.fitContent && ((g = (h = e.builderBlock) == null ? void 0 : h.children) != null && g.length) ? /* @__PURE__ */ o("div", { className: "div-3ac67dd4-2", children: e.children }) : null
|
|
95
95
|
] }),
|
|
96
|
-
/* @__PURE__ */ o("style", { children: `.img-
|
|
96
|
+
/* @__PURE__ */ o("style", { children: `.img-3ac67dd4 {
|
|
97
97
|
opacity: 1;
|
|
98
98
|
transition: opacity 0.2s ease-in-out;
|
|
99
|
-
}.div-
|
|
99
|
+
}.div-3ac67dd4 {
|
|
100
100
|
width: 100%;
|
|
101
101
|
pointer-events: none;
|
|
102
102
|
font-size: 0;
|
|
103
|
-
}.div-
|
|
103
|
+
}.div-3ac67dd4-2 {
|
|
104
104
|
display: flex;
|
|
105
105
|
flex-direction: column;
|
|
106
106
|
align-items: stretch;
|
|
@@ -113,5 +113,5 @@ function v(e) {
|
|
|
113
113
|
] });
|
|
114
114
|
}
|
|
115
115
|
export {
|
|
116
|
-
|
|
116
|
+
y as default
|
|
117
117
|
};
|
|
@@ -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-d9413c6f.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-d9413c6f.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.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blocks as o, BuilderContext as i, Button as s, Columns as n, Content as c, Fragment as g, Image as m, Section as a, Symbol as d, Text as l, Video as u } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as f, createRegisterComponentMessage as B, fetchBuilderProps as C, fetchEntries as E, fetchOneEntry as h, getBuilderSearchParams as x, isEditing as S, isPreviewing as b, register as P, setEditorSettings as k, subscribeToEditor as y, track as R } from "./server-entry-
|
|
2
|
+
import { _processContentResult as f, createRegisterComponentMessage as B, fetchBuilderProps as C, fetchEntries as E, fetchOneEntry as h, getBuilderSearchParams as x, isEditing as S, isPreviewing as b, register as P, setEditorSettings as k, subscribeToEditor as y, track as R } from "./server-entry-cb8ad418.js";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
5
5
|
o as Blocks,
|
package/lib/edge/init.cjs
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("isolated-vm")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ivm=require("isolated-vm"),serverEntry=require("./server-entry-d9413c6f.cjs"),noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const INJECTED_IVM_GLOBAL="BUILDER_IVM";let IVM_INSTANCE=null;const setIvm=(e,t={})=>{IVM_INSTANCE=e,setIsolateContext(t)},getIvm=()=>{try{if(IVM_INSTANCE)return IVM_INSTANCE;const e=safeDynamicRequire("isolated-vm");if(e)return e}catch(e){serverEntry.logger.error("isolated-vm import error.",e)}throw new Error(`${serverEntry.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
2
|
+
|
|
3
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
4
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
5
|
+
a server-only execution path within your application.
|
|
6
|
+
|
|
7
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
8
|
+
`)};function setIsolateContext(e={memoryLimit:128}){const t=getIvm(),n=new t.Isolate(e).createContextSync(),i=n.global;return i.setSync("global",i.derefInto()),i.setSync("log",function(...o){console.log(...o)}),i.setSync(INJECTED_IVM_GLOBAL,t),n}const initializeNodeRuntime=({ivmIsolateOptions:e})=>{setIvm(ivm,e)};exports.initializeNodeRuntime=initializeNodeRuntime;
|
package/lib/edge/init.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "isolated-vm";
|
|
1
|
+
import ivm from "isolated-vm";
|
|
2
|
+
import { logger, MSG_PREFIX } from "./server-entry-cb8ad418.js";
|
|
2
3
|
const noop = () => {
|
|
3
4
|
};
|
|
4
5
|
let safeDynamicRequire = noop;
|
|
@@ -6,7 +7,41 @@ try {
|
|
|
6
7
|
safeDynamicRequire = eval("require");
|
|
7
8
|
} catch (e) {
|
|
8
9
|
}
|
|
9
|
-
const
|
|
10
|
+
const INJECTED_IVM_GLOBAL = "BUILDER_IVM";
|
|
11
|
+
let IVM_INSTANCE = null;
|
|
12
|
+
const setIvm = (e, t = {}) => {
|
|
13
|
+
IVM_INSTANCE = e, setIsolateContext(t);
|
|
14
|
+
}, getIvm = () => {
|
|
15
|
+
try {
|
|
16
|
+
if (IVM_INSTANCE)
|
|
17
|
+
return IVM_INSTANCE;
|
|
18
|
+
const e = safeDynamicRequire("isolated-vm");
|
|
19
|
+
if (e)
|
|
20
|
+
return e;
|
|
21
|
+
} catch (e) {
|
|
22
|
+
logger.error("isolated-vm import error.", e);
|
|
23
|
+
}
|
|
24
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
25
|
+
|
|
26
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
27
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
28
|
+
a server-only execution path within your application.
|
|
29
|
+
|
|
30
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
31
|
+
`);
|
|
32
|
+
};
|
|
33
|
+
function setIsolateContext(e = {
|
|
34
|
+
memoryLimit: 128
|
|
35
|
+
}) {
|
|
36
|
+
const t = getIvm(), i = new t.Isolate(e).createContextSync(), o = i.global;
|
|
37
|
+
return o.setSync("global", o.derefInto()), o.setSync("log", function(...n) {
|
|
38
|
+
console.log(...n);
|
|
39
|
+
}), o.setSync(INJECTED_IVM_GLOBAL, t), i;
|
|
40
|
+
}
|
|
41
|
+
const initializeNodeRuntime = ({
|
|
42
|
+
ivmIsolateOptions: e
|
|
43
|
+
}) => {
|
|
44
|
+
setIvm(ivm, e);
|
|
10
45
|
};
|
|
11
46
|
export {
|
|
12
47
|
initializeNodeRuntime
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./server-entry-d9413c6f.cjs");function a(e){return t.createElement("input",{...e.attributes,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),r=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),r=require("./server-entry-d9413c6f.cjs");function i(e){var a;return n.createElement("select",{...e.attributes,value:e.value,key:r.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(a=e.options)==null?void 0:a.map((t,u)=>l.jsx("option",{value:t.value,children:t.name||t.value},`${t.name}-${u}`)))}exports.default=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as m } from "react";
|
|
3
|
-
import { isEditing as n } from "./server-entry-
|
|
3
|
+
import { isEditing as n } from "./server-entry-cb8ad418.js";
|
|
4
4
|
function r(e) {
|
|
5
5
|
var t;
|
|
6
6
|
return /* @__PURE__ */ m(
|
|
@@ -302,7 +302,7 @@ function $(e, t) {
|
|
|
302
302
|
const n = new URL(t.origin), r = n.hostname;
|
|
303
303
|
return (e || Ee).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
304
304
|
}
|
|
305
|
-
const Pe = "1.0.
|
|
305
|
+
const Pe = "1.0.25", He = () => {
|
|
306
306
|
ne("insertMenu", {
|
|
307
307
|
name: "_default",
|
|
308
308
|
default: !0,
|
|
@@ -656,6 +656,7 @@ const Ye = async (e) => {
|
|
|
656
656
|
};
|
|
657
657
|
};
|
|
658
658
|
export {
|
|
659
|
+
b as MSG_PREFIX,
|
|
659
660
|
I as TARGET,
|
|
660
661
|
_e as _processContentResult,
|
|
661
662
|
ke as _track,
|