@builder.io/sdk-vue 5.2.11 → 5.2.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.
Files changed (83) hide show
  1. package/lib/browser/{awaiter-MAyQwJUp.cjs → awaiter-Ja_QJKsd.cjs} +1 -1
  2. package/lib/browser/{awaiter-quz2SFrg.js → awaiter-PAIWzl07.js} +1 -1
  3. package/lib/browser/{block-wrapper-vBu_Ygm8.cjs → block-wrapper-CeRmNoq0.cjs} +1 -1
  4. package/lib/browser/{block-wrapper-SCckT0M5.js → block-wrapper-b4XqsSBv.js} +3 -3
  5. package/lib/browser/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  6. package/lib/browser/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  7. package/lib/browser/{component-ref-HWBSC66Y.cjs → component-ref-MNrE4dOw.cjs} +1 -1
  8. package/lib/browser/{component-ref-owc3e0h8.js → component-ref-RNH8q_Ct.js} +4 -4
  9. package/lib/browser/constants/sdk-version.d.ts +1 -1
  10. package/lib/browser/{get-block-properties-odFddSWh.cjs → get-block-properties-C1S41sZd.cjs} +1 -1
  11. package/lib/browser/{get-block-properties-Hny6jqGG.js → get-block-properties-aY0jarAY.js} +1 -1
  12. package/lib/browser/helpers/css.d.ts +2 -0
  13. package/lib/browser/helpers/studio-user-attributes.d.ts +6 -0
  14. package/lib/browser/helpers/user-attributes.d.ts +6 -2
  15. package/lib/browser/{index-7bXAC1Q8.js → index-Q7tlS2c1.js} +768 -716
  16. package/lib/browser/{index-uDRmkrr4.cjs → index-ohjTQ4ru.cjs} +53 -35
  17. package/lib/browser/index.cjs +1 -1
  18. package/lib/browser/index.mjs +4 -4
  19. package/lib/browser/{live-edit-x4eHrcJh.js → live-edit-zIE57v1M.js} +1 -1
  20. package/lib/browser/{live-edit-AUagAEej.cjs → live-edit-zUS6r7uc.cjs} +1 -1
  21. package/lib/browser/{repeated-block-ZGXPYgA8.cjs → repeated-block-XFgvkCPh.cjs} +1 -1
  22. package/lib/browser/{repeated-block-uVi8A50N.js → repeated-block-qKqkpCg_.js} +2 -2
  23. package/lib/browser/{style-wrapper-usFESjt5.js → style-wrapper-nYNv2BeU.js} +72 -66
  24. package/lib/browser/style-wrapper-zgP9Exwf.cjs +1 -0
  25. package/lib/browser/style.css +1 -1
  26. package/lib/edge/{awaiter-RSfMls5f.js → awaiter-Mugw26Wi.js} +1 -1
  27. package/lib/edge/{awaiter-zow2zgzw.cjs → awaiter-N8Gr0F79.cjs} +1 -1
  28. package/lib/{node/block-wrapper-PUFgSKq_.js → edge/block-wrapper-0c3wPm9h.js} +3 -3
  29. package/lib/edge/{block-wrapper-4qKpWsP8.cjs → block-wrapper-KQrzy0mA.cjs} +1 -1
  30. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  31. package/lib/edge/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  32. package/lib/edge/{component-ref-1iPK0xOE.js → component-ref-R_Q4TOb7.js} +4 -4
  33. package/lib/edge/{component-ref-WdOIbmOU.cjs → component-ref-e3xYDpNG.cjs} +1 -1
  34. package/lib/edge/constants/sdk-version.d.ts +1 -1
  35. package/lib/edge/{get-block-properties-bMVCvUX0.js → get-block-properties-TtYKEgAO.js} +1 -1
  36. package/lib/edge/{get-block-properties-2E03ld67.cjs → get-block-properties-d0E5ZkZj.cjs} +1 -1
  37. package/lib/edge/helpers/css.d.ts +2 -0
  38. package/lib/edge/helpers/studio-user-attributes.d.ts +6 -0
  39. package/lib/edge/helpers/user-attributes.d.ts +6 -2
  40. package/lib/edge/{index-Bgm0yCrN.js → index-5jMXhHfs.js} +1310 -1258
  41. package/lib/edge/{index-LWGIJNVx.cjs → index-_dQKp9LH.cjs} +61 -43
  42. package/lib/edge/index.cjs +1 -1
  43. package/lib/edge/index.mjs +3 -3
  44. package/lib/edge/{live-edit-tegdYGJO.js → live-edit-7Dc7Q2yS.js} +1 -1
  45. package/lib/{node/live-edit-xPik2aUh.cjs → edge/live-edit-oGxYZa_V.cjs} +1 -1
  46. package/lib/edge/{repeated-block-yZJM5I60.js → repeated-block-GESRSjst.js} +2 -2
  47. package/lib/edge/{repeated-block--MhEsXmR.cjs → repeated-block-K9b4UbOC.cjs} +1 -1
  48. package/lib/edge/style-wrapper-dmNB8lmp.cjs +1 -0
  49. package/lib/edge/{style-wrapper-i8R7NpdY.js → style-wrapper-rh9YxCiw.js} +72 -66
  50. package/lib/edge/style.css +1 -1
  51. package/lib/node/{awaiter-Vwjft2v-.cjs → awaiter-0EtumND-.cjs} +1 -1
  52. package/lib/node/{awaiter-o3ynOQKr.js → awaiter-9zCUlZB9.js} +1 -1
  53. package/lib/node/{block-wrapper-KX1-Y2Oq.cjs → block-wrapper-c0gZ4j4I.cjs} +1 -1
  54. package/lib/{edge/block-wrapper-GT2d4luN.js → node/block-wrapper-s8zLAxlL.js} +3 -3
  55. package/lib/node/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  56. package/lib/node/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  57. package/lib/node/{component-ref-HmJKie9z.js → component-ref-PPsTcld8.js} +5 -5
  58. package/lib/node/{component-ref-o3vjSyAQ.cjs → component-ref-lWzA5guw.cjs} +1 -1
  59. package/lib/node/constants/sdk-version.d.ts +1 -1
  60. package/lib/node/{get-block-properties-DGfMhs4M.js → get-block-properties-AwCMGMPi.js} +2 -2
  61. package/lib/node/{get-block-properties-2yGkQVh7.cjs → get-block-properties-DKvJS4pV.cjs} +1 -1
  62. package/lib/node/helpers/css.d.ts +2 -0
  63. package/lib/node/helpers/studio-user-attributes.d.ts +6 -0
  64. package/lib/node/helpers/user-attributes.d.ts +6 -2
  65. package/lib/node/{index-JQgNoVXs.js → index-DWznrY3w.js} +675 -623
  66. package/lib/node/{index-7xT7wMXt.cjs → index-funKFPCj.cjs} +53 -35
  67. package/lib/node/index.cjs +1 -1
  68. package/lib/node/index.mjs +6 -6
  69. package/lib/node/init.cjs +1 -1
  70. package/lib/node/init.mjs +1 -1
  71. package/lib/{edge/live-edit-oLYhcuYs.cjs → node/live-edit-Bw84zZeV.cjs} +1 -1
  72. package/lib/node/{live-edit-hxNZMHld.js → live-edit-GVvl4apL.js} +1 -1
  73. package/lib/node/{repeated-block-PvGSbsHD.js → repeated-block-SP8WaEQp.js} +2 -2
  74. package/lib/node/{repeated-block-LHiXlO3e.cjs → repeated-block-ux8wkluB.cjs} +1 -1
  75. package/lib/node/{should-force-browser-runtime-in-node-aeKfQiEQ.cjs → should-force-browser-runtime-in-node-5MPjjLJt.cjs} +1 -1
  76. package/lib/node/{should-force-browser-runtime-in-node-ooRgTwqs.js → should-force-browser-runtime-in-node-nOG6zu2k.js} +1 -1
  77. package/lib/node/{style-wrapper-U-7exIwN.js → style-wrapper-5BoLwggo.js} +70 -64
  78. package/lib/node/style-wrapper-aKufn4zn.cjs +1 -0
  79. package/lib/node/style.css +1 -1
  80. package/package.json +1 -1
  81. package/lib/browser/style-wrapper-C_c9B5_Y.cjs +0 -1
  82. package/lib/edge/style-wrapper-8JiLG-FF.cjs +0 -1
  83. package/lib/node/style-wrapper-3l8xaVr4.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-LWGIJNVx.cjs");exports.Blocks=e.Blocks;exports.BuilderContext=e.BuilderContext;exports.Button=e.Button;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Fragment=e.Fragment;exports.Image=e.Image;exports.Section=e.Section;exports.Symbol=e.Symbol;exports.Text=e.Text;exports.Video=e.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.registerAction=e.registerAction;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-_dQKp9LH.cjs");exports.Blocks=e.Blocks;exports.BuilderContext=e.BuilderContext;exports.Button=e.Button;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Fragment=e.Fragment;exports.Image=e.Image;exports.Section=e.Section;exports.Symbol=e.Symbol;exports.Text=e.Text;exports.Video=e.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.registerAction=e.registerAction;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
