@useinsider/guido 3.4.1-beta.6fad109 → 3.4.1-beta.a125d94

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.
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "b293a2b0"
15
+ "cdee3452"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,44 +1,42 @@
1
- import { defineComponent as Q, defineAsyncComponent as N, ref as I, computed as W, watch as X, onMounted as Y, onUnmounted as Z } from "vue";
2
- import { useCortexBlueprintBridge as ee } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as te } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as ne } from "../composables/usePartner.js";
6
- import { useStripo as re } from "../composables/useStripo.js";
7
- import { useTimerClone as se } from "../composables/useTimerClone.js";
1
+ import { defineComponent as J, defineAsyncComponent as R, ref as I, computed as W, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
+ import { useCortexBlueprintBridge as Z } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as oe } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as te } from "../composables/usePartner.js";
6
+ import { useStripo as ne } from "../composables/useStripo.js";
7
+ import { useTimerClone as re } from "../composables/useTimerClone.js";
8
8
  import { migrate as x } from "../config/migrator/index.js";
9
9
  import { ModuleFolderDefaults as G } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import ie from "./organisms/AutoSaveController.vue.js";
13
- import me from "./organisms/base/Toaster.vue.js";
14
- import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import le from "./organisms/header/HeaderWrapper.vue.js";
16
- import ue from "./organisms/LoadingWrapper.vue.js";
17
- import pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import fe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as ve } from "../services/stripoApi.js";
20
- import { useConfigStore as ye } from "../stores/config.js";
21
- import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
22
- import { useEditorStore as H } from "../stores/editor.js";
10
+ import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
11
+ import ce from "./organisms/AutoSaveController.vue.js";
12
+ import ae from "./organisms/base/Toaster.vue.js";
13
+ import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
14
+ import me from "./organisms/header/HeaderWrapper.vue.js";
15
+ import de from "./organisms/LoadingWrapper.vue.js";
16
+ import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
17
+ import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
18
+ import { useStripoApi as pe } from "../services/stripoApi.js";
19
+ import { useConfigStore as fe } from "../stores/config.js";
20
+ import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
21
+ import { useEditorStore as ye } from "../stores/editor.js";
23
22
  import { usePreviewStore as he } from "../stores/preview.js";
