@useinsider/guido 3.4.1-beta.ea1fec9 → 3.4.1-beta.eecf662
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/config/migrator/checkboxMigrator.js +49 -55
- package/dist/config/migrator/radioButtonMigrator.js +75 -75
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +24 -16
- package/dist/guido.css +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
- package/dist/utils/templatePreparation.js +43 -51
- 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": "",
|
|
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"), validate: t.isValidFilterTag, 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
|
+
"5553d071"
|
|
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 R, computed as a } from "vue";
|
|
2
|
+
import { useTranslations as E } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as d, OP_ANY_OF as f } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as U } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { parseTagList as w, safeDecodeURIComponent as F, isValidFilterTag as M, encodeTagList as Y } from "../../../../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
6
|
+
import { getInvalidFilterFields as j } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
|
|
7
|
+
import { locale as q } from "../../../../utils/dateUtil.js";
|
|
8
|
+
import { InTags as z, InButtonV2 as G, InSelect as H, InDatePickerV2 as J, InBasicTextInput as K } from "@useinsider/design-system-vue";
|
|
9
|
+
import Q from "./LogicAdapter.vue.js";
|
|
10
|
+
import { useDebounceFn as W } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
11
|
+
const pe = /* @__PURE__ */ R({
|
|
12
12
|
__name: "FilterItem",
|
|
13
13
|
props: {
|
|
14
14
|
filter: null,
|
|
@@ -17,8 +17,8 @@ const se = /* @__PURE__ */ N({
|
|
|
17
17
|
submitted: { type: Boolean }
|
|
18
18
|
},
|
|
19
19
|
emits: ["delete-filter"],
|
|
20
|
-
setup(
|
|
21
|
-
const t =
|
|
20
|
+
setup(T, { emit: I }) {
|
|
21
|
+
const t = T, s = E(), l = U(), O = [
|
|
22
22
|
{
|
|
23
23
|
text: s("email-editor.standard-filter"),
|
|
24
24
|
value: "standardFilter"
|
|
@@ -26,79 +26,79 @@ const se = /* @__PURE__ */ N({
|
|
|
26
26
|
], u = [
|
|
27
27
|
{ text: "True", value: "true" },
|
|
28
28
|
{ text: "False", value: "false" }
|
|
29
|
-
], m =
|
|
29
|
+
], m = a(() => t.filter.attribute || ""), i = a(() => l.getFilterList.find((e) => e.value === m.value) || { text: "", value: "", type: "" }), h = a(
|
|
30
30
|
() => {
|
|
31
31
|
var e;
|
|
32
32
|
return ((e = i.value) == null ? void 0 : e.type) === "Boolean";
|
|
33
33
|
}
|
|
34
|
-
), b =
|
|
34
|
+
), b = a(() => {
|
|
35
35
|
var e;
|
|
36
|
-
return
|
|
37
|
-
}), A =
|
|
36
|
+
return d((e = i.value) == null ? void 0 : e.type).find((r) => r.value === t.filter.operator);
|
|
37
|
+
}), A = a(
|
|
38
38
|
() => u.find((e) => e.value === t.filter.value) || u[0]
|
|
39
|
-
), p =
|
|
39
|
+
), p = a(() => t.submitted ? j(t.filter) : /* @__PURE__ */ new Set()), x = (e) => p.value.has(e) ? "error" : "default", B = a(
|
|
40
40
|
() => p.value.has("value") ? s("action-builder.filter-empty-value-error") : ""
|
|
41
|
-
), v =
|
|
41
|
+
), v = a(
|
|
42
42
|
() => {
|
|
43
43
|
var e;
|
|
44
44
|
return ((e = i.value) == null ? void 0 : e.type) === "Number";
|
|
45
45
|
}
|
|
46
|
-
), D =
|
|
46
|
+
), D = a(() => v.value ? "number" : "text"), V = a(
|
|
47
47
|
() => {
|
|
48
48
|
var e;
|
|
49
49
|
return ((e = i.value) == null ? void 0 : e.type) === "Date";
|
|
50
50
|
}
|
|
51
|
-
), _ =
|
|
52
|
-
|
|
51
|
+
), _ = a(() => t.filter.operator === f), k = a(() => w(t.filter.value)), C = W((e) => {
|
|
52
|
+
l.updateFilter({
|
|
53
53
|
...t.filter,
|
|
54
54
|
[e.text]: e.value
|
|
55
55
|
});
|
|
56
|
-
}, 500),
|
|
57
|
-
const
|
|
58
|
-
|
|
56
|
+
}, 500), L = (e) => {
|
|
57
|
+
const r = l.getFilterList.find((c) => c.value === e.value), n = (r == null ? void 0 : r.type) === "Boolean", [o] = d(r == null ? void 0 : r.type);
|
|
58
|
+
l.updateFilter({
|
|
59
59
|
...t.filter,
|
|
60
60
|
attribute: e.value,
|
|
61
|
-
operator:
|
|
62
|
-
value:
|
|
61
|
+
operator: n ? "=" : (o == null ? void 0 : o.value) ?? "",
|
|
62
|
+
value: n ? "true" : ""
|
|
63
63
|
});
|
|
64
|
-
},
|
|
65
|
-
|
|
64
|
+
}, P = (e) => {
|
|
65
|
+
l.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 r = e.value;
|
|
72
|
+
if (r === t.filter.operator)
|
|
73
73
|
return;
|
|
74
|
-
const c = t.filter.operator ===
|
|
75
|
-
|
|
74
|
+
const c = t.filter.operator === f !== (r === f);
|
|
75
|
+
l.updateFilter({
|
|
76
76
|
...t.filter,
|
|
77
|
-
operator:
|
|
77
|
+
operator: r,
|
|
78
78
|
value: c ? "" : t.filter.value
|
|
79
79
|
});
|
|
80
|
-
}, $ =
|
|
81
|
-
const [
|
|
82
|
-
return !
|
|
83
|
-
},
|
|
84
|
-
const [
|
|
85
|
-
return !
|
|
86
|
-
},
|
|
87
|
-
() => y(
|
|
80
|
+
}, $ = q(), y = (e) => {
|
|
81
|
+
const [r, n, o] = e.split("-");
|
|
82
|
+
return !r || !n || !o ? "" : `${n}/${o}/${r}`;
|
|
83
|
+
}, g = (e) => {
|
|
84
|
+
const [r, n, o] = e.split("/");
|
|
85
|
+
return !o || !r || !n ? "" : `${o}-${r.padStart(2, "0")}-${n.padStart(2, "0")}`;
|
|
86
|
+
}, N = a(
|
|
87
|
+
() => y(F(t.filter.value))
|
|
88
88
|
);
|
|
89
|
-
return { __sfc: !0, trans: s, store:
|
|
90
|
-
|
|
89
|
+
return { __sfc: !0, trans: s, store: l, props: t, filterTypeOptions: O, booleanValueOptions: u, attributeType: m, selectedAttributeType: i, isBooleanAttribute: h, selectedOperatorType: b, selectedBooleanValue: A, emit: I, invalidFields: p, getFieldState: x, valueErrorMessage: B, isNumericAttribute: v, valueInputType: D, isDateAttribute: V, isAnyOfOperator: _, tagValues: k, updateFilter: C, handleAttributeChange: L, handleBooleanValueChange: P, handleOperatorChange: S, datePickerLocale: $, isoToPickerDate: y, pickerDateToIso: g, datePickerValue: N, onDatePickerApply: (e) => {
|
|
90
|
+
l.updateFilter({
|
|
91
91
|
...t.filter,
|
|
92
|
-
value: encodeURIComponent(
|
|
92
|
+
value: encodeURIComponent(g(e))
|
|
93
93
|
});
|
|
94
94
|
}, onTagsInput: (e) => {
|
|
95
|
-
|
|
95
|
+
l.updateFilter({
|
|
96
96
|
...t.filter,
|
|
97
|
-
value: e
|
|
97
|
+
value: Y(e)
|
|
98
98
|
});
|
|
99
|
-
}, getOperatorOptions:
|
|
99
|
+
}, getOperatorOptions: d, isValidFilterTag: M, safeDecodeURIComponent: F, InBasicTextInput: K, InDatePickerV2: J, InSelect: H, InButtonV2: G, InTags: z, LogicAdapter: Q };
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
pe as default
|
|
104
104
|
};
|
|
@@ -1,91 +1,85 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
class O {
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var y = (s, t, e) => t in s ? x(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var m = (s, t, e) => y(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import b from "../../extensions/Blocks/Checkbox/template.js";
|
|
5
|
+
class f {
|
|
7
6
|
constructor() {
|
|
8
|
-
|
|
7
|
+
m(this, "parser");
|
|
9
8
|
this.parser = new DOMParser();
|
|
10
9
|
}
|
|
11
10
|
migrate(t) {
|
|
12
11
|
try {
|
|
13
|
-
const e = this.parser.parseFromString(t, "text/html"),
|
|
14
|
-
|
|
15
|
-
return t;
|
|
16
|
-
let s = !1;
|
|
17
|
-
return l.forEach((r) => {
|
|
12
|
+
const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll("td.checkbox-block");
|
|
13
|
+
return i.length === 0 ? t : (i.forEach((r) => {
|
|
18
14
|
if (r.classList.contains("checkbox-block-v2"))
|
|
19
15
|
return;
|
|
20
|
-
const
|
|
21
|
-
`<table id="tempDoc"><tbody><tr>${
|
|
16
|
+
const n = r.getAttribute("id"), l = this.extractTextFromElement(r, "ins-title"), c = this.extractTextFromElement(r, "ins-description"), a = this.buildTextBlock(l), p = this.buildTextBlock(c), g = b.replace("{-{-TITLE-}-}", a).replace("{-{-DESCRIPTION-}-}", p), o = this.parser.parseFromString(
|
|
17
|
+
`<table id="tempDoc"><tbody><tr>${g}</tr></tbody></table>`,
|
|
22
18
|
"text/html"
|
|
23
19
|
).querySelector(".checkbox-block-v2");
|
|
24
|
-
|
|
25
|
-
}),
|
|
20
|
+
o && r.parentNode && (o.setAttribute("id", n || ""), r.parentNode.replaceChild(o, r));
|
|
21
|
+
}), e.documentElement.outerHTML);
|
|
26
22
|
} catch (e) {
|
|
27
23
|
return console.error("CheckboxMigrator failed:", e), t;
|
|
28
24
|
}
|
|
29
25
|
}
|
|
30
26
|
extractTextFromElement(t, e) {
|
|
31
|
-
var
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
27
|
+
var o, d;
|
|
28
|
+
const i = t.querySelector(`.${e}`);
|
|
29
|
+
if (!i)
|
|
34
30
|
return {
|
|
35
|
-
|
|
31
|
+
text: e === "ins-title" ? "Title" : "Description",
|
|
32
|
+
isBold: !1,
|
|
33
|
+
isItalic: !1,
|
|
36
34
|
align: "left",
|
|
37
|
-
|
|
35
|
+
styles: ""
|
|
38
36
|
};
|
|
39
|
-
const r =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const r = i.querySelector("p");
|
|
38
|
+
if (!r)
|
|
39
|
+
return {
|
|
40
|
+
text: ((o = i.textContent) == null ? void 0 : o.trim()) || (e === "ins-title" ? "Title" : "Description"),
|
|
43
41
|
isBold: !1,
|
|
44
42
|
isItalic: !1,
|
|
43
|
+
align: i.getAttribute("align") || "left",
|
|
45
44
|
styles: ""
|
|
46
|
-
}],
|
|
47
|
-
align: i,
|
|
48
|
-
classList: ""
|
|
49
|
-
} : { paragraphs: r.map((p) => {
|
|
50
|
-
const g = p.getAttribute("style") || "", u = L.test(g) || !!p.querySelector("b, strong"), h = R.test(g) || !!p.querySelector("i, em"), E = this.removeFontEmphasisProperties(g);
|
|
51
|
-
return {
|
|
52
|
-
// Legacy parity: empty <p> → fallback placeholder; <p><br></p> is not empty.
|
|
53
|
-
innerHtml: p.innerHTML.trim() || l,
|
|
54
|
-
isBold: u,
|
|
55
|
-
isItalic: h,
|
|
56
|
-
styles: this.convertInlineToBlock(E)
|
|
57
45
|
};
|
|
58
|
-
|
|
46
|
+
const n = ((d = r.textContent) == null ? void 0 : d.trim()) || (e === "ins-title" ? "Title" : "Description"), l = r.getAttribute("style") || "", c = i.getAttribute("align") || r.getAttribute("align") || "left", a = /font-weight\s*:\s*bold/i.test(l) || !!r.querySelector("b, strong"), p = /font-style\s*:\s*italic/i.test(l) || !!r.querySelector("i, em"), g = this.removeStyleProperties(l, ["font-weight", "font-style"]), u = this.convertInlineToBlock(g);
|
|
47
|
+
return {
|
|
48
|
+
text: n,
|
|
49
|
+
isBold: a,
|
|
50
|
+
isItalic: p,
|
|
51
|
+
align: c,
|
|
52
|
+
styles: u
|
|
53
|
+
};
|
|
59
54
|
}
|
|
60
55
|
buildTextBlock(t) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const m = s.isBold && !$.test(n), c = s.isItalic && !k.test(n);
|
|
65
|
-
m && c ? n = `<strong path="${i},0"><em path="${i},0,0">${n}</em></strong>` : m ? n = `<strong path="${i},0">${n}</strong>` : c && (n = `<em path="${i},0">${n}</em>`);
|
|
66
|
-
const a = s.styles ? ` style="${s.styles.replaceAll('"', "'")}"` : "";
|
|
67
|
-
return `<p path="${i}"${a}>${n}</p>`;
|
|
68
|
-
}).join(`
|
|
69
|
-
`);
|
|
56
|
+
let e = t.text;
|
|
57
|
+
t.isBold && t.isItalic ? e = `<strong path="1,0"><em path="1,0,0">${e}</em></strong>` : t.isBold ? e = `<strong path="1,0">${e}</strong>` : t.isItalic && (e = `<em path="1,0">${e}</em>`);
|
|
58
|
+
const i = t.align ? ` align="${t.align}"` : "", r = t.styles ? ` style="${t.styles}"` : "";
|
|
70
59
|
return `
|
|
71
|
-
<td class="esd-block-text
|
|
72
|
-
|
|
60
|
+
<td class="esd-block-text" ${i}>
|
|
61
|
+
<p path="1" ${r}>
|
|
62
|
+
${e}
|
|
63
|
+
</p>
|
|
73
64
|
</td>
|
|
74
65
|
`;
|
|
75
66
|
}
|
|
76
|
-
|
|
77
|
-
return t ?
|
|
67
|
+
removeStyleProperties(t, e) {
|
|
68
|
+
return t ? e.reduce((r, n) => {
|
|
69
|
+
const l = new RegExp(`${n}\\s*:\\s*[^;]*;?`, "gi");
|
|
70
|
+
return r.replace(l, "");
|
|
71
|
+
}, t).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
|
|
78
72
|
}
|
|
79
73
|
convertInlineToBlock(t) {
|
|
80
74
|
if (!t)
|
|
81
75
|
return "";
|
|
82
|
-
let e = t.replace(
|
|
83
|
-
return
|
|
76
|
+
let e = t.replace(/display\s*:\s*inline/gi, "display: block");
|
|
77
|
+
return /display\s*:/i.test(e) || (e = e ? `${e}; display: block` : "display: block"), e.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
|
-
function
|
|
87
|
-
return new
|
|
80
|
+
function k(s) {
|
|
81
|
+
return new f().migrate(s);
|
|
88
82
|
}
|
|
89
83
|
export {
|
|
90
|
-
|
|
84
|
+
k as migrateCheckbox
|
|
91
85
|
};
|
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
class H {
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var T = (l, e, t) => e in l ? x(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
|
+
var b = (l, e, t) => T(l, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import S from "../../extensions/Blocks/RadioButton/template.js";
|
|
5
|
+
class B {
|
|
7
6
|
constructor() {
|
|
8
|
-
|
|
7
|
+
b(this, "parser");
|
|
9
8
|
this.parser = new DOMParser();
|
|
10
9
|
}
|
|
11
|
-
migrate(
|
|
10
|
+
migrate(e) {
|
|
12
11
|
try {
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
let
|
|
17
|
-
return
|
|
12
|
+
const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll("td.radio-button-block"), i = t.querySelectorAll("td.radio-button-v2");
|
|
13
|
+
if (s.length === 0 && i.length === 0)
|
|
14
|
+
return e;
|
|
15
|
+
let o = !1;
|
|
16
|
+
return s.forEach((r) => {
|
|
18
17
|
if (r.classList.contains("radio-button-v2"))
|
|
19
18
|
return;
|
|
20
|
-
const
|
|
19
|
+
const n = r.getAttribute("id"), a = this.extractTextFromElement(r, "ins-title"), g = this.extractTextFromElement(r, "ins-description"), c = this.extractTextFromElement(r, "ins-subscribe"), u = this.extractTextFromElement(r, "ins-unsubscribe"), p = this.buildTextBlock(a), d = this.buildTextBlock(g), y = this.buildTextBlock({ ...c, classList: "" }), f = this.buildTextBlock({ ...u, classList: "" }), h = S.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", d).replace("{-{-YES-}-}", y).replace("{-{-NO-}-}", f), m = this.parser.parseFromString(
|
|
21
20
|
`<table id="tempDoc"><tbody><tr>${h}</tr></tbody></table>`,
|
|
22
21
|
"text/html"
|
|
23
22
|
).querySelector(".radio-button-v2");
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
} catch (
|
|
27
|
-
return console.error("RadioButtonMigrator failed:",
|
|
23
|
+
m && r.parentNode && (m.setAttribute("id", n || ""), r.parentNode.replaceChild(m, r), o = !0);
|
|
24
|
+
}), o = this.healRadioButtonV2(t) || o, o ? t.documentElement.outerHTML : e;
|
|
25
|
+
} catch (t) {
|
|
26
|
+
return console.error("RadioButtonMigrator failed:", t), e;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
healRadioButtonV2(
|
|
31
|
-
let
|
|
32
|
-
return
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
29
|
+
healRadioButtonV2(e) {
|
|
30
|
+
let t = !1;
|
|
31
|
+
return e.querySelectorAll("td.radio-button-v2").forEach((s) => {
|
|
32
|
+
var d;
|
|
33
|
+
s.classList.contains("radio-button-block") || (s.classList.add("radio-button-block"), t = !0);
|
|
34
|
+
const i = s.querySelector("input#radioYes"), o = s.querySelector("input#radioNo");
|
|
35
|
+
if (!i || !o)
|
|
37
36
|
return;
|
|
38
|
-
const r = ((
|
|
39
|
-
if (!r && !
|
|
37
|
+
const r = ((d = i.parentElement) == null ? void 0 : d.querySelector(":scope > p")) || null;
|
|
38
|
+
if (!r && !i.hasAttribute("align"))
|
|
40
39
|
return;
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
40
|
+
const n = i.closest("tr"), a = o.closest("tr");
|
|
41
|
+
if (!n || !a || n === a || !n.parentNode)
|
|
43
42
|
return;
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
}),
|
|
43
|
+
const g = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", c = a.cloneNode(!0), u = c.querySelector("input#radioNo"), p = c.querySelector("p");
|
|
44
|
+
u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), p && (p.innerHTML = g), n.parentNode.replaceChild(c, n), t = !0;
|
|
45
|
+
}), t;
|
|
47
46
|
}
|
|
48
|
-
extractTextFromElement(
|
|
49
|
-
var
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
47
|
+
extractTextFromElement(e, t) {
|
|
48
|
+
var d, y;
|
|
49
|
+
const s = e.querySelector(`.${t}`);
|
|
50
|
+
if (!s)
|
|
52
51
|
return {
|
|
53
|
-
|
|
52
|
+
text: t === "ins-title" ? "Title" : "Description",
|
|
53
|
+
isBold: !1,
|
|
54
|
+
isItalic: !1,
|
|
54
55
|
align: "left",
|
|
56
|
+
styles: "",
|
|
55
57
|
classList: ""
|
|
56
58
|
};
|
|
57
|
-
const i =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const i = s.querySelector("p");
|
|
60
|
+
if (!i)
|
|
61
|
+
return {
|
|
62
|
+
text: ((d = s.textContent) == null ? void 0 : d.trim()) || (t === "ins-title" ? "Title" : "Description"),
|
|
61
63
|
isBold: !1,
|
|
62
64
|
isItalic: !1,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
classList: ""
|
|
67
|
-
} : { paragraphs: i.map((a) => {
|
|
68
|
-
const d = a.getAttribute("style") || "", m = B.test(d) || !!a.querySelector("b, strong"), T = $.test(d) || !!a.querySelector("i, em"), b = this.removeFontEmphasisProperties(d);
|
|
69
|
-
return {
|
|
70
|
-
// Legacy parity: empty <p> → fallback placeholder; <p><br></p> is not empty.
|
|
71
|
-
innerHtml: a.innerHTML.trim() || o,
|
|
72
|
-
isBold: m,
|
|
73
|
-
isItalic: T,
|
|
74
|
-
styles: this.convertInlineToBlock(b)
|
|
65
|
+
align: s.getAttribute("align") || "left",
|
|
66
|
+
styles: "",
|
|
67
|
+
classList: ""
|
|
75
68
|
};
|
|
76
|
-
|
|
69
|
+
const o = ((y = i.textContent) == null ? void 0 : y.trim()) || (t === "ins-title" ? "Title" : "Description"), r = i.getAttribute("style") || "", n = s.getAttribute("align") || i.getAttribute("align") || "left", a = /font-weight\s*:\s*bold/i.test(r) || !!i.querySelector("b, strong"), g = /font-style\s*:\s*italic/i.test(r) || !!i.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), u = this.convertInlineToBlock(c), p = s.getAttribute("class") || "";
|
|
70
|
+
return {
|
|
71
|
+
text: o,
|
|
72
|
+
isBold: a,
|
|
73
|
+
isItalic: g,
|
|
74
|
+
align: n,
|
|
75
|
+
styles: u,
|
|
76
|
+
classList: p
|
|
77
|
+
};
|
|
77
78
|
}
|
|
78
|
-
buildTextBlock(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const c = n.isBold && !N.test(s), u = n.isItalic && !O.test(s);
|
|
83
|
-
c && u ? s = `<strong path="${r},0"><em path="${r},0,0">${s}</em></strong>` : c ? s = `<strong path="${r},0">${s}</strong>` : u && (s = `<em path="${r},0">${s}</em>`);
|
|
84
|
-
const l = n.styles ? ` style="${n.styles.replaceAll('"', "'")}"` : "";
|
|
85
|
-
return `<p path="${r}"${l}>${s}</p>`;
|
|
86
|
-
}).join(`
|
|
87
|
-
`);
|
|
79
|
+
buildTextBlock(e) {
|
|
80
|
+
let t = e.text;
|
|
81
|
+
e.isBold && e.isItalic ? t = `<strong path="1,0"><em path="1,0,0">${t}</em></strong>` : e.isBold ? t = `<strong path="1,0">${t}</strong>` : e.isItalic && (t = `<em path="1,0">${t}</em>`);
|
|
82
|
+
const s = e.align ? ` align="${e.align}"` : "", i = e.styles ? ` style="${e.styles.replaceAll('"', "'")}"` : "";
|
|
88
83
|
return `
|
|
89
|
-
<td class="esd-block-text ${
|
|
90
|
-
|
|
84
|
+
<td class="esd-block-text ${e.classList}" ${s}>
|
|
85
|
+
<p path="1" ${i}>
|
|
86
|
+
${t}
|
|
87
|
+
</p>
|
|
91
88
|
</td>
|
|
92
89
|
`;
|
|
93
90
|
}
|
|
94
|
-
|
|
95
|
-
return
|
|
91
|
+
removeStyleProperties(e, t) {
|
|
92
|
+
return e ? t.reduce((i, o) => {
|
|
93
|
+
const r = new RegExp(`${o}\\s*:\\s*[^;]*;?`, "gi");
|
|
94
|
+
return i.replace(r, "");
|
|
95
|
+
}, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
|
|
96
96
|
}
|
|
97
|
-
convertInlineToBlock(
|
|
98
|
-
if (!
|
|
97
|
+
convertInlineToBlock(e) {
|
|
98
|
+
if (!e)
|
|
99
99
|
return "";
|
|
100
|
-
let
|
|
101
|
-
return
|
|
100
|
+
let t = e.replace(/display\s*:\s*inline/gi, "display: block");
|
|
101
|
+
return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return new
|
|
104
|
+
function L(l) {
|
|
105
|
+
return new B().migrate(l);
|
|
106
106
|
}
|
|
107
107
|
export {
|
|
108
|
-
|
|
108
|
+
L as migrateRadioButton
|
|
109
109
|
};
|
|
@@ -9,36 +9,44 @@ function m(t) {
|
|
|
9
9
|
function f(t) {
|
|
10
10
|
return t.split(",").filter(Boolean).map(m);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function G(t) {
|
|
13
|
+
return t.map(encodeURIComponent).join(",");
|
|
14
|
+
}
|
|
15
|
+
function Q(t) {
|
|
16
|
+
return t.trim().length > 0;
|
|
17
|
+
}
|
|
18
|
+
function d(t) {
|
|
13
19
|
if (t.length === 0)
|
|
14
20
|
return "";
|
|
15
21
|
const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
|
|
16
|
-
const e = r.operator === l, a = e ? "=" : r.operator,
|
|
17
|
-
return `[${r.attribute}][${encodeURIComponent(a)}][${
|
|
18
|
-
}), [
|
|
19
|
-
let n =
|
|
20
|
-
for (let r = 0; r <
|
|
22
|
+
const e = r.operator === l, a = e ? "=" : r.operator, s = e ? f(r.value).join(l) : r.value;
|
|
23
|
+
return `[${r.attribute}][${encodeURIComponent(a)}][${s}]`;
|
|
24
|
+
}), [p, ...i] = u;
|
|
25
|
+
let n = p;
|
|
26
|
+
for (let r = 0; r < i.length; r++) {
|
|
21
27
|
const e = o[r].innerGroupOperator;
|
|
22
|
-
n += `${e}${
|
|
28
|
+
n += `${e}${i[r]}`;
|
|
23
29
|
}
|
|
24
30
|
return `(${n})`;
|
|
25
31
|
}
|
|
26
|
-
function
|
|
32
|
+
function F(t) {
|
|
27
33
|
if (!t || t.length === 0)
|
|
28
34
|
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),
|
|
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), p = u.map((r) => {
|
|
30
36
|
const e = o[r];
|
|
31
|
-
return
|
|
32
|
-
}), [
|
|
33
|
-
let
|
|
37
|
+
return d(e);
|
|
38
|
+
}), [i, ...n] = p;
|
|
39
|
+
let c = i;
|
|
34
40
|
for (let r = 0; r < n.length; r++) {
|
|
35
|
-
const e = u[r + 1],
|
|
36
|
-
|
|
41
|
+
const e = u[r + 1], s = o[e][0].outerGroupOperator;
|
|
42
|
+
c += `${s}${n[r]}`;
|
|
37
43
|
}
|
|
38
|
-
return
|
|
44
|
+
return c.trim();
|
|
39
45
|
}
|
|
40
46
|
export {
|
|
41
|
-
|
|
47
|
+
G as encodeTagList,
|
|
48
|
+
F as generateCompleteFilterQuery,
|
|
49
|
+
Q as isValidFilterTag,
|
|
42
50
|
f as parseTagList,
|
|
43
51
|
m as safeDecodeURIComponent
|
|
44
52
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.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}
|
|
@@ -1,6 +1,8 @@
|
|
|
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;
|
|
4
6
|
/**
|
|
5
7
|
* Generates the complete query with outer group operators
|
|
6
8
|
* @param filters Array of Filter objects
|
|
@@ -1,87 +1,79 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { DEFAULT_CURRENCY as
|
|
1
|
+
import { useActionsApi as T } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as C } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as a } 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 y } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { parsePageList as P } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
7
|
+
import { useDynamicContentStore as D } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useUnsubscribeStore as E } from "../stores/unsubscribe.js";
|
|
9
|
+
function U(i, r) {
|
|
10
|
+
const s = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${y.PAGE_LIST}]`), c = [];
|
|
11
|
+
return s.forEach((t) => {
|
|
12
|
+
const o = t.getAttribute(y.PAGE_LIST);
|
|
13
|
+
o && c.push(...P(o));
|
|
14
|
+
}), r.filter((t) => c.includes(t));
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
function F(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 d = b();
|
|
21
|
+
m.forEach((s) => {
|
|
22
|
+
var g, f, u, n, S;
|
|
23
|
+
const c = s.getAttribute("recommendation-id"), t = c ? Number(c) : NaN;
|
|
24
|
+
if (!Number.isFinite(t))
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
const o = s.getAttribute("esd-ext-config");
|
|
27
|
+
if (!o)
|
|
28
28
|
return;
|
|
29
29
|
let e;
|
|
30
30
|
try {
|
|
31
|
-
e = JSON.parse(
|
|
31
|
+
e = JSON.parse(o);
|
|
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 ?? a.strategy,
|
|
39
|
+
language: e.language ?? a.language,
|
|
40
|
+
size: e.size ?? a.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 ?? [...a.productIds],
|
|
44
|
+
filters: e.filters ?? [...a.filters],
|
|
45
|
+
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
46
|
+
currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? l.code,
|
|
47
|
+
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? l.alignment,
|
|
48
|
+
currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? l.decimalCount,
|
|
49
|
+
currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? l.decimalSeparator,
|
|
50
|
+
currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? l.thousandSeparator
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
d.seedBlockUrlConfig(t, 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
|
-
}
|
|
62
54
|
}
|
|
63
55
|
const _ = () => {
|
|
64
|
-
const i =
|
|
56
|
+
const i = D(), r = E(), { getCompiledEmail: m, getTemplateData: d } = T(), { compileHtml: s } = C();
|
|
65
57
|
return {
|
|
66
58
|
prepareTemplateDetails: async () => {
|
|
67
|
-
const { html:
|
|
59
|
+
const { html: t, ampHtml: o = "", ampErrors: e = [] } = await m({
|
|
68
60
|
minimize: !0,
|
|
69
61
|
resetDataSavedFlag: !1
|
|
70
|
-
}), { html: p, css: g, syncModulesIds: f = [] } = await
|
|
71
|
-
|
|
72
|
-
const { compiledHtml: u, stats: n, appliedRules:
|
|
62
|
+
}), { html: p, css: g, syncModulesIds: f = [] } = await d();
|
|
63
|
+
r.selectedUnsubscribePages.length && await r.fetchTemplates(), F(p);
|
|
64
|
+
const { compiledHtml: u, stats: n, appliedRules: S } = s(t), h = i.getSelectedDynamicContentList, A = b();
|
|
73
65
|
return console.debug("HTML Compilation Stats:", {
|
|
74
66
|
originalSize: n.originalSize,
|
|
75
67
|
compiledSize: n.compiledSize,
|
|
76
68
|
reduction: `${n.reductionPercentage.toFixed(2)}%`,
|
|
77
|
-
appliedRules:
|
|
69
|
+
appliedRules: S,
|
|
78
70
|
executionTime: `${n.executionTime.toFixed(2)}ms`
|
|
79
71
|
}), {
|
|
80
72
|
dynamicContentList: h,
|
|
81
73
|
compiledHtml: u,
|
|
82
74
|
rawHtml: p,
|
|
83
75
|
css: g,
|
|
84
|
-
ampHtml:
|
|
76
|
+
ampHtml: o,
|
|
85
77
|
ampErrors: e,
|
|
86
78
|
modules: f.map(Number),
|
|
87
79
|
recommendation: {
|
|
@@ -89,8 +81,8 @@ const _ = () => {
|
|
|
89
81
|
configs: {}
|
|
90
82
|
},
|
|
91
83
|
unsubscribe: {
|
|
92
|
-
status:
|
|
93
|
-
config:
|
|
84
|
+
status: r.unsubscribePagesStatus,
|
|
85
|
+
config: U(u, r.selectedUnsubscribePages)
|
|
94
86
|
}
|
|
95
87
|
};
|
|
96
88
|
}
|
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.eecf662",
|
|
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",
|