@useinsider/guido 3.20.0-beta.11a0bde → 3.20.0-beta.13006ea
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/config/compiler/itemsCompilerRules.js +13 -6
- package/dist/config/compiler/utils/itemsCompilerUtils.js +34 -17
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/productIds.js +3 -5
- package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { pairProductVariables as
|
|
2
|
-
import { wrapHiddenPriceTdsForOutlook as r, MSO_ITEMS_HIDE_START as e, MSO_ITEMS_HIDE_END as
|
|
3
|
-
const
|
|
1
|
+
import { pairProductVariables as i } from "../../utils/pairProductVariables.js";
|
|
2
|
+
import { wrapHiddenPriceTdsForOutlook as r, lockHorizontalItemImageWidths as t, MSO_ITEMS_HIDE_START as e, MSO_ITEMS_HIDE_END as s } from "./utils/itemsCompilerUtils.js";
|
|
3
|
+
const c = [
|
|
4
4
|
{
|
|
5
5
|
id: "pair-product-variables",
|
|
6
6
|
description: "Replace product default values with template variables",
|
|
7
7
|
type: "custom",
|
|
8
|
-
processor:
|
|
8
|
+
processor: i,
|
|
9
9
|
priority: 60
|
|
10
10
|
// After recommendation rules (priority 50-53)
|
|
11
11
|
},
|
|
@@ -20,16 +20,23 @@ const a = [
|
|
|
20
20
|
priority: 65
|
|
21
21
|
// After pair-product-variables (60), before outlook rules (70+)
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
id: "lock-horizontal-item-image-widths",
|
|
25
|
+
description: "Pin horizontal Items thumbnails to their width so narrow rows cannot collapse them",
|
|
26
|
+
type: "custom",
|
|
27
|
+
processor: t,
|
|
28
|
+
priority: 66
|
|
29
|
+
},
|
|
23
30
|
{
|
|
24
31
|
id: "swap-items-mso-markers",
|
|
25
32
|
// Injecting the delicate `<!-- -->` ghost token LAST (after reco minify P99
|
|
26
33
|
// and reco swap P100) keeps it out of every whitespace/comment-mangling pass.
|
|
27
34
|
description: "Swap Items MSO markers into [if !mso] conditional comments",
|
|
28
35
|
type: "custom",
|
|
29
|
-
processor: (
|
|
36
|
+
processor: (o) => o.replaceAll(`<!--${e}-->`, "<!--[if !mso]><!-- -->").replaceAll(`<!--${s}-->`, "<!--<![endif]-->"),
|
|
30
37
|
priority: 101
|
|
31
38
|
}
|
|
32
39
|
];
|
|
33
40
|
export {
|
|
34
|
-
|
|
41
|
+
c as itemsCompilerRules
|
|
35
42
|
};
|
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { DefaultConfigValues as m } from "../../../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
2
|
+
const u = "MSO_ITEMS_HIDE_START", f = "MSO_ITEMS_HIDE_END", _ = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", T = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price", A = ".ins-product-td td.product-image-class img[width]", I = Number(m.productImageWidth), p = (t) => t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
3
|
+
function E(t, n) {
|
|
4
|
+
const r = t.match(/<!DOCTYPE[^>]*>/i);
|
|
5
|
+
return ((r ? `${r[0]}
|
|
6
|
+
` : "") + n.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
7
|
+
}
|
|
8
|
+
function h(t) {
|
|
3
9
|
if (!t.includes("vertical-price") || !t.includes("ins-product-cart"))
|
|
4
10
|
return t;
|
|
5
|
-
const
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
var s,
|
|
11
|
+
const n = p(t), r = new DOMParser().parseFromString(n, "text/html");
|
|
12
|
+
let c = !1;
|
|
13
|
+
return r.querySelectorAll(T).forEach((e) => {
|
|
14
|
+
var s, l;
|
|
9
15
|
const o = e.getAttribute("style") || "";
|
|
10
16
|
if (!/display\s*:\s*none/i.test(o))
|
|
11
17
|
return;
|
|
12
|
-
const
|
|
13
|
-
if (((
|
|
18
|
+
const i = e.previousSibling;
|
|
19
|
+
if (((i == null ? void 0 : i.nodeType) !== Node.COMMENT_NODE || i.data !== u) && ((s = e.parentNode) == null || s.insertBefore(r.createComment(u), e), (l = e.parentNode) == null || l.insertBefore(r.createComment(f), e.nextSibling)), !/mso-hide/i.test(o)) {
|
|
14
20
|
const d = o.trim().endsWith(";") ? " " : "; ";
|
|
15
|
-
e.setAttribute("style", `${o}${d}${
|
|
21
|
+
e.setAttribute("style", `${o}${d}${_}`);
|
|
16
22
|
}
|
|
17
|
-
|
|
18
|
-
}),
|
|
23
|
+
c = !0;
|
|
24
|
+
}), c ? E(n, r) : t;
|
|
25
|
+
}
|
|
26
|
+
function D(t) {
|
|
27
|
+
if (!t.includes("product-image-class"))
|
|
19
28
|
return t;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
const n = p(t), r = new DOMParser().parseFromString(n, "text/html");
|
|
30
|
+
let c = !1;
|
|
31
|
+
return r.querySelectorAll(A).forEach((e) => {
|
|
32
|
+
var d, a;
|
|
33
|
+
const o = ((d = e.getAttribute("width")) == null ? void 0 : d.trim()) ?? "", i = ((a = e.getAttribute("style")) == null ? void 0 : a.trim()) ?? "";
|
|
34
|
+
if (!/^\d+$/.test(o) || /(^|;)\s*min-width\s*:/i.test(i))
|
|
35
|
+
return;
|
|
36
|
+
const s = i && !i.endsWith(";") ? ";" : "", l = Math.min(Number(o), I);
|
|
37
|
+
e.setAttribute("style", `${i}${s}min-width:${l}px;max-width:${o}px`), c = !0;
|
|
38
|
+
}), c ? E(n, r) : t;
|
|
23
39
|
}
|
|
24
40
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
f as MSO_ITEMS_HIDE_END,
|
|
42
|
+
u as MSO_ITEMS_HIDE_START,
|
|
43
|
+
D as lockHorizontalItemImageWidths,
|
|
44
|
+
h as wrapHiddenPriceTdsForOutlook
|
|
28
45
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import "../constants/selectors.js";
|
|
2
2
|
import { RRS_CONFIG_VERSION as m } from "../constants/defaultConfig.js";
|
|
3
|
-
import { sanitizeProductIds as p
|
|
4
|
-
const
|
|
5
|
-
function
|
|
3
|
+
import { sanitizeProductIds as p } from "./productIds.js";
|
|
4
|
+
const d = "manualMerchandising";
|
|
5
|
+
function N({ strategyId: e, nodeConfigVersion: t }) {
|
|
6
6
|
return !e && t < m;
|
|
7
7
|
}
|
|
8
8
|
const o = (e) => {
|
|
9
9
|
const t = String(e ?? "").trim();
|
|
10
10
|
return /^[1-9]\d*$/.test(t) ? t : null;
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function f({ campaignId: e, templateLibraryId: t }) {
|
|
13
13
|
if (o(e))
|
|
14
14
|
return { scope: "campaign" };
|
|
15
15
|
const n = o(t);
|
|
16
16
|
return n ? { scope: "template", templateId: n } : { scope: "campaign" };
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function y({
|
|
19
19
|
blockId: e,
|
|
20
20
|
url: t,
|
|
21
21
|
campaignId: n,
|
|
@@ -24,7 +24,7 @@ function S({
|
|
|
24
24
|
productIds: s,
|
|
25
25
|
target: r
|
|
26
26
|
}) {
|
|
27
|
-
const i = c ===
|
|
27
|
+
const i = c === d ? p(s).split(",").filter(Boolean) : [];
|
|
28
28
|
return {
|
|
29
29
|
...r.scope === "template" ? { templateId: Number.parseInt(r.templateId) } : {
|
|
30
30
|
campaignId: Number.parseInt(n) || 0,
|
|
@@ -36,7 +36,7 @@ function S({
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
y as buildLegacyMigrationPayload,
|
|
40
|
+
N as isLegacyStrategyConfig,
|
|
41
|
+
f as resolveMigrationTarget
|
|
42
42
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return t.map((n) => String(n ?? "").trim()).filter(Boolean).join(",");
|
|
1
|
+
function n(t) {
|
|
2
|
+
return t.map((i) => String(i ?? "").trim()).filter(Boolean).join(",");
|
|
4
3
|
}
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
o as sanitizeProductIds
|
|
5
|
+
n as sanitizeProductIds
|
|
8
6
|
};
|
|
@@ -10,3 +10,8 @@ export declare const MSO_ITEMS_HIDE_END = "MSO_ITEMS_HIDE_END";
|
|
|
10
10
|
* and collapse them inline for web-engine Outlook.
|
|
11
11
|
*/
|
|
12
12
|
export declare function wrapHiddenPriceTdsForOutlook(html: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* The mobile `.adapt-img { width: 100% }` rule sizes the horizontal thumbnail by its auto-width column,
|
|
15
|
+
* so it grows in a roomy row and collapses to nothing in a crowded one — bound it to [default, width].
|
|
16
|
+
*/
|
|
17
|
+
export declare function lockHorizontalItemImageWidths(html: string): string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** Separator between product ids in the `sanitizeProductIds` output */
|
|
2
|
-
export declare const PRODUCT_ID_SEPARATOR = ",";
|
|
3
1
|
/**
|
|
4
2
|
* Builds the request/URL `productId` value from raw product ID segments.
|
|
5
3
|
* Trimming happens here — NOT on input change — so the user's in-progress
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.20.0-beta.
|
|
3
|
+
"version": "3.20.0-beta.13006ea",
|
|
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",
|