@useinsider/guido 3.12.0-beta.1b68f97 → 3.12.0-beta.29b526b
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/README.md +0 -4
- package/dist/@types/config/schemas.js +50 -63
- 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/useEmailTemplateApplier.js +49 -30
- package/dist/composables/usePreviewInteractionGuard.js +11 -36
- package/dist/composables/useRecommendationPreview.js +60 -61
- package/dist/composables/useSave.js +24 -43
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/extension.js +21 -23
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +40 -41
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +2 -3
- package/dist/extensions/Blocks/controlFactories.js +75 -125
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -29
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -0
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -36
- package/dist/src/stores/config.d.ts +0 -36
- package/package.json +1 -1
- package/dist/composables/validators/useAllowlistValidator.js +0 -31
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +0 -10
- package/dist/src/composables/validators/useAllowlistValidator.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +0 -14
- package/dist/src/utils/urlSchemes.d.ts +0 -6
- package/dist/utils/urlSchemes.js +0 -4
|
@@ -1,112 +1,111 @@
|
|
|
1
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
2
|
-
import { useRecommendationExtensionStore as
|
|
3
|
-
import { formatPrice as
|
|
4
|
-
|
|
5
|
-
const S = `${f}[recommendation-id]`, h = ".product-old-price", T = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, b = new RegExp(
|
|
1
|
+
import { BLOCK_ROOT_SELECTOR as S, CURRENCY_ATTR as p, CONTAINER_SELECTOR as O } from "../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
+
import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
3
|
+
import { formatPrice as E } from "../extensions/Blocks/Recommendation/utils/priceFormatter.js";
|
|
4
|
+
const f = `${S}[recommendation-id]`, C = ".product-old-price", R = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, T = new RegExp(
|
|
6
5
|
"\\{%\\s*if\\s+([\\s\\S]+?)\\s*%\\}([\\s\\S]*?)(?:\\{%\\s*else\\s*%\\}([\\s\\S]*?))?\\{%\\s*endif\\s*%\\}",
|
|
7
6
|
"g"
|
|
8
7
|
);
|
|
9
|
-
function
|
|
8
|
+
function b(e) {
|
|
10
9
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
var
|
|
14
|
-
const
|
|
15
|
-
return
|
|
11
|
+
function _(e) {
|
|
12
|
+
var s;
|
|
13
|
+
const n = (s = e.replace(/[\u0000-\u0020]+/g, "").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/)) == null ? void 0 : s[1];
|
|
14
|
+
return n && n !== "http" && n !== "https" && n !== "mailto" ? "" : e;
|
|
16
15
|
}
|
|
17
16
|
function N(e) {
|
|
18
|
-
const t = e.getAttribute(
|
|
17
|
+
const t = e.getAttribute(p.CURRENCY) || "USD", n = e.getAttribute(p.DECIMAL_SEPARATOR) || ".", s = e.getAttribute(p.THOUSAND_SEPARATOR) || ",";
|
|
19
18
|
return {
|
|
20
19
|
code: t,
|
|
21
|
-
symbol: e.getAttribute(
|
|
22
|
-
alignment: e.getAttribute(
|
|
23
|
-
decimalCount: parseInt(e.getAttribute(
|
|
24
|
-
decimalSeparator:
|
|
25
|
-
thousandSeparator:
|
|
20
|
+
symbol: e.getAttribute(p.SYMBOL) || t,
|
|
21
|
+
alignment: e.getAttribute(p.ALIGNMENT) === "0" ? "before" : "after",
|
|
22
|
+
decimalCount: parseInt(e.getAttribute(p.DECIMAL_COUNT) || "2") || 2,
|
|
23
|
+
decimalSeparator: n,
|
|
24
|
+
thousandSeparator: s
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function g(e, t) {
|
|
29
28
|
return (e == null ? void 0 : e[t]) ?? Object.values(e ?? {})[0] ?? 0;
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
return
|
|
30
|
+
function L(e, t) {
|
|
31
|
+
const n = g(e.original_price, t), s = g(e.price, t), o = n > 0 ? Math.round((n - s) / n * 100) : 0;
|
|
32
|
+
return o > 0 ? `${o}%` : "0%";
|
|
34
33
|
}
|
|
35
|
-
function P(e, t,
|
|
36
|
-
|
|
37
|
-
const r = (m) => `${
|
|
38
|
-
e.set(r("name"),
|
|
39
|
-
e.set(r(`product_attribute.${m}`), String(
|
|
34
|
+
function P(e, t, n, s, o, a) {
|
|
35
|
+
s.forEach((i, c) => {
|
|
36
|
+
const r = (m) => `${n}_${c}_${m}`, u = E({ price: g(i.price, o.code), currency: o }), l = E({ price: g(i.original_price, o.code), currency: o }), d = L(i, o.code);
|
|
37
|
+
e.set(r("name"), i.name ?? ""), e.set(r("image_url"), _(i.image_url ?? "")), e.set(r("url"), _(i.url ?? "")), e.set(r("item_id"), i.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(`${n}_${c}`), Object.entries(i.product_attributes ?? {}).forEach(([m, A]) => {
|
|
38
|
+
e.set(r(`product_attribute.${m}`), String(A)), e.set(r(m), String(A));
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
41
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
42
|
+
function $(e, t) {
|
|
43
|
+
const n = e.match(/^(.+?)\s*(!=|==)\s*"([^"]*)"$/);
|
|
44
|
+
if (!n)
|
|
46
45
|
return !0;
|
|
47
|
-
const [,
|
|
48
|
-
return
|
|
46
|
+
const [, s, o, a] = n, i = t.get(s.trim()) ?? "";
|
|
47
|
+
return o === "!=" ? i !== a : i === a;
|
|
49
48
|
}
|
|
50
|
-
function
|
|
49
|
+
function z(e, t) {
|
|
51
50
|
return e.replace(
|
|
52
|
-
|
|
53
|
-
(
|
|
51
|
+
T,
|
|
52
|
+
(n, s, o, a) => s.split(/\s+and\s+/).every((c) => $(c.trim(), t)) ? o : a ?? ""
|
|
54
53
|
);
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function w(e) {
|
|
57
56
|
let t = e;
|
|
58
57
|
for (; t.children.length === 1; )
|
|
59
58
|
[t] = t.children;
|
|
60
59
|
return t;
|
|
61
60
|
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
61
|
+
function D(e, t) {
|
|
62
|
+
var i;
|
|
64
63
|
if (!t.size)
|
|
65
64
|
return e;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const r = Number(
|
|
65
|
+
const n = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), s = new DOMParser().parseFromString(n, "text/html");
|
|
66
|
+
s.querySelectorAll(f).forEach((c) => {
|
|
67
|
+
const r = Number(c.getAttribute("recommendation-id"));
|
|
69
68
|
if (!Number.isFinite(r))
|
|
70
69
|
return;
|
|
71
|
-
const u =
|
|
72
|
-
(u.length ? Array.from(u) : [
|
|
73
|
-
d.querySelectorAll(
|
|
74
|
-
t.has(`${r}_${
|
|
70
|
+
const u = c.querySelectorAll(O);
|
|
71
|
+
(u.length ? Array.from(u) : [c]).forEach((d) => {
|
|
72
|
+
d.querySelectorAll(C).forEach((m, A) => {
|
|
73
|
+
t.has(`${r}_${A}`) && (w(m).textContent = "");
|
|
75
74
|
});
|
|
76
75
|
});
|
|
77
76
|
});
|
|
78
|
-
const
|
|
79
|
-
return ((
|
|
80
|
-
` : "") +
|
|
77
|
+
const o = (i = e.match(/<!DOCTYPE[^>]*>/i)) == null ? void 0 : i[0];
|
|
78
|
+
return ((o ? `${o}
|
|
79
|
+
` : "") + s.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
81
80
|
}
|
|
82
|
-
function
|
|
81
|
+
function I(e) {
|
|
83
82
|
if (!e || !e.includes("recommendation-block-v2"))
|
|
84
83
|
return e;
|
|
85
|
-
const t =
|
|
86
|
-
if (
|
|
84
|
+
const t = h(), n = new DOMParser().parseFromString(e, "text/html"), s = Array.from(n.querySelectorAll(f)), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
85
|
+
if (s.forEach((c) => {
|
|
87
86
|
var l;
|
|
88
|
-
const r = Number(
|
|
87
|
+
const r = Number(c.getAttribute("recommendation-id"));
|
|
89
88
|
if (!Number.isFinite(r))
|
|
90
89
|
return;
|
|
91
90
|
const u = ((l = t.blockStates[r]) == null ? void 0 : l.recommendationProducts) ?? [];
|
|
92
91
|
u.length && P(
|
|
93
|
-
|
|
92
|
+
o,
|
|
94
93
|
a,
|
|
95
94
|
r,
|
|
96
95
|
u,
|
|
97
|
-
N(
|
|
98
|
-
|
|
96
|
+
N(c),
|
|
97
|
+
c.getAttribute("hide-price") === "true"
|
|
99
98
|
);
|
|
100
|
-
}), !
|
|
99
|
+
}), !o.size)
|
|
101
100
|
return e;
|
|
102
|
-
let
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
),
|
|
101
|
+
let i = D(e, a);
|
|
102
|
+
return i = i.replace(
|
|
103
|
+
R,
|
|
104
|
+
(c, r) => o.has(r) ? b(o.get(r)) : c
|
|
105
|
+
), i = z(i, o), i;
|
|
107
106
|
}
|
|
108
|
-
const q = () => ({ substituteRecommendationPreview:
|
|
107
|
+
const q = () => ({ substituteRecommendationPreview: I });
|
|
109
108
|
export {
|
|
110
|
-
|
|
109
|
+
I as substituteRecommendationPreview,
|
|
111
110
|
q as useRecommendationPreview
|
|
112
111
|
};
|
|
@@ -1,51 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
d();
|
|
19
|
-
const { prepareTemplateDetails: g } = L(), t = await g();
|
|
20
|
-
if (!p(t.compiledHtml) || !f(t.compiledHtml) || !v(t.compiledHtml))
|
|
1
|
+
import { useActionsApi as H } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as y } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as w, useSaveComplete as k } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as C } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as B } from "./useHtmlValidator.js";
|
|
8
|
+
import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
|
|
9
|
+
import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
|
|
10
|
+
import { useUnsubscribeBlockValidator as U } from "./validators/useUnsubscribeBlockValidator.js";
|
|
11
|
+
const K = () => {
|
|
12
|
+
const o = w(), s = k(), { validateHtml: r } = B(), { validateLiquidSyntax: l } = P(), { validateCouponBlockTags: n } = L(), { validateUnsubscribeBlockUniqueness: d, validateUnsubscribeBlockHasTemplate: c } = U(), { callbacks: i, isFeatureEnabled: u } = y(), { extractSyncModuleData: m } = q(), { setSyncModuleUnsubscriptionPages: p } = C(), { editorSave: v } = H();
|
|
13
|
+
return { save: async (f = !1, S = !1) => {
|
|
14
|
+
var a;
|
|
15
|
+
o();
|
|
16
|
+
const { prepareTemplateDetails: V } = E(), t = await V();
|
|
17
|
+
if (!n(t.compiledHtml) || !d(t.compiledHtml) || !c(t.compiledHtml))
|
|
21
18
|
return;
|
|
22
|
-
if (
|
|
23
|
-
if (!await
|
|
19
|
+
if (u("liquidSyntax")) {
|
|
20
|
+
if (!await l(t.compiledHtml))
|
|
24
21
|
return;
|
|
25
|
-
} else if (!await
|
|
22
|
+
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
26
23
|
return;
|
|
27
|
-
if ((
|
|
24
|
+
if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await v())
|
|
28
25
|
return;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (o.length) {
|
|
32
|
-
if (!r) {
|
|
33
|
-
const i = (n = (e = a.value) == null ? void 0 : e.resolveAllowlistToast) == null ? void 0 : n.call(e, o);
|
|
34
|
-
i != null && i.message && w({
|
|
35
|
-
type: A.Warning,
|
|
36
|
-
message: i.message,
|
|
37
|
-
actionButton: i.actionButton
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (!await V())
|
|
44
|
-
return;
|
|
45
|
-
const { unsubscribePayload: x, stripoModules: T } = S(t.rawHtml);
|
|
46
|
-
return await b(x), t.modules = T, H || c({ ...t, silent: r }), t;
|
|
26
|
+
const { unsubscribePayload: b, stripoModules: x } = m(t.rawHtml);
|
|
27
|
+
return await p(b), t.modules = x, f || s({ ...t, silent: S }), t;
|
|
47
28
|
} };
|
|
48
29
|
};
|
|
49
30
|
export {
|
|
50
|
-
|
|
31
|
+
K as useSave
|
|
51
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.
|
|
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 || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
1
|
+
import { ExtensionBuilder as r } 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,44 +6,42 @@ 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 s } from "./controls/price/index.js";
|
|
10
|
+
import { OldPriceControls as l } 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 f } from "./controls/image/index.js";
|
|
15
|
+
import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
|
|
16
16
|
import { SpacingControl as d } from "./controls/spacing/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
|
|
17
|
+
import { CardBackgroundColorControl as u } from "./controls/cardBackground/index.js";
|
|
18
|
+
import { RecommendationCardCompositionControl as g } from "./controls/cardComposition/index.js";
|
|
19
|
+
import { SyncInfoMessageControl as y } from "./controls/syncInfoMessage.js";
|
|
21
20
|
import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
|
|
22
21
|
import R from "./recommendation.css.js";
|
|
23
22
|
import { SettingsPanel as S } from "./settingsPanel.js";
|
|
24
|
-
const
|
|
23
|
+
const w = [
|
|
25
24
|
e,
|
|
26
|
-
l,
|
|
27
25
|
s,
|
|
26
|
+
l,
|
|
28
27
|
p,
|
|
29
28
|
a,
|
|
30
29
|
c,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
],
|
|
30
|
+
f,
|
|
31
|
+
C
|
|
32
|
+
], B = [
|
|
34
33
|
i,
|
|
35
34
|
u,
|
|
36
|
-
g,
|
|
37
35
|
d,
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
g,
|
|
37
|
+
y
|
|
40
38
|
], b = [
|
|
41
|
-
...
|
|
42
|
-
...
|
|
43
|
-
],
|
|
44
|
-
(o,
|
|
45
|
-
new
|
|
39
|
+
...B,
|
|
40
|
+
...w.flatMap((o) => Object.values(o))
|
|
41
|
+
], U = b.reduce(
|
|
42
|
+
(o, t) => o.addControl(t),
|
|
43
|
+
new r().addBlock(m).withSettingsPanelRegistry(S)
|
|
46
44
|
).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
|
|
47
45
|
export {
|
|
48
|
-
|
|
46
|
+
U as default
|
|
49
47
|
};
|
|
@@ -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 O, ContainerControls as C, TextControls as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as U } 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 A } 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,38 +13,37 @@ 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 "./controls/
|
|
18
|
-
import {
|
|
19
|
-
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
16
|
+
import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
|
|
17
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
|
|
18
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
20
19
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
21
|
-
class
|
|
22
|
-
registerBlockControls(
|
|
23
|
-
|
|
20
|
+
class d extends E {
|
|
21
|
+
registerBlockControls(I) {
|
|
22
|
+
I[U] = [
|
|
24
23
|
new _(
|
|
25
|
-
|
|
24
|
+
O.SETTINGS,
|
|
26
25
|
[
|
|
27
|
-
|
|
26
|
+
A,
|
|
28
27
|
C.EXTERNAL_INDENTS
|
|
29
28
|
]
|
|
30
29
|
),
|
|
31
30
|
new _(
|
|
32
|
-
|
|
31
|
+
O.STYLES,
|
|
33
32
|
[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
R.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
34
|
+
D,
|
|
35
|
+
L
|
|
37
36
|
]
|
|
38
37
|
),
|
|
39
38
|
new _(
|
|
40
39
|
"Card Composition",
|
|
41
40
|
[
|
|
42
|
-
|
|
41
|
+
B
|
|
43
42
|
]
|
|
44
43
|
).withLabel(this.api.translate("Card Composition"))
|
|
45
|
-
],
|
|
44
|
+
], I[S.NAME] = [
|
|
46
45
|
new _(
|
|
47
|
-
|
|
46
|
+
O.SETTINGS,
|
|
48
47
|
[
|
|
49
48
|
N,
|
|
50
49
|
T.NAME_STYLE,
|
|
@@ -54,7 +53,7 @@ class s extends E {
|
|
|
54
53
|
]
|
|
55
54
|
),
|
|
56
55
|
new _(
|
|
57
|
-
|
|
56
|
+
O.STYLES,
|
|
58
57
|
[
|
|
59
58
|
T.NAME_BACKGROUND,
|
|
60
59
|
T.NAME_FONT_FAMILY,
|
|
@@ -62,9 +61,9 @@ class s extends E {
|
|
|
62
61
|
T.NAME_COLOR
|
|
63
62
|
]
|
|
64
63
|
)
|
|
65
|
-
],
|
|
64
|
+
], I[S.PRICE] = [
|
|
66
65
|
new _(
|
|
67
|
-
|
|
66
|
+
O.SETTINGS,
|
|
68
67
|
[
|
|
69
68
|
N,
|
|
70
69
|
T.PRICE_STYLE,
|
|
@@ -73,7 +72,7 @@ class s extends E {
|
|
|
73
72
|
]
|
|
74
73
|
),
|
|
75
74
|
new _(
|
|
76
|
-
|
|
75
|
+
O.STYLES,
|
|
77
76
|
[
|
|
78
77
|
T.PRICE_BACKGROUND,
|
|
79
78
|
T.PRICE_FONT_FAMILY,
|
|
@@ -81,9 +80,9 @@ class s extends E {
|
|
|
81
80
|
T.PRICE_COLOR
|
|
82
81
|
]
|
|
83
82
|
)
|
|
84
|
-
],
|
|
83
|
+
], I[S.OLD_PRICE] = [
|
|
85
84
|
new _(
|
|
86
|
-
|
|
85
|
+
O.SETTINGS,
|
|
87
86
|
[
|
|
88
87
|
N,
|
|
89
88
|
T.OLD_PRICE_STYLE,
|
|
@@ -92,7 +91,7 @@ class s extends E {
|
|
|
92
91
|
]
|
|
93
92
|
),
|
|
94
93
|
new _(
|
|
95
|
-
|
|
94
|
+
O.STYLES,
|
|
96
95
|
[
|
|
97
96
|
T.OLD_PRICE_BACKGROUND,
|
|
98
97
|
T.OLD_PRICE_FONT_FAMILY,
|
|
@@ -100,9 +99,9 @@ class s extends E {
|
|
|
100
99
|
T.OLD_PRICE_COLOR
|
|
101
100
|
]
|
|
102
101
|
)
|
|
103
|
-
],
|
|
102
|
+
], I[S.OMNIBUS_PRICE] = [
|
|
104
103
|
new _(
|
|
105
|
-
|
|
104
|
+
O.SETTINGS,
|
|
106
105
|
[
|
|
107
106
|
N,
|
|
108
107
|
T.OMNIBUS_PRICE_TEXT_BEFORE,
|
|
@@ -113,7 +112,7 @@ class s extends E {
|
|
|
113
112
|
]
|
|
114
113
|
),
|
|
115
114
|
new _(
|
|
116
|
-
|
|
115
|
+
O.STYLES,
|
|
117
116
|
[
|
|
118
117
|
T.OMNIBUS_PRICE_BACKGROUND,
|
|
119
118
|
T.OMNIBUS_PRICE_FONT_FAMILY,
|
|
@@ -121,9 +120,9 @@ class s extends E {
|
|
|
121
120
|
T.OMNIBUS_PRICE_COLOR
|
|
122
121
|
]
|
|
123
122
|
)
|
|
124
|
-
],
|
|
123
|
+
], I[S.OMNIBUS_DISCOUNT] = [
|
|
125
124
|
new _(
|
|
126
|
-
|
|
125
|
+
O.SETTINGS,
|
|
127
126
|
[
|
|
128
127
|
N,
|
|
129
128
|
T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
|
|
@@ -134,7 +133,7 @@ class s extends E {
|
|
|
134
133
|
]
|
|
135
134
|
),
|
|
136
135
|
new _(
|
|
137
|
-
|
|
136
|
+
O.STYLES,
|
|
138
137
|
[
|
|
139
138
|
T.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
140
139
|
T.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
@@ -142,9 +141,9 @@ class s extends E {
|
|
|
142
141
|
T.OMNIBUS_DISCOUNT_COLOR
|
|
143
142
|
]
|
|
144
143
|
)
|
|
145
|
-
],
|
|
144
|
+
], I[S.BUTTON] = [
|
|
146
145
|
new _(
|
|
147
|
-
|
|
146
|
+
O.SETTINGS,
|
|
148
147
|
[
|
|
149
148
|
N,
|
|
150
149
|
T.BUTTON_TEXT,
|
|
@@ -154,7 +153,7 @@ class s extends E {
|
|
|
154
153
|
]
|
|
155
154
|
),
|
|
156
155
|
new _(
|
|
157
|
-
|
|
156
|
+
O.STYLES,
|
|
158
157
|
[
|
|
159
158
|
T.BUTTON_COLOR,
|
|
160
159
|
T.BUTTON_FONT_FAMILY,
|
|
@@ -165,9 +164,9 @@ class s extends E {
|
|
|
165
164
|
T.BUTTON_BORDER
|
|
166
165
|
]
|
|
167
166
|
)
|
|
168
|
-
],
|
|
167
|
+
], I[S.CUSTOM_ATTRIBUTE] = [
|
|
169
168
|
new _(
|
|
170
|
-
|
|
169
|
+
O.SETTINGS,
|
|
171
170
|
[
|
|
172
171
|
T.CUSTOM_ATTR_STYLE,
|
|
173
172
|
T.CUSTOM_ATTR_ALIGN,
|
|
@@ -176,7 +175,7 @@ class s extends E {
|
|
|
176
175
|
]
|
|
177
176
|
),
|
|
178
177
|
new _(
|
|
179
|
-
|
|
178
|
+
O.STYLES,
|
|
180
179
|
[
|
|
181
180
|
T.CUSTOM_ATTR_BACKGROUND,
|
|
182
181
|
T.CUSTOM_ATTR_FONT_FAMILY,
|
|
@@ -184,9 +183,9 @@ class s extends E {
|
|
|
184
183
|
T.CUSTOM_ATTR_COLOR
|
|
185
184
|
]
|
|
186
185
|
)
|
|
187
|
-
],
|
|
186
|
+
], I[S.IMAGE] = [
|
|
188
187
|
new _(
|
|
189
|
-
|
|
188
|
+
O.SETTINGS,
|
|
190
189
|
[
|
|
191
190
|
N,
|
|
192
191
|
T.IMAGE_SIZE,
|
|
@@ -197,5 +196,5 @@ class s extends E {
|
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
export {
|
|
200
|
-
|
|
199
|
+
d as SettingsPanel
|
|
201
200
|
};
|
|
@@ -5,10 +5,9 @@ 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";
|
|
9
9
|
export {
|
|
10
10
|
b as DATA_ATTRIBUTES,
|
|
11
11
|
c as UNSUBSCRIBE_BLOCK_SELECTOR,
|
|
12
|
-
s as UNSUBSCRIBE_EVENTS
|
|
13
|
-
u as UNSUBSCRIBE_LINK_SELECTOR
|
|
12
|
+
s as UNSUBSCRIBE_EVENTS
|
|
14
13
|
};
|