24
- import { useTemplateStore as be } from "../stores/template.js";
25
- import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
26
- const Ke = /* @__PURE__ */ Q({
23
+ import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
24
+ const He = /* @__PURE__ */ J({
27
25
  __name: "Guido",
28
26
  props: {
29
27
  config: null
30
28
  },
31
29
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
32
- setup($, { expose: z, emit: n }) {
33
- const g = $, q = N(
30
+ setup(H, { expose: z, emit: n }) {
31
+ const g = H, q = R(
34
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
35
- ), K = N(
33
+ ), K = R(
36
34
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
37
- ), E = I(), u = I(), p = Se(), w = ge(), i = ye();
35
+ ), w = I(), u = I(), p = ve(), E = Se(), i = fe();
38
36
  i.init(g.config);
39
- const f = H(), V = he(), m = W(() => f.hasChanges), { isTestPartner: j } = ne(), D = () => {
37
+ const f = ye(), V = he(), m = W(() => f.hasChanges), { isTestPartner: $ } = te(), D = () => {
40
38
  var e;
41
- return (e = E.value) == null ? void 0 : e.handleSave(!0);
39
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
42
40
  }, {
43
41
  templateId: v,
44
42
  userId: C,
@@ -47,8 +45,8 @@ const Ke = /* @__PURE__ */ Q({
47
45
  template: o,
48
46
  editor: s
49
47
  } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || G.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || G.DEFAULT_MODULES;
50
- ee(), te();
51
- const S = {
48
+ f.templateId = v, Z(), oe();
49
+ const h = {
52
50
  emailId: v,
53
51
  userId: C,
54
52
  username: k,
@@ -60,11 +58,11 @@ const Ke = /* @__PURE__ */ Q({
60
58
  onReady: () => {
61
59
  console.debug("guido:ready"), n("ready");
62
60
  }
63
- }, { initPlugin: M } = re(S, _), { getDefaultTemplate: O } = ve(), { cloneTimersOnSave: P, hasTimerBlocks: R } = se(), J = W(() => {
61
+ }, { initPlugin: M } = ne(h, _), { getDefaultTemplate: O } = pe(), { cloneTimersOnSave: P, hasTimerBlocks: A } = re(), j = W(() => {
64
62
  var e;
65
63
  return !((e = i.ui) != null && e.showHeader);
66
64
  });
67
- oe({
65
+ ee({
68
66
  onBack: () => {
69
67
  console.debug("guido:back"), n("back");
70
68
  },
@@ -72,50 +70,50 @@ const Ke = /* @__PURE__ */ Q({
72
70
  console.debug("guido:save:start"), n("save:start");
73
71
  },
74
72
  onSaveComplete: (e) => {
75
- const t = { ...e, metadata: S };
73
+ const t = { ...e, metadata: h };
76
74
  console.debug("guido:save:complete", t), n("save:complete", t);
77
75
  },
78
76
  onTestEmailClick: () => {
79
77
  console.debug("guido:test-email:click"), n("test-email:click");
80
78
  }
81
79
  });
82
- const A = (e) => {
80
+ const B = (e) => {
83
81
  console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
84
- }, B = () => {
82
+ }, N = () => {
85
83
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
86
84
  };
87
- X(() => m.value, () => {
85
+ Q(() => m.value, () => {
88
86
  n("on-change", m.value);
89
87
  });
90
- const h = (e) => {
88
+ const S = (e) => {
91
89
  const t = e, { attribute: l, position: a } = t.detail;
92
90
  console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
93
91
  };
94
92
  let c = null;
95
93
  const b = () => {
96
94
  var t;
97
- const e = document.querySelector(ce);
95
+ const e = document.querySelector(se);
98
96
  (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
99
97
  };
100
- return Y(async () => {
98
+ return X(async () => {
101
99
  var t, l;
102
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), H().$reset(), f.templateId = v, be().$reset(), b();
100
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
103
101
  const e = (t = u.value) == null ? void 0 : t.parentElement;
104
102
  e && (c = new ResizeObserver(b), c.observe(e));
105
103
  try {
106
- w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
104
+ E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
107
105
  const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
108
106
  let r = {
109
107
  html: d && await x(d, a),
110
108
  css: F
111
109
  };
112
- r.html || (r = await O(), r.html = await x(r.html, a)), R(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
110
+ r.html || (r = await O(), r.html = await x(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
113
111
  } catch (a) {
114
112
  console.error("Failed to initialize Stripo editor:", a);
115
113
  }
116
- document.addEventListener("dynamic-content:open", h);
117
- }), Z(() => {
118
- c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", h);
114
+ document.addEventListener("dynamic-content:open", S);
115
+ }), Y(() => {
116
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S);
119
117
  try {
120
118
  window.UIEditor.removeEditor();
121
119
  } catch {
@@ -124,14 +122,14 @@ const Ke = /* @__PURE__ */ Q({
124
122
  i.reset();
125
123
  }), z({
126
124
  dynamicContent: {
127
- insert: A,
128
- close: B
125
+ insert: B,
126
+ close: N
129
127
  },
130
128
  hasChanges: m,
131
129
  saveSilent: D
132
- }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: E, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: w, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: S, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: R, noHeader: J, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: h, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: ie, Toaster: me, FilterSelectionDrawer: de, HeaderWrapper: le, LoadingWrapper: ue, SaveAsTemplateDrawer: pe, UnsubscribeWrapper: fe };
130
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: ce, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: me, LoadingWrapper: de, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
133
131
  }
134
132
  });
135
133
  export {
136
- Ke as default
134
+ He as default
137
135
  };
@@ -1,109 +1,109 @@
1
- var x = Object.defineProperty;
2
- var T = (l, e, t) => e in l ? x(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
- var b = (l, e, t) => T(l, typeof e != "symbol" ? e + "" : e, t);
4
- import S from "../../extensions/Blocks/RadioButton/template.js";
5
- class B {
1
+ var S = Object.defineProperty;
2
+ var I = (p, t, e) => t in p ? S(p, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : p[t] = e;
3
+ var y = (p, t, e) => I(p, typeof t != "symbol" ? t + "" : t, e);
4
+ import R from "../../extensions/Blocks/RadioButton/template.js";
5
+ const L = /font-weight\s*:\s*[^;]*;?/gi, _ = /font-style\s*:\s*[^;]*;?/gi, f = /;\s*;/g, E = /^;|;$/g, x = /display\s*:\s*inline/gi, A = /display\s*:/i, B = /font-weight\s*:\s*bold/i, $ = /font-style\s*:\s*italic/i, N = /^<(?:strong|b)\b/i, O = /^<(?:em|i)\b/i;
6
+ class H {
6
7
  constructor() {
7
- b(this, "parser");
8
+ y(this, "parser");
8
9
  this.parser = new DOMParser();
9
10
  }
10
- migrate(e) {
11
+ migrate(t) {
11
12
  try {
12
- const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll("td.radio-button-block"), i = t.querySelectorAll("td.radio-button-v2");
13
- if (s.length === 0 && i.length === 0)
14
- return e;
15
- let o = !1;
16
- return s.forEach((r) => {
13
+ const e = this.parser.parseFromString(t, "text/html"), o = e.querySelectorAll("td.radio-button-block"), n = e.querySelectorAll("td.radio-button-v2");
14
+ if (o.length === 0 && n.length === 0)
15
+ return t;
16
+ let i = !1;
17
+ return o.forEach((r) => {
17
18
  if (r.classList.contains("radio-button-v2"))
18
19
  return;
19
- const n = r.getAttribute("id"), a = this.extractTextFromElement(r, "ins-title"), g = this.extractTextFromElement(r, "ins-description"), c = this.extractTextFromElement(r, "ins-subscribe"), u = this.extractTextFromElement(r, "ins-unsubscribe"), p = this.buildTextBlock(a), d = this.buildTextBlock(g), y = this.buildTextBlock({ ...c, classList: "" }), f = this.buildTextBlock({ ...u, classList: "" }), h = S.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", d).replace("{-{-YES-}-}", y).replace("{-{-NO-}-}", f), m = this.parser.parseFromString(
20
+ const s = r.getAttribute("id"), c = this.extractTextFromElement(r, "ins-title"), u = this.extractTextFromElement(r, "ins-description"), l = this.extractTextFromElement(r, "ins-subscribe"), a = this.extractTextFromElement(r, "ins-unsubscribe"), d = this.buildTextBlock(c), m = this.buildTextBlock(u), T = this.buildTextBlock({ ...l, classList: "" }), b = this.buildTextBlock({ ...a, classList: "" }), h = R.replace("{-{-TITLE-}-}", d).replace("{-{-DESCRIPTION-}-}", m).replace("{-{-YES-}-}", T).replace("{-{-NO-}-}", b), g = this.parser.parseFromString(
20
21
  `<table id="tempDoc"><tbody><tr>${h}</tr></tbody></table>`,
21
22
  "text/html"
22
23
  ).querySelector(".radio-button-v2");
23
- m && r.parentNode && (m.setAttribute("id", n || ""), r.parentNode.replaceChild(m, r), o = !0);
24
- }), o = this.healRadioButtonV2(t) || o, o ? t.documentElement.outerHTML : e;
25
- } catch (t) {
26
- return console.error("RadioButtonMigrator failed:", t), e;
24
+ g && r.parentNode && (g.setAttribute("id", s || ""), r.parentNode.replaceChild(g, r), i = !0);
25
+ }), i = this.healRadioButtonV2(e) || i, i ? e.documentElement.outerHTML : t;
26
+ } catch (e) {
27
+ return console.error("RadioButtonMigrator failed:", e), t;
27
28
  }
28
29
  }
29
- healRadioButtonV2(e) {
30
- let t = !1;
31
- return e.querySelectorAll("td.radio-button-v2").forEach((s) => {
32
- var d;
33
- s.classList.contains("radio-button-block") || (s.classList.add("radio-button-block"), t = !0);
34
- const i = s.querySelector("input#radioYes"), o = s.querySelector("input#radioNo");
35
- if (!i || !o)
30
+ healRadioButtonV2(t) {
31
+ let e = !1;
32
+ return t.querySelectorAll("td.radio-button-v2").forEach((o) => {
33
+ var m;
34
+ o.classList.contains("radio-button-block") || (o.classList.add("radio-button-block"), e = !0);
35
+ const n = o.querySelector("input#radioYes"), i = o.querySelector("input#radioNo");
36
+ if (!n || !i)
36
37
  return;
37
- const r = ((d = i.parentElement) == null ? void 0 : d.querySelector(":scope > p")) || null;
38
- if (!r && !i.hasAttribute("align"))
38
+ const r = ((m = n.parentElement) == null ? void 0 : m.querySelector(":scope > p")) || null;
39
+ if (!r && !n.hasAttribute("align"))
39
40
  return;
40
- const n = i.closest("tr"), a = o.closest("tr");
41
- if (!n || !a || n === a || !n.parentNode)
41
+ const s = n.closest("tr"), c = i.closest("tr");
42
+ if (!s || !c || s === c || !s.parentNode)
42
43
  return;
43
- const g = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", c = a.cloneNode(!0), u = c.querySelector("input#radioNo"), p = c.querySelector("p");
44
- u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), p && (p.innerHTML = g), n.parentNode.replaceChild(c, n), t = !0;
45
- }), t;
44
+ const u = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", l = c.cloneNode(!0), a = l.querySelector("input#radioNo"), d = l.querySelector("p");
45
+ a && (a.setAttribute("id", "radioYes"), a.removeAttribute("align")), d && (d.innerHTML = u), s.parentNode.replaceChild(l, s), e = !0;
46
+ }), e;
46
47
  }
47
- extractTextFromElement(e, t) {
48
- var d, y;
49
- const s = e.querySelector(`.${t}`);
50
- if (!s)
48
+ extractTextFromElement(t, e) {
49
+ var u, l;
50
+ const o = e === "ins-title" ? "Title" : "Description", n = t.querySelector(`.${e}`);
51
+ if (!n)
51
52
  return {
52
- text: t === "ins-title" ? "Title" : "Description",
53
- isBold: !1,
54
- isItalic: !1,
53
+ paragraphs: [{ innerHtml: o, isBold: !1, isItalic: !1, styles: "" }],
55
54
  align: "left",
56
- styles: "",
57
55
  classList: ""
58
56
  };
59
- const i = s.querySelector("p");
60
- if (!i)
61
- return {
62
- text: ((d = s.textContent) == null ? void 0 : d.trim()) || (t === "ins-title" ? "Title" : "Description"),
57
+ const i = Array.from(n.querySelectorAll("p")), r = n.getAttribute("align") || ((u = i[0]) == null ? void 0 : u.getAttribute("align")) || "left", s = n.getAttribute("class") || "";
58
+ return i.length === 0 ? {
59
+ paragraphs: [{
60
+ innerHtml: ((l = n.textContent) == null ? void 0 : l.trim()) || o,
63
61
  isBold: !1,
64
62
  isItalic: !1,
65
- align: s.getAttribute("align") || "left",
66
- styles: "",
67
- classList: ""
63
+ styles: ""
64
+ }],
65
+ align: r,
66
+ classList: ""
67
+ } : { paragraphs: i.map((a) => {
68
+ const d = a.getAttribute("style") || "", m = B.test(d) || !!a.querySelector("b, strong"), T = $.test(d) || !!a.querySelector("i, em"), b = this.removeFontEmphasisProperties(d);
69
+ return {
70
+ // Legacy parity: empty <p> → fallback placeholder; <p><br></p> is not empty.
71
+ innerHtml: a.innerHTML.trim() || o,
72
+ isBold: m,
73
+ isItalic: T,
74
+ styles: this.convertInlineToBlock(b)
68
75
  };
69
- const o = ((y = i.textContent) == null ? void 0 : y.trim()) || (t === "ins-title" ? "Title" : "Description"), r = i.getAttribute("style") || "", n = s.getAttribute("align") || i.getAttribute("align") || "left", a = /font-weight\s*:\s*bold/i.test(r) || !!i.querySelector("b, strong"), g = /font-style\s*:\s*italic/i.test(r) || !!i.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), u = this.convertInlineToBlock(c), p = s.getAttribute("class") || "";
70
- return {
71
- text: o,
72
- isBold: a,
73
- isItalic: g,
74
- align: n,
75
- styles: u,
76
- classList: p
77
- };
76
+ }), align: r, classList: s };
78
77
  }
79
- buildTextBlock(e) {
80
- let t = e.text;
81
- e.isBold && e.isItalic ? t = `<strong path="1,0"><em path="1,0,0">${t}</em></strong>` : e.isBold ? t = `<strong path="1,0">${t}</strong>` : e.isItalic && (t = `<em path="1,0">${t}</em>`);
82
- const s = e.align ? ` align="${e.align}"` : "", i = e.styles ? ` style="${e.styles.replaceAll('"', "'")}"` : "";
78
+ buildTextBlock(t) {
79
+ const e = t.align ? ` align="${t.align}"` : "", o = t.paragraphs.map((n, i) => {
80
+ const r = i + 1;
81
+ let s = n.innerHtml;
82
+ const c = n.isBold && !N.test(s), u = n.isItalic && !O.test(s);
83
+ c && u ? s = `<strong path="${r},0"><em path="${r},0,0">${s}</em></strong>` : c ? s = `<strong path="${r},0">${s}</strong>` : u && (s = `<em path="${r},0">${s}</em>`);
84
+ const l = n.styles ? ` style="${n.styles.replaceAll('"', "'")}"` : "";
85
+ return `<p path="${r}"${l}>${s}</p>`;
86
+ }).join(`
87
+ `);
83
88
  return `
84
- <td class="esd-block-text ${e.classList}" ${s}>
85
- <p path="1" ${i}>
86
- ${t}
87
- </p>
89
+ <td class="esd-block-text ${t.classList}" ${e}>
90
+ ${o}
88
91
  </td>
89
92
  `;
90
93
  }
91
- removeStyleProperties(e, t) {
92
- return e ? t.reduce((i, o) => {
93
- const r = new RegExp(`${o}\\s*:\\s*[^;]*;?`, "gi");
94
- return i.replace(r, "");
95
- }, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
94
+ removeFontEmphasisProperties(t) {
95
+ return t ? t.replace(L, "").replace(_, "").replace(f, ";").replace(E, "").trim() : "";
96
96
  }
97
- convertInlineToBlock(e) {
98
- if (!e)
97
+ convertInlineToBlock(t) {
98
+ if (!t)
99
99
  return "";
100
- let t = e.replace(/display\s*:\s*inline/gi, "display: block");
101
- return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
100
+ let e = t.replace(x, "display: block");
101
+ return A.test(e) || (e = e ? `${e}; display: block` : "display: block"), e.replace(f, ";").replace(E, "").trim();
102
102
  }
103
103
  }
104
- function L(l) {
105
- return new B().migrate(l);
104
+ function C(p) {
105
+ return new H().migrate(p);
106
106
  }
107
107
  export {
108
- L as migrateRadioButton
108
+ C as migrateRadioButton
109
109
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-8053a037],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-b293a2b0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b293a2b0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b293a2b0]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-8053a037],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-cdee3452]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-cdee3452]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-cdee3452]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
@@ -1,87 +1,79 @@
1
- import { useActionsApi as C } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as T } from "../composables/useHtmlCompiler.js";
3
- import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
1
+ import { useActionsApi as T } from "../composables/useActionsApi.js";
2
+ import { useHtmlCompiler as C } from "../composables/useHtmlCompiler.js";
3
+ import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
4
  import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
6
- import { parsePageList as D } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
7
- import { useDynamicContentStore as P } from "../stores/dynamic-content.js";
8
- import { useUnsubscribeStore as w } from "../stores/unsubscribe.js";
9
- function E(i, o) {
10
- const t = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), c = [];
11
- return t.forEach((r) => {
12
- const a = r.getAttribute(S.PAGE_LIST);
13
- a && c.push(...D(a));
14
- }), o.filter((r) => c.includes(r));
5
+ import { DATA_ATTRIBUTES as y } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
6
+ import { parsePageList as P } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
7
+ import { useDynamicContentStore as D } from "../stores/dynamic-content.js";
8
+ import { useUnsubscribeStore as E } from "../stores/unsubscribe.js";
9
+ function U(i, r) {
10
+ const s = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${y.PAGE_LIST}]`), c = [];
11
+ return s.forEach((t) => {
12
+ const o = t.getAttribute(y.PAGE_LIST);
13
+ o && c.push(...P(o));
14
+ }), r.filter((t) => c.includes(t));
15
15
  }
16
- async function U(i) {
16
+ function F(i) {
17
17
  const m = new DOMParser().parseFromString(i, "text/html").querySelectorAll(".recommendation-block-v2");
18
18
  if (m.length === 0)
19
19
  return;
20
- const l = b();
21
- m.forEach((t) => {
22
- var g, f, u, n, y;
23
- const c = t.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
24
- if (!Number.isFinite(r))
20
+ const d = b();
21
+ m.forEach((s) => {
22
+ var g, f, u, n, S;
23
+ const c = s.getAttribute("recommendation-id"), t = c ? Number(c) : NaN;
24
+ if (!Number.isFinite(t))
25
25
  return;
26
- const a = t.getAttribute("esd-ext-config");
27
- if (!a)
26
+ const o = s.getAttribute("esd-ext-config");
27
+ if (!o)
28
28
  return;
29
29
  let e;
30
30
  try {
31
- e = JSON.parse(a);
31
+ e = JSON.parse(o);
32
32
  } catch {
33
33
  return;
34
34
  }
35
35
  if (!e || typeof e != "object" || Array.isArray(e))
36
36
  return;
37
37
  const p = {
38
- strategy: e.strategy ?? s.strategy,
39
- language: e.language ?? s.language,
40
- size: e.size ?? s.size,
38
+ strategy: e.strategy ?? a.strategy,
39
+ language: e.language ?? a.language,
40
+ size: e.size ?? a.size,
41
41
  // Spread the default arrays so each block gets a fresh reference
42
42
  // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
43
- productIds: e.productIds ?? [...s.productIds],
44
- filters: e.filters ?? [...s.filters],
45
- shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
46
- currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? d.code,
47
- currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? d.alignment,
48
- currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? d.decimalCount,
49
- currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? d.decimalSeparator,
50
- currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
43
+ productIds: e.productIds ?? [...a.productIds],
44
+ filters: e.filters ?? [...a.filters],
45
+ shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
46
+ currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? l.code,
47
+ currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? l.alignment,
48
+ currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? l.decimalCount,
49
+ currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? l.decimalSeparator,
50
+ currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? l.thousandSeparator
51
51
  };
52
- l.seedBlockUrlConfig(r, p);
52
+ d.seedBlockUrlConfig(t, p);
53
53
  });
54
- try {
55
- await l.fetchRecommendationCreateData();
56
- } catch (t) {
57
- console.warn(
58
- "Recommendation reference data pre-load failed; validator will skip the availability check.",
59
- t
60
- );
61
- }
62
54
  }
63
55
  const _ = () => {
64
- const i = P(), o = w(), { getCompiledEmail: m, getTemplateData: l } = C(), { compileHtml: t } = T();
56
+ const i = D(), r = E(), { getCompiledEmail: m, getTemplateData: d } = T(), { compileHtml: s } = C();
65
57
  return {
66
58
  prepareTemplateDetails: async () => {
67
- const { html: r, ampHtml: a = "", ampErrors: e = [] } = await m({
59
+ const { html: t, ampHtml: o = "", ampErrors: e = [] } = await m({
68
60
  minimize: !0,
69
61
  resetDataSavedFlag: !1
70
- }), { html: p, css: g, syncModulesIds: f = [] } = await l();
71
- o.selectedUnsubscribePages.length && await o.fetchTemplates(), await U(p);
72
- const { compiledHtml: u, stats: n, appliedRules: y } = t(r), h = i.getSelectedDynamicContentList, A = b();
62
+ }), { html: p, css: g, syncModulesIds: f = [] } = await d();
63
+ r.selectedUnsubscribePages.length && await r.fetchTemplates(), F(p);
64
+ const { compiledHtml: u, stats: n, appliedRules: S } = s(t), h = i.getSelectedDynamicContentList, A = b();
73
65
  return console.debug("HTML Compilation Stats:", {
74
66
  originalSize: n.originalSize,
75
67
  compiledSize: n.compiledSize,
76
68
  reduction: `${n.reductionPercentage.toFixed(2)}%`,
77
- appliedRules: y,
69
+ appliedRules: S,
78
70
  executionTime: `${n.executionTime.toFixed(2)}ms`
79
71
  }), {
80
72
  dynamicContentList: h,
81
73
  compiledHtml: u,
82
74
  rawHtml: p,
83
75
  css: g,
84
- ampHtml: a,
76
+ ampHtml: o,
85
77
  ampErrors: e,
86
78
  modules: f.map(Number),
87
79
  recommendation: {
@@ -89,8 +81,8 @@ const _ = () => {
89
81
  configs: {}
90
82
  },
91
83
  unsubscribe: {
92
- status: o.unsubscribePagesStatus,
93
- config: E(u, o.selectedUnsubscribePages)
84
+ status: r.unsubscribePagesStatus,
85
+ config: U(u, r.selectedUnsubscribePages)
94
86
  }
95
87
  };
96
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.4.1-beta.6fad109",
3
+ "version": "3.4.1-beta.a125d94",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",