@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.f0d4ffd
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 +1 -0
- package/dist/@types/config/schemas.js +66 -54
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useSave.js +23 -15
- package/dist/composables/useStripo.js +44 -41
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +158 -44
- package/dist/config/compiler/unsubscribeCompilerRules.js +37 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +49 -46
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/recommendation.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +94 -92
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +31 -31
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +28 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/composables/useConfig.d.ts +12 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.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/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +108 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/static/styles/components/button.css.js +3 -2
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/stores/preview.js +4 -3
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_PRODUCTS_PER_ROW as
|
|
2
|
-
import { DEFAULT_CARD_COMPOSITION as
|
|
3
|
-
import { gridElementRenderer as
|
|
4
|
-
const
|
|
1
|
+
import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
|
|
2
|
+
import { DEFAULT_CARD_COMPOSITION as E, spacer as I, getDefaultProducts as _, createBlockTemplate as S, DEFAULTS as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
|
|
3
|
+
import { gridElementRenderer as w, ATTRIBUTE_CELL_CLASS as D, DEFAULT_CELL_PADDING as C } from "./elementRenderer.js";
|
|
4
|
+
const O = `
|
|
5
5
|
<tr class="recommendation-product-row">
|
|
6
6
|
<td>
|
|
7
7
|
<table
|
|
@@ -18,7 +18,7 @@ const C = `
|
|
|
18
18
|
</table>
|
|
19
19
|
</td>
|
|
20
20
|
</tr>
|
|
21
|
-
`,
|
|
21
|
+
`, g = `
|
|
22
22
|
<tr
|
|
23
23
|
class="recommendation-attribute-row"
|
|
24
24
|
data-attribute-type="{-{-ATTR_TYPE-}-}"
|
|
@@ -27,37 +27,38 @@ const C = `
|
|
|
27
27
|
{-{-CELLS-}-}
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
return
|
|
30
|
+
function P(t, e, o, r = E, n = {}) {
|
|
31
|
+
const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${D}" style="padding: ${C};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a = A(o, r, n);
|
|
32
|
+
return r.filter((s) => a[s]).map((s) => {
|
|
33
|
+
const T = f[s] ?? !0, u = T ? "" : 'style="display: none;"', R = t.map((m) => a[s](m).replace("<td", `<td width="${c}%"`)).join("");
|
|
34
|
+
return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", T ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + d);
|
|
35
35
|
}).join("");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
for (let
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
const
|
|
43
|
-
r,
|
|
44
|
-
e,
|
|
37
|
+
function U(t, e, o, r, n = {}) {
|
|
38
|
+
const c = [];
|
|
39
|
+
for (let l = 0; l < t.length; l += e)
|
|
40
|
+
c.push(t.slice(l, l + e));
|
|
41
|
+
return c.map((l, d) => {
|
|
42
|
+
const a = P(
|
|
45
43
|
l,
|
|
44
|
+
e,
|
|
45
|
+
o,
|
|
46
|
+
r,
|
|
46
47
|
n
|
|
47
|
-
),
|
|
48
|
-
return
|
|
48
|
+
), p = O.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
|
|
49
|
+
return d > 0 ? I + p : p;
|
|
49
50
|
}).join("");
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
52
|
+
function h(t, e, o, r = {}) {
|
|
53
|
+
return U(t, e, w, o, r);
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
-
const e = t ? `ins-recommendation-v3-block-${t}` : void 0,
|
|
56
|
-
return
|
|
55
|
+
function F(t) {
|
|
56
|
+
const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = S("grid", e), r = _(), n = h(r, L);
|
|
57
|
+
return o.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
57
58
|
}
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
F as getDefaultTemplate,
|
|
61
|
+
P as prepareGridAttributeRows,
|
|
62
|
+
U as prepareGridProductRows,
|
|
63
|
+
h as prepareProductRows
|
|
63
64
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
|
|
2
2
|
import { prepareProductRows as c } from "./grid/template.js";
|
|
3
|
-
import { prepareProductRows as
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
7
|
-
const { productsPerRow:
|
|
8
|
-
return c(
|
|
3
|
+
import { prepareProductRows as R } from "./list/template.js";
|
|
4
|
+
function a(o, t, r = {}) {
|
|
5
|
+
if (t === "list")
|
|
6
|
+
return R(o, r.composition, r.filterList);
|
|
7
|
+
const { productsPerRow: e = s, composition: p, filterList: i } = r;
|
|
8
|
+
return c(o, e, p, i);
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
a as prepareProductRows
|
|
12
12
|
};
|
|
@@ -166,11 +166,13 @@ const I = {
|
|
|
166
166
|
/**
|
|
167
167
|
* Custom attribute row template — same tr-td structure as Name, Price, etc.
|
|
168
168
|
* Used by `buildElementRenderer` for `customAttr:*` composition entries.
|
|
169
|
+
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
170
|
+
* @param content - Display content for the cell
|
|
169
171
|
*/
|
|
170
172
|
[y]: (t, e) => `
|
|
171
173
|
<tr>
|
|
172
174
|
<td
|
|
173
|
-
${u}="
|
|
175
|
+
${u}="${t}"
|
|
174
176
|
class="esd-block-text product-custom-attribute"
|
|
175
177
|
esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
|
|
176
178
|
align="left">
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as
|
|
2
|
-
import { DEFAULT_CARD_COMPOSITION as
|
|
3
|
-
import { listElementRenderer as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_BUTTON as a } from "../../constants/selectors.js";
|
|
2
|
+
import { DEFAULT_CARD_COMPOSITION as m, spacer as C, buildElementRenderer as b, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
|
|
3
|
+
import { listElementRenderer as R } from "./elementRenderer.js";
|
|
4
|
+
function f(r, n, l) {
|
|
5
|
+
const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
6
6
|
return `<tr
|
|
7
7
|
class="recommendation-attribute-row"
|
|
8
8
|
data-attribute-type="${n}"
|
|
9
|
-
data-visibility="${
|
|
9
|
+
data-visibility="${l ? "1" : "0"}"${t}>${o}</tr>`;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const y = `
|
|
12
12
|
<tr class="recommendation-product-row">
|
|
13
13
|
<td style="padding: 0 5px;">
|
|
14
14
|
<table
|
|
@@ -26,29 +26,29 @@ const f = `
|
|
|
26
26
|
</td>
|
|
27
27
|
</tr>
|
|
28
28
|
`;
|
|
29
|
-
function
|
|
30
|
-
const t =
|
|
29
|
+
function O(r, n = m, l = {}) {
|
|
30
|
+
const t = b(R, n, l), o = t[d](r), c = `
|
|
31
31
|
<td class="product-info-cell" valign="middle" style="padding: 15px;">
|
|
32
32
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
33
33
|
<tbody>
|
|
34
|
-
${n.filter((e) => e !==
|
|
35
|
-
const
|
|
36
|
-
return
|
|
34
|
+
${n.filter((e) => e !== d && e !== a).filter((e) => t[e]).map((e) => {
|
|
35
|
+
const u = T[e] ?? !0;
|
|
36
|
+
return f(t[e](r), e, u);
|
|
37
37
|
}).join(`
|
|
38
38
|
`)}
|
|
39
39
|
</tbody>
|
|
40
40
|
</table>
|
|
41
41
|
</td>
|
|
42
|
-
`,
|
|
43
|
-
return
|
|
42
|
+
`, s = t[a](r), p = o + c + s;
|
|
43
|
+
return y.replace("{-{-PRODUCT_CONTENT-}-}", p);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return r.map((t,
|
|
47
|
-
const
|
|
48
|
-
return
|
|
45
|
+
function D(r, n, l = {}) {
|
|
46
|
+
return r.map((t, o) => {
|
|
47
|
+
const i = O(t, n, l);
|
|
48
|
+
return o > 0 ? C + i : i;
|
|
49
49
|
}).join("");
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
O as getListProductCard,
|
|
53
|
+
D as prepareProductRows
|
|
54
54
|
};
|
|
@@ -1,55 +1,60 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as
|
|
2
|
-
function
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as b, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OMNIBUS_DISCOUNT as C, ATTR_PRODUCT_BUTTON as f, ATTR_CUSTOM_PREFIX as u } from "../constants/selectors.js";
|
|
2
|
+
function U(t) {
|
|
3
3
|
return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function R(t, e) {
|
|
6
|
+
const n = Object.values(e).find((r) => r.attributeName === t);
|
|
7
|
+
return (n == null ? void 0 : n.type) === "defaultAttribute";
|
|
8
|
+
}
|
|
9
|
+
function y(t, e) {
|
|
10
|
+
return R(t, e) ? t : `product_attribute.${t}`;
|
|
11
|
+
}
|
|
12
|
+
const P = Symbol("customCellHtml");
|
|
13
|
+
function S(t, e, n = {}) {
|
|
14
|
+
const r = t[P];
|
|
15
|
+
if (!r)
|
|
9
16
|
return { ...t };
|
|
10
|
-
const
|
|
11
|
-
return e.filter((o) => o.startsWith(
|
|
12
|
-
const s = o.substring(
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
c != null ? String(c) : l
|
|
19
|
-
);
|
|
17
|
+
const l = { ...t };
|
|
18
|
+
return e.filter((o) => o.startsWith(u) && !l[o]).forEach((o) => {
|
|
19
|
+
const s = o.substring(u.length), a = U(s), D = y(s, n), O = R(s, n);
|
|
20
|
+
l[o] = (d) => {
|
|
21
|
+
var p;
|
|
22
|
+
const i = O ? d[s] : (p = d.product_attributes) == null ? void 0 : p[s];
|
|
23
|
+
let c = a;
|
|
24
|
+
return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(D, c);
|
|
20
25
|
};
|
|
21
|
-
}),
|
|
26
|
+
}), l;
|
|
22
27
|
}
|
|
23
|
-
const
|
|
28
|
+
const L = {
|
|
24
29
|
TITLE: "You May Also Like!"
|
|
25
|
-
},
|
|
30
|
+
}, M = [
|
|
26
31
|
m,
|
|
27
|
-
|
|
32
|
+
b,
|
|
28
33
|
T,
|
|
29
|
-
u,
|
|
30
34
|
_,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
g,
|
|
36
|
+
C,
|
|
37
|
+
f
|
|
38
|
+
], $ = {
|
|
34
39
|
[m]: !0,
|
|
35
|
-
[
|
|
36
|
-
[
|
|
40
|
+
[b]: !0,
|
|
41
|
+
[_]: !0,
|
|
37
42
|
[T]: !0,
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
},
|
|
43
|
+
[g]: !1,
|
|
44
|
+
[C]: !1,
|
|
45
|
+
[f]: !0
|
|
46
|
+
}, h = `
|
|
42
47
|
<tr>
|
|
43
48
|
<td class="spacer" style="height: 10px;"></td>
|
|
44
49
|
</tr>
|
|
45
|
-
`,
|
|
46
|
-
function
|
|
47
|
-
return !t || typeof t != "string" || t.trim() === "" ?
|
|
50
|
+
`, A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
|
|
51
|
+
function w(t) {
|
|
52
|
+
return !t || typeof t != "string" || t.trim() === "" ? A : t.startsWith("http://") ? t.replace("http://", "https://") : t;
|
|
48
53
|
}
|
|
49
|
-
function
|
|
54
|
+
function I(t) {
|
|
50
55
|
return {
|
|
51
56
|
name: "Product Name",
|
|
52
|
-
image_url:
|
|
57
|
+
image_url: A,
|
|
53
58
|
price: { USD: 18 },
|
|
54
59
|
original_price: { USD: 20 },
|
|
55
60
|
discount: { USD: 2 },
|
|
@@ -61,13 +66,13 @@ function D(t) {
|
|
|
61
66
|
category: []
|
|
62
67
|
};
|
|
63
68
|
}
|
|
64
|
-
function
|
|
69
|
+
function N(t = 6) {
|
|
65
70
|
return Array.from(
|
|
66
71
|
{ length: t },
|
|
67
|
-
(e, n) =>
|
|
72
|
+
(e, n) => I(String(n + 1))
|
|
68
73
|
);
|
|
69
74
|
}
|
|
70
|
-
function
|
|
75
|
+
function k(t = "grid", e) {
|
|
71
76
|
const n = t === "list" ? `
|
|
72
77
|
data-layout="list"` : "", r = e ? ` ${e}` : "";
|
|
73
78
|
return `
|
|
@@ -105,7 +110,7 @@ function y(t = "grid", e) {
|
|
|
105
110
|
</table>
|
|
106
111
|
</td>
|
|
107
112
|
</tr>
|
|
108
|
-
${
|
|
113
|
+
${h}
|
|
109
114
|
<tr>
|
|
110
115
|
<td>
|
|
111
116
|
<table
|
|
@@ -144,15 +149,17 @@ function y(t = "grid", e) {
|
|
|
144
149
|
`;
|
|
145
150
|
}
|
|
146
151
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
P as CUSTOM_CELL_HTML,
|
|
153
|
+
L as DEFAULTS,
|
|
154
|
+
M as DEFAULT_CARD_COMPOSITION,
|
|
155
|
+
$ as DEFAULT_CARD_VISIBILITY,
|
|
156
|
+
A as PLACEHOLDER_IMAGE,
|
|
157
|
+
S as buildElementRenderer,
|
|
158
|
+
k as createBlockTemplate,
|
|
159
|
+
N as getDefaultProducts,
|
|
160
|
+
R as isDefaultAttribute,
|
|
161
|
+
y as resolveProductAttrValue,
|
|
162
|
+
w as sanitizeImageUrl,
|
|
163
|
+
h as spacer,
|
|
164
|
+
U as toDisplayName
|
|
158
165
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
2
|
var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
3
|
var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { useConfig as d } from "../../composables/useConfig.js";
|
|
5
|
+
import { mergeTagToDynamicContent as m, dynamicContentToMergeTags as u } from "../../utils/genericUtil.js";
|
|
6
|
+
import { UIElement as h, UIElementType as a, UEAttr as T, UIElementTagRegistry as y } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { ExternalMergeTagsLibrary as C } from "./dynamic-content-modal.js";
|
|
8
|
+
const l = "external-dynamic-content-ui-element", L = "button-add-dynamic-content";
|
|
9
|
+
class w extends y {
|
|
9
10
|
registerUiElements(s) {
|
|
10
11
|
s[a.MERGETAGS] = l;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
class
|
|
14
|
+
class f extends h {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
r(this, "mergeTagsButton", null);
|
|
@@ -43,7 +44,7 @@ class b extends u {
|
|
|
43
44
|
onAttributeUpdated(t, e) {
|
|
44
45
|
if (t !== "mergeTag" || !(e != null && e.value))
|
|
45
46
|
return;
|
|
46
|
-
const n =
|
|
47
|
+
const n = m(e), i = this._getLastClickedPosition();
|
|
47
48
|
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
|
|
48
49
|
}
|
|
49
50
|
openMergeTagLibrary() {
|
|
@@ -55,10 +56,14 @@ class b extends u {
|
|
|
55
56
|
* Dispatches event with dynamic content data and position
|
|
56
57
|
*/
|
|
57
58
|
_openDynamicContentLibrary(t, e) {
|
|
58
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
59
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new C()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
59
60
|
t,
|
|
60
61
|
(n) => {
|
|
61
|
-
n.text && n.value
|
|
62
|
+
if (n.text && n.value) {
|
|
63
|
+
const { isFeatureEnabled: i } = d();
|
|
64
|
+
this.api.triggerValueChange(u([n], i("liquidSyntax"))[0]);
|
|
65
|
+
} else
|
|
66
|
+
this.api.triggerValueChange(null);
|
|
62
67
|
},
|
|
63
68
|
e
|
|
64
69
|
);
|
|
@@ -142,7 +147,7 @@ class b extends u {
|
|
|
142
147
|
<${a.BUTTON}
|
|
143
148
|
id="guido__btn-add-dynamic-content"
|
|
144
149
|
class="btn btn-primary"
|
|
145
|
-
${
|
|
150
|
+
${T.BUTTON.name}="${L}">
|
|
146
151
|
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
147
152
|
</${a.ICON}>
|
|
148
153
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -151,6 +156,6 @@ class b extends u {
|
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
158
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
w as DynamicContentTagRegistry,
|
|
160
|
+
f as DynamicContentUiElementExtension
|
|
156
161
|
};
|
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-
|
|
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-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-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}
|
package/dist/package.json.js
CHANGED
|
@@ -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;
|