@useinsider/guido 3.4.1-beta.eecf662 → 3.4.1-beta.f0bed82
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/extensions/recommendation/FilterItem.vue.js +2 -2
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +49 -49
- package/dist/composables/useActionsApi.js +9 -5
- package/dist/composables/useRecommendation.js +34 -33
- package/dist/composables/useSave.js +13 -14
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +16 -24
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
- package/dist/guido.css +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
- package/dist/utils/templatePreparation.js +51 -43
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ var r = function() {
|
|
|
5
5
|
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
6
6
|
return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
|
|
7
7
|
return t.emit("delete-filter", t.props.filter);
|
|
8
|
-
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: t.handleOperatorChange } }), t.isAnyOfOperator ? e(t.InTags, { staticClass: "w-2", attrs: { "allow-bulk-paste": "", "allow-duplicates": !1, invalid: t.invalidFields.has("value"), "invalid-message": t.valueErrorMessage, label: t.trans("condition.value"), placeholder: t.trans("condition.enter-value-placeholder"),
|
|
8
|
+
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: t.handleOperatorChange } }), t.isAnyOfOperator ? e(t.InTags, { staticClass: "w-2", attrs: { "allow-bulk-paste": "", validate: "text", "allow-duplicates": !1, invalid: t.invalidFields.has("value"), "invalid-message": t.valueErrorMessage, label: t.trans("condition.value"), placeholder: t.trans("condition.enter-value-placeholder"), value: t.tagValues }, on: { input: t.onTagsInput } }) : t.isDateAttribute ? e(t.InDatePickerV2, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, "single-date-picker-status": "", "label-text": t.trans("condition.value"), locale: t.datePickerLocale, name: `filter-item-input--value-${a.index}`, "placeholder-text": t.trans("condition.enter-value-placeholder"), state: t.getFieldState("value"), "state-message": t.valueErrorMessage, value: t.datePickerValue }, on: { apply: t.onDatePickerApply } }) : e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: t.safeDecodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
9
9
|
t.updateFilter({ text: "value", value: encodeURIComponent(s) });
|
|
10
10
|
} } })]], 2), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
|
|
11
11
|
return t.updateFilter({ text: "innerGroupOperator", value: s });
|
|
@@ -16,7 +16,7 @@ var r = function() {
|
|
|
16
16
|
n,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"8053a037"
|
|
20
20
|
);
|
|
21
21
|
const f = o.exports;
|
|
22
22
|
export {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getOperatorOptions as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import { parseTagList as
|
|
6
|
-
import { getInvalidFilterFields as
|
|
7
|
-
import { locale as
|
|
8
|
-
import { InTags as
|
|
9
|
-
import
|
|
10
|
-
import { useDebounceFn as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as N, computed as r } from "vue";
|
|
2
|
+
import { useTranslations as U } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as f, OP_ANY_OF as d } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as E } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { parseTagList as j, safeDecodeURIComponent as g } from "../../../../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
6
|
+
import { getInvalidFilterFields as w } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
|
|
7
|
+
import { locale as M } from "../../../../utils/dateUtil.js";
|
|
8
|
+
import { InTags as Y, InButtonV2 as q, InSelect as z, InDatePickerV2 as G, InBasicTextInput as H } from "@useinsider/design-system-vue";
|
|
9
|
+
import J from "./LogicAdapter.vue.js";
|
|
10
|
+
import { useDebounceFn as K } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
11
|
+
const se = /* @__PURE__ */ N({
|
|
12
12
|
__name: "FilterItem",
|
|
13
13
|
props: {
|
|
14
14
|
filter: null,
|
|
@@ -17,8 +17,8 @@ const pe = /* @__PURE__ */ R({
|
|
|
17
17
|
submitted: { type: Boolean }
|
|
18
18
|
},
|
|
19
19
|
emits: ["delete-filter"],
|
|
20
|
-
setup(
|
|
21
|
-
const t =
|
|
20
|
+
setup(I, { emit: O }) {
|
|
21
|
+
const t = I, s = U(), n = E(), T = [
|
|
22
22
|
{
|
|
23
23
|
text: s("email-editor.standard-filter"),
|
|
24
24
|
value: "standardFilter"
|
|
@@ -26,79 +26,79 @@ const pe = /* @__PURE__ */ R({
|
|
|
26
26
|
], u = [
|
|
27
27
|
{ text: "True", value: "true" },
|
|
28
28
|
{ text: "False", value: "false" }
|
|
29
|
-
], m =
|
|
29
|
+
], m = r(() => t.filter.attribute || ""), i = r(() => n.getFilterList.find((e) => e.value === m.value) || { text: "", value: "", type: "" }), h = r(
|
|
30
30
|
() => {
|
|
31
31
|
var e;
|
|
32
32
|
return ((e = i.value) == null ? void 0 : e.type) === "Boolean";
|
|
33
33
|
}
|
|
34
|
-
), b =
|
|
34
|
+
), b = r(() => {
|
|
35
35
|
var e;
|
|
36
|
-
return
|
|
37
|
-
}), A =
|
|
36
|
+
return f((e = i.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
|
|
37
|
+
}), A = r(
|
|
38
38
|
() => u.find((e) => e.value === t.filter.value) || u[0]
|
|
39
|
-
), p =
|
|
39
|
+
), p = r(() => t.submitted ? w(t.filter) : /* @__PURE__ */ new Set()), x = (e) => p.value.has(e) ? "error" : "default", B = r(
|
|
40
40
|
() => p.value.has("value") ? s("action-builder.filter-empty-value-error") : ""
|
|
41
|
-
), v =
|
|
41
|
+
), v = r(
|
|
42
42
|
() => {
|
|
43
43
|
var e;
|
|
44
44
|
return ((e = i.value) == null ? void 0 : e.type) === "Number";
|
|
45
45
|
}
|
|
46
|
-
), D =
|
|
46
|
+
), D = r(() => v.value ? "number" : "text"), C = r(
|
|
47
47
|
() => {
|
|
48
48
|
var e;
|
|
49
49
|
return ((e = i.value) == null ? void 0 : e.type) === "Date";
|
|
50
50
|
}
|
|
51
|
-
), _ =
|
|
52
|
-
|
|
51
|
+
), _ = r(() => t.filter.operator === d), k = r(() => j(t.filter.value)), P = K((e) => {
|
|
52
|
+
n.updateFilter({
|
|
53
53
|
...t.filter,
|
|
54
54
|
[e.text]: e.value
|
|
55
55
|
});
|
|
56
|
-
}, 500),
|
|
57
|
-
const
|
|
58
|
-
|
|
56
|
+
}, 500), V = (e) => {
|
|
57
|
+
const o = n.getFilterList.find((c) => c.value === e.value), l = (o == null ? void 0 : o.type) === "Boolean", [a] = f(o == null ? void 0 : o.type);
|
|
58
|
+
n.updateFilter({
|
|
59
59
|
...t.filter,
|
|
60
60
|
attribute: e.value,
|
|
61
|
-
operator:
|
|
62
|
-
value:
|
|
61
|
+
operator: l ? "=" : (a == null ? void 0 : a.value) ?? "",
|
|
62
|
+
value: l ? "true" : ""
|
|
63
63
|
});
|
|
64
|
-
},
|
|
65
|
-
|
|
64
|
+
}, L = (e) => {
|
|
65
|
+
n.updateFilter({
|
|
66
66
|
...t.filter,
|
|
67
67
|
operator: "=",
|
|
68
68
|
value: e.value
|
|
69
69
|
});
|
|
70
70
|
}, S = (e) => {
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
71
|
+
const o = e.value;
|
|
72
|
+
if (o === t.filter.operator)
|
|
73
73
|
return;
|
|
74
|
-
const c = t.filter.operator ===
|
|
75
|
-
|
|
74
|
+
const c = t.filter.operator === d !== (o === d);
|
|
75
|
+
n.updateFilter({
|
|
76
76
|
...t.filter,
|
|
77
|
-
operator:
|
|
77
|
+
operator: o,
|
|
78
78
|
value: c ? "" : t.filter.value
|
|
79
79
|
});
|
|
80
|
-
}, $ =
|
|
81
|
-
const [
|
|
82
|
-
return !
|
|
83
|
-
},
|
|
84
|
-
const [
|
|
85
|
-
return !
|
|
86
|
-
},
|
|
87
|
-
() => y(
|
|
80
|
+
}, $ = M(), y = (e) => {
|
|
81
|
+
const [o, l, a] = e.split("-");
|
|
82
|
+
return !o || !l || !a ? "" : `${l}/${a}/${o}`;
|
|
83
|
+
}, F = (e) => {
|
|
84
|
+
const [o, l, a] = e.split("/");
|
|
85
|
+
return !a || !o || !l ? "" : `${a}-${o.padStart(2, "0")}-${l.padStart(2, "0")}`;
|
|
86
|
+
}, R = r(
|
|
87
|
+
() => y(g(t.filter.value))
|
|
88
88
|
);
|
|
89
|
-
return { __sfc: !0, trans: s, store:
|
|
90
|
-
|
|
89
|
+
return { __sfc: !0, trans: s, store: n, props: t, filterTypeOptions: T, booleanValueOptions: u, attributeType: m, selectedAttributeType: i, isBooleanAttribute: h, selectedOperatorType: b, selectedBooleanValue: A, emit: O, invalidFields: p, getFieldState: x, valueErrorMessage: B, isNumericAttribute: v, valueInputType: D, isDateAttribute: C, isAnyOfOperator: _, tagValues: k, updateFilter: P, handleAttributeChange: V, handleBooleanValueChange: L, handleOperatorChange: S, datePickerLocale: $, isoToPickerDate: y, pickerDateToIso: F, datePickerValue: R, onDatePickerApply: (e) => {
|
|
90
|
+
n.updateFilter({
|
|
91
91
|
...t.filter,
|
|
92
|
-
value: encodeURIComponent(
|
|
92
|
+
value: encodeURIComponent(F(e))
|
|
93
93
|
});
|
|
94
94
|
}, onTagsInput: (e) => {
|
|
95
|
-
|
|
95
|
+
n.updateFilter({
|
|
96
96
|
...t.filter,
|
|
97
|
-
value:
|
|
97
|
+
value: e.map(encodeURIComponent).join(",")
|
|
98
98
|
});
|
|
99
|
-
}, getOperatorOptions:
|
|
99
|
+
}, getOperatorOptions: f, safeDecodeURIComponent: g, InBasicTextInput: H, InDatePickerV2: G, InSelect: z, InButtonV2: q, InTags: Y, LogicAdapter: J };
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
se as default
|
|
104
104
|
};
|
|
@@ -21,9 +21,9 @@ const v = () => {
|
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
23
|
}, ...t }, s = {
|
|
24
|
-
callback: (l,
|
|
24
|
+
callback: (l, p, d, c, u) => {
|
|
25
25
|
l ? a(l) : e({
|
|
26
|
-
html:
|
|
26
|
+
html: p,
|
|
27
27
|
ampHtml: d,
|
|
28
28
|
ampErrors: c,
|
|
29
29
|
displayConditions: u
|
|
@@ -36,11 +36,11 @@ const v = () => {
|
|
|
36
36
|
return {
|
|
37
37
|
getCompiledEmail: m,
|
|
38
38
|
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html: a, css: i, width: o, height:
|
|
39
|
+
const e = ({ html: a, css: i, width: o, height: r, utmParams: s, syncModulesIds: l }) => t({
|
|
40
40
|
html: a,
|
|
41
41
|
css: i,
|
|
42
42
|
width: o,
|
|
43
|
-
height:
|
|
43
|
+
height: r,
|
|
44
44
|
utmParams: s,
|
|
45
45
|
syncModulesIds: l
|
|
46
46
|
});
|
|
@@ -91,7 +91,11 @@ const v = () => {
|
|
|
91
91
|
},
|
|
92
92
|
editorSave: () => new Promise((t) => {
|
|
93
93
|
window.StripoEditorApi.actionsApi.save((e) => {
|
|
94
|
-
|
|
94
|
+
if (e) {
|
|
95
|
+
n(e, "Failed to save template"), t(!1);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
t(!0);
|
|
95
99
|
});
|
|
96
100
|
})
|
|
97
101
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as I, URLS as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as I, URLS as R } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as C, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
5
6
|
import { useConfigStore as x } from "../stores/config.js";
|
|
6
|
-
const
|
|
7
|
+
const A = () => ({
|
|
7
8
|
calculateCardWidth: ({
|
|
8
9
|
mobileLeftPadding: s,
|
|
9
10
|
mobileRightPadding: a,
|
|
10
11
|
cardsInRow: c,
|
|
11
|
-
unresponsive:
|
|
12
|
+
unresponsive: o
|
|
12
13
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
return (
|
|
14
|
+
const n = o ? c : 1, e = s + a + (n - 1) * b;
|
|
15
|
+
return (C - e) / n;
|
|
15
16
|
},
|
|
16
17
|
getRecommendationCampaignData: (s) => {
|
|
17
|
-
const a =
|
|
18
|
-
if (!
|
|
18
|
+
const a = l(), c = Number(s), o = a.blockStates[c];
|
|
19
|
+
if (!o)
|
|
19
20
|
return {
|
|
20
21
|
textTrimming: !1,
|
|
21
22
|
orientation: "vertical",
|
|
@@ -28,14 +29,14 @@ const w = () => ({
|
|
|
28
29
|
discountBeforeTextValue: "",
|
|
29
30
|
discountAfterTextValue: ""
|
|
30
31
|
};
|
|
31
|
-
const { recommendationConfigs:
|
|
32
|
+
const { recommendationConfigs: n } = o, e = n.orientation === "grid" ? "vertical" : "horizontal";
|
|
32
33
|
return {
|
|
33
|
-
textTrimming:
|
|
34
|
+
textTrimming: n.textTrimming,
|
|
34
35
|
orientation: e,
|
|
35
36
|
mobileLeftPadding: 0,
|
|
36
37
|
mobileRightPadding: 0,
|
|
37
|
-
cardsInRow:
|
|
38
|
-
unresponsive:
|
|
38
|
+
cardsInRow: n.cardsInRow,
|
|
39
|
+
unresponsive: n.unresponsive,
|
|
39
40
|
priceBeforeTextValue: "",
|
|
40
41
|
priceAfterTextValue: "",
|
|
41
42
|
discountBeforeTextValue: "",
|
|
@@ -43,38 +44,38 @@ const w = () => ({
|
|
|
43
44
|
};
|
|
44
45
|
},
|
|
45
46
|
buildCampaignUrl: (s, a) => {
|
|
46
|
-
var
|
|
47
|
-
const c =
|
|
47
|
+
var m;
|
|
48
|
+
const c = l(), o = x(), n = Number(s);
|
|
48
49
|
let e;
|
|
49
50
|
if (a)
|
|
50
51
|
e = a;
|
|
51
52
|
else {
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
53
|
+
const r = c.blockStates[n];
|
|
54
|
+
if (!r)
|
|
54
55
|
return "";
|
|
55
|
-
const { recommendationConfigs:
|
|
56
|
+
const { recommendationConfigs: i } = r;
|
|
56
57
|
e = {
|
|
57
|
-
strategy:
|
|
58
|
-
language:
|
|
59
|
-
currencyCode:
|
|
60
|
-
size:
|
|
61
|
-
productIds:
|
|
62
|
-
filters:
|
|
63
|
-
shuffleProducts:
|
|
58
|
+
strategy: i.strategy,
|
|
59
|
+
language: i.language,
|
|
60
|
+
currencyCode: i.currencySettings.value,
|
|
61
|
+
size: i.size,
|
|
62
|
+
productIds: i.productIds,
|
|
63
|
+
filters: i.filters,
|
|
64
|
+
shuffleProducts: i.shuffleProducts
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
const f = ((
|
|
67
|
-
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
68
|
-
const
|
|
69
|
-
t.set("productId", e.productIds.slice(0,
|
|
67
|
+
const f = ((m = I().find((r) => r.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
68
|
+
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising") {
|
|
69
|
+
const r = parseInt(e.size) || 6;
|
|
70
|
+
t.set("productId", e.productIds.slice(0, r).join(","));
|
|
70
71
|
} else e.strategy === "similarViewed" && t.set("productId", "{itemId}");
|
|
71
72
|
e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
72
|
-
const g = e.filters.filter((
|
|
73
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
|
|
74
|
-
const p = decodeURIComponent(t.toString()), u = `${
|
|
73
|
+
const g = e.filters.filter((r) => r.isValid), d = h(g);
|
|
74
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(o.partnerName, e.strategy)).forEach(([r, i]) => t.set(r, i));
|
|
75
|
+
const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
75
76
|
return c.recommendationCampaignUrls[s] = u, u;
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
export {
|
|
79
|
-
|
|
80
|
+
A as useRecommendation
|
|
80
81
|
};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
2
|
import { useConfig as y } from "./useConfig.js";
|
|
3
3
|
import { useSaveStart as w, useSaveComplete as C } from "./useGuidoActions.js";
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import { useStripoApi as
|
|
6
|
-
import { useTemplatePreparation as
|
|
7
|
-
import { useHtmlValidator as
|
|
8
|
-
import { useCouponBlockValidator as
|
|
9
|
-
import { useLiquidValidator as
|
|
10
|
-
const
|
|
11
|
-
const o = w(), s = C(), { validateHtml: r } =
|
|
4
|
+
import { useSyncModuleExtractor as E } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as H } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as q } from "./useHtmlValidator.js";
|
|
8
|
+
import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
|
|
9
|
+
import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
|
|
10
|
+
const z = () => {
|
|
11
|
+
const o = w(), s = C(), { validateHtml: r } = q(), { validateLiquidSyntax: n } = P(), { validateCouponBlockTags: l } = L(), { callbacks: a, isFeatureEnabled: d } = y(), { extractSyncModuleData: u } = E(), { setSyncModuleUnsubscriptionPages: c } = H(), { editorSave: m } = x();
|
|
12
12
|
return { save: async (p = !1, f = !1) => {
|
|
13
13
|
var i;
|
|
14
14
|
o();
|
|
15
|
-
const { prepareTemplateDetails: v } =
|
|
16
|
-
if (!
|
|
15
|
+
const { prepareTemplateDetails: v } = b(), t = await v();
|
|
16
|
+
if (!l(t.compiledHtml))
|
|
17
17
|
return;
|
|
18
18
|
if (d("liquidSyntax")) {
|
|
19
|
-
if (!await
|
|
19
|
+
if (!await n(t.compiledHtml))
|
|
20
20
|
return;
|
|
21
21
|
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
22
22
|
return;
|
|
23
|
-
if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
|
|
23
|
+
if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t) || !await m())
|
|
24
24
|
return;
|
|
25
|
-
await m();
|
|
26
25
|
const { unsubscribePayload: S, stripoModules: V } = u(t.rawHtml);
|
|
27
26
|
return await c(S), t.modules = V, p || s({ ...t, silent: f }), t;
|
|
28
27
|
} };
|
|
29
28
|
};
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
z as useSave
|
|
32
31
|
};
|
|
@@ -6,8 +6,9 @@ import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
|
6
6
|
import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { getPartnerRecommendationParams as w } from "../utils/partnerCustomizations.js";
|
|
10
|
+
import { isFilterValid as v } from "../validation/filterSchema.js";
|
|
11
|
+
import { isConfigValid as N } from "../validation/requiredFields.js";
|
|
11
12
|
const h = C();
|
|
12
13
|
let m = null, u = null, d = null;
|
|
13
14
|
function k() {
|
|
@@ -49,7 +50,7 @@ function I() {
|
|
|
49
50
|
filterSnapshot: null
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
|
-
const
|
|
53
|
+
const x = () => ({
|
|
53
54
|
recommendationCampaignUrls: {},
|
|
54
55
|
activePredictiveAlgorithms: [],
|
|
55
56
|
languages: {},
|
|
@@ -58,8 +59,8 @@ const N = () => ({
|
|
|
58
59
|
blockStates: {},
|
|
59
60
|
currentRecommendationId: null,
|
|
60
61
|
configVersion: 0
|
|
61
|
-
}),
|
|
62
|
-
state: () =>
|
|
62
|
+
}), T = P("guidoRecommendationExtension", {
|
|
63
|
+
state: () => x(),
|
|
63
64
|
getters: {
|
|
64
65
|
// ====================================================================
|
|
65
66
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -359,7 +360,7 @@ const N = () => ({
|
|
|
359
360
|
const n = [...e.recommendationConfigs.filters];
|
|
360
361
|
n[r] = {
|
|
361
362
|
...t,
|
|
362
|
-
isValid:
|
|
363
|
+
isValid: v(t)
|
|
363
364
|
}, e.recommendationConfigs.filters = n;
|
|
364
365
|
}
|
|
365
366
|
},
|
|
@@ -405,7 +406,7 @@ const N = () => ({
|
|
|
405
406
|
* every block's recommendationConfigs across user edits.
|
|
406
407
|
*/
|
|
407
408
|
hasInvalidBlock() {
|
|
408
|
-
return Object.values(this.blockStates).some((t) => !
|
|
409
|
+
return Object.values(this.blockStates).some((t) => !N(t.recommendationConfigs, this));
|
|
409
410
|
},
|
|
410
411
|
// ====================================================================
|
|
411
412
|
// Per-Block Product Fetching
|
|
@@ -434,7 +435,10 @@ const N = () => ({
|
|
|
434
435
|
details: !0,
|
|
435
436
|
campaignId: o.variationId
|
|
436
437
|
};
|
|
437
|
-
r.strategy === "manualMerchandising" ? a.productId = r.productIds.slice(0, s).join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0)
|
|
438
|
+
r.strategy === "manualMerchandising" ? a.productId = r.productIds.slice(0, s).join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
439
|
+
a,
|
|
440
|
+
w(o.partnerName, r.strategy)
|
|
441
|
+
);
|
|
438
442
|
let f;
|
|
439
443
|
try {
|
|
440
444
|
f = await h.fetchRecommendationProducts(i, a);
|
|
@@ -452,5 +456,5 @@ const N = () => ({
|
|
|
452
456
|
}
|
|
453
457
|
});
|
|
454
458
|
export {
|
|
455
|
-
|
|
459
|
+
T as useRecommendationExtensionStore
|
|
456
460
|
};
|
|
@@ -9,44 +9,36 @@ function m(t) {
|
|
|
9
9
|
function f(t) {
|
|
10
10
|
return t.split(",").filter(Boolean).map(m);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return t.map(encodeURIComponent).join(",");
|
|
14
|
-
}
|
|
15
|
-
function Q(t) {
|
|
16
|
-
return t.trim().length > 0;
|
|
17
|
-
}
|
|
18
|
-
function d(t) {
|
|
12
|
+
function y(t) {
|
|
19
13
|
if (t.length === 0)
|
|
20
14
|
return "";
|
|
21
15
|
const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
|
|
22
|
-
const e = r.operator === l, a = e ? "=" : r.operator,
|
|
23
|
-
return `[${r.attribute}][${encodeURIComponent(a)}][${
|
|
24
|
-
}), [
|
|
25
|
-
let n =
|
|
26
|
-
for (let r = 0; r <
|
|
16
|
+
const e = r.operator === l, a = e ? "=" : r.operator, c = e ? f(r.value).join(l) : r.value;
|
|
17
|
+
return `[${r.attribute}][${encodeURIComponent(a)}][${c}]`;
|
|
18
|
+
}), [i, ...p] = u;
|
|
19
|
+
let n = i;
|
|
20
|
+
for (let r = 0; r < p.length; r++) {
|
|
27
21
|
const e = o[r].innerGroupOperator;
|
|
28
|
-
n += `${e}${
|
|
22
|
+
n += `${e}${p[r]}`;
|
|
29
23
|
}
|
|
30
24
|
return `(${n})`;
|
|
31
25
|
}
|
|
32
|
-
function
|
|
26
|
+
function g(t) {
|
|
33
27
|
if (!t || t.length === 0)
|
|
34
28
|
return "";
|
|
35
|
-
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e),
|
|
29
|
+
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e), i = u.map((r) => {
|
|
36
30
|
const e = o[r];
|
|
37
|
-
return
|
|
38
|
-
}), [
|
|
39
|
-
let
|
|
31
|
+
return y(e);
|
|
32
|
+
}), [p, ...n] = i;
|
|
33
|
+
let s = p;
|
|
40
34
|
for (let r = 0; r < n.length; r++) {
|
|
41
|
-
const e = u[r + 1],
|
|
42
|
-
|
|
35
|
+
const e = u[r + 1], c = o[e][0].outerGroupOperator;
|
|
36
|
+
s += `${c}${n[r]}`;
|
|
43
37
|
}
|
|
44
|
-
return
|
|
38
|
+
return s.trim();
|
|
45
39
|
}
|
|
46
40
|
export {
|
|
47
|
-
|
|
48
|
-
F as generateCompleteFilterQuery,
|
|
49
|
-
Q as isValidFilterTag,
|
|
41
|
+
g as generateCompleteFilterQuery,
|
|
50
42
|
f as parseTagList,
|
|
51
43
|
m as safeDecodeURIComponent
|
|
52
44
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const i = [
|
|
2
|
+
"ozonebg",
|
|
3
|
+
"ozonehr",
|
|
4
|
+
"ozonero",
|
|
5
|
+
"ozoneinfo",
|
|
6
|
+
"babybg",
|
|
7
|
+
"ozongr",
|
|
8
|
+
"iboodat",
|
|
9
|
+
"iboodbe",
|
|
10
|
+
"iboodde",
|
|
11
|
+
"iboodfr",
|
|
12
|
+
"iboodnl",
|
|
13
|
+
"iboodpl"
|
|
14
|
+
], r = ["interencheres", "interencherespreprod"], d = ["lodenfrey", "lodenfreyuat"], c = "manualMerchandising";
|
|
15
|
+
function s(e, n) {
|
|
16
|
+
const o = {};
|
|
17
|
+
return i.includes(e) && (o.excludePurchaseDay = "30", o.userId = "{user_id}"), r.includes(e) && (o.hp = "1"), d.includes(e) && n === c && (o.includeOutOfStockItems = "true"), o;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
s as getPartnerRecommendationParams
|
|
21
|
+
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-
|
|
1
|
+
.gap-16[data-v-8053a037],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-cdee3452]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-cdee3452]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-cdee3452]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -7,5 +7,5 @@ export declare const useActionsApi: () => {
|
|
|
7
7
|
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
8
8
|
updateTimerInClonedTemplate: () => Promise<string | null>;
|
|
9
9
|
updateHtmlAndCss: (html: string, css: string) => void;
|
|
10
|
-
editorSave: () => Promise<
|
|
10
|
+
editorSave: () => Promise<boolean>;
|
|
11
11
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Filter } from '@@/Types/recommendation';
|
|
2
2
|
export declare function safeDecodeURIComponent(value: string): string;
|
|
3
3
|
export declare function parseTagList(value: string): string[];
|
|
4
|
-
export declare function encodeTagList(tags: string[]): string;
|
|
5
|
-
export declare function isValidFilterTag(tag: string): boolean;
|
|
6
4
|
/**
|
|
7
5
|
* Generates the complete query with outer group operators
|
|
8
6
|
* @param filters Array of Filter objects
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the extra recommendation feed query params for an account, if any.
|
|
3
|
+
* Accounts without customizations get an empty object.
|
|
4
|
+
* @param partnerName Account subdomain (`config.partner.name`)
|
|
5
|
+
* @param strategy Recommendation strategy key of the block
|
|
6
|
+
*/
|
|
7
|
+
export declare function getPartnerRecommendationParams(partnerName: string, strategy: string): Record<string, string>;
|
|
@@ -1,79 +1,87 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { DEFAULT_CURRENCY as
|
|
1
|
+
import { useActionsApi as C } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as T } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
4
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
-
import { DATA_ATTRIBUTES as
|
|
6
|
-
import { parsePageList as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
}),
|
|
5
|
+
import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { parsePageList as D } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
7
|
+
import { useDynamicContentStore as P } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useUnsubscribeStore as w } from "../stores/unsubscribe.js";
|
|
9
|
+
function E(i, o) {
|
|
10
|
+
const t = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), c = [];
|
|
11
|
+
return t.forEach((r) => {
|
|
12
|
+
const a = r.getAttribute(S.PAGE_LIST);
|
|
13
|
+
a && c.push(...D(a));
|
|
14
|
+
}), o.filter((r) => c.includes(r));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
async function U(i) {
|
|
17
17
|
const m = new DOMParser().parseFromString(i, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
18
18
|
if (m.length === 0)
|
|
19
19
|
return;
|
|
20
|
-
const
|
|
21
|
-
m.forEach((
|
|
22
|
-
var g, f, u, n,
|
|
23
|
-
const c =
|
|
24
|
-
if (!Number.isFinite(
|
|
20
|
+
const l = b();
|
|
21
|
+
m.forEach((t) => {
|
|
22
|
+
var g, f, u, n, y;
|
|
23
|
+
const c = t.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
|
|
24
|
+
if (!Number.isFinite(r))
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
const a = t.getAttribute("esd-ext-config");
|
|
27
|
+
if (!a)
|
|
28
28
|
return;
|
|
29
29
|
let e;
|
|
30
30
|
try {
|
|
31
|
-
e = JSON.parse(
|
|
31
|
+
e = JSON.parse(a);
|
|
32
32
|
} catch {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
36
36
|
return;
|
|
37
37
|
const p = {
|
|
38
|
-
strategy: e.strategy ??
|
|
39
|
-
language: e.language ??
|
|
40
|
-
size: e.size ??
|
|
38
|
+
strategy: e.strategy ?? s.strategy,
|
|
39
|
+
language: e.language ?? s.language,
|
|
40
|
+
size: e.size ?? s.size,
|
|
41
41
|
// Spread the default arrays so each block gets a fresh reference
|
|
42
42
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
43
|
-
productIds: e.productIds ?? [...
|
|
44
|
-
filters: e.filters ?? [...
|
|
45
|
-
shuffleProducts: e.shuffleProducts ??
|
|
46
|
-
currencyCode: ((g = e.currency) == null ? void 0 : g.code) ??
|
|
47
|
-
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ??
|
|
48
|
-
currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ??
|
|
49
|
-
currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ??
|
|
50
|
-
currencyThousandSeparator: ((
|
|
43
|
+
productIds: e.productIds ?? [...s.productIds],
|
|
44
|
+
filters: e.filters ?? [...s.filters],
|
|
45
|
+
shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
|
|
46
|
+
currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? d.code,
|
|
47
|
+
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? d.alignment,
|
|
48
|
+
currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? d.decimalCount,
|
|
49
|
+
currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? d.decimalSeparator,
|
|
50
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
l.seedBlockUrlConfig(r, p);
|
|
53
53
|
});
|
|
54
|
+
try {
|
|
55
|
+
await l.fetchRecommendationCreateData();
|
|
56
|
+
} catch (t) {
|
|
57
|
+
console.warn(
|
|
58
|
+
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
59
|
+
t
|
|
60
|
+
);
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
const _ = () => {
|
|
56
|
-
const i =
|
|
64
|
+
const i = P(), o = w(), { getCompiledEmail: m, getTemplateData: l } = C(), { compileHtml: t } = T();
|
|
57
65
|
return {
|
|
58
66
|
prepareTemplateDetails: async () => {
|
|
59
|
-
const { html:
|
|
67
|
+
const { html: r, ampHtml: a = "", ampErrors: e = [] } = await m({
|
|
60
68
|
minimize: !0,
|
|
61
69
|
resetDataSavedFlag: !1
|
|
62
|
-
}), { html: p, css: g, syncModulesIds: f = [] } = await
|
|
63
|
-
|
|
64
|
-
const { compiledHtml: u, stats: n, appliedRules:
|
|
70
|
+
}), { html: p, css: g, syncModulesIds: f = [] } = await l();
|
|
71
|
+
o.selectedUnsubscribePages.length && await o.fetchTemplates(), await U(p);
|
|
72
|
+
const { compiledHtml: u, stats: n, appliedRules: y } = t(r), h = i.getSelectedDynamicContentList, A = b();
|
|
65
73
|
return console.debug("HTML Compilation Stats:", {
|
|
66
74
|
originalSize: n.originalSize,
|
|
67
75
|
compiledSize: n.compiledSize,
|
|
68
76
|
reduction: `${n.reductionPercentage.toFixed(2)}%`,
|
|
69
|
-
appliedRules:
|
|
77
|
+
appliedRules: y,
|
|
70
78
|
executionTime: `${n.executionTime.toFixed(2)}ms`
|
|
71
79
|
}), {
|
|
72
80
|
dynamicContentList: h,
|
|
73
81
|
compiledHtml: u,
|
|
74
82
|
rawHtml: p,
|
|
75
83
|
css: g,
|
|
76
|
-
ampHtml:
|
|
84
|
+
ampHtml: a,
|
|
77
85
|
ampErrors: e,
|
|
78
86
|
modules: f.map(Number),
|
|
79
87
|
recommendation: {
|
|
@@ -81,8 +89,8 @@ const _ = () => {
|
|
|
81
89
|
configs: {}
|
|
82
90
|
},
|
|
83
91
|
unsubscribe: {
|
|
84
|
-
status:
|
|
85
|
-
config:
|
|
92
|
+
status: o.unsubscribePagesStatus,
|
|
93
|
+
config: E(u, o.selectedUnsubscribePages)
|
|
86
94
|
}
|
|
87
95
|
};
|
|
88
96
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.4.1-beta.
|
|
3
|
+
"version": "3.4.1-beta.f0bed82",
|
|
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",
|