@useinsider/guido 2.1.0-beta.3b5e21d → 2.1.0-beta.3d5480e
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/README.md +77 -2
- package/dist/@types/config/schemas.js +70 -65
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +73 -62
- package/dist/composables/useBlocksConfig.js +26 -16
- package/dist/composables/useSave.js +16 -12
- package/dist/composables/useStripo.js +61 -57
- package/dist/composables/useStripoEventHandler.js +27 -12
- package/dist/composables/useSyncModuleExtractor.js +45 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -17
- package/dist/config/migrator/itemsBlockMigrator.js +101 -97
- package/dist/enums/defaults.js +8 -4
- package/dist/enums/unsubscribe.js +25 -21
- package/dist/extensions/Blocks/Recommendation/block.js +24 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +11 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +31 -15
- package/dist/extensions/ModulesTabIcons/extension.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
- package/dist/services/stripoApi.js +48 -12
- package/dist/src/@types/config/schemas.d.ts +9 -1
- package/dist/src/@types/events.d.ts +38 -2
- package/dist/src/components/Guido.vue.d.ts +2 -2
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useGuidoActions.d.ts +1 -1
- package/dist/src/composables/useSave.d.ts +2 -2
- package/dist/src/composables/useStripo.d.ts +2 -2
- package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
- package/dist/src/enums/defaults.d.ts +4 -0
- package/dist/src/enums/unsubscribe.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -2
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/mock/api/settings.d.ts +2 -0
- package/dist/src/services/stripoApi.d.ts +5 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/utils/templatePreparation.d.ts +1 -1
- package/dist/static/styles/customEditorStyle.css.js +10 -9
- package/dist/stores/editor.js +2 -1
- package/dist/utils/templatePreparation.js +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useSaveStart as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useConfig as d } from "./useConfig.js";
|
|
2
|
+
import { useSaveStart as p, useSaveComplete as f } from "./useGuidoActions.js";
|
|
3
|
+
import { useSyncModuleExtractor as v } from "./useSyncModuleExtractor.js";
|
|
4
|
+
import { useStripoApi as S } from "../services/stripoApi.js";
|
|
5
|
+
import { useTemplatePreparation as x } from "../utils/templatePreparation.js";
|
|
6
|
+
import { useHtmlValidator as V } from "./useHtmlValidator.js";
|
|
7
|
+
const g = () => {
|
|
8
|
+
const o = p(), s = f(), { validateHtml: i } = V(), { callbacks: a } = d(), { extractSyncModuleData: r } = v(), { setSyncModuleUnsubscriptionPages: n } = S();
|
|
9
|
+
return { save: async (l = !1) => {
|
|
8
10
|
var e;
|
|
9
|
-
|
|
10
|
-
const { prepareTemplateDetails:
|
|
11
|
-
if (await
|
|
12
|
-
return
|
|
11
|
+
o();
|
|
12
|
+
const { prepareTemplateDetails: c } = x(), t = await c();
|
|
13
|
+
if (!await i(t.compiledHtml, t.dynamicContentList, !0) || (e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t))
|
|
14
|
+
return;
|
|
15
|
+
const { unsubscribePayload: m, stripoModules: u } = r(t.rawHtml);
|
|
16
|
+
return await n(m), t.modules = u, l || s(t), t;
|
|
13
17
|
} };
|
|
14
18
|
};
|
|
15
19
|
export {
|
|
16
|
-
|
|
20
|
+
g as useSave
|
|
17
21
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useStripoEventHandler as
|
|
6
|
-
import { useToaster as
|
|
7
|
-
import { displayConditions as
|
|
8
|
-
import { useStripoApi as
|
|
9
|
-
import
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { dynamicContentToMergeTags as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
const { features: l, template:
|
|
15
|
-
var
|
|
16
|
-
const
|
|
1
|
+
import { useActionsApi as A } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as F } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as D } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as I } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as P } from "./useToaster.js";
|
|
7
|
+
import { displayConditions as R } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as H } from "../services/stripoApi.js";
|
|
9
|
+
import O from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as S } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as q } from "../utils/genericUtil.js";
|
|
12
|
+
import x from "../package.json.js";
|
|
13
|
+
const ee = (C, c) => {
|
|
14
|
+
const { features: l, template: E } = D(), { handleError: u } = P(), { getToken: h, getCustomFonts: w, getSyncModulesStatus: b } = H(), { handleEvent: k } = U(), { getStripoBlocksConfig: T } = F(), V = async (i, n = [], r = !1) => {
|
|
15
|
+
var g, f, y;
|
|
16
|
+
const e = S(), { html: m, css: a } = i, { baseBlocks: o, extensions: d } = await T(), p = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, B = ((f = l.value) == null ? void 0 : f.modulesDisabled) ?? !1, v = ((y = E.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
17
17
|
window.UIEditor.initEditor(
|
|
18
18
|
document.querySelector("#guido-editor"),
|
|
19
19
|
{
|
|
20
|
-
metadata:
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
23
|
-
forceRecreate:
|
|
20
|
+
metadata: C,
|
|
21
|
+
html: m,
|
|
22
|
+
css: a,
|
|
23
|
+
forceRecreate: v,
|
|
24
24
|
locale: "en",
|
|
25
25
|
undoButtonSelector: "#guido__undo-button",
|
|
26
26
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,19 +30,20 @@ const W = (c) => {
|
|
|
30
30
|
customAppearanceMergetags: !0,
|
|
31
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
34
|
-
conditionsEnabled:
|
|
35
|
-
customConditionsEnabled:
|
|
36
|
-
conditionCategories:
|
|
33
|
+
customViewStyles: O,
|
|
34
|
+
conditionsEnabled: p,
|
|
35
|
+
customConditionsEnabled: p,
|
|
36
|
+
conditionCategories: R,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled:
|
|
38
|
+
modulesDisabled: B,
|
|
39
|
+
syncModulesEnabled: r,
|
|
39
40
|
messageSettingsEnabled: !0,
|
|
40
41
|
displayGmailAnnotations: !0,
|
|
41
42
|
displayHiddenPreheader: !1,
|
|
42
43
|
displayTitle: !1,
|
|
43
44
|
displayUTM: !1,
|
|
44
45
|
selectElementAfterDrop: !0,
|
|
45
|
-
...
|
|
46
|
+
...o ? { baseBlocks: o } : {},
|
|
46
47
|
editorFonts: {
|
|
47
48
|
showDefaultStandardFonts: !0,
|
|
48
49
|
showDefaultNotStandardFonts: !0,
|
|
@@ -50,68 +51,71 @@ const W = (c) => {
|
|
|
50
51
|
},
|
|
51
52
|
mergeTags: [
|
|
52
53
|
{
|
|
53
|
-
entries:
|
|
54
|
+
entries: q(c.preselectedDynamicContentList)
|
|
54
55
|
}
|
|
55
56
|
],
|
|
56
|
-
async onTokenRefreshRequest(
|
|
57
|
+
async onTokenRefreshRequest(t) {
|
|
57
58
|
try {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
} catch (
|
|
61
|
-
u(
|
|
59
|
+
const s = await h();
|
|
60
|
+
t(s);
|
|
61
|
+
} catch (s) {
|
|
62
|
+
u(s, "Failed to refresh token");
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
onTemplateLoaded() {
|
|
65
66
|
try {
|
|
66
|
-
const { importCss:
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const { importCss: t } = I(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: M } = A();
|
|
68
|
+
t(), s(), M(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
69
|
+
e.hasChanges = !1;
|
|
69
70
|
}, 1e3);
|
|
70
|
-
} catch (
|
|
71
|
-
u(
|
|
71
|
+
} catch (t) {
|
|
72
|
+
u(t, "Failed to load custom interface appearance");
|
|
72
73
|
}
|
|
73
74
|
},
|
|
74
|
-
onCodeEditorVisibilityChanged(
|
|
75
|
-
|
|
75
|
+
onCodeEditorVisibilityChanged(t) {
|
|
76
|
+
e.isCodeEditorOpen = t;
|
|
76
77
|
},
|
|
77
|
-
onEditorVisualModeChanged(
|
|
78
|
-
|
|
78
|
+
onEditorVisualModeChanged(t) {
|
|
79
|
+
e.editorVisualMode = t.toLowerCase();
|
|
79
80
|
},
|
|
80
|
-
onVersionHistoryVisibilityChanged(
|
|
81
|
-
|
|
81
|
+
onVersionHistoryVisibilityChanged(t) {
|
|
82
|
+
e.isVersionHistoryOpen = t;
|
|
82
83
|
},
|
|
83
84
|
onDataChanged() {
|
|
84
|
-
|
|
85
|
+
e.hasChanges = !0;
|
|
85
86
|
},
|
|
86
|
-
onEvent:
|
|
87
|
+
onEvent: k,
|
|
87
88
|
ignoreClickOutsideSelectors: [
|
|
88
89
|
"#guido-dynamic-content-modal",
|
|
89
90
|
".in-on-board-wrapper",
|
|
90
91
|
".in-drawer__container"
|
|
91
92
|
],
|
|
92
|
-
extensions:
|
|
93
|
+
extensions: d
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
|
-
},
|
|
96
|
-
var
|
|
96
|
+
}, _ = (i) => new Promise((n, r) => {
|
|
97
|
+
var d;
|
|
97
98
|
if (document.getElementById("UiEditorScript")) {
|
|
98
99
|
i(), n();
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
|
-
const
|
|
102
|
-
|
|
102
|
+
const e = x.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
103
|
+
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
103
104
|
i(), n();
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
}, document.body.appendChild(
|
|
105
|
+
}, o.onerror = () => {
|
|
106
|
+
r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
107
|
+
}, document.body.appendChild(o);
|
|
107
108
|
});
|
|
108
109
|
return { initPlugin: async (i) => {
|
|
109
|
-
await
|
|
110
|
-
const n = await
|
|
111
|
-
|
|
110
|
+
await _(async () => {
|
|
111
|
+
const n = S(), [r, e] = await Promise.all([
|
|
112
|
+
w(),
|
|
113
|
+
b()
|
|
114
|
+
]);
|
|
115
|
+
n.syncModulesEnabled = e, await V(i, r, e);
|
|
112
116
|
});
|
|
113
117
|
} };
|
|
114
118
|
};
|
|
115
119
|
export {
|
|
116
|
-
|
|
120
|
+
ee as useStripo
|
|
117
121
|
};
|
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useStripoApi as i } from "../services/stripoApi.js";
|
|
2
|
+
import { useEditorStore as u } from "../stores/editor.js";
|
|
3
|
+
import { useOnboardingStore as l } from "../stores/onboarding.js";
|
|
4
|
+
import { useUnsubscribeStore as b } from "../stores/unsubscribe.js";
|
|
5
|
+
const v = () => {
|
|
6
|
+
const { updateSyncModule: d, getSyncModule: r } = i(), n = u(), s = b(), a = {
|
|
7
|
+
block_dropped: ({ blockName: e }) => {
|
|
8
|
+
if (e === "BLOCK_TEXT") {
|
|
9
|
+
const o = l(), t = !o.shouldShowOnboarding("textBlockOnboarding"), c = o.isActive("textBlockOnboarding");
|
|
10
|
+
if (t || c)
|
|
8
11
|
return;
|
|
9
|
-
|
|
12
|
+
o.start("textBlockOnboarding");
|
|
10
13
|
}
|
|
14
|
+
},
|
|
15
|
+
module_saved: async (e) => {
|
|
16
|
+
n.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await d(e));
|
|
17
|
+
},
|
|
18
|
+
module_dropped: async (e) => {
|
|
19
|
+
if (!n.syncModulesEnabled)
|
|
20
|
+
return;
|
|
21
|
+
const { moduleId: o } = e, t = await r(o);
|
|
22
|
+
console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await s.fetchTemplates();
|
|
23
|
+
},
|
|
24
|
+
module_updated: async (e) => {
|
|
25
|
+
n.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await d(e));
|
|
11
26
|
}
|
|
12
27
|
};
|
|
13
|
-
return { handleEvent: async (
|
|
14
|
-
const
|
|
15
|
-
o && await o
|
|
28
|
+
return { handleEvent: async (e, o) => {
|
|
29
|
+
const t = a[e];
|
|
30
|
+
console.debug("Stripo Event: ", e, o), t && await t(o);
|
|
16
31
|
} };
|
|
17
32
|
};
|
|
18
33
|
export {
|
|
19
|
-
|
|
34
|
+
v as useStripoEventHandler
|
|
20
35
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { UNSUBSCRIBE_SYNC_MODULE_TYPES as T } from "../enums/unsubscribe.js";
|
|
2
|
+
import { DATA_ATTRIBUTES as p } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
3
|
+
import { useEditorStore as f } from "../stores/editor.js";
|
|
4
|
+
const y = ".esd-synchronizable-module", A = '[esd-extension-block-id="unsubscribe-block"]', _ = "esd-custom-block-id", B = () => {
|
|
5
|
+
const d = f();
|
|
6
|
+
return { extractSyncModuleData: (E) => {
|
|
7
|
+
const S = {
|
|
8
|
+
unsubscribePayload: [],
|
|
9
|
+
stripoModules: []
|
|
10
|
+
};
|
|
11
|
+
if (!d.syncModulesEnabled)
|
|
12
|
+
return S;
|
|
13
|
+
const b = new DOMParser().parseFromString(E, "text/html").querySelectorAll(y), r = [], s = [];
|
|
14
|
+
return b.forEach((o) => {
|
|
15
|
+
const t = o.getAttribute(_);
|
|
16
|
+
if (!t)
|
|
17
|
+
return;
|
|
18
|
+
const n = o.querySelectorAll(A);
|
|
19
|
+
if (n.length === 0) {
|
|
20
|
+
s.push(Number(t));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
n.forEach((c) => {
|
|
24
|
+
const u = c.getAttribute(p.PAGE_LIST), i = c.getAttribute(p.PAGE_TYPE);
|
|
25
|
+
if (!u || !i)
|
|
26
|
+
return;
|
|
27
|
+
const m = parseInt(i), a = T[m];
|
|
28
|
+
if (!a)
|
|
29
|
+
return;
|
|
30
|
+
const l = u.split(",").map((e) => parseInt(e.trim())).filter((e) => !Number.isNaN(e));
|
|
31
|
+
l.length !== 0 && r.push({
|
|
32
|
+
stripoModuleId: t,
|
|
33
|
+
unsubscriptionPreferencePages: l,
|
|
34
|
+
type: a
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}), {
|
|
38
|
+
unsubscribePayload: r,
|
|
39
|
+
stripoModules: s
|
|
40
|
+
};
|
|
41
|
+
} };
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
B as useSyncModuleExtractor
|
|
45
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
|
|
2
2
|
function b(e, u, r, o) {
|
|
3
|
-
const
|
|
4
|
-
return o === "before" ? `${t} ${
|
|
3
|
+
const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
|
|
4
|
+
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
5
5
|
}
|
|
6
|
-
function p(e, u, r, o,
|
|
6
|
+
function p(e, u, r, o, n) {
|
|
7
7
|
switch (u) {
|
|
8
8
|
case "productImage": {
|
|
9
9
|
const t = e.querySelector("img");
|
|
@@ -24,7 +24,7 @@ function p(e, u, r, o, s) {
|
|
|
24
24
|
const t = e.querySelector("p");
|
|
25
25
|
if (t) {
|
|
26
26
|
const c = t.querySelector("strong") || t;
|
|
27
|
-
c.textContent = b(r, o, "price",
|
|
27
|
+
c.textContent = b(r, o, "price", n);
|
|
28
28
|
}
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
@@ -36,7 +36,7 @@ function p(e, u, r, o, s) {
|
|
|
36
36
|
r,
|
|
37
37
|
o,
|
|
38
38
|
"original_price",
|
|
39
|
-
|
|
39
|
+
n
|
|
40
40
|
), t.setAttribute("product-attr", "discount");
|
|
41
41
|
}
|
|
42
42
|
break;
|
|
@@ -67,12 +67,12 @@ function p(e, u, r, o, s) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
function $(e, u, r) {
|
|
70
|
-
e.querySelectorAll(".recommendation-product-row").forEach((
|
|
71
|
-
|
|
72
|
-
const i =
|
|
70
|
+
e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
|
|
71
|
+
n.querySelectorAll("[data-attribute-type]").forEach((s) => {
|
|
72
|
+
const i = s.getAttribute("data-attribute-type") || "", a = s.querySelectorAll(".attribute-cell");
|
|
73
73
|
a.length > 0 ? a.forEach((l) => {
|
|
74
74
|
p(l, i, u, t, r);
|
|
75
|
-
}) : p(
|
|
75
|
+
}) : p(s, i, u, t, r);
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -80,9 +80,9 @@ function S(e, u, r) {
|
|
|
80
80
|
const o = e.querySelectorAll(".recommendation-product-row");
|
|
81
81
|
if (!o.length)
|
|
82
82
|
return;
|
|
83
|
-
const [
|
|
84
|
-
o.forEach((
|
|
85
|
-
|
|
83
|
+
const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
84
|
+
o.forEach((s, i) => {
|
|
85
|
+
s.querySelectorAll("[data-attribute-type]").forEach((l) => {
|
|
86
86
|
const f = l.getAttribute("data-attribute-type") || "";
|
|
87
87
|
l.querySelectorAll(".attribute-cell").forEach((y, m) => {
|
|
88
88
|
const A = i * c + m;
|
|
@@ -91,9 +91,14 @@ function S(e, u, r) {
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
function q(e, u) {
|
|
94
|
+
function q(e, u, r) {
|
|
95
|
+
e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
|
|
96
|
+
S(n, u, r);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function d(e, u) {
|
|
95
100
|
const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
|
|
96
|
-
r === "list" ? $(e, u, o) :
|
|
101
|
+
r === "list" ? $(e, u, o) : q(e, u, o);
|
|
97
102
|
}
|
|
98
103
|
function h(e, u) {
|
|
99
104
|
const r = e.match(/<!DOCTYPE[^>]*>/i);
|
|
@@ -104,10 +109,10 @@ function w(e) {
|
|
|
104
109
|
const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".ins-recommendation-v3-block-v2");
|
|
105
110
|
if (!o.length)
|
|
106
111
|
return e;
|
|
107
|
-
const { buildCampaignUrl:
|
|
112
|
+
const { buildCampaignUrl: n } = _();
|
|
108
113
|
return o.forEach((c) => {
|
|
109
|
-
const
|
|
110
|
-
|
|
114
|
+
const s = c.getAttribute("recommendation-id");
|
|
115
|
+
s && (n(s), d(c, s));
|
|
111
116
|
}), h(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
112
117
|
}
|
|
113
118
|
export {
|