@useinsider/guido 3.2.0-beta.738ec8a → 3.2.0-beta.78d83bd
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 +11 -9
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +35 -70
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/enums/extensions/recommendationBlock.js +27 -28
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/Items/template.js +46 -48
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +12 -25
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./FilterItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var i = 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:
|
|
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: function(s) {
|
|
9
|
+
return t.updateFilter({ text: "operator", value: s.value });
|
|
10
|
+
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", 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: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
9
11
|
t.updateFilter({ text: "value", value: encodeURIComponent(s) });
|
|
10
12
|
} } })]], 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
13
|
return t.updateFilter({ text: "innerGroupOperator", value: s });
|
|
12
14
|
} } })], 1) : a._e()]);
|
|
13
|
-
},
|
|
14
|
-
l,
|
|
15
|
+
}, o = [], n = /* @__PURE__ */ l(
|
|
15
16
|
r,
|
|
16
|
-
|
|
17
|
+
i,
|
|
18
|
+
o,
|
|
17
19
|
!1,
|
|
18
20
|
null,
|
|
19
|
-
"
|
|
21
|
+
"3b53a736"
|
|
20
22
|
);
|
|
21
|
-
const f =
|
|
23
|
+
const f = n.exports;
|
|
22
24
|
export {
|
|
23
25
|
f as default
|
|
24
26
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getOperatorOptions as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { useDebounceFn as K } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
11
|
-
const se = /* @__PURE__ */ N({
|
|
1
|
+
import { defineComponent as _, computed as l } from "vue";
|
|
2
|
+
import { useTranslations as C } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as p } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as V } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { getInvalidFilterFields as A } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
|
|
6
|
+
import { InButtonV2 as L, InSelect as O, InBasicTextInput as S } from "@useinsider/design-system-vue";
|
|
7
|
+
import E from "./LogicAdapter.vue.js";
|
|
8
|
+
import { useDebounceFn as N } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
9
|
+
const K = /* @__PURE__ */ _({
|
|
12
10
|
__name: "FilterItem",
|
|
13
11
|
props: {
|
|
14
12
|
filter: null,
|
|
@@ -17,88 +15,55 @@ const se = /* @__PURE__ */ N({
|
|
|
17
15
|
submitted: { type: Boolean }
|
|
18
16
|
},
|
|
19
17
|
emits: ["delete-filter"],
|
|
20
|
-
setup(
|
|
21
|
-
const t =
|
|
18
|
+
setup(f, { emit: v }) {
|
|
19
|
+
const t = f, n = C(), a = V(), y = [
|
|
22
20
|
{
|
|
23
|
-
text:
|
|
21
|
+
text: n("email-editor.standard-filter"),
|
|
24
22
|
value: "standardFilter"
|
|
25
23
|
}
|
|
26
|
-
],
|
|
24
|
+
], i = [
|
|
27
25
|
{ text: "True", value: "true" },
|
|
28
26
|
{ text: "False", value: "false" }
|
|
29
|
-
],
|
|
27
|
+
], d = l(() => t.filter.attribute || ""), r = l(() => a.getFilterList.find((e) => e.value === d.value) || { text: "", value: "", type: "" }), F = l(
|
|
30
28
|
() => {
|
|
31
29
|
var e;
|
|
32
|
-
return ((e =
|
|
30
|
+
return ((e = r.value) == null ? void 0 : e.type) === "Boolean";
|
|
33
31
|
}
|
|
34
|
-
), b =
|
|
32
|
+
), b = l(() => {
|
|
35
33
|
var e;
|
|
36
|
-
return
|
|
37
|
-
}),
|
|
38
|
-
() =>
|
|
39
|
-
),
|
|
40
|
-
() =>
|
|
41
|
-
),
|
|
34
|
+
return p((e = r.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
|
|
35
|
+
}), g = l(
|
|
36
|
+
() => i.find((e) => e.value === t.filter.value) || i[0]
|
|
37
|
+
), u = l(() => t.submitted ? A(t.filter) : /* @__PURE__ */ new Set()), h = (e) => u.value.has(e) ? "error" : "default", B = l(
|
|
38
|
+
() => u.value.has("value") ? n("action-builder.filter-empty-value-error") : ""
|
|
39
|
+
), c = l(
|
|
42
40
|
() => {
|
|
43
41
|
var e;
|
|
44
|
-
return ((e =
|
|
42
|
+
return ((e = r.value) == null ? void 0 : e.type) === "Number";
|
|
45
43
|
}
|
|
46
|
-
),
|
|
47
|
-
(
|
|
48
|
-
var e;
|
|
49
|
-
return ((e = i.value) == null ? void 0 : e.type) === "Date";
|
|
50
|
-
}
|
|
51
|
-
), _ = r(() => t.filter.operator === d), k = r(() => j(t.filter.value)), P = K((e) => {
|
|
52
|
-
n.updateFilter({
|
|
44
|
+
), x = l(() => c.value ? "number" : "text"), T = N((e) => {
|
|
45
|
+
a.updateFilter({
|
|
53
46
|
...t.filter,
|
|
54
47
|
[e.text]: e.value
|
|
55
48
|
});
|
|
56
|
-
}, 500)
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
}, 500);
|
|
50
|
+
return { __sfc: !0, trans: n, store: a, props: t, filterTypeOptions: y, booleanValueOptions: i, attributeType: d, selectedAttributeType: r, isBooleanAttribute: F, selectedOperatorType: b, selectedBooleanValue: g, emit: v, invalidFields: u, getFieldState: h, valueErrorMessage: B, isNumericAttribute: c, valueInputType: x, updateFilter: T, handleAttributeChange: (e) => {
|
|
51
|
+
const o = a.getFilterList.find((I) => I.value === e.value), m = (o == null ? void 0 : o.type) === "Boolean", [s] = p(o == null ? void 0 : o.type);
|
|
52
|
+
a.updateFilter({
|
|
59
53
|
...t.filter,
|
|
60
54
|
attribute: e.value,
|
|
61
|
-
operator:
|
|
62
|
-
value:
|
|
55
|
+
operator: m ? "=" : (s == null ? void 0 : s.value) ?? "",
|
|
56
|
+
value: m ? "true" : ""
|
|
63
57
|
});
|
|
64
|
-
},
|
|
65
|
-
|
|
58
|
+
}, handleBooleanValueChange: (e) => {
|
|
59
|
+
a.updateFilter({
|
|
66
60
|
...t.filter,
|
|
67
61
|
operator: "=",
|
|
68
62
|
value: e.value
|
|
69
63
|
});
|
|
70
|
-
}, S
|
|
71
|
-
const o = e.value;
|
|
72
|
-
if (o === t.filter.operator)
|
|
73
|
-
return;
|
|
74
|
-
const c = t.filter.operator === d !== (o === d);
|
|
75
|
-
n.updateFilter({
|
|
76
|
-
...t.filter,
|
|
77
|
-
operator: o,
|
|
78
|
-
value: c ? "" : t.filter.value
|
|
79
|
-
});
|
|
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
|
-
);
|
|
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
|
-
...t.filter,
|
|
92
|
-
value: encodeURIComponent(F(e))
|
|
93
|
-
});
|
|
94
|
-
}, onTagsInput: (e) => {
|
|
95
|
-
n.updateFilter({
|
|
96
|
-
...t.filter,
|
|
97
|
-
value: e.map(encodeURIComponent).join(",")
|
|
98
|
-
});
|
|
99
|
-
}, getOperatorOptions: f, safeDecodeURIComponent: g, InBasicTextInput: H, InDatePickerV2: G, InSelect: z, InButtonV2: q, InTags: Y, LogicAdapter: J };
|
|
64
|
+
}, getOperatorOptions: p, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
|
|
100
65
|
}
|
|
101
66
|
});
|
|
102
67
|
export {
|
|
103
|
-
|
|
68
|
+
K as default
|
|
104
69
|
};
|
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as p, LINK_TYPES as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import { useDynamicContentStore as
|
|
6
|
-
import { useUnsubscribeStore as
|
|
7
|
-
|
|
1
|
+
import { usePartner as U } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as p, PRODUCT_TYPE_URL_SEGMENTS as R, LINK_TYPES as _, INSIDER_ID as m, URLS as y } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as N } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as C } from "../../stores/config.js";
|
|
5
|
+
import { useDynamicContentStore as L } from "../../stores/dynamic-content.js";
|
|
6
|
+
import { useUnsubscribeStore as P } from "../../stores/unsubscribe.js";
|
|
7
|
+
import { ProductType as B } from "../../@types/config/schemas.js";
|
|
8
|
+
import "../../@types/config/defaults.js";
|
|
9
|
+
const F = [
|
|
8
10
|
{
|
|
9
11
|
id: "add-unsubscribe-link-values",
|
|
10
12
|
description: "Adding unsubscribe link values",
|
|
11
13
|
type: "custom",
|
|
12
|
-
processor: (
|
|
13
|
-
const { getPartnerName: i } =
|
|
14
|
-
if (!
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
processor: (s) => {
|
|
15
|
+
const { getPartnerName: i } = U(), n = C(), t = L(), E = P(), c = n.variationId;
|
|
16
|
+
if (!c)
|
|
17
|
+
return s;
|
|
18
|
+
const r = R[n.productType] ?? R[B.EMAIL];
|
|
19
|
+
let e = s;
|
|
20
|
+
const d = `/${i()}/${r}/${c}?user={{iid}}`, f = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]");
|
|
21
|
+
let a = !1, l = !1;
|
|
22
|
+
return f.forEach((g) => {
|
|
23
|
+
var S;
|
|
24
|
+
const u = g.getAttribute("data-unsubscribe-page-list");
|
|
22
25
|
if (!u)
|
|
23
26
|
return;
|
|
24
|
-
const
|
|
25
|
-
(
|
|
27
|
+
const I = N(u), b = ((S = E.templates) == null ? void 0 : S.filter(
|
|
28
|
+
(o) => I.includes(o.id)
|
|
26
29
|
)) ?? [];
|
|
27
|
-
|
|
28
|
-
}), (
|
|
30
|
+
a = a || b.some((o) => o.type === _.UNSUBSCRIBE_LINK_TYPE), l = l || b.some((o) => o.type === _.PREFERENCES_LINK_TYPE);
|
|
31
|
+
}), (a || l) && (t.selectedDynamicContentList.some((u) => u.value === m) || t.selectedDynamicContentList.push({
|
|
29
32
|
text: m,
|
|
30
33
|
value: m,
|
|
31
34
|
fallback: ""
|
|
32
|
-
})),
|
|
35
|
+
})), a && (e = e.replace(
|
|
33
36
|
p.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
34
|
-
|
|
37
|
+
y.UNSUBSCRIBE_URL + d
|
|
35
38
|
)), l && (e = e.replace(
|
|
36
39
|
p.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
37
|
-
|
|
38
|
-
)),
|
|
40
|
+
y.PREFERENCES_URL + d
|
|
41
|
+
)), f.length && (e = e.replace(p.UNSUBSCRIBE_LINK_REGEX, "")), e;
|
|
39
42
|
},
|
|
40
43
|
priority: 60
|
|
41
44
|
},
|
|
@@ -52,25 +55,25 @@ const G = [
|
|
|
52
55
|
id: "format-comment-braces",
|
|
53
56
|
description: "Adding spaces around comment braces for proper formatting",
|
|
54
57
|
type: "custom",
|
|
55
|
-
processor: (
|
|
58
|
+
processor: (s) => s.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
|
|
56
59
|
priority: 62
|
|
57
60
|
},
|
|
58
61
|
{
|
|
59
62
|
id: "add-universal-link-flags",
|
|
60
63
|
description: "Adding universal link flags",
|
|
61
64
|
type: "custom",
|
|
62
|
-
processor: (
|
|
63
|
-
let i =
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
if (
|
|
65
|
+
processor: (s) => {
|
|
66
|
+
let i = s;
|
|
67
|
+
const n = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
68
|
+
return n && n.forEach((t) => {
|
|
69
|
+
if (t.includes("insEmail=1"))
|
|
67
70
|
return;
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
return
|
|
71
|
+
if (t.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
72
|
+
const c = t.replace(/href=(["'`”])(.*?)\1/gm, (r) => {
|
|
73
|
+
const e = r.slice(6, r.length - 1).trim();
|
|
74
|
+
return r.includes("?") || r.includes("#") ? e.slice(-1) === "&" ? r.replace(e, `${e}insEmail=1`) : r.replace(e, `${e}&insEmail=1`) : r.replace(e, `${e}?insEmail=1`);
|
|
72
75
|
});
|
|
73
|
-
i = i.replace(
|
|
76
|
+
i = i.replace(t, c);
|
|
74
77
|
}
|
|
75
78
|
}), i;
|
|
76
79
|
},
|
|
@@ -78,5 +81,5 @@ const G = [
|
|
|
78
81
|
}
|
|
79
82
|
];
|
|
80
83
|
export {
|
|
81
|
-
|
|
84
|
+
F as unsubscribeCompilerRules
|
|
82
85
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = {
|
|
2
2
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
3
|
-
},
|
|
3
|
+
}, i = {
|
|
4
4
|
CLIENT_ID: "clientId"
|
|
5
|
-
},
|
|
5
|
+
}, u = [
|
|
6
6
|
{ id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
|
|
7
7
|
{ id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
|
|
8
8
|
{ id: 13, key: "userBased", name: "User Based", path: "user-based" },
|
|
@@ -13,72 +13,71 @@ const i = {
|
|
|
13
13
|
{ id: 46, key: "mostValuableOfPartner", name: "Most Valuable Products", path: "most-valuable" },
|
|
14
14
|
{ id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
|
|
15
15
|
{ id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
|
|
16
|
-
],
|
|
16
|
+
], l = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], c = [
|
|
17
17
|
{ text: "before the amount", value: "0" },
|
|
18
18
|
{ text: "after the amount", value: "1" }
|
|
19
|
-
],
|
|
19
|
+
], d = [
|
|
20
20
|
{ text: "dot(.)", value: "." },
|
|
21
21
|
{ text: "comma(,)", value: "," }
|
|
22
|
-
],
|
|
22
|
+
], p = [
|
|
23
23
|
{ text: "0", value: "0" },
|
|
24
24
|
{ text: "1", value: "1" },
|
|
25
25
|
{ text: "2", value: "2" },
|
|
26
26
|
{ text: "3", value: "3" },
|
|
27
27
|
{ text: "4", value: "4" },
|
|
28
28
|
{ text: "5", value: "5" }
|
|
29
|
-
],
|
|
29
|
+
], e = [
|
|
30
30
|
{ text: "is exactly", value: "=" },
|
|
31
31
|
{ text: "contains", value: "~" },
|
|
32
32
|
{ text: "does not contain", value: "!~" },
|
|
33
|
-
{ text: "any of", value:
|
|
34
|
-
],
|
|
33
|
+
{ text: "any of", value: "||" }
|
|
34
|
+
], a = [
|
|
35
35
|
{ text: "is exactly", value: "=" },
|
|
36
36
|
{ text: "is not exactly", value: "!==" },
|
|
37
37
|
{ text: "contains", value: "~" },
|
|
38
38
|
{ text: "does not contain", value: "!~" },
|
|
39
|
-
{ text: "any of", value:
|
|
39
|
+
{ text: "any of", value: "||" }
|
|
40
40
|
], r = [
|
|
41
41
|
{ text: "is equal to", value: "=" },
|
|
42
42
|
{ text: "is greater than", value: ">" },
|
|
43
43
|
{ text: "is less than", value: "<" }
|
|
44
|
-
],
|
|
44
|
+
], o = [
|
|
45
45
|
{ text: "is equal to", value: "=" },
|
|
46
46
|
{ text: "after", value: ">" },
|
|
47
47
|
{ text: "before", value: "<" }
|
|
48
|
-
],
|
|
48
|
+
], n = [
|
|
49
49
|
{ text: "true", value: "==" },
|
|
50
50
|
{ text: "false", value: "!=" }
|
|
51
|
-
],
|
|
51
|
+
], m = (t) => {
|
|
52
52
|
if (!t)
|
|
53
53
|
return e;
|
|
54
54
|
switch (t) {
|
|
55
55
|
case "Boolean":
|
|
56
|
-
return s;
|
|
57
|
-
case "Date":
|
|
58
56
|
return n;
|
|
57
|
+
case "Date":
|
|
58
|
+
return o;
|
|
59
59
|
case "Number":
|
|
60
60
|
return r;
|
|
61
61
|
case "String":
|
|
62
62
|
return e;
|
|
63
63
|
case "Strings":
|
|
64
|
-
return
|
|
64
|
+
return a;
|
|
65
65
|
default:
|
|
66
66
|
return e;
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
u as
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
d as
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
n as operatorOptionsForDates,
|
|
70
|
+
l as PriceAttributes,
|
|
71
|
+
i as QUERY_PARAMS,
|
|
72
|
+
u as RecommendationFeedSourceMaps,
|
|
73
|
+
s as URLS,
|
|
74
|
+
p as currencyDecimalCounts,
|
|
75
|
+
c as currencyLocationMaps,
|
|
76
|
+
d as currencyOperators,
|
|
77
|
+
m as getOperatorOptions,
|
|
78
|
+
a as operatorOptionsForArrayOfStrings,
|
|
79
|
+
n as operatorOptionsForBooleans,
|
|
80
|
+
o as operatorOptionsForDates,
|
|
82
81
|
r as operatorOptionsForNumbers,
|
|
83
82
|
e as operatorOptionsForStrings
|
|
84
83
|
};
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { useTranslations as R } from "../composables/useTranslations.js";
|
|
2
|
+
import { ProductType as s } from "../@types/config/schemas.js";
|
|
3
|
+
import "../@types/config/defaults.js";
|
|
4
|
+
import { getEnvironmentPrefix as S } from "../utils/environmentUtil.js";
|
|
5
|
+
const B = {
|
|
4
6
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
5
7
|
PREFERENCES_LINK_TYPE: 3
|
|
6
|
-
},
|
|
8
|
+
}, i = {
|
|
7
9
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
8
10
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
9
11
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
10
12
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
11
|
-
}, n =
|
|
13
|
+
}, n = S(), C = {
|
|
12
14
|
UNSUBSCRIBE_URL: `https://mail.${n}.com/user/v1/unsub`,
|
|
13
15
|
PREFERENCES_URL: `https://mail.${n}.com/user/v1/prefs`
|
|
14
|
-
},
|
|
16
|
+
}, U = {
|
|
17
|
+
[s.EMAIL]: "email",
|
|
18
|
+
[s.ARCHITECT]: "journey",
|
|
19
|
+
[s.UNSUBSCRIBE_PAGES]: "email"
|
|
20
|
+
}, t = "iid", o = {
|
|
15
21
|
name: "Global Unsubscribe",
|
|
16
22
|
sendGridId: "G"
|
|
17
|
-
},
|
|
23
|
+
}, c = "/email/unsubscribe-pages", E = {
|
|
18
24
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
19
25
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
20
26
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
21
27
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
22
28
|
RESUBSCRIBE: 5
|
|
23
|
-
},
|
|
29
|
+
}, u = {
|
|
24
30
|
[E.GLOBAL_UNSUBSCRIBE]: "custom-unsubscribe",
|
|
25
31
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "custom-preferences"
|
|
26
|
-
},
|
|
32
|
+
}, T = {
|
|
27
33
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
28
34
|
E.GLOBAL_UNSUBSCRIBE,
|
|
29
35
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -33,30 +39,31 @@ const _ = {
|
|
|
33
39
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
34
40
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
35
41
|
]
|
|
36
|
-
},
|
|
37
|
-
const
|
|
42
|
+
}, b = () => {
|
|
43
|
+
const e = R();
|
|
38
44
|
return {
|
|
39
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
40
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
41
|
-
[E.RESUBSCRIBE]:
|
|
42
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
43
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
45
|
+
[E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
|
|
46
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
47
|
+
[E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
|
|
48
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
|
|
49
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
44
50
|
};
|
|
45
|
-
},
|
|
51
|
+
}, P = {
|
|
46
52
|
default: "{{ins-unsubscribe-link}}",
|
|
47
53
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
48
54
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
49
55
|
};
|
|
50
56
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
o as DEFAULT_UNSUBSCRIBE_GROUP,
|
|
58
|
+
t as INSIDER_ID,
|
|
59
|
+
i as LINK_REGEXES,
|
|
60
|
+
B as LINK_TYPES,
|
|
61
|
+
P as MERGE_TAGS,
|
|
56
62
|
E as PAGE_TYPES,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
U as PRODUCT_TYPE_URL_SEGMENTS,
|
|
64
|
+
T as TYPE_COLLECTIONS,
|
|
65
|
+
c as UNSUBSCRIBE_PAGES_LINK,
|
|
66
|
+
u as UNSUBSCRIBE_SYNC_MODULE_TYPES,
|
|
67
|
+
C as URLS,
|
|
68
|
+
b as getTypeTranslations
|
|
62
69
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { BlockType as b, BlockAttr as
|
|
1
|
+
import { BlockType as b, BlockAttr as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { ItemsBlockId as O } from "./enums/controlEnums.js";
|
|
3
|
-
import { productPairs as
|
|
4
|
-
import { ItemInCartOptions as Y, SETTINGS_ENUMS as x, DefaultConfigValues as
|
|
3
|
+
import { productPairs as P, templateFirstLine as C } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as Y, SETTINGS_ENUMS as x, DefaultConfigValues as F } from "./enums/settingsEnums.js";
|
|
5
5
|
import j from "./layouts/horizontal.html.js";
|
|
6
6
|
import q from "./layouts/vertical.html.js";
|
|
7
7
|
import { escapeReplacement as V } from "./utils/nodeConfigUtils.js";
|
|
8
|
-
let [
|
|
9
|
-
const
|
|
8
|
+
let [M] = P.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [D] = P.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [N] = P.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [m] = P.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [U] = P.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
9
|
+
const g = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), L = (s) => g(s, "text-align"), A = (s, e) => {
|
|
10
10
|
const r = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(r);
|
|
11
11
|
return a ? a[1].trim() : null;
|
|
12
12
|
}, v = (s, e, r) => new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi").test(s) ? s.replace(
|
|
13
13
|
new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi"),
|
|
14
14
|
`$1${r}`
|
|
15
15
|
) : s, Z = (s, e, r, a) => {
|
|
16
|
-
const i = r ||
|
|
16
|
+
const i = r || F.productImageHeight, n = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
|
|
17
17
|
return `
|
|
18
18
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
19
19
|
align="center"
|
|
@@ -28,8 +28,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
28
28
|
href="#!">
|
|
29
29
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
30
30
|
style="object-fit: contain;"
|
|
31
|
-
src="${
|
|
32
|
-
alt="${L}"
|
|
31
|
+
src="${M}"
|
|
33
32
|
width="${i}"
|
|
34
33
|
height="${i}">
|
|
35
34
|
</a>
|
|
@@ -37,11 +36,10 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
37
36
|
`;
|
|
38
37
|
}, J = (s, e) => `
|
|
39
38
|
<${b.BLOCK_IMAGE}
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${N.BLOCK_IMAGE.height}="${D.productImageWidth}"
|
|
39
|
+
${S.BLOCK_IMAGE.src}="${M}"
|
|
40
|
+
${S.BLOCK_IMAGE.href}="#!"
|
|
41
|
+
${S.BLOCK_IMAGE.width}="${F.productImageWidth}"
|
|
42
|
+
${S.BLOCK_IMAGE.height}="${F.productImageWidth}"
|
|
45
43
|
esd-extension-block-id="${O.IMAGE}"
|
|
46
44
|
data-slot-1
|
|
47
45
|
product-attr="imageSrc"
|
|
@@ -64,7 +62,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
64
62
|
text-overflow: ellipsis;
|
|
65
63
|
`;
|
|
66
64
|
if (e) {
|
|
67
|
-
const c =
|
|
65
|
+
const c = A(a || "", "text-align") || "center", l = L(a || o), $ = A(l, "color"), t = A(l, "font-size"), E = A(l, "font-family"), _ = A(l, "font-weight"), u = A(l, "font-style"), w = _ === "bold" || _ === "700", p = u === "italic", R = [
|
|
68
66
|
$ ? `color: ${$}` : "",
|
|
69
67
|
t ? `font-size: ${t}` : "",
|
|
70
68
|
E ? `font-family: ${E}` : ""
|
|
@@ -74,17 +72,17 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
74
72
|
"font-size",
|
|
75
73
|
"inherit"
|
|
76
74
|
);
|
|
77
|
-
d =
|
|
75
|
+
d = g(d, "font-weight"), d = g(d, "font-style");
|
|
78
76
|
const T = (i == null ? void 0 : i.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
|
|
79
|
-
let
|
|
77
|
+
let I = `<a
|
|
80
78
|
href="#!"
|
|
81
79
|
style="${d}"
|
|
82
80
|
product-attr="name"
|
|
83
81
|
data-slot-2
|
|
84
82
|
width="100%">
|
|
85
|
-
${
|
|
83
|
+
${D}
|
|
86
84
|
</a>`;
|
|
87
|
-
return
|
|
85
|
+
return w && (I = `<strong>${I}</strong>`), p && (I = `<em>${I}</em>`), `
|
|
88
86
|
<td class="esd-block-text es-p10"
|
|
89
87
|
align="${c}"
|
|
90
88
|
width="100%"
|
|
@@ -92,7 +90,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
92
90
|
esd-extension-block-id="${O.NAME}"
|
|
93
91
|
style="${T}">
|
|
94
92
|
<p contenteditable="false" path="1"${R ? ` style="${R}"` : ""}>
|
|
95
|
-
${
|
|
93
|
+
${I}
|
|
96
94
|
</p>
|
|
97
95
|
</td>
|
|
98
96
|
`;
|
|
@@ -124,26 +122,26 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
124
122
|
product-attr="name"
|
|
125
123
|
data-slot-2
|
|
126
124
|
width="100%">
|
|
127
|
-
${
|
|
125
|
+
${D}
|
|
128
126
|
</a>
|
|
129
127
|
</p>
|
|
130
128
|
</${b.BLOCK_TEXT}>
|
|
131
129
|
`;
|
|
132
130
|
}, et = (s, e, r, a, i, n, o, c, l, $) => {
|
|
133
|
-
let t =
|
|
131
|
+
let t = N;
|
|
134
132
|
if (a && a.trim()) {
|
|
135
133
|
const T = `${a.trim()}`;
|
|
136
|
-
t = (i || "0") === "1" ? `${
|
|
134
|
+
t = (i || "0") === "1" ? `${N} ${T}` : `${T} ${N}`;
|
|
137
135
|
}
|
|
138
|
-
const E = i === "1" ? "after" : "before", _ = `data-formated="${r ? "true" : "false"}"`, u = `data-curency="${E}"`,
|
|
136
|
+
const E = i === "1" ? "after" : "before", _ = `data-formated="${r ? "true" : "false"}"`, u = `data-curency="${E}"`, w = a ? `data-currency_symbol="${a}"` : "", p = `data-single_price="${c ? "true" : "false"}"`, d = l === x.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
139
137
|
if (n) {
|
|
140
|
-
const
|
|
138
|
+
const h = L(o || "color: #060606; white-space: nowrap; font-size: 20px;"), I = $ ? "" : ' style="display: none;"';
|
|
141
139
|
return `
|
|
142
140
|
<td class="esd-block-text items-block-price${d}"
|
|
143
141
|
align="center"
|
|
144
142
|
esd-extension-block-id="${O.PRICE}"
|
|
145
143
|
width="100%"
|
|
146
|
-
${
|
|
144
|
+
${I}>
|
|
147
145
|
<p product-attr="price"
|
|
148
146
|
contenteditable="false"
|
|
149
147
|
data-slot-4
|
|
@@ -151,9 +149,9 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
151
149
|
data-number="${e}"
|
|
152
150
|
${_}
|
|
153
151
|
${u}
|
|
154
|
-
${
|
|
152
|
+
${w}
|
|
155
153
|
${p}
|
|
156
|
-
style="${
|
|
154
|
+
style="${h}">
|
|
157
155
|
${t}
|
|
158
156
|
</p>
|
|
159
157
|
</td>`;
|
|
@@ -181,19 +179,19 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
181
179
|
</${b.BLOCK_TEXT}>
|
|
182
180
|
`;
|
|
183
181
|
}, at = (s, e, r, a, i, n, o = !0, c, l, $) => {
|
|
184
|
-
let t =
|
|
182
|
+
let t = m;
|
|
185
183
|
if (a && a.trim()) {
|
|
186
184
|
const T = `${a.trim()}`;
|
|
187
|
-
t = (i || "0") === "1" ? `${
|
|
185
|
+
t = (i || "0") === "1" ? `${m} ${T}` : `${T} ${m}`;
|
|
188
186
|
}
|
|
189
|
-
const E = i === "1" ? "after" : "before", _ = `data-formated="${r ? "true" : "false"}"`, u = `data-curency="${E}"`,
|
|
187
|
+
const E = i === "1" ? "after" : "before", _ = `data-formated="${r ? "true" : "false"}"`, u = `data-curency="${E}"`, w = o ? "" : ' style="display: none;"', p = `data-single_price="${l ? "true" : "false"}"`, d = $ === x.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
190
188
|
if (n) {
|
|
191
|
-
const
|
|
189
|
+
const h = L(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
192
190
|
return `
|
|
193
191
|
<td class="esd-block-text items-block-price${d}"
|
|
194
192
|
esd-extension-block-id="${O.ORIGINAL_PRICE}"
|
|
195
193
|
width="100%"
|
|
196
|
-
align="center"${
|
|
194
|
+
align="center"${w}>
|
|
197
195
|
<p
|
|
198
196
|
product-attr="originalPrice"
|
|
199
197
|
contenteditable="false"
|
|
@@ -204,7 +202,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
204
202
|
${u}
|
|
205
203
|
${a ? `data-currency_symbol="${a}"` : ""}
|
|
206
204
|
${p}
|
|
207
|
-
style="${
|
|
205
|
+
style="${h}">
|
|
208
206
|
<s>${t}</s>
|
|
209
207
|
</p>
|
|
210
208
|
</td>
|
|
@@ -237,7 +235,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
237
235
|
}, st = (s = !0, e, r) => {
|
|
238
236
|
const a = s ? "" : 'style="display: none;"';
|
|
239
237
|
if (e) {
|
|
240
|
-
const i = "font-size: 14px;", n =
|
|
238
|
+
const i = "font-size: 14px;", n = A(r || "", "text-align") || "center", o = L(r || i);
|
|
241
239
|
return `
|
|
242
240
|
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
243
241
|
width="100%" align="${n}"
|
|
@@ -249,7 +247,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
249
247
|
width="100%"
|
|
250
248
|
path="1"
|
|
251
249
|
style="${o}">
|
|
252
|
-
${
|
|
250
|
+
${U}
|
|
253
251
|
</p>
|
|
254
252
|
</td>`;
|
|
255
253
|
}
|
|
@@ -266,13 +264,13 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
266
264
|
data-slot-3
|
|
267
265
|
contenteditable="false"
|
|
268
266
|
width="100%">
|
|
269
|
-
${
|
|
267
|
+
${U}
|
|
270
268
|
</p>
|
|
271
269
|
</${b.BLOCK_TEXT}>
|
|
272
270
|
`;
|
|
273
271
|
}, lt = (s, e, r = "Buy", a, i, n = !0, o = !0) => {
|
|
274
272
|
if (a) {
|
|
275
|
-
const c =
|
|
273
|
+
const c = A(i || "", "background") || A(i || "", "background-color"), l = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", $ = n ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
|
|
276
274
|
return `
|
|
277
275
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
278
276
|
align="center" width="100%" name="buy-button" caption="${r}"
|
|
@@ -328,10 +326,10 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
328
326
|
}, it = (s) => s ? `<td align="center"
|
|
329
327
|
esd-extension-block-id="items-block" width="560"
|
|
330
328
|
data-number="4"
|
|
331
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : C, z = (s, e, r, a, i, n, o, c, l, $, t, E, _, u = "horizontal",
|
|
332
|
-
const
|
|
329
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : C, z = (s, e, r, a, i, n, o, c, l, $, t, E, _, u = "horizontal", w, p, R, d) => {
|
|
330
|
+
const I = `${`data-type="${e}" data-number="${r}"`} data-orientation="${a}"`, y = s.replace(
|
|
333
331
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
334
|
-
`<td$1 ${
|
|
332
|
+
`<td$1 ${I}>`
|
|
335
333
|
), X = l == null ? void 0 : l["data-product_image_control_image-height"], G = n ? Z(e, r, X, t) : J(e, r), K = (t == null ? void 0 : t.buttonLabel) || "Buy", B = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, W = e === x.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, Q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", k = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", f = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", H = y.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(n)).replace("{-{-PRODUCT_IMAGE-}-}", G).replace("{-{-PRODUCT_NAME-}-}", tt(e, n, a, E, t)).replaceAll(
|
|
336
334
|
"{-{-PRODUCT_PRICE-}-}",
|
|
337
335
|
V(et(
|
|
@@ -341,7 +339,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
341
339
|
o,
|
|
342
340
|
c,
|
|
343
341
|
n,
|
|
344
|
-
|
|
342
|
+
w,
|
|
345
343
|
d,
|
|
346
344
|
a,
|
|
347
345
|
k
|
|
@@ -387,7 +385,7 @@ function Tt({
|
|
|
387
385
|
priceStyles: E,
|
|
388
386
|
originalPriceStyles: _,
|
|
389
387
|
quantityStyles: u,
|
|
390
|
-
priceOrientation:
|
|
388
|
+
priceOrientation: w
|
|
391
389
|
}) {
|
|
392
390
|
const p = Y[e].findIndex((y) => y.value === r);
|
|
393
391
|
let R = "1";
|
|
@@ -398,10 +396,10 @@ function Tt({
|
|
|
398
396
|
y && y[1] && ([, R] = y);
|
|
399
397
|
}
|
|
400
398
|
const d = (l == null ? void 0 : l.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
401
|
-
|
|
402
|
-
const T =
|
|
403
|
-
d ? (
|
|
404
|
-
const
|
|
399
|
+
M = P.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[p >= 0 ? p : 0], D = P.PAIRS_FOR_EXTENSION.name[e].DEFAULT[p >= 0 ? p : 0];
|
|
400
|
+
const T = P.PAIRS_FOR_EXTENSION.price[e], h = P.PAIRS_FOR_EXTENSION.originalPrice[e];
|
|
401
|
+
d ? (N = o ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE, m = o ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (N = o ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE, m = o ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), U = P.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
|
|
402
|
+
const I = w || (l == null ? void 0 : l.priceOrientation) || "horizontal";
|
|
405
403
|
return s === x.ORIENTATION.VERTICAL ? z(
|
|
406
404
|
q,
|
|
407
405
|
e,
|
|
@@ -417,7 +415,7 @@ function Tt({
|
|
|
417
415
|
l,
|
|
418
416
|
$,
|
|
419
417
|
t,
|
|
420
|
-
|
|
418
|
+
I,
|
|
421
419
|
E,
|
|
422
420
|
_,
|
|
423
421
|
u,
|
|
@@ -437,7 +435,7 @@ function Tt({
|
|
|
437
435
|
l,
|
|
438
436
|
$,
|
|
439
437
|
t,
|
|
440
|
-
|
|
438
|
+
I,
|
|
441
439
|
E,
|
|
442
440
|
_,
|
|
443
441
|
u,
|
|
@@ -1,44 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
function m(t) {
|
|
3
|
-
try {
|
|
4
|
-
return decodeURIComponent(t);
|
|
5
|
-
} catch {
|
|
6
|
-
return t;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
function f(t) {
|
|
10
|
-
return t.split(",").filter(Boolean).map(m);
|
|
11
|
-
}
|
|
12
|
-
function y(t) {
|
|
1
|
+
function l(t) {
|
|
13
2
|
if (t.length === 0)
|
|
14
3
|
return "";
|
|
15
4
|
const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
|
|
16
|
-
const e = r.operator ===
|
|
5
|
+
const e = r.operator === "||", a = e ? "=" : r.operator, c = e ? decodeURIComponent(r.value).split(",").join("||") : r.value;
|
|
17
6
|
return `[${r.attribute}][${a}][${c}]`;
|
|
18
|
-
}), [
|
|
19
|
-
let n =
|
|
7
|
+
}), [s, ...p] = u;
|
|
8
|
+
let n = s;
|
|
20
9
|
for (let r = 0; r < p.length; r++) {
|
|
21
10
|
const e = o[r].innerGroupOperator;
|
|
22
11
|
n += `${e}${p[r]}`;
|
|
23
12
|
}
|
|
24
13
|
return `(${n})`;
|
|
25
14
|
}
|
|
26
|
-
function
|
|
15
|
+
function G(t) {
|
|
27
16
|
if (!t || t.length === 0)
|
|
28
17
|
return "";
|
|
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),
|
|
18
|
+
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), s = u.map((r) => {
|
|
30
19
|
const e = o[r];
|
|
31
|
-
return
|
|
32
|
-
}), [p, ...n] =
|
|
33
|
-
let
|
|
20
|
+
return l(e);
|
|
21
|
+
}), [p, ...n] = s;
|
|
22
|
+
let i = p;
|
|
34
23
|
for (let r = 0; r < n.length; r++) {
|
|
35
24
|
const e = u[r + 1], c = o[e][0].outerGroupOperator;
|
|
36
|
-
|
|
25
|
+
i += `${c}${n[r]}`;
|
|
37
26
|
}
|
|
38
|
-
return
|
|
27
|
+
return i.trim();
|
|
39
28
|
}
|
|
40
29
|
export {
|
|
41
|
-
|
|
42
|
-
f as parseTagList,
|
|
43
|
-
m as safeDecodeURIComponent
|
|
30
|
+
G as generateCompleteFilterQuery
|
|
44
31
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-
|
|
1
|
+
.gap-16[data-v-3b53a736],.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}.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-25780af6]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-25780af6]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-25780af6]{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-29b9af29] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-d073b1dc] .vueperslides__bullets{pointer-events:none!important}[data-v-d073b1dc] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -11,7 +11,6 @@ export declare const PriceAttributes: string[];
|
|
|
11
11
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
12
12
|
export declare const currencyOperators: TextValueObject[];
|
|
13
13
|
export declare const currencyDecimalCounts: TextValueObject[];
|
|
14
|
-
export declare const OP_ANY_OF = "||";
|
|
15
14
|
export declare const operatorOptionsForStrings: TextValueObject[];
|
|
16
15
|
export declare const operatorOptionsForArrayOfStrings: TextValueObject[];
|
|
17
16
|
export declare const operatorOptionsForNumbers: TextValueObject[];
|
|
@@ -12,6 +12,11 @@ export declare const URLS: {
|
|
|
12
12
|
UNSUBSCRIBE_URL: string;
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
16
|
+
readonly 60: "email";
|
|
17
|
+
readonly 49: "journey";
|
|
18
|
+
readonly 97: "email";
|
|
19
|
+
};
|
|
15
20
|
export declare const INSIDER_ID = "iid";
|
|
16
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
|
|
17
22
|
readonly name: "Global Unsubscribe";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { Filter } from '@@/Types/recommendation';
|
|
2
|
-
export declare function safeDecodeURIComponent(value: string): string;
|
|
3
|
-
export declare function parseTagList(value: string): string[];
|
|
4
2
|
/**
|
|
5
3
|
* Generates the complete query with outer group operators
|
|
6
4
|
* @param filters Array of Filter objects
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.78d83bd",
|
|
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",
|