@useinsider/guido 3.12.0-beta.841bb6a → 3.12.0-beta.86e34da
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/@types/config/schemas.js +9 -4
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +50 -49
- 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/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +38 -0
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendation.js +56 -40
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useStrategyFilters.js +16 -0
- package/dist/config/migrator/recommendationMigrator.js +7 -4
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/filteringV2.js +1024 -0
- package/dist/enums/extensions/recommendationBlock.js +45 -24
- package/dist/enums/extensions/strategyDetail.js +148 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +141 -123
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +285 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +16 -2
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +257 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +460 -113
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/common-control.js +2 -1
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +120 -32
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +2 -0
- package/dist/src/composables/useStrategyFilters.d.ts +24 -0
- package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +33 -0
- package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
- 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/Recommendation/controls/main/index.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +75 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +903 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +9 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +9 -0
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +10 -1
- package/dist/utils/pairProductVariables.js +43 -44
- package/dist/utils/templatePreparation.js +70 -57
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { FilterTypeNames as f, OperatorAbbreviations as N, UserEvents as y, UserEventKeys as d } from "../../../../enums/extensions/strategyDetail.js";
|
|
2
|
+
import { formatShortDate as p } from "../../../../utils/dateUtil.js";
|
|
3
|
+
const L = /* @__PURE__ */ new Set([
|
|
4
|
+
d.CURRENTLY_VIEWED_ITEM,
|
|
5
|
+
d.LEGACY_CURRENTLY_VIEWED_ITEM
|
|
6
|
+
]), g = /^(\d+)([whd])$/, h = (t) => t ? t.charAt(0).toUpperCase() + t.slice(1) : "", v = (t, e) => {
|
|
7
|
+
const r = y.find((n) => n.value === t);
|
|
8
|
+
return r ? e(r.text) : t;
|
|
9
|
+
}, C = (t, e) => {
|
|
10
|
+
if (t.userAttribute)
|
|
11
|
+
return t.userAttribute;
|
|
12
|
+
if (!t.userEvent)
|
|
13
|
+
return "";
|
|
14
|
+
const r = v(t.userEvent, e);
|
|
15
|
+
if (L.has(t.userEvent))
|
|
16
|
+
return r;
|
|
17
|
+
const n = t.userEventCount ?? 0;
|
|
18
|
+
if (n <= 0)
|
|
19
|
+
return r;
|
|
20
|
+
const a = e(
|
|
21
|
+
n === 1 ? "discovery-strategy-filtering.item" : "discovery-strategy-filtering.items"
|
|
22
|
+
);
|
|
23
|
+
return `${r} ${n} ${a}`;
|
|
24
|
+
}, O = [
|
|
25
|
+
f.USER_ATTRIBUTE_FILTER,
|
|
26
|
+
f.USER_EVENT_FILTER,
|
|
27
|
+
f.USER_CONTEXT_FILTER
|
|
28
|
+
], V = (t) => O.includes(t ?? ""), S = (t, e, r) => {
|
|
29
|
+
if (!t)
|
|
30
|
+
return "";
|
|
31
|
+
const n = g.exec(t);
|
|
32
|
+
if (!n)
|
|
33
|
+
return "";
|
|
34
|
+
const [, a, c] = n, s = e.find((T) => T.value === c), $ = s ? s.text.toLowerCase() : c;
|
|
35
|
+
return ` ${r("purchase-history.in-last")} ${a} ${$}`;
|
|
36
|
+
}, R = (t, e) => t.map((r) => `[${r}]`).join(` ${e} `), b = (t) => {
|
|
37
|
+
let e;
|
|
38
|
+
try {
|
|
39
|
+
e = JSON.parse(t);
|
|
40
|
+
} catch {
|
|
41
|
+
return t.split(",");
|
|
42
|
+
}
|
|
43
|
+
return Array.isArray(e) ? e.map((r) => String(r)) : [String(e)];
|
|
44
|
+
};
|
|
45
|
+
function w(t) {
|
|
46
|
+
const {
|
|
47
|
+
condition: e,
|
|
48
|
+
selectedOperator: r,
|
|
49
|
+
filterValue: n,
|
|
50
|
+
timeUnit: a,
|
|
51
|
+
inBetweenValues: c,
|
|
52
|
+
timeUnitOptions: s,
|
|
53
|
+
isDateAttribute: $,
|
|
54
|
+
isMultiSelect: T,
|
|
55
|
+
isInOrNotInOperator: U,
|
|
56
|
+
trans: E
|
|
57
|
+
} = t, { IN_LAST: A, IN_BETWEEN: _ } = N.OPERATOR, l = E("action-builder.and");
|
|
58
|
+
if (V(e.type)) {
|
|
59
|
+
const i = C(e, E);
|
|
60
|
+
if (i)
|
|
61
|
+
return `${i}${S(e.duration, s, E)}`;
|
|
62
|
+
}
|
|
63
|
+
const u = e.type === f.EVENT_BASED_FILTER ? S(e.duration, s, E) : "";
|
|
64
|
+
if (e.time && r !== _)
|
|
65
|
+
return `${p(e.time)}${u}`;
|
|
66
|
+
if (r === A) {
|
|
67
|
+
const [i] = n.match(/\d+/g) || [];
|
|
68
|
+
if (!i)
|
|
69
|
+
return n;
|
|
70
|
+
const o = s.find((m) => m.value === a);
|
|
71
|
+
return `${i} ${h((o == null ? void 0 : o.text) ?? "")}`.trimEnd();
|
|
72
|
+
}
|
|
73
|
+
if (r === _) {
|
|
74
|
+
if ($() && e.time) {
|
|
75
|
+
const [m = "", I = ""] = e.time.split(":");
|
|
76
|
+
return `${p(m)} ${l} ${p(I)}${u}`;
|
|
77
|
+
}
|
|
78
|
+
const [i = "", o = ""] = c ?? [];
|
|
79
|
+
return `${i} ${l} ${o}${u}`;
|
|
80
|
+
}
|
|
81
|
+
if (T())
|
|
82
|
+
return `${R(b(n), l)}${u}`;
|
|
83
|
+
if (U()) {
|
|
84
|
+
const i = n.split(",");
|
|
85
|
+
return `${i.length > 1 ? R(i, l) : n}${u}`;
|
|
86
|
+
}
|
|
87
|
+
return `${n}${u}`;
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
R as bracketJoin,
|
|
91
|
+
h as capitalizeFirstLetter,
|
|
92
|
+
S as getDurationSuffix,
|
|
93
|
+
w as getSuitableValue,
|
|
94
|
+
C as getUserContextValue,
|
|
95
|
+
v as getUserEventLabel,
|
|
96
|
+
b as parseMultiSelectValue
|
|
97
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { STRATEGY_PAGES as a } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
const o = (t) => {
|
|
3
|
+
window.location.assign(t);
|
|
4
|
+
}, e = (t) => a.EDIT.replace("{{id}}", String(t));
|
|
5
|
+
export {
|
|
6
|
+
e as buildStrategyEditPath,
|
|
7
|
+
o as navigateToStrategyPage
|
|
8
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { TimeAbbreviations as g, Operators as y, OperatorNames as c, OperatorAbbreviations as I, DataTypes as O, MultiSelectDataTypes as E } from "../../../../enums/extensions/filteringV2.js";
|
|
2
|
+
import { capitalizeFirstLetter as d, bracketJoin as T, parseMultiSelectValue as v } from "./strategyHumanizer.js";
|
|
3
|
+
import { formatShortDate as f } from "../../../../utils/dateUtil.js";
|
|
4
|
+
import { parseJsonField as b } from "../../../../utils/genericUtil.js";
|
|
5
|
+
const S = "CHEF", _ = "MIXED", M = [S, _], N = 2, h = 4, A = (e) => `recommendation-algorithm-names.${(e || "").replaceAll("_", "-").toLowerCase()}`, x = (e) => ({
|
|
6
|
+
[S]: "discovery-strategy.chef",
|
|
7
|
+
[_]: "discovery-strategy.mixed-algorithm"
|
|
8
|
+
})[e] ?? "discovery-strategy.single-algorithm", L = (e, t) => {
|
|
9
|
+
if (!M.includes(e.algorithm))
|
|
10
|
+
return t(A(e.algorithm));
|
|
11
|
+
const o = t(x(e.algorithm)), i = (e.algorithm_used || "").split(",").map((r) => r.trim()).filter(Boolean).map((r) => t(A(r))), n = [...new Set(i)];
|
|
12
|
+
if (n.length > 1) {
|
|
13
|
+
const r = t("strategy-info-box-content.and-more", { count: n.length - 1 });
|
|
14
|
+
return `${o} - ${n[0]} ${r}`;
|
|
15
|
+
}
|
|
16
|
+
return `${o} - ${n.join(", ")}`;
|
|
17
|
+
}, C = (e, t) => {
|
|
18
|
+
const o = [
|
|
19
|
+
e.exclude_view && "viewed",
|
|
20
|
+
e.exclude_purchase && "purchased",
|
|
21
|
+
e.exclude_cart && "cart"
|
|
22
|
+
].filter(Boolean);
|
|
23
|
+
return o.length ? o.map((n, r) => {
|
|
24
|
+
if (r === 0)
|
|
25
|
+
return t(`recommendation-strategy.recently_${n}`) + (o.length > 2 ? "," : "");
|
|
26
|
+
const s = t(`recommendation-strategy.${n}`);
|
|
27
|
+
return r === o.length - 1 ? `${t("ds-condition.and")} ${s}` : s;
|
|
28
|
+
}).join(" ") : t("recommendation-strategy.none");
|
|
29
|
+
}, D = (e, t) => {
|
|
30
|
+
var n;
|
|
31
|
+
const i = (y[((n = e.attribute) == null ? void 0 : n.attributeType) ?? ""] || []).find((r) => r.value === e.selectedOperator);
|
|
32
|
+
return i ? t(i.text) : "";
|
|
33
|
+
}, w = ({ attribute: e }) => (e == null ? void 0 : e.attributeType) === O.DATE, R = (e) => {
|
|
34
|
+
var r;
|
|
35
|
+
const t = ((r = e.attribute) == null ? void 0 : r.attributeType) ?? "", o = e.selectedOperator ?? "";
|
|
36
|
+
if (!E.includes(t) || [c.CONTAINS, c.NOT_CONTAINS].includes(o))
|
|
37
|
+
return !1;
|
|
38
|
+
const i = [c.IS_EXACTLY, c.IS_NOT_EXACTLY].includes(o);
|
|
39
|
+
return !((e.isHierarchyCategory || t === O.STRING) && i);
|
|
40
|
+
}, j = (e, t, o) => {
|
|
41
|
+
const i = e.value ?? "", n = t("action-builder.and"), { IN_LAST: r, IN_BETWEEN: s } = I.OPERATOR;
|
|
42
|
+
if (e.time && e.selectedOperator !== s)
|
|
43
|
+
return f(e.time);
|
|
44
|
+
if (e.selectedOperator === r) {
|
|
45
|
+
const [a] = i.match(/\d+/g) || [], l = o[e.timeUnit ?? ""];
|
|
46
|
+
return a && l ? `${a} ${l}` : i;
|
|
47
|
+
}
|
|
48
|
+
if (e.selectedOperator === s) {
|
|
49
|
+
if (w(e)) {
|
|
50
|
+
const [m = "", u = ""] = (e.time ?? "").split(":");
|
|
51
|
+
return `${f(m)} ${n} ${f(u)}`;
|
|
52
|
+
}
|
|
53
|
+
const [a = "", l = ""] = e.inBetweenValues ?? [];
|
|
54
|
+
return `${a} ${n} ${l}`;
|
|
55
|
+
}
|
|
56
|
+
if (R(e))
|
|
57
|
+
return T(v(i), n);
|
|
58
|
+
if ([c.IN, c.NOT_IN].includes(e.selectedOperator)) {
|
|
59
|
+
const a = i.split(",");
|
|
60
|
+
return a.length > 1 ? T(a, n) : i;
|
|
61
|
+
}
|
|
62
|
+
return i;
|
|
63
|
+
}, F = (e, t) => {
|
|
64
|
+
var $;
|
|
65
|
+
const o = b(e.filters, {}), n = Object.values(o).slice(0, N).flatMap((p) => (p == null ? void 0 : p.conditionList) ?? []), [r] = n;
|
|
66
|
+
if (!r)
|
|
67
|
+
return t("recommendation-strategy.none");
|
|
68
|
+
const s = {
|
|
69
|
+
[g.WEEK]: d(t("journey-builder.weeks")),
|
|
70
|
+
[g.DAY]: d(t("settings.day-s")),
|
|
71
|
+
[g.HOUR]: d(t("settings.hour-s"))
|
|
72
|
+
}, a = d((($ = r.attribute) == null ? void 0 : $.text) ?? ""), l = D(r, t), m = j(r, t, s), u = `${a} ${t("input.value")} ${l} ${m}`;
|
|
73
|
+
return n.length > 1 ? `${u} ${t("strategy-info-box-content.and-more", { count: n.length - 1 })}` : u;
|
|
74
|
+
}, H = (e, t) => {
|
|
75
|
+
const o = b(e.manual_merchandising_products, []), i = b(e.mixed_strategies, []), n = (Array.isArray(i) ? i : []).map((s) => s == null ? void 0 : s.productId).filter(Boolean), r = [.../* @__PURE__ */ new Set([...Array.isArray(o) ? o : [], ...n])];
|
|
76
|
+
if (!r.length)
|
|
77
|
+
return t("recommendation-strategy.none");
|
|
78
|
+
if (r.length > h) {
|
|
79
|
+
const s = t("strategy-info-box-content.and-more", {
|
|
80
|
+
count: r.length - h
|
|
81
|
+
});
|
|
82
|
+
return `${r.slice(0, h).join(", ")} ${s}`;
|
|
83
|
+
}
|
|
84
|
+
return r.join(", ");
|
|
85
|
+
}, V = (e, t) => [
|
|
86
|
+
{ title: t("gpt-app-builder.algorithms-and-method"), value: L(e, t) },
|
|
87
|
+
{ title: t("gpt-app-builder.exclusions"), value: C(e, t) },
|
|
88
|
+
{ title: t("gpt-app-builder.filters"), value: F(e, t) },
|
|
89
|
+
{ title: t("gpt-app-builder.manual-merchandising"), value: H(e, t) }
|
|
90
|
+
];
|
|
91
|
+
export {
|
|
92
|
+
V as buildStrategySummary,
|
|
93
|
+
A as getAlgorithmTranslationKey,
|
|
94
|
+
x as getMethodTranslationKey
|
|
95
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useConfigStore as I } from "../../../../stores/config.js";
|
|
2
|
+
const l = {
|
|
3
|
+
LOCALE: ["{locale}", "{language}"],
|
|
4
|
+
CURRENCY: ["{currency}"],
|
|
5
|
+
CAMPAIGN_ID: ["{campaignId}"],
|
|
6
|
+
STRATEGY_ID: ["{strategyId}"],
|
|
7
|
+
CLIENT_ID: ["{clientId}"],
|
|
8
|
+
PARTNER_NAME: ["{partnerName}", "{partnerId}"],
|
|
9
|
+
SIZE: ["{size}"]
|
|
10
|
+
}, d = {
|
|
11
|
+
// Both spellings are in use: the legacy email templates say `{user_id}`,
|
|
12
|
+
// the web runtime's say `{userId}`.
|
|
13
|
+
USER_ID: ["{userId}", "{user_id}"]
|
|
14
|
+
}, E = (e, r, s) => r.reduce((t, n) => t.replaceAll(n, s), e), u = (e) => {
|
|
15
|
+
const r = e.indexOf("?");
|
|
16
|
+
if (r === -1)
|
|
17
|
+
return e;
|
|
18
|
+
const s = e.slice(0, r), t = e.slice(r + 1), n = t.indexOf("#"), i = n === -1 ? t : t.slice(0, n), c = n === -1 ? "" : t.slice(n), a = i.split("&").filter((o) => !/\{[^}]*\}/.test(o.slice(o.indexOf("=") + 1)));
|
|
19
|
+
return a.length ? `${s}?${a.join("&")}${c}` : `${s}${c}`;
|
|
20
|
+
}, A = (e) => {
|
|
21
|
+
const r = I();
|
|
22
|
+
return {
|
|
23
|
+
LOCALE: e.language,
|
|
24
|
+
CURRENCY: e.currencyCode,
|
|
25
|
+
CAMPAIGN_ID: r.variationId,
|
|
26
|
+
STRATEGY_ID: e.strategyId,
|
|
27
|
+
CLIENT_ID: "6KcLM9TwheVB1mgK",
|
|
28
|
+
PARTNER_NAME: r.partnerName,
|
|
29
|
+
SIZE: e.size
|
|
30
|
+
};
|
|
31
|
+
}, C = (e, r, s) => {
|
|
32
|
+
if (!e)
|
|
33
|
+
return "";
|
|
34
|
+
const t = Object.entries(l).reduce(
|
|
35
|
+
(n, [i, c]) => E(n, c, r[i]),
|
|
36
|
+
e
|
|
37
|
+
);
|
|
38
|
+
return s === "preview" ? u(t) : E(t, d.USER_ID, "{user_id}");
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
A as buildStrategyUrlValues,
|
|
42
|
+
C as resolveStrategyUrl
|
|
43
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const u = [
|
|
2
2
|
{
|
|
3
3
|
key: "locale",
|
|
4
4
|
getValue: (e) => e.language,
|
|
@@ -9,25 +9,39 @@ const l = [
|
|
|
9
9
|
getValue: (e) => e.currencySettings.value,
|
|
10
10
|
getAvailableOptions: (e) => e.currencyList.map((n) => n.text),
|
|
11
11
|
canBeEmpty: !0
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
// Only a *deleted* strategy blocks the save (SD-145578 AC-4). An empty
|
|
15
|
+
// strategyId is legitimate: blocks saved before RRS keep running on their
|
|
16
|
+
// algorithm URL, and with the flag on by default those templates must stay
|
|
17
|
+
// saveable.
|
|
18
|
+
//
|
|
19
|
+
// `canValidateStrategy` gates the whole check — mid-fetch the listing is
|
|
20
|
+
// empty and every assigned id would look deleted.
|
|
21
|
+
key: "strategy",
|
|
22
|
+
optional: !0,
|
|
23
|
+
getValue: (e) => e.strategyId,
|
|
24
|
+
getAvailableOptions: (e) => e.strategyIds,
|
|
25
|
+
condition: (e, n) => n.isRrsEnabled && n.canValidateStrategy
|
|
12
26
|
}
|
|
13
27
|
], o = "newsletter.recommendation-fill-required-fields";
|
|
14
|
-
function c(e, n,
|
|
15
|
-
return
|
|
16
|
-
var
|
|
17
|
-
if (t.condition && !t.condition(e))
|
|
28
|
+
function c(e, n, l = u) {
|
|
29
|
+
return l.filter((t) => {
|
|
30
|
+
var i;
|
|
31
|
+
if (t.condition && !t.condition(e, n))
|
|
18
32
|
return !1;
|
|
19
|
-
const
|
|
20
|
-
if (t.canBeEmpty && (
|
|
33
|
+
const a = (i = t.getAvailableOptions) == null ? void 0 : i.call(t, n);
|
|
34
|
+
if (t.canBeEmpty && (a == null ? void 0 : a.length) === 0)
|
|
21
35
|
return !1;
|
|
22
|
-
const
|
|
23
|
-
return
|
|
36
|
+
const r = t.getValue(e);
|
|
37
|
+
return r ? a !== void 0 && !a.includes(r) : !t.optional;
|
|
24
38
|
}).map((t) => t.key);
|
|
25
39
|
}
|
|
26
40
|
function s(e, n) {
|
|
27
41
|
return c(e, n).length === 0;
|
|
28
42
|
}
|
|
29
43
|
export {
|
|
30
|
-
|
|
44
|
+
u as REQUIRED_RECOMMENDATION_FIELDS,
|
|
31
45
|
o as RecommendationRequiredFieldsKey,
|
|
32
46
|
c as getInvalidFields,
|
|
33
47
|
s as isConfigValid
|
|
@@ -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
|
};
|
|
@@ -191,10 +191,11 @@ class d extends I {
|
|
|
191
191
|
* @param param0
|
|
192
192
|
* @returns It returns a button with an icon.
|
|
193
193
|
*/
|
|
194
|
-
_GuIconButton({ name: e, icon: t, className: o = "" }) {
|
|
194
|
+
_GuIconButton({ name: e, icon: t, className: o = "", id: E = "" }) {
|
|
195
195
|
return `
|
|
196
196
|
<${n.BUTTON}
|
|
197
197
|
class="${o}"
|
|
198
|
+
${E ? `id="${E}"` : ""}
|
|
198
199
|
${$.BUTTON.name}="${e}"
|
|
199
200
|
${$.BUTTON.icon}="${t}">
|
|
200
201
|
</${n.BUTTON}>
|
|
@@ -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
|
};
|