@builder.io/sdk-react 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +17 -17
- package/lib/browser/blocks-exports.mjs +759 -740
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +6 -5
- package/lib/browser/server-entry-06504dba.cjs +2 -0
- package/lib/browser/{server-entry-065ec411.js → server-entry-074665de.js} +24 -13
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +7 -6
- package/lib/edge/{accordion-c239771d.cjs → accordion-0768e15a.cjs} +1 -1
- package/lib/edge/{accordion-79f6d62c.js → accordion-d3831f48.js} +1 -1
- package/lib/edge/{blocks-3cb3a9cd.js → blocks-0269007e.js} +105 -106
- package/lib/edge/{blocks-56f79850.cjs → blocks-2af1d7c9.cjs} +10 -10
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-759b43fb.cjs → button-050f4fef.cjs} +1 -1
- package/lib/edge/{button-6dee05c9.js → button-a478ff1a.js} +2 -2
- package/lib/edge/{columns-2743498a.js → columns-0b3181f1.js} +3 -3
- package/lib/edge/{columns-a29ec0ac.cjs → columns-25375990.cjs} +1 -1
- package/lib/edge/{content-variants-4d5a1e3c.js → content-variants-0dd65b50.js} +426 -415
- package/lib/edge/content-variants-4cab7215.cjs +302 -0
- package/lib/edge/{custom-code-6129bd8c.cjs → custom-code-eb5aedd2.cjs} +1 -1
- package/lib/edge/{custom-code-8034fac0.js → custom-code-f7a0f1c1.js} +1 -1
- package/lib/edge/{embed-b2ea5150.cjs → embed-69114c35.cjs} +1 -1
- package/lib/edge/{embed-f5b10eeb.js → embed-e4979560.js} +1 -1
- package/lib/edge/{form-14942d4f.js → form-30fba682.js} +27 -22
- package/lib/edge/form-7b4bd399.cjs +1 -0
- package/lib/edge/{get-class-prop-name-f6a63f4a.js → get-class-prop-name-770bdff2.js} +1 -1
- package/lib/edge/{get-class-prop-name-7e739c9f.cjs → get-class-prop-name-f470d5ce.cjs} +1 -1
- package/lib/edge/{img-ba2ef9ee.js → img-3bb375bf.js} +1 -1
- package/lib/edge/{img-f33a2e42.cjs → img-ddf74e12.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +4 -3
- package/lib/edge/{input-c2f95825.cjs → input-a6caf021.cjs} +1 -1
- package/lib/edge/{input-7089e95f.js → input-e4a9fe0b.js} +1 -1
- package/lib/edge/{personalization-container-eb1ecef2.js → personalization-container-64f3cd71.js} +4 -4
- package/lib/edge/{personalization-container-794b3939.cjs → personalization-container-f7030f08.cjs} +1 -1
- package/lib/edge/{select-af0bb9fe.cjs → select-c217566c.cjs} +1 -1
- package/lib/edge/{select-8f01592a.js → select-c59c9ac6.js} +1 -1
- package/lib/edge/server-entry-67200cf1.cjs +2 -0
- package/lib/edge/{server-entry-7c65c9a8.js → server-entry-fb5f2b80.js} +22 -11
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +7 -6
- package/lib/edge/{slot-2638fd6d.js → slot-26ec2911.js} +3 -3
- package/lib/edge/{slot-db37860e.cjs → slot-ccd946e2.cjs} +1 -1
- package/lib/edge/{symbol-7faca118.js → symbol-10cb2f77.js} +26 -23
- package/lib/edge/symbol-4548e942.cjs +1 -0
- package/lib/edge/tabs-82a9170c.cjs +1 -0
- package/lib/edge/{tabs-2eee6422.js → tabs-f9110171.js} +24 -23
- package/lib/node/blocks-exports.cjs +20 -20
- package/lib/node/blocks-exports.mjs +919 -900
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +6 -5
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-581dd491.js → server-entry-83d3751d.js} +24 -13
- package/lib/node/server-entry-d40e4b66.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +7 -6
- package/lib/node/{setIvm-2eb44b9d.cjs → setIvm-0a5b2ba2.cjs} +1 -1
- package/lib/node/{setIvm-8d02dc72.js → setIvm-596668c3.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-f461467e.js → should-force-browser-runtime-in-node-180c3315.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-ed3fa1f9.cjs → should-force-browser-runtime-in-node-5b9e373d.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/components/awaiter.d.ts +1 -11
- package/types/components/awaiter.types.d.ts +7 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/register.d.ts +18 -0
- package/types/server-index.d.ts +1 -1
- package/lib/browser/server-entry-09953757.cjs +0 -2
- package/lib/edge/content-variants-bdf1748b.cjs +0 -302
- package/lib/edge/form-26c3a03e.cjs +0 -1
- package/lib/edge/server-entry-142a50e9.cjs +0 -2
- package/lib/edge/symbol-630b9a57.cjs +0 -1
- package/lib/edge/tabs-502123df.cjs +0 -1
- package/lib/node/server-entry-375d06e8.cjs +0 -2
package/lib/edge/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blocks as i, BuilderContext as o, Button as s, Columns as n, Content as c, Fragment as g, Image as m, Section as a, Symbol as l, Text as u, Video as d } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as C, createRegisterComponentMessage as f, fetchBuilderProps as B, fetchEntries as E, fetchOneEntry as b, getBuilderSearchParams as h, isEditing as x, isPreviewing as S, register as P,
|
|
2
|
+
import { _processContentResult as C, createRegisterComponentMessage as f, fetchBuilderProps as B, fetchEntries as E, fetchOneEntry as b, getBuilderSearchParams as h, isEditing as x, isPreviewing as S, register as P, registerAction as k, setClientUserAttributes as y, setEditorSettings as A, subscribeToEditor as R, track as T } from "./server-entry-fb5f2b80.js";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
5
5
|
i as Blocks,
|
|
@@ -22,8 +22,9 @@ export {
|
|
|
22
22
|
x as isEditing,
|
|
23
23
|
S as isPreviewing,
|
|
24
24
|
P as register,
|
|
25
|
-
k as
|
|
26
|
-
y as
|
|
25
|
+
k as registerAction,
|
|
26
|
+
y as setClientUserAttributes,
|
|
27
|
+
A as setEditorSettings,
|
|
27
28
|
R as subscribeToEditor,
|
|
28
29
|
T as track
|
|
29
30
|
};
|
|
@@ -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-67200cf1.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;
|
package/lib/edge/{personalization-container-eb1ecef2.js → personalization-container-64f3cd71.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as v, jsx as l, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as Q, useState as c, useEffect as z } from "react";
|
|
3
|
-
import { Blocks as m, InlinedStyles as X } from "./blocks-
|
|
4
|
-
import { getPersonalizationScript as J, getUpdateVisibilityStylesScript as M, checkShouldRenderVariants as Y, DEFAULT_INDEX as C, SDKS_REQUIRING_RESET_APPROACH as f, InlinedScript as h, filterWithCustomTargeting as Z, getBlocksToRender as p } from "./content-variants-
|
|
5
|
-
import { userAttributesService as N, getDefaultCanTrack as tt, TARGET as b, isEditing as et, isPreviewing as it } from "./server-entry-
|
|
6
|
-
import { getClassPropName as O } from "./get-class-prop-name-
|
|
3
|
+
import { Blocks as m, InlinedStyles as X } from "./blocks-0269007e.js";
|
|
4
|
+
import { getPersonalizationScript as J, getUpdateVisibilityStylesScript as M, checkShouldRenderVariants as Y, DEFAULT_INDEX as C, SDKS_REQUIRING_RESET_APPROACH as f, InlinedScript as h, filterWithCustomTargeting as Z, getBlocksToRender as p } from "./content-variants-0dd65b50.js";
|
|
5
|
+
import { userAttributesService as N, getDefaultCanTrack as tt, TARGET as b, isEditing as et, isPreviewing as it } from "./server-entry-fb5f2b80.js";
|
|
6
|
+
import { getClassPropName as O } from "./get-class-prop-name-770bdff2.js";
|
|
7
7
|
import "./blocks-exports.mjs";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function mt(t) {
|
package/lib/edge/{personalization-container-794b3939.cjs → personalization-container-f7030f08.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),k=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),k=require("./blocks-2af1d7c9.cjs"),r=require("./content-variants-4cab7215.cjs"),s=require("./server-entry-67200cf1.cjs"),U=require("./get-class-prop-name-f470d5ce.cjs");require("./blocks-exports.cjs");require("./dynamic-renderer-b29b45ca.cjs");function O(e){var h,R,B,g,m,T,y,A,P,I,$,j,D;const u=l.useRef(null),[V,q]=l.useState(()=>s.userAttributesService.getUserAttributes()),[C,F]=l.useState(()=>{var t,n,i;return r.getPersonalizationScript(e.variants,((t=e.builderBlock)==null?void 0:t.id)||"none",(i=(n=e.builderContext)==null?void 0:n.rootState)==null?void 0:i.locale)}),[N,H]=l.useState(()=>{var t,n,i;return r.getUpdateVisibilityStylesScript(e.variants,((t=e.builderBlock)==null?void 0:t.id)||"none",(i=(n=e.builderContext)==null?void 0:n.rootState)==null?void 0:i.locale)}),[x,L]=l.useState(()=>[]),[E,z]=l.useState(()=>{var t;return r.checkShouldRenderVariants(e.variants,s.getDefaultCanTrack((t=e.builderContext)==null?void 0:t.canTrack))}),[v,w]=l.useState(()=>!1);function G(){return{...e.attributes,[U.getClassPropName()]:`builder-personalization-container ${e.attributes[U.getClassPropName()]||""}`}}function f(){return(e.variants||[]).filter(t=>{var n,i,o,c;return r.filterWithCustomTargeting({...(i=(n=e.builderContext)==null?void 0:n.rootState)!=null&&i.locale?{locale:(c=(o=e.builderContext)==null?void 0:o.rootState)==null?void 0:c.locale}:{},...V},t.query,t.startDate,t.endDate)})}function d(){var t;return r.getBlocksToRender({variants:e.variants,fallbackBlocks:(t=e.builderBlock)==null?void 0:t.children,isHydrated:v,filteredVariants:f(),previewingIndex:e.previewingIndex})}function W(){return(e.variants||[]).map((t,n)=>{var i;return`div[data-variant-id="${(i=e.builderBlock)==null?void 0:i.id}-${n}"] { display: none !important; } `}).join("")}return l.useEffect(()=>{var n;w(!0);const t=s.userAttributesService.subscribeOnUserAttributesChange(i=>{q(i)},{fireImmediately:s.TARGET==="qwik"});if(!(s.isEditing()||s.isPreviewing())){const i=f()[0];u.current&&(u.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:i||r.DEFAULT_INDEX,content:(n=e.builderContext)==null?void 0:n.content},bubbles:!0})),new IntersectionObserver(c=>{c.forEach(S=>{var b;S.isIntersecting&&u.current&&u.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:i||r.DEFAULT_INDEX,content:(b=e.builderContext)==null?void 0:b.content},bubbles:!0}))})}).observe(u.current))}x.push(t)},[]),l.useEffect(()=>()=>{x.forEach(t=>t())},[]),a.jsxs("div",{ref:u,...G(),children:[v&&r.SDKS_REQUIRING_RESET_APPROACH.includes(s.TARGET)?a.jsx(k.Blocks,{blocks:d().blocks,parent:(h=e.builderBlock)==null?void 0:h.id,path:d().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(R=e.builderContext)==null?void 0:R.BlocksWrapperProps,"data-variant-id":`${(B=e.builderBlock)==null?void 0:B.id}-${d().index}`}}):null,!v&&r.SDKS_REQUIRING_RESET_APPROACH.includes(s.TARGET)||!r.SDKS_REQUIRING_RESET_APPROACH.includes(s.TARGET)?a.jsxs(a.Fragment,{children:[E?a.jsxs(a.Fragment,{children:[a.jsx(k.InlinedStyles,{nonce:((g=e.builderContext)==null?void 0:g.nonce)||"",styles:W(),id:`variants-styles-${(m=e.builderBlock)==null?void 0:m.id}`}),a.jsx(r.InlinedScript,{nonce:((T=e.builderContext)==null?void 0:T.nonce)||"",scriptStr:N,id:`variants-visibility-script-${(y=e.builderBlock)==null?void 0:y.id}`}),(A=e.variants)==null?void 0:A.map((t,n)=>{var i,o,c,S,b,_;return a.jsx(k.Blocks,{BlocksWrapperProps:{...(i=e.builderContext)==null?void 0:i.BlocksWrapperProps,"aria-hidden":!0,hidden:!0,"data-variant-id":`${(o=e.builderBlock)==null?void 0:o.id}-${n}`},blocks:t.blocks,parent:(c=e.builderBlock)==null?void 0:c.id,path:`component.options.variants.${n}.blocks`,context:e.builderContext,registeredComponents:e.builderComponents,children:a.jsx(r.InlinedScript,{nonce:((S=e.builderContext)==null?void 0:S.nonce)||"",scriptStr:C,id:`variants-script-${(b=e.builderBlock)==null?void 0:b.id}-${n}`})},`${(_=e.builderBlock)==null?void 0:_.id}-${n}`)})]}):null,a.jsx(k.Blocks,{blocks:d().blocks,parent:(P=e.builderBlock)==null?void 0:P.id,path:d().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(I=e.builderContext)==null?void 0:I.BlocksWrapperProps,"data-variant-id":`${($=e.builderBlock)==null?void 0:$.id}-${d().index}`},children:E?a.jsx(r.InlinedScript,{nonce:((j=e.builderContext)==null?void 0:j.nonce)||"",scriptStr:C,id:`variants-script-${(D=e.builderBlock)==null?void 0:D.id}-${r.DEFAULT_INDEX}`}):null})]}):null]})}exports.default=O;
|
|
@@ -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-67200cf1.cjs");function i(e){var u;return n.createElement("select",{...e.attributes,value:e.value,key:r.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(u=e.options)==null?void 0:u.map((t,a)=>l.jsx("option",{value:t.value,children:t.name||t.value},`${t.name}-${a}`)))}exports.default=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } 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-fb5f2b80.js";
|
|
4
4
|
function r(e) {
|
|
5
5
|
var t;
|
|
6
6
|
return /* @__PURE__ */ m(
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const S="react";function a(){return typeof window!="undefined"&&typeof document!="undefined"}const A="[Builder.io]: ",d={log:(...t)=>console.log(A,...t),error:(...t)=>console.error(A,...t),warn:(...t)=>console.warn(A,...t),debug:(...t)=>console.debug(A,...t)},p=t=>t!=null,yt=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},v=({name:t,canTrack:e})=>{var n;try{return e?(n=document.cookie.split("; ").find(r=>r.startsWith(`${t}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},$=async t=>v(t),bt=t=>t.map(([e,n])=>n?`${e}=${n}`:e).filter(p).join("; "),mt=[["secure",""],["SameSite","None"]],wt=({name:t,value:e,expires:n})=>{const s=(a()?location.protocol==="https:":!0)?mt:[[]],o=n?[["expires",n.toUTCString()]]:[[]],i=[[t,e],...o,["path","/"],["domain",yt(window.location.hostname)],...s];return bt(i)},O=async({name:t,value:e,expires:n,canTrack:r})=>{try{if(!r)return;const s=wt({name:t,value:e,expires:n});document.cookie=s}catch(s){d.warn("[COOKIE] SET error: ",(s==null?void 0:s.message)||s)}};const V="builder.userAttributes";function D(){let t=!0;const e=new Set;return{setUserAttributes(n){if(!a())return;const r={...this.getUserAttributes(),...n};O({name:V,value:JSON.stringify(r),canTrack:t}),e.forEach(s=>s(r))},getUserAttributes(){return a()?JSON.parse(v({name:V,canTrack:t})||"{}"):{}},subscribeOnUserAttributesChange(n,{fireImmediately:r}={}){return e.add(n),r&&n(this.getUserAttributes()),function(){e.delete(n)}},setCanTrack(n){t=n}}}let U;a()&&S==="qwik"?(window.__BUILDER_USER_ATTRIBUTES_SERVICE__||(window.__BUILDER_USER_ATTRIBUTES_SERVICE__=D()),U=window.__BUILDER_USER_ATTRIBUTES_SERVICE__):U=D();const P=U,Et=t=>{P.setUserAttributes(t)},It=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},G=t=>t instanceof URLSearchParams?It(t):t,J=t=>typeof t=="string"?t:t instanceof URLSearchParams?t.toString():new URLSearchParams(t).toString();function At(){return a()&&window.self!==window.top}function z(t){return At()&&J(t||window.location.search).indexOf("builder.frameEditing=")!==-1}function vt(t){const e=t||(a()?window.location.search:void 0);return e?J(e).indexOf("builder.preview=")!==-1:!1}const kt=t=>({type:"builder.registerComponent",data:R(t)}),Ut=t=>{const e=t.toString().trim(),n=/^[a-zA-Z0-9_]+\s*=>/i.test(e);return`return (${!e.startsWith("function")&&!e.startsWith("async")&&!e.startsWith("(")&&!n?"function ":""}${e}).apply(this, arguments)`};function R(t){return JSON.parse(JSON.stringify(t,(e,n)=>typeof n=="function"?Ut(n):n))}const F={};function Tt(t,e){t==="plugin"&&(e=R(e));let n=F[t];if(n||(n=F[t]=[]),n.push(e),a()){const r={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(s){console.debug("Could not postmessage",s)}}}function Ot(t){var e;if(a()){const n=JSON.parse(JSON.stringify(t));t.action&&(n.action=t.action.toString()),(e=window.parent)==null||e.postMessage({type:"builder.registerAction",data:n},"*")}}const M={};function Pt(t){if(a()){Object.assign(M,t);const e={type:"builder.settingsChange",data:M};parent.postMessage(e,"*")}}const K="builder.",Rt="options.",C=t=>{if(!t)return{};const e=G(t),n={};return Object.keys(e).forEach(r=>{if(r.startsWith(K)){const s=r.replace(K,"").replace(Rt,"");n[s]=e[r]}}),n},Ct=()=>{if(!a())return{};const t=new URLSearchParams(window.location.search);return C(t)},X="4.2.2",H=()=>({"X-Builder-SDK":S,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":X});function Bt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}function Q(){return Bt().replace(/-/g,"")}const Y="builderSessionId",xt=async({canTrack:t})=>{if(!t)return;const e=await $({name:Y,canTrack:t});if(p(e))return e;{const n=_t();return Lt({id:n,canTrack:t}),n}},_t=()=>Q(),Lt=({id:t,canTrack:e})=>O({name:Y,value:t,canTrack:e}),Z=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,Nt=({key:t,canTrack:e})=>{var n;try{return e?(n=Z())==null?void 0:n.getItem(t):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Vt=({key:t,canTrack:e,value:n})=>{var r;try{e&&((r=Z())==null||r.setItem(t,n))}catch(s){console.debug("[LocalStorage] SET error: ",s)}},q="builderVisitorId",Dt=({canTrack:t})=>{if(!t)return;const e=Nt({key:q,canTrack:t});if(p(e))return e;{const n=Ft();return Mt({id:n,canTrack:t}),n}},Ft=()=>Q(),Mt=({id:t,canTrack:e})=>Vt({key:q,value:t,canTrack:e});function tt(t){var e;typeof process!="undefined"&&((e=process.env)!=null&&e.DEBUG)&&String(process.env.DEBUG)=="true"&&d.log(t)}const Kt=()=>{if(a()){const t=new URL(location.href);return t.pathname===""&&(t.pathname="/"),t}else return console.warn("Cannot get location for tracking in non-browser environment"),null},Wt=()=>typeof navigator=="object"&&navigator.userAgent||"",et=()=>{const t=Wt(),e={Android(){return t.match(/Android/i)},BlackBerry(){return t.match(/BlackBerry/i)},iOS(){return t.match(/iPhone|iPod/i)},Opera(){return t.match(/Opera Mini/i)},Windows(){return t.match(/IEMobile/i)||t.match(/WPDesktop/i)},any(){return e.Android()||e.BlackBerry()||e.iOS()||e.Opera()||e.Windows()||S==="reactNative"}},n=t.match(/Tablet|iPad/i),r=Kt();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":e.any()?"mobile":"desktop"}},jt=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await xt({canTrack:t}),n=Dt({canTrack:t});return{sessionId:e,visitorId:n}},$t=async({type:t,canTrack:e,apiKey:n,metadata:r,...s})=>({type:t,data:{...s,metadata:{url:location.href,...r},...await jt({canTrack:e}),userAttributes:et(),ownerId:n}});async function nt({apiHost:t,...e}){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(!e.canTrack||z()||!(a()||S==="reactNative"))return;const r=`${t||"https://cdn.builder.io"}/api/v1/track`;return tt(r),fetch(r,{method:"POST",body:JSON.stringify({events:[await $t(e)]}),headers:{"content-type":"application/json",...H()},mode:"cors"}).catch(s=>{console.error("Failed to track: ",s)})}const Gt=t=>nt({...t,canTrack:!0}),Jt=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function rt(t,e){if(!e.origin.startsWith("http")&&!e.origin.startsWith("https"))return!1;const n=new URL(e.origin),r=n.hostname;return(t||Jt).findIndex(s=>s.startsWith("*.")?r.endsWith(s.slice(1)):s===r)>-1}let W=!1;const st=t=>{var e,n;W||(W=!0,a()&&((e=window.parent)==null||e.postMessage({type:"builder.sdkInfo",data:{target:S,version:X,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0,modelName:t.modelName,apiKey:t.apiKey,supportsXSmallBreakpoint:!0,blockLevelPersonalization:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:t}},"*"),window.addEventListener("message",r=>{var o,i;if(!rt(t.trustedHosts,r))return;const{data:s}=r;if(s!=null&&s.type)switch(s.type){case"builder.evaluate":{const u=s.data.text,m=s.data.arguments||[],y=s.data.id,w=new Function(u);let l,g=null;try{l=w.apply(null,m)}catch(h){g=h}g?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:y,error:g.message}},"*"):l&&typeof l.then=="function"?l.then(h=>{var E;(E=window.parent)==null||E.postMessage({type:"builder.evaluateResult",data:{id:y,result:h}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:l,id:y}},"*");break}}})))},ot=({model:t,trustedHosts:e,callbacks:n})=>r=>{if(!rt(e,r))return;const{data:s}=r;if(s)switch(s.type){case"builder.configureSdk":{n.configureSdk(s.data);break}case"builder.triggerAnimation":{n.animation(s.data);break}case"builder.resetState":{const o=s.data,i=o.model,u=o==null?void 0:o.state;i===t&&u&&n.stateUpdate(u);break}case"builder.contentUpdate":{const o=s.data,i=o.key||o.alias||o.entry||o.modelName,u=o.data;i===t&&n.contentUpdate(u);break}}},zt=({model:t,apiKey:e,callback:n,trustedHosts:r})=>{if(!a)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};st({modelName:t,apiKey:e});const s=ot({callbacks:{contentUpdate:n,animation:()=>{},configureSdk:()=>{},stateUpdate:()=>{}},model:t,trustedHosts:r});return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},Xt="builder.tests",B=t=>`${Xt}.${t}`,Ht=({contentId:t})=>$({name:B(t),canTrack:!0}),Qt=({contentId:t})=>v({name:B(t),canTrack:!0}),Yt=({contentId:t,value:e})=>O({name:B(t),value:e,canTrack:!0}),it=t=>p(t.id)&&p(t.variations)&&Object.keys(t.variations).length>0,Zt=({id:t,variations:e})=>{var s;let n=0;const r=Math.random();for(const o in e){const i=(s=e[o])==null?void 0:s.testRatio;if(n+=i,r<n)return o}return t},at=t=>{const e=Zt(t);return Yt({contentId:t.id,value:e}).catch(n=>{d.error("could not store A/B test variation: ",n)}),e},ct=({item:t,testGroupId:e})=>{const n=t.variations[e];return e===t.id||!n?{testVariationId:t.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===t.id?"Default":"")}},qt=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!it(t))return t;const n=Qt({contentId:t.id})||at({variations:t.variations,id:t.id}),r=ct({item:t,testGroupId:n});return{...t,...r}},te=async({item:t,canTrack:e})=>{if(!e||!it(t))return t;const r=await Ht({contentId:t.id})||at({variations:t.variations,id:t.id}),s=ct({item:t,testGroupId:r});return{...t,...s}},ut=t=>{const e=p(t)?t:!0;return P.setCanTrack(e),e};function ee(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function ne(){const t=ee().fetch;if(typeof t=="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
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return t}const re=ne();function T(t,e=null,n="."){return Object.keys(t).reduce((r,s)=>{const o=t[s],i=[e,s].filter(Boolean).join(n);return[typeof o=="object",o!==null,!(Array.isArray(o)&&o.length===0)].every(Boolean)?{...r,...T(o,i,n)}:{...r,[i]:o}},{})}function lt(t,e,n={}){for(const r in t){const s=t[r],o=e?e+"."+r:r;s&&typeof s=="object"&&!Array.isArray(s)&&!Object.keys(s).find(i=>i.startsWith("$"))?lt(s,o,n):n[o]=s}return n}function se(t){const e={};for(const n in t){const r=n.split(".");let s=e;for(let o=0;o<r.length;o++){const i=r[o];o===r.length-1?s[i]=t[n]:(s[i]=s[i]||{},s=s[i])}}return e}const oe="v3",j=t=>typeof t=="number"&&!isNaN(t)&&t>=0,x=t=>{const{limit:e=30,userAttributes:n,query:r,model:s,apiKey:o,enrich:i,locale:u,apiVersion:m=oe,fields:y,omit:w,offset:l,cacheSeconds:g,staleCacheSeconds:h,sort:E,includeUnpublished:_,apiHost:ht}=t;if(!o)throw new Error("Missing API key");if(!["v3"].includes(m))throw new Error(`Invalid apiVersion: expected 'v3', received '${m}'`);const pt=e!==1,St=ht||"https://cdn.builder.io",c=new URL(`${St}/api/${m}/content/${s}`);c.searchParams.set("apiKey",o),c.searchParams.set("limit",String(e)),c.searchParams.set("noTraverse",String(pt)),c.searchParams.set("includeRefs",String(!0));const k=u||(n==null?void 0:n.locale);let b=n||{};if(k&&(c.searchParams.set("locale",k),b={locale:k,...b}),i&&c.searchParams.set("enrich",String(i)),c.searchParams.set("omit",w!=null?w:"meta.componentsUsed"),y&&c.searchParams.set("fields",y),Number.isFinite(l)&&l>-1&&c.searchParams.set("offset",String(Math.floor(l))),typeof _=="boolean"&&c.searchParams.set("includeUnpublished",String(_)),g&&j(g)&&c.searchParams.set("cacheSeconds",String(g)),h&&j(h)&&c.searchParams.set("staleCacheSeconds",String(h)),E){const f=T({sort:E});for(const I in f)c.searchParams.set(I,JSON.stringify(f[I]))}const L={...Ct(),...G(t.options||{})};b={...b,...ae(L)};const N=T(L);for(const f in N)c.searchParams.set(f,String(N[f]));if(Object.keys(b).length>0&&c.searchParams.set("userAttributes",JSON.stringify(b)),r){const f=lt({query:r});for(const I in f)c.searchParams.set(I,JSON.stringify(f[I]))}return c},ie=t=>{const e={};for(const n in t)n.startsWith("userAttributes.")&&(e[n]=t[n],delete t[n]);return e},ae=t=>{if(a()&&t.preview==="BUILDER_STUDIO"){t["userAttributes.urlPath"]=window.location.pathname,t["userAttributes.host"]=window.location.host;const e=ie(t),{userAttributes:n}=se(e);return n}return{}},ce=t=>"results"in t;async function dt(t){const e=await gt({...t,limit:1});return e&&e[0]||null}const ue=async t=>{var i,u;const e=x(t),n=(i=t.fetch)!=null?i:re,r={...t.fetchOptions,headers:{...(u=t.fetchOptions)==null?void 0:u.headers,...H()}};return await(await n(e.href,r)).json()},ft=async(t,e,n=x(t))=>{const r=ut(t.canTrack);if(n.search.includes("preview="),!r||!(a()||S==="reactNative"))return e.results;try{const s=[];for(const o of e.results)s.push(await te({item:o,canTrack:r}));e.results=s}catch(s){d.error("Could not process A/B tests. ",s)}return e.results};async function gt(t){const e=x(t),n=await ue(t);if(!ce(n))throw d.error("Error fetching data. ",{url:e,content:n,options:t}),n;return ft(t,n)}const le=async t=>{var r,s,o;const e=t.path||((r=t.url)==null?void 0:r.pathname)||((s=t.userAttributes)==null?void 0:s.urlPath),n={...t,apiKey:t.apiKey,model:t.model||"page",userAttributes:{...t.userAttributes,...e?{urlPath:e}:{}},options:C(t.searchParams||((o=t.url)==null?void 0:o.searchParams)||t.options)};return{apiKey:n.apiKey,model:n.model,content:await dt(n)}};exports.TARGET=S;exports._processContentResult=ft;exports._track=nt;exports.checkIsDefined=p;exports.createEditorListener=ot;exports.createRegisterComponentMessage=kt;exports.fetchBuilderProps=le;exports.fetchEntries=gt;exports.fetchOneEntry=dt;exports.getBuilderSearchParams=C;exports.getCookieSync=v;exports.getDefaultCanTrack=ut;exports.getUserAttributes=et;exports.handleABTestingSync=qt;exports.isBrowser=a;exports.isEditing=z;exports.isPreviewing=vt;exports.logFetch=tt;exports.logger=d;exports.register=Tt;exports.registerAction=Ot;exports.serializeIncludingFunctions=R;exports.setClientUserAttributes=Et;exports.setEditorSettings=Pt;exports.setupBrowserForEditing=st;exports.subscribeToEditor=zt;exports.track=Gt;exports.userAttributesService=P;
|
|
@@ -135,8 +135,18 @@ function se(t, e) {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
const V = {};
|
|
139
138
|
function oe(t) {
|
|
139
|
+
var e;
|
|
140
|
+
if (c()) {
|
|
141
|
+
const n = JSON.parse(JSON.stringify(t));
|
|
142
|
+
t.action && (n.action = t.action.toString()), (e = window.parent) == null || e.postMessage({
|
|
143
|
+
type: "builder.registerAction",
|
|
144
|
+
data: n
|
|
145
|
+
}, "*");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const V = {};
|
|
149
|
+
function ie(t) {
|
|
140
150
|
if (c()) {
|
|
141
151
|
Object.assign(V, t);
|
|
142
152
|
const e = {
|
|
@@ -161,7 +171,7 @@ const D = "builder.", pt = "options.", J = (t) => {
|
|
|
161
171
|
return {};
|
|
162
172
|
const t = new URLSearchParams(window.location.search);
|
|
163
173
|
return J(t);
|
|
164
|
-
}, z = "4.2.
|
|
174
|
+
}, z = "4.2.2", X = () => ({
|
|
165
175
|
"X-Builder-SDK": b,
|
|
166
176
|
"X-Builder-SDK-GEN": "2",
|
|
167
177
|
"X-Builder-SDK-Version": z
|
|
@@ -347,7 +357,7 @@ async function Bt({
|
|
|
347
357
|
console.error("Failed to track: ", s);
|
|
348
358
|
});
|
|
349
359
|
}
|
|
350
|
-
const
|
|
360
|
+
const ae = (t) => Bt({
|
|
351
361
|
...t,
|
|
352
362
|
canTrack: !0
|
|
353
363
|
}), xt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
@@ -454,7 +464,7 @@ const _t = (t) => {
|
|
|
454
464
|
break;
|
|
455
465
|
}
|
|
456
466
|
}
|
|
457
|
-
},
|
|
467
|
+
}, ce = ({
|
|
458
468
|
model: t,
|
|
459
469
|
apiKey: e,
|
|
460
470
|
callback: n,
|
|
@@ -535,7 +545,7 @@ const _t = (t) => {
|
|
|
535
545
|
testVariationId: n.id,
|
|
536
546
|
testVariationName: n.name || (n.id === t.id ? "Default" : "")
|
|
537
547
|
};
|
|
538
|
-
},
|
|
548
|
+
}, ue = ({
|
|
539
549
|
item: t,
|
|
540
550
|
canTrack: e
|
|
541
551
|
}) => {
|
|
@@ -738,7 +748,7 @@ async function te(t) {
|
|
|
738
748
|
}), n;
|
|
739
749
|
return qt(t, n);
|
|
740
750
|
}
|
|
741
|
-
const
|
|
751
|
+
const le = async (t) => {
|
|
742
752
|
var r, s, o;
|
|
743
753
|
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((s = t.userAttributes) == null ? void 0 : s.urlPath), n = {
|
|
744
754
|
...t,
|
|
@@ -765,25 +775,26 @@ export {
|
|
|
765
775
|
y as checkIsDefined,
|
|
766
776
|
Lt as createEditorListener,
|
|
767
777
|
re as createRegisterComponentMessage,
|
|
768
|
-
|
|
778
|
+
le as fetchBuilderProps,
|
|
769
779
|
te as fetchEntries,
|
|
770
780
|
Yt as fetchOneEntry,
|
|
771
781
|
J as getBuilderSearchParams,
|
|
772
782
|
O as getCookieSync,
|
|
773
783
|
Wt as getDefaultCanTrack,
|
|
774
784
|
Pt as getUserAttributes,
|
|
775
|
-
|
|
785
|
+
ue as handleABTestingSync,
|
|
776
786
|
c as isBrowser,
|
|
777
787
|
ht as isEditing,
|
|
778
788
|
ne as isPreviewing,
|
|
779
789
|
Ut as logFetch,
|
|
780
790
|
f as logger,
|
|
781
791
|
se as register,
|
|
792
|
+
oe as registerAction,
|
|
782
793
|
G as serializeIncludingFunctions,
|
|
783
794
|
ee as setClientUserAttributes,
|
|
784
|
-
|
|
795
|
+
ie as setEditorSettings,
|
|
785
796
|
_t as setupBrowserForEditing,
|
|
786
|
-
|
|
787
|
-
|
|
797
|
+
ce as subscribeToEditor,
|
|
798
|
+
ae as track,
|
|
788
799
|
W as userAttributesService
|
|
789
800
|
};
|
|
@@ -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-67200cf1.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.registerAction=e.registerAction;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as i, fetchBuilderProps as s, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, registerAction as E, setEditorSettings as f, subscribeToEditor as h, track as p } from "./server-entry-fb5f2b80.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
i as createRegisterComponentMessage,
|
|
5
|
+
s as fetchBuilderProps,
|
|
6
6
|
n as fetchEntries,
|
|
7
7
|
o as fetchOneEntry,
|
|
8
8
|
c as getBuilderSearchParams,
|
|
9
9
|
g as isEditing,
|
|
10
10
|
a as isPreviewing,
|
|
11
11
|
d as register,
|
|
12
|
-
E as
|
|
13
|
-
f as
|
|
14
|
-
h as
|
|
12
|
+
E as registerAction,
|
|
13
|
+
f as setEditorSettings,
|
|
14
|
+
h as subscribeToEditor,
|
|
15
|
+
p as track
|
|
15
16
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Blocks as m } from "./blocks-
|
|
2
|
+
import { Blocks as m } from "./blocks-0269007e.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-fb5f2b80.js";
|
|
6
|
+
import "./get-class-prop-name-770bdff2.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
function c(t) {
|
|
9
9
|
var e, o, n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("./blocks-2af1d7c9.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-67200cf1.cjs");require("./get-class-prop-name-f470d5ce.cjs");require("./dynamic-renderer-b29b45ca.cjs");function u(e){var t,n,r;return o.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:o.jsx(i.Blocks,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(r=e.builderContext.rootState)==null?void 0:r[e.name]})})}exports.default=u;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b, useEffect as f } from "react";
|
|
3
|
-
import { Content as
|
|
4
|
-
import { getClassPropName as
|
|
5
|
-
import { fetchOneEntry as
|
|
6
|
-
const
|
|
3
|
+
import { Content as K } from "./blocks-exports.mjs";
|
|
4
|
+
import { getClassPropName as S } from "./get-class-prop-name-770bdff2.js";
|
|
5
|
+
import { fetchOneEntry as E, logger as N } from "./server-entry-fb5f2b80.js";
|
|
6
|
+
const W = async ({
|
|
7
7
|
builderContextValue: t,
|
|
8
8
|
symbol: n
|
|
9
9
|
}) => {
|
|
10
10
|
if (n != null && n.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
11
11
|
(t != null && t.apiKey))
|
|
12
|
-
return
|
|
12
|
+
return E({
|
|
13
13
|
model: n.model,
|
|
14
14
|
apiKey: t.apiKey,
|
|
15
15
|
apiVersion: t.apiVersion,
|
|
@@ -19,11 +19,11 @@ const N = async ({
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}).catch((r) => {
|
|
22
|
-
|
|
22
|
+
N.error("Could not fetch symbol content: ", r);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
var a, c,
|
|
25
|
+
function q(t) {
|
|
26
|
+
var a, c, m, l, d;
|
|
27
27
|
function n() {
|
|
28
28
|
return "div";
|
|
29
29
|
}
|
|
@@ -31,36 +31,39 @@ function T(t) {
|
|
|
31
31
|
return "div";
|
|
32
32
|
}
|
|
33
33
|
function s() {
|
|
34
|
+
return Object.values(t.builderComponents);
|
|
35
|
+
}
|
|
36
|
+
function C() {
|
|
34
37
|
var e, o;
|
|
35
38
|
return [
|
|
36
|
-
t.attributes[
|
|
39
|
+
t.attributes[S()],
|
|
37
40
|
"builder-symbol",
|
|
38
41
|
(e = t.symbol) != null && e.inline ? "builder-inline-symbol" : void 0,
|
|
39
42
|
(o = t.symbol) != null && o.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
40
43
|
].filter(Boolean).join(" ");
|
|
41
44
|
}
|
|
42
|
-
const [i,
|
|
45
|
+
const [i, v] = b(() => {
|
|
43
46
|
var e;
|
|
44
47
|
return (e = t.symbol) == null ? void 0 : e.content;
|
|
45
|
-
}), [
|
|
48
|
+
}), [k, h] = b(() => {
|
|
46
49
|
var e;
|
|
47
50
|
return (e = t.symbol) == null ? void 0 : e.entry;
|
|
48
51
|
});
|
|
49
|
-
function
|
|
52
|
+
function x() {
|
|
50
53
|
var e;
|
|
51
|
-
i &&
|
|
54
|
+
i && k === ((e = t.symbol) == null ? void 0 : e.entry) || W({
|
|
52
55
|
symbol: t.symbol,
|
|
53
56
|
builderContextValue: t.builderContext
|
|
54
57
|
}).then((o) => {
|
|
55
|
-
var
|
|
56
|
-
o && (
|
|
58
|
+
var u;
|
|
59
|
+
o && (v(o), h((u = t.symbol) == null ? void 0 : u.entry));
|
|
57
60
|
});
|
|
58
61
|
}
|
|
59
62
|
return f(() => {
|
|
60
63
|
}, []), f(() => {
|
|
61
|
-
|
|
62
|
-
}, [t.symbol]), /* @__PURE__ */
|
|
63
|
-
|
|
64
|
+
x();
|
|
65
|
+
}, [t.symbol]), /* @__PURE__ */ y("div", { ...t.attributes, className: C(), children: /* @__PURE__ */ y(
|
|
66
|
+
K,
|
|
64
67
|
{
|
|
65
68
|
nonce: t.builderContext.nonce,
|
|
66
69
|
isNestedRender: !0,
|
|
@@ -70,14 +73,14 @@ function T(t) {
|
|
|
70
73
|
...t.builderContext.context,
|
|
71
74
|
symbolId: (a = t.builderBlock) == null ? void 0 : a.id
|
|
72
75
|
},
|
|
73
|
-
customComponents:
|
|
76
|
+
customComponents: s(),
|
|
74
77
|
data: {
|
|
75
78
|
...(c = t.symbol) == null ? void 0 : c.data,
|
|
76
79
|
...t.builderContext.localState,
|
|
77
|
-
...(
|
|
80
|
+
...(m = i == null ? void 0 : i.data) == null ? void 0 : m.state
|
|
78
81
|
},
|
|
79
82
|
canTrack: t.builderContext.canTrack,
|
|
80
|
-
model: (d = (
|
|
83
|
+
model: (d = (l = t.symbol) == null ? void 0 : l.model) != null ? d : "",
|
|
81
84
|
content: i,
|
|
82
85
|
linkComponent: t.builderLinkComponent,
|
|
83
86
|
blocksWrapper: n(),
|
|
@@ -86,5 +89,5 @@ function T(t) {
|
|
|
86
89
|
) });
|
|
87
90
|
}
|
|
88
91
|
export {
|
|
89
|
-
|
|
92
|
+
q as default
|
|
90
93
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),r=require("react"),E=require("./blocks-exports.cjs"),g=require("./get-class-prop-name-f470d5ce.cjs"),b=require("./server-entry-67200cf1.cjs"),h=async({builderContextValue:e,symbol:n})=>{if(n!=null&&n.model&&(e!=null&&e.apiKey))return b.fetchOneEntry({model:n.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(n==null?void 0:n.entry)&&{query:{id:n.entry}}}).catch(c=>{b.logger.error("Could not fetch symbol content: ",c)})};function j(e){var a,l,u,d,s;function n(){return"div"}function c(){return"div"}function f(){return Object.values(e.builderComponents)}function C(){var t,o;return[e.attributes[g.getClassPropName()],"builder-symbol",(t=e.symbol)!=null&&t.inline?"builder-inline-symbol":void 0,(o=e.symbol)!=null&&o.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,v]=r.useState(()=>{var t;return(t=e.symbol)==null?void 0:t.content}),[k,x]=r.useState(()=>{var t;return(t=e.symbol)==null?void 0:t.entry});function S(){var t;i&&k===((t=e.symbol)==null?void 0:t.entry)||h({symbol:e.symbol,builderContextValue:e.builderContext}).then(o=>{var m;o&&(v(o),x((m=e.symbol)==null?void 0:m.entry))})}return r.useEffect(()=>{},[]),r.useEffect(()=>{S()},[e.symbol]),y.jsx("div",{...e.attributes,className:C(),children:y.jsx(E.Content,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(a=e.builderBlock)==null?void 0:a.id},customComponents:f(),data:{...(l=e.symbol)==null?void 0:l.data,...e.builderContext.localState,...(u=i==null?void 0:i.data)==null?void 0:u.state},canTrack:e.builderContext.canTrack,model:(s=(d=e.symbol)==null?void 0:d.model)!=null?s:"",content:i,linkComponent:e.builderLinkComponent,blocksWrapper:n(),contentWrapper:c()})})}exports.default=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),r=require("./blocks-2af1d7c9.cjs");require("./blocks-exports.cjs");require("./server-entry-67200cf1.cjs");require("./get-class-prop-name-f470d5ce.cjs");require("./dynamic-renderer-b29b45ca.cjs");function d(e){var o;const[n,a]=s.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function c(t){return e.tabs&&e.tabs[t].content}function u(t){return t===n?e.activeTabStyle:{}}function b(t){t===n&&e.collapsible?a(-1):a(t)}return l.jsxs("div",{children:[l.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(o=e.tabs)==null?void 0:o.map((t,i)=>l.jsx("span",{className:`builder-tab-wrap ${n===i?"builder-tab-active":""}`,style:u(i),onClick:f=>b(i),children:l.jsx(r.Blocks,{parent:e.builderBlock.id,path:`tabs.${i}.label`,blocks:t.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},i))}),c(n)?l.jsx("div",{children:l.jsx(r.Blocks,{parent:e.builderBlock.id,path:`tabs.${n}.content`,blocks:c(n),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=d;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m } from "react";
|
|
3
|
+
import { Blocks as c } from "./blocks-0269007e.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-fb5f2b80.js";
|
|
6
|
+
import "./get-class-prop-name-770bdff2.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
|
-
function
|
|
8
|
+
function x(t) {
|
|
9
9
|
var b;
|
|
10
|
-
const [
|
|
10
|
+
const [n, a] = m(
|
|
11
11
|
() => t.defaultActiveTab ? t.defaultActiveTab - 1 : 0
|
|
12
12
|
);
|
|
13
|
-
function o(
|
|
14
|
-
return t.tabs && t.tabs[
|
|
13
|
+
function o(e) {
|
|
14
|
+
return t.tabs && t.tabs[e].content;
|
|
15
15
|
}
|
|
16
|
-
function r(
|
|
17
|
-
|
|
16
|
+
function r(e) {
|
|
17
|
+
return e === n ? t.activeTabStyle : {};
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
function u(e) {
|
|
20
|
+
e === n && t.collapsible ? a(-1) : a(e);
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
20
23
|
/* @__PURE__ */ i(
|
|
21
24
|
"div",
|
|
22
25
|
{
|
|
@@ -27,20 +30,18 @@ function y(t) {
|
|
|
27
30
|
justifyContent: t.tabHeaderLayout || "flex-start",
|
|
28
31
|
overflow: "auto"
|
|
29
32
|
},
|
|
30
|
-
children: (b = t.tabs) == null ? void 0 : b.map((
|
|
33
|
+
children: (b = t.tabs) == null ? void 0 : b.map((e, l) => /* @__PURE__ */ i(
|
|
31
34
|
"span",
|
|
32
35
|
{
|
|
33
|
-
className: `builder-tab-wrap ${
|
|
34
|
-
style:
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
onClick: (m) => r(l),
|
|
36
|
+
className: `builder-tab-wrap ${n === l ? "builder-tab-active" : ""}`,
|
|
37
|
+
style: r(l),
|
|
38
|
+
onClick: (s) => u(l),
|
|
38
39
|
children: /* @__PURE__ */ i(
|
|
39
40
|
c,
|
|
40
41
|
{
|
|
41
42
|
parent: t.builderBlock.id,
|
|
42
43
|
path: `tabs.${l}.label`,
|
|
43
|
-
blocks:
|
|
44
|
+
blocks: e.label,
|
|
44
45
|
context: t.builderContext,
|
|
45
46
|
registeredComponents: t.builderComponents,
|
|
46
47
|
linkComponent: t.builderLinkComponent
|
|
@@ -51,12 +52,12 @@ function y(t) {
|
|
|
51
52
|
))
|
|
52
53
|
}
|
|
53
54
|
),
|
|
54
|
-
o(
|
|
55
|
+
o(n) ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
55
56
|
c,
|
|
56
57
|
{
|
|
57
58
|
parent: t.builderBlock.id,
|
|
58
|
-
path: `tabs.${
|
|
59
|
-
blocks: o(
|
|
59
|
+
path: `tabs.${n}.content`,
|
|
60
|
+
blocks: o(n),
|
|
60
61
|
context: t.builderContext,
|
|
61
62
|
registeredComponents: t.builderComponents,
|
|
62
63
|
linkComponent: t.builderLinkComponent
|
|
@@ -65,5 +66,5 @@ function y(t) {
|
|
|
65
66
|
] });
|
|
66
67
|
}
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
x as default
|
|
69
70
|
};
|