@useinsider/guido 3.12.0-beta.ea5b317 → 3.12.0-beta.f48e1bc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as
|
|
2
|
-
import { usePreviewInteractionGuard as
|
|
1
|
+
import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as d } from "vue";
|
|
2
|
+
import { usePreviewInteractionGuard as v } from "../../../../composables/usePreviewInteractionGuard.js";
|
|
3
3
|
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
4
4
|
import { usePreviewStore as w } from "../../../../stores/preview.js";
|
|
5
5
|
import I from "./DesktopBrowserHeader.vue.js";
|
|
6
6
|
const C = /* @__PURE__ */ u({
|
|
7
7
|
__name: "DesktopPreview",
|
|
8
|
-
setup(
|
|
9
|
-
const i = _(), {
|
|
8
|
+
setup(P) {
|
|
9
|
+
const i = _(), { guardPreviewInteractions: t } = v(), o = a(), r = a(!1), c = w();
|
|
10
10
|
let e = null;
|
|
11
11
|
const f = (m) => {
|
|
12
12
|
t(m.target);
|
|
13
|
-
},
|
|
13
|
+
}, n = () => {
|
|
14
14
|
o.value && (e = new ResizeObserver(() => {
|
|
15
|
-
}), e.observe(o.value),
|
|
16
|
-
|
|
15
|
+
}), e.observe(o.value), d(() => {
|
|
16
|
+
r.value = !0;
|
|
17
17
|
}));
|
|
18
18
|
}, s = () => {
|
|
19
19
|
e == null || e.disconnect();
|
|
20
20
|
};
|
|
21
|
-
return p(
|
|
21
|
+
return p(n), l(s), { __sfc: !0, trans: i, guardPreviewInteractions: t, containerRef: o, isContainerReady: r, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: n, cleanIframe: s, DesktopBrowserHeader: I };
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
export {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./ContentView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
4
|
+
var o = function() {
|
|
5
5
|
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
6
|
return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
|
|
7
7
|
return t.$emit("back-to-inbox");
|
|
8
8
|
} } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
|
|
9
|
-
},
|
|
9
|
+
}, i = [], r = /* @__PURE__ */ n(
|
|
10
10
|
e,
|
|
11
|
-
c,
|
|
12
11
|
o,
|
|
12
|
+
i,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"f255b2bb"
|
|
16
16
|
);
|
|
17
|
-
const d =
|
|
17
|
+
const d = r.exports;
|
|
18
18
|
export {
|
|
19
19
|
d as default
|
|
20
20
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as c, ref as a } from "vue";
|
|
2
2
|
import { usePreviewInteractionGuard as f } from "../../../../composables/usePreviewInteractionGuard.js";
|
|
3
3
|
import { useResponsivePreview as p } from "../../../../composables/useResponsivePreview.js";
|
|
4
4
|
import { useTranslations as u } from "../../../../composables/useTranslations.js";
|
|
5
5
|
import { usePreviewStore as v } from "../../../../stores/preview.js";
|
|
6
|
-
import { InIcons as
|
|
7
|
-
const
|
|
6
|
+
import { InIcons as d } from "@useinsider/design-system-vue";
|
|
7
|
+
const b = /* @__PURE__ */ c({
|
|
8
8
|
__name: "ContentView",
|
|
9
9
|
emits: ["back-to-inbox"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
10
|
+
setup(P) {
|
|
11
|
+
const m = u(), r = v(), t = a(), { setupResponsivePreview: n } = p(), { guardPreviewInteractions: s } = f(), i = (e) => {
|
|
12
12
|
["transform", "transform-origin", "height"].forEach((o) => {
|
|
13
13
|
e.documentElement.style.removeProperty(o);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
return { __sfc: !0, trans:
|
|
17
|
-
const e =
|
|
18
|
-
o && (n(e), s(e),
|
|
19
|
-
}, InIcons:
|
|
16
|
+
return { __sfc: !0, trans: m, previewStore: r, iframeRef: t, setupResponsivePreview: n, guardPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
|
|
17
|
+
const e = t.value, o = e == null ? void 0 : e.contentDocument;
|
|
18
|
+
o && (n(e), s(e), r.isAMPResponsive && i(o));
|
|
19
|
+
}, InIcons: d };
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
b as default
|
|
24
24
|
};
|
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { URLS as o, MERGE_TAGS as a } from "../enums/unsubscribe.js";
|
|
2
|
+
import { UNSUBSCRIBE_LINK_SELECTOR as i } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
3
|
+
import { BASE_SAFE_URL_SCHEMES as u } from "../utils/urlSchemes.js";
|
|
4
|
+
const E = ["click", "auxclick"], d = [
|
|
5
|
+
...Object.values(a),
|
|
6
|
+
o.UNSUBSCRIBE_URL,
|
|
7
|
+
o.PREFERENCES_URL
|
|
8
|
+
], l = (e) => {
|
|
9
|
+
if (e.matches(i))
|
|
10
|
+
return !0;
|
|
11
|
+
const r = e.getAttribute("href") ?? "";
|
|
12
|
+
return d.some((t) => r.includes(t));
|
|
13
|
+
}, S = [...u, "tel:", "sms:"], f = (e) => {
|
|
14
|
+
const r = (e.getAttribute("href") ?? "").trim();
|
|
15
|
+
return r === "" || r.startsWith("#") || r.startsWith("{{") ? !1 : S.includes(e.protocol);
|
|
16
|
+
}, m = (e) => {
|
|
17
|
+
var t, n;
|
|
18
|
+
const r = (n = (t = e.target) == null ? void 0 : t.closest) == null ? void 0 : n.call(t, "a");
|
|
19
|
+
if (r) {
|
|
20
|
+
if (l(r) || !f(r)) {
|
|
21
|
+
e.preventDefault(), e.stopPropagation();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer");
|
|
25
|
+
}
|
|
26
|
+
}, R = (e) => {
|
|
27
|
+
e.preventDefault(), e.stopPropagation();
|
|
28
|
+
}, s = /* @__PURE__ */ new WeakSet(), c = "guidoPreviewGuarded", g = () => ({ guardPreviewInteractions: (r) => {
|
|
4
29
|
try {
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
30
|
+
const t = r.contentDocument;
|
|
31
|
+
if (!t || s.has(t))
|
|
7
32
|
return;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
} catch (
|
|
12
|
-
console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:",
|
|
33
|
+
delete t.documentElement.dataset[c], E.forEach((n) => {
|
|
34
|
+
t.addEventListener(n, m, !0);
|
|
35
|
+
}), t.addEventListener("submit", R, !0), s.add(t), t.documentElement.dataset[c] = "true";
|
|
36
|
+
} catch (t) {
|
|
37
|
+
console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", t);
|
|
13
38
|
}
|
|
14
39
|
} });
|
|
15
40
|
export {
|
|
16
|
-
|
|
41
|
+
g as usePreviewInteractionGuard
|
|
17
42
|
};
|
|
@@ -1,111 +1,112 @@
|
|
|
1
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
2
|
-
import { useRecommendationExtensionStore as
|
|
3
|
-
import { formatPrice as
|
|
4
|
-
|
|
1
|
+
import { BLOCK_ROOT_SELECTOR as f, CURRENCY_ATTR as A, CONTAINER_SELECTOR as O } from "../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
+
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
3
|
+
import { formatPrice as _ } from "../extensions/Blocks/Recommendation/utils/priceFormatter.js";
|
|
4
|
+
import { BASE_SAFE_URL_SCHEMES as R } from "../utils/urlSchemes.js";
|
|
5
|
+
const S = `${f}[recommendation-id]`, h = ".product-old-price", T = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, b = new RegExp(
|
|
5
6
|
"\\{%\\s*if\\s+([\\s\\S]+?)\\s*%\\}([\\s\\S]*?)(?:\\{%\\s*else\\s*%\\}([\\s\\S]*?))?\\{%\\s*endif\\s*%\\}",
|
|
6
7
|
"g"
|
|
7
8
|
);
|
|
8
|
-
function
|
|
9
|
+
function L(e) {
|
|
9
10
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
const
|
|
14
|
-
return
|
|
12
|
+
function g(e) {
|
|
13
|
+
var c;
|
|
14
|
+
const i = (c = e.replace(/[\u0000-\u0020]+/g, "").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/)) == null ? void 0 : c[1];
|
|
15
|
+
return i && !R.includes(`${i}:`) ? "" : e;
|
|
15
16
|
}
|
|
16
17
|
function N(e) {
|
|
17
|
-
const t = e.getAttribute(
|
|
18
|
+
const t = e.getAttribute(A.CURRENCY) || "USD", i = e.getAttribute(A.DECIMAL_SEPARATOR) || ".", c = e.getAttribute(A.THOUSAND_SEPARATOR) || ",";
|
|
18
19
|
return {
|
|
19
20
|
code: t,
|
|
20
|
-
symbol: e.getAttribute(
|
|
21
|
-
alignment: e.getAttribute(
|
|
22
|
-
decimalCount: parseInt(e.getAttribute(
|
|
23
|
-
decimalSeparator:
|
|
24
|
-
thousandSeparator:
|
|
21
|
+
symbol: e.getAttribute(A.SYMBOL) || t,
|
|
22
|
+
alignment: e.getAttribute(A.ALIGNMENT) === "0" ? "before" : "after",
|
|
23
|
+
decimalCount: parseInt(e.getAttribute(A.DECIMAL_COUNT) || "2") || 2,
|
|
24
|
+
decimalSeparator: i,
|
|
25
|
+
thousandSeparator: c
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function E(e, t) {
|
|
28
29
|
return (e == null ? void 0 : e[t]) ?? Object.values(e ?? {})[0] ?? 0;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return
|
|
31
|
+
function $(e, t) {
|
|
32
|
+
const i = E(e.original_price, t), c = E(e.price, t), n = i > 0 ? Math.round((i - c) / i * 100) : 0;
|
|
33
|
+
return n > 0 ? `${n}%` : "0%";
|
|
33
34
|
}
|
|
34
|
-
function P(e, t,
|
|
35
|
-
|
|
36
|
-
const r = (m) => `${
|
|
37
|
-
e.set(r("name"),
|
|
38
|
-
e.set(r(`product_attribute.${m}`), String(
|
|
35
|
+
function P(e, t, i, c, n, a) {
|
|
36
|
+
c.forEach((o, s) => {
|
|
37
|
+
const r = (m) => `${i}_${s}_${m}`, u = _({ price: E(o.price, n.code), currency: n }), l = _({ price: E(o.original_price, n.code), currency: n }), d = $(o, n.code);
|
|
38
|
+
e.set(r("name"), o.name ?? ""), e.set(r("image_url"), g(o.image_url ?? "")), e.set(r("url"), g(o.url ?? "")), e.set(r("item_id"), o.item_id ?? ""), e.set(r("currency"), ""), e.set(r("price"), u), e.set(r("original_price"), l), e.set(r("discount"), d), e.set(r("omnibus_price"), l), e.set(r("omnibus_discount"), d), a && u === l && t.add(`${i}_${s}`), Object.entries(o.product_attributes ?? {}).forEach(([m, p]) => {
|
|
39
|
+
e.set(r(`product_attribute.${m}`), String(p)), e.set(r(m), String(p));
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
function z(e, t) {
|
|
44
|
+
const i = e.match(/^(.+?)\s*(!=|==)\s*"([^"]*)"$/);
|
|
45
|
+
if (!i)
|
|
45
46
|
return !0;
|
|
46
|
-
const [,
|
|
47
|
-
return
|
|
47
|
+
const [, c, n, a] = i, o = t.get(c.trim()) ?? "";
|
|
48
|
+
return n === "!=" ? o !== a : o === a;
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function w(e, t) {
|
|
50
51
|
return e.replace(
|
|
51
|
-
|
|
52
|
-
(
|
|
52
|
+
b,
|
|
53
|
+
(i, c, n, a) => c.split(/\s+and\s+/).every((s) => z(s.trim(), t)) ? n : a ?? ""
|
|
53
54
|
);
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function D(e) {
|
|
56
57
|
let t = e;
|
|
57
58
|
for (; t.children.length === 1; )
|
|
58
59
|
[t] = t.children;
|
|
59
60
|
return t;
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
62
|
+
function I(e, t) {
|
|
63
|
+
var o;
|
|
63
64
|
if (!t.size)
|
|
64
65
|
return e;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const r = Number(
|
|
66
|
+
const i = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), c = new DOMParser().parseFromString(i, "text/html");
|
|
67
|
+
c.querySelectorAll(S).forEach((s) => {
|
|
68
|
+
const r = Number(s.getAttribute("recommendation-id"));
|
|
68
69
|
if (!Number.isFinite(r))
|
|
69
70
|
return;
|
|
70
|
-
const u =
|
|
71
|
-
(u.length ? Array.from(u) : [
|
|
72
|
-
d.querySelectorAll(
|
|
73
|
-
t.has(`${r}_${
|
|
71
|
+
const u = s.querySelectorAll(O);
|
|
72
|
+
(u.length ? Array.from(u) : [s]).forEach((d) => {
|
|
73
|
+
d.querySelectorAll(h).forEach((m, p) => {
|
|
74
|
+
t.has(`${r}_${p}`) && (D(m).textContent = "");
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
77
|
});
|
|
77
|
-
const
|
|
78
|
-
return ((
|
|
79
|
-
` : "") +
|
|
78
|
+
const n = (o = e.match(/<!DOCTYPE[^>]*>/i)) == null ? void 0 : o[0];
|
|
79
|
+
return ((n ? `${n}
|
|
80
|
+
` : "") + c.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function y(e) {
|
|
82
83
|
if (!e || !e.includes("recommendation-block-v2"))
|
|
83
84
|
return e;
|
|
84
|
-
const t =
|
|
85
|
-
if (
|
|
85
|
+
const t = C(), i = new DOMParser().parseFromString(e, "text/html"), c = Array.from(i.querySelectorAll(S)), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
86
|
+
if (c.forEach((s) => {
|
|
86
87
|
var l;
|
|
87
|
-
const r = Number(
|
|
88
|
+
const r = Number(s.getAttribute("recommendation-id"));
|
|
88
89
|
if (!Number.isFinite(r))
|
|
89
90
|
return;
|
|
90
91
|
const u = ((l = t.blockStates[r]) == null ? void 0 : l.recommendationProducts) ?? [];
|
|
91
92
|
u.length && P(
|
|
92
|
-
|
|
93
|
+
n,
|
|
93
94
|
a,
|
|
94
95
|
r,
|
|
95
96
|
u,
|
|
96
|
-
N(
|
|
97
|
-
|
|
97
|
+
N(s),
|
|
98
|
+
s.getAttribute("hide-price") === "true"
|
|
98
99
|
);
|
|
99
|
-
}), !
|
|
100
|
+
}), !n.size)
|
|
100
101
|
return e;
|
|
101
|
-
let
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
(
|
|
105
|
-
),
|
|
102
|
+
let o = I(e, a);
|
|
103
|
+
return o = o.replace(
|
|
104
|
+
T,
|
|
105
|
+
(s, r) => n.has(r) ? L(n.get(r)) : s
|
|
106
|
+
), o = w(o, n), o;
|
|
106
107
|
}
|
|
107
|
-
const q = () => ({ substituteRecommendationPreview:
|
|
108
|
+
const q = () => ({ substituteRecommendationPreview: y });
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
y as substituteRecommendationPreview,
|
|
110
111
|
q as useRecommendationPreview
|
|
111
112
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BLOCK_BACKGROUND = "recommendation-block-background-color-control", c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
3
|
+
import { BLOCK_ROOT_SELECTOR as t } from "../../constants/selectors.js";
|
|
4
|
+
const c = o(
|
|
5
|
+
r.BLOCK_BACKGROUND,
|
|
6
|
+
t
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
c as BlockBackgroundColorControl
|
|
10
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
1
|
+
import { ExtensionBuilder as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import n from "./canvasPreview.css.js";
|
|
4
4
|
import { RecommendationBlockControl as i } from "./controls/main/index.js";
|
|
@@ -6,42 +6,44 @@ import "./constants/selectors.js";
|
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./utils/captureStyleTemplates.js";
|
|
8
8
|
import { NameControls as e } from "./controls/name/index.js";
|
|
9
|
-
import { PriceControls as
|
|
10
|
-
import { OldPriceControls as
|
|
9
|
+
import { PriceControls as l } from "./controls/price/index.js";
|
|
10
|
+
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
11
11
|
import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
|
|
12
12
|
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
13
13
|
import { ButtonControls as c } from "./controls/button/index.js";
|
|
14
|
-
import { ImageControls as
|
|
15
|
-
import { CustomAttributeControls as
|
|
14
|
+
import { ImageControls as C } from "./controls/image/index.js";
|
|
15
|
+
import { CustomAttributeControls as f } from "./controls/customAttribute/index.js";
|
|
16
16
|
import { SpacingControl as d } from "./controls/spacing/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import { BlockBackgroundColorControl as u } from "./controls/blockBackground/index.js";
|
|
18
|
+
import { CardBackgroundColorControl as g } from "./controls/cardBackground/index.js";
|
|
19
|
+
import { RecommendationCardCompositionControl as y } from "./controls/cardComposition/index.js";
|
|
20
|
+
import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
|
|
20
21
|
import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
|
|
21
22
|
import R from "./recommendation.css.js";
|
|
22
23
|
import { SettingsPanel as S } from "./settingsPanel.js";
|
|
23
|
-
const
|
|
24
|
+
const k = [
|
|
24
25
|
e,
|
|
25
|
-
s,
|
|
26
26
|
l,
|
|
27
|
+
s,
|
|
27
28
|
p,
|
|
28
29
|
a,
|
|
29
30
|
c,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
31
|
+
C,
|
|
32
|
+
f
|
|
33
|
+
], w = [
|
|
33
34
|
i,
|
|
34
35
|
u,
|
|
35
|
-
d,
|
|
36
36
|
g,
|
|
37
|
-
|
|
37
|
+
d,
|
|
38
|
+
y,
|
|
39
|
+
B
|
|
38
40
|
], b = [
|
|
39
|
-
...
|
|
40
|
-
...
|
|
41
|
-
],
|
|
42
|
-
(o,
|
|
43
|
-
new
|
|
41
|
+
...w,
|
|
42
|
+
...k.flatMap((o) => Object.values(o))
|
|
43
|
+
], W = b.reduce(
|
|
44
|
+
(o, r) => o.addControl(r),
|
|
45
|
+
new t().addBlock(m).withSettingsPanelRegistry(S)
|
|
44
46
|
).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
W as default
|
|
47
49
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as
|
|
2
|
-
import { BLOCK_ID as
|
|
1
|
+
import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as I, ContainerControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as R } from "./block.js";
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
|
-
import { CONTROL_BLOCK_ID as
|
|
6
|
+
import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
|
|
7
7
|
import "./store/recommendation.js";
|
|
8
8
|
import "./utils/captureStyleTemplates.js";
|
|
9
9
|
import "./controls/name/index.js";
|
|
@@ -13,37 +13,38 @@ import "./controls/omnibusPrice/index.js";
|
|
|
13
13
|
import "./controls/omnibusDiscount/index.js";
|
|
14
14
|
import "./controls/button/index.js";
|
|
15
15
|
import "./controls/image/index.js";
|
|
16
|
-
import { SPACING_CONTROL_ID as
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
16
|
+
import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
|
|
17
|
+
import "./controls/blockBackground/index.js";
|
|
18
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
|
|
19
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
19
20
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
20
|
-
class
|
|
21
|
-
registerBlockControls(
|
|
22
|
-
|
|
21
|
+
class s extends E {
|
|
22
|
+
registerBlockControls(O) {
|
|
23
|
+
O[R] = [
|
|
23
24
|
new _(
|
|
24
|
-
|
|
25
|
+
I.SETTINGS,
|
|
25
26
|
[
|
|
26
|
-
|
|
27
|
+
U,
|
|
27
28
|
C.EXTERNAL_INDENTS
|
|
28
29
|
]
|
|
29
30
|
),
|
|
30
31
|
new _(
|
|
31
|
-
|
|
32
|
+
I.STYLES,
|
|
32
33
|
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
T.BLOCK_BACKGROUND,
|
|
35
|
+
L,
|
|
36
|
+
A
|
|
36
37
|
]
|
|
37
38
|
),
|
|
38
39
|
new _(
|
|
39
40
|
"Card Composition",
|
|
40
41
|
[
|
|
41
|
-
|
|
42
|
+
D
|
|
42
43
|
]
|
|
43
44
|
).withLabel(this.api.translate("Card Composition"))
|
|
44
|
-
],
|
|
45
|
+
], O[S.NAME] = [
|
|
45
46
|
new _(
|
|
46
|
-
|
|
47
|
+
I.SETTINGS,
|
|
47
48
|
[
|
|
48
49
|
N,
|
|
49
50
|
T.NAME_STYLE,
|
|
@@ -53,7 +54,7 @@ class d extends E {
|
|
|
53
54
|
]
|
|
54
55
|
),
|
|
55
56
|
new _(
|
|
56
|
-
|
|
57
|
+
I.STYLES,
|
|
57
58
|
[
|
|
58
59
|
T.NAME_BACKGROUND,
|
|
59
60
|
T.NAME_FONT_FAMILY,
|
|
@@ -61,9 +62,9 @@ class d extends E {
|
|
|
61
62
|
T.NAME_COLOR
|
|
62
63
|
]
|
|
63
64
|
)
|
|
64
|
-
],
|
|
65
|
+
], O[S.PRICE] = [
|
|
65
66
|
new _(
|
|
66
|
-
|
|
67
|
+
I.SETTINGS,
|
|
67
68
|
[
|
|
68
69
|
N,
|
|
69
70
|
T.PRICE_STYLE,
|
|
@@ -72,7 +73,7 @@ class d extends E {
|
|
|
72
73
|
]
|
|
73
74
|
),
|
|
74
75
|
new _(
|
|
75
|
-
|
|
76
|
+
I.STYLES,
|
|
76
77
|
[
|
|
77
78
|
T.PRICE_BACKGROUND,
|
|
78
79
|
T.PRICE_FONT_FAMILY,
|
|
@@ -80,9 +81,9 @@ class d extends E {
|
|
|
80
81
|
T.PRICE_COLOR
|
|
81
82
|
]
|
|
82
83
|
)
|
|
83
|
-
],
|
|
84
|
+
], O[S.OLD_PRICE] = [
|
|
84
85
|
new _(
|
|
85
|
-
|
|
86
|
+
I.SETTINGS,
|
|
86
87
|
[
|
|
87
88
|
N,
|
|
88
89
|
T.OLD_PRICE_STYLE,
|
|
@@ -91,7 +92,7 @@ class d extends E {
|
|
|
91
92
|
]
|
|
92
93
|
),
|
|
93
94
|
new _(
|
|
94
|
-
|
|
95
|
+
I.STYLES,
|
|
95
96
|
[
|
|
96
97
|
T.OLD_PRICE_BACKGROUND,
|
|
97
98
|
T.OLD_PRICE_FONT_FAMILY,
|
|
@@ -99,9 +100,9 @@ class d extends E {
|
|
|
99
100
|
T.OLD_PRICE_COLOR
|
|
100
101
|
]
|
|
101
102
|
)
|
|
102
|
-
],
|
|
103
|
+
], O[S.OMNIBUS_PRICE] = [
|
|
103
104
|
new _(
|
|
104
|
-
|
|
105
|
+
I.SETTINGS,
|
|
105
106
|
[
|
|
106
107
|
N,
|
|
107
108
|
T.OMNIBUS_PRICE_TEXT_BEFORE,
|
|
@@ -112,7 +113,7 @@ class d extends E {
|
|
|
112
113
|
]
|
|
113
114
|
),
|
|
114
115
|
new _(
|
|
115
|
-
|
|
116
|
+
I.STYLES,
|
|
116
117
|
[
|
|
117
118
|
T.OMNIBUS_PRICE_BACKGROUND,
|
|
118
119
|
T.OMNIBUS_PRICE_FONT_FAMILY,
|
|
@@ -120,9 +121,9 @@ class d extends E {
|
|
|
120
121
|
T.OMNIBUS_PRICE_COLOR
|
|
121
122
|
]
|
|
122
123
|
)
|
|
123
|
-
],
|
|
124
|
+
], O[S.OMNIBUS_DISCOUNT] = [
|
|
124
125
|
new _(
|
|
125
|
-
|
|
126
|
+
I.SETTINGS,
|
|
126
127
|
[
|
|
127
128
|
N,
|
|
128
129
|
T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
|
|
@@ -133,7 +134,7 @@ class d extends E {
|
|
|
133
134
|
]
|
|
134
135
|
),
|
|
135
136
|
new _(
|
|
136
|
-
|
|
137
|
+
I.STYLES,
|
|
137
138
|
[
|
|
138
139
|
T.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
139
140
|
T.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
@@ -141,9 +142,9 @@ class d extends E {
|
|
|
141
142
|
T.OMNIBUS_DISCOUNT_COLOR
|
|
142
143
|
]
|
|
143
144
|
)
|
|
144
|
-
],
|
|
145
|
+
], O[S.BUTTON] = [
|
|
145
146
|
new _(
|
|
146
|
-
|
|
147
|
+
I.SETTINGS,
|
|
147
148
|
[
|
|
148
149
|
N,
|
|
149
150
|
T.BUTTON_TEXT,
|
|
@@ -153,7 +154,7 @@ class d extends E {
|
|
|
153
154
|
]
|
|
154
155
|
),
|
|
155
156
|
new _(
|
|
156
|
-
|
|
157
|
+
I.STYLES,
|
|
157
158
|
[
|
|
158
159
|
T.BUTTON_COLOR,
|
|
159
160
|
T.BUTTON_FONT_FAMILY,
|
|
@@ -164,9 +165,9 @@ class d extends E {
|
|
|
164
165
|
T.BUTTON_BORDER
|
|
165
166
|
]
|
|
166
167
|
)
|
|
167
|
-
],
|
|
168
|
+
], O[S.CUSTOM_ATTRIBUTE] = [
|
|
168
169
|
new _(
|
|
169
|
-
|
|
170
|
+
I.SETTINGS,
|
|
170
171
|
[
|
|
171
172
|
T.CUSTOM_ATTR_STYLE,
|
|
172
173
|
T.CUSTOM_ATTR_ALIGN,
|
|
@@ -175,7 +176,7 @@ class d extends E {
|
|
|
175
176
|
]
|
|
176
177
|
),
|
|
177
178
|
new _(
|
|
178
|
-
|
|
179
|
+
I.STYLES,
|
|
179
180
|
[
|
|
180
181
|
T.CUSTOM_ATTR_BACKGROUND,
|
|
181
182
|
T.CUSTOM_ATTR_FONT_FAMILY,
|
|
@@ -183,9 +184,9 @@ class d extends E {
|
|
|
183
184
|
T.CUSTOM_ATTR_COLOR
|
|
184
185
|
]
|
|
185
186
|
)
|
|
186
|
-
],
|
|
187
|
+
], O[S.IMAGE] = [
|
|
187
188
|
new _(
|
|
188
|
-
|
|
189
|
+
I.SETTINGS,
|
|
189
190
|
[
|
|
190
191
|
N,
|
|
191
192
|
T.IMAGE_SIZE,
|
|
@@ -196,5 +197,5 @@ class d extends E {
|
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
export {
|
|
199
|
-
|
|
200
|
+
s as SettingsPanel
|
|
200
201
|
};
|
|
@@ -5,9 +5,10 @@ const s = {
|
|
|
5
5
|
PAGE_TYPE: "data-unsubscribe-page-type",
|
|
6
6
|
PAGE_LIST: "data-unsubscribe-page-list",
|
|
7
7
|
BLOCK_ID: "data-unsubscribe-block-id"
|
|
8
|
-
}, c = ".unsubscribe-block-v2";
|
|
8
|
+
}, c = ".unsubscribe-block-v2", u = 'a[data-unsubscribe-link="true"], a.unsubscribe-link';
|
|
9
9
|
export {
|
|
10
10
|
b as DATA_ATTRIBUTES,
|
|
11
11
|
c as UNSUBSCRIBE_BLOCK_SELECTOR,
|
|
12
|
-
s as UNSUBSCRIBE_EVENTS
|
|
12
|
+
s as UNSUBSCRIBE_EVENTS,
|
|
13
|
+
u as UNSUBSCRIBE_LINK_SELECTOR
|
|
13
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TextAlignBuiltInControl as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return class extends
|
|
1
|
+
import { TextAlignBuiltInControl as C, TextColorBuiltInControl as x, TextSizeBuiltInControl as T, TextStyleBuiltInControl as B, TextFontFamilyBuiltInControl as m, ButtonBackgroundColorBuiltInControl as d, TextPaddingsBuiltInControl as y, ImageSizeBuiltInControl as b, ImageMarginsBuiltInControl as I, ButtonAlignBuiltInControl as S, ButtonBorderBuiltInControl as A, ButtonBorderRadiusBuiltInControl as k, ButtonColorBuiltInControl as N, ButtonFontFamilyBuiltInControl as h, ButtonMarginsBuiltInControl as p, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as q, ButtonTextSizeBuiltInControl as F, ButtonTextStyleAndFontColorBuiltInControl as v, ButtonFitToContainerBuiltInControl as R, TextLineSpacingBuiltInControl as M } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const O = "buttonTextStyleForm", a = "backgroundColor", g = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]), _ = ["elementColor", a], E = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
3
|
+
function P(o, n, r) {
|
|
4
|
+
return class extends C {
|
|
5
5
|
getId() {
|
|
6
6
|
return o;
|
|
7
7
|
}
|
|
@@ -13,8 +13,8 @@ function z(o, n, r) {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return class extends
|
|
16
|
+
function H(o, n, r) {
|
|
17
|
+
return class extends x {
|
|
18
18
|
getId() {
|
|
19
19
|
return o;
|
|
20
20
|
}
|
|
@@ -26,8 +26,8 @@ function v(o, n, r) {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return class extends
|
|
29
|
+
function U(o, n, r) {
|
|
30
|
+
return class extends T {
|
|
31
31
|
getId() {
|
|
32
32
|
return o;
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ function P(o, n, r) {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return class extends
|
|
42
|
+
function Y(o, n, r) {
|
|
43
|
+
return class extends B {
|
|
44
44
|
getId() {
|
|
45
45
|
return o;
|
|
46
46
|
}
|
|
@@ -52,8 +52,8 @@ function D(o, n, r) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return class extends
|
|
55
|
+
function G(o, n, r) {
|
|
56
|
+
return class extends m {
|
|
57
57
|
getId() {
|
|
58
58
|
return o;
|
|
59
59
|
}
|
|
@@ -65,8 +65,8 @@ function K(o, n, r) {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return class extends
|
|
68
|
+
function V(o, n, r) {
|
|
69
|
+
return class extends d {
|
|
70
70
|
getId() {
|
|
71
71
|
return o;
|
|
72
72
|
}
|
|
@@ -89,16 +89,65 @@ function L(o, n, r) {
|
|
|
89
89
|
const t = this.getTargetNodes(e);
|
|
90
90
|
if (!t.length)
|
|
91
91
|
return;
|
|
92
|
-
const
|
|
92
|
+
const i = this.api.getValues()[a], l = !i || g.has(i), s = this.api.getDocumentModifier();
|
|
93
93
|
return t.forEach((u) => {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
}),
|
|
94
|
+
const c = s.modifyHtml(u);
|
|
95
|
+
l ? c.removeStyle("background-color") : c.setStyle("background-color", i);
|
|
96
|
+
}), s;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
100
|
+
function K(o) {
|
|
101
|
+
const n = _.find((e) => e in o);
|
|
102
|
+
if (!n)
|
|
103
|
+
return;
|
|
104
|
+
const r = o[n];
|
|
105
|
+
return typeof r == "string" ? r : "";
|
|
106
|
+
}
|
|
107
|
+
function L(o, n) {
|
|
108
|
+
return n.startsWith(".") && "hasClass" in o && o.hasClass(n.slice(1));
|
|
109
|
+
}
|
|
110
|
+
function z(o, n) {
|
|
111
|
+
try {
|
|
112
|
+
return L(o, n) ? o : o.closest(n) ?? void 0;
|
|
113
|
+
} catch {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function w(o, n) {
|
|
118
|
+
return class extends d {
|
|
119
|
+
getId() {
|
|
120
|
+
return o;
|
|
121
|
+
}
|
|
122
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
123
|
+
getLabels() {
|
|
124
|
+
return { title: this.api.translate("Block Background Color") };
|
|
125
|
+
}
|
|
126
|
+
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
127
|
+
getTargetNodes(r) {
|
|
128
|
+
const e = z(r, n);
|
|
129
|
+
return e ? [e] : [];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
133
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
134
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
135
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
136
|
+
*/
|
|
137
|
+
getAdditionalModifications(r) {
|
|
138
|
+
const [e] = this.getTargetNodes(r);
|
|
139
|
+
if (!e)
|
|
140
|
+
return;
|
|
141
|
+
const t = K(this.api.getValues());
|
|
142
|
+
if (t === void 0)
|
|
143
|
+
return;
|
|
144
|
+
const i = !t || g.has(t), l = this.api.getDocumentModifier(), s = l.modifyHtml(e);
|
|
145
|
+
return i ? s.removeStyle("background-color").removeAttribute("bgcolor") : (s.setStyle("background-color", t), E.test(t) ? s.setAttribute("bgcolor", t) : s.removeAttribute("bgcolor")), l;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function W(o, n, r) {
|
|
150
|
+
return class extends y {
|
|
102
151
|
getId() {
|
|
103
152
|
return o;
|
|
104
153
|
}
|
|
@@ -110,7 +159,7 @@ function U(o, n, r) {
|
|
|
110
159
|
}
|
|
111
160
|
};
|
|
112
161
|
}
|
|
113
|
-
function
|
|
162
|
+
function X(o, n, r) {
|
|
114
163
|
return class extends M {
|
|
115
164
|
getId() {
|
|
116
165
|
return o;
|
|
@@ -120,8 +169,8 @@ function Y(o, n, r) {
|
|
|
120
169
|
}
|
|
121
170
|
};
|
|
122
171
|
}
|
|
123
|
-
function
|
|
124
|
-
return class extends
|
|
172
|
+
function j(o, n, r = ".ins-recommendation-product-container") {
|
|
173
|
+
return class extends S {
|
|
125
174
|
getId() {
|
|
126
175
|
return o;
|
|
127
176
|
}
|
|
@@ -131,8 +180,8 @@ function w(o, n, r = ".ins-recommendation-product-container") {
|
|
|
131
180
|
}
|
|
132
181
|
};
|
|
133
182
|
}
|
|
134
|
-
function
|
|
135
|
-
return class extends
|
|
183
|
+
function J(o, n, r = ".ins-recommendation-product-container") {
|
|
184
|
+
return class extends N {
|
|
136
185
|
getId() {
|
|
137
186
|
return o;
|
|
138
187
|
}
|
|
@@ -142,8 +191,8 @@ function G(o, n, r = ".ins-recommendation-product-container") {
|
|
|
142
191
|
}
|
|
143
192
|
};
|
|
144
193
|
}
|
|
145
|
-
function
|
|
146
|
-
return class extends
|
|
194
|
+
function Q(o, n, r = ".ins-recommendation-product-container") {
|
|
195
|
+
return class extends A {
|
|
147
196
|
getId() {
|
|
148
197
|
return o;
|
|
149
198
|
}
|
|
@@ -153,8 +202,8 @@ function H(o, n, r = ".ins-recommendation-product-container") {
|
|
|
153
202
|
}
|
|
154
203
|
};
|
|
155
204
|
}
|
|
156
|
-
function
|
|
157
|
-
return class extends
|
|
205
|
+
function Z(o, n, r = ".ins-recommendation-product-container") {
|
|
206
|
+
return class extends k {
|
|
158
207
|
getId() {
|
|
159
208
|
return o;
|
|
160
209
|
}
|
|
@@ -164,8 +213,8 @@ function V(o, n, r = ".ins-recommendation-product-container") {
|
|
|
164
213
|
}
|
|
165
214
|
};
|
|
166
215
|
}
|
|
167
|
-
function
|
|
168
|
-
return class extends
|
|
216
|
+
function tt(o, n, r = ".ins-recommendation-product-container") {
|
|
217
|
+
return class extends h {
|
|
169
218
|
getId() {
|
|
170
219
|
return o;
|
|
171
220
|
}
|
|
@@ -175,8 +224,8 @@ function W(o, n, r = ".ins-recommendation-product-container") {
|
|
|
175
224
|
}
|
|
176
225
|
};
|
|
177
226
|
}
|
|
178
|
-
function
|
|
179
|
-
return class extends
|
|
227
|
+
function et(o, n, r = ".ins-recommendation-product-container") {
|
|
228
|
+
return class extends p {
|
|
180
229
|
getId() {
|
|
181
230
|
return o;
|
|
182
231
|
}
|
|
@@ -186,7 +235,7 @@ function X(o, n, r = ".ins-recommendation-product-container") {
|
|
|
186
235
|
}
|
|
187
236
|
};
|
|
188
237
|
}
|
|
189
|
-
function
|
|
238
|
+
function nt(o, n, r = ".ins-recommendation-product-container") {
|
|
190
239
|
return class extends $ {
|
|
191
240
|
getId() {
|
|
192
241
|
return o;
|
|
@@ -197,8 +246,8 @@ function j(o, n, r = ".ins-recommendation-product-container") {
|
|
|
197
246
|
}
|
|
198
247
|
};
|
|
199
248
|
}
|
|
200
|
-
function
|
|
201
|
-
return class extends
|
|
249
|
+
function rt(o, n, r = ".ins-recommendation-product-container") {
|
|
250
|
+
return class extends q {
|
|
202
251
|
getId() {
|
|
203
252
|
return o;
|
|
204
253
|
}
|
|
@@ -208,8 +257,8 @@ function J(o, n, r = ".ins-recommendation-product-container") {
|
|
|
208
257
|
}
|
|
209
258
|
};
|
|
210
259
|
}
|
|
211
|
-
function
|
|
212
|
-
return class extends
|
|
260
|
+
function ot(o, n, r = ".ins-recommendation-product-container") {
|
|
261
|
+
return class extends F {
|
|
213
262
|
getId() {
|
|
214
263
|
return o;
|
|
215
264
|
}
|
|
@@ -219,8 +268,8 @@ function Q(o, n, r = ".ins-recommendation-product-container") {
|
|
|
219
268
|
}
|
|
220
269
|
};
|
|
221
270
|
}
|
|
222
|
-
function
|
|
223
|
-
return class extends
|
|
271
|
+
function st(o, n, r) {
|
|
272
|
+
return class extends v {
|
|
224
273
|
getId() {
|
|
225
274
|
return o;
|
|
226
275
|
}
|
|
@@ -242,21 +291,21 @@ function Z(o, n, r) {
|
|
|
242
291
|
const t = e.closest(r);
|
|
243
292
|
if (!t)
|
|
244
293
|
return;
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
294
|
+
const i = t.querySelectorAll(`[esd-extension-block-id="${n}"] a.es-button`);
|
|
295
|
+
if (!i.length)
|
|
247
296
|
return;
|
|
248
|
-
const
|
|
249
|
-
if (!
|
|
297
|
+
const l = this.api.getValues()[O];
|
|
298
|
+
if (!l)
|
|
250
299
|
return;
|
|
251
|
-
const
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
}),
|
|
300
|
+
const s = l.bold ? "bold" : "normal", u = l.italic ? "italic" : "normal", c = this.api.getDocumentModifier();
|
|
301
|
+
return i.forEach((f) => {
|
|
302
|
+
c.modifyHtml(f).setStyle("font-weight", s).setStyle("font-style", u);
|
|
303
|
+
}), c;
|
|
255
304
|
}
|
|
256
305
|
};
|
|
257
306
|
}
|
|
258
|
-
function
|
|
259
|
-
return class extends
|
|
307
|
+
function it(o, n, r) {
|
|
308
|
+
return class extends R {
|
|
260
309
|
getId() {
|
|
261
310
|
return o;
|
|
262
311
|
}
|
|
@@ -266,8 +315,8 @@ function tt(o, n, r) {
|
|
|
266
315
|
}
|
|
267
316
|
};
|
|
268
317
|
}
|
|
269
|
-
function
|
|
270
|
-
return class extends
|
|
318
|
+
function lt(o, n, r) {
|
|
319
|
+
return class extends b {
|
|
271
320
|
getId() {
|
|
272
321
|
return o;
|
|
273
322
|
}
|
|
@@ -281,8 +330,8 @@ function et(o, n, r) {
|
|
|
281
330
|
}
|
|
282
331
|
};
|
|
283
332
|
}
|
|
284
|
-
function
|
|
285
|
-
return class extends
|
|
333
|
+
function ct(o, n, r) {
|
|
334
|
+
return class extends I {
|
|
286
335
|
getId() {
|
|
287
336
|
return o;
|
|
288
337
|
}
|
|
@@ -297,25 +346,26 @@ function nt(o, n, r) {
|
|
|
297
346
|
};
|
|
298
347
|
}
|
|
299
348
|
export {
|
|
300
|
-
w as
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
349
|
+
w as createBlockBackgroundColorControl,
|
|
350
|
+
j as createButtonAlignControl,
|
|
351
|
+
Q as createButtonBorderControl,
|
|
352
|
+
Z as createButtonBorderRadiusControl,
|
|
353
|
+
J as createButtonColorControl,
|
|
354
|
+
it as createButtonFitToContainerControl,
|
|
355
|
+
tt as createButtonFontFamilyControl,
|
|
356
|
+
et as createButtonMarginsControl,
|
|
357
|
+
nt as createButtonPaddingsControl,
|
|
358
|
+
rt as createButtonTextControl,
|
|
359
|
+
ot as createButtonTextSizeControl,
|
|
360
|
+
st as createButtonTextStyleAndFontColorControl,
|
|
361
|
+
ct as createImageMarginsControl,
|
|
362
|
+
lt as createImageSizeControl,
|
|
363
|
+
W as createPaddingsControl,
|
|
364
|
+
P as createTextAlignControl,
|
|
365
|
+
V as createTextBackgroundColorControl,
|
|
366
|
+
H as createTextColorControl,
|
|
367
|
+
G as createTextFontFamilyControl,
|
|
368
|
+
X as createTextLineSpacingControl,
|
|
369
|
+
U as createTextSizeControl,
|
|
370
|
+
Y as createTextStyleControl
|
|
321
371
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{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-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{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-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { MAX_DEFAULT_TEMPLATE_ID as
|
|
4
|
-
import { useBlankTemplate as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { useHttp as m } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as y } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as f } from "../enums/defaults.js";
|
|
4
|
+
import { useBlankTemplate as g } from "./blankTemplate.js";
|
|
5
|
+
const l = () => ({
|
|
6
|
+
id: 0,
|
|
7
|
+
stripoId: 0,
|
|
8
|
+
unsubscriptionPreferencePages: []
|
|
9
|
+
}), D = () => {
|
|
10
|
+
const { get: s, post: u } = m(), { handleError: r } = y(), { getBlankTemplate: n } = g();
|
|
7
11
|
return {
|
|
8
12
|
getToken: async () => {
|
|
9
13
|
try {
|
|
@@ -26,13 +30,13 @@ const D = () => {
|
|
|
26
30
|
},
|
|
27
31
|
getDefaultTemplate: async () => {
|
|
28
32
|
try {
|
|
29
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
30
|
-
if (!i && !
|
|
31
|
-
return await
|
|
32
|
-
const
|
|
33
|
-
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await
|
|
33
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), p = t.get("master"), o = e ? parseInt(e) : 0, i = o >= 1 && o <= f ? o : 0;
|
|
34
|
+
if (!i && !p)
|
|
35
|
+
return await n();
|
|
36
|
+
const d = `/stripo/default-template/${i}`, { data: c } = await s(d), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
37
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await n() : a;
|
|
34
38
|
} catch (t) {
|
|
35
|
-
return r(t, "Failed to fetch default template"),
|
|
39
|
+
return r(t, "Failed to fetch default template"), n();
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
getSyncModulesStatus: async () => {
|
|
@@ -53,13 +57,9 @@ const D = () => {
|
|
|
53
57
|
getSyncModule: async (t) => {
|
|
54
58
|
try {
|
|
55
59
|
const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
|
|
56
|
-
return e;
|
|
60
|
+
return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e : l();
|
|
57
61
|
} catch (e) {
|
|
58
|
-
return r(e, "Failed to get sync module"),
|
|
59
|
-
id: 0,
|
|
60
|
-
stripoId: 0,
|
|
61
|
-
unsubscriptionPreferencePages: []
|
|
62
|
-
};
|
|
62
|
+
return r(e, "Failed to get sync module"), l();
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* These IDs are returned by the getId() method of each control
|
|
4
4
|
*/
|
|
5
5
|
export declare enum RecommendationControlId {
|
|
6
|
+
BLOCK_BACKGROUND = "recommendation-block-background-color-control",
|
|
6
7
|
BUTTON_ALIGN = "recommendation-block-button-align-control",
|
|
7
8
|
BUTTON_BORDER = "recommendation-block-button-border-control",
|
|
8
9
|
BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BlockBackgroundColorControl: {
|
|
2
|
+
new (): {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getLabels(): {
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
8
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
9
|
+
getParentControlId(): string;
|
|
10
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
11
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
12
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -20,6 +20,7 @@ export { ButtonControls } from './button';
|
|
|
20
20
|
export { ImageControls } from './image';
|
|
21
21
|
export { CustomAttributeControls } from './customAttribute';
|
|
22
22
|
export { SpacingControl, SPACING_CONTROL_ID } from './spacing';
|
|
23
|
+
export { BlockBackgroundColorControl } from './blockBackground';
|
|
23
24
|
export { CardBackgroundColorControl, CARD_BACKGROUND_COLOR_CONTROL_ID } from './cardBackground';
|
|
24
25
|
export { RecommendationCardCompositionControl, COMPOSITION_CONTROL_BLOCK_ID } from './cardComposition';
|
|
25
26
|
export { SyncInfoMessageControl, SYNC_INFO_MESSAGE_CONTROL_ID } from './syncInfoMessage';
|
|
@@ -9,3 +9,4 @@ export declare const DATA_ATTRIBUTES: {
|
|
|
9
9
|
readonly BLOCK_ID: "data-unsubscribe-block-id";
|
|
10
10
|
};
|
|
11
11
|
export declare const UNSUBSCRIBE_BLOCK_SELECTOR = ".unsubscribe-block-v2";
|
|
12
|
+
export declare const UNSUBSCRIBE_LINK_SELECTOR = "a[data-unsubscribe-link=\"true\"], a.unsubscribe-link";
|
|
@@ -115,6 +115,42 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
115
115
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Factory for a background-color control that paints a whole extension block (SD-145082).
|
|
120
|
+
*
|
|
121
|
+
* Base is `ButtonBackgroundColorBuiltInControl` because its `GENERAL.BACKGROUND_COLOR` form key
|
|
122
|
+
* round-trips through `getValues()`; the block-text base (`TextBlockBackgroundBuiltInControl`, the
|
|
123
|
+
* built-in this replaces) reports `textBlockBackgroundColor`, which our read path never sees. That
|
|
124
|
+
* borrowed base targets the block's Buy buttons, so `getTargetNodes` here is a GUARD that keeps it
|
|
125
|
+
* off the buttons — not the write path.
|
|
126
|
+
*
|
|
127
|
+
* The write is entirely ours (`getAdditionalModifications`): Stripo's built-in emits a stylesheet
|
|
128
|
+
* rule that inline styles from regeneration outrank (SD-143023), so it would silently no-op on the
|
|
129
|
+
* next edit. We write inline `background-color` + `bgcolor` on the block `<td>` instead — surviving
|
|
130
|
+
* regeneration and reaching Outlook, matching the migrator's convention.
|
|
131
|
+
*/
|
|
132
|
+
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
|
|
133
|
+
new (): {
|
|
134
|
+
getId(): string;
|
|
135
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
136
|
+
getLabels(): {
|
|
137
|
+
title: string;
|
|
138
|
+
};
|
|
139
|
+
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
140
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
141
|
+
/**
|
|
142
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
143
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
144
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
145
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
146
|
+
*/
|
|
147
|
+
getAdditionalModifications(root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
148
|
+
getParentControlId(): string;
|
|
149
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
150
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
151
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
118
154
|
/**
|
|
119
155
|
* Factory function to create paddings controls for different block elements
|
|
120
156
|
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL schemes that are safe to follow from partner-authored email HTML. Shared so a
|
|
3
|
+
* future bypass fix lands in one place — the preview guard and the recommendation
|
|
4
|
+
* sanitizer both gate on it. Stored with the trailing colon to match `anchor.protocol`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BASE_SAFE_URL_SCHEMES: readonly string[];
|
|
@@ -3,8 +3,12 @@ const n = `.base-input {
|
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
background-color: var(--guido-color-gray-0);
|
|
5
5
|
align-items: center;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/* 40px is a floor, never a cap: \`.base-input\` is shared by every settings field,
|
|
7
|
+
including Stripo's own auto-height inputs (e.g. the link field) that expand on
|
|
8
|
+
focus. A fixed max-height clamped their inner box; keep 40px only as the floor. */
|
|
9
|
+
min-height: 40px;
|
|
10
|
+
height: auto;
|
|
11
|
+
max-height: none;
|
|
8
12
|
box-sizing: content-box;
|
|
9
13
|
outline: none;
|
|
10
14
|
resize: vertical;
|
|
@@ -36,11 +40,6 @@ ue-contenteditable .base-input {
|
|
|
36
40
|
line-height: 24px;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
/* Image link input is auto-height; lift the fixed 40px cap so it can grow. */
|
|
40
|
-
ue-contenteditable.link-autoheight-contenteditable .base-input {
|
|
41
|
-
max-height: none;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
43
|
ue-icon-component.icon-button.icon-clear-input {
|
|
45
44
|
right: 2px;
|
|
46
45
|
top: 2px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.f48e1bc",
|
|
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",
|