@useinsider/guido 3.4.1-beta.6a8f00a → 3.4.1-beta.6fad109
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 +1 -1
- package/dist/components/Guido.vue2.js +50 -48
- package/dist/composables/useRecommendation.js +33 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +9 -13
- package/dist/guido.css +1 -1
- package/dist/utils/templatePreparation.js +51 -43
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +0 -21
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +0 -7
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
1
|
+
import { defineComponent as Q, defineAsyncComponent as N, ref as I, computed as W, watch as X, onMounted as Y, onUnmounted as Z } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ee } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as te } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as ne } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as re } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as se } from "../composables/useTimerClone.js";
|
|
8
8
|
import { migrate as x } from "../config/migrator/index.js";
|
|
9
9
|
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
10
|
+
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import ie from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import me from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import le from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ue from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import fe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as ve } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as ye } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as H } from "../stores/editor.js";
|
|
22
23
|
import { usePreviewStore as he } from "../stores/preview.js";
|
|
23
|
-
import {
|
|
24
|
-
|
|
24
|
+
import { useTemplateStore as be } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
|
|
26
|
+
const Ke = /* @__PURE__ */ Q({
|
|
25
27
|
__name: "Guido",
|
|
26
28
|
props: {
|
|
27
29
|
config: null
|
|
28
30
|
},
|
|
29
31
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
30
|
-
setup(
|
|
31
|
-
const g =
|
|
32
|
+
setup($, { expose: z, emit: n }) {
|
|
33
|
+
const g = $, q = N(
|
|
32
34
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
33
|
-
), K =
|
|
35
|
+
), K = N(
|
|
34
36
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
35
|
-
),
|
|
37
|
+
), E = I(), u = I(), p = Se(), w = ge(), i = ye();
|
|
36
38
|
i.init(g.config);
|
|
37
|
-
const f =
|
|
39
|
+
const f = H(), V = he(), m = W(() => f.hasChanges), { isTestPartner: j } = ne(), D = () => {
|
|
38
40
|
var e;
|
|
39
|
-
return (e =
|
|
41
|
+
return (e = E.value) == null ? void 0 : e.handleSave(!0);
|
|
40
42
|
}, {
|
|
41
43
|
templateId: v,
|
|
42
44
|
userId: C,
|
|
@@ -45,8 +47,8 @@ const He = /* @__PURE__ */ J({
|
|
|
45
47
|
template: o,
|
|
46
48
|
editor: s
|
|
47
49
|
} = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || G.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || G.DEFAULT_MODULES;
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
+
ee(), te();
|
|
51
|
+
const S = {
|
|
50
52
|
emailId: v,
|
|
51
53
|
userId: C,
|
|
52
54
|
username: k,
|
|
@@ -58,11 +60,11 @@ const He = /* @__PURE__ */ J({
|
|
|
58
60
|
onReady: () => {
|
|
59
61
|
console.debug("guido:ready"), n("ready");
|
|
60
62
|
}
|
|
61
|
-
}, { initPlugin: M } =
|
|
63
|
+
}, { initPlugin: M } = re(S, _), { getDefaultTemplate: O } = ve(), { cloneTimersOnSave: P, hasTimerBlocks: R } = se(), J = W(() => {
|
|
62
64
|
var e;
|
|
63
65
|
return !((e = i.ui) != null && e.showHeader);
|
|
64
66
|
});
|
|
65
|
-
|
|
67
|
+
oe({
|
|
66
68
|
onBack: () => {
|
|
67
69
|
console.debug("guido:back"), n("back");
|
|
68
70
|
},
|
|
@@ -70,50 +72,50 @@ const He = /* @__PURE__ */ J({
|
|
|
70
72
|
console.debug("guido:save:start"), n("save:start");
|
|
71
73
|
},
|
|
72
74
|
onSaveComplete: (e) => {
|
|
73
|
-
const t = { ...e, metadata:
|
|
75
|
+
const t = { ...e, metadata: S };
|
|
74
76
|
console.debug("guido:save:complete", t), n("save:complete", t);
|
|
75
77
|
},
|
|
76
78
|
onTestEmailClick: () => {
|
|
77
79
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
78
80
|
}
|
|
79
81
|
});
|
|
80
|
-
const
|
|
82
|
+
const A = (e) => {
|
|
81
83
|
console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
82
|
-
},
|
|
84
|
+
}, B = () => {
|
|
83
85
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
84
86
|
};
|
|
85
|
-
|
|
87
|
+
X(() => m.value, () => {
|
|
86
88
|
n("on-change", m.value);
|
|
87
89
|
});
|
|
88
|
-
const
|
|
90
|
+
const h = (e) => {
|
|
89
91
|
const t = e, { attribute: l, position: a } = t.detail;
|
|
90
92
|
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
|
|
91
93
|
};
|
|
92
94
|
let c = null;
|
|
93
95
|
const b = () => {
|
|
94
96
|
var t;
|
|
95
|
-
const e = document.querySelector(
|
|
97
|
+
const e = document.querySelector(ce);
|
|
96
98
|
(t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
97
99
|
};
|
|
98
|
-
return
|
|
100
|
+
return Y(async () => {
|
|
99
101
|
var t, l;
|
|
100
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
|
|
102
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), H().$reset(), f.templateId = v, be().$reset(), b();
|
|
101
103
|
const e = (t = u.value) == null ? void 0 : t.parentElement;
|
|
102
104
|
e && (c = new ResizeObserver(b), c.observe(e));
|
|
103
105
|
try {
|
|
104
|
-
|
|
106
|
+
w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
105
107
|
const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
|
|
106
108
|
let r = {
|
|
107
109
|
html: d && await x(d, a),
|
|
108
110
|
css: F
|
|
109
111
|
};
|
|
110
|
-
r.html || (r = await O(), r.html = await x(r.html, a)),
|
|
112
|
+
r.html || (r = await O(), r.html = await x(r.html, a)), R(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
|
|
111
113
|
} catch (a) {
|
|
112
114
|
console.error("Failed to initialize Stripo editor:", a);
|
|
113
115
|
}
|
|
114
|
-
document.addEventListener("dynamic-content:open",
|
|
115
|
-
}),
|
|
116
|
-
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
116
|
+
document.addEventListener("dynamic-content:open", h);
|
|
117
|
+
}), Z(() => {
|
|
118
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", h);
|
|
117
119
|
try {
|
|
118
120
|
window.UIEditor.removeEditor();
|
|
119
121
|
} catch {
|
|
@@ -122,14 +124,14 @@ const He = /* @__PURE__ */ J({
|
|
|
122
124
|
i.reset();
|
|
123
125
|
}), z({
|
|
124
126
|
dynamicContent: {
|
|
125
|
-
insert:
|
|
126
|
-
close:
|
|
127
|
+
insert: A,
|
|
128
|
+
close: B
|
|
127
129
|
},
|
|
128
130
|
hasChanges: m,
|
|
129
131
|
saveSilent: D
|
|
130
|
-
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef:
|
|
132
|
+
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: E, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: w, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: S, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: R, noHeader: J, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: h, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: ie, Toaster: me, FilterSelectionDrawer: de, HeaderWrapper: le, LoadingWrapper: ue, SaveAsTemplateDrawer: pe, UnsubscribeWrapper: fe };
|
|
131
133
|
}
|
|
132
134
|
});
|
|
133
135
|
export {
|
|
134
|
-
|
|
136
|
+
Ke as default
|
|
135
137
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as I, URLS as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
-
import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
5
|
import { useConfigStore as x } from "../stores/config.js";
|
|
7
|
-
const
|
|
6
|
+
const w = () => ({
|
|
8
7
|
calculateCardWidth: ({
|
|
9
8
|
mobileLeftPadding: s,
|
|
10
9
|
mobileRightPadding: a,
|
|
11
10
|
cardsInRow: c,
|
|
12
|
-
unresponsive:
|
|
11
|
+
unresponsive: n
|
|
13
12
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return (
|
|
13
|
+
const r = n ? c : 1, e = s + a + (r - 1) * b;
|
|
14
|
+
return (R - e) / r;
|
|
16
15
|
},
|
|
17
16
|
getRecommendationCampaignData: (s) => {
|
|
18
|
-
const a =
|
|
19
|
-
if (!
|
|
17
|
+
const a = m(), c = Number(s), n = a.blockStates[c];
|
|
18
|
+
if (!n)
|
|
20
19
|
return {
|
|
21
20
|
textTrimming: !1,
|
|
22
21
|
orientation: "vertical",
|
|
@@ -29,14 +28,14 @@ const A = () => ({
|
|
|
29
28
|
discountBeforeTextValue: "",
|
|
30
29
|
discountAfterTextValue: ""
|
|
31
30
|
};
|
|
32
|
-
const { recommendationConfigs:
|
|
31
|
+
const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
33
32
|
return {
|
|
34
|
-
textTrimming:
|
|
33
|
+
textTrimming: r.textTrimming,
|
|
35
34
|
orientation: e,
|
|
36
35
|
mobileLeftPadding: 0,
|
|
37
36
|
mobileRightPadding: 0,
|
|
38
|
-
cardsInRow:
|
|
39
|
-
unresponsive:
|
|
37
|
+
cardsInRow: r.cardsInRow,
|
|
38
|
+
unresponsive: r.unresponsive,
|
|
40
39
|
priceBeforeTextValue: "",
|
|
41
40
|
priceAfterTextValue: "",
|
|
42
41
|
discountBeforeTextValue: "",
|
|
@@ -44,38 +43,38 @@ const A = () => ({
|
|
|
44
43
|
};
|
|
45
44
|
},
|
|
46
45
|
buildCampaignUrl: (s, a) => {
|
|
47
|
-
var
|
|
48
|
-
const c =
|
|
46
|
+
var l;
|
|
47
|
+
const c = m(), n = x(), r = Number(s);
|
|
49
48
|
let e;
|
|
50
49
|
if (a)
|
|
51
50
|
e = a;
|
|
52
51
|
else {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
52
|
+
const i = c.blockStates[r];
|
|
53
|
+
if (!i)
|
|
55
54
|
return "";
|
|
56
|
-
const { recommendationConfigs:
|
|
55
|
+
const { recommendationConfigs: o } = i;
|
|
57
56
|
e = {
|
|
58
|
-
strategy:
|
|
59
|
-
language:
|
|
60
|
-
currencyCode:
|
|
61
|
-
size:
|
|
62
|
-
productIds:
|
|
63
|
-
filters:
|
|
64
|
-
shuffleProducts:
|
|
57
|
+
strategy: o.strategy,
|
|
58
|
+
language: o.language,
|
|
59
|
+
currencyCode: o.currencySettings.value,
|
|
60
|
+
size: o.size,
|
|
61
|
+
productIds: o.productIds,
|
|
62
|
+
filters: o.filters,
|
|
63
|
+
shuffleProducts: o.shuffleProducts
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
|
-
const f = ((
|
|
68
|
-
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
69
|
-
const
|
|
70
|
-
t.set("productId", e.productIds.slice(0,
|
|
66
|
+
const f = ((l = I().find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
67
|
+
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising") {
|
|
68
|
+
const i = parseInt(e.size) || 6;
|
|
69
|
+
t.set("productId", e.productIds.slice(0, i).join(","));
|
|
71
70
|
} else e.strategy === "similarViewed" && t.set("productId", "{itemId}");
|
|
72
71
|
e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
73
|
-
const g = e.filters.filter((
|
|
74
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true")
|
|
75
|
-
const p = decodeURIComponent(t.toString()), u = `${
|
|
72
|
+
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
73
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
|
|
74
|
+
const p = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
76
75
|
return c.recommendationCampaignUrls[s] = u, u;
|
|
77
76
|
}
|
|
78
77
|
});
|
|
79
78
|
export {
|
|
80
|
-
|
|
79
|
+
w as useRecommendation
|
|
81
80
|
};
|
|
@@ -6,9 +6,8 @@ import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
|
6
6
|
import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { isConfigValid as N } from "../validation/requiredFields.js";
|
|
9
|
+
import { isFilterValid as w } from "../validation/filterSchema.js";
|
|
10
|
+
import { isConfigValid as v } from "../validation/requiredFields.js";
|
|
12
11
|
const h = C();
|
|
13
12
|
let m = null, u = null, d = null;
|
|
14
13
|
function k() {
|
|
@@ -50,7 +49,7 @@ function I() {
|
|
|
50
49
|
filterSnapshot: null
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
|
-
const
|
|
52
|
+
const N = () => ({
|
|
54
53
|
recommendationCampaignUrls: {},
|
|
55
54
|
activePredictiveAlgorithms: [],
|
|
56
55
|
languages: {},
|
|
@@ -59,8 +58,8 @@ const x = () => ({
|
|
|
59
58
|
blockStates: {},
|
|
60
59
|
currentRecommendationId: null,
|
|
61
60
|
configVersion: 0
|
|
62
|
-
}),
|
|
63
|
-
state: () =>
|
|
61
|
+
}), M = P("guidoRecommendationExtension", {
|
|
62
|
+
state: () => N(),
|
|
64
63
|
getters: {
|
|
65
64
|
// ====================================================================
|
|
66
65
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -360,7 +359,7 @@ const x = () => ({
|
|
|
360
359
|
const n = [...e.recommendationConfigs.filters];
|
|
361
360
|
n[r] = {
|
|
362
361
|
...t,
|
|
363
|
-
isValid:
|
|
362
|
+
isValid: w(t)
|
|
364
363
|
}, e.recommendationConfigs.filters = n;
|
|
365
364
|
}
|
|
366
365
|
},
|
|
@@ -406,7 +405,7 @@ const x = () => ({
|
|
|
406
405
|
* every block's recommendationConfigs across user edits.
|
|
407
406
|
*/
|
|
408
407
|
hasInvalidBlock() {
|
|
409
|
-
return Object.values(this.blockStates).some((t) => !
|
|
408
|
+
return Object.values(this.blockStates).some((t) => !v(t.recommendationConfigs, this));
|
|
410
409
|
},
|
|
411
410
|
// ====================================================================
|
|
412
411
|
// Per-Block Product Fetching
|
|
@@ -435,10 +434,7 @@ const x = () => ({
|
|
|
435
434
|
details: !0,
|
|
436
435
|
campaignId: o.variationId
|
|
437
436
|
};
|
|
438
|
-
r.strategy === "manualMerchandising" ? a.productId = r.productIds.slice(0, s).join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0)
|
|
439
|
-
a,
|
|
440
|
-
w(o.partnerName, r.strategy)
|
|
441
|
-
);
|
|
437
|
+
r.strategy === "manualMerchandising" ? a.productId = r.productIds.slice(0, s).join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0);
|
|
442
438
|
let f;
|
|
443
439
|
try {
|
|
444
440
|
f = await h.fetchRecommendationProducts(i, a);
|
|
@@ -456,5 +452,5 @@ const x = () => ({
|
|
|
456
452
|
}
|
|
457
453
|
});
|
|
458
454
|
export {
|
|
459
|
-
|
|
455
|
+
M as useRecommendationExtensionStore
|
|
460
456
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-8053a037],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-8053a037],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-b293a2b0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b293a2b0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b293a2b0]{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,79 +1,87 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { DEFAULT_CURRENCY as
|
|
1
|
+
import { useActionsApi as C } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as T } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
4
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
-
import { DATA_ATTRIBUTES as
|
|
6
|
-
import { parsePageList as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
}),
|
|
5
|
+
import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { parsePageList as D } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
7
|
+
import { useDynamicContentStore as P } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useUnsubscribeStore as w } from "../stores/unsubscribe.js";
|
|
9
|
+
function E(i, o) {
|
|
10
|
+
const t = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), c = [];
|
|
11
|
+
return t.forEach((r) => {
|
|
12
|
+
const a = r.getAttribute(S.PAGE_LIST);
|
|
13
|
+
a && c.push(...D(a));
|
|
14
|
+
}), o.filter((r) => c.includes(r));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
async function U(i) {
|
|
17
17
|
const m = new DOMParser().parseFromString(i, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
18
18
|
if (m.length === 0)
|
|
19
19
|
return;
|
|
20
|
-
const
|
|
21
|
-
m.forEach((
|
|
22
|
-
var g, f, u, n,
|
|
23
|
-
const c =
|
|
24
|
-
if (!Number.isFinite(
|
|
20
|
+
const l = b();
|
|
21
|
+
m.forEach((t) => {
|
|
22
|
+
var g, f, u, n, y;
|
|
23
|
+
const c = t.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
|
|
24
|
+
if (!Number.isFinite(r))
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
const a = t.getAttribute("esd-ext-config");
|
|
27
|
+
if (!a)
|
|
28
28
|
return;
|
|
29
29
|
let e;
|
|
30
30
|
try {
|
|
31
|
-
e = JSON.parse(
|
|
31
|
+
e = JSON.parse(a);
|
|
32
32
|
} catch {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
36
36
|
return;
|
|
37
37
|
const p = {
|
|
38
|
-
strategy: e.strategy ??
|
|
39
|
-
language: e.language ??
|
|
40
|
-
size: e.size ??
|
|
38
|
+
strategy: e.strategy ?? s.strategy,
|
|
39
|
+
language: e.language ?? s.language,
|
|
40
|
+
size: e.size ?? s.size,
|
|
41
41
|
// Spread the default arrays so each block gets a fresh reference
|
|
42
42
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
43
|
-
productIds: e.productIds ?? [...
|
|
44
|
-
filters: e.filters ?? [...
|
|
45
|
-
shuffleProducts: e.shuffleProducts ??
|
|
46
|
-
currencyCode: ((g = e.currency) == null ? void 0 : g.code) ??
|
|
47
|
-
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ??
|
|
48
|
-
currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ??
|
|
49
|
-
currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ??
|
|
50
|
-
currencyThousandSeparator: ((
|
|
43
|
+
productIds: e.productIds ?? [...s.productIds],
|
|
44
|
+
filters: e.filters ?? [...s.filters],
|
|
45
|
+
shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
|
|
46
|
+
currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? d.code,
|
|
47
|
+
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? d.alignment,
|
|
48
|
+
currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? d.decimalCount,
|
|
49
|
+
currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? d.decimalSeparator,
|
|
50
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
l.seedBlockUrlConfig(r, p);
|
|
53
53
|
});
|
|
54
|
+
try {
|
|
55
|
+
await l.fetchRecommendationCreateData();
|
|
56
|
+
} catch (t) {
|
|
57
|
+
console.warn(
|
|
58
|
+
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
59
|
+
t
|
|
60
|
+
);
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
const _ = () => {
|
|
56
|
-
const i =
|
|
64
|
+
const i = P(), o = w(), { getCompiledEmail: m, getTemplateData: l } = C(), { compileHtml: t } = T();
|
|
57
65
|
return {
|
|
58
66
|
prepareTemplateDetails: async () => {
|
|
59
|
-
const { html:
|
|
67
|
+
const { html: r, ampHtml: a = "", ampErrors: e = [] } = await m({
|
|
60
68
|
minimize: !0,
|
|
61
69
|
resetDataSavedFlag: !1
|
|
62
|
-
}), { html: p, css: g, syncModulesIds: f = [] } = await
|
|
63
|
-
|
|
64
|
-
const { compiledHtml: u, stats: n, appliedRules:
|
|
70
|
+
}), { html: p, css: g, syncModulesIds: f = [] } = await l();
|
|
71
|
+
o.selectedUnsubscribePages.length && await o.fetchTemplates(), await U(p);
|
|
72
|
+
const { compiledHtml: u, stats: n, appliedRules: y } = t(r), h = i.getSelectedDynamicContentList, A = b();
|
|
65
73
|
return console.debug("HTML Compilation Stats:", {
|
|
66
74
|
originalSize: n.originalSize,
|
|
67
75
|
compiledSize: n.compiledSize,
|
|
68
76
|
reduction: `${n.reductionPercentage.toFixed(2)}%`,
|
|
69
|
-
appliedRules:
|
|
77
|
+
appliedRules: y,
|
|
70
78
|
executionTime: `${n.executionTime.toFixed(2)}ms`
|
|
71
79
|
}), {
|
|
72
80
|
dynamicContentList: h,
|
|
73
81
|
compiledHtml: u,
|
|
74
82
|
rawHtml: p,
|
|
75
83
|
css: g,
|
|
76
|
-
ampHtml:
|
|
84
|
+
ampHtml: a,
|
|
77
85
|
ampErrors: e,
|
|
78
86
|
modules: f.map(Number),
|
|
79
87
|
recommendation: {
|
|
@@ -81,8 +89,8 @@ const _ = () => {
|
|
|
81
89
|
configs: {}
|
|
82
90
|
},
|
|
83
91
|
unsubscribe: {
|
|
84
|
-
status:
|
|
85
|
-
config:
|
|
92
|
+
status: o.unsubscribePagesStatus,
|
|
93
|
+
config: E(u, o.selectedUnsubscribePages)
|
|
86
94
|
}
|
|
87
95
|
};
|
|
88
96
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.4.1-beta.
|
|
3
|
+
"version": "3.4.1-beta.6fad109",
|
|
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
|
-
const i = [
|
|
2
|
-
"ozonebg",
|
|
3
|
-
"ozonehr",
|
|
4
|
-
"ozonero",
|
|
5
|
-
"ozoneinfo",
|
|
6
|
-
"babybg",
|
|
7
|
-
"ozongr",
|
|
8
|
-
"iboodat",
|
|
9
|
-
"iboodbe",
|
|
10
|
-
"iboodde",
|
|
11
|
-
"iboodfr",
|
|
12
|
-
"iboodnl",
|
|
13
|
-
"iboodpl"
|
|
14
|
-
], r = ["interencheres", "interencherespreprod"], d = ["lodenfrey", "lodenfreyuat"], c = "manualMerchandising";
|
|
15
|
-
function s(e, n) {
|
|
16
|
-
const o = {};
|
|
17
|
-
return i.includes(e) && (o.excludePurchaseDay = "30", o.userId = "{user_id}"), r.includes(e) && (o.hp = "1"), d.includes(e) && n === c && (o.includeOutOfStockItems = "true"), o;
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
s as getPartnerRecommendationParams
|
|
21
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the extra recommendation feed query params for an account, if any.
|
|
3
|
-
* Accounts without customizations get an empty object.
|
|
4
|
-
* @param partnerName Account subdomain (`config.partner.name`)
|
|
5
|
-
* @param strategy Recommendation strategy key of the block
|
|
6
|
-
*/
|
|
7
|
-
export declare function getPartnerRecommendationParams(partnerName: string, strategy: string): Record<string, string>;
|