@useinsider/guido 3.1.1-beta.5ad1748 → 3.1.1-beta.5b87594
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/@types/config/schemas.js +9 -7
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/config/compiler/recommendationCompilerRules.js +158 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +49 -46
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/recommendation.js +2 -2
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/static/styles/base.css.js +7 -2
- package/dist/utils/templatePreparation.js +34 -25
- package/package.json +1 -1
|
@@ -121,7 +121,9 @@ const m = {
|
|
|
121
121
|
/** Enable unsubscribe block */
|
|
122
122
|
unsubscribe: e(a(), !0),
|
|
123
123
|
/** Disable modules panel in the editor */
|
|
124
|
-
modulesDisabled: e(a(), !1)
|
|
124
|
+
modulesDisabled: e(a(), !1),
|
|
125
|
+
/** Enable Liquid template syntax */
|
|
126
|
+
liquidSyntax: e(a(), !1)
|
|
125
127
|
}), g = n([
|
|
126
128
|
"amp-accordion",
|
|
127
129
|
"amp-carousel",
|
|
@@ -193,14 +195,14 @@ const m = {
|
|
|
193
195
|
(i) => typeof i == "function",
|
|
194
196
|
"processor must be a function"
|
|
195
197
|
)
|
|
196
|
-
}),
|
|
198
|
+
}), x = k("type", [
|
|
197
199
|
M,
|
|
198
200
|
N,
|
|
199
201
|
D,
|
|
200
202
|
v
|
|
201
|
-
]),
|
|
203
|
+
]), U = o({
|
|
202
204
|
/** Custom compiler rules to apply */
|
|
203
|
-
customRules: e(c(
|
|
205
|
+
customRules: e(c(x), []),
|
|
204
206
|
/** Skip default compiler rules */
|
|
205
207
|
ignoreDefaultRules: e(a(), !1)
|
|
206
208
|
}), B = o({
|
|
@@ -232,15 +234,15 @@ const m = {
|
|
|
232
234
|
/** Block configuration */
|
|
233
235
|
blocks: e(L, {}),
|
|
234
236
|
/** Compiler configuration */
|
|
235
|
-
compiler: e(
|
|
237
|
+
compiler: e(U, {}),
|
|
236
238
|
/** Callbacks and event handlers */
|
|
237
239
|
callbacks: e(B, {})
|
|
238
240
|
});
|
|
239
241
|
export {
|
|
240
242
|
L as BlocksSchema,
|
|
241
243
|
B as CallbacksSchema,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
x as CompilerRuleSchema,
|
|
245
|
+
U as CompilerSchema,
|
|
244
246
|
O as CustomBlockTypeSchema,
|
|
245
247
|
v as CustomRuleSchema,
|
|
246
248
|
g as DefaultBlockTypeSchema,
|
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
3
|
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"25780af6"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const u = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
u as default
|
|
20
20
|
};
|
|
@@ -1,121 +1,131 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import { ModuleFolderDefaults as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
1
|
+
import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
|
+
import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as Z } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as ee } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as te } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as B } from "../enums/defaults.js";
|
|
8
|
+
import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
|
|
9
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
10
|
+
import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
11
|
+
import re from "./organisms/header/HeaderWrapper.vue.js";
|
|
12
|
+
import ce from "./organisms/LoadingWrapper.vue.js";
|
|
13
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
14
|
+
import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
15
|
+
import { useStripoApi as me } from "../services/stripoApi.js";
|
|
16
|
+
import { useConfigStore as de } from "../stores/config.js";
|
|
17
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
18
|
+
import { useEditorStore as ue } from "../stores/editor.js";
|
|
19
|
+
import { usePreviewStore as pe } from "../stores/preview.js";
|
|
20
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
21
|
+
const Re = /* @__PURE__ */ j({
|
|
21
22
|
__name: "Guido",
|
|
22
23
|
props: {
|
|
23
24
|
config: null
|
|
24
25
|
},
|
|
25
26
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
27
|
+
setup(H, { expose: x, emit: s }) {
|
|
28
|
+
const b = H, G = R(
|
|
28
29
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
29
|
-
),
|
|
30
|
+
), z = R(
|
|
30
31
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
const
|
|
32
|
+
), S = A(), d = A(), l = le(), g = fe(), a = de();
|
|
33
|
+
a.init(b.config);
|
|
34
|
+
const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
|
|
34
35
|
var e;
|
|
35
|
-
return (e =
|
|
36
|
+
return (e = S.value) == null ? void 0 : e.handleSave(!0);
|
|
36
37
|
}, {
|
|
37
|
-
templateId:
|
|
38
|
-
userId:
|
|
39
|
-
partnerName:
|
|
40
|
-
username:
|
|
41
|
-
template:
|
|
42
|
-
editor:
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
emailId:
|
|
47
|
-
userId:
|
|
48
|
-
username:
|
|
49
|
-
partnerName:
|
|
50
|
-
savedModulesFolderName:
|
|
51
|
-
defaultModulesFolderName:
|
|
52
|
-
},
|
|
53
|
-
preselectedDynamicContentList:
|
|
38
|
+
templateId: p,
|
|
39
|
+
userId: E,
|
|
40
|
+
partnerName: D,
|
|
41
|
+
username: C,
|
|
42
|
+
template: t,
|
|
43
|
+
editor: r
|
|
44
|
+
} = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
|
|
45
|
+
u.templateId = p;
|
|
46
|
+
const v = {
|
|
47
|
+
emailId: p,
|
|
48
|
+
userId: E,
|
|
49
|
+
username: C,
|
|
50
|
+
partnerName: D,
|
|
51
|
+
savedModulesFolderName: k,
|
|
52
|
+
defaultModulesFolderName: F
|
|
53
|
+
}, L = {
|
|
54
|
+
preselectedDynamicContentList: f,
|
|
54
55
|
onReady: () => {
|
|
55
|
-
console.debug("guido:ready"),
|
|
56
|
+
console.debug("guido:ready"), s("ready");
|
|
56
57
|
}
|
|
57
|
-
}, { initPlugin:
|
|
58
|
+
}, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
|
|
58
59
|
var e;
|
|
59
|
-
return !((e =
|
|
60
|
+
return !((e = a.ui) != null && e.showHeader);
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
+
Y({
|
|
62
63
|
onBack: () => {
|
|
63
|
-
console.debug("guido:back"),
|
|
64
|
+
console.debug("guido:back"), s("back");
|
|
64
65
|
},
|
|
65
66
|
onSaveStart: () => {
|
|
66
|
-
console.debug("guido:save:start"),
|
|
67
|
+
console.debug("guido:save:start"), s("save:start");
|
|
67
68
|
},
|
|
68
69
|
onSaveComplete: (e) => {
|
|
69
|
-
const
|
|
70
|
-
console.debug("guido:save:complete",
|
|
70
|
+
const n = { ...e, metadata: v };
|
|
71
|
+
console.debug("guido:save:complete", n), s("save:complete", n);
|
|
71
72
|
},
|
|
72
73
|
onTestEmailClick: () => {
|
|
73
|
-
console.debug("guido:test-email:click"),
|
|
74
|
+
console.debug("guido:test-email:click"), s("test-email:click");
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
|
-
const
|
|
77
|
-
console.debug("dynamic-content:close", e),
|
|
78
|
-
},
|
|
77
|
+
const P = (e) => {
|
|
78
|
+
console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
79
|
+
}, N = () => {
|
|
79
80
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
J(() => i.value, () => {
|
|
83
|
+
s("on-change", i.value);
|
|
83
84
|
});
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
console.debug("dynamic-content:open",
|
|
85
|
+
const y = (e) => {
|
|
86
|
+
const n = e, { attribute: o, position: $ } = n.detail;
|
|
87
|
+
console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
|
|
87
88
|
};
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
let c = null;
|
|
90
|
+
const h = () => {
|
|
91
|
+
var n;
|
|
92
|
+
const e = document.querySelector(oe);
|
|
93
|
+
(n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
94
|
+
};
|
|
95
|
+
return Q(async () => {
|
|
96
|
+
var n;
|
|
97
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
|
|
98
|
+
const e = (n = d.value) == null ? void 0 : n.parentElement;
|
|
99
|
+
e && (c = new ResizeObserver(h), c.observe(e));
|
|
90
100
|
try {
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
html:
|
|
94
|
-
css:
|
|
101
|
+
g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
102
|
+
let o = {
|
|
103
|
+
html: m && await W(m),
|
|
104
|
+
css: T
|
|
95
105
|
};
|
|
96
|
-
|
|
97
|
-
} catch (
|
|
98
|
-
console.error("Failed to initialize Stripo editor:",
|
|
106
|
+
o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
|
|
107
|
+
} catch (o) {
|
|
108
|
+
console.error("Failed to initialize Stripo editor:", o);
|
|
99
109
|
}
|
|
100
|
-
document.addEventListener("dynamic-content:open",
|
|
101
|
-
}),
|
|
102
|
-
document.removeEventListener("dynamic-content:open",
|
|
110
|
+
document.addEventListener("dynamic-content:open", y);
|
|
111
|
+
}), X(() => {
|
|
112
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
|
|
103
113
|
try {
|
|
104
114
|
window.UIEditor.removeEditor();
|
|
105
115
|
} catch {
|
|
106
116
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
107
117
|
}
|
|
108
|
-
|
|
109
|
-
}),
|
|
118
|
+
a.reset();
|
|
119
|
+
}), x({
|
|
110
120
|
dynamicContent: {
|
|
111
|
-
insert:
|
|
112
|
-
close:
|
|
121
|
+
insert: P,
|
|
122
|
+
close: N
|
|
113
123
|
},
|
|
114
|
-
hasChanges:
|
|
115
|
-
saveSilent:
|
|
116
|
-
}), { __sfc: !0, PreviewContainer:
|
|
124
|
+
hasChanges: i,
|
|
125
|
+
saveSilent: w
|
|
126
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
|
|
117
127
|
}
|
|
118
128
|
});
|
|
119
129
|
export {
|
|
120
|
-
|
|
130
|
+
Re as default
|
|
121
131
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useRecommendation as
|
|
2
|
-
import { DUMMY_IMAGE_MAPPINGS as
|
|
3
|
-
import { prepareRecommendationBlocks as
|
|
4
|
-
const
|
|
1
|
+
import { useRecommendation as N } from "../../composables/useRecommendation.js";
|
|
2
|
+
import { DUMMY_IMAGE_MAPPINGS as C, REGEX as T, VerticalOrientation as M, CSS as E, ATTRIBUTES as R, CONDITIONS as $, HTML as h } from "../../enums/recommendation.js";
|
|
3
|
+
import { prepareRecommendationBlocks as x } from "./utils/recommendationCompilerUtils.js";
|
|
4
|
+
const w = [
|
|
5
5
|
{
|
|
6
6
|
id: "replace-images-with-variable-names",
|
|
7
7
|
description: "Replacing dummy images with variable names in recommendation module",
|
|
8
8
|
type: "custom",
|
|
9
|
-
processor: (
|
|
10
|
-
let
|
|
11
|
-
return Object.entries(
|
|
12
|
-
Object.entries(
|
|
13
|
-
|
|
9
|
+
processor: (i) => {
|
|
10
|
+
let e = i;
|
|
11
|
+
return Object.entries(C).forEach(([, p]) => {
|
|
12
|
+
Object.entries(p).forEach(([c, n]) => {
|
|
13
|
+
e = e.replaceAll(n, `{{${c}}}`);
|
|
14
14
|
});
|
|
15
|
-
}),
|
|
15
|
+
}), e;
|
|
16
16
|
},
|
|
17
17
|
priority: 50
|
|
18
18
|
},
|
|
@@ -29,21 +29,21 @@ const G = [
|
|
|
29
29
|
id: "add-recommendation-unresponsive-css",
|
|
30
30
|
description: "Adding recommendation unresponsive css",
|
|
31
31
|
type: "custom",
|
|
32
|
-
processor: (
|
|
33
|
-
const { calculateCardWidth:
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
const
|
|
43
|
-
|
|
32
|
+
processor: (i) => {
|
|
33
|
+
const { calculateCardWidth: e, getRecommendationCampaignData: p } = N();
|
|
34
|
+
let c = i;
|
|
35
|
+
const n = c.match(T.ID);
|
|
36
|
+
if (n) {
|
|
37
|
+
const a = [];
|
|
38
|
+
if (n.forEach((s) => {
|
|
39
|
+
const d = /recommendation-id="(.*?)"/i.exec(s), _ = d ? d[1].trim() : "", A = p(_);
|
|
40
|
+
A.textTrimming && A.orientation === M && a.push(e(A));
|
|
41
|
+
}), a.length) {
|
|
42
|
+
const s = `width:${Math.min(...a)}px!important;`;
|
|
43
|
+
c = c.replace(E.REGULAR_NAME_HEIGHT, `${E.TRIMMED_NAME_HEIGHT} ${s} ${E.ELLIPSIS}`).replace(E.REGULAR_NAME_CONTAINER_HEIGHT, E.TRIMMED_NAME_CONTAINER_CSS).replace(E.RESPONSIVE_NAME_SIZE, `${E.RESPONSIVE_NAME_HEIGHT} ${s} ${E.ELLIPSIS}`).replace(E.RESPONSIVE_NAME_CONTAINER_HEIGHT, E.TRIMMED_RESPONSIVE_NAME_CONTAINER_CSS);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return c;
|
|
47
47
|
},
|
|
48
48
|
priority: 52
|
|
49
49
|
},
|
|
@@ -51,39 +51,153 @@ const G = [
|
|
|
51
51
|
id: "prepare-recommendations",
|
|
52
52
|
description: "Replacing product data with template variables in recommendation blocks",
|
|
53
53
|
type: "custom",
|
|
54
|
-
processor: (
|
|
54
|
+
processor: (i) => x(i),
|
|
55
55
|
priority: 48
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
id: "add-discount-conditions",
|
|
59
59
|
description: "Adding discount conditions to the recommendation block",
|
|
60
60
|
type: "custom",
|
|
61
|
-
processor: (
|
|
62
|
-
let
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
61
|
+
processor: (i) => {
|
|
62
|
+
let e = i;
|
|
63
|
+
const p = e.match(T.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: c } = N();
|
|
64
|
+
return p !== null && p.forEach((n) => {
|
|
65
|
+
const a = n.match(T.CUSTOM_FIELD);
|
|
66
|
+
if (!a)
|
|
67
67
|
return;
|
|
68
|
-
const [
|
|
69
|
-
if (!
|
|
68
|
+
const [s] = a, d = s.match(T.CUSTOM_FIELD_INDEXES_PART), _ = s.match(T.CUSTOM_FIELD_NAME_PART), A = n.match(T.ATTRIBUTE_PARAGRAPH_START_TAG);
|
|
69
|
+
if (!d || !_ || !A)
|
|
70
70
|
return;
|
|
71
|
-
const [
|
|
72
|
-
let
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
71
|
+
const [I] = d, [S] = _, [m] = A, o = S.substring(1, S.length - 2), r = m.match(T.COMPOSITION) !== null;
|
|
72
|
+
let t = s;
|
|
73
|
+
if (r) {
|
|
74
|
+
const b = I.substring(2, I.length - 3), l = c(b);
|
|
75
|
+
o === R.OMNIBUS_PRICE && (l.priceBeforeTextValue && (t = `${l.priceBeforeTextValue}${t}`), l.priceAfterTextValue && (t = `${t}${l.priceAfterTextValue}`)), o === R.OMNIBUS_DISCOUNT && (l.discountBeforeTextValue && (t = `${l.discountBeforeTextValue}${t}`), l.discountAfterTextValue && (t = `${t}${l.discountAfterTextValue}`));
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
}),
|
|
77
|
+
const u = I.substring(2);
|
|
78
|
+
let f = "";
|
|
79
|
+
o in $.IF && (f = $.IF[o].replaceAll(`{${R.DISCOUNT}}`, `${u}${R.DISCOUNT}`).replaceAll(`{${R.OMNIBUS_DISCOUNT}}`, `${u}${R.OMNIBUS_DISCOUNT}`).replaceAll(`{${R.OMNIBUS_PRICE}}`, `${u}${R.OMNIBUS_PRICE}`));
|
|
80
|
+
const g = `${m}${t}${h.PARAGRAPH_END_TAG}`, y = `${f}${r ? g : n}${$.ELSE}${m}${h.PARAGRAPH_END_TAG}${$.END_IF}`;
|
|
81
|
+
e = e.replace(n, y);
|
|
82
|
+
}), e;
|
|
83
83
|
},
|
|
84
84
|
priority: 53
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "strip-empty-omnibus-spans",
|
|
88
|
+
description: "Remove empty omnibus text-before and text-after span elements",
|
|
89
|
+
type: "regex",
|
|
90
|
+
pattern: '<span class="omnibus-text-(?:before|after)">\\s*</span>',
|
|
91
|
+
replacement: "",
|
|
92
|
+
flags: "g",
|
|
93
|
+
priority: 54
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "strip-recommendation-editor-attributes",
|
|
97
|
+
description: "Strip editor-only attributes from compiled recommendation output",
|
|
98
|
+
type: "regex",
|
|
99
|
+
// eslint-disable-next-line @stylistic/max-len
|
|
100
|
+
pattern: '\\s+(?:esd-extension-block-id|data-attribute-type|data-visibility|data-text-before|data-text-after|product-attr|composition)="[^"]*"',
|
|
101
|
+
replacement: "",
|
|
102
|
+
flags: "g",
|
|
103
|
+
priority: 55
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "strip-unused-recommendation-classes",
|
|
107
|
+
description: "Remove CSS classes not referenced by any style rule from recommendation elements",
|
|
108
|
+
type: "custom",
|
|
109
|
+
processor: (i) => {
|
|
110
|
+
let e = i.replace(
|
|
111
|
+
/ class="(?:product-card-segment|attribute-cell|recommendation-attribute-row|product-image|product-name|product-price|product-old-price|product-omnibus-price|product-omnibus-discount|product-button|recommendation-product-row|product-card-wrapper)"/g,
|
|
112
|
+
""
|
|
113
|
+
);
|
|
114
|
+
return e = e.replaceAll("es-button buy-button", "es-button"), e = e.replaceAll("ins-recommendation-product-container ", ""), e;
|
|
115
|
+
},
|
|
116
|
+
priority: 56
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "remove-empty-mobile-layout-artifacts",
|
|
120
|
+
description: "Remove empty mobile container rows and unused mobile layout CSS",
|
|
121
|
+
type: "custom",
|
|
122
|
+
processor: (i) => {
|
|
123
|
+
let e = i;
|
|
124
|
+
return e = e.replace(
|
|
125
|
+
/<tr[^>]*class="ins-recommendation-mobile-row"[^>]*><\/tr>/g,
|
|
126
|
+
""
|
|
127
|
+
), /class="[^"]*ins-recommendation-mobile-container/.test(e) || (e = e.replace(
|
|
128
|
+
/\.ins-recommendation-mobile-container\s*\{\s*display\s*:\s*none\s*;?\s*\}/g,
|
|
129
|
+
""
|
|
130
|
+
), e = e.replace(
|
|
131
|
+
/@media[^{]*max-width\s*:\s*480px[^{]*\{((?:[^{}]*\{[^{}]*\})*[^{}]*)\}/g,
|
|
132
|
+
(p, c) => {
|
|
133
|
+
const n = c.match(/[^{}]+\{[^{}]*\}/g) || [], a = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
|
|
134
|
+
return n.every((d) => a.test(d)) ? "" : p;
|
|
135
|
+
}
|
|
136
|
+
)), e;
|
|
137
|
+
},
|
|
138
|
+
priority: 57
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "deduplicate-inline-styles",
|
|
142
|
+
description: "Replace repeated inline styles with CSS class references within recommendation blocks",
|
|
143
|
+
type: "custom",
|
|
144
|
+
processor: (i) => {
|
|
145
|
+
const e = i.replace(
|
|
146
|
+
/<a\b[^>]*\bes-button\b[^>]*>/g,
|
|
147
|
+
(o) => o.replace(
|
|
148
|
+
/([;"]color:)([^;"]+)/g,
|
|
149
|
+
(r, t, u) => u.includes("!important") ? r : `${t}${u} !important`
|
|
150
|
+
)
|
|
151
|
+
), p = /<!--REC_START-->([\s\S]*?)<!--REC_END-->/g, c = / style="([^"]*)"/g, n = /* @__PURE__ */ new Map();
|
|
152
|
+
let a = p.exec(e);
|
|
153
|
+
for (; a !== null; ) {
|
|
154
|
+
let o = c.exec(a[1]);
|
|
155
|
+
for (; o !== null; ) {
|
|
156
|
+
const [, r] = o;
|
|
157
|
+
n.set(r, (n.get(r) || 0) + 1), o = c.exec(a[1]);
|
|
158
|
+
}
|
|
159
|
+
c.lastIndex = 0, a = p.exec(e);
|
|
160
|
+
}
|
|
161
|
+
const s = /* @__PURE__ */ new Map(), d = [];
|
|
162
|
+
let _ = 0;
|
|
163
|
+
if (n.forEach((o, r) => {
|
|
164
|
+
if (o >= 6) {
|
|
165
|
+
const t = `rc${_++}`;
|
|
166
|
+
s.set(r, t), d.push(`.${t}{${r}}`);
|
|
167
|
+
}
|
|
168
|
+
}), s.size === 0) {
|
|
169
|
+
let o = e;
|
|
170
|
+
return o = o.replaceAll("<!--REC_START-->", ""), o = o.replaceAll("<!--REC_END-->", ""), o;
|
|
171
|
+
}
|
|
172
|
+
const A = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), I = (o, r) => `${o.slice(0, -1)} ${r}"`, S = /* @__PURE__ */ new Map();
|
|
173
|
+
s.forEach((o, r) => {
|
|
174
|
+
const t = A(r);
|
|
175
|
+
S.set(r, {
|
|
176
|
+
caseA: new RegExp(`(class="[^"]*")((?:[^>]*?)) style="${t}"`, "g"),
|
|
177
|
+
caseB: new RegExp(` style="${t}"((?:[^>]*?))(class="[^"]*")`, "g")
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
let m = e.replace("</style>", `${d.join("")}</style>`);
|
|
181
|
+
return m = m.replace(
|
|
182
|
+
/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g,
|
|
183
|
+
(o, r) => {
|
|
184
|
+
let t = r;
|
|
185
|
+
return s.forEach((u, f) => {
|
|
186
|
+
const g = S.get(f);
|
|
187
|
+
t = t.replace(
|
|
188
|
+
g.caseA,
|
|
189
|
+
(y, b, l) => I(b, u) + l
|
|
190
|
+
), t = t.replace(
|
|
191
|
+
g.caseB,
|
|
192
|
+
(y, b, l) => b + I(l, u)
|
|
193
|
+
), t = t.replaceAll(` style="${f}"`, ` class="${u}"`);
|
|
194
|
+
}), t;
|
|
195
|
+
}
|
|
196
|
+
), m = m.replaceAll("<!--REC_START-->", ""), m = m.replaceAll("<!--REC_END-->", ""), m;
|
|
197
|
+
},
|
|
198
|
+
priority: 58
|
|
85
199
|
}
|
|
86
200
|
];
|
|
87
201
|
export {
|
|
88
|
-
|
|
202
|
+
w as recommendationCompilerRules
|
|
89
203
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useConfig as S } from "../../../composables/useConfig.js";
|
|
2
|
+
import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
|
|
3
|
+
function y(e, u, r, o, s = "") {
|
|
4
|
+
const n = `{{${s}${e}_${u}_${r}}}`, t = `{{${s}${e}_${u}_currency}}`;
|
|
4
5
|
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
5
6
|
}
|
|
6
|
-
function p(e, u, r, o, n) {
|
|
7
|
+
function p(e, u, r, o, s, n) {
|
|
7
8
|
switch (u) {
|
|
8
9
|
case "productImage": {
|
|
9
10
|
const t = e.querySelector("img");
|
|
10
|
-
t && (t.setAttribute("src", `{{${r}_${o}_image_url}}`), t.setAttribute("alt", `{{${r}_${o}_name}}`));
|
|
11
|
+
t && (t.setAttribute("src", `{{${n}${r}_${o}_image_url}}`), t.setAttribute("alt", `{{${n}${r}_${o}_name}}`));
|
|
11
12
|
const c = e.querySelector("a");
|
|
12
|
-
c && c.setAttribute("href", `{{${r}_${o}_url}}`);
|
|
13
|
+
c && c.setAttribute("href", `{{${n}${r}_${o}_url}}`);
|
|
13
14
|
break;
|
|
14
15
|
}
|
|
15
16
|
case "productName": {
|
|
16
17
|
const t = e.querySelector("p");
|
|
17
18
|
if (t) {
|
|
18
19
|
const c = t.querySelector("strong") || t;
|
|
19
|
-
c.textContent = `{{${r}_${o}_name}}`;
|
|
20
|
+
c.textContent = `{{${n}${r}_${o}_name}}`;
|
|
20
21
|
}
|
|
21
22
|
break;
|
|
22
23
|
}
|
|
@@ -24,7 +25,7 @@ function p(e, u, r, o, n) {
|
|
|
24
25
|
const t = e.querySelector("p");
|
|
25
26
|
if (t) {
|
|
26
27
|
const c = t.querySelector("strong") || t;
|
|
27
|
-
c.textContent =
|
|
28
|
+
c.textContent = y(r, o, "price", s, n);
|
|
28
29
|
}
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
@@ -32,10 +33,11 @@ function p(e, u, r, o, n) {
|
|
|
32
33
|
const t = e.querySelector("p");
|
|
33
34
|
if (t) {
|
|
34
35
|
const c = t.querySelector("strong") || t;
|
|
35
|
-
c.textContent =
|
|
36
|
+
c.textContent = y(
|
|
36
37
|
r,
|
|
37
38
|
o,
|
|
38
39
|
"original_price",
|
|
40
|
+
s,
|
|
39
41
|
n
|
|
40
42
|
), t.setAttribute("product-attr", "discount");
|
|
41
43
|
}
|
|
@@ -43,13 +45,13 @@ function p(e, u, r, o, n) {
|
|
|
43
45
|
}
|
|
44
46
|
case "productButton": {
|
|
45
47
|
const t = e.querySelector("a");
|
|
46
|
-
t && t.setAttribute("href", `{{${r}_${o}_url}}`);
|
|
48
|
+
t && t.setAttribute("href", `{{${n}${r}_${o}_url}}`);
|
|
47
49
|
break;
|
|
48
50
|
}
|
|
49
51
|
case "productOmnibusPrice": {
|
|
50
52
|
const t = e.querySelector(".omnibus-price-value");
|
|
51
53
|
if (t) {
|
|
52
|
-
t.textContent = `{{${r}_${o}_omnibus_price}}`;
|
|
54
|
+
t.textContent = `{{${n}${r}_${o}_omnibus_price}}`;
|
|
53
55
|
const c = t.closest("p");
|
|
54
56
|
c && (c.setAttribute("product-attr", "omnibus_price"), c.setAttribute("composition", "true"));
|
|
55
57
|
}
|
|
@@ -58,7 +60,7 @@ function p(e, u, r, o, n) {
|
|
|
58
60
|
case "productOmnibusDiscount": {
|
|
59
61
|
const t = e.querySelector(".omnibus-discount-value");
|
|
60
62
|
if (t) {
|
|
61
|
-
t.textContent = `{{${r}_${o}_omnibus_discount}}`;
|
|
63
|
+
t.textContent = `{{${n}${r}_${o}_omnibus_discount}}`;
|
|
62
64
|
const c = t.closest("p");
|
|
63
65
|
c && (c.setAttribute("product-attr", "omnibus_discount"), c.setAttribute("composition", "true"));
|
|
64
66
|
}
|
|
@@ -67,66 +69,67 @@ function p(e, u, r, o, n) {
|
|
|
67
69
|
default: {
|
|
68
70
|
const t = e.getAttribute("product-attr") ? e : e.querySelector("[product-attr]");
|
|
69
71
|
if (t) {
|
|
70
|
-
const c = t.getAttribute("product-attr"),
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const c = t.getAttribute("product-attr"), i = t.querySelector("p");
|
|
73
|
+
if (i) {
|
|
74
|
+
const a = i.querySelector("strong") || i;
|
|
75
|
+
a.textContent = `{{${n}${r}_${o}_${c}}}`;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
break;
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
|
-
function
|
|
82
|
+
function d(e, u, r, o) {
|
|
81
83
|
e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
|
|
82
|
-
n.querySelectorAll("[data-attribute-type]").forEach((
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
p(
|
|
86
|
-
}) : p(
|
|
84
|
+
n.querySelectorAll("[data-attribute-type]").forEach((i) => {
|
|
85
|
+
const a = i.getAttribute("data-attribute-type") || "", b = i.querySelectorAll(".attribute-cell");
|
|
86
|
+
b.length > 0 ? b.forEach((l) => {
|
|
87
|
+
p(l, a, u, t, r, o);
|
|
88
|
+
}) : p(i, a, u, t, r, o);
|
|
87
89
|
});
|
|
88
90
|
});
|
|
89
91
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
92
|
+
function q(e, u, r, o) {
|
|
93
|
+
const s = e.querySelectorAll(".recommendation-product-row");
|
|
94
|
+
if (!s.length)
|
|
93
95
|
return;
|
|
94
|
-
const [n] =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
p(
|
|
96
|
+
const [n] = s, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
97
|
+
s.forEach((i, a) => {
|
|
98
|
+
i.querySelectorAll("[data-attribute-type]").forEach((l) => {
|
|
99
|
+
const m = l.getAttribute("data-attribute-type") || "";
|
|
100
|
+
l.querySelectorAll(".attribute-cell").forEach(($, f) => {
|
|
101
|
+
const A = a * c + f;
|
|
102
|
+
p($, m, u, A, r, o);
|
|
101
103
|
});
|
|
102
104
|
});
|
|
103
105
|
});
|
|
104
106
|
}
|
|
105
|
-
function
|
|
107
|
+
function g(e, u, r, o) {
|
|
106
108
|
e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
|
|
107
|
-
|
|
109
|
+
q(n, u, r, o);
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
|
-
function
|
|
111
|
-
const
|
|
112
|
-
|
|
112
|
+
function h(e, u, r) {
|
|
113
|
+
const o = e.getAttribute("data-layout") || "grid", s = e.getAttribute("currency-alignment") || "after";
|
|
114
|
+
o === "list" ? d(e, u, s, r) : g(e, u, s, r);
|
|
113
115
|
}
|
|
114
|
-
function
|
|
116
|
+
function C(e, u) {
|
|
115
117
|
const r = e.match(/<!DOCTYPE[^>]*>/i);
|
|
116
118
|
return (r ? `${r[0]}
|
|
117
119
|
` : "") + u.documentElement.outerHTML;
|
|
118
120
|
}
|
|
119
|
-
function
|
|
121
|
+
function P(e) {
|
|
120
122
|
const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".recommendation-block-v2");
|
|
121
123
|
if (!o.length)
|
|
122
124
|
return e;
|
|
123
|
-
const { buildCampaignUrl: n } =
|
|
124
|
-
return o.forEach((
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
const { buildCampaignUrl: s } = _(), { isFeatureEnabled: n } = S(), t = n("liquidSyntax") ? "reco_" : "";
|
|
126
|
+
return o.forEach((i) => {
|
|
127
|
+
var b, l;
|
|
128
|
+
const a = i.getAttribute("recommendation-id");
|
|
129
|
+
a && ((b = i.parentNode) == null || b.insertBefore(r.createComment("REC_START"), i), (l = i.parentNode) == null || l.insertBefore(r.createComment("REC_END"), i.nextSibling), s(a), h(i, a, t));
|
|
130
|
+
}), C(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
128
131
|
}
|
|
129
132
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
y as formatPriceVariable,
|
|
134
|
+
P as prepareRecommendationBlocks
|
|
132
135
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const s = {
|
|
2
2
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
3
|
-
}, i =
|
|
3
|
+
}, i = {
|
|
4
|
+
CLIENT_ID: "clientId"
|
|
5
|
+
}, u = [
|
|
4
6
|
{ id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
|
|
5
7
|
{ id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
|
|
6
8
|
{ id: 13, key: "userBased", name: "User Based", path: "user-based" },
|
|
@@ -11,13 +13,13 @@ const s = {
|
|
|
11
13
|
{ id: 46, key: "mostValuableOfPartner", name: "Most Valuable Products", path: "most-valuable" },
|
|
12
14
|
{ id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
|
|
13
15
|
{ id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
|
|
14
|
-
],
|
|
16
|
+
], l = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], c = [
|
|
15
17
|
{ text: "before the amount", value: "0" },
|
|
16
18
|
{ text: "after the amount", value: "1" }
|
|
17
|
-
],
|
|
19
|
+
], d = [
|
|
18
20
|
{ text: "dot(.)", value: "." },
|
|
19
21
|
{ text: "comma(,)", value: "," }
|
|
20
|
-
],
|
|
22
|
+
], p = [
|
|
21
23
|
{ text: "0", value: "0" },
|
|
22
24
|
{ text: "1", value: "1" },
|
|
23
25
|
{ text: "2", value: "2" },
|
|
@@ -46,7 +48,7 @@ const s = {
|
|
|
46
48
|
], n = [
|
|
47
49
|
{ text: "true", value: "==" },
|
|
48
50
|
{ text: "false", value: "!=" }
|
|
49
|
-
],
|
|
51
|
+
], m = (t) => {
|
|
50
52
|
if (!t)
|
|
51
53
|
return e;
|
|
52
54
|
switch (t) {
|
|
@@ -65,13 +67,14 @@ const s = {
|
|
|
65
67
|
}
|
|
66
68
|
};
|
|
67
69
|
export {
|
|
68
|
-
|
|
69
|
-
i as
|
|
70
|
+
l as PriceAttributes,
|
|
71
|
+
i as QUERY_PARAMS,
|
|
72
|
+
u as RecommendationFeedSourceMaps,
|
|
70
73
|
s as URLS,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
p as currencyDecimalCounts,
|
|
75
|
+
c as currencyLocationMaps,
|
|
76
|
+
d as currencyOperators,
|
|
77
|
+
m as getOperatorOptions,
|
|
75
78
|
a as operatorOptionsForArrayOfStrings,
|
|
76
79
|
n as operatorOptionsForBooleans,
|
|
77
80
|
o as operatorOptionsForDates,
|
|
@@ -28,8 +28,8 @@ const e = 20, s = 320, t = "vertical", m = {
|
|
|
28
28
|
ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>[\S\s]*?<\/p>/gm,
|
|
29
29
|
ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>/gm,
|
|
30
30
|
COMPOSITION: /composition="true"/gm,
|
|
31
|
-
CUSTOM_FIELD: /{{[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
|
|
32
|
-
CUSTOM_FIELD_INDEXES_PART: /{{[0-9]+_[0-8]_/gm,
|
|
31
|
+
CUSTOM_FIELD: /{{(?:reco_)?[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
|
|
32
|
+
CUSTOM_FIELD_INDEXES_PART: /{{(?:reco_)?[0-9]+_[0-8]_/gm,
|
|
33
33
|
CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
|
|
34
34
|
}, n = {
|
|
35
35
|
PARAGRAPH_END_TAG: "</p>"
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-3b53a736],.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}.editor-actions[data-v-acff76a8]{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-3b53a736],.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}.editor-actions[data-v-acff76a8]{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-25780af6]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-25780af6]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-25780af6]{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-29b9af29] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-d073b1dc] .vueperslides__bullets{pointer-events:none!important}[data-v-d073b1dc] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
const { get:
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
import { QUERY_PARAMS as d, URLS as h } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = () => {
|
|
4
|
+
const { get: r } = a(), { get: s } = a({ headers: {} }), m = "6KcLM9TwheVB1mgK";
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await r("/newsletter/recommendations/create-data")).data;
|
|
9
9
|
} catch (e) {
|
|
10
10
|
throw console.error("fetchUserModalState error:", e), e;
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
fetchRecommendationFilters: async () => {
|
|
14
14
|
try {
|
|
15
|
-
const { data: e } = await
|
|
15
|
+
const { data: e } = await r("/stripo/email-recommendation-attributes");
|
|
16
16
|
return e;
|
|
17
17
|
} catch (e) {
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, i) => {
|
|
22
22
|
var n;
|
|
23
23
|
try {
|
|
24
|
-
const t =
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`${
|
|
24
|
+
const t = new URLSearchParams(Object.entries(i));
|
|
25
|
+
t.set(d.CLIENT_ID, m);
|
|
26
|
+
const c = decodeURIComponent(t.toString());
|
|
27
|
+
console.debug("🏁 Recommendation API Query:", c);
|
|
28
|
+
const o = await s(
|
|
29
|
+
`${h.RECOMMENDATION_API_URL}/v2/${e}?${c}`
|
|
30
30
|
);
|
|
31
|
-
return ((n =
|
|
31
|
+
return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
|
|
32
32
|
} catch (t) {
|
|
33
33
|
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
34
34
|
}
|
|
@@ -36,5 +36,5 @@ const f = () => {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
y as useRecommendationApi
|
|
40
40
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useHttp as d } from "../composables/useHttp.js";
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import f from "../static/templates/empty/index.html.js";
|
|
5
|
+
import g from "../static/templates/empty/style.css.js";
|
|
6
6
|
const E = () => {
|
|
7
7
|
const { get: s, post: c } = d(), { handleError: r } = m();
|
|
8
8
|
return {
|
|
9
9
|
getToken: async () => {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const { data: t } = await s("/stripo/get-user-token");
|
|
12
|
+
return t.body.token;
|
|
13
13
|
} catch (t) {
|
|
14
14
|
return r(t, "Failed to fetch token"), "";
|
|
15
15
|
}
|
|
@@ -27,14 +27,14 @@ const E = () => {
|
|
|
27
27
|
},
|
|
28
28
|
getDefaultTemplate: async () => {
|
|
29
29
|
const t = {
|
|
30
|
-
html:
|
|
31
|
-
css:
|
|
30
|
+
html: f,
|
|
31
|
+
css: g
|
|
32
32
|
};
|
|
33
33
|
try {
|
|
34
|
-
const e = new URLSearchParams(window.location.search), u = e.get("default-template"),
|
|
35
|
-
if (!i && !
|
|
34
|
+
const e = new URLSearchParams(window.location.search), u = e.get("default-template"), p = e.get("master"), a = u ? parseInt(u) : 0, i = a >= 1 && a <= y ? a : 0;
|
|
35
|
+
if (!i && !p)
|
|
36
36
|
return t;
|
|
37
|
-
const
|
|
37
|
+
const l = `/stripo/default-template/${i}`, { data: n } = await s(l), o = typeof n == "string" ? JSON.parse(n) : n;
|
|
38
38
|
return !o || typeof o != "object" || !("html" in o) || !("css" in o) ? t : o;
|
|
39
39
|
} catch (e) {
|
|
40
40
|
return r(e, "Failed to fetch default template"), t;
|
|
@@ -176,6 +176,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
176
176
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
177
177
|
/** Disable modules panel in the editor */
|
|
178
178
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
|
+
/** Enable Liquid template syntax */
|
|
180
|
+
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
181
|
}, undefined>;
|
|
180
182
|
/**
|
|
181
183
|
* Default block types available in Stripo
|
|
@@ -497,6 +499,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
497
499
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
498
500
|
/** Disable modules panel in the editor */
|
|
499
501
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
502
|
+
/** Enable Liquid template syntax */
|
|
503
|
+
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
500
504
|
}, undefined>, {}>;
|
|
501
505
|
/** Block configuration */
|
|
502
506
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -61,6 +61,7 @@ export declare const useConfig: () => {
|
|
|
61
61
|
displayConditions: boolean;
|
|
62
62
|
unsubscribe: boolean;
|
|
63
63
|
modulesDisabled: boolean;
|
|
64
|
+
liquidSyntax: boolean;
|
|
64
65
|
};
|
|
65
66
|
blocks: {
|
|
66
67
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -157,6 +158,7 @@ export declare const useConfig: () => {
|
|
|
157
158
|
displayConditions: boolean;
|
|
158
159
|
unsubscribe: boolean;
|
|
159
160
|
modulesDisabled: boolean;
|
|
161
|
+
liquidSyntax: boolean;
|
|
160
162
|
} | null>;
|
|
161
163
|
blocks: import("vue").ComputedRef<{
|
|
162
164
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param alignment - Currency alignment from block config: 'before' or 'after'
|
|
7
7
|
* @returns Formatted price string with currency variable in correct position
|
|
8
8
|
*/
|
|
9
|
-
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string): string;
|
|
9
|
+
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string, prefix?: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* Transforms recommendation block HTML by replacing product data with
|
|
12
12
|
* template variables.
|
|
@@ -3,6 +3,9 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
};
|
|
6
|
+
export declare const QUERY_PARAMS: {
|
|
7
|
+
CLIENT_ID: string;
|
|
8
|
+
};
|
|
6
9
|
export declare const RecommendationFeedSourceMaps: RecommendationFeedItem[];
|
|
7
10
|
export declare const PriceAttributes: string[];
|
|
8
11
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
@@ -66,6 +66,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
66
66
|
displayConditions: boolean;
|
|
67
67
|
unsubscribe: boolean;
|
|
68
68
|
modulesDisabled: boolean;
|
|
69
|
+
liquidSyntax: boolean;
|
|
69
70
|
};
|
|
70
71
|
blocks: {
|
|
71
72
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -168,6 +169,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
168
169
|
displayConditions: boolean;
|
|
169
170
|
unsubscribe: boolean;
|
|
170
171
|
modulesDisabled: boolean;
|
|
172
|
+
liquidSyntax: boolean;
|
|
171
173
|
};
|
|
172
174
|
blocks: {
|
|
173
175
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -270,6 +272,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
270
272
|
displayConditions: boolean;
|
|
271
273
|
unsubscribe: boolean;
|
|
272
274
|
modulesDisabled: boolean;
|
|
275
|
+
liquidSyntax: boolean;
|
|
273
276
|
};
|
|
274
277
|
blocks: {
|
|
275
278
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -372,6 +375,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
372
375
|
displayConditions: boolean;
|
|
373
376
|
unsubscribe: boolean;
|
|
374
377
|
modulesDisabled: boolean;
|
|
378
|
+
liquidSyntax: boolean;
|
|
375
379
|
};
|
|
376
380
|
blocks: {
|
|
377
381
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -474,6 +478,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
474
478
|
displayConditions: boolean;
|
|
475
479
|
unsubscribe: boolean;
|
|
476
480
|
modulesDisabled: boolean;
|
|
481
|
+
liquidSyntax: boolean;
|
|
477
482
|
};
|
|
478
483
|
blocks: {
|
|
479
484
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -576,6 +581,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
576
581
|
displayConditions: boolean;
|
|
577
582
|
unsubscribe: boolean;
|
|
578
583
|
modulesDisabled: boolean;
|
|
584
|
+
liquidSyntax: boolean;
|
|
579
585
|
};
|
|
580
586
|
blocks: {
|
|
581
587
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -678,6 +684,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
678
684
|
displayConditions: boolean;
|
|
679
685
|
unsubscribe: boolean;
|
|
680
686
|
modulesDisabled: boolean;
|
|
687
|
+
liquidSyntax: boolean;
|
|
681
688
|
};
|
|
682
689
|
blocks: {
|
|
683
690
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -780,6 +787,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
780
787
|
displayConditions: boolean;
|
|
781
788
|
unsubscribe: boolean;
|
|
782
789
|
modulesDisabled: boolean;
|
|
790
|
+
liquidSyntax: boolean;
|
|
783
791
|
};
|
|
784
792
|
blocks: {
|
|
785
793
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -882,6 +890,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
882
890
|
displayConditions: boolean;
|
|
883
891
|
unsubscribe: boolean;
|
|
884
892
|
modulesDisabled: boolean;
|
|
893
|
+
liquidSyntax: boolean;
|
|
885
894
|
};
|
|
886
895
|
blocks: {
|
|
887
896
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -984,6 +993,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
984
993
|
displayConditions: boolean;
|
|
985
994
|
unsubscribe: boolean;
|
|
986
995
|
modulesDisabled: boolean;
|
|
996
|
+
liquidSyntax: boolean;
|
|
987
997
|
};
|
|
988
998
|
blocks: {
|
|
989
999
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1086,6 +1096,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1086
1096
|
displayConditions: boolean;
|
|
1087
1097
|
unsubscribe: boolean;
|
|
1088
1098
|
modulesDisabled: boolean;
|
|
1099
|
+
liquidSyntax: boolean;
|
|
1089
1100
|
};
|
|
1090
1101
|
blocks: {
|
|
1091
1102
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1188,6 +1199,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1188
1199
|
displayConditions: boolean;
|
|
1189
1200
|
unsubscribe: boolean;
|
|
1190
1201
|
modulesDisabled: boolean;
|
|
1202
|
+
liquidSyntax: boolean;
|
|
1191
1203
|
};
|
|
1192
1204
|
blocks: {
|
|
1193
1205
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1290,6 +1302,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1290
1302
|
displayConditions: boolean;
|
|
1291
1303
|
unsubscribe: boolean;
|
|
1292
1304
|
modulesDisabled: boolean;
|
|
1305
|
+
liquidSyntax: boolean;
|
|
1293
1306
|
};
|
|
1294
1307
|
blocks: {
|
|
1295
1308
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1392,6 +1405,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1392
1405
|
displayConditions: boolean;
|
|
1393
1406
|
unsubscribe: boolean;
|
|
1394
1407
|
modulesDisabled: boolean;
|
|
1408
|
+
liquidSyntax: boolean;
|
|
1395
1409
|
};
|
|
1396
1410
|
blocks: {
|
|
1397
1411
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1494,6 +1508,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1494
1508
|
displayConditions: boolean;
|
|
1495
1509
|
unsubscribe: boolean;
|
|
1496
1510
|
modulesDisabled: boolean;
|
|
1511
|
+
liquidSyntax: boolean;
|
|
1497
1512
|
};
|
|
1498
1513
|
blocks: {
|
|
1499
1514
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1596,6 +1611,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1596
1611
|
displayConditions: boolean;
|
|
1597
1612
|
unsubscribe: boolean;
|
|
1598
1613
|
modulesDisabled: boolean;
|
|
1614
|
+
liquidSyntax: boolean;
|
|
1599
1615
|
};
|
|
1600
1616
|
blocks: {
|
|
1601
1617
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1698,6 +1714,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1698
1714
|
displayConditions: boolean;
|
|
1699
1715
|
unsubscribe: boolean;
|
|
1700
1716
|
modulesDisabled: boolean;
|
|
1717
|
+
liquidSyntax: boolean;
|
|
1701
1718
|
};
|
|
1702
1719
|
blocks: {
|
|
1703
1720
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1800,6 +1817,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1800
1817
|
displayConditions: boolean;
|
|
1801
1818
|
unsubscribe: boolean;
|
|
1802
1819
|
modulesDisabled: boolean;
|
|
1820
|
+
liquidSyntax: boolean;
|
|
1803
1821
|
};
|
|
1804
1822
|
blocks: {
|
|
1805
1823
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = `.amp-input-list,
|
|
2
2
|
.button,
|
|
3
3
|
.base-input,
|
|
4
4
|
ue-stripe-thumb,
|
|
5
5
|
.ue-stripe-thumb {
|
|
6
6
|
transition: all .5s ease;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
height: 100% !important;
|
|
11
|
+
min-height: 0 !important;
|
|
12
|
+
}
|
|
8
13
|
`;
|
|
9
14
|
export {
|
|
10
|
-
|
|
15
|
+
n as default
|
|
11
16
|
};
|
|
@@ -1,44 +1,53 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useActionsApi as T } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as P } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { DATA_ATTRIBUTES as l } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
5
|
+
import { parsePageList as h } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
6
|
+
import { useDynamicContentStore as C } from "../stores/dynamic-content.js";
|
|
7
|
+
import { useUnsubscribeStore as D } from "../stores/unsubscribe.js";
|
|
8
|
+
function x(i, e) {
|
|
9
|
+
const r = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${l.PAGE_LIST}]`), n = [];
|
|
10
|
+
return r.forEach((t) => {
|
|
11
|
+
const o = t.getAttribute(l.PAGE_LIST);
|
|
12
|
+
o && n.push(...h(o));
|
|
13
|
+
}), e.filter((t) => n.includes(t));
|
|
14
|
+
}
|
|
15
|
+
const I = () => {
|
|
16
|
+
const i = C(), e = D(), { getCompiledEmail: a, getTemplateData: m } = T(), { compileHtml: r } = P();
|
|
8
17
|
return {
|
|
9
18
|
prepareTemplateDetails: async () => {
|
|
10
|
-
const { html:
|
|
19
|
+
const { html: t, ampHtml: o = "", ampErrors: p = [] } = await a({
|
|
11
20
|
minimize: !0,
|
|
12
21
|
resetDataSavedFlag: !1
|
|
13
|
-
}), { html:
|
|
22
|
+
}), { html: u, css: d, syncModulesIds: g = [] } = await m();
|
|
14
23
|
e.selectedUnsubscribePages.length && await e.fetchTemplates();
|
|
15
|
-
const { compiledHtml:
|
|
24
|
+
const { compiledHtml: c, stats: s, appliedRules: S } = r(t), b = i.getSelectedDynamicContentList, f = A();
|
|
16
25
|
return console.debug("HTML Compilation Stats:", {
|
|
17
|
-
originalSize:
|
|
18
|
-
compiledSize:
|
|
19
|
-
reduction: `${
|
|
20
|
-
appliedRules:
|
|
21
|
-
executionTime: `${
|
|
26
|
+
originalSize: s.originalSize,
|
|
27
|
+
compiledSize: s.compiledSize,
|
|
28
|
+
reduction: `${s.reductionPercentage.toFixed(2)}%`,
|
|
29
|
+
appliedRules: S,
|
|
30
|
+
executionTime: `${s.executionTime.toFixed(2)}ms`
|
|
22
31
|
}), {
|
|
23
|
-
dynamicContentList:
|
|
24
|
-
compiledHtml:
|
|
25
|
-
rawHtml:
|
|
26
|
-
css:
|
|
27
|
-
ampHtml:
|
|
28
|
-
ampErrors:
|
|
29
|
-
modules:
|
|
32
|
+
dynamicContentList: b,
|
|
33
|
+
compiledHtml: c,
|
|
34
|
+
rawHtml: u,
|
|
35
|
+
css: d,
|
|
36
|
+
ampHtml: o,
|
|
37
|
+
ampErrors: p,
|
|
38
|
+
modules: g.map(Number),
|
|
30
39
|
recommendation: {
|
|
31
|
-
campaignUrls:
|
|
40
|
+
campaignUrls: f.recommendationCampaignUrls,
|
|
32
41
|
configs: {}
|
|
33
42
|
},
|
|
34
43
|
unsubscribe: {
|
|
35
44
|
status: e.unsubscribePagesStatus,
|
|
36
|
-
config: e.selectedUnsubscribePages
|
|
45
|
+
config: x(c, e.selectedUnsubscribePages)
|
|
37
46
|
}
|
|
38
47
|
};
|
|
39
48
|
}
|
|
40
49
|
};
|
|
41
50
|
};
|
|
42
51
|
export {
|
|
43
|
-
|
|
52
|
+
I as useTemplatePreparation
|
|
44
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.5b87594",
|
|
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",
|