@useinsider/guido 3.18.2-beta.f42547e → 3.18.2-beta.ff43aaa
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 +11 -13
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -70
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/composables/useCustomInterfaceAppearance.js +46 -56
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useRecommendation.js +35 -40
- package/dist/composables/useStripo.js +30 -30
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -189
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -7
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -75
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
- package/dist/stores/onboarding.js +36 -41
- package/dist/utils/genericUtil.js +64 -61
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +55 -55
- package/package.json +1 -1
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
- package/dist/static/styles/components/skeleton.css.js +0 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useOnboardingApi as
|
|
2
|
-
import { defineStore as
|
|
1
|
+
import { useOnboardingApi as s } from "../services/onboardingApi.js";
|
|
2
|
+
import { defineStore as e } from "pinia";
|
|
3
3
|
const t = () => ({
|
|
4
4
|
cardIndex: 0,
|
|
5
5
|
isActive: !1,
|
|
@@ -11,54 +11,49 @@ const t = () => ({
|
|
|
11
11
|
textBlockOnboarding: t(),
|
|
12
12
|
versionHistoryOnboarding: t(),
|
|
13
13
|
ampOnboarding: t(),
|
|
14
|
-
itemsOnboarding: t()
|
|
15
|
-
recommendationStrategyOnboarding: t()
|
|
14
|
+
itemsOnboarding: t()
|
|
16
15
|
},
|
|
17
16
|
userModalState: {},
|
|
18
17
|
isFetched: !1
|
|
19
|
-
}), c =
|
|
18
|
+
}), c = e("guidoOnboarding", {
|
|
20
19
|
state: () => a(),
|
|
21
20
|
getters: {
|
|
22
|
-
getOnboarding: (n) => (
|
|
23
|
-
isActive: (n) => (
|
|
24
|
-
getCurrentCard: (n) => (
|
|
25
|
-
const
|
|
26
|
-
return
|
|
21
|
+
getOnboarding: (n) => (i) => n.onboardings[i],
|
|
22
|
+
isActive: (n) => (i) => n.onboardings[i].isActive,
|
|
23
|
+
getCurrentCard: (n) => (i) => {
|
|
24
|
+
const o = n.onboardings[i];
|
|
25
|
+
return o.config[o.cardIndex];
|
|
27
26
|
},
|
|
28
27
|
getGenericCurrentCard: (n) => {
|
|
29
|
-
const { genericOnboarding:
|
|
30
|
-
return
|
|
28
|
+
const { genericOnboarding: i } = n.onboardings;
|
|
29
|
+
return i.config[i.cardIndex];
|
|
31
30
|
},
|
|
32
31
|
getTextBlockCurrentCard: (n) => {
|
|
33
|
-
const { textBlockOnboarding:
|
|
34
|
-
return
|
|
32
|
+
const { textBlockOnboarding: i } = n.onboardings;
|
|
33
|
+
return i.config[i.cardIndex];
|
|
35
34
|
},
|
|
36
35
|
getVersionHistoryCurrentCard: (n) => {
|
|
37
|
-
const { versionHistoryOnboarding:
|
|
38
|
-
return
|
|
36
|
+
const { versionHistoryOnboarding: i } = n.onboardings;
|
|
37
|
+
return i.config[i.cardIndex];
|
|
39
38
|
},
|
|
40
39
|
getAmpCurrentCard: (n) => {
|
|
41
|
-
const { ampOnboarding:
|
|
42
|
-
return
|
|
40
|
+
const { ampOnboarding: i } = n.onboardings;
|
|
41
|
+
return i.config[i.cardIndex];
|
|
43
42
|
},
|
|
44
43
|
getItemsCurrentCard: (n) => {
|
|
45
|
-
const { itemsOnboarding:
|
|
46
|
-
return
|
|
47
|
-
},
|
|
48
|
-
getRecommendationStrategyCurrentCard: (n) => {
|
|
49
|
-
const { recommendationStrategyOnboarding: o } = n.onboardings;
|
|
50
|
-
return o.config[o.cardIndex];
|
|
44
|
+
const { itemsOnboarding: i } = n.onboardings;
|
|
45
|
+
return i.config[i.cardIndex];
|
|
51
46
|
},
|
|
52
|
-
shouldShowOnboarding: (n) => (
|
|
53
|
-
const
|
|
54
|
-
return
|
|
47
|
+
shouldShowOnboarding: (n) => (i) => {
|
|
48
|
+
const o = n.userModalState.Guido;
|
|
49
|
+
return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
|
|
55
50
|
}
|
|
56
51
|
},
|
|
57
52
|
actions: {
|
|
58
53
|
closeOtherOnboardings(n) {
|
|
59
|
-
Object.keys(this.onboardings).forEach((
|
|
60
|
-
const
|
|
61
|
-
|
|
54
|
+
Object.keys(this.onboardings).forEach((i) => {
|
|
55
|
+
const o = i;
|
|
56
|
+
o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
|
|
62
57
|
});
|
|
63
58
|
},
|
|
64
59
|
start(n) {
|
|
@@ -76,12 +71,12 @@ const t = () => ({
|
|
|
76
71
|
previous(n) {
|
|
77
72
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
78
73
|
},
|
|
79
|
-
updateCardPosition(n,
|
|
80
|
-
const r = this.onboardings[n].config[
|
|
81
|
-
r && (r.top =
|
|
74
|
+
updateCardPosition(n, i, o) {
|
|
75
|
+
const r = this.onboardings[n].config[i];
|
|
76
|
+
r && (r.top = o.top, r.position = o.position);
|
|
82
77
|
},
|
|
83
|
-
setConfig(n,
|
|
84
|
-
this.onboardings[n].config =
|
|
78
|
+
setConfig(n, i) {
|
|
79
|
+
this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
85
80
|
},
|
|
86
81
|
async onDiscoverNowClicked() {
|
|
87
82
|
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
@@ -98,16 +93,16 @@ const t = () => ({
|
|
|
98
93
|
async fetchUserModalState() {
|
|
99
94
|
if (this.isFetched)
|
|
100
95
|
return;
|
|
101
|
-
const { fetchUserModalState: n } =
|
|
96
|
+
const { fetchUserModalState: n } = s();
|
|
102
97
|
try {
|
|
103
|
-
const
|
|
104
|
-
this.userModalState =
|
|
98
|
+
const i = await n();
|
|
99
|
+
this.userModalState = i, this.isFetched = !0;
|
|
105
100
|
} catch {
|
|
106
101
|
}
|
|
107
102
|
},
|
|
108
|
-
async setUserModalState(n,
|
|
109
|
-
const { setUserModalState: r } =
|
|
110
|
-
await r(n,
|
|
103
|
+
async setUserModalState(n, i, o) {
|
|
104
|
+
const { setUserModalState: r } = s();
|
|
105
|
+
await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
|
|
111
106
|
}
|
|
112
107
|
}
|
|
113
108
|
});
|
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 = {
|
|
14
|
+
text: t.label,
|
|
15
|
+
value: l || ""
|
|
5
16
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [,
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
n ? r.format = n : l || (r.fallback = e), l && (r.fallback = l);
|
|
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 (!t.fallback)
|
|
25
|
-
return {
|
|
26
|
-
label: t.text,
|
|
27
|
-
value: `{{ ${t.value} }}`
|
|
28
|
-
};
|
|
29
|
-
const r = !Number.isNaN(Number(t.fallback)) && t.fallback.trim() !== "" ? t.fallback : `"${t.fallback}"`;
|
|
30
|
-
return {
|
|
31
|
-
label: `${t.text} | ${t.fallback}`,
|
|
32
|
-
value: `{{ ${t.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: t.
|
|
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
|
|
48
|
-
|
|
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
|
-
},
|
|
59
|
-
var
|
|
60
|
-
return ((
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
61
|
+
}, F = () => {
|
|
62
|
+
var t;
|
|
63
|
+
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
64
|
+
}, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
|
|
65
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
63
66
|
return !1;
|
|
64
|
-
const
|
|
65
|
-
return
|
|
67
|
+
const r = Object.getPrototypeOf(t);
|
|
68
|
+
return r === Object.prototype || r === null;
|
|
66
69
|
};
|
|
67
70
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
|
75
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,32 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHtmlCompiler as
|
|
4
|
-
import {
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
import { mapLegacyStrategy as
|
|
7
|
-
import { DATA_ATTRIBUTES as
|
|
8
|
-
import { parsePageList as
|
|
9
|
-
import { useDynamicContentStore as
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { useUnsubscribeStore as
|
|
12
|
-
import { isPlainObject as
|
|
13
|
-
import { assignTrackingIds as
|
|
14
|
-
function
|
|
15
|
-
const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${
|
|
16
|
-
return i.forEach((
|
|
17
|
-
const
|
|
18
|
-
|
|
1
|
+
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
|
+
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
+
import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
+
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
+
import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
|
+
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
|
+
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
+
import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
|
|
12
|
+
import { isPlainObject as _ } from "./genericUtil.js";
|
|
13
|
+
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
14
|
+
function M(l) {
|
|
15
|
+
const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), t = [];
|
|
16
|
+
return i.forEach((c) => {
|
|
17
|
+
const o = c.getAttribute(T.PAGE_LIST);
|
|
18
|
+
o && t.push(...R(o));
|
|
19
19
|
}), [...new Set(t)];
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
21
|
+
async function q(l) {
|
|
22
22
|
const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
23
23
|
if (a.length === 0)
|
|
24
24
|
return;
|
|
25
|
-
const i =
|
|
25
|
+
const i = A();
|
|
26
26
|
a.forEach((t) => {
|
|
27
|
-
var d, g, f,
|
|
28
|
-
const
|
|
29
|
-
if (!Number.isFinite(
|
|
27
|
+
var r, d, g, f, s, y;
|
|
28
|
+
const c = t.getAttribute("recommendation-id"), o = c ? Number(c) : NaN;
|
|
29
|
+
if (!Number.isFinite(o))
|
|
30
30
|
return;
|
|
31
31
|
const p = t.getAttribute("esd-ext-config");
|
|
32
32
|
if (!p)
|
|
@@ -37,13 +37,13 @@ async function M(l) {
|
|
|
37
37
|
} catch {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (!
|
|
40
|
+
if (!_(e))
|
|
41
41
|
return;
|
|
42
|
-
const
|
|
42
|
+
const b = {
|
|
43
43
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
44
44
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
45
45
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
46
|
-
strategy:
|
|
46
|
+
strategy: L(e.strategy) || n.strategy,
|
|
47
47
|
strategyId: e.strategyId ?? n.strategyId,
|
|
48
48
|
language: e.language ?? n.language,
|
|
49
49
|
size: e.size ?? n.size,
|
|
@@ -52,14 +52,14 @@ async function M(l) {
|
|
|
52
52
|
productIds: e.productIds ?? [...n.productIds],
|
|
53
53
|
filters: e.filters ?? [...n.filters],
|
|
54
54
|
shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
|
|
55
|
-
currencyCode: ((
|
|
56
|
-
currencySymbol: ((
|
|
57
|
-
currencyAlignment: ((
|
|
58
|
-
currencyDecimalCount: ((
|
|
59
|
-
currencyDecimalSeparator: ((
|
|
60
|
-
currencyThousandSeparator: ((
|
|
55
|
+
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? m.code,
|
|
56
|
+
currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
|
|
57
|
+
currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
|
|
58
|
+
currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
|
|
59
|
+
currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
|
|
60
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
|
|
61
61
|
};
|
|
62
|
-
i.seedBlockUrlConfig(
|
|
62
|
+
i.seedBlockUrlConfig(o, b);
|
|
63
63
|
});
|
|
64
64
|
try {
|
|
65
65
|
await i.fetchRecommendationCreateData();
|
|
@@ -70,51 +70,51 @@ async function M(l) {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
const l =
|
|
73
|
+
const te = () => {
|
|
74
|
+
const l = N(), u = z(), a = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: c } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
75
75
|
return {
|
|
76
76
|
prepareTemplateDetails: async () => {
|
|
77
|
-
let { html:
|
|
77
|
+
let { html: r, css: d, syncModulesIds: g = [] } = await t();
|
|
78
78
|
if (e("linkTrackingIds"))
|
|
79
79
|
try {
|
|
80
|
-
const { html:
|
|
81
|
-
u.trackIdSessionFloor = H, F && (
|
|
82
|
-
} catch (
|
|
83
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (r = h, await c(h, d));
|
|
82
|
+
} catch (h) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", h);
|
|
84
84
|
}
|
|
85
|
-
const { html: f, ampHtml:
|
|
85
|
+
const { html: f, ampHtml: s = "", ampErrors: y = [] } = await i({
|
|
86
86
|
minimize: !0,
|
|
87
87
|
resetDataSavedFlag: !1
|
|
88
88
|
});
|
|
89
|
-
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await
|
|
90
|
-
const { compiledHtml:
|
|
89
|
+
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await q(r);
|
|
90
|
+
const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, P = l.getSelectedDynamicContentList, E = A(), C = M(r);
|
|
91
91
|
return console.debug("HTML Compilation Stats:", {
|
|
92
|
-
originalSize:
|
|
93
|
-
compiledSize:
|
|
94
|
-
reduction: `${
|
|
92
|
+
originalSize: S.originalSize,
|
|
93
|
+
compiledSize: S.compiledSize,
|
|
94
|
+
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
95
95
|
appliedRules: w,
|
|
96
|
-
executionTime: `${
|
|
96
|
+
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
97
97
|
}), {
|
|
98
|
-
dynamicContentList:
|
|
99
|
-
compiledHtml:
|
|
100
|
-
rawHtml:
|
|
98
|
+
dynamicContentList: P,
|
|
99
|
+
compiledHtml: I,
|
|
100
|
+
rawHtml: r,
|
|
101
101
|
css: d,
|
|
102
102
|
ampHtml: D,
|
|
103
103
|
ampErrors: y,
|
|
104
104
|
modules: g.map(Number),
|
|
105
105
|
recommendation: {
|
|
106
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: E.recommendationCampaignUrls,
|
|
107
107
|
configs: {}
|
|
108
108
|
},
|
|
109
109
|
unsubscribe: {
|
|
110
|
-
status:
|
|
111
|
-
config:
|
|
110
|
+
status: C.length > 0,
|
|
111
|
+
config: C
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
M as getHtmlReferencedUnsubscribePages,
|
|
119
|
+
te as useTemplatePreparation
|
|
120
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.2-beta.
|
|
3
|
+
"version": "3.18.2-beta.ff43aaa",
|
|
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",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import d from "./RecommendationStrategyOnboarding.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import g from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var m = function() {
|
|
5
|
-
var e, n, r, i, a;
|
|
6
|
-
var t = this, s = t._self._c, o = t._self._setupProxy;
|
|
7
|
-
return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
|
|
8
|
-
return o.onboardingStore.close(o.ONBOARDING_TYPE);
|
|
9
|
-
}, nextButtonClick: o.handleNext } }) : t._e();
|
|
10
|
-
}, c = [], _ = /* @__PURE__ */ g(
|
|
11
|
-
d,
|
|
12
|
-
m,
|
|
13
|
-
c,
|
|
14
|
-
!1,
|
|
15
|
-
null,
|
|
16
|
-
"ec2027ff"
|
|
17
|
-
);
|
|
18
|
-
const S = _.exports;
|
|
19
|
-
export {
|
|
20
|
-
S as default
|
|
21
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, computed as p, watch as b } from "vue";
|
|
2
|
-
import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
|
|
3
|
-
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
|
|
5
|
-
import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
-
import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
|
|
7
|
-
import { InOnboard as y } from "@useinsider/design-system-vue";
|
|
8
|
-
const h = /* @__PURE__ */ g({
|
|
9
|
-
__name: "RecommendationStrategyOnboarding",
|
|
10
|
-
setup(C) {
|
|
11
|
-
const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
|
|
12
|
-
{
|
|
13
|
-
classes: "guido-recommendation-strategy-onboarding",
|
|
14
|
-
// Sits in the gap left of the settings panel and points at the strategy section, which
|
|
15
|
-
// starts 208px down: the panel header and its tab row are fixed chrome above it.
|
|
16
|
-
right: "426px",
|
|
17
|
-
top: r(208),
|
|
18
|
-
position: "Right Top",
|
|
19
|
-
title: e("email-editor.onboarding-recommendation-strategy-title"),
|
|
20
|
-
description: e("email-editor.onboarding-recommendation-strategy-description", {
|
|
21
|
-
academyLink: a
|
|
22
|
-
}),
|
|
23
|
-
imageSource: "",
|
|
24
|
-
backButtonClick: () => {
|
|
25
|
-
},
|
|
26
|
-
nextButtonType: "text",
|
|
27
|
-
nextButtonText: e("action-builder.ok"),
|
|
28
|
-
nextButtonClick: () => {
|
|
29
|
-
t.close(n);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
|
|
33
|
-
var o, s;
|
|
34
|
-
(s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
|
|
35
|
-
};
|
|
36
|
-
return b(
|
|
37
|
-
() => t.isActive(n),
|
|
38
|
-
(o) => {
|
|
39
|
-
o && t.setConfig(n, m());
|
|
40
|
-
},
|
|
41
|
-
{ immediate: !0 }
|
|
42
|
-
), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export {
|
|
46
|
-
h as default
|
|
47
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useRecommendationExtensionStore as s } from "../store/recommendation.js";
|
|
2
|
-
import { commitBlockChangeOutsidePanel as d } from "./nodeConfigWriter.js";
|
|
3
|
-
async function u(e, n) {
|
|
4
|
-
const t = s(), o = t.blockStates[e];
|
|
5
|
-
if (!o)
|
|
6
|
-
return !1;
|
|
7
|
-
const { strategyId: a, strategy: c, size: i } = o.recommendationConfigs;
|
|
8
|
-
if (t.currentRecommendationId === e)
|
|
9
|
-
try {
|
|
10
|
-
await t.fetchRecommendationProducts();
|
|
11
|
-
} catch (m) {
|
|
12
|
-
console.error("[recommendation] product refetch after a strategy change failed", m);
|
|
13
|
-
}
|
|
14
|
-
const r = d(
|
|
15
|
-
e,
|
|
16
|
-
{ strategyId: a, strategy: c, size: i },
|
|
17
|
-
o.recommendationProducts,
|
|
18
|
-
n
|
|
19
|
-
);
|
|
20
|
-
return r || console.error("[recommendation] strategy change did not reach a node", { blockId: e }), r;
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
u as commitStrategyChange
|
|
24
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Writes a strategy change and its products straight to the document, without the settings panel.
|
|
3
|
-
*
|
|
4
|
-
* Every entry point is host-rendered UI outside `ui-editor`, and none of them can rely on the
|
|
5
|
-
* panel control: opening the strategy page deselects the block, so by the time the user comes back
|
|
6
|
-
* and presses Assign the control — and with it the subscription that does the node write, the
|
|
7
|
-
* product fetch and the repaint — is gone. The assignment then reaches Pinia and nothing else
|
|
8
|
-
* (SD-149916).
|
|
9
|
-
*
|
|
10
|
-
* Call AFTER the store change (`assignStrategy` / `removeStrategy`).
|
|
11
|
-
* @param description - labels the undo entry
|
|
12
|
-
* @returns whether the write reached a node
|
|
13
|
-
*/
|
|
14
|
-
export declare function commitStrategyChange(blockId: number, description: string): Promise<boolean>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const e = `/*
|
|
2
|
-
* Mirrors the design system's InSkeleton 1:1 (gradient stops, 200% size, 1.6s linear).
|
|
3
|
-
* The Stripo panel lives in the editor's shadow root and is built from raw HTML strings,
|
|
4
|
-
* so the Vue component cannot be used there. Hex values are literal in the DS too.
|
|
5
|
-
*
|
|
6
|
-
* Base only: each panel sizes its own \`.guido-skeleton--*\` modifier to the footprint of
|
|
7
|
-
* the element it stands in for.
|
|
8
|
-
*/
|
|
9
|
-
.guido-skeleton {
|
|
10
|
-
display: none;
|
|
11
|
-
border-radius: 4px;
|
|
12
|
-
background: linear-gradient(90deg, #f0f0f0 39.5%, #e1e1e1 66.02%, #f0f0f0 89.42%);
|
|
13
|
-
background-size: 200% 100%;
|
|
14
|
-
animation: guido-skeleton-shine 1.6s linear infinite;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@keyframes guido-skeleton-shine {
|
|
18
|
-
to { background-position-x: -200%; }
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
export {
|
|
22
|
-
e as default
|
|
23
|
-
};
|