@builder.io/sdk-react 2.0.12 → 2.0.13
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 +20 -20
- package/lib/browser/blocks-exports.mjs +445 -434
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/{node/server-entry-dc66de59.js → browser/server-entry-288f3748.js} +1 -1
- package/lib/browser/{server-entry-acf08871.cjs → server-entry-7304506e.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-37ff8319.js → accordion-3cfa3eee.js} +1 -1
- package/lib/edge/{accordion-b3b8c262.cjs → accordion-807094e8.cjs} +1 -1
- package/lib/edge/{blocks-e0e60319.js → blocks-54e76c48.js} +220 -211
- package/lib/edge/blocks-ec210226.cjs +12 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-15992755.js → button-0d89818e.js} +2 -2
- package/lib/edge/{button-875ac10b.cjs → button-e3dbd868.cjs} +1 -1
- package/lib/edge/{columns-11ead988.cjs → columns-f4875265.cjs} +1 -1
- package/lib/edge/{columns-cfe663b2.js → columns-f9a7710d.js} +4 -4
- package/lib/edge/{content-variants-e780597b.js → content-variants-8ab0c195.js} +13 -12
- package/lib/edge/{content-variants-f8ef104d.cjs → content-variants-aadc6d6c.cjs} +1 -1
- package/lib/edge/{evaluate-6408d64d.js → evaluate-1ef00edc.js} +1 -1
- package/lib/edge/{evaluate-938a955e.cjs → evaluate-4d70dcda.cjs} +1 -1
- package/lib/edge/{form-7735178f.js → form-0e3e79d5.js} +4 -4
- package/lib/edge/{form-75a774bc.cjs → form-8edb1a1e.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-d005a2bb.js → get-class-prop-name-c8375d5b.js} +1 -1
- package/lib/edge/{get-class-prop-name-e596650d.cjs → get-class-prop-name-f64b085a.cjs} +1 -1
- package/lib/edge/{img-045bb860.js → img-411548cf.js} +1 -1
- package/lib/edge/{img-dd79e34b.cjs → img-a63de542.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-3bd0ac03.cjs → input-59f88558.cjs} +1 -1
- package/lib/edge/{input-adf80016.js → input-a31ad183.js} +1 -1
- package/lib/edge/{select-882193d4.cjs → select-31a4a930.cjs} +1 -1
- package/lib/edge/{select-90b076db.js → select-bfc6e2dd.js} +1 -1
- package/lib/edge/{server-entry-84c3cdd6.js → server-entry-899f7119.js} +1 -1
- package/lib/edge/{server-entry-d5ae6221.cjs → server-entry-f0b40e5b.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-293114eb.js → slot-634372d2.js} +12 -11
- package/lib/edge/slot-c9228b15.cjs +1 -0
- package/lib/edge/{symbol-3e0799b8.cjs → symbol-10d573de.cjs} +1 -1
- package/lib/edge/{symbol-aed9cd2b.js → symbol-32a5d0f7.js} +2 -2
- package/lib/edge/{tabs-0cf37bf4.js → tabs-52ed1067.js} +4 -4
- package/lib/edge/{tabs-f5c4f350.cjs → tabs-71e3e002.cjs} +1 -1
- package/lib/edge/{text-abb84188.cjs → text-853d6ef4.cjs} +1 -1
- package/lib/edge/{text-9e2166c7.js → text-ea8a6161.js} +2 -2
- package/lib/node/blocks-exports.cjs +20 -20
- package/lib/node/blocks-exports.mjs +442 -431
- 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 +2 -2
- package/lib/node/{node-runtime-49e4c6cb.js → node-runtime-792d0497.js} +1 -1
- package/lib/node/{node-runtime-11912803.cjs → node-runtime-8348be9f.cjs} +1 -1
- package/lib/{browser/server-entry-dc66de59.js → node/server-entry-288f3748.js} +1 -1
- package/lib/node/{server-entry-acf08871.cjs → server-entry-7304506e.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/slot/slot.d.ts +2 -2
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/blocks-793430a0.cjs +0 -12
- package/lib/edge/slot-42b9b358.cjs +0 -1
package/lib/node/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-7304506e.cjs");require("react/jsx-runtime");require("react");require("./node-runtime-8348be9f.cjs");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/node/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Blocks as s, BuilderContext as n, Button as m, Columns as c, Content as g, Fragment as a, Image as p, Section as d, Symbol as l, Text as u, Video as f } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as C, createRegisterComponentMessage as E, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as b, isEditing as P, isPreviewing as k, register as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-
|
|
2
|
+
import { _processContentResult as C, createRegisterComponentMessage as E, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as b, isEditing as P, isPreviewing as k, register as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-288f3748.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./node-runtime-
|
|
5
|
+
import "./node-runtime-792d0497.js";
|
|
6
6
|
export {
|
|
7
7
|
s as Blocks,
|
|
8
8
|
n as BuilderContext,
|
package/lib/node/init.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("isolated-vm"),n=require("./node-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("isolated-vm"),n=require("./node-runtime-8348be9f.cjs");require("./server-entry-7304506e.cjs");const o=e=>{const{ivmIsolateOptions:i}=e||{};n.setIvm(t,i)};exports.initializeNodeRuntime=o;
|
package/lib/node/init.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "isolated-vm";
|
|
2
|
-
import { setIvm as m } from "./node-runtime-
|
|
3
|
-
import "./server-entry-
|
|
2
|
+
import { setIvm as m } from "./node-runtime-792d0497.js";
|
|
3
|
+
import "./server-entry-288f3748.js";
|
|
4
4
|
const p = (i) => {
|
|
5
5
|
const {
|
|
6
6
|
ivmIsolateOptions: o
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-
|
|
1
|
+
import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-288f3748.js";
|
|
2
2
|
const getFunctionArguments = ({
|
|
3
3
|
builder: e,
|
|
4
4
|
context: t,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const serverEntry=require("./server-entry-
|
|
1
|
+
"use strict";const serverEntry=require("./server-entry-7304506e.cjs"),getFunctionArguments=({builder:e,context:t,event:s,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:s}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"react-nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,s)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,o,i)=>Object(n[o])===n[o]?n[o]:n[o]=Math.abs(Number(r[i+1]))>>0===+r[i+1]?[]:{},e)[r[r.length-1]]=s,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -302,7 +302,7 @@ function $(t, e) {
|
|
|
302
302
|
const n = new URL(e.origin), r = n.hostname;
|
|
303
303
|
return (t || kt).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
304
304
|
}
|
|
305
|
-
const Et = "2.0.
|
|
305
|
+
const Et = "2.0.13", zt = () => {
|
|
306
306
|
ot("insertMenu", {
|
|
307
307
|
name: "_default",
|
|
308
308
|
default: !0,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const I="react",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const ce=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ce(e):e,U=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ue(){return c()&&window.self!==window.top}function F(e){return ue()&&U(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const de=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},le=()=>typeof navigator=="object"&&navigator.userAgent||"",N=()=>{const e=le(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=de();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},p=e=>e!=null;function fe(e){const t=e||(c()?window.location.search:void 0);return t?U(t).indexOf("builder.preview=")!==-1:!1}const ge=e=>({type:"builder.registerComponent",data:k(e)}),he=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function k(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?he(n):n))}const x={};function D(e,t){e==="plugin"&&(t=k(t));let n=x[e];if(n||(n=x[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const R={};function pe(e){if(c()){Object.assign(R,e);const t={type:"builder.settingsChange",data:R};parent.postMessage(t,"*")}}const B="builder.",me="options.",P=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(B)){const o=r.replace(B,"").replace(me,"");n[o]=t[r]}}),n},ye=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return P(e)},Se=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},j=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async e=>j(e),we=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),be=[["secure",""],["SameSite","None"]],Ie=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?be:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",Se(window.location.hostname)],...o];return we(a)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=Ie({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function ve(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function W(){return ve().replace(/-/g,"")}const $="builderSessionId",Ee=async({canTrack:e})=>{if(!e)return;const t=await K({name:$,canTrack:e});if(p(t))return t;{const n=ke();return Pe({id:n,canTrack:e}),n}},ke=()=>W(),Pe=({id:e,canTrack:t})=>_({name:$,value:e,canTrack:t}),G=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ce=({key:e,canTrack:t})=>{var n;try{return t?(n=G())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Oe=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=G())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},z="builderVisitorId",Ae=({canTrack:e})=>{if(!e)return;const t=Ce({key:z,canTrack:e});if(p(t))return t;{const n=Te();return xe({id:n,canTrack:e}),n}},Te=()=>W(),xe=({id:e,canTrack:t})=>Oe({key:z,value:e,canTrack:t}),Re=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ee({canTrack:e}),n=Ae({canTrack:e});return{sessionId:t,visitorId:n}},Be=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Re({canTrack:t}),userAttributes:N(),ownerId:n}});async function J(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(c()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Be(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Le=e=>J({...e,canTrack:!0}),Ve=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function H(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||Ve).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Me="2.0.
|
|
1
|
+
"use strict";const I="react",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const ce=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ce(e):e,U=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ue(){return c()&&window.self!==window.top}function F(e){return ue()&&U(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const de=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},le=()=>typeof navigator=="object"&&navigator.userAgent||"",N=()=>{const e=le(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=de();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},p=e=>e!=null;function fe(e){const t=e||(c()?window.location.search:void 0);return t?U(t).indexOf("builder.preview=")!==-1:!1}const ge=e=>({type:"builder.registerComponent",data:k(e)}),he=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function k(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?he(n):n))}const x={};function D(e,t){e==="plugin"&&(t=k(t));let n=x[e];if(n||(n=x[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const R={};function pe(e){if(c()){Object.assign(R,e);const t={type:"builder.settingsChange",data:R};parent.postMessage(t,"*")}}const B="builder.",me="options.",P=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(B)){const o=r.replace(B,"").replace(me,"");n[o]=t[r]}}),n},ye=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return P(e)},Se=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},j=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async e=>j(e),we=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),be=[["secure",""],["SameSite","None"]],Ie=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?be:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",Se(window.location.hostname)],...o];return we(a)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=Ie({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function ve(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function W(){return ve().replace(/-/g,"")}const $="builderSessionId",Ee=async({canTrack:e})=>{if(!e)return;const t=await K({name:$,canTrack:e});if(p(t))return t;{const n=ke();return Pe({id:n,canTrack:e}),n}},ke=()=>W(),Pe=({id:e,canTrack:t})=>_({name:$,value:e,canTrack:t}),G=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ce=({key:e,canTrack:t})=>{var n;try{return t?(n=G())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Oe=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=G())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},z="builderVisitorId",Ae=({canTrack:e})=>{if(!e)return;const t=Ce({key:z,canTrack:e});if(p(t))return t;{const n=Te();return xe({id:n,canTrack:e}),n}},Te=()=>W(),xe=({id:e,canTrack:t})=>Oe({key:z,value:e,canTrack:t}),Re=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ee({canTrack:e}),n=Ae({canTrack:e});return{sessionId:t,visitorId:n}},Be=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Re({canTrack:t}),userAttributes:N(),ownerId:n}});async function J(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(c()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Be(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Le=e=>J({...e,canTrack:!0}),Ve=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function H(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||Ve).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Me="2.0.13",Ue=()=>{D("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let L=!1;const X=(e={})=>{var t,n;L||(L=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:Me,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,a;if(!H(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const l=o.data.text,y=o.data.arguments||[],m=o.data.id,v=new Function(l);let u,g=null;try{u=v.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):u&&typeof u.then=="function"?u.then(h=>{var S;(S=window.parent)==null||S.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:m}},"*");break}}})))},q=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!H(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,a=s.key||s.alias||s.entry||s.modelName,l=s.data;a===e&&n.contentUpdate(l);break}}},Fe=(e,t,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};X();const r=q({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},Ne="builder.tests",C=e=>`${Ne}.${e}`,De=({contentId:e})=>K({name:C(e),canTrack:!0}),je=({contentId:e})=>j({name:C(e),canTrack:!0}),Ke=({contentId:e,value:t})=>_({name:C(e),value:t,canTrack:!0}),Q=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,_e=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const a=(o=t[s])==null?void 0:o.testRatio;if(n+=a,r<n)return s}return e},Y=e=>{const t=_e(e);return Ke({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},Z=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},We=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Q(e))return e;const n=je({contentId:e.id})||Y({variations:e.variations,id:e.id}),r=Z({item:e,testGroupId:n});return{...e,...r}},$e=async({item:e,canTrack:t})=>{if(!t||!Q(e))return e;const r=await De({contentId:e.id})||Y({variations:e.variations,id:e.id}),o=Z({item:e,testGroupId:r});return{...e,...o}},ee=e=>p(e)?e:!0;function Ge(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function ze(){const e=Ge().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
2
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const te=ze();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,a,n)}:{...r,[a]:s}},{})}function ne(e,t,n={}){for(const r in e){const o=e[r],s=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(a=>a.startsWith("$"))?ne(o,s,n):n[s]=o}return n}const Je="v3",V=e=>typeof e=="number"&&!isNaN(e)&&e>=0,O=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Je,fields:m,omit:v,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:S,includeUnpublished:A}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ie=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(ie)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",v||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof A=="boolean"&&i.searchParams.set("includeUnpublished",String(A)),g&&V(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&V(h)&&i.searchParams.set("staleCacheSeconds",String(h)),S){const f=E({sort:S});for(const w in f)i.searchParams.set(w,JSON.stringify(f[w]))}const ae={...ye(),...M(e.options||{})},T=E(ae);for(const f in T)i.searchParams.set(f,String(T[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=ne({query:r});for(const w in f)i.searchParams.set(w,JSON.stringify(f[w]))}return i},He=e=>"results"in e;async function re(e){const t=await se({...e,limit:1});return t&&t[0]||null}const Xe=async e=>{var s;const t=O(e);return await(await((s=e.fetch)!=null?s:te)(t.href,e.fetchOptions)).json()},oe=async(e,t,n=O(e))=>{const r=ee(e.canTrack);if(n.search.includes("preview="),!r||!(c()||I==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await $e({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function se(e){try{const t=O(e),n=await Xe(e);return He(n)?oe(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}const qe=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:P(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await re(n)}};exports.MSG_PREFIX=b;exports.TARGET=I;exports._processContentResult=oe;exports._track=J;exports.checkIsDefined=p;exports.createEditorListener=q;exports.createRegisterComponentMessage=ge;exports.fetch=te;exports.fetchBuilderProps=qe;exports.fetchEntries=se;exports.fetchOneEntry=re;exports.getBuilderSearchParams=P;exports.getDefaultCanTrack=ee;exports.getUserAttributes=N;exports.handleABTestingSync=We;exports.isBrowser=c;exports.isEditing=F;exports.isPreviewing=fe;exports.logger=d;exports.register=D;exports.registerInsertMenu=Ue;exports.serializeIncludingFunctions=k;exports.setEditorSettings=pe;exports.setupBrowserForEditing=X;exports.subscribeToEditor=Fe;exports.track=Le;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-7304506e.cjs");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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-288f3748.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export type DropzoneProps = BuilderDataProps & {
|
|
2
|
+
export type DropzoneProps = BuilderDataProps & BuilderComponentsProp & {
|
|
3
3
|
name: string;
|
|
4
4
|
attributes: any;
|
|
5
5
|
};
|
|
6
|
-
import type { BuilderDataProps } from "../../types/builder-props";
|
|
6
|
+
import type { BuilderComponentsProp, BuilderDataProps } from "../../types/builder-props";
|
|
7
7
|
declare function Slot(props: DropzoneProps): React.JSX.Element;
|
|
8
8
|
export default Slot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.13";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("react/jsx-runtime"),y=require("react"),T=require("./blocks-exports.cjs"),p=require("./server-entry-d5ae6221.cjs"),v=require("./evaluate-938a955e.cjs"),z=require("./get-class-prop-name-e596650d.cjs"),K=require("./dynamic-renderer-b29b45ca.cjs"),j=e=>JSON.parse(JSON.stringify(e)),W=y.createContext({registeredComponents:{}});function G(e){var n;return{...(n=e.component)==null?void 0:n.options,...e.options}}function V(e,...n){const t=Object.assign({},e);for(const r of n)delete t[r];return t}function w(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(t=>w(t));if(e["@type"]==="@builder.io/sdk:Element")return e;const n={};for(const t in e)t!=="meta"&&Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=w(e[t]));return n}const Z=["svelte","vue","angular","qwik","solid"].includes(p.TARGET),J=e=>{if(Z){const n=j(e);return{...n,properties:{...n.properties},actions:{...n.actions}}}else{const n=w(V(e,"children","meta"));return{...n,properties:{...n.properties},actions:{...n.actions},children:e.children,meta:e.meta}}},Q=({block:e,context:n,localState:t,rootState:r,rootSetState:o})=>{if(!e.bindings)return e;const s=J(e);for(const c in e.bindings){const u=e.bindings[c],f=v.evaluate({code:u,localState:t,rootState:r,rootSetState:o,context:n,enableCache:!0});v.set(s,c,f)}return s};function X({block:e,context:n,shouldEvaluateBindings:t,localState:r,rootState:o,rootSetState:s}){const c=e;return t?Q({block:c,localState:r,rootState:o,rootSetState:s,context:n}):c}const B=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function Y(e,n,t={}){let r,o,s,c=null,u=0;const f=function(){u=t.leading===!1?0:Date.now(),c=null,s=e.apply(r,o),c||(r=o=null)};return function(){const i=Date.now();!u&&t.leading===!1&&(u=i);const m=n-(i-u);return r=this,o=arguments,m<=0||m>n?(c&&(clearTimeout(c),c=null),u=i,s=e.apply(r,o),c||(r=o=null)):!c&&t.trailing!==!1&&(c=setTimeout(f,m)),s}}function S(e,...n){const t=Object(e);for(let r=1;r<arguments.length;r++){const o=arguments[r];if(o!=null)for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t}function ee(e){for(const n of e)switch(n.trigger){case"pageLoad":D(n);break;case"scrollInView":ne(n);break}}function $(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function N(e,n){const t=te(e),r=getComputedStyle(n),o=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,c=[o,s];for(const u of c)for(const f of t)f in u||(u[f]=r[f])}function te(e){const n=[];for(const t of e.steps)for(const r in t.styles)n.indexOf(r)===-1&&n.push(r);return n}function D(e){const n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!n.length){$(e.elementId||e.id||"");return}Array.from(n).forEach(t=>{N(e,t),t.style.transition="none",t.style.transitionDelay="0",S(t.style,e.steps[0].styles),setTimeout(()=>{t.style.transition=`all ${e.duration}s ${B(e.easing)}`,e.delay&&(t.style.transitionDelay=e.delay+"s"),S(t.style,e.steps[1].styles),setTimeout(()=>{t.style.transition="",t.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function ne(e){const n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!n.length){$(e.elementId||e.id||"");return}Array.from(n).forEach(t=>{N(e,t);let r=!1,o=!1;function s(){!r&&u(t)?(r=!0,o=!0,setTimeout(()=>{S(t.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",c),setTimeout(()=>{o=!1,e.repeat||(t.style.transition="",t.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&r&&!o&&!u(t)&&(r=!1,S(t.style,e.steps[0].styles))}const c=Y(s,200,{leading:!1});function u(m){const x=m.getBoundingClientRect(),k=window.innerHeight,a=(e.thresholdPercent||0)/100*k;return x.bottom>a&&x.top<k-a}const f=e.steps[0].styles;function i(){S(t.style,f)}i(),setTimeout(()=>{t.style.transition=`all ${e.duration}s ${B(e.easing)}`,e.delay&&(t.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",c,{capture:!0,passive:!0}),s()})}const F=e=>Object.entries(e).map(([t,r])=>{if(typeof r=="string")return`${B(t)}: ${r};`}).filter(p.checkIsDefined),oe=e=>F(e).join(`
|
|
2
|
-
`),b=({mediaQuery:e,className:n,styles:t})=>{const r=`.${n} {
|
|
3
|
-
${oe(t)}
|
|
4
|
-
}`;return e?`${e} {
|
|
5
|
-
${r}
|
|
6
|
-
}`:r};function re({style:e}){return e}const se=({block:e,context:n})=>_(re({style:e.style||{},context:n,block:e}));function _(e){switch(p.TARGET){case"svelte":case"vue":case"solid":case"angular":return F(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const ce=({block:e,registeredComponents:n})=>{var o;const t=(o=e.component)==null?void 0:o.name;if(!t)return null;const r=n[t];if(r)return r;console.warn(`
|
|
7
|
-
Could not find a registered component named "${t}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},le=({block:e,context:n})=>{const{repeat:t,...r}=e;if(!(t!=null&&t.collection))return;const o=v.evaluate({code:t.collection,localState:n.localState,rootState:n.rootState,rootSetState:n.rootSetState,context:n.context,enableCache:!0});if(!Array.isArray(o))return;const s=t.collection.split(".").pop(),c=t.itemName||(s?s+"Item":"item");return o.map((f,i)=>({context:{...n,localState:{...n.localState,$index:i,$item:f,[c]:f,[`$${c}Index`]:i}},block:r}))},ie=(e,n)=>{var t;return(t=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&t.builderLinkComponent?{builderLinkComponent:n}:{}},ae=(e,n)=>{var t;return(t=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&t.builderComponents?{builderComponents:n}:{}},ue=(e,n)=>{var t;return(t=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&t.builderBlock?{builderBlock:n}:{}},de=(e,n)=>{var t;return(t=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&t.builderContext?{builderContext:n}:{}},M={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},A=(e,n=M)=>`@media (max-width: ${n[e].max}px)`,L=({small:e,medium:n})=>{const t=j(M);if(!e||!n)return t;const r=Math.floor(e/2);t.small={max:e,min:r,default:r+1};const o=t.small.max+1;t.medium={max:n,min:o,default:o+1};const s=t.medium.max+1;return t.large={max:2e3,min:s,default:s+1},t};function q(e){return l.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function fe(e){function n(){const r=e.block;return p.checkIsDefined(r.hide)?!r.hide:p.checkIsDefined(r.show)?r.show:!0}function t(){var g,E,I;const r=e.block,o=r.responsiveStyles,s=e.context.content,c=L(((g=s==null?void 0:s.meta)==null?void 0:g.breakpoints)||{}),u=o==null?void 0:o.large,f=o==null?void 0:o.medium,i=o==null?void 0:o.small,m=r.id;if(!m)return"";const x=u?b({className:m,styles:u}):"",k=f?b({className:m,styles:f,mediaQuery:A("medium",c)}):"",d=i?b({className:m,styles:i,mediaQuery:A("small",c)}):"",a=r.animations&&r.animations.find(P=>P.trigger==="hover");let h="";if(a){const P=((I=(E=a.steps)==null?void 0:E[1])==null?void 0:I.styles)||{};h=b({className:`${m}:hover`,styles:{...P,transition:`all ${a.duration}s ${B(a.easing)}`,transitionDelay:a.delay?`${a.delay}s`:"0s"}})||""}return[x,k,d,h].join(" ")}return l.jsx(l.Fragment,{children:t()&&n()?l.jsx(l.Fragment,{children:l.jsx(q,{id:"builderio-block",styles:t(),nonce:e.context.nonce})}):null})}function me(e){return e.charAt(0).toUpperCase()+e.slice(1)}const he=e=>`on${me(e)}`,ye=(e,n)=>t=>v.evaluate({code:e,context:n.context,localState:n.localState,rootState:n.rootState,rootSetState:n.rootSetState,event:t,isExpression:!1,enableCache:!0});function H(e){var r;const n={},t=(r=e.block.actions)!=null?r:{};for(const o in t){if(!t.hasOwnProperty(o))continue;const s=t[o];let c=he(o);if(e.stripPrefix)switch(p.TARGET){case"vue":c=c.replace("v-on:","");break;case"svelte":c=c.replace("on:","");break}n[c]=ye(s,e)}return n}function pe({properties:e}){return e}const ge=e=>({href:e.href});function R({block:e,context:n}){var r;const t={...ge(e),...e.properties,"builder-id":e.id,style:se({block:e,context:n}),[z.getClassPropName()]:[e.id,"builder-block",e.class,(r=e.properties)==null?void 0:r.class].filter(Boolean).join(" ")};return pe({properties:t,context:n,block:e})}function xe(e){return l.jsx(K.DynamicRenderer,{TagName:e.Wrapper,attributes:R({block:e.block,context:e.context}),actionAttributes:H({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function ke(e){function n(){return e.includeBlockProps?{...R({block:e.block,context:e.context}),...H({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return l.jsx(e.Wrapper,{...e.wrapperProps,attributes:n(),children:e.children})}const Se=({componentOptions:e,builderBlock:n,context:t,componentRef:r,includeBlockProps:o,isInteractive:s,contextValue:c})=>{const u={...e,...o?{attributes:R({block:n,context:c})}:{}};return s?{Wrapper:r,block:n,context:t,wrapperProps:e,includeBlockProps:o}:u};function O(e){var r;const[n,t]=y.useState(()=>e.isInteractive?ke:e.componentRef);return l.jsx(l.Fragment,{children:e.componentRef?l.jsx(l.Fragment,{children:l.jsx(n,{...Se({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(r=e.blockChildren)==null?void 0:r.map(o=>l.jsx(C,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function Ce(e){const[n,t]=y.useState(()=>e.repeatContext);return l.jsx(T.BuilderContext.Provider,{value:n,children:l.jsx(C,{block:e.block,context:n,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function C(e){var m,x,k;function n(){return le({block:e.block,context:e.context})}const[t,r]=y.useState(()=>({value:null,update:!1}));function o(){var a;if(t.value&&!t.update&&!p.isPreviewing())return t.value;const d=(a=e.block.repeat)!=null&&a.collection?e.block:X({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return t.value=d,t.update=!1,d}function s(){return ce({block:o(),registeredComponents:e.registeredComponents})}function c(){var a;return e.block.tagName==="a"||((a=o().properties)==null?void 0:a.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"}function u(){var h,g;if((h=e.block.repeat)!=null&&h.collection)return!!((g=n==null?void 0:n())!=null&&g.length);const d="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!d}function f(){var a,h;return!((a=s==null?void 0:s())!=null&&a.component)&&!n()?(h=o().children)!=null?h:[]:[]}function i(){var d,a,h,g;return{blockChildren:(d=o().children)!=null?d:[],componentRef:(a=s==null?void 0:s())==null?void 0:a.component,componentOptions:{...G(o()),...ue(s(),o()),...de(s(),e.context),...ie(s(),e.linkComponent),...ae(s(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((h=s==null?void 0:s())==null?void 0:h.noWrap)===!0,isInteractive:!((g=s==null?void 0:s())!=null&&g.isRSC&&p.TARGET==="rsc")}}return y.useEffect(()=>{const d=o().id,a=o().animations;a&&d&&ee(a.map(h=>({...h,elementId:d})))},[]),y.useEffect(()=>{t.update=!0}),l.jsx(l.Fragment,{children:u()?l.jsxs(l.Fragment,{children:[l.jsx(fe,{block:o(),context:e.context}),(m=s==null?void 0:s())!=null&&m.noWrap?l.jsx(l.Fragment,{children:l.jsx(O,{componentRef:i().componentRef,componentOptions:i().componentOptions,blockChildren:i().blockChildren,context:i().context,registeredComponents:i().registeredComponents,linkComponent:i().linkComponent,builderBlock:i().builderBlock,includeBlockProps:i().includeBlockProps,isInteractive:i().isInteractive})}):l.jsx(l.Fragment,{children:n()?l.jsx(l.Fragment,{children:(k=n())==null?void 0:k.map((d,a)=>l.jsx(Ce,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},a))}):l.jsxs(xe,{Wrapper:c(),block:o(),context:e.context,children:[l.jsx(O,{componentRef:i().componentRef,componentOptions:i().componentOptions,blockChildren:i().blockChildren,context:i().context,registeredComponents:i().registeredComponents,linkComponent:i().linkComponent,builderBlock:i().builderBlock,includeBlockProps:i().includeBlockProps,isInteractive:i().isInteractive}),(x=f())==null?void 0:x.map(d=>l.jsx(C,{block:d,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},d.id))]})})]}):null})}function be(e){const n=y.useRef(null);function t(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function r(){var s,c;p.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((c=window.parent)==null||c.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var s,c;p.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((c=window.parent)==null||c.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return y.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:n,className:t()+" props-blocks-wrapper-51ef31b4","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>r(),onMouseEnter:s=>o(),onKeyPress:s=>r(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-51ef31b4 {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
align-items: stretch;
|
|
12
|
-
}`})]})}function U(e){var r,o,s;const n=y.useContext(T.BuilderContext),t=y.useContext(W);return l.jsx(be,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:((r=e.context)==null?void 0:r.BlocksWrapper)||n.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||n.BlocksWrapperProps,children:e.blocks?l.jsx(l.Fragment,{children:(s=e.blocks)==null?void 0:s.map(c=>l.jsx(C,{block:c,linkComponent:e.linkComponent,context:e.context||n,registeredComponents:e.registeredComponents||t.registeredComponents},c.id))}):null})}const ve=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));exports.Block=C;exports.Blocks=U;exports.ComponentsContext=W;exports.InlinedStyles=q;exports.blocks=ve;exports.fastClone=j;exports.getSizesForBreakpoints=L;exports.mapStyleObjToStrIfNeeded=_;exports.triggerAnimation=D;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-793430a0.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-d5ae6221.cjs");require("./evaluate-938a955e.cjs");require("./get-class-prop-name-e596650d.cjs");require("./dynamic-renderer-b29b45ca.cjs");function o(e){var t,r,n;return i.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:i.jsx(u.Blocks,{parent:(r=e.builderContext.context)==null?void 0:r.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(n=e.builderContext.rootState)==null?void 0:n[e.name]})})}exports.default=o;
|