@useinsider/guido 3.18.1 → 3.18.2-beta.320e07f
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/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +30 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -57
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +23 -37
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/composables/useCustomInterfaceAppearance.js +56 -46
- package/dist/composables/useHtmlValidator.js +87 -82
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useRecommendation.js +40 -35
- package/dist/composables/useStripo.js +30 -30
- package/dist/enums/extensions/recommendationBlock.js +38 -31
- package/dist/extensions/Blocks/Recommendation/block.js +43 -39
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +55 -44
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +84 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +190 -90
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +29 -28
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +17 -14
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +87 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/utils/genericUtil.d.ts +6 -0
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +34 -4
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/genericUtil.js +63 -54
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +61 -59
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useOnboardingApi as
|
|
2
|
-
import { defineStore as
|
|
1
|
+
import { useOnboardingApi as e } from "../services/onboardingApi.js";
|
|
2
|
+
import { defineStore as s } from "pinia";
|
|
3
3
|
const t = () => ({
|
|
4
4
|
cardIndex: 0,
|
|
5
5
|
isActive: !1,
|
|
@@ -11,49 +11,54 @@ const t = () => ({
|
|
|
11
11
|
textBlockOnboarding: t(),
|
|
12
12
|
versionHistoryOnboarding: t(),
|
|
13
13
|
ampOnboarding: t(),
|
|
14
|
-
itemsOnboarding: t()
|
|
14
|
+
itemsOnboarding: t(),
|
|
15
|
+
recommendationStrategyOnboarding: t()
|
|
15
16
|
},
|
|
16
17
|
userModalState: {},
|
|
17
18
|
isFetched: !1
|
|
18
|
-
}), c =
|
|
19
|
+
}), c = s("guidoOnboarding", {
|
|
19
20
|
state: () => a(),
|
|
20
21
|
getters: {
|
|
21
|
-
getOnboarding: (n) => (
|
|
22
|
-
isActive: (n) => (
|
|
23
|
-
getCurrentCard: (n) => (
|
|
24
|
-
const
|
|
25
|
-
return
|
|
22
|
+
getOnboarding: (n) => (o) => n.onboardings[o],
|
|
23
|
+
isActive: (n) => (o) => n.onboardings[o].isActive,
|
|
24
|
+
getCurrentCard: (n) => (o) => {
|
|
25
|
+
const i = n.onboardings[o];
|
|
26
|
+
return i.config[i.cardIndex];
|
|
26
27
|
},
|
|
27
28
|
getGenericCurrentCard: (n) => {
|
|
28
|
-
const { genericOnboarding:
|
|
29
|
-
return
|
|
29
|
+
const { genericOnboarding: o } = n.onboardings;
|
|
30
|
+
return o.config[o.cardIndex];
|
|
30
31
|
},
|
|
31
32
|
getTextBlockCurrentCard: (n) => {
|
|
32
|
-
const { textBlockOnboarding:
|
|
33
|
-
return
|
|
33
|
+
const { textBlockOnboarding: o } = n.onboardings;
|
|
34
|
+
return o.config[o.cardIndex];
|
|
34
35
|
},
|
|
35
36
|
getVersionHistoryCurrentCard: (n) => {
|
|
36
|
-
const { versionHistoryOnboarding:
|
|
37
|
-
return
|
|
37
|
+
const { versionHistoryOnboarding: o } = n.onboardings;
|
|
38
|
+
return o.config[o.cardIndex];
|
|
38
39
|
},
|
|
39
40
|
getAmpCurrentCard: (n) => {
|
|
40
|
-
const { ampOnboarding:
|
|
41
|
-
return
|
|
41
|
+
const { ampOnboarding: o } = n.onboardings;
|
|
42
|
+
return o.config[o.cardIndex];
|
|
42
43
|
},
|
|
43
44
|
getItemsCurrentCard: (n) => {
|
|
44
|
-
const { itemsOnboarding:
|
|
45
|
-
return
|
|
45
|
+
const { itemsOnboarding: o } = n.onboardings;
|
|
46
|
+
return o.config[o.cardIndex];
|
|
47
|
+
},
|
|
48
|
+
getRecommendationStrategyCurrentCard: (n) => {
|
|
49
|
+
const { recommendationStrategyOnboarding: o } = n.onboardings;
|
|
50
|
+
return o.config[o.cardIndex];
|
|
46
51
|
},
|
|
47
|
-
shouldShowOnboarding: (n) => (
|
|
48
|
-
const
|
|
49
|
-
return
|
|
52
|
+
shouldShowOnboarding: (n) => (o) => {
|
|
53
|
+
const i = n.userModalState.Guido;
|
|
54
|
+
return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
|
|
50
55
|
}
|
|
51
56
|
},
|
|
52
57
|
actions: {
|
|
53
58
|
closeOtherOnboardings(n) {
|
|
54
|
-
Object.keys(this.onboardings).forEach((
|
|
55
|
-
const
|
|
56
|
-
|
|
59
|
+
Object.keys(this.onboardings).forEach((o) => {
|
|
60
|
+
const i = o;
|
|
61
|
+
i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
|
|
57
62
|
});
|
|
58
63
|
},
|
|
59
64
|
start(n) {
|
|
@@ -71,12 +76,12 @@ const t = () => ({
|
|
|
71
76
|
previous(n) {
|
|
72
77
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
73
78
|
},
|
|
74
|
-
updateCardPosition(n,
|
|
75
|
-
const r = this.onboardings[n].config[
|
|
76
|
-
r && (r.top =
|
|
79
|
+
updateCardPosition(n, o, i) {
|
|
80
|
+
const r = this.onboardings[n].config[o];
|
|
81
|
+
r && (r.top = i.top, r.position = i.position);
|
|
77
82
|
},
|
|
78
|
-
setConfig(n,
|
|
79
|
-
this.onboardings[n].config =
|
|
83
|
+
setConfig(n, o) {
|
|
84
|
+
this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
80
85
|
},
|
|
81
86
|
async onDiscoverNowClicked() {
|
|
82
87
|
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
@@ -93,16 +98,16 @@ const t = () => ({
|
|
|
93
98
|
async fetchUserModalState() {
|
|
94
99
|
if (this.isFetched)
|
|
95
100
|
return;
|
|
96
|
-
const { fetchUserModalState: n } =
|
|
101
|
+
const { fetchUserModalState: n } = e();
|
|
97
102
|
try {
|
|
98
|
-
const
|
|
99
|
-
this.userModalState =
|
|
103
|
+
const o = await n();
|
|
104
|
+
this.userModalState = o, this.isFetched = !0;
|
|
100
105
|
} catch {
|
|
101
106
|
}
|
|
102
107
|
},
|
|
103
|
-
async setUserModalState(n,
|
|
104
|
-
const { setUserModalState: r } =
|
|
105
|
-
await r(n,
|
|
108
|
+
async setUserModalState(n, o, i) {
|
|
109
|
+
const { setUserModalState: r } = e();
|
|
110
|
+
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
});
|
|
@@ -1,69 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { formatToLiquidFilter as b, quoteArgument as y, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
|
|
2
|
+
const g = (t) => {
|
|
3
|
+
if (!t.includes("="))
|
|
4
|
+
return null;
|
|
5
|
+
const [r, e] = t.split("=");
|
|
6
|
+
return { key: r.trim(), value: e.trim() };
|
|
7
|
+
}, c = "default:", f = (t) => {
|
|
8
|
+
if (!t.startsWith(c))
|
|
9
|
+
return t;
|
|
10
|
+
const r = t.slice(c.length).trim(), e = (l) => r.length >= 2 && r.startsWith(l) && r.endsWith(l);
|
|
11
|
+
return e('"') || e("'") ? r.slice(1, -1) : r;
|
|
12
|
+
}, k = (t) => {
|
|
13
|
+
const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [l] = e, s = {
|
|
3
14
|
text: t.label,
|
|
4
|
-
value:
|
|
15
|
+
value: l || ""
|
|
5
16
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [,
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
|
|
17
|
+
if (e.length >= 2) {
|
|
18
|
+
const [, a, n] = e;
|
|
19
|
+
if (a.startsWith(c))
|
|
20
|
+
s.fallback = f(a);
|
|
21
|
+
else {
|
|
22
|
+
const o = h(a) ?? g(a);
|
|
23
|
+
o ? s.format = o : n || (s.fallback = a), n && (s.fallback = f(n));
|
|
14
24
|
}
|
|
15
25
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
if (c) {
|
|
24
|
-
if (!a.fallback)
|
|
25
|
-
return {
|
|
26
|
-
label: a.text,
|
|
27
|
-
value: `{{ ${a.value} }}`
|
|
28
|
-
};
|
|
29
|
-
const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
|
-
return {
|
|
31
|
-
label: `${a.text} | ${a.fallback}`,
|
|
32
|
-
value: `{{ ${a.value} | default: ${r} }}`
|
|
33
|
-
};
|
|
34
|
-
}
|
|
26
|
+
return s;
|
|
27
|
+
}, p = (t) => {
|
|
28
|
+
const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
|
|
29
|
+
return e === null ? null : `${c} ${e}`;
|
|
30
|
+
}, v = (t) => {
|
|
31
|
+
const r = t.format ? b(t.format) : null, e = t.fallback ? p(t.fallback) : null, l = [t.value, r, e].filter(Boolean);
|
|
35
32
|
return {
|
|
36
|
-
label:
|
|
37
|
-
value:
|
|
33
|
+
label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
|
|
34
|
+
value: `{{ ${l.join(" | ")} }}`
|
|
38
35
|
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
}, i = (t, r = !1) => t.map((e) => r ? v(e) : e.format ? {
|
|
37
|
+
label: `${e.text} | ${e.format.key}=${e.format.value}`,
|
|
38
|
+
value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
|
|
39
|
+
} : {
|
|
40
|
+
label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
|
|
41
|
+
value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
|
|
42
|
+
}), $ = (t) => {
|
|
43
|
+
const r = [], e = /* @__PURE__ */ new Set(), l = (a) => {
|
|
44
|
+
Array.isArray(a) && a.forEach((n) => {
|
|
45
|
+
const o = [...n.children ?? [], ...n.select_items ?? []];
|
|
46
|
+
if (o.length > 0) {
|
|
47
|
+
l(o);
|
|
45
48
|
return;
|
|
46
49
|
}
|
|
47
|
-
const u =
|
|
48
|
-
u &&
|
|
50
|
+
const u = n.text || n.tag_text;
|
|
51
|
+
u && n.value && !e.has(n.value) && (e.add(n.value), r.push({ text: u, value: n.value }));
|
|
49
52
|
});
|
|
50
|
-
}, [
|
|
51
|
-
return s
|
|
52
|
-
},
|
|
53
|
-
const
|
|
53
|
+
}, [s] = Object.values(t ?? {});
|
|
54
|
+
return l(s), r;
|
|
55
|
+
}, d = (t, r, e = !1) => {
|
|
56
|
+
const l = new Set(t.map((a) => a.value)), s = r.filter((a) => l.has(a.value) ? !1 : (l.add(a.value), !0));
|
|
54
57
|
return [
|
|
55
|
-
...
|
|
56
|
-
...
|
|
58
|
+
...i(t, e),
|
|
59
|
+
...i(s, e)
|
|
57
60
|
];
|
|
58
|
-
},
|
|
61
|
+
}, F = () => {
|
|
59
62
|
var t;
|
|
60
63
|
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
61
|
-
},
|
|
64
|
+
}, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
|
|
65
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
66
|
+
return !1;
|
|
67
|
+
const r = Object.getPrototypeOf(t);
|
|
68
|
+
return r === Object.prototype || r === null;
|
|
69
|
+
};
|
|
62
70
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
T as asText,
|
|
72
|
+
d as buildMergeTagEntries,
|
|
73
|
+
i as dynamicContentToMergeTags,
|
|
74
|
+
$ as flattenDynamicContentList,
|
|
75
|
+
F as getCsrfToken,
|
|
76
|
+
x as isPlainObject,
|
|
77
|
+
k as mergeTagToDynamicContent
|
|
69
78
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const E = "time-format", r = "date", u = new RegExp(`^${r}\\s*:\\s*(?:"([^"]*)"|'([^']*)')$`), s = /%[-_0^#]?\d*[a-zA-Z%]/, c = new RegExp(s, "g"), l = /\b(?:Y{2,4}|M{2,4}|D{1,4}|d{3,4}|H{2}|h{2}|m{2}|s{2}|S{1,3}|A|a)\b/, T = (t) => t.includes('"') ? t.includes("'") ? null : `'${t}'` : `"${t}"`, i = (t) => s.test(t) && !l.test(t.replace(c, "")), R = (t) => {
|
|
2
|
+
if (t.key !== E || !i(t.value ?? ""))
|
|
3
|
+
return null;
|
|
4
|
+
const n = T(t.value);
|
|
5
|
+
return n === null ? null : `${r}: ${n}`;
|
|
6
|
+
}, _ = (t) => {
|
|
7
|
+
const [, n, o] = t.match(u) ?? [], e = n ?? o;
|
|
8
|
+
return e ? { key: E, value: e } : null;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
E as TIME_FORMAT_KEY,
|
|
12
|
+
R as formatToLiquidFilter,
|
|
13
|
+
_ as liquidFilterToFormat,
|
|
14
|
+
T as quoteArgument
|
|
15
|
+
};
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHtmlCompiler as
|
|
4
|
-
import { DEFAULT_CURRENCY as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
import { mapLegacyStrategy as
|
|
1
|
+
import { useActionsApi as R } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as k } from "../composables/useConfig.js";
|
|
3
|
+
import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
|
|
4
|
+
import { RRS_CONFIG_VERSION as U, DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as I } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
+
import { mapLegacyStrategy as x } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
|
-
import { parsePageList as
|
|
9
|
-
import { useDynamicContentStore as
|
|
10
|
-
import { useEditorStore as
|
|
8
|
+
import { parsePageList as L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
|
+
import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import { isPlainObject as v } from "./genericUtil.js";
|
|
13
|
+
import { assignTrackingIds as B } from "./linkTrackingIds.js";
|
|
14
|
+
function G(l) {
|
|
15
|
+
const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
16
|
return i.forEach((s) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
17
|
+
const r = s.getAttribute(A.PAGE_LIST);
|
|
18
|
+
r && t.push(...L(r));
|
|
18
19
|
}), [...new Set(t)];
|
|
19
20
|
}
|
|
20
|
-
async function M(
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
async function M(l) {
|
|
22
|
+
const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
23
|
+
if (a.length === 0)
|
|
23
24
|
return;
|
|
24
|
-
const i =
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
const s = t.getAttribute("recommendation-id"),
|
|
28
|
-
if (!Number.isFinite(
|
|
25
|
+
const i = I();
|
|
26
|
+
a.forEach((t) => {
|
|
27
|
+
var d, g, f, c, y, S;
|
|
28
|
+
const s = t.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
|
|
29
|
+
if (!Number.isFinite(r))
|
|
29
30
|
return;
|
|
30
31
|
const p = t.getAttribute("esd-ext-config");
|
|
31
32
|
if (!p)
|
|
@@ -36,28 +37,29 @@ async function M(m) {
|
|
|
36
37
|
} catch {
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
if (!
|
|
40
|
+
if (!v(e))
|
|
40
41
|
return;
|
|
41
|
-
const
|
|
42
|
+
const C = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
|
|
42
43
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
44
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
45
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy:
|
|
46
|
-
strategyId: e.strategyId ??
|
|
47
|
-
language: e.language ??
|
|
48
|
-
size: e.size ??
|
|
46
|
+
strategy: x(e.strategy) || (C ? "" : n.strategy),
|
|
47
|
+
strategyId: e.strategyId ?? n.strategyId,
|
|
48
|
+
language: e.language ?? n.language,
|
|
49
|
+
size: e.size ?? n.size,
|
|
49
50
|
// Spread the default arrays so each block gets a fresh reference
|
|
50
51
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
51
|
-
productIds: e.productIds ?? [...
|
|
52
|
-
filters: e.filters ?? [...
|
|
53
|
-
shuffleProducts: e.shuffleProducts ??
|
|
54
|
-
currencyCode: ((
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
productIds: e.productIds ?? [...n.productIds],
|
|
53
|
+
filters: e.filters ?? [...n.filters],
|
|
54
|
+
shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
|
|
55
|
+
currencyCode: ((d = e.currency) == null ? void 0 : d.code) ?? m.code,
|
|
56
|
+
currencySymbol: ((g = e.currency) == null ? void 0 : g.symbol) ?? m.symbol,
|
|
57
|
+
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? m.alignment,
|
|
58
|
+
currencyDecimalCount: ((c = e.currency) == null ? void 0 : c.decimalCount) ?? m.decimalCount,
|
|
59
|
+
currencyDecimalSeparator: ((y = e.currency) == null ? void 0 : y.decimalSeparator) ?? m.decimalSeparator,
|
|
60
|
+
currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? m.thousandSeparator
|
|
59
61
|
};
|
|
60
|
-
i.seedBlockUrlConfig(
|
|
62
|
+
i.seedBlockUrlConfig(r, o);
|
|
61
63
|
});
|
|
62
64
|
try {
|
|
63
65
|
await i.fetchRecommendationCreateData();
|
|
@@ -68,51 +70,51 @@ async function M(m) {
|
|
|
68
70
|
);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
+
const re = () => {
|
|
74
|
+
const l = z(), u = O(), a = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
|
|
73
75
|
return {
|
|
74
76
|
prepareTemplateDetails: async () => {
|
|
75
|
-
let { html:
|
|
77
|
+
let { html: o, css: d, syncModulesIds: g = [] } = await t();
|
|
76
78
|
if (e("linkTrackingIds"))
|
|
77
79
|
try {
|
|
78
|
-
const { html:
|
|
79
|
-
u.trackIdSessionFloor = H, F && (
|
|
80
|
-
} catch (
|
|
81
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: b, changed: F, nextSeq: H } = B(o, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (o = b, await s(b, d));
|
|
82
|
+
} catch (b) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", b);
|
|
82
84
|
}
|
|
83
|
-
const { html: f, ampHtml: c = "", ampErrors:
|
|
85
|
+
const { html: f, ampHtml: c = "", ampErrors: y = [] } = await i({
|
|
84
86
|
minimize: !0,
|
|
85
87
|
resetDataSavedFlag: !1
|
|
86
88
|
});
|
|
87
|
-
|
|
88
|
-
const { compiledHtml:
|
|
89
|
+
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(o);
|
|
90
|
+
const { compiledHtml: S, stats: h, appliedRules: w } = r(f), D = c && p(c).compiledHtml, E = l.getSelectedDynamicContentList, P = I(), T = G(o);
|
|
89
91
|
return console.debug("HTML Compilation Stats:", {
|
|
90
|
-
originalSize:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
92
|
+
originalSize: h.originalSize,
|
|
93
|
+
compiledSize: h.compiledSize,
|
|
94
|
+
reduction: `${h.reductionPercentage.toFixed(2)}%`,
|
|
93
95
|
appliedRules: w,
|
|
94
|
-
executionTime: `${
|
|
96
|
+
executionTime: `${h.executionTime.toFixed(2)}ms`
|
|
95
97
|
}), {
|
|
96
98
|
dynamicContentList: E,
|
|
97
|
-
compiledHtml:
|
|
98
|
-
rawHtml:
|
|
99
|
-
css:
|
|
99
|
+
compiledHtml: S,
|
|
100
|
+
rawHtml: o,
|
|
101
|
+
css: d,
|
|
100
102
|
ampHtml: D,
|
|
101
|
-
ampErrors:
|
|
103
|
+
ampErrors: y,
|
|
102
104
|
modules: g.map(Number),
|
|
103
105
|
recommendation: {
|
|
104
106
|
campaignUrls: P.recommendationCampaignUrls,
|
|
105
107
|
configs: {}
|
|
106
108
|
},
|
|
107
109
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
110
|
+
status: T.length > 0,
|
|
111
|
+
config: T
|
|
110
112
|
}
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
116
|
};
|
|
115
117
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
G as getHtmlReferencedUnsubscribePages,
|
|
119
|
+
re as useTemplatePreparation
|
|
118
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.2-beta.320e07f",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"author": "",
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
50
|
+
"@stripoinc/ui-editor-extensions": "3.10.0",
|
|
51
51
|
"@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
|
|
52
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
53
|
"@vueuse/core": "11.3.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@typescript-eslint/parser": "7.18.0",
|
|
78
78
|
"@useinsider/eslint-config": "1.5.3",
|
|
79
79
|
"@vitejs/plugin-vue2": "2.3.1",
|
|
80
|
-
"@vitest/coverage-v8": "
|
|
80
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
81
81
|
"eslint": "8.57.1",
|
|
82
82
|
"eslint-config-airbnb-base": "15.0.0",
|
|
83
83
|
"eslint-config-airbnb-typescript": "18.0.0",
|
|
@@ -90,17 +90,17 @@
|
|
|
90
90
|
"happy-dom": "15.11.7",
|
|
91
91
|
"husky": "9.1.7",
|
|
92
92
|
"msw": "2.10.3",
|
|
93
|
-
"nyc": "
|
|
93
|
+
"nyc": "18.0.0",
|
|
94
94
|
"sass": "1.69.7",
|
|
95
95
|
"typescript": "5.5.4",
|
|
96
96
|
"typescript-eslint": "8.26.0",
|
|
97
97
|
"vite-plugin-dts": "4.5.4",
|
|
98
98
|
"vite-plugin-istanbul": "7.0.0",
|
|
99
|
-
"vitest": "
|
|
99
|
+
"vitest": "4.1.11",
|
|
100
100
|
"vue-tsc": "2.2.10"
|
|
101
101
|
},
|
|
102
102
|
"overrides": {
|
|
103
|
-
"axios": "1.
|
|
103
|
+
"axios": "1.20.0",
|
|
104
104
|
"flatted": "3.4.2",
|
|
105
105
|
"micromatch": "4.0.8",
|
|
106
106
|
"path-to-regexp": "6.3.0"
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"guido": {
|
|
120
120
|
"stripo": {
|
|
121
|
-
"version": "2.
|
|
121
|
+
"version": "2.76.0"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|