@useinsider/guido 3.9.1-beta.6e7cd3e → 3.9.1-beta.8a96896
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/header/AiStatusPill.vue.js +18 -0
- package/dist/components/organisms/header/AiStatusPill.vue2.js +17 -0
- package/dist/components/organisms/header/EditorToolbar.vue.js +2 -2
- package/dist/components/organisms/header/EditorToolbar.vue2.js +7 -6
- package/dist/composables/useAiStatus.js +13 -0
- package/dist/composables/useCortexBlueprintBridge.js +49 -42
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +106 -119
- package/dist/enums/defaults.js +7 -4
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +75 -69
- package/dist/guido.css +1 -1
- package/dist/services/blankTemplate.js +34 -0
- package/dist/services/stripoApi.js +13 -18
- package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +2 -0
- package/dist/src/composables/useAiStatus.d.ts +11 -0
- package/dist/src/enums/defaults.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +6 -0
- package/dist/src/services/blankTemplate.d.ts +11 -0
- package/dist/src/stores/guido-ai-status.d.ts +10 -0
- package/dist/stores/guido-ai-status.js +12 -0
- package/dist/utils/pairProductVariables.js +65 -64
- package/package.json +1 -1
- package/dist/static/templates/empty/index.html.js +0 -74
- package/dist/static/templates/empty/style.css.js +0 -779
|
@@ -1,84 +1,85 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (d)
|
|
1
|
+
import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
function q(w) {
|
|
3
|
+
const y = w.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), T = new DOMParser().parseFromString(y, "text/html"), C = L.PAIRS_FOR_EXTENSION;
|
|
4
|
+
Object.entries(C).forEach(([r, f]) => {
|
|
5
|
+
T.querySelectorAll(".ins-product-td").forEach((o) => {
|
|
6
|
+
const A = o.getAttribute("data-number") || "1", b = o.getAttribute("data-type") || "CART_ITEMS";
|
|
7
|
+
o.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
|
|
8
|
+
var k, F, I;
|
|
9
|
+
const $ = e.getAttribute("data-type") || b, d = e.getAttribute("data-number") || A, u = f[$];
|
|
10
|
+
if (u)
|
|
12
11
|
switch (r) {
|
|
13
12
|
case "imageSrc": {
|
|
14
13
|
let t = null, i = null;
|
|
15
14
|
if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
|
|
16
15
|
break;
|
|
17
|
-
const a =
|
|
16
|
+
const a = u.DEFAULT, s = u.ATTR;
|
|
18
17
|
if (a && t.src) {
|
|
19
|
-
const
|
|
18
|
+
const c = t.src;
|
|
20
19
|
a.some((h) => {
|
|
21
|
-
const l = h.split("/").pop() || "",
|
|
22
|
-
return
|
|
23
|
-
}) && (t.src = `{{${s}_${
|
|
20
|
+
const l = h.split("/").pop() || "", g = c.split("/").pop() || "";
|
|
21
|
+
return c.includes(h) || c.includes(l) || g === l;
|
|
22
|
+
}) && (t.src = `{{${s}_${d}}}`);
|
|
24
23
|
}
|
|
25
|
-
const n = (
|
|
26
|
-
if (n && t.setAttribute("alt", `{{${n}_${
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const E =
|
|
30
|
-
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${
|
|
24
|
+
const n = (F = (k = C.name) == null ? void 0 : k[$]) == null ? void 0 : F.ATTR;
|
|
25
|
+
if (n && t.setAttribute("alt", `{{${n}_${d}}}`), i) {
|
|
26
|
+
const c = (I = C.itemLink) == null ? void 0 : I[$];
|
|
27
|
+
if (c) {
|
|
28
|
+
const E = c.HREF, h = c.DEFAULT_HREF || "#!", l = i.href;
|
|
29
|
+
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${d}}}`);
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
break;
|
|
34
33
|
}
|
|
35
34
|
case "name": {
|
|
36
|
-
const t =
|
|
37
|
-
e.textContent && (e.textContent = `{{${i}_${
|
|
35
|
+
const t = u, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
|
|
36
|
+
e.textContent && (e.textContent = `{{${i}_${d}}}`);
|
|
38
37
|
const n = e.closest("a") || (e.tagName === "A" ? e : null);
|
|
39
38
|
if (n && s) {
|
|
40
|
-
const
|
|
41
|
-
(
|
|
39
|
+
const c = n.href, E = `${window.location.href}${a}`;
|
|
40
|
+
(c === E || c.endsWith(a)) && (n.href = `{{${s}_${d}}}`);
|
|
42
41
|
}
|
|
43
42
|
break;
|
|
44
43
|
}
|
|
45
44
|
case "price":
|
|
46
45
|
case "originalPrice": {
|
|
47
|
-
const t =
|
|
46
|
+
const t = u, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", c = e.getAttribute("data-curency") || "before";
|
|
48
47
|
let E;
|
|
49
48
|
n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
|
|
50
49
|
const h = t.CURRENCY;
|
|
51
|
-
let l = `{{${E}_${
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
let l = `{{${E}_${d}}}`;
|
|
51
|
+
if (h) {
|
|
52
|
+
const g = `{{${h}_${d}}}`;
|
|
53
|
+
l = c === "after" ? `${l} ${g}` : `${g} ${l}`;
|
|
54
|
+
}
|
|
55
|
+
e.textContent = l;
|
|
55
56
|
break;
|
|
56
57
|
}
|
|
57
58
|
case "quantity": {
|
|
58
|
-
const t =
|
|
59
|
-
e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${
|
|
59
|
+
const t = u, i = t.ATTR, a = t.DEFAULT;
|
|
60
|
+
e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${d}}}`);
|
|
60
61
|
break;
|
|
61
62
|
}
|
|
62
63
|
case "button": {
|
|
63
|
-
const t =
|
|
64
|
+
const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
|
|
64
65
|
if (s) {
|
|
65
|
-
const n = s.href || "",
|
|
66
|
-
(n === "" || n === "#" || n ===
|
|
66
|
+
const n = s.href || "", c = `${window.location.href}${a}`;
|
|
67
|
+
(n === "" || n === "#" || n === c || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${d}}}`);
|
|
67
68
|
}
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
71
|
case "itemLink": {
|
|
71
|
-
const t =
|
|
72
|
+
const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
|
|
72
73
|
if (s.href) {
|
|
73
|
-
const n = s.href,
|
|
74
|
-
(n ===
|
|
74
|
+
const n = s.href, c = `${window.location.href}${a}`;
|
|
75
|
+
(n === c || n.endsWith(a)) && (s.href = `{{${i}_${d}}}`);
|
|
75
76
|
}
|
|
76
77
|
break;
|
|
77
78
|
}
|
|
78
79
|
default: {
|
|
79
|
-
if ("ATTR" in
|
|
80
|
-
const t =
|
|
81
|
-
e.textContent && (e.textContent = `{{${t}_${
|
|
80
|
+
if ("ATTR" in u) {
|
|
81
|
+
const t = u.ATTR;
|
|
82
|
+
e.textContent && (e.textContent = `{{${t}_${d}}}`);
|
|
82
83
|
}
|
|
83
84
|
break;
|
|
84
85
|
}
|
|
@@ -86,48 +87,48 @@ function W(M) {
|
|
|
86
87
|
});
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
|
-
const
|
|
90
|
-
` : "",
|
|
91
|
-
|
|
92
|
-
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1",
|
|
93
|
-
|
|
90
|
+
const S = y.match(/<!DOCTYPE[^>]*>/i), M = S ? `${S[0]}
|
|
91
|
+
` : "", P = T.querySelectorAll(".ins-product-td"), H = [];
|
|
92
|
+
P.forEach((r) => {
|
|
93
|
+
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", o = r.getAttribute("data-nodup"), A = r.outerHTML;
|
|
94
|
+
H.push({
|
|
94
95
|
element: r,
|
|
95
96
|
outerHtml: A,
|
|
96
97
|
type: f,
|
|
97
98
|
number: p,
|
|
98
|
-
nodup:
|
|
99
|
+
nodup: o || void 0
|
|
99
100
|
});
|
|
100
101
|
});
|
|
101
|
-
let _ =
|
|
102
|
-
|
|
103
|
-
let
|
|
102
|
+
let _ = M + T.documentElement.outerHTML;
|
|
103
|
+
H.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
|
|
104
|
+
let o = "";
|
|
104
105
|
switch (f) {
|
|
105
106
|
case "CART_ITEMS":
|
|
106
|
-
|
|
107
|
+
o = "ins_apr_total_product_kind";
|
|
107
108
|
break;
|
|
108
109
|
case "BROWSED_ITEMS":
|
|
109
|
-
|
|
110
|
+
o = "browsed_item_total_product_kind";
|
|
110
111
|
break;
|
|
111
112
|
case "PURCHASED_ITEMS":
|
|
112
|
-
|
|
113
|
+
o = "purchased_item_total_product_kind";
|
|
113
114
|
break;
|
|
114
115
|
}
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
116
|
+
if (o) {
|
|
117
|
+
const b = parseInt(p) - 1, $ = `${`{% if ${o} > ${b} %}`}${r}{% endif %}`;
|
|
117
118
|
_ = _.replace(r, $);
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
|
-
const
|
|
121
|
-
return
|
|
121
|
+
const D = T.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), R = [];
|
|
122
|
+
return D.forEach((r) => {
|
|
122
123
|
const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
|
|
123
124
|
if (!f || p !== "CART_ITEMS")
|
|
124
125
|
return;
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
const A =
|
|
128
|
-
|
|
126
|
+
const o = r.closest(".product-original-price-class");
|
|
127
|
+
if (o) {
|
|
128
|
+
const A = o.outerHTML;
|
|
129
|
+
R.some((m) => m.tdOuterHtml === A) || R.push({ tdOuterHtml: A, number: f });
|
|
129
130
|
}
|
|
130
|
-
}),
|
|
131
|
+
}), R.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
|
|
131
132
|
const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
|
|
132
133
|
if (!_.includes(p) && !r.includes("{% if")) {
|
|
133
134
|
const A = `${p}${r}{% endif %}`;
|
|
@@ -136,5 +137,5 @@ function W(M) {
|
|
|
136
137
|
}), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
137
138
|
}
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
q as pairProductVariables
|
|
140
141
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.9.1-beta.
|
|
3
|
+
"version": "3.9.1-beta.8a96896",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const t = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta content="width=device-width, initial-scale=1" name="viewport">
|
|
7
|
-
<meta name="x-apple-disable-message-reformatting">
|
|
8
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
9
|
-
<meta content="telephone=no" name="format-detection">
|
|
10
|
-
<title></title>
|
|
11
|
-
<!--[if (mso 16)]><style type="text/css">a{text-decoration:none}</style><![endif]-->
|
|
12
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
13
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
14
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
15
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
16
|
-
<!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]-->
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class="es-wrapper-color">
|
|
21
|
-
<!--[if gte mso 9]>
|
|
22
|
-
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
|
|
23
|
-
<v:fill type="tile" color="#f6f6f6"></v:fill>
|
|
24
|
-
</v:background>
|
|
25
|
-
<![endif]-->
|
|
26
|
-
<table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0">
|
|
27
|
-
<tbody>
|
|
28
|
-
<tr>
|
|
29
|
-
<td class="esd-email-paddings" valign="top">
|
|
30
|
-
<table class="es-content esd-footer-popover" cellspacing="0" cellpadding="0" align="center">
|
|
31
|
-
<tbody>
|
|
32
|
-
<tr>
|
|
33
|
-
<td class="esd-stripe" align="center">
|
|
34
|
-
<table class="es-content-body" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center">
|
|
35
|
-
<tbody>
|
|
36
|
-
<tr>
|
|
37
|
-
<td class="esd-structure es-p20" align="left">
|
|
38
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
39
|
-
<tbody>
|
|
40
|
-
<tr>
|
|
41
|
-
<td width="560" class="esd-container-frame" align="center" valign="top">
|
|
42
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
43
|
-
<tbody>
|
|
44
|
-
<tr>
|
|
45
|
-
<td align="center" class="esd-empty-container" style="display: none;"></td>
|
|
46
|
-
</tr>
|
|
47
|
-
</tbody>
|
|
48
|
-
</table>
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
</tbody>
|
|
52
|
-
</table>
|
|
53
|
-
</td>
|
|
54
|
-
</tr>
|
|
55
|
-
</tbody>
|
|
56
|
-
</table>
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
</tbody>
|
|
60
|
-
</table>
|
|
61
|
-
</td>
|
|
62
|
-
</tr>
|
|
63
|
-
</tbody>
|
|
64
|
-
</table>
|
|
65
|
-
</div>
|
|
66
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px;"></div>
|
|
67
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px; padding: 0px; border: 0px none; width: 1px;"></div>
|
|
68
|
-
</body>
|
|
69
|
-
|
|
70
|
-
</html>
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
t as default
|
|
74
|
-
};
|