@builder.io/sdk-vue 5.2.12 → 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 (74) hide show
  1. package/lib/browser/{awaiter-_vJybpjE.cjs → awaiter-Ja_QJKsd.cjs} +1 -1
  2. package/lib/browser/{awaiter-nbyjYGTm.js → awaiter-PAIWzl07.js} +1 -1
  3. package/lib/browser/{block-wrapper-LaZs4cQn.cjs → block-wrapper-CeRmNoq0.cjs} +1 -1
  4. package/lib/browser/{block-wrapper-H2uWRFfl.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-VXY67QLx.cjs → component-ref-MNrE4dOw.cjs} +1 -1
  8. package/lib/browser/{component-ref-pzekKy-e.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-k4bCVM0L.cjs → get-block-properties-C1S41sZd.cjs} +1 -1
  11. package/lib/browser/{get-block-properties-pJvtXJrC.js → get-block-properties-aY0jarAY.js} +1 -1
  12. package/lib/browser/helpers/studio-user-attributes.d.ts +6 -0
  13. package/lib/browser/helpers/user-attributes.d.ts +6 -2
  14. package/lib/browser/{index-3BT-zvy_.js → index-Q7tlS2c1.js} +666 -627
  15. package/lib/browser/{index-FQjXUcZa.cjs → index-ohjTQ4ru.cjs} +47 -29
  16. package/lib/browser/index.cjs +1 -1
  17. package/lib/browser/index.mjs +1 -1
  18. package/lib/browser/{live-edit-f81HRMwD.js → live-edit-zIE57v1M.js} +1 -1
  19. package/lib/browser/{live-edit-QecbSljF.cjs → live-edit-zUS6r7uc.cjs} +1 -1
  20. package/lib/browser/{repeated-block-pzyWtt9k.cjs → repeated-block-XFgvkCPh.cjs} +1 -1
  21. package/lib/browser/{repeated-block-z4-Tq0vb.js → repeated-block-qKqkpCg_.js} +2 -2
  22. package/lib/browser/{style-wrapper-XQIDj12j.js → style-wrapper-nYNv2BeU.js} +1 -1
  23. package/lib/browser/{style-wrapper-wOCgRtEf.cjs → style-wrapper-zgP9Exwf.cjs} +1 -1
  24. package/lib/edge/{awaiter-cczNFZYf.js → awaiter-Mugw26Wi.js} +1 -1
  25. package/lib/edge/{awaiter-kqWOzygI.cjs → awaiter-N8Gr0F79.cjs} +1 -1
  26. package/lib/edge/{block-wrapper-TCG6J1wM.js → block-wrapper-0c3wPm9h.js} +3 -3
  27. package/lib/{node/block-wrapper-B7fQ00-T.cjs → edge/block-wrapper-KQrzy0mA.cjs} +1 -1
  28. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  29. package/lib/edge/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  30. package/lib/edge/{component-ref-ke62ODDh.js → component-ref-R_Q4TOb7.js} +4 -4
  31. package/lib/edge/{component-ref-zHNGcCjv.cjs → component-ref-e3xYDpNG.cjs} +1 -1
  32. package/lib/edge/constants/sdk-version.d.ts +1 -1
  33. package/lib/edge/{get-block-properties-GLe5pKJ-.js → get-block-properties-TtYKEgAO.js} +1 -1
  34. package/lib/edge/{get-block-properties-g3UUmViz.cjs → get-block-properties-d0E5ZkZj.cjs} +1 -1
  35. package/lib/edge/helpers/studio-user-attributes.d.ts +6 -0
  36. package/lib/edge/helpers/user-attributes.d.ts +6 -2
  37. package/lib/edge/{index-NPl2zFFt.js → index-5jMXhHfs.js} +1016 -977
  38. package/lib/edge/{index-Q1mE-A20.cjs → index-_dQKp9LH.cjs} +55 -37
  39. package/lib/edge/index.cjs +1 -1
  40. package/lib/edge/index.mjs +1 -1
  41. package/lib/edge/{live-edit-mfyAZvt8.js → live-edit-7Dc7Q2yS.js} +1 -1
  42. package/lib/{node/live-edit-Qt7v1n8V.cjs → edge/live-edit-oGxYZa_V.cjs} +1 -1
  43. package/lib/edge/{repeated-block-lZx6tufR.js → repeated-block-GESRSjst.js} +2 -2
  44. package/lib/edge/{repeated-block-fItsEFz7.cjs → repeated-block-K9b4UbOC.cjs} +1 -1
  45. package/lib/edge/{style-wrapper-9SPXPEOl.cjs → style-wrapper-dmNB8lmp.cjs} +1 -1
  46. package/lib/edge/{style-wrapper-C9W8emFx.js → style-wrapper-rh9YxCiw.js} +1 -1
  47. package/lib/node/{awaiter-Se1nH_ny.cjs → awaiter-0EtumND-.cjs} +1 -1
  48. package/lib/node/{awaiter-if1ZrvLi.js → awaiter-9zCUlZB9.js} +1 -1
  49. package/lib/{edge/block-wrapper-WHxKG2JN.cjs → node/block-wrapper-c0gZ4j4I.cjs} +1 -1
  50. package/lib/node/{block-wrapper-Nkj9awCA.js → block-wrapper-s8zLAxlL.js} +3 -3
  51. package/lib/node/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -2
  52. package/lib/node/blocks/personalization-container/personalization-container.vue.d.ts +3 -1
  53. package/lib/node/{component-ref-IheEdKTm.js → component-ref-PPsTcld8.js} +5 -5
  54. package/lib/node/{component-ref-BFKh4Vpb.cjs → component-ref-lWzA5guw.cjs} +1 -1
  55. package/lib/node/constants/sdk-version.d.ts +1 -1
  56. package/lib/node/{get-block-properties-I05vUwHl.js → get-block-properties-AwCMGMPi.js} +2 -2
  57. package/lib/node/{get-block-properties-NSTAD_o0.cjs → get-block-properties-DKvJS4pV.cjs} +1 -1
  58. package/lib/node/helpers/studio-user-attributes.d.ts +6 -0
  59. package/lib/node/helpers/user-attributes.d.ts +6 -2
  60. package/lib/node/{index-vP-oPL56.js → index-DWznrY3w.js} +557 -518
  61. package/lib/node/{index-jBWgo8LI.cjs → index-funKFPCj.cjs} +47 -29
  62. package/lib/node/index.cjs +1 -1
  63. package/lib/node/index.mjs +2 -2
  64. package/lib/node/init.cjs +1 -1
  65. package/lib/node/init.mjs +1 -1
  66. package/lib/{edge/live-edit-NlcA1TEi.cjs → node/live-edit-Bw84zZeV.cjs} +1 -1
  67. package/lib/node/{live-edit-yKSQ0yqr.js → live-edit-GVvl4apL.js} +1 -1
  68. package/lib/node/{repeated-block-EN_RXDs9.js → repeated-block-SP8WaEQp.js} +2 -2
  69. package/lib/node/{repeated-block-KjQeddn3.cjs → repeated-block-ux8wkluB.cjs} +1 -1
  70. package/lib/node/{should-force-browser-runtime-in-node--WFVCCbl.cjs → should-force-browser-runtime-in-node-5MPjjLJt.cjs} +1 -1
  71. package/lib/node/{should-force-browser-runtime-in-node-cWvDK4Td.js → should-force-browser-runtime-in-node-nOG6zu2k.js} +1 -1
  72. package/lib/node/{style-wrapper-GM8YDWdR.js → style-wrapper-5BoLwggo.js} +2 -2
  73. package/lib/node/{style-wrapper-tpv235Ma.cjs → style-wrapper-aKufn4zn.cjs} +1 -1
  74. package/package.json +1 -1
