@useinsider/guido 2.1.0-beta.d5b6dd6 → 2.1.0-beta.da0e48e
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/extensions/recommendation/FilterSelectionDrawer.vue2.js +15 -14
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
- package/dist/composables/useHtmlValidator.js +114 -104
- package/dist/composables/useRecommendation.js +54 -21
- package/dist/composables/useStripo.js +1 -1
- package/dist/config/compiler/recommendationCompilerRules.js +45 -39
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +121 -0
- package/dist/config/{localePatch → i18n/en}/index.js +5 -7
- package/dist/config/{localePatch → i18n/en}/toasters.json.js +7 -2
- package/dist/config/i18n/index.js +7 -0
- package/dist/config/migrator/itemsBlockMigrator.js +127 -122
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/enums/extensions/recommendationBlock.js +1 -1
- package/dist/enums/recommendation.js +16 -15
- package/dist/extensions/Blocks/Recommendation/block.js +133 -9
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +66 -0
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +22 -0
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +21 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +92 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +102 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +209 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +52 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +250 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +70 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +160 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +67 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +307 -0
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +108 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +19 -3
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
- package/dist/extensions/Blocks/Recommendation/services/configService.js +240 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +254 -207
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +228 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +66 -0
- package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +169 -0
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +134 -0
- package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +26 -15
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
- package/dist/extensions/Blocks/controlFactories.js +125 -93
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +242 -186
- package/dist/services/recommendationApi.js +11 -8
- package/dist/services/stripoApi.js +20 -17
- package/dist/services/templateLibraryApi.js +16 -13
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +17 -0
- package/dist/src/config/i18n/en/index.d.ts +1 -0
- package/dist/src/config/i18n/index.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +67 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +41 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +52 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +79 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +60 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +221 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +83 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
- package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +138 -468
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +41 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +66 -0
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +166 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/static/styles/components/notification.css.js +4 -0
- package/dist/static/styles/components/tools.css.js +6 -2
- package/dist/static/styles/customEditorStyle.css.js +35 -11
- package/dist/static/styles/variables.css.js +2 -1
- package/dist/static/templates/empty/index.html.js +74 -0
- package/dist/static/templates/empty/style.css.js +779 -0
- package/dist/stores/unsubscribe.js +37 -34
- package/dist/utils/pairProductVariables.js +57 -56
- package/dist/utils/templatePreparation.js +15 -14
- package/package.json +2 -2
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
- package/dist/extensions/Blocks/Recommendation/control.js +0 -336
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
- package/dist/src/config/localePatch/index.d.ts +0 -140
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
- /package/dist/config/{localePatch → i18n/en}/labels.json.js +0 -0
- /package/dist/config/{localePatch → i18n/en}/tooltips.json.js +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
|
|
2
|
+
function b(e, u, r, o) {
|
|
3
|
+
const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
|
|
4
|
+
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
5
|
+
}
|
|
6
|
+
function p(e, u, r, o, n) {
|
|
7
|
+
switch (u) {
|
|
8
|
+
case "productImage": {
|
|
9
|
+
const t = e.querySelector("img");
|
|
10
|
+
t && (t.setAttribute("src", `{{${r}_${o}_image_url}}`), t.setAttribute("alt", `{{${r}_${o}_name}}`));
|
|
11
|
+
const c = e.querySelector("a");
|
|
12
|
+
c && c.setAttribute("href", `{{${r}_${o}_url}}`);
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
case "productName": {
|
|
16
|
+
const t = e.querySelector("p");
|
|
17
|
+
if (t) {
|
|
18
|
+
const c = t.querySelector("strong") || t;
|
|
19
|
+
c.textContent = `{{${r}_${o}_name}}`;
|
|
20
|
+
}
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case "productPrice": {
|
|
24
|
+
const t = e.querySelector("p");
|
|
25
|
+
if (t) {
|
|
26
|
+
const c = t.querySelector("strong") || t;
|
|
27
|
+
c.textContent = b(r, o, "price", n);
|
|
28
|
+
}
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case "productOldPrice": {
|
|
32
|
+
const t = e.querySelector("p");
|
|
33
|
+
if (t) {
|
|
34
|
+
const c = t.querySelector("strong") || t;
|
|
35
|
+
c.textContent = b(
|
|
36
|
+
r,
|
|
37
|
+
o,
|
|
38
|
+
"original_price",
|
|
39
|
+
n
|
|
40
|
+
), t.setAttribute("product-attr", "discount");
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case "productButton": {
|
|
45
|
+
const t = e.querySelector("a");
|
|
46
|
+
t && t.setAttribute("href", `{{${r}_${o}_url}}`);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case "productOmnibusPrice": {
|
|
50
|
+
const t = e.querySelector(".omnibus-price-value");
|
|
51
|
+
if (t) {
|
|
52
|
+
t.textContent = `{{${r}_${o}_omnibus_price}}`;
|
|
53
|
+
const c = t.closest("p");
|
|
54
|
+
c && (c.setAttribute("product-attr", "omnibus_price"), c.setAttribute("composition", "true"));
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case "productOmnibusDiscount": {
|
|
59
|
+
const t = e.querySelector(".omnibus-discount-value");
|
|
60
|
+
if (t) {
|
|
61
|
+
t.textContent = `{{${r}_${o}_omnibus_discount}}`;
|
|
62
|
+
const c = t.closest("p");
|
|
63
|
+
c && (c.setAttribute("product-attr", "omnibus_discount"), c.setAttribute("composition", "true"));
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function $(e, u, r) {
|
|
70
|
+
e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
|
|
71
|
+
n.querySelectorAll("[data-attribute-type]").forEach((s) => {
|
|
72
|
+
const i = s.getAttribute("data-attribute-type") || "", a = s.querySelectorAll(".attribute-cell");
|
|
73
|
+
a.length > 0 ? a.forEach((l) => {
|
|
74
|
+
p(l, i, u, t, r);
|
|
75
|
+
}) : p(s, i, u, t, r);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function S(e, u, r) {
|
|
80
|
+
const o = e.querySelectorAll(".recommendation-product-row");
|
|
81
|
+
if (!o.length)
|
|
82
|
+
return;
|
|
83
|
+
const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
84
|
+
o.forEach((s, i) => {
|
|
85
|
+
s.querySelectorAll("[data-attribute-type]").forEach((l) => {
|
|
86
|
+
const f = l.getAttribute("data-attribute-type") || "";
|
|
87
|
+
l.querySelectorAll(".attribute-cell").forEach((y, m) => {
|
|
88
|
+
const A = i * c + m;
|
|
89
|
+
p(y, f, u, A, r);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function q(e, u, r) {
|
|
95
|
+
e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
|
|
96
|
+
S(n, u, r);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function d(e, u) {
|
|
100
|
+
const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
|
|
101
|
+
r === "list" ? $(e, u, o) : q(e, u, o);
|
|
102
|
+
}
|
|
103
|
+
function h(e, u) {
|
|
104
|
+
const r = e.match(/<!DOCTYPE[^>]*>/i);
|
|
105
|
+
return (r ? `${r[0]}
|
|
106
|
+
` : "") + u.documentElement.outerHTML;
|
|
107
|
+
}
|
|
108
|
+
function w(e) {
|
|
109
|
+
const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".ins-recommendation-v3-block-v2");
|
|
110
|
+
if (!o.length)
|
|
111
|
+
return e;
|
|
112
|
+
const { buildCampaignUrl: n } = _();
|
|
113
|
+
return o.forEach((c) => {
|
|
114
|
+
const s = c.getAttribute("recommendation-id");
|
|
115
|
+
s && (n(s), d(c, s));
|
|
116
|
+
}), h(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
b as formatPriceVariable,
|
|
120
|
+
w as prepareRecommendationBlocks
|
|
121
|
+
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import o from "./labels.json.js";
|
|
2
2
|
import t from "./toasters.json.js";
|
|
3
3
|
import r from "./tooltips.json.js";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...t
|
|
9
|
-
}
|
|
4
|
+
const e = {
|
|
5
|
+
...o,
|
|
6
|
+
...r,
|
|
7
|
+
...t
|
|
10
8
|
};
|
|
11
9
|
export {
|
|
12
|
-
|
|
10
|
+
e as en
|
|
13
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "Your version has been restored successfully.", o = "Restore Image", t = {
|
|
1
|
+
const e = "Your version has been restored successfully.", o = "Restore Image", t = "Cancel", a = {
|
|
2
2
|
"The image has been deleted.": "The image has been deleted successfully.",
|
|
3
3
|
"Aim for the drop zone!": "Drag and drop your image inside the upload area to continue.",
|
|
4
4
|
"Image processing": "The image upload is in progress. This may take some time.",
|
|
@@ -14,6 +14,7 @@ const e = "Your version has been restored successfully.", o = "Restore Image", t
|
|
|
14
14
|
"Error message from image processing": "The Play Button couldn't be added to the Video Thumbnail right now. You can select another Play Button and try again.",
|
|
15
15
|
"The AI is fine-tuning your result... Please wait! This may take up to 1 minute.": "AI content generation is in progress. This may take some time.",
|
|
16
16
|
"Can not complete AI request. Try again later": "AI content generation couldn't be completed right now. You can reload the editor or wait for a while and try again.",
|
|
17
|
+
"Http failure response for https://plugins.stripo.email/api/v1/documents/v3/documents/link: 400 OK": "Upload a valid image to continue.",
|
|
17
18
|
"Http failure response for https://plugins.stripo.email/api/v1/documents/v3/documents/base64: 400 OK": "The video thumbnail couldn’t be uploaded from the URL. Check and update your URL to continue.",
|
|
18
19
|
"AI is processing your request": "AI content generation is in progress. This may take some time.",
|
|
19
20
|
"Whoops, something went wrong. Our experts are working to resolve this issue. Try again later please": "Your action couldn't be done right now. You can reload the editor or wait for a while and try again.",
|
|
@@ -40,12 +41,16 @@ const e = "Your version has been restored successfully.", o = "Restore Image", t
|
|
|
40
41
|
"Image recovery error": "The image couldn't be restored right now. You can wait for a while and try again.",
|
|
41
42
|
"Image moved to trash": "The image has been deleted successfully.",
|
|
42
43
|
Recover: o,
|
|
44
|
+
Stop: t,
|
|
45
|
+
"Can`t delete the image": "The image couldn’t be deleted right now. You can wait for a while and try again.",
|
|
46
|
+
"Can`t restore the image": "The image couldn’t be restored right now. You can wait for a while and try again.",
|
|
43
47
|
"Image delete error": "The image couldn't be deleted right now. You can wait for a while and try again.",
|
|
44
48
|
"The maximum number of users who can simultaneously work with the sheet has been exceeded. Maximum allowed number: {{max_users_per_model}}": "You can’t edit the design right now as the maximum number of users are currently editing it.",
|
|
45
49
|
"The monthly limit of Timer basic block is reached. Please change the subscription pricing plan to activate new quotas": "You have reached your monthly limit of Timer Blocks. You can contact your Account Director for more information."
|
|
46
50
|
};
|
|
47
51
|
export {
|
|
48
52
|
o as Recover,
|
|
49
|
-
t as
|
|
53
|
+
t as Stop,
|
|
54
|
+
a as default,
|
|
50
55
|
e as history_revert_to_patch
|
|
51
56
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var M = (
|
|
4
|
-
import { productPairs as
|
|
5
|
-
import { ItemInCartOptions as
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var B = (e, t, r) => t in e ? v(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var M = (e, t, r) => B(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { productPairs as U } from "../../extensions/Blocks/Items/enums/productEnums.js";
|
|
5
|
+
import { ItemInCartOptions as T, DefaultConfigValues as g, SETTINGS_ENUMS as u } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
6
6
|
import { getDefaultTemplate as K } from "../../extensions/Blocks/Items/template.js";
|
|
7
7
|
const w = {
|
|
8
8
|
img: {
|
|
@@ -74,76 +74,77 @@ const w = {
|
|
|
74
74
|
function F() {
|
|
75
75
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
76
76
|
}
|
|
77
|
-
function q(
|
|
78
|
-
return
|
|
79
|
-
CartItems:
|
|
80
|
-
BrowsedItems:
|
|
81
|
-
PurchasedItems:
|
|
82
|
-
CART_ITEMS:
|
|
83
|
-
BROWSED_ITEMS:
|
|
84
|
-
PURCHASED_ITEMS:
|
|
85
|
-
}[
|
|
77
|
+
function q(e) {
|
|
78
|
+
return e ? {
|
|
79
|
+
CartItems: u.ITEMS_TYPE.CART_ITEMS,
|
|
80
|
+
BrowsedItems: u.ITEMS_TYPE.BROWSED_ITEMS,
|
|
81
|
+
PurchasedItems: u.ITEMS_TYPE.PURCHASED_ITEMS,
|
|
82
|
+
CART_ITEMS: u.ITEMS_TYPE.CART_ITEMS,
|
|
83
|
+
BROWSED_ITEMS: u.ITEMS_TYPE.BROWSED_ITEMS,
|
|
84
|
+
PURCHASED_ITEMS: u.ITEMS_TYPE.PURCHASED_ITEMS
|
|
85
|
+
}[e] || u.ITEMS_TYPE.CART_ITEMS : u.ITEMS_TYPE.CART_ITEMS;
|
|
86
86
|
}
|
|
87
|
-
function R(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
function R(e) {
|
|
88
|
+
var a;
|
|
89
|
+
const t = (_, c) => _ == null ? c : _ === "1" || _ === "true", r = (_, c) => _ || c, l = e["data-type"] || e["data-source"], i = q(l), n = T[i];
|
|
90
|
+
let o = e["data-cart_items_select_control_value"] || ((a = n == null ? void 0 : n[0]) == null ? void 0 : a.value) || g.cartItemsSelectControlValue;
|
|
91
|
+
if (o && !o.includes("{{") && /^\d+$/.test(o)) {
|
|
92
|
+
const _ = parseInt(o) - 1, c = T[i];
|
|
93
|
+
c && c[_] && (o = c[_].value);
|
|
93
94
|
}
|
|
94
95
|
return {
|
|
95
96
|
initialized: !0,
|
|
96
|
-
blockInstanceId: e
|
|
97
|
-
source:
|
|
98
|
-
type:
|
|
99
|
-
itemsSelectValue:
|
|
100
|
-
orientation:
|
|
101
|
-
nameTrimming: t(
|
|
102
|
-
priceHideDiscount: t(
|
|
103
|
-
priceFormatted: t(
|
|
104
|
-
priceSinglePrice: t(
|
|
105
|
-
priceCurrencySymbol:
|
|
106
|
-
|
|
97
|
+
blockInstanceId: r(e["data-block-instance-id"], F()),
|
|
98
|
+
source: i,
|
|
99
|
+
type: i,
|
|
100
|
+
itemsSelectValue: o,
|
|
101
|
+
orientation: e["data-card_orientation_control_value"] || u.ORIENTATION.VERTICAL,
|
|
102
|
+
nameTrimming: t(e["data-product_name_control_trim"], !0),
|
|
103
|
+
priceHideDiscount: t(e["data-product_price_control_nodup"], !0),
|
|
104
|
+
priceFormatted: t(e["data-product_price_control_formated"], !0),
|
|
105
|
+
priceSinglePrice: t(e["data-product_price_control_single_price"], !1),
|
|
106
|
+
priceCurrencySymbol: r(
|
|
107
|
+
e["data-product_price_control_currency_symbol"],
|
|
107
108
|
g.productPriceCurrencySymbolControlValue
|
|
108
109
|
),
|
|
109
|
-
priceCurrencyLocation:
|
|
110
|
-
|
|
110
|
+
priceCurrencyLocation: r(
|
|
111
|
+
e["data-product_price_currency_location"],
|
|
111
112
|
g.productPriceCurrencyLocationControlValue
|
|
112
113
|
),
|
|
113
|
-
priceOrientation:
|
|
114
|
-
quantityControlEnabled: t(
|
|
115
|
-
buttonLink: e
|
|
116
|
-
imageLink: e
|
|
117
|
-
buttonLabel: e
|
|
118
|
-
buttonFullWidth: t(
|
|
119
|
-
imageVisible: t(
|
|
120
|
-
nameVisible: t(
|
|
121
|
-
quantityVisible: t(
|
|
122
|
-
priceVisible: t(
|
|
123
|
-
originalPriceVisible: t(
|
|
124
|
-
buttonVisible: t(
|
|
114
|
+
priceOrientation: e["data-product_original_price_control_orientation"] || "horizontal",
|
|
115
|
+
quantityControlEnabled: t(e["data-product_quantity_control_enabled"], !0),
|
|
116
|
+
buttonLink: r(e["data-product_button_link"], g.productButtonLinkControlValue),
|
|
117
|
+
imageLink: r(e["data-product_image_link"], g.productImageLinkControlValue),
|
|
118
|
+
buttonLabel: r(e["data-product_button_control_label"], "Buy"),
|
|
119
|
+
buttonFullWidth: t(e["data-product_button_control_atw"], !0),
|
|
120
|
+
imageVisible: t(e["data-product_image_control_enabled"], !0),
|
|
121
|
+
nameVisible: t(e["data-product_name_control_enabled"], !0),
|
|
122
|
+
quantityVisible: t(e["data-product_quantity_control_enabled"], !0),
|
|
123
|
+
priceVisible: t(e["data-product_price_control_enabled"], !0),
|
|
124
|
+
originalPriceVisible: t(e["data-product_original_price_control_enabled"], !0),
|
|
125
|
+
buttonVisible: t(e["data-product_button_control_enabled"], !0)
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
|
-
const
|
|
128
|
+
const O = {
|
|
128
129
|
ins_apr: "CART_ITEMS",
|
|
129
130
|
browsed_item: "BROWSED_ITEMS",
|
|
130
131
|
purchased_item: "PURCHASED_ITEMS"
|
|
131
132
|
};
|
|
132
|
-
function
|
|
133
|
-
const
|
|
133
|
+
function $(e, t) {
|
|
134
|
+
const r = {
|
|
134
135
|
CART_ITEMS: `{{Abandoned Cart Item (${t}) Image}}`,
|
|
135
136
|
BROWSED_ITEMS: `{{Browsed Item (${t}) Image}}`,
|
|
136
137
|
PURCHASED_ITEMS: `{{Purchased Item (${t}) Image}}`
|
|
137
138
|
};
|
|
138
|
-
return e
|
|
139
|
+
return r[e] || r.CART_ITEMS;
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
-
const
|
|
141
|
+
function x(e, t) {
|
|
142
|
+
const r = {
|
|
142
143
|
CART_ITEMS: `{{Abandoned Cart Item (${t}) Url}}`,
|
|
143
144
|
BROWSED_ITEMS: `{{Browsed Item (${t}) Url}}`,
|
|
144
145
|
PURCHASED_ITEMS: `{{Purchased Item (${t}) Url}}`
|
|
145
146
|
};
|
|
146
|
-
return e
|
|
147
|
+
return r[e] || r.CART_ITEMS;
|
|
147
148
|
}
|
|
148
149
|
class V {
|
|
149
150
|
constructor() {
|
|
@@ -152,40 +153,40 @@ class V {
|
|
|
152
153
|
}
|
|
153
154
|
migrate(t) {
|
|
154
155
|
try {
|
|
155
|
-
let
|
|
156
|
-
|
|
157
|
-
const
|
|
156
|
+
let r = this.removeJinjaConditionals(t);
|
|
157
|
+
r = this.replaceTemplateVariables(r);
|
|
158
|
+
const l = this.parser.parseFromString(r, "text/html"), i = l.querySelectorAll(
|
|
158
159
|
"td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
|
|
159
160
|
);
|
|
160
|
-
return
|
|
161
|
-
const
|
|
162
|
-
orientation:
|
|
163
|
-
itemsType:
|
|
164
|
-
itemId:
|
|
165
|
-
currencySymbol:
|
|
166
|
-
currencyLocation:
|
|
167
|
-
formattedPrice:
|
|
168
|
-
configBlockAttributes:
|
|
161
|
+
return i.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), r) : (i.forEach((n) => {
|
|
162
|
+
const o = this.extractConfiguration(n), a = K({
|
|
163
|
+
orientation: o.orientation,
|
|
164
|
+
itemsType: o.itemsType,
|
|
165
|
+
itemId: o.itemId,
|
|
166
|
+
currencySymbol: o.currencySymbol,
|
|
167
|
+
currencyLocation: o.currencyLocation,
|
|
168
|
+
formattedPrice: o.formattedPrice,
|
|
169
|
+
configBlockAttributes: o.configBlockAttributes,
|
|
169
170
|
migrate: !0,
|
|
170
|
-
nameStyles:
|
|
171
|
-
buttonStyles:
|
|
172
|
-
priceStyles:
|
|
173
|
-
originalPriceStyles:
|
|
174
|
-
quantityStyles:
|
|
175
|
-
nodeConfig: R(
|
|
171
|
+
nameStyles: o.nameStyles,
|
|
172
|
+
buttonStyles: o.buttonStyles,
|
|
173
|
+
priceStyles: o.priceStyles,
|
|
174
|
+
originalPriceStyles: o.originalPriceStyles,
|
|
175
|
+
quantityStyles: o.quantityStyles,
|
|
176
|
+
nodeConfig: R(o.configBlockAttributes)
|
|
176
177
|
}), c = this.parser.parseFromString(
|
|
177
|
-
`<table><tbody><tr>${
|
|
178
|
+
`<table><tbody><tr>${a}</tr></tbody></table>`,
|
|
178
179
|
"text/html"
|
|
179
180
|
).querySelector("td");
|
|
180
181
|
if (c && n.parentNode) {
|
|
181
|
-
const f = R(
|
|
182
|
+
const f = R(o.configBlockAttributes);
|
|
182
183
|
c.setAttribute("esd-ext-config", JSON.stringify(f));
|
|
183
|
-
const
|
|
184
|
-
|
|
184
|
+
const d = c.querySelector("esd-config-block");
|
|
185
|
+
d && d.remove(), n.parentNode.replaceChild(c, n);
|
|
185
186
|
}
|
|
186
|
-
}),
|
|
187
|
-
} catch (
|
|
188
|
-
return console.error("ItemsBlockMigrator failed:",
|
|
187
|
+
}), l.documentElement.outerHTML);
|
|
188
|
+
} catch (r) {
|
|
189
|
+
return console.error("ItemsBlockMigrator failed:", r), t;
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
/**
|
|
@@ -196,22 +197,22 @@ class V {
|
|
|
196
197
|
*/
|
|
197
198
|
extractConfiguration(t) {
|
|
198
199
|
var C, D, P;
|
|
199
|
-
const
|
|
200
|
-
let
|
|
201
|
-
|
|
202
|
-
const p = t.querySelector('a[product-attr="name"]'),
|
|
200
|
+
const r = ((C = t.querySelector("[data-type]")) == null ? void 0 : C.getAttribute("data-type")) || "CART_ITEMS", l = ((D = t.querySelector("[data-number]")) == null ? void 0 : D.getAttribute("data-number")) || "1", i = parseInt(l) - 1, n = T[r], o = ((P = n == null ? void 0 : n[i]) == null ? void 0 : P.value) || n[0].value, a = t.querySelector('[product-attr="price"]'), _ = (a == null ? void 0 : a.getAttribute("data-currency_symbol")) || "USD", f = ((a == null ? void 0 : a.getAttribute("data-curency")) || "before") === "after" ? "1" : "0", d = (a == null ? void 0 : a.getAttribute("data-formated")) !== "false", s = this.extractConfigBlockAttributes(t, r, l), S = s["data-card_orientation_control_value"];
|
|
201
|
+
let b;
|
|
202
|
+
S ? b = S === "horizontal" ? "horizontal" : "vertical" : b = t.querySelector('[colspan="2"]') !== null ? "vertical" : "horizontal";
|
|
203
|
+
const p = t.querySelector('a[product-attr="name"]'), I = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0, h = (a == null ? void 0 : a.getAttribute("style")) || void 0, A = t.querySelector("p.original-price"), k = (A == null ? void 0 : A.getAttribute("style")) || void 0, E = t.querySelector('[product-attr="quantity"]'), L = (E == null ? void 0 : E.getAttribute("style")) || void 0;
|
|
203
204
|
return {
|
|
204
|
-
orientation:
|
|
205
|
-
itemsType:
|
|
206
|
-
itemId:
|
|
205
|
+
orientation: b,
|
|
206
|
+
itemsType: r,
|
|
207
|
+
itemId: o,
|
|
207
208
|
currencySymbol: _,
|
|
208
209
|
currencyLocation: f,
|
|
209
|
-
formattedPrice:
|
|
210
|
+
formattedPrice: d,
|
|
210
211
|
configBlockAttributes: s,
|
|
211
|
-
nameStyles:
|
|
212
|
+
nameStyles: I,
|
|
212
213
|
buttonStyles: m,
|
|
213
|
-
priceStyles:
|
|
214
|
-
originalPriceStyles:
|
|
214
|
+
priceStyles: h,
|
|
215
|
+
originalPriceStyles: k,
|
|
215
216
|
quantityStyles: L
|
|
216
217
|
};
|
|
217
218
|
}
|
|
@@ -222,27 +223,27 @@ class V {
|
|
|
222
223
|
* @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
|
|
223
224
|
* @param itemNumber - The item number (1-based index)
|
|
224
225
|
*/
|
|
225
|
-
extractConfigBlockAttributes(t,
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
226
|
+
extractConfigBlockAttributes(t, r, l) {
|
|
227
|
+
const i = t.querySelector("esd-config-block"), n = {};
|
|
228
|
+
if (!i)
|
|
228
229
|
return this.getDefaultConfigBlockAttributes();
|
|
229
|
-
if (Array.from(
|
|
230
|
-
|
|
230
|
+
if (Array.from(i.attributes).forEach((a) => {
|
|
231
|
+
a.name.startsWith("data-") && (n[a.name] = a.value);
|
|
231
232
|
}), n["data-cart_items_select_control_value"]) {
|
|
232
|
-
const
|
|
233
|
-
if (/^\d+$/.test(
|
|
234
|
-
const _ = parseInt(
|
|
233
|
+
const a = n["data-cart_items_select_control_value"];
|
|
234
|
+
if (/^\d+$/.test(a)) {
|
|
235
|
+
const _ = parseInt(a) - 1, c = T[r];
|
|
235
236
|
c && c[_] && (n["data-cart_items_select_control_value"] = c[_].value);
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
if (n["data-product_price_control_curency"]) {
|
|
239
|
-
const
|
|
240
|
-
let _ =
|
|
241
|
-
|
|
240
|
+
const a = n["data-product_price_control_curency"];
|
|
241
|
+
let _ = a;
|
|
242
|
+
a === "before" ? _ = "0" : a === "after" && (_ = "1"), n["data-product_price_control_curency"] = _, n["data-product_price_currency_location"] = _;
|
|
242
243
|
}
|
|
243
244
|
(!n["data-product_price_control_currency_symbol"] || n["data-product_price_control_currency_symbol"].trim() === "") && (n["data-product_price_control_currency_symbol"] = "USD");
|
|
244
|
-
const
|
|
245
|
-
return
|
|
245
|
+
const o = { ...this.getDefaultConfigBlockAttributes(), ...n };
|
|
246
|
+
return o["data-type"] = r, o["data-source"] = r, o["data-product_image_link"] = $(r, l), o["data-product_button_link"] = x(r, l), o;
|
|
246
247
|
}
|
|
247
248
|
/**
|
|
248
249
|
* Returns default esd-config-block attributes based on the old template structure
|
|
@@ -297,18 +298,22 @@ class V {
|
|
|
297
298
|
* - Cart Items: ins_apr_total_product_kind, ins_apr_price_N, ins_apr_originalprice_N
|
|
298
299
|
* - Browsed Items: browsed_item_total_product_kind, browsed_item_price_N, browsed_item_originalprice_N
|
|
299
300
|
* - Purchased Items: purchased_item_total_product_kind, purchased_item_price_N, purchased_item_originalprice_N
|
|
301
|
+
*
|
|
302
|
+
* IMPORTANT: Preserves the esd-custom-display-conditions attribute on <body> which
|
|
303
|
+
* contains display condition Jinja scripts that should NOT be removed.
|
|
300
304
|
*/
|
|
301
305
|
removeJinjaConditionals(t) {
|
|
302
|
-
|
|
306
|
+
const r = "__ESD_DISPLAY_CONDITIONS_PLACEHOLDER__", l = t.match(/esd-custom-display-conditions="[^"]*"/);
|
|
307
|
+
let i = l ? t.replace(l[0], r) : t;
|
|
308
|
+
return i = i.replace(
|
|
303
309
|
/\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(>|>)\s*\d+\s*%\}/g,
|
|
304
310
|
""
|
|
305
|
-
)
|
|
306
|
-
return e = e.replace(
|
|
311
|
+
), i = i.replace(
|
|
307
312
|
/\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!=|!=)\s*\1_originalprice_\d+\s*%\}/g,
|
|
308
313
|
""
|
|
309
|
-
),
|
|
314
|
+
), i = i.replace(/\{%\s*endif\s*%\}/g, ""), l && (i = i.replace(r, l[0])), i = i.replace(/\n\s*\n\s*\n/g, `
|
|
310
315
|
|
|
311
|
-
`),
|
|
316
|
+
`), i;
|
|
312
317
|
}
|
|
313
318
|
/**
|
|
314
319
|
* Replaces template variables with default values from productPairs
|
|
@@ -320,31 +325,31 @@ class V {
|
|
|
320
325
|
* - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
|
|
321
326
|
*/
|
|
322
327
|
replaceTemplateVariables(t) {
|
|
323
|
-
const { PAIRS_FOR_EXTENSION:
|
|
324
|
-
return t.replace(/{{([^}]+)}}/g, (
|
|
325
|
-
const n =
|
|
328
|
+
const { PAIRS_FOR_EXTENSION: r } = U;
|
|
329
|
+
return t.replace(/{{([^}]+)}}/g, (l, i) => {
|
|
330
|
+
const n = i.match(/^(ins_apr|browsed_item|purchased_item)_([a-z_]+)_(\d+)$/);
|
|
326
331
|
if (!n)
|
|
327
|
-
return
|
|
328
|
-
const [,
|
|
332
|
+
return l;
|
|
333
|
+
const [, o, a, _] = n, c = O[o];
|
|
329
334
|
if (!c)
|
|
330
|
-
return console.warn(`Unknown variable prefix: ${
|
|
331
|
-
const f = w[
|
|
335
|
+
return console.warn(`Unknown variable prefix: ${o}`), l;
|
|
336
|
+
const f = w[a];
|
|
332
337
|
if (!f)
|
|
333
|
-
return console.warn(`Unknown variable suffix mapping for: ${
|
|
334
|
-
const { pairsKey:
|
|
338
|
+
return console.warn(`Unknown variable suffix mapping for: ${a}`), l;
|
|
339
|
+
const { pairsKey: d, defaultKey: s, isArray: S } = f, p = r[d][c];
|
|
335
340
|
if (!p)
|
|
336
|
-
return console.warn(`No data found for: ${
|
|
337
|
-
if (
|
|
341
|
+
return console.warn(`No data found for: ${d}.${c}`), l;
|
|
342
|
+
if (S) {
|
|
338
343
|
const y = parseInt(_) - 1, m = p[s];
|
|
339
|
-
return Array.isArray(m) && m[y] ? m[y] : (console.warn(`Array value not found: ${
|
|
344
|
+
return Array.isArray(m) && m[y] ? m[y] : (console.warn(`Array value not found: ${d}.${c}.${s}[${y}]`), l);
|
|
340
345
|
}
|
|
341
|
-
const
|
|
342
|
-
return
|
|
346
|
+
const I = p[s];
|
|
347
|
+
return I !== void 0 ? String(I) : (console.warn(`Default value not found: ${d}.${c}.${s}`), l);
|
|
343
348
|
});
|
|
344
349
|
}
|
|
345
350
|
}
|
|
346
|
-
function G(
|
|
347
|
-
return new V().migrate(
|
|
351
|
+
function G(e) {
|
|
352
|
+
return new V().migrate(e);
|
|
348
353
|
}
|
|
349
354
|
export {
|
|
350
355
|
G as migrateItemsBlock
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var h = Object.defineProperty;
|
|
2
2
|
var T = (A, e, t) => e in A ? h(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t;
|
|
3
3
|
var m = (A, e, t) => T(A, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import P, { prepareProductRows as S } from "../../extensions/Blocks/Recommendation/templates/
|
|
5
|
-
import { getDefaultProducts as q } from "../../extensions/Blocks/Recommendation/templates/
|
|
4
|
+
import P, { prepareProductRows as S } from "../../extensions/Blocks/Recommendation/templates/grid/migration.js";
|
|
5
|
+
import { getDefaultProducts as q } from "../../extensions/Blocks/Recommendation/templates/utils.js";
|
|
6
6
|
class w {
|
|
7
7
|
constructor() {
|
|
8
8
|
m(this, "parser");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const s = {
|
|
2
|
-
RECOMMENDATION_API_URL: "
|
|
2
|
+
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
3
3
|
}, i = [
|
|
4
4
|
{ id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
|
|
5
5
|
{ id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = 20, s = 320, t = "vertical", m = {
|
|
2
2
|
CART_ABANDONMENT: {
|
|
3
3
|
ins_apr_img_1: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
|
|
4
4
|
ins_apr_img_2: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
|
|
@@ -15,7 +15,7 @@ const s = 20, e = 320, t = {
|
|
|
15
15
|
DISCOUNT: "discount",
|
|
16
16
|
OMNIBUS_DISCOUNT: "omnibus_discount",
|
|
17
17
|
OMNIBUS_PRICE: "omnibus_price"
|
|
18
|
-
},
|
|
18
|
+
}, _ = {
|
|
19
19
|
IF: {
|
|
20
20
|
discount: `{% if {${i.DISCOUNT}} != "0%" and {${i.DISCOUNT}} != "" %}`,
|
|
21
21
|
omnibus_discount: `{% if {${i.DISCOUNT}} != "0%" and {${i.DISCOUNT}} != "" and {${i.OMNIBUS_DISCOUNT}} != "0%" and {${i.OMNIBUS_DISCOUNT}} != "" %}`,
|
|
@@ -23,17 +23,17 @@ const s = 20, e = 320, t = {
|
|
|
23
23
|
},
|
|
24
24
|
ELSE: "{% else %}",
|
|
25
25
|
END_IF: "{% endif %}"
|
|
26
|
-
},
|
|
27
|
-
ID: /
|
|
28
|
-
ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"
|
|
29
|
-
ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"
|
|
26
|
+
}, a = {
|
|
27
|
+
ID: /recommendation-id="(.*?)"/gi,
|
|
28
|
+
ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>[\S\s]*?<\/p>/gm,
|
|
29
|
+
ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>/gm,
|
|
30
30
|
COMPOSITION: /composition="true"/gm,
|
|
31
31
|
CUSTOM_FIELD: /{{[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
|
|
32
32
|
CUSTOM_FIELD_INDEXES_PART: /{{[0-9]+_[0-8]_/gm,
|
|
33
33
|
CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
|
|
34
|
-
}, a = {
|
|
35
|
-
PARAGRAPH_END_TAG: "</p>"
|
|
36
34
|
}, n = {
|
|
35
|
+
PARAGRAPH_END_TAG: "</p>"
|
|
36
|
+
}, o = {
|
|
37
37
|
REGULAR_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:90px!important;",
|
|
38
38
|
TRIMMED_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:18px!important;",
|
|
39
39
|
ELLIPSIS: "text-overflow:ellipsis!important; white-space:nowrap!important;",
|
|
@@ -46,11 +46,12 @@ const s = 20, e = 320, t = {
|
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
48
|
i as ATTRIBUTES,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
_ as CONDITIONS,
|
|
50
|
+
o as CSS,
|
|
51
|
+
m as DUMMY_IMAGE_MAPPINGS,
|
|
52
|
+
e as DefaultPadding,
|
|
53
|
+
n as HTML,
|
|
54
|
+
s as MinDeviceViewport,
|
|
55
|
+
a as REGEX,
|
|
56
|
+
t as VerticalOrientation
|
|
56
57
|
};
|