@@ -1,4 +1,4 @@
1
- import { p as t, b as a, m as r, C as i, q as n, F as o, I as c, S as g, n as u, o as l, V as m, E as d, t as C, D as E, G as b, H as p, y as B, i as S, r as f, u as h, v as x, s as y, x as A, A as P, z as k } from "./index-Bgm0yCrN.js";
1
+ import { q as t, b as a, n as r, C as i, r as n, F as o, I as c, S as g, o as u, p as l, V as d, G as m, u as C, E, H as b, J as p, z as B, i as S, t as f, v as h, x, s as y, y as A, D as P, A as k } from "./index-5jMXhHfs.js";
2
2
  export {
3
3
  t as Blocks,
4
4
  a as BuilderContext,
@@ -10,8 +10,8 @@ export {
10
10
  g as Section,
11
11
  u as Symbol,
12
12
  l as Text,
13
- m as Video,
14
- d as _processContentResult,
13
+ d as Video,
14
+ m as _processContentResult,
15
15
  C as createRegisterComponentMessage,
16
16
  E as fetchBuilderProps,
17
17
  b as fetchEntries,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as o, openBlock as r, createBlock as n, resolveDynamicComponent as i, mergeProps as s, withCtx as p, renderSlot as a } from "vue";
2
2
  import { f as c } from "./find-block-3Ig0kVVe.js";
3
- import { b as d, _ as l } from "./index-Bgm0yCrN.js";
3
+ import { b as d, _ as l } from "./index-5jMXhHfs.js";
4
4
  const m = o({
5
5
  name: "live-edit",
6
6
  props: ["id", "attributes", "Wrapper"],
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./find-block-FREohLcp.cjs"),n=require("./index-7xT7wMXt.cjs"),i=t.defineComponent({name:"live-edit",props:["id","attributes","Wrapper"],inject:{context:n.BuilderContext.key},computed:{block(){return r.findBlockById(this.context.content,this.id)},options(){var e,o;return((o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options)||{}}}});function s(e,o,p,u,d,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({attributes:e.attributes},e.options),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"])}const c=n._export_sfc(i,[["render",s]]);exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./find-block-FREohLcp.cjs"),n=require("./index-_dQKp9LH.cjs"),i=t.defineComponent({name:"live-edit",props:["id","attributes","Wrapper"],inject:{context:n.BuilderContext.key},computed:{block(){return r.findBlockById(this.context.content,this.id)},options(){var e,o;return((o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options)||{}}}});function s(e,o,p,u,d,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({attributes:e.attributes},e.options),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"])}const c=n._export_sfc(i,[["render",s]]);exports.default=c;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as t, defineAsyncComponent as n, resolveComponent as r, openBlock as p, createBlock as s } from "vue";
2
- import { b as c, _ as i } from "./index-Bgm0yCrN.js";
3
- const a = () => import("./index-Bgm0yCrN.js").then((e) => e.K).then((e) => e.default).catch((e) => {
2
+ import { b as c, _ as i } from "./index-5jMXhHfs.js";
3
+ const a = () => import("./index-5jMXhHfs.js").then((e) => e.L).then((e) => e.default).catch((e) => {
4
4
  throw console.error(
5
5
  "Error while attempting to dynamically import component Block at ../block.vue",
6
6
  e
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),t=require("./index-LWGIJNVx.cjs"),r=()=>Promise.resolve().then(()=>require("./index-LWGIJNVx.cjs")).then(e=>e.block).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Block at ../block.vue",e),e}),c=o.defineComponent({name:"repeated-block",components:{Block:o.defineAsyncComponent(r)},props:["repeatContext","block","registeredComponents","linkComponent"],data(){return{store:this.repeatContext}},provide(){const e=this;return{[t.BuilderContext.key]:e.store}},watch:{onUpdateHook0:{handler(){this.store=this.repeatContext},immediate:!0}},computed:{onUpdateHook0(){return{0:this.repeatContext}}}});function s(e,p,l,a,d,m){const n=o.resolveComponent("Block");return o.openBlock(),o.createBlock(n,{block:e.block,context:e.store,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"])}const i=t._export_sfc(c,[["render",s]]);exports.default=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),t=require("./index-_dQKp9LH.cjs"),r=()=>Promise.resolve().then(()=>require("./index-_dQKp9LH.cjs")).then(e=>e.block).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Block at ../block.vue",e),e}),c=o.defineComponent({name:"repeated-block",components:{Block:o.defineAsyncComponent(r)},props:["repeatContext","block","registeredComponents","linkComponent"],data(){return{store:this.repeatContext}},provide(){const e=this;return{[t.BuilderContext.key]:e.store}},watch:{onUpdateHook0:{handler(){this.store=this.repeatContext},immediate:!0}},computed:{onUpdateHook0(){return{0:this.repeatContext}}}});function s(e,p,l,a,d,m){const n=o.resolveComponent("Block");return o.openBlock(),o.createBlock(n,{block:e.block,context:e.store,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"])}const i=t._export_sfc(c,[["render",s]]);exports.default=i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),s=require("./index-_dQKp9LH.cjs"),_=require("./find-block-FREohLcp.cjs"),P=o.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,B,C,f,v;const e=this.block,t=s.getResponsiveStylesWithImagePosition(e.responsiveStyles,((S=e.component)==null?void 0:S.name)==="Image"),n=this.context.content,l=s.getSizesForBreakpoints(((h=n==null?void 0:n.meta)==null?void 0:h.breakpoints)||{}),k=!!((C=(B=n==null?void 0:n.meta)==null?void 0:B.breakpoints)!=null&&C.xsmall),a=t==null?void 0:t.large,c=t==null?void 0:t.medium,d=t==null?void 0:t.small,r=t==null?void 0:t.xsmall,m=e.id;if(!m)return"";const b=a?s.createCssClass({className:m,styles:a}):"",g=c?s.createCssClass({className:m,styles:c,mediaQuery:s.getMaxWidthQueryForSize("medium",l)}):"",x=d?s.createCssClass({className:m,styles:d,mediaQuery:s.getMaxWidthQueryForSize("small",l)}):"",p=r&&k?s.createCssClass({className:m,styles:r,mediaQuery:s.getMaxWidthQueryForSize("xsmall",l)}):"",i=e.animations&&e.animations.find(u=>u.trigger==="hover");let y="";if(i){const u=((v=(f=i.steps)==null?void 0:f[1])==null?void 0:v.styles)||{};y=s.createCssClass({className:`${m}:hover`,styles:{...u,transition:`all ${i.duration}s ${s.camelToKebabCase(i.easing)}`,transitionDelay:i.delay?`${i.delay}s`:"0s"}})||""}return[b,g,x,p,y].join(" ")}}});function E(e,t,n,l,k,a){const c=o.resolveComponent("InlinedStyles");return e.TARGET!=="reactNative"&&e.css&&e.canShowBlock?(o.openBlock(),o.createBlock(c,{key:0,id:"builderio-block",styles:e.css,nonce:e.context.nonce},null,8,["styles","nonce"])):o.createCommentVNode("",!0)}const I=s._export_sfc(P,[["render",E]]),Q=o.defineComponent({name:"live-edit-block-styles",components:{InlinedStyles:s._sfc_main},props:["contextProvider","id"],data(){return{TARGET:s.TARGET}},computed:{block(){return _.findBlockById(this.contextProvider.content,this.id)},processedBlock(){var n;const e=this.block;return e?(n=e.repeat)!=null&&n.collection?e:s.getProcessedBlock({block:e,localState:this.contextProvider.localState,rootState:this.contextProvider.rootState,rootSetState:this.contextProvider.rootSetState,context:this.contextProvider.context}):null},canShowBlock(){var e,t,n,l;return s.checkIsDefined((e=this.processedBlock)==null?void 0:e.hide)?!((t=this.processedBlock)!=null&&t.hide):s.checkIsDefined((n=this.processedBlock)==null?void 0:n.show)?(l=this.processedBlock)==null?void 0:l.show:!0},css(){var y,S,h,B,C,f,v,u,T;const e=s.getResponsiveStylesWithImagePosition((y=this.processedBlock)==null?void 0:y.responsiveStyles,((h=(S=this.processedBlock)==null?void 0:S.component)==null?void 0:h.name)==="Image"),t=this.contextProvider.content,n=s.getSizesForBreakpoints(((B=t==null?void 0:t.meta)==null?void 0:B.breakpoints)||{}),l=!!((f=(C=t==null?void 0:t.meta)==null?void 0:C.breakpoints)!=null&&f.xsmall),k=e==null?void 0:e.large,a=e==null?void 0:e.medium,c=e==null?void 0:e.small,d=e==null?void 0:e.xsmall,r=(v=this.processedBlock)==null?void 0:v.id;if(!r)return"";const m=k?s.createCssClass({className:r,styles:k}):"",b=a?s.createCssClass({className:r,styles:a,mediaQuery:s.getMaxWidthQueryForSize("medium",n)}):"",g=c?s.createCssClass({className:r,styles:c,mediaQuery:s.getMaxWidthQueryForSize("small",n)}):"",x=d&&l?s.createCssClass({className:r,styles:d,mediaQuery:s.getMaxWidthQueryForSize("xsmall",n)}):"",p=this.processedBlock.animations&&this.processedBlock.animations.find($=>$.trigger==="hover");let i="";if(p){const $=((T=(u=p.steps)==null?void 0:u[1])==null?void 0:T.styles)||{};i=s.createCssClass({className:`${r}:hover`,styles:{...$,transition:`all ${p.duration}s ${s.camelToKebabCase(p.easing)}`,transitionDelay:p.delay?`${p.delay}s`:"0s"}})||""}return[m,b,g,x,i].join(" ")}}});function A(e,t,n,l,k,a){const c=o.resolveComponent("InlinedStyles");return e.TARGET==="rsc"&&e.css&&e.canShowBlock?(o.openBlock(),o.createBlock(c,{key:0,id:"builderio-block",styles:e.css,nonce:e.contextProvider.nonce},null,8,["styles","nonce"])):o.createCommentVNode("",!0)}const R=s._export_sfc(Q,[["render",A]]),W=o.defineComponent({name:"style-wrapper",components:{BlockStyles:I,LiveEditBlockStyles:R},props:["block","context"],data(){return{isClientEditing:!1,isHydrated:!1,TARGET:s.TARGET}},inject:{contextProvider:s.BuilderContext.key},mounted(){}});function z(e,t,n,l,k,a){const c=o.resolveComponent("LiveEditBlockStyles"),d=o.resolveComponent("BlockStyles");return e.isHydrated?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.TARGET==="rsc"&&e.isClientEditing?(o.openBlock(),o.createBlock(c,{key:0,id:e.block.id,contextProvider:e.contextProvider},null,8,["id","contextProvider"])):(o.openBlock(),o.createBlock(d,{key:1,block:e.block,context:e.context},null,8,["block","context"]))],64)):(o.openBlock(),o.createBlock(d,{key:1,block:e.block,context:e.context},null,8,["block","context"]))}const w=s._export_sfc(W,[["render",z]]);exports.default=w;
@@ -1,9 +1,9 @@
1
- import { defineComponent as E, resolveComponent as x, openBlock as y, createBlock as $, createCommentVNode as Q, createElementBlock as z, Fragment as G } from "vue";
2
- import { c as A, T as w, d as C, f as N, h as l, j as u, k as j, _ as I, l as H, b as R } from "./index-Bgm0yCrN.js";
3
- import { f as U } from "./find-block-3Ig0kVVe.js";
4
- const W = E({
1
+ import { defineComponent as E, resolveComponent as x, openBlock as y, createBlock as g, createCommentVNode as N, createElementBlock as G, Fragment as H } from "vue";
2
+ import { c as R, T as w, d as C, f as W, h as j, j as l, k as u, l as z, _ as Q, m as U, b as D } from "./index-5jMXhHfs.js";
3
+ import { f as F } from "./find-block-3Ig0kVVe.js";
4
+ const L = E({
5
5
  name: "block-styles",
6
- components: { InlinedStyles: A },
6
+ components: { InlinedStyles: R },
7
7
  props: ["block", "context"],
8
8
  data() {
9
9
  return { TARGET: w };
@@ -14,85 +14,88 @@ const W = E({
14
14
  return C(e.hide) ? !e.hide : C(e.show) ? e.show : !0;
15
15
  },
16
16
  css() {
17
- var h, B, f, v, b;
18
- const e = this.block, s = e.responsiveStyles, t = this.context.content, o = N(
19
- ((h = t == null ? void 0 : t.meta) == null ? void 0 : h.breakpoints) || {}
20
- ), p = !!((f = (B = t == null ? void 0 : t.meta) == null ? void 0 : B.breakpoints) != null && f.xsmall), i = s == null ? void 0 : s.large, n = s == null ? void 0 : s.medium, a = s == null ? void 0 : s.small, r = s == null ? void 0 : s.xsmall, d = e.id;
17
+ var S, B, f, v, b, $;
18
+ const e = this.block, s = W(
19
+ e.responsiveStyles,
20
+ ((S = e.component) == null ? void 0 : S.name) === "Image"
21
+ ), t = this.context.content, o = j(
22
+ ((B = t == null ? void 0 : t.meta) == null ? void 0 : B.breakpoints) || {}
23
+ ), p = !!((v = (f = t == null ? void 0 : t.meta) == null ? void 0 : f.breakpoints) != null && v.xsmall), i = s == null ? void 0 : s.large, n = s == null ? void 0 : s.medium, a = s == null ? void 0 : s.small, c = s == null ? void 0 : s.xsmall, d = e.id;
21
24
  if (!d)
22
25
  return "";
23
- const g = i ? l({
26
+ const P = i ? l({
24
27
  className: d,
25
28
  styles: i
26
- }) : "", P = n ? l({
29
+ }) : "", T = n ? l({
27
30
  className: d,
28
31
  styles: n,
29
32
  mediaQuery: u(
30
33
  "medium",
31
34
  o
32
35
  )
33
- }) : "", T = a ? l({
36
+ }) : "", _ = a ? l({
34
37
  className: d,
35
38
  styles: a,
36
39
  mediaQuery: u(
37
40
  "small",
38
41
  o
39
42
  )
40
- }) : "", m = r && p ? l({
43
+ }) : "", m = c && p ? l({
41
44
  className: d,
42
- styles: r,
45
+ styles: c,
43
46
  mediaQuery: u(
44
47
  "xsmall",
45
48
  o
46
49
  )
47
- }) : "", c = e.animations && e.animations.find((k) => k.trigger === "hover");
48
- let S = "";
49
- if (c) {
50
- const k = ((b = (v = c.steps) == null ? void 0 : v[1]) == null ? void 0 : b.styles) || {};
51
- S = l({
50
+ }) : "", r = e.animations && e.animations.find((k) => k.trigger === "hover");
51
+ let h = "";
52
+ if (r) {
53
+ const k = (($ = (b = r.steps) == null ? void 0 : b[1]) == null ? void 0 : $.styles) || {};
54
+ h = l({
52
55
  className: `${d}:hover`,
53
56
  styles: {
54
57
  ...k,
55
- transition: `all ${c.duration}s ${j(
56
- c.easing
58
+ transition: `all ${r.duration}s ${z(
59
+ r.easing
57
60
  )}`,
58
- transitionDelay: c.delay ? `${c.delay}s` : "0s"
61
+ transitionDelay: r.delay ? `${r.delay}s` : "0s"
59
62
  }
60
63
  }) || "";
61
64
  }
62
65
  return [
63
- g,
64
66
  P,
65
67
  T,
68
+ _,
66
69
  m,
67
- S
70
+ h
68
71
  ].join(" ");
69
72
  }
70
73
  }
71
74
  });
72
- function D(e, s, t, o, p, i) {
75
+ function X(e, s, t, o, p, i) {
73
76
  const n = x("InlinedStyles");
74
- return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? (y(), $(n, {
77
+ return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? (y(), g(n, {
75
78
  key: 0,
76
79
  id: "builderio-block",
77
80
  styles: e.css,
78
81
  nonce: e.context.nonce
79
- }, null, 8, ["styles", "nonce"])) : Q("", !0);
82
+ }, null, 8, ["styles", "nonce"])) : N("", !0);
80
83
  }
81
- const F = /* @__PURE__ */ I(W, [["render", D]]), L = E({
84
+ const K = /* @__PURE__ */ Q(L, [["render", X]]), M = E({
82
85
  name: "live-edit-block-styles",
83
- components: { InlinedStyles: A },
86
+ components: { InlinedStyles: R },
84
87
  props: ["contextProvider", "id"],
85
88
  data() {
86
89
  return { TARGET: w };
87
90
  },
88
91
  computed: {
89
92
  block() {
90
- return U(this.contextProvider.content, this.id);
93
+ return F(this.contextProvider.content, this.id);
91
94
  },
92
95
  processedBlock() {
93
96
  var t;
94
97
  const e = this.block;
95
- return e ? (t = e.repeat) != null && t.collection ? e : H({
98
+ return e ? (t = e.repeat) != null && t.collection ? e : U({
96
99
  block: e,
97
100
  localState: this.contextProvider.localState,
98
101
  rootState: this.contextProvider.rootState,
@@ -105,45 +108,48 @@ const F = /* @__PURE__ */ I(W, [["render", D]]), L = E({
105
108
  return C((e = this.processedBlock) == null ? void 0 : e.hide) ? !((s = this.processedBlock) != null && s.hide) : C((t = this.processedBlock) == null ? void 0 : t.show) ? (o = this.processedBlock) == null ? void 0 : o.show : !0;
106
109
  },
107
110
  css() {
108
- var S, h, B, f, v, b, k;
109
- const e = (S = this.processedBlock) == null ? void 0 : S.responsiveStyles, s = this.contextProvider.content, t = N(
110
- ((h = s == null ? void 0 : s.meta) == null ? void 0 : h.breakpoints) || {}
111
- ), o = !!((f = (B = s == null ? void 0 : s.meta) == null ? void 0 : B.breakpoints) != null && f.xsmall), p = e == null ? void 0 : e.large, i = e == null ? void 0 : e.medium, n = e == null ? void 0 : e.small, a = e == null ? void 0 : e.xsmall, r = (v = this.processedBlock) == null ? void 0 : v.id;
112
- if (!r)
111
+ var h, S, B, f, v, b, $, k, A;
112
+ const e = W(
113
+ (h = this.processedBlock) == null ? void 0 : h.responsiveStyles,
114
+ ((B = (S = this.processedBlock) == null ? void 0 : S.component) == null ? void 0 : B.name) === "Image"
115
+ ), s = this.contextProvider.content, t = j(
116
+ ((f = s == null ? void 0 : s.meta) == null ? void 0 : f.breakpoints) || {}
117
+ ), o = !!((b = (v = s == null ? void 0 : s.meta) == null ? void 0 : v.breakpoints) != null && b.xsmall), p = e == null ? void 0 : e.large, i = e == null ? void 0 : e.medium, n = e == null ? void 0 : e.small, a = e == null ? void 0 : e.xsmall, c = ($ = this.processedBlock) == null ? void 0 : $.id;
118
+ if (!c)
113
119
  return "";
114
120
  const d = p ? l({
115
- className: r,
121
+ className: c,
116
122
  styles: p
117
- }) : "", g = i ? l({
118
- className: r,
123
+ }) : "", P = i ? l({
124
+ className: c,
119
125
  styles: i,
120
126
  mediaQuery: u(
121
127
  "medium",
122
128
  t
123
129
  )
124
- }) : "", P = n ? l({
125
- className: r,
130
+ }) : "", T = n ? l({
131
+ className: c,
126
132
  styles: n,
127
133
  mediaQuery: u(
128
134
  "small",
129
135
  t
130
136
  )
131
- }) : "", T = a && o ? l({
132
- className: r,
137
+ }) : "", _ = a && o ? l({
138
+ className: c,
133
139
  styles: a,
134
140
  mediaQuery: u(
135
141
  "xsmall",
136
142
  t
137
143
  )
138
- }) : "", m = this.processedBlock.animations && this.processedBlock.animations.find((_) => _.trigger === "hover");
139
- let c = "";
144
+ }) : "", m = this.processedBlock.animations && this.processedBlock.animations.find((I) => I.trigger === "hover");
145
+ let r = "";
140
146
  if (m) {
141
- const _ = ((k = (b = m.steps) == null ? void 0 : b[1]) == null ? void 0 : k.styles) || {};
142
- c = l({
143
- className: `${r}:hover`,
147
+ const I = ((A = (k = m.steps) == null ? void 0 : k[1]) == null ? void 0 : A.styles) || {};
148
+ r = l({
149
+ className: `${c}:hover`,
144
150
  styles: {
145
- ..._,
146
- transition: `all ${m.duration}s ${j(
151
+ ...I,
152
+ transition: `all ${m.duration}s ${z(
147
153
  m.easing
148
154
  )}`,
149
155
  transitionDelay: m.delay ? `${m.delay}s` : "0s"
@@ -152,58 +158,58 @@ const F = /* @__PURE__ */ I(W, [["render", D]]), L = E({
152
158
  }
153
159
  return [
154
160
  d,
155
- g,
156
161
  P,
157
162
  T,
158
- c
163
+ _,
164
+ r
159
165
  ].join(" ");
160
166
  }
161
167
  }
162
168
  });
163
- function X(e, s, t, o, p, i) {
169
+ function V(e, s, t, o, p, i) {
164
170
  const n = x("InlinedStyles");
165
- return e.TARGET === "rsc" && e.css && e.canShowBlock ? (y(), $(n, {
171
+ return e.TARGET === "rsc" && e.css && e.canShowBlock ? (y(), g(n, {
166
172
  key: 0,
167
173
  id: "builderio-block",
168
174
  styles: e.css,
169
175
  nonce: e.contextProvider.nonce
170
- }, null, 8, ["styles", "nonce"])) : Q("", !0);
176
+ }, null, 8, ["styles", "nonce"])) : N("", !0);
171
177
  }
172
- const K = /* @__PURE__ */ I(L, [["render", X]]), M = E({
178
+ const q = /* @__PURE__ */ Q(M, [["render", V]]), J = E({
173
179
  name: "style-wrapper",
174
180
  components: {
175
- BlockStyles: F,
176
- LiveEditBlockStyles: K
181
+ BlockStyles: K,
182
+ LiveEditBlockStyles: q
177
183
  },
178
184
  props: ["block", "context"],
179
185
  data() {
180
186
  return { isClientEditing: !1, isHydrated: !1, TARGET: w };
181
187
  },
182
188
  inject: {
183
- contextProvider: R.key
189
+ contextProvider: D.key
184
190
  },
185
191
  mounted() {
186
192
  }
187
193
  });
188
- function V(e, s, t, o, p, i) {
194
+ function O(e, s, t, o, p, i) {
189
195
  const n = x("LiveEditBlockStyles"), a = x("BlockStyles");
190
- return e.isHydrated ? (y(), z(G, { key: 0 }, [
191
- e.TARGET === "rsc" && e.isClientEditing ? (y(), $(n, {
196
+ return e.isHydrated ? (y(), G(H, { key: 0 }, [
197
+ e.TARGET === "rsc" && e.isClientEditing ? (y(), g(n, {
192
198
  key: 0,
193
199
  id: e.block.id,
194
200
  contextProvider: e.contextProvider
195
- }, null, 8, ["id", "contextProvider"])) : (y(), $(a, {
201
+ }, null, 8, ["id", "contextProvider"])) : (y(), g(a, {
196
202
  key: 1,
197
203
  block: e.block,
198
204
  context: e.context
199
205
  }, null, 8, ["block", "context"]))
200
- ], 64)) : (y(), $(a, {
206
+ ], 64)) : (y(), g(a, {
201
207
  key: 1,
202
208
  block: e.block,
203
209
  context: e.context
204
210
  }, null, 8, ["block", "context"]));
205
211
  }
206
- const Y = /* @__PURE__ */ I(M, [["render", V]]);
212
+ const se = /* @__PURE__ */ Q(J, [["render", O]]);
207
213
  export {
208
- Y as default
214
+ se as default
209
215
  };
@@ -1 +1 @@
1
- .component-5vz8uirn7sc[data-v-82fc93d6]{display:flex;flex-direction:column;align-items:stretch}.div-1be3j8m9ewb[data-v-ab15749a]{display:flex;line-height:normal;height:100%}.img-t43jfuqn6g[data-v-bb2384ad]{opacity:1;transition:opacity .2s ease-in-out}.div-t43jfuqn6g[data-v-bb2384ad]{width:100%;pointer-events:none;font-size:0}.div-t43jfuqn6g-2[data-v-bb2384ad]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.pre-2oa2wtipkzk[data-v-77c7888c]{padding:10px;color:red;text-align:center}
1
+ .component-5vz8uirn7sc[data-v-82fc93d6]{display:flex;flex-direction:column;align-items:stretch}.div-1be3j8m9ewb[data-v-ab15749a]{display:flex;line-height:normal;height:100%}.img-t43jfuqn6g[data-v-f109a7da]{opacity:1;transition:opacity .2s ease-in-out}.div-t43jfuqn6g[data-v-f109a7da]{width:100%;pointer-events:none;font-size:0}.div-t43jfuqn6g-2[data-v-f109a7da]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.pre-2oa2wtipkzk[data-v-77c7888c]{padding:10px;color:red;text-align:center}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-7xT7wMXt.cjs"),n=e.defineComponent({name:"awaiter",props:[],mounted(){}});function o(t,a,c,i,u,d){return e.renderSlot(t.$slots,"default")}const s=r._export_sfc(n,[["render",o]]);exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-funKFPCj.cjs"),n=e.defineComponent({name:"awaiter",props:[],mounted(){}});function o(t,a,c,i,u,d){return e.renderSlot(t.$slots,"default")}const s=r._export_sfc(n,[["render",o]]);exports.default=s;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as t, renderSlot as o } from "vue";
2
- import { _ as r } from "./index-JQgNoVXs.js";
2
+ import { _ as r } from "./index-DWznrY3w.js";
3
3
  const n = t({
4
4
  name: "awaiter",
5
5
  props: [],
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./get-block-properties-2yGkQVh7.cjs"),a=require("./index-7xT7wMXt.cjs"),i=()=>Promise.resolve().then(()=>require("./index-7xT7wMXt.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}),s=t.defineComponent({name:"block-wrapper",components:{DynamicRenderer:t.defineAsyncComponent(i)},props:["Wrapper","block","context"],data(){return{getBlockActions:r.getBlockActions,getBlockProperties:r.getBlockProperties}}});function l(e,d,m,u,k,y){var o,n;const c=t.resolveComponent("DynamicRenderer");return t.openBlock(),t.createBlock(c,{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,trackingContext:{apiKey:e.context.apiKey,canTrack:e.context.canTrack??!0,contentId:(o=e.context.content)==null?void 0:o.id,variationId:(n=e.context.content)==null?void 0:n.testVariationId}})},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["TagName","attributes","actionAttributes"])}const p=a._export_sfc(s,[["render",l]]);exports.default=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./get-block-properties-DKvJS4pV.cjs"),a=require("./index-funKFPCj.cjs"),i=()=>Promise.resolve().then(()=>require("./index-funKFPCj.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}),s=t.defineComponent({name:"block-wrapper",components:{DynamicRenderer:t.defineAsyncComponent(i)},props:["Wrapper","block","context"],data(){return{getBlockActions:r.getBlockActions,getBlockProperties:r.getBlockProperties}}});function l(e,d,m,u,k,y){var o,n;const c=t.resolveComponent("DynamicRenderer");return t.openBlock(),t.createBlock(c,{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,trackingContext:{apiKey:e.context.apiKey,canTrack:e.context.canTrack??!0,contentId:(o=e.context.content)==null?void 0:o.id,variationId:(n=e.context.content)==null?void 0:n.testVariationId}})},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["TagName","attributes","actionAttributes"])}const p=a._export_sfc(s,[["render",l]]);exports.default=p;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as r, defineAsyncComponent as a, resolveComponent as c, openBlock as i, createBlock as p, withCtx as s, renderSlot as l } from "vue";
2
- import { g as m, a as d } from "./get-block-properties-bMVCvUX0.js";
3
- import { _ as k } from "./index-Bgm0yCrN.js";
4
- const u = () => import("./index-Bgm0yCrN.js").then((t) => t.J).then((t) => t.default).catch((t) => {
2
+ import { g as m, a as d } from "./get-block-properties-AwCMGMPi.js";
3
+ import { _ as k } from "./index-DWznrY3w.js";
4
+ const u = () => import("./index-DWznrY3w.js").then((t) => t.E).then((t) => t.default).catch((t) => {
5
5
  throw console.error(
6
6
  "Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",
7
7
  t
@@ -4,8 +4,14 @@
4
4
  */
5
5
  import type { Query, UserAttributes } from '../helpers';
6
6
  import { type PersonalizationContainerProps } from '../personalization-container.types';
7
+ /**
8
+ * Mirrors helpers/studio-user-attributes.ts; stringification rules out sharing the code.
9
+ * Anything referenced from module scope becomes an undefined global at runtime.
10
+ */
11
+ export declare function getStudioUserAttributes(): Record<string, unknown>;
7
12
  export declare function filterWithCustomTargeting(userAttributes: UserAttributes, query: Query[], startDate?: string, endDate?: string): boolean;
8
13
  export declare function updateVisibilityStylesScript(variants: PersonalizationContainerProps['variants'], blockId: string, isHydrationTarget: boolean, locale?: string): void;
9
- export declare const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\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 attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
14
+ export declare const STUDIO_USER_ATTRIBUTES_SCRIPT = "function getStudioUserAttributes() {\n const params = new URLSearchParams(window.location.search);\n if (params.get('builder.preview') !== 'BUILDER_STUDIO') {\n return {};\n }\n const prefix = 'builder.userAttributes.';\n const attributes = {};\n params.forEach(function (value, key) {\n if (key.indexOf(prefix) === 0) {\n attributes[key.slice(prefix.length)] = value === 'true' ? true : value === 'false' ? false : value;\n }\n });\n return attributes;\n}";
15
+ export declare const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\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 attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n Object.assign(attributes, window.builderIoStudioUserAttributes());\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
10
16
  export declare const FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
11
- export declare const UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\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 visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
17
+ export declare const UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\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 visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n Object.assign(attributes, window.builderIoStudioUserAttributes());\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
@@ -6,7 +6,9 @@ declare const _default: import("vue").DefineComponent<Readonly<{
6
6
  variants?: any;
7
7
  previewingIndex?: any;
8
8
  }>, unknown, {
9
- userAttributes: any;
9
+ userAttributes: {
10
+ [x: string]: any;
11
+ };
10
12
  scriptStr: string;
11
13
  updateVisibilityStylesScript: string;
12
14
  unsubscribers: never[];
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as h, defineAsyncComponent as u, resolveComponent as m, openBlock as o, createBlock as i, withCtx as p, renderSlot as d, createElementBlock as f, Fragment as b, resolveDynamicComponent as C, mergeProps as w, normalizeProps as W, renderList as y, createCommentVNode as B } from "vue";
2
- import { _ as g, B as E, w as R } from "./index-JQgNoVXs.js";
3
- import { T as $, o as A } from "./should-force-browser-runtime-in-node-ooRgTwqs.js";
4
- import { a as v, g as S } from "./get-block-properties-DGfMhs4M.js";
5
- const T = () => import("./awaiter-o3ynOQKr.js").then((t) => t.default).catch((t) => {
2
+ import { _ as g, B as E, w as R } from "./index-DWznrY3w.js";
3
+ import { T as $, o as A } from "./should-force-browser-runtime-in-node-nOG6zu2k.js";
4
+ import { a as v, g as S } from "./get-block-properties-AwCMGMPi.js";
5
+ const T = () => import("./awaiter-9zCUlZB9.js").then((t) => t.default).catch((t) => {
6
6
  throw console.error(
7
7
  "Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",
8
8
  t
9
9
  ), t;
10
- }), I = () => import("./live-edit-hxNZMHld.js").then((t) => t.default).catch((t) => {
10
+ }), I = () => import("./live-edit-GVvl4apL.js").then((t) => t.default).catch((t) => {
11
11
  throw console.error(
12
12
  "Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",
13
13
  t
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),p=require("./index-7xT7wMXt.cjs"),d=require("./should-force-browser-runtime-in-node-aeKfQiEQ.cjs"),l=require("./get-block-properties-2yGkQVh7.cjs"),k=()=>Promise.resolve().then(()=>require("./awaiter-Vwjft2v-.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),h=()=>Promise.resolve().then(()=>require("./live-edit-xPik2aUh.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",e),e}),b=t.defineComponent({name:"interactive-element",components:{LiveEdit:t.defineAsyncComponent(h),Awaiter:t.defineAsyncComponent(k)},props:["wrapperProps","block","includeBlockProps","context","Wrapper"],data(){return{forceRenderCount:0,TARGET:d.TARGET,isEditing:d.isEditing}},watch:{onUpdateHook0:{handler(){},immediate:!0}},computed:{attributes(){var e,o;return this.includeBlockProps?{...l.getBlockProperties({block:this.block,context:this.context}),...l.getBlockActions({block:this.block,rootState:this.context.rootState,rootSetState:this.context.rootSetState,localState:this.context.localState,context:this.context.context,trackingContext:{apiKey:this.context.apiKey,canTrack:this.context.canTrack??!0,contentId:(e=this.context.content)==null?void 0:e.id,variationId:(o=this.context.content)==null?void 0:o.testVariationId}})}:{}},targetWrapperProps(){return{...this.wrapperProps,...Object.keys(this.attributes).length>0?{attributes:this.attributes}:{}}},onUpdateHook0(){var e,o;return{0:this.wrapperProps,1:(o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options}}}});function f(e,o,s,a,i,c){const r=t.resolveComponent("Awaiter"),n=t.resolveComponent("LiveEdit");return e.Wrapper.load?(t.openBlock(),t.createBlock(r,{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.createElementBlock(t.Fragment,{key:1},[e.TARGET==="rsc"&&e.isEditing()?(t.openBlock(),t.createBlock(n,{key:0,Wrapper:e.Wrapper,id:e.block.id||"",attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["Wrapper","id","attributes"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({key:1,attributes:e.attributes},e.targetWrapperProps),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"]))],64))}const m=p._export_sfc(b,[["render",f]]),C=({componentOptions:e,builderBlock:o,context:s,componentRef:a,includeBlockProps:i,isInteractive:c,contextValue:r})=>{const n={...e,...i?{attributes:l.getBlockProperties({block:o,context:r})}:{}};return c?{Wrapper:a,block:o,context:s,wrapperProps:e,includeBlockProps:i}:n},B=t.defineComponent({name:"component-ref",components:{Block:p.Block,InteractiveElement:m},props:["isInteractive","componentRef","blockChildren","componentOptions","builderBlock","context","linkComponent","includeBlockProps","registeredComponents"],data(){return{shouldUpdate:!1,Wrapper:this.isInteractive?p.wrapComponentRef(m):this.componentRef,getWrapperProps:C}},computed:{blockChildrenToRender(){return this.componentRef?this.blockChildren:[]}}});function v(e,o,s,a,i,c){const r=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.blockChildrenToRender,(n,u)=>(t.openBlock(),t.createBlock(r,{key:n.id,block:n,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"]))),128))]),_:1},16)):t.createCommentVNode("",!0)}const g=p._export_sfc(B,[["render",v]]);exports.default=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),p=require("./index-funKFPCj.cjs"),d=require("./should-force-browser-runtime-in-node-5MPjjLJt.cjs"),l=require("./get-block-properties-DKvJS4pV.cjs"),k=()=>Promise.resolve().then(()=>require("./awaiter-0EtumND-.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),h=()=>Promise.resolve().then(()=>require("./live-edit-Bw84zZeV.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",e),e}),b=t.defineComponent({name:"interactive-element",components:{LiveEdit:t.defineAsyncComponent(h),Awaiter:t.defineAsyncComponent(k)},props:["wrapperProps","block","includeBlockProps","context","Wrapper"],data(){return{forceRenderCount:0,TARGET:d.TARGET,isEditing:d.isEditing}},watch:{onUpdateHook0:{handler(){},immediate:!0}},computed:{attributes(){var e,o;return this.includeBlockProps?{...l.getBlockProperties({block:this.block,context:this.context}),...l.getBlockActions({block:this.block,rootState:this.context.rootState,rootSetState:this.context.rootSetState,localState:this.context.localState,context:this.context.context,trackingContext:{apiKey:this.context.apiKey,canTrack:this.context.canTrack??!0,contentId:(e=this.context.content)==null?void 0:e.id,variationId:(o=this.context.content)==null?void 0:o.testVariationId}})}:{}},targetWrapperProps(){return{...this.wrapperProps,...Object.keys(this.attributes).length>0?{attributes:this.attributes}:{}}},onUpdateHook0(){var e,o;return{0:this.wrapperProps,1:(o=(e=this.block)==null?void 0:e.component)==null?void 0:o.options}}}});function f(e,o,s,a,i,c){const r=t.resolveComponent("Awaiter"),n=t.resolveComponent("LiveEdit");return e.Wrapper.load?(t.openBlock(),t.createBlock(r,{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.createElementBlock(t.Fragment,{key:1},[e.TARGET==="rsc"&&e.isEditing()?(t.openBlock(),t.createBlock(n,{key:0,Wrapper:e.Wrapper,id:e.block.id||"",attributes:e.attributes},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["Wrapper","id","attributes"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Wrapper),t.mergeProps({key:1,attributes:e.attributes},e.targetWrapperProps),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["attributes"]))],64))}const m=p._export_sfc(b,[["render",f]]),C=({componentOptions:e,builderBlock:o,context:s,componentRef:a,includeBlockProps:i,isInteractive:c,contextValue:r})=>{const n={...e,...i?{attributes:l.getBlockProperties({block:o,context:r})}:{}};return c?{Wrapper:a,block:o,context:s,wrapperProps:e,includeBlockProps:i}:n},B=t.defineComponent({name:"component-ref",components:{Block:p.Block,InteractiveElement:m},props:["isInteractive","componentRef","blockChildren","componentOptions","builderBlock","context","linkComponent","includeBlockProps","registeredComponents"],data(){return{shouldUpdate:!1,Wrapper:this.isInteractive?p.wrapComponentRef(m):this.componentRef,getWrapperProps:C}},computed:{blockChildrenToRender(){return this.componentRef?this.blockChildren:[]}}});function v(e,o,s,a,i,c){const r=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.blockChildrenToRender,(n,u)=>(t.openBlock(),t.createBlock(r,{key:n.id,block:n,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},null,8,["block","context","registeredComponents","linkComponent"]))),128))]),_:1},16)):t.createCommentVNode("",!0)}const g=p._export_sfc(B,[["render",v]]);exports.default=g;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.2.11";
1
+ export declare const SDK_VERSION = "5.2.13";
@@ -1,5 +1,5 @@
1
- import { T as s } from "./should-force-browser-runtime-in-node-ooRgTwqs.js";
2
- import { e as c, g as i, a as l } from "./index-JQgNoVXs.js";
1
+ import { T as s } from "./should-force-browser-runtime-in-node-nOG6zu2k.js";
2
+ import { e as c, g as i, a as l } from "./index-DWznrY3w.js";
3
3
  const f = (e) => `v-on:${e.toLowerCase()}`, p = (e, t) => (r) => c({
4
4
  code: e,
5
5
  context: t.context,
@@ -1 +1 @@
1
- "use strict";const c=require("./should-force-browser-runtime-in-node-aeKfQiEQ.cjs"),s=require("./index-7xT7wMXt.cjs"),i=e=>`v-on:${e.toLowerCase()}`,l=(e,t)=>r=>s.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function u(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const a=r[o];let n=i(o);if(e.stripPrefix)switch(c.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=l(a,e)}return t}function d({properties:e}){return e}const f=e=>({href:e.href});function p({block:e,context:t}){var o;const r={...f(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 d({properties:r,context:t,block:e})}exports.getBlockActions=u;exports.getBlockProperties=p;
1
+ "use strict";const c=require("./should-force-browser-runtime-in-node-5MPjjLJt.cjs"),s=require("./index-funKFPCj.cjs"),i=e=>`v-on:${e.toLowerCase()}`,l=(e,t)=>r=>s.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function u(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const a=r[o];let n=i(o);if(e.stripPrefix)switch(c.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=l(a,e)}return t}function d({properties:e}){return e}const f=e=>({href:e.href});function p({block:e,context:t}){var o;const r={...f(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 d({properties:r,context:t,block:e})}exports.getBlockActions=u;exports.getBlockProperties=p;
@@ -1,3 +1,5 @@
1
+ import type { BuilderBlock } from '../types/builder-block';
2
+ export declare const getResponsiveStylesWithImagePosition: (styles: BuilderBlock['responsiveStyles'], isBuilderImage: boolean) => BuilderBlock['responsiveStyles'];
1
3
  export declare const convertStyleMapToCSSArray: (style: Partial<CSSStyleDeclaration>) => string[];
2
4
  export declare const convertStyleMapToCSS: (style: Partial<CSSStyleDeclaration>) => string;
3
5
  export declare const createCssClass: ({ mediaQuery, className, styles }: {
@@ -0,0 +1,6 @@
1
+ import type { UserAttributes } from './user-attributes';
2
+ /**
3
+ * Studio passes its targeting overrides as query params because it cannot write the
4
+ * builder.userAttributes cookie on the previewed site's origin.
5
+ */
6
+ export declare const getStudioUserAttributes: () => UserAttributes;
@@ -4,7 +4,9 @@ export interface UserAttributes {
4
4
  export declare const USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
5
5
  export declare function createUserAttributesService(): {
6
6
  setUserAttributes(newAttrs: UserAttributes): void;
7
- getUserAttributes(): any;
7
+ getUserAttributes(): {
8
+ [x: string]: any;
9
+ };
8
10
  subscribeOnUserAttributesChange(callback: (attrs: UserAttributes) => void, { fireImmediately }?: {
9
11
  fireImmediately?: boolean | undefined;
10
12
  }): () => void;
@@ -12,7 +14,9 @@ export declare function createUserAttributesService(): {
12
14
  };
13
15
  export declare const userAttributesService: {
14
16
  setUserAttributes(newAttrs: UserAttributes): void;
15
- getUserAttributes(): any;
17
+ getUserAttributes(): {
18
+ [x: string]: any;
19
+ };
16
20
  subscribeOnUserAttributesChange(callback: (attrs: UserAttributes) => void, { fireImmediately }?: {
17
21
  fireImmediately?: boolean | undefined;
18
22
  }): () => void;