@builder.io/sdk-vue 4.0.1 → 4.0.4
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/{awaiter-wbBKeVzr.cjs → awaiter-2F9-_oO8.cjs} +1 -1
- package/lib/browser/{awaiter-nAWFNqrx.js → awaiter-HDfw2t1B.js} +1 -1
- package/lib/browser/{block-styles-M0XEa30c.js → block-styles-MXm48vmz.js} +1 -1
- package/lib/browser/{block-styles-qBk6SyHU.cjs → block-styles-X9EhtMJv.cjs} +1 -1
- package/lib/browser/{block-wrapper-f0180-Dt.js → block-wrapper-4qw8AGWG.js} +3 -3
- package/lib/browser/{block-wrapper-ZjrIzk0G.cjs → block-wrapper-c8JGyOAA.cjs} +1 -1
- package/lib/browser/blocks/custom-code/custom-code.vue.d.ts +7 -1
- package/lib/browser/blocks/image/image.types.d.ts +1 -0
- package/lib/browser/blocks/image/image.vue.d.ts +3 -0
- package/lib/browser/{component-ref-VMpgtIT8.cjs → component-ref-9P0mKMJt.cjs} +1 -1
- package/lib/browser/{component-ref-tnogP_WI.js → component-ref-qKfSMika.js} +3 -3
- package/lib/browser/components/blocks/blocks-wrapper.vue.d.ts +6 -1
- package/lib/browser/components/content/components/enable-editor.vue.d.ts +1 -0
- package/lib/browser/components/content-variants/inlined-fns.d.ts +1 -1
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/{get-block-properties-VbdeRBq9.js → get-block-properties-QUOxxR_A.js} +1 -1
- package/lib/browser/{get-block-properties-kgoNqJkv.cjs → get-block-properties-UKaGP0U3.cjs} +1 -1
- package/lib/browser/{index-hYyYGFKw.js → index-LkA4auYM.js} +285 -233
- package/lib/browser/index-bGdQisdn.cjs +169 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{repeated-block-wzdH4zkn.cjs → repeated-block-GTImoZrN.cjs} +1 -1
- package/lib/browser/{repeated-block-jvm1EXAe.js → repeated-block-kQ_jnUM3.js} +2 -2
- package/lib/browser/style.css +1 -1
- package/lib/edge/{awaiter-aRh0Pj94.cjs → awaiter-mqwukzJZ.cjs} +1 -1
- package/lib/edge/{awaiter-hkMTEA9V.js → awaiter-nsg2nwZ7.js} +1 -1
- package/lib/edge/{block-styles-AI5sotc1.cjs → block-styles-jsDKKRQk.cjs} +1 -1
- package/lib/edge/{block-styles-LPJy6dQs.js → block-styles-uiNGacsi.js} +1 -1
- package/lib/edge/{block-wrapper-JuWdKgUU.js → block-wrapper-OdmciHkP.js} +3 -3
- package/lib/{node/block-wrapper-JeY6E7Bj.cjs → edge/block-wrapper-nI4dA-4Z.cjs} +1 -1
- package/lib/edge/blocks/custom-code/custom-code.vue.d.ts +7 -1
- package/lib/edge/blocks/image/image.types.d.ts +1 -0
- package/lib/edge/blocks/image/image.vue.d.ts +3 -0
- package/lib/edge/{component-ref-P4gIixq8.js → component-ref-Fb_1lhVs.js} +3 -3
- package/lib/edge/{component-ref-puTtsezh.cjs → component-ref-Tb1ckGhf.cjs} +1 -1
- package/lib/edge/components/blocks/blocks-wrapper.vue.d.ts +6 -1
- package/lib/edge/components/content/components/enable-editor.vue.d.ts +1 -0
- package/lib/edge/components/content-variants/inlined-fns.d.ts +1 -1
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/{get-block-properties-5osCAaC3.cjs → get-block-properties-MuKAymJ3.cjs} +1 -1
- package/lib/edge/{get-block-properties-AMnn5X6R.js → get-block-properties-skoEen4E.js} +1 -1
- package/lib/edge/index-BpamWQ_I.cjs +187 -0
- package/lib/edge/{index-HO4jmmvI.js → index-qJQiiZLG.js} +514 -462
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{repeated-block-IFYfMg17.js → repeated-block--Z7wD2xG.js} +2 -2
- package/lib/{node/repeated-block-7PPwMKZ7.cjs → edge/repeated-block-163bX_a9.cjs} +1 -1
- package/lib/edge/style.css +1 -1
- package/lib/node/{awaiter-Z7o9s6gq.js → awaiter-JPCBNySo.js} +1 -1
- package/lib/node/{awaiter-t8znoZtH.cjs → awaiter-hL5s-L1s.cjs} +1 -1
- package/lib/node/{block-styles-cgq-AQI-.cjs → block-styles-Qs6UPPvF.cjs} +1 -1
- package/lib/node/{block-styles-shrS5yAc.js → block-styles-cdBFFodd.js} +1 -1
- package/lib/node/{block-wrapper-fIn5jGPq.js → block-wrapper-QLQ8QCsB.js} +3 -3
- package/lib/{edge/block-wrapper-V2J7FjnE.cjs → node/block-wrapper-rqFiyxb2.cjs} +1 -1
- package/lib/node/blocks/custom-code/custom-code.vue.d.ts +7 -1
- package/lib/node/blocks/image/image.types.d.ts +1 -0
- package/lib/node/blocks/image/image.vue.d.ts +3 -0
- package/lib/node/{component-ref-M4gAxFd5.js → component-ref-_3BRwWYE.js} +3 -3
- package/lib/node/{component-ref-FgrBreGf.cjs → component-ref-kiBJD9kI.cjs} +1 -1
- package/lib/node/components/blocks/blocks-wrapper.vue.d.ts +6 -1
- package/lib/node/components/content/components/enable-editor.vue.d.ts +1 -0
- package/lib/node/components/content-variants/inlined-fns.d.ts +1 -1
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/{get-block-properties-AfiBthZ9.js → get-block-properties-4xNKhBHm.js} +1 -1
- package/lib/node/{get-block-properties-VbZkXgcG.cjs → get-block-properties-gCroeFct.cjs} +1 -1
- package/lib/node/index-7TI9yCCh.cjs +169 -0
- package/lib/node/{index-mcalyz7B.js → index-kH9JS7W5.js} +347 -295
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{repeated-block-xkdGhBrs.js → repeated-block-5xUjwB4K.js} +2 -2
- package/lib/{edge/repeated-block-KY5UOI15.cjs → node/repeated-block-Q0mddYsG.cjs} +1 -1
- package/lib/node/style.css +1 -1
- package/package.json +1 -1
- package/lib/browser/index-es6BsrIz.cjs +0 -166
- package/lib/edge/index-S_6GpGNI.cjs +0 -184
- package/lib/node/index-hyrTHgHn.cjs +0 -166
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
var p=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-bGdQisdn.cjs"),n=e.defineComponent({name:"awaiter",props:[],mounted(){}});function o(t,a,i,c,u,d){return e.renderSlot(t.$slots,"default")}const s=r._export_sfc(n,[["render",o]]);exports.default=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
2
|
import { defineComponent as _, resolveComponent as x, openBlock as T, createBlock as w, createCommentVNode as I } from "vue";
|
|
3
|
-
import { _ as N, T as Q, c as C, g as z, a, b as m, d as A, e as D } from "./index-
|
|
3
|
+
import { _ as N, T as Q, c as C, g as z, a, b as m, d as A, e as D } from "./index-LkA4auYM.js";
|
|
4
4
|
const E = _({
|
|
5
5
|
name: "block-styles",
|
|
6
6
|
components: { InlinedStyles: N },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),s=require("./index-
|
|
1
|
+
var _=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),s=require("./index-bGdQisdn.cjs"),x=a.defineComponent({name:"block-styles",components:{InlinedStyles:s._sfc_main},props:["block","context"],data(){return{TARGET:s.TARGET}},computed:{canShowBlock(){const e=this.block;return s.checkIsDefined(e.hide)?!e.hide:s.checkIsDefined(e.show)?e.show:!0},css(){var S,h,k,C,f;const e=this.block,t=e.responsiveStyles,o=this.context.content,r=s.getSizesForBreakpoints(((S=o==null?void 0:o.meta)==null?void 0:S.breakpoints)||{}),d=!!((k=(h=o==null?void 0:o.meta)==null?void 0:h.breakpoints)!=null&&k.xsmall),i=t==null?void 0:t.large,c=t==null?void 0:t.medium,u=t==null?void 0:t.small,y=t==null?void 0:t.xsmall,n=e.id;if(!n)return"";const b=i?s.createCssClass({className:n,styles:i}):"",g=c?s.createCssClass({className:n,styles:c,mediaQuery:s.getMaxWidthQueryForSize("medium",r)}):"",v=u?s.createCssClass({className:n,styles:u,mediaQuery:s.getMaxWidthQueryForSize("small",r)}):"",B=y&&d?s.createCssClass({className:n,styles:y,mediaQuery:s.getMaxWidthQueryForSize("xsmall",r)}):"",l=e.animations&&e.animations.find(m=>m.trigger==="hover");let p="";if(l){const m=((f=(C=l.steps)==null?void 0:C[1])==null?void 0:f.styles)||{};p=s.createCssClass({className:`${n}:hover`,styles:{...m,transition:`all ${l.duration}s ${s.camelToKebabCase(l.easing)}`,transitionDelay:l.delay?`${l.delay}s`:"0s"}})||""}return[b,g,v,B,p].join(" ")}}});function T(e,t,o,r,d,i){const c=a.resolveComponent("InlinedStyles");return e.TARGET!=="reactNative"&&e.css&&e.canShowBlock?(a.openBlock(),a.createBlock(c,{key:0,id:"builderio-block",styles:e.css,nonce:e.context.nonce},null,8,["styles","nonce"])):a.createCommentVNode("",!0)}const $=s._export_sfc(x,[["render",T]]);exports.default=$;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
2
|
import { defineComponent as o, defineAsyncComponent as r, resolveComponent as n, openBlock as a, createBlock as c, withCtx as i, renderSlot as p } from "vue";
|
|
3
|
-
import { g as s, a as l } from "./get-block-properties-
|
|
4
|
-
import { e as m } from "./index-
|
|
5
|
-
const d = () => import("./index-
|
|
3
|
+
import { g as s, a as l } from "./get-block-properties-QUOxxR_A.js";
|
|
4
|
+
import { e as m } from "./index-LkA4auYM.js";
|
|
5
|
+
const d = () => import("./index-LkA4auYM.js").then((e) => e.G).then((e) => e.default).catch((e) => {
|
|
6
6
|
throw console.error(
|
|
7
7
|
"Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",
|
|
8
8
|
e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var k=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./get-block-properties-
|
|
1
|
+
var k=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./get-block-properties-UKaGP0U3.cjs"),n=require("./index-bGdQisdn.cjs"),c=()=>Promise.resolve().then(()=>require("./index-bGdQisdn.cjs")).then(e=>e.dynamicRenderer).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",e),e}),a=t.defineComponent({name:"block-wrapper",components:{DynamicRenderer:t.defineAsyncComponent(c)},props:["Wrapper","block","context"],data(){return{getBlockActions:o.getBlockActions,getBlockProperties:o.getBlockProperties}}});function i(e,l,p,d,m,u){const r=t.resolveComponent("DynamicRenderer");return t.openBlock(),t.createBlock(r,{TagName:e.Wrapper,attributes:e.getBlockProperties({block:e.block,context:e.context}),actionAttributes:e.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["TagName","attributes","actionAttributes"])}const s=n._export_sfc(a,[["render",i]]);exports.default=s;
|
|
@@ -8,7 +8,13 @@ declare const _default: import("vue").DefineComponent<Readonly<{
|
|
|
8
8
|
}>, unknown, {
|
|
9
9
|
scriptsInserted: never[];
|
|
10
10
|
scriptsRun: never[];
|
|
11
|
-
}, {
|
|
11
|
+
}, {
|
|
12
|
+
onUpdateHook0(): {
|
|
13
|
+
0: any;
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
runScripts(): void;
|
|
17
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
|
|
12
18
|
code?: any;
|
|
13
19
|
replaceNodes?: any;
|
|
14
20
|
}>>>, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<Readonly<{
|
|
2
|
+
title?: any;
|
|
2
3
|
image?: any;
|
|
3
4
|
className?: any;
|
|
4
5
|
builderBlock?: any;
|
|
@@ -23,6 +24,7 @@ declare const _default: import("vue").DefineComponent<Readonly<{
|
|
|
23
24
|
readonly top: "0px";
|
|
24
25
|
} | undefined;
|
|
25
26
|
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
|
|
27
|
+
title?: any;
|
|
26
28
|
image?: any;
|
|
27
29
|
className?: any;
|
|
28
30
|
builderBlock?: any;
|
|
@@ -37,6 +39,7 @@ declare const _default: import("vue").DefineComponent<Readonly<{
|
|
|
37
39
|
sizes?: any;
|
|
38
40
|
fitContent?: any;
|
|
39
41
|
}>>>, {
|
|
42
|
+
readonly title?: any;
|
|
40
43
|
readonly image?: any;
|
|
41
44
|
readonly className?: any;
|
|
42
45
|
readonly builderBlock?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var P=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),c=require("./index-
|
|
1
|
+
var P=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),c=require("./index-bGdQisdn.cjs"),a=require("./get-block-properties-UKaGP0U3.cjs"),u=()=>Promise.resolve().then(()=>require("./awaiter-2F9-_oO8.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),d=t.defineComponent({name:"interactive-element",components:{Awaiter:t.defineAsyncComponent(u)},props:["includeBlockProps","block","context","Wrapper","wrapperProps"],computed:{attributes(){return this.includeBlockProps?{...a.getBlockProperties({block:this.block,context:this.context}),...a.getBlockActions({block:this.block,rootState:this.context.rootState,rootSetState:this.context.rootSetState,localState:this.context.localState,context:this.context.context})}:{}}}});function f(e,n,s,i,r,l){const o=t.resolveComponent("Awaiter");return e.Wrapper.load?(t.openBlock(),t.createBlock(o,{key:0,load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["load","fallback","props","attributes"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({key:1,attributes:e.attributes},e.wrapperProps),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"]))}const m=c._export_sfc(d,[["render",f]]),b=({componentOptions:e,builderBlock:n,context:s,componentRef:i,includeBlockProps:r,isInteractive:l,contextValue:o})=>{const p={...e,...r?{attributes:a.getBlockProperties({block:n,context:o})}:{}};return l?{Wrapper:i,block:n,context:s,wrapperProps:e,includeBlockProps:r}:p},B=t.defineComponent({name:"component-ref",components:{Block:c.Block,InteractiveElement:m},props:["isInteractive","componentRef","componentOptions","builderBlock","context","linkComponent","includeBlockProps","blockChildren","registeredComponents"],data(){return{Wrapper:this.isInteractive?c.wrapComponentRef(m):this.componentRef,getWrapperProps:b}}});function C(e,n,s,i,r,l){const o=t.resolveComponent("Block");return e.componentRef?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.normalizeProps(t.mergeProps({key:0},e.getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}))),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.blockChildren,(p,k)=>(t.openBlock(),t.createBlock(o,{key:p.id,block:p,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"]))),128))]),_:1},16)):t.createCommentVNode("",!0)}const h=c._export_sfc(B,[["render",C]]);exports.default=h;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
2
|
import { defineComponent as d, defineAsyncComponent as P, resolveComponent as k, openBlock as o, createBlock as a, withCtx as l, renderSlot as m, resolveDynamicComponent as f, mergeProps as b, normalizeProps as B, createElementBlock as g, Fragment as $, renderList as v, createCommentVNode as W } from "vue";
|
|
3
|
-
import { e as h, B as S, w as y } from "./index-
|
|
4
|
-
import { a as C, g as A } from "./get-block-properties-
|
|
5
|
-
const R = () => import("./awaiter-
|
|
3
|
+
import { e as h, B as S, w as y } from "./index-LkA4auYM.js";
|
|
4
|
+
import { a as C, g as A } from "./get-block-properties-QUOxxR_A.js";
|
|
5
|
+
const R = () => import("./awaiter-HDfw2t1B.js").then((e) => e.default).catch((e) => {
|
|
6
6
|
throw console.error(
|
|
7
7
|
"Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",
|
|
8
8
|
e
|
|
@@ -23,9 +23,14 @@ declare const _default: import("vue").DefineComponent<Readonly<{
|
|
|
23
23
|
styleProp?: any;
|
|
24
24
|
BlocksWrapperProps?: any;
|
|
25
25
|
BlocksWrapper?: any;
|
|
26
|
-
}>, unknown,
|
|
26
|
+
}>, unknown, {
|
|
27
|
+
shouldUpdate: boolean;
|
|
28
|
+
}, {
|
|
27
29
|
className(): string;
|
|
28
30
|
dataPath(): any;
|
|
31
|
+
onUpdateHook0(): {
|
|
32
|
+
0: any;
|
|
33
|
+
};
|
|
29
34
|
}, {
|
|
30
35
|
onClick(): void;
|
|
31
36
|
onMouseEnter(): void;
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
* For more information on how this works,
|
|
11
11
|
* see our [SSR A/B Test Docs](https://github.com/BuilderIO/builder/tree/main/packages/sdks/docs/SSR_AB_TEST.md)
|
|
12
12
|
*/
|
|
13
|
-
export declare const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n
|
|
13
|
+
export declare const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n let styleEl = document.currentScript?.previousElementSibling;\n if (isAngularSDK) {\n styleEl = document.currentScript?.parentElement?.previousElementSibling?.querySelector('style');\n }\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
|
|
14
14
|
export declare const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=require("./style.css");const s=require("./index-
|
|
1
|
+
var d=require("./style.css");const s=require("./index-bGdQisdn.cjs"),c=e=>`v-on:${e.toLowerCase()}`,i=(e,t)=>r=>s.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1});function l(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const a=r[o];let n=c(o);if(e.stripPrefix)switch(s.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=i(a,e)}return t}function u({properties:e}){return e}const p=e=>({href:e.href});function f({block:e,context:t}){var o;const r={...p(e),...e.properties,"builder-id":e.id,style:s.getStyle({block:e,context:t}),[s.getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return u({properties:r,context:t,block:e})}exports.getBlockActions=l;exports.getBlockProperties=f;
|