@useinsider/guido 3.15.0-beta.94dfda1 → 3.15.0-beta.bc7091e
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/composables/useAllowlist.js +48 -30
- package/dist/composables/useHtmlCompiler.js +19 -16
- package/dist/config/compiler/htmlCompilerRules.js +34 -7
- package/dist/config/compiler/recommendationCompilerRules.js +30 -30
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/enums/recommendation.js +17 -17
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
- package/package.json +1 -1
|
@@ -1,50 +1,68 @@
|
|
|
1
1
|
import { useAllowlistApi as A } from "../services/allowlistApi.js";
|
|
2
|
-
import { base64EncodeWithSpecialChars as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { useUserRole as
|
|
5
|
-
const
|
|
2
|
+
import { base64EncodeWithSpecialChars as f } from "../utils/base64.js";
|
|
3
|
+
import { useTranslations as D } from "./useTranslations.js";
|
|
4
|
+
import { useUserRole as E } from "./useUserRole.js";
|
|
5
|
+
const _ = /(?:https?:\/\/|www\.)[^\s"'<>()]+/gi, L = /"\/\//gi, w = "s3-eu-west-1.amazonaws.com", d = [
|
|
6
|
+
"insider-email",
|
|
7
|
+
"web-image.useinsider.com",
|
|
8
|
+
"image.useinsider.com",
|
|
9
|
+
"panel-assets.useinsider.com",
|
|
10
|
+
"stripo-editor-image"
|
|
11
|
+
], N = ({ hostname: r, pathname: l }) => {
|
|
12
|
+
const n = r.toLowerCase();
|
|
13
|
+
if (n === w) {
|
|
14
|
+
const i = l.split("/")[1].toLowerCase();
|
|
15
|
+
return d.includes(i);
|
|
16
|
+
}
|
|
17
|
+
return d.some((i) => n === `${i}.${w}`);
|
|
18
|
+
}, m = {
|
|
6
19
|
MANAGE: "journey-builder.domain-allowlist-warning",
|
|
7
20
|
NON_MANAGE: "settings.allow-list-warning-not-admin-architect",
|
|
8
21
|
ADD_BUTTON: "settings.allow-list-warning-add-button"
|
|
9
|
-
},
|
|
10
|
-
const { checkDomain:
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const
|
|
22
|
+
}, g = /* @__PURE__ */ new Set(), O = (r) => `/settings?openAddModal=true&type=domain&values=${f(r)}#security`, C = () => {
|
|
23
|
+
const { checkDomain: r } = A(), { getIsManageUser: l } = E(), n = D(), i = (t, e) => {
|
|
24
|
+
const a = `${t || ""} ${e || ""}`.replace(L, "https://").match(_) || [], s = /* @__PURE__ */ new Set();
|
|
25
|
+
return a.forEach((c) => {
|
|
26
|
+
const h = /^https?:\/\//i.test(c) ? c : `https://${c}`;
|
|
14
27
|
try {
|
|
15
|
-
const
|
|
16
|
-
|
|
28
|
+
const u = new URL(h);
|
|
29
|
+
if (N(u))
|
|
30
|
+
return;
|
|
31
|
+
u.hostname && s.add(u.hostname.replace(/^www\./i, "").toLowerCase());
|
|
17
32
|
} catch {
|
|
18
33
|
}
|
|
19
|
-
}), [...
|
|
20
|
-
},
|
|
21
|
-
if (
|
|
34
|
+
}), [...s];
|
|
35
|
+
}, p = async (t) => {
|
|
36
|
+
if (g.has(t))
|
|
22
37
|
return !0;
|
|
23
38
|
try {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
} catch (
|
|
27
|
-
return console.error("[GUIDO_ALLOWLIST] isDomainAllowlisted failed", t,
|
|
39
|
+
const e = await r(t);
|
|
40
|
+
return e && g.add(t), e;
|
|
41
|
+
} catch (e) {
|
|
42
|
+
return console.error("[GUIDO_ALLOWLIST] isDomainAllowlisted failed", t, e), !0;
|
|
28
43
|
}
|
|
29
44
|
};
|
|
30
|
-
return { getBlockedDomains: async (t,
|
|
45
|
+
return { getBlockedDomains: async (t, e) => {
|
|
31
46
|
try {
|
|
32
|
-
const o =
|
|
47
|
+
const o = i(t, e);
|
|
33
48
|
return o.length ? (await Promise.all(
|
|
34
|
-
o.map(async (
|
|
35
|
-
)).filter((
|
|
49
|
+
o.map(async (s) => ({ domain: s, allowlisted: await p(s) }))
|
|
50
|
+
)).filter((s) => !s.allowlisted).map((s) => s.domain) : [];
|
|
36
51
|
} catch (o) {
|
|
37
52
|
return console.error("[GUIDO_ALLOWLIST] getBlockedDomains failed", o), [];
|
|
38
53
|
}
|
|
39
|
-
}, resolveToast: async (t) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
}, resolveToast: async (t) => {
|
|
55
|
+
const e = await l(), o = t.length ? ` (${t.join(", ")})` : "", a = (s) => `${s}${o}`;
|
|
56
|
+
return e ? {
|
|
57
|
+
message: a(n(m.MANAGE)),
|
|
58
|
+
actionButton: {
|
|
59
|
+
text: n(m.ADD_BUTTON),
|
|
60
|
+
onClick: () => window.open(O(t.join(",")), "_blank")
|
|
61
|
+
}
|
|
62
|
+
} : { message: a(n(m.NON_MANAGE)) };
|
|
63
|
+
} };
|
|
46
64
|
};
|
|
47
65
|
export {
|
|
48
66
|
O as buildAllowlistSettingsUrl,
|
|
49
|
-
|
|
67
|
+
C as useAllowlist
|
|
50
68
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { liquidCompilerRules as
|
|
4
|
-
import { outlookCompilerRules as
|
|
1
|
+
import { defaultHtmlCompilerRules as g } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as R } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as b } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
|
|
5
5
|
import { recommendationCompilerRules as v } from "../config/compiler/recommendationCompilerRules.js";
|
|
6
|
-
import { socialCompilerRules as
|
|
7
|
-
import { unsubscribeCompilerRules as
|
|
6
|
+
import { socialCompilerRules as y } from "../config/compiler/socialCompilerRules.js";
|
|
7
|
+
import { unsubscribeCompilerRules as H } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
8
|
import { createHtmlCompiler as s } from "../utils/htmlCompiler.js";
|
|
9
|
-
import { useConfig as
|
|
10
|
-
const
|
|
9
|
+
import { useConfig as x } from "./useConfig.js";
|
|
10
|
+
const h = /* @__PURE__ */ new Set([
|
|
11
11
|
// URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
|
|
12
12
|
"fix-url-encoding-start",
|
|
13
13
|
"fix-url-encoding-end",
|
|
@@ -18,6 +18,9 @@ const y = /* @__PURE__ */ new Set([
|
|
|
18
18
|
// Image domain corrections — plain string replacement.
|
|
19
19
|
"replace-old-image-domain",
|
|
20
20
|
"replace-old-v2-image-domain",
|
|
21
|
+
"replace-s3-path-style-web-image-domain",
|
|
22
|
+
"replace-s3-path-style-image-domain",
|
|
23
|
+
"replace-s3-path-style-panel-assets-domain",
|
|
21
24
|
// Unsubscribe domain — the actual fix: injects the real unsubscribe href in
|
|
22
25
|
// place of the `{{ins-*-unsubscribe-link}}` placeholders, plus related
|
|
23
26
|
// unsubscribe-only cleanups. All pure regex/text, no AMP-forbidden output.
|
|
@@ -32,21 +35,21 @@ const y = /* @__PURE__ */ new Set([
|
|
|
32
35
|
"remove-contenteditable"
|
|
33
36
|
]), M = () => {
|
|
34
37
|
var i, m, r;
|
|
35
|
-
const { compiler: o, isFeatureEnabled:
|
|
36
|
-
...!!((m = o.value) != null && m.ignoreDefaultRules) ? [] :
|
|
38
|
+
const { compiler: o, isFeatureEnabled: a, partner: n } = x(), p = ((i = o.value) == null ? void 0 : i.customRules) || [], l = [
|
|
39
|
+
...!!((m = o.value) != null && m.ignoreDefaultRules) ? [] : g,
|
|
37
40
|
...v,
|
|
38
|
-
...x,
|
|
39
|
-
...g,
|
|
40
|
-
...b,
|
|
41
41
|
...H,
|
|
42
|
-
...
|
|
42
|
+
...R,
|
|
43
|
+
...C,
|
|
44
|
+
...y,
|
|
45
|
+
...a("liquidSyntax") ? b : [],
|
|
43
46
|
...p.map((e, f) => ({
|
|
44
47
|
...e,
|
|
45
48
|
priority: e.priority + 1e3 + f
|
|
46
49
|
// Ensure additional rules run after default rules
|
|
47
50
|
}))
|
|
48
|
-
],
|
|
49
|
-
return { compileHtml: (e) =>
|
|
51
|
+
], c = s(l), u = l.filter((e) => h.has(e.id)), d = s(u), t = (r = n.value) == null ? void 0 : r.fallbackFont;
|
|
52
|
+
return { compileHtml: (e) => c.compile(e, void 0, t), compileAmpHtml: (e) => d.compile(e, void 0, t) };
|
|
50
53
|
};
|
|
51
54
|
export {
|
|
52
55
|
M as useHtmlCompiler
|
|
@@ -122,10 +122,10 @@ const d = [
|
|
|
122
122
|
], i = /<head>([\S\s]*)<\/head>/, o = new RegExp(i);
|
|
123
123
|
if (!e.match(o))
|
|
124
124
|
return e;
|
|
125
|
-
let
|
|
126
|
-
return t.forEach((
|
|
127
|
-
|
|
128
|
-
}),
|
|
125
|
+
let s = e;
|
|
126
|
+
return t.forEach((r) => {
|
|
127
|
+
s = s.replace("</head>", `${r}</head>`);
|
|
128
|
+
}), s;
|
|
129
129
|
},
|
|
130
130
|
priority: 30
|
|
131
131
|
},
|
|
@@ -147,6 +147,33 @@ const d = [
|
|
|
147
147
|
replaceAll: !0,
|
|
148
148
|
priority: 41
|
|
149
149
|
},
|
|
150
|
+
{
|
|
151
|
+
id: "replace-s3-path-style-web-image-domain",
|
|
152
|
+
description: "Rewriting path-style S3 asset URLs to the web-image.useinsider.com domain",
|
|
153
|
+
type: "replace",
|
|
154
|
+
search: "s3-eu-west-1.amazonaws.com/web-image.useinsider.com",
|
|
155
|
+
replacement: "web-image.useinsider.com",
|
|
156
|
+
replaceAll: !0,
|
|
157
|
+
priority: 42
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "replace-s3-path-style-image-domain",
|
|
161
|
+
description: "Rewriting path-style S3 asset URLs to the image.useinsider.com domain",
|
|
162
|
+
type: "replace",
|
|
163
|
+
search: "s3-eu-west-1.amazonaws.com/image.useinsider.com",
|
|
164
|
+
replacement: "image.useinsider.com",
|
|
165
|
+
replaceAll: !0,
|
|
166
|
+
priority: 43
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "replace-s3-path-style-panel-assets-domain",
|
|
170
|
+
description: "Rewriting path-style S3 asset URLs to the panel-assets.useinsider.com domain",
|
|
171
|
+
type: "replace",
|
|
172
|
+
search: "s3-eu-west-1.amazonaws.com/panel-assets.useinsider.com",
|
|
173
|
+
replacement: "panel-assets.useinsider.com",
|
|
174
|
+
replaceAll: !0,
|
|
175
|
+
priority: 46
|
|
176
|
+
},
|
|
150
177
|
{
|
|
151
178
|
id: "convert-rgb-to-hex",
|
|
152
179
|
// SD-142395: rgb()/6-digit hex are verbose; hex/3-digit shorthand is byte-identical
|
|
@@ -156,9 +183,9 @@ const d = [
|
|
|
156
183
|
type: "custom",
|
|
157
184
|
processor: (e) => {
|
|
158
185
|
const t = (i) => i.toString(16).padStart(2, "0");
|
|
159
|
-
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o,
|
|
160
|
-
const [
|
|
161
|
-
return
|
|
186
|
+
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, a, s) => {
|
|
187
|
+
const [r, n, c] = [Number(o), Number(a), Number(s)];
|
|
188
|
+
return r > 255 || n > 255 || c > 255 ? i : `#${t(r)}${t(n)}${t(c)}`;
|
|
162
189
|
}).replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3\b/gi, "#$1$2$3");
|
|
163
190
|
},
|
|
164
191
|
priority: 44
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useRecommendation as N } from "../../composables/useRecommendation.js";
|
|
2
|
-
import { DUMMY_IMAGE_MAPPINGS as
|
|
2
|
+
import { DUMMY_IMAGE_MAPPINGS as C, REGEX as d, VerticalOrientation as $, CSS as n, ATTRIBUTES as p, CONDITIONS as A, HTML as g } from "../../enums/recommendation.js";
|
|
3
3
|
import { prepareRecommendationBlocks as O } from "./utils/recommendationCompilerUtils.js";
|
|
4
|
-
const
|
|
4
|
+
const P = "https://s3-eu-west-1.amazonaws.com/", D = (t) => t.replace("https://", P), U = [
|
|
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
9
|
processor: (t) => {
|
|
10
10
|
let e = t;
|
|
11
|
-
return Object.entries(
|
|
12
|
-
Object.entries(
|
|
13
|
-
e = e.replaceAll(
|
|
11
|
+
return Object.entries(C).forEach(([, i]) => {
|
|
12
|
+
Object.entries(i).forEach(([o, r]) => {
|
|
13
|
+
e = e.replaceAll(D(r), `{{${o}}}`).replaceAll(r, `{{${o}}}`);
|
|
14
14
|
});
|
|
15
15
|
}), e;
|
|
16
16
|
},
|
|
@@ -42,13 +42,13 @@ const H = [
|
|
|
42
42
|
description: "Adding recommendation unresponsive css",
|
|
43
43
|
type: "custom",
|
|
44
44
|
processor: (t) => {
|
|
45
|
-
const { calculateCardWidth: e, getRecommendationCampaignData:
|
|
45
|
+
const { calculateCardWidth: e, getRecommendationCampaignData: i } = N();
|
|
46
46
|
let o = t;
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
47
|
+
const r = o.match(d.ID);
|
|
48
|
+
if (r) {
|
|
49
49
|
const s = [];
|
|
50
|
-
if (
|
|
51
|
-
const m = /recommendation-id="(.*?)"/i.exec(c), E = m ? m[1].trim() : "", u =
|
|
50
|
+
if (r.forEach((c) => {
|
|
51
|
+
const m = /recommendation-id="(.*?)"/i.exec(c), E = m ? m[1].trim() : "", u = i(E);
|
|
52
52
|
u.textTrimming && u.orientation === $ && s.push(e(u));
|
|
53
53
|
}), s.length) {
|
|
54
54
|
const c = `width:${Math.min(...s)}px!important;`;
|
|
@@ -72,25 +72,25 @@ const H = [
|
|
|
72
72
|
type: "custom",
|
|
73
73
|
processor: (t) => {
|
|
74
74
|
let e = t;
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
const s =
|
|
75
|
+
const i = e.match(d.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: o } = N();
|
|
76
|
+
return i !== null && i.forEach((r) => {
|
|
77
|
+
const s = r.match(d.CUSTOM_FIELD);
|
|
78
78
|
if (!s)
|
|
79
79
|
return;
|
|
80
|
-
const [c] = s, m = c.match(d.CUSTOM_FIELD_INDEXES_PART), E = c.match(d.CUSTOM_FIELD_NAME_PART), u =
|
|
80
|
+
const [c] = s, m = c.match(d.CUSTOM_FIELD_INDEXES_PART), E = c.match(d.CUSTOM_FIELD_NAME_PART), u = r.match(d.ATTRIBUTE_PARAGRAPH_START_TAG);
|
|
81
81
|
if (!m || !E || !u)
|
|
82
82
|
return;
|
|
83
|
-
const [
|
|
83
|
+
const [b] = m, [I] = E, [T] = u, _ = I.substring(1, I.length - 2), S = T.match(d.COMPOSITION) !== null;
|
|
84
84
|
let a = c;
|
|
85
85
|
if (S) {
|
|
86
|
-
const
|
|
87
|
-
|
|
86
|
+
const f = b.substring(2, b.length - 3), l = o(f);
|
|
87
|
+
_ === p.OMNIBUS_PRICE && (l.priceBeforeTextValue && (a = `${l.priceBeforeTextValue}${a}`), l.priceAfterTextValue && (a = `${a}${l.priceAfterTextValue}`)), _ === p.OMNIBUS_DISCOUNT && (l.discountBeforeTextValue && (a = `${l.discountBeforeTextValue}${a}`), l.discountAfterTextValue && (a = `${a}${l.discountAfterTextValue}`));
|
|
88
88
|
}
|
|
89
|
-
const R =
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
e = e.replace(
|
|
89
|
+
const R = b.substring(2);
|
|
90
|
+
let y = "";
|
|
91
|
+
_ in A.IF && (y = A.IF[_].replaceAll(`{${p.DISCOUNT}}`, `${R}${p.DISCOUNT}`).replaceAll(`{${p.OMNIBUS_DISCOUNT}}`, `${R}${p.OMNIBUS_DISCOUNT}`).replaceAll(`{${p.OMNIBUS_PRICE}}`, `${R}${p.OMNIBUS_PRICE}`));
|
|
92
|
+
const h = `${T}${a}${g.PARAGRAPH_END_TAG}`, M = `${y}${S ? h : r}${A.ELSE}${T}${g.PARAGRAPH_END_TAG}${A.END_IF}`;
|
|
93
|
+
e = e.replace(r, M);
|
|
94
94
|
}), e;
|
|
95
95
|
},
|
|
96
96
|
priority: 53
|
|
@@ -114,7 +114,7 @@ const H = [
|
|
|
114
114
|
const e = /\s+(?:esd-extension-block-id|data-attribute-type|data-visibility|data-text-before|data-text-after|data-same-price|product-attr|composition)="[^"]*"/g;
|
|
115
115
|
return t.replace(
|
|
116
116
|
/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g,
|
|
117
|
-
(
|
|
117
|
+
(i, o) => `<!--REC_START-->${o.replace(e, "")}<!--REC_END-->`
|
|
118
118
|
);
|
|
119
119
|
},
|
|
120
120
|
priority: 55
|
|
@@ -146,9 +146,9 @@ const H = [
|
|
|
146
146
|
""
|
|
147
147
|
), e = e.replace(
|
|
148
148
|
/@media[^{]*max-width\s*:\s*480px[^{]*\{((?:[^{}]*\{[^{}]*\})*[^{}]*)\}/g,
|
|
149
|
-
(
|
|
150
|
-
const
|
|
151
|
-
return
|
|
149
|
+
(i, o) => {
|
|
150
|
+
const r = o.match(/[^{}]+\{[^{}]*\}/g) || [], s = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
|
|
151
|
+
return r.every((m) => s.test(m)) ? "" : i;
|
|
152
152
|
}
|
|
153
153
|
)), e;
|
|
154
154
|
},
|
|
@@ -167,7 +167,7 @@ const H = [
|
|
|
167
167
|
/<a\b[^>]*\bes-button\b[^>]*>/g,
|
|
168
168
|
(e) => e.replace(
|
|
169
169
|
/([;"]color:)([^;"]+)/g,
|
|
170
|
-
(
|
|
170
|
+
(i, o, r) => r.includes("!important") ? i : `${o}${r} !important`
|
|
171
171
|
)
|
|
172
172
|
),
|
|
173
173
|
priority: 58
|
|
@@ -184,8 +184,8 @@ const H = [
|
|
|
184
184
|
description: "Collapse whitespace inside recommendation blocks and strip boundary markers",
|
|
185
185
|
type: "custom",
|
|
186
186
|
processor: (t) => {
|
|
187
|
-
const e = (
|
|
188
|
-
return t.replace(/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g, (
|
|
187
|
+
const e = (i) => i.replace(/>\s+</g, "><").replace(/<[^>]+>/g, (o) => o.replace(/\s+/g, " "));
|
|
188
|
+
return t.replace(/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g, (i, o) => e(o)).replaceAll("<!--REC_START-->", "").replaceAll("<!--REC_END-->", "");
|
|
189
189
|
},
|
|
190
190
|
priority: 99
|
|
191
191
|
},
|
|
@@ -208,5 +208,5 @@ const H = [
|
|
|
208
208
|
}
|
|
209
209
|
];
|
|
210
210
|
export {
|
|
211
|
-
|
|
211
|
+
U as recommendationCompilerRules
|
|
212
212
|
};
|
|
@@ -381,7 +381,7 @@ class H {
|
|
|
381
381
|
* Supports all block types by detecting prefix and using appropriate type:
|
|
382
382
|
*
|
|
383
383
|
* Examples:
|
|
384
|
-
* - {{ins_apr_img_1}} → https://
|
|
384
|
+
* - {{ins_apr_img_1}} → https://web-image.useinsider.com/.../img_1.jpeg (CART_ITEMS)
|
|
385
385
|
* - {{browsed_item_name_2}} → 'Set of Sprite Yoga Straps' (BROWSED_ITEMS)
|
|
386
386
|
* - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
|
|
387
387
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const e = 20,
|
|
1
|
+
const e = 20, t = 320, s = "vertical", m = {
|
|
2
2
|
CART_ABANDONMENT: {
|
|
3
|
-
ins_apr_img_1: "https://
|
|
4
|
-
ins_apr_img_2: "https://
|
|
5
|
-
ins_apr_img_3: "https://
|
|
6
|
-
ins_apr_img_4: "https://
|
|
3
|
+
ins_apr_img_1: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
|
|
4
|
+
ins_apr_img_2: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
|
|
5
|
+
ins_apr_img_3: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_3.png",
|
|
6
|
+
ins_apr_img_4: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_4.png"
|
|
7
7
|
},
|
|
8
8
|
BROWSE_ABANDONMENT: {
|
|
9
|
-
browsed_item_img_1: "https://
|
|
10
|
-
browsed_item_img_2: "https://
|
|
11
|
-
browsed_item_img_3: "https://
|
|
12
|
-
browsed_item_img_4: "https://
|
|
9
|
+
browsed_item_img_1: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_1.jpg",
|
|
10
|
+
browsed_item_img_2: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_2.jpg",
|
|
11
|
+
browsed_item_img_3: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_3.jpg",
|
|
12
|
+
browsed_item_img_4: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_4.jpg"
|
|
13
13
|
}
|
|
14
14
|
}, i = {
|
|
15
15
|
DISCOUNT: "discount",
|
|
@@ -23,7 +23,7 @@ const e = 20, s = 320, t = "vertical", m = {
|
|
|
23
23
|
},
|
|
24
24
|
ELSE: "{% else %}",
|
|
25
25
|
END_IF: "{% endif %}"
|
|
26
|
-
},
|
|
26
|
+
}, n = {
|
|
27
27
|
ID: /recommendation-id="(.*?)"/gi,
|
|
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,
|
|
@@ -31,9 +31,9 @@ const e = 20, s = 320, t = "vertical", m = {
|
|
|
31
31
|
CUSTOM_FIELD: /{{(?:reco_)?[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
|
|
32
32
|
CUSTOM_FIELD_INDEXES_PART: /{{(?:reco_)?[0-9]+_[0-8]_/gm,
|
|
33
33
|
CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
|
|
34
|
-
}, n = {
|
|
35
|
-
PARAGRAPH_END_TAG: "</p>"
|
|
36
34
|
}, o = {
|
|
35
|
+
PARAGRAPH_END_TAG: "</p>"
|
|
36
|
+
}, a = {
|
|
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;",
|
|
@@ -47,11 +47,11 @@ const e = 20, s = 320, t = "vertical", m = {
|
|
|
47
47
|
export {
|
|
48
48
|
i as ATTRIBUTES,
|
|
49
49
|
_ as CONDITIONS,
|
|
50
|
-
|
|
50
|
+
a as CSS,
|
|
51
51
|
m as DUMMY_IMAGE_MAPPINGS,
|
|
52
52
|
e as DefaultPadding,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
o as HTML,
|
|
54
|
+
t as MinDeviceViewport,
|
|
55
|
+
n as REGEX,
|
|
56
|
+
s as VerticalOrientation
|
|
57
57
|
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import E from "../../../../node_modules/lodash-es/flatMap.js";
|
|
2
|
+
import s from "../../../../node_modules/lodash-es/range.js";
|
|
3
|
+
const t = '<td align="center" class="ins-product-td items-block items-block-v2">', r = { PAIRS_FOR_EXTENSION: {
|
|
4
4
|
imageSrc: {
|
|
5
5
|
CART_ITEMS: {
|
|
6
6
|
ATTR: "ins_apr_img",
|
|
7
7
|
DEFAULT: [
|
|
8
|
-
"https://
|
|
9
|
-
"https://
|
|
10
|
-
"https://
|
|
11
|
-
"https://
|
|
12
|
-
"https://
|
|
13
|
-
"https://
|
|
14
|
-
"https://
|
|
15
|
-
"https://
|
|
8
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
9
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
10
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
11
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
12
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
13
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
14
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
15
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
BROWSED_ITEMS: {
|
|
19
19
|
ATTR: "browsed_item_img",
|
|
20
20
|
DEFAULT: [
|
|
21
|
-
"https://
|
|
22
|
-
"https://
|
|
23
|
-
"https://
|
|
24
|
-
"https://
|
|
25
|
-
"https://
|
|
26
|
-
"https://
|
|
27
|
-
"https://
|
|
28
|
-
"https://
|
|
21
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
22
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
23
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
24
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
25
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
26
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
27
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
28
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
PURCHASED_ITEMS: {
|
|
32
32
|
ATTR: "purchased_item_img",
|
|
33
33
|
DEFAULT: [
|
|
34
|
-
"https://
|
|
35
|
-
"https://
|
|
36
|
-
"https://
|
|
37
|
-
"https://
|
|
38
|
-
"https://
|
|
39
|
-
"https://
|
|
40
|
-
"https://
|
|
41
|
-
"https://
|
|
34
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
35
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
36
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
37
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
38
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
39
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
40
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
41
|
+
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
44
|
},
|
|
@@ -211,27 +211,27 @@ const T = '<td align="center" class="ins-product-td items-block items-block-v2">
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
} };
|
|
214
|
-
function
|
|
215
|
-
return
|
|
214
|
+
function a(e, i = 8) {
|
|
215
|
+
return s(1, i + 1).map((_) => `${e}_${_}`);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
const { PAIRS_FOR_EXTENSION: e } =
|
|
219
|
-
return
|
|
217
|
+
function R() {
|
|
218
|
+
const { PAIRS_FOR_EXTENSION: e } = r, i = [];
|
|
219
|
+
return i.push(
|
|
220
220
|
e.imageSrc.CART_ITEMS.ATTR,
|
|
221
221
|
e.imageSrc.BROWSED_ITEMS.ATTR,
|
|
222
222
|
e.imageSrc.PURCHASED_ITEMS.ATTR
|
|
223
|
-
),
|
|
223
|
+
), i.push(
|
|
224
224
|
e.name.CART_ITEMS.ATTR,
|
|
225
225
|
e.name.CART_ITEMS.HREF,
|
|
226
226
|
e.name.BROWSED_ITEMS.ATTR,
|
|
227
227
|
e.name.BROWSED_ITEMS.HREF,
|
|
228
228
|
e.name.PURCHASED_ITEMS.ATTR,
|
|
229
229
|
e.name.PURCHASED_ITEMS.HREF
|
|
230
|
-
),
|
|
230
|
+
), i.push(
|
|
231
231
|
e.quantity.CART_ITEMS.ATTR,
|
|
232
232
|
e.quantity.BROWSED_ITEMS.ATTR,
|
|
233
233
|
e.quantity.PURCHASED_ITEMS.ATTR
|
|
234
|
-
),
|
|
234
|
+
), i.push(
|
|
235
235
|
e.price.CART_ITEMS.PRICE,
|
|
236
236
|
e.price.CART_ITEMS.PRICE_FORMATTED,
|
|
237
237
|
e.price.CART_ITEMS.SINGLE_PRICE,
|
|
@@ -247,7 +247,7 @@ function r() {
|
|
|
247
247
|
e.price.PURCHASED_ITEMS.SINGLE_PRICE,
|
|
248
248
|
e.price.PURCHASED_ITEMS.SINGLE_PRICE_FORMATTED,
|
|
249
249
|
e.price.PURCHASED_ITEMS.CURRENCY
|
|
250
|
-
),
|
|
250
|
+
), i.push(
|
|
251
251
|
e.originalPrice.CART_ITEMS.PRICE,
|
|
252
252
|
e.originalPrice.CART_ITEMS.PRICE_FORMATTED,
|
|
253
253
|
e.originalPrice.CART_ITEMS.SINGLE_PRICE,
|
|
@@ -263,22 +263,22 @@ function r() {
|
|
|
263
263
|
e.originalPrice.PURCHASED_ITEMS.SINGLE_PRICE,
|
|
264
264
|
e.originalPrice.PURCHASED_ITEMS.SINGLE_PRICE_FORMATTED,
|
|
265
265
|
e.originalPrice.PURCHASED_ITEMS.CURRENCY
|
|
266
|
-
),
|
|
266
|
+
), i.push(
|
|
267
267
|
e.button.CART_ITEMS.HREF,
|
|
268
268
|
e.button.BROWSED_ITEMS.HREF,
|
|
269
269
|
e.button.PURCHASED_ITEMS.HREF
|
|
270
|
-
),
|
|
270
|
+
), i.push(
|
|
271
271
|
e.itemLink.CART_ITEMS.HREF,
|
|
272
272
|
e.itemLink.BROWSED_ITEMS.HREF,
|
|
273
273
|
e.itemLink.PURCHASED_ITEMS.HREF
|
|
274
|
-
),
|
|
274
|
+
), i;
|
|
275
275
|
}
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
(e) =>
|
|
276
|
+
const p = E(
|
|
277
|
+
R(),
|
|
278
|
+
(e) => a(e)
|
|
279
279
|
);
|
|
280
280
|
export {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
281
|
+
p as itemsBlockDynamicVariables,
|
|
282
|
+
r as productPairs,
|
|
283
|
+
t as templateFirstLine
|
|
284
284
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.15.0-beta.
|
|
3
|
+
"version": "3.15.0-beta.bc7091e",
|
|
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",
|