@@ -1 +1 @@
1
- var p=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-FQjXUcZa.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
+ var p=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-ohjTQ4ru.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 t, renderSlot as o } from "vue";
3
- import { _ as r } from "./index-3BT-zvy_.js";
3
+ import { _ as r } from "./index-Q7tlS2c1.js";
4
4
  const n = t({
5
5
  name: "awaiter",
6
6
  props: [],
@@ -1 +1 @@
1
- var b=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./get-block-properties-k4bCVM0L.cjs"),a=require("./index-FQjXUcZa.cjs"),i=()=>Promise.resolve().then(()=>require("./index-FQjXUcZa.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
+ var b=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./get-block-properties-C1S41sZd.cjs"),a=require("./index-ohjTQ4ru.cjs"),i=()=>Promise.resolve().then(()=>require("./index-ohjTQ4ru.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,8 +1,8 @@
1
1
  import "./style.css";
2
2
  import { defineComponent as r, defineAsyncComponent as a, resolveComponent as c, openBlock as i, createBlock as p, withCtx as s, renderSlot as l } from "vue";
3
- import { g as m, a as d } from "./get-block-properties-pJvtXJrC.js";
4
- import { _ as k } from "./index-3BT-zvy_.js";
5
- const u = () => import("./index-3BT-zvy_.js").then((t) => t.K).then((t) => t.default).catch((t) => {
3
+ import { g as m, a as d } from "./get-block-properties-aY0jarAY.js";
4
+ import { _ as k } from "./index-Q7tlS2c1.js";
5
+ const u = () => import("./index-Q7tlS2c1.js").then((t) => t.K).then((t) => t.default).catch((t) => {
6
6
  throw console.error(
7
7
  "Error while attempting to dynamically import component DynamicRenderer at ../../dynamic-renderer/dynamic-renderer.vue",
8
8
  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 +1 @@
1
- var g=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./index-FQjXUcZa.cjs"),l=require("./get-block-properties-k4bCVM0L.cjs"),u=()=>Promise.resolve().then(()=>require("./awaiter-_vJybpjE.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),k=()=>Promise.resolve().then(()=>require("./live-edit-QecbSljF.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",e),e}),h=t.defineComponent({name:"interactive-element",components:{LiveEdit:t.defineAsyncComponent(k),Awaiter:t.defineAsyncComponent(u)},props:["wrapperProps","block","includeBlockProps","context","Wrapper"],data(){return{forceRenderCount:0,TARGET:r.TARGET,isEditing:r.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 b(e,o,a,s,p,c){const i=t.resolveComponent("Awaiter"),n=t.resolveComponent("LiveEdit");return e.Wrapper.load?(t.openBlock(),t.createBlock(i,{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 d=r._export_sfc(h,[["render",b]]),f=({componentOptions:e,builderBlock:o,context:a,componentRef:s,includeBlockProps:p,isInteractive:c,contextValue:i})=>{const n={...e,...p?{attributes:l.getBlockProperties({block:o,context:i})}:{}};return c?{Wrapper:s,block:o,context:a,wrapperProps:e,includeBlockProps:p}:n},C=t.defineComponent({name:"component-ref",components:{Block:r.Block,InteractiveElement:d},props:["isInteractive","componentRef","blockChildren","componentOptions","builderBlock","context","linkComponent","includeBlockProps","registeredComponents"],data(){return{shouldUpdate:!1,Wrapper:this.isInteractive?r.wrapComponentRef(d):this.componentRef,getWrapperProps:f}},computed:{blockChildrenToRender(){return this.componentRef?this.blockChildren:[]}}});function B(e,o,a,s,p,c){const i=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,m)=>(t.openBlock(),t.createBlock(i,{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 v=r._export_sfc(C,[["render",B]]);exports.default=v;
1
+ var g=require("./style.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./index-ohjTQ4ru.cjs"),l=require("./get-block-properties-C1S41sZd.cjs"),u=()=>Promise.resolve().then(()=>require("./awaiter-Ja_QJKsd.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component Awaiter at ../../awaiter.vue",e),e}),k=()=>Promise.resolve().then(()=>require("./live-edit-zUS6r7uc.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component LiveEdit at ../../live-edit.vue",e),e}),h=t.defineComponent({name:"interactive-element",components:{LiveEdit:t.defineAsyncComponent(k),Awaiter:t.defineAsyncComponent(u)},props:["wrapperProps","block","includeBlockProps","context","Wrapper"],data(){return{forceRenderCount:0,TARGET:r.TARGET,isEditing:r.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 b(e,o,a,s,p,c){const i=t.resolveComponent("Awaiter"),n=t.resolveComponent("LiveEdit");return e.Wrapper.load?(t.openBlock(),t.createBlock(i,{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 d=r._export_sfc(h,[["render",b]]),f=({componentOptions:e,builderBlock:o,context:a,componentRef:s,includeBlockProps:p,isInteractive:c,contextValue:i})=>{const n={...e,...p?{attributes:l.getBlockProperties({block:o,context:i})}:{}};return c?{Wrapper:s,block:o,context:a,wrapperProps:e,includeBlockProps:p}:n},C=t.defineComponent({name:"component-ref",components:{Block:r.Block,InteractiveElement:d},props:["isInteractive","componentRef","blockChildren","componentOptions","builderBlock","context","linkComponent","includeBlockProps","registeredComponents"],data(){return{shouldUpdate:!1,Wrapper:this.isInteractive?r.wrapComponentRef(d):this.componentRef,getWrapperProps:f}},computed:{blockChildrenToRender(){return this.componentRef?this.blockChildren:[]}}});function B(e,o,a,s,p,c){const i=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,m)=>(t.openBlock(),t.createBlock(i,{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 v=r._export_sfc(C,[["render",B]]);exports.default=v;
@@ -1,13 +1,13 @@
1
1
  import "./style.css";
2
2
  import { defineComponent as h, defineAsyncComponent as u, resolveComponent as m, openBlock as o, createBlock as i, withCtx as p, renderSlot as d, createElementBlock as b, Fragment as f, resolveDynamicComponent as C, mergeProps as w, normalizeProps as W, renderList as y, createCommentVNode as B } from "vue";
3
- import { T as E, i as R, _ as g, B as $, w as A } from "./index-3BT-zvy_.js";
4
- import { a as v, g as S } from "./get-block-properties-pJvtXJrC.js";
5
- const T = () => import("./awaiter-nbyjYGTm.js").then((t) => t.default).catch((t) => {
3
+ import { T as E, i as R, _ as g, B as $, w as A } from "./index-Q7tlS2c1.js";
4
+ import { a as v, g as S } from "./get-block-properties-aY0jarAY.js";
5
+ const T = () => import("./awaiter-PAIWzl07.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-f81HRMwD.js").then((t) => t.default).catch((t) => {
10
+ }), I = () => import("./live-edit-zIE57v1M.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
- export declare const SDK_VERSION = "5.2.12";
1
+ export declare const SDK_VERSION = "5.2.13";
@@ -1 +1 @@
1
- var d=require("./style.css");const a=require("./index-FQjXUcZa.cjs"),c=e=>`v-on:${e.toLowerCase()}`,i=(e,t)=>r=>a.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function l(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const s=r[o];let n=c(o);if(e.stripPrefix)switch(a.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=i(s,e)}return t}function u({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:a.getStyle({block:e,context:t}),[a.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=p;
1
+ var d=require("./style.css");const a=require("./index-ohjTQ4ru.cjs"),c=e=>`v-on:${e.toLowerCase()}`,i=(e,t)=>r=>a.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function l(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const s=r[o];let n=c(o);if(e.stripPrefix)switch(a.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=i(s,e)}return t}function u({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:a.getStyle({block:e,context:t}),[a.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=p;
@@ -1,5 +1,5 @@
1
1
  import "./style.css";
2
- import { e as s, T as c, g as i, a as l } from "./index-3BT-zvy_.js";
2
+ import { e as s, T as c, g as i, a as l } from "./index-Q7tlS2c1.js";
3
3
  const f = (e) => `v-on:${e.toLowerCase()}`, p = (e, t) => (r) => s({
4
4
  code: e,
5
5
  context: t.context,
@@ -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;