@useinsider/guido 3.16.0 → 3.17.0-beta.1631b31
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 +12 -6
- package/dist/components/Guido.vue.js +9 -9
- package/dist/components/Guido.vue2.js +77 -73
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +69 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +13 -0
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useRecommendation.js +43 -35
- package/dist/composables/useStripo.js +30 -29
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/config/migrator/recommendation/settingsMapper.js +19 -17
- package/dist/config/migrator/recommendationMigrator.js +6 -4
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/recommendationBlock.js +4 -1
- package/dist/enums/recommendation.js +17 -17
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
- package/dist/extensions/Blocks/Recommendation/block.js +26 -21
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +163 -159
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +142 -0
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +222 -78
- package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +75 -30
- package/dist/src/@types/config/schemas.d.ts +12 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +17 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +7 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +16 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +30 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +206 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/strategyInfoBox.d.ts +35 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +188 -0
- package/dist/utils/dateUtil.js +29 -10
- package/dist/utils/strategyInfoBox.js +68 -0
- package/dist/utils/templatePreparation.js +37 -34
- package/package.json +2 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
const n = `/* Recommendation Strategy section of the recommendation block's settings panel
|
|
2
|
+
(SD-149105). Scoped to the section's own classes/ids so nothing leaks into
|
|
3
|
+
other blocks' controls. Measurements come from the Figma frames
|
|
4
|
+
4880:44449 (empty) and 4826:7513 (assigned). */
|
|
5
|
+
|
|
6
|
+
.strategy-control-header {
|
|
7
|
+
padding: 16px 16px 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.strategy-control-title {
|
|
11
|
+
margin: 0;
|
|
12
|
+
color: var(--guido-color-gray-800);
|
|
13
|
+
font-size: 16px;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
line-height: 24px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.strategy-control-description-row {
|
|
19
|
+
padding: 8px 16px 16px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.strategy-control-description {
|
|
23
|
+
margin: 0;
|
|
24
|
+
color: var(--guido-color-gray-600);
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
line-height: 16px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.strategy-control-description a {
|
|
30
|
+
color: var(--guido-color-primary-500);
|
|
31
|
+
text-decoration: underline;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Assign + Create are two fixed 180px columns, left-aligned — not a stretched
|
|
35
|
+
half-and-half. The ancestor is load-bearing: it out-specifies the editor's own
|
|
36
|
+
\`.container.two-columns\` grid, which otherwise wins and leaves the CTAs uneven. */
|
|
37
|
+
.recommendation-controls-container .container.strategy-control-cta-row {
|
|
38
|
+
grid-template-columns: repeat(2, minmax(0, 180px));
|
|
39
|
+
justify-content: start;
|
|
40
|
+
gap: 16px;
|
|
41
|
+
padding: 0 16px 16px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The editor's grid does not stretch its items and the visible pill is the inner
|
|
45
|
+
\`.button\`, not the \`ue-button\` host — so both need the width or the two CTAs
|
|
46
|
+
come out sized to their own captions. */
|
|
47
|
+
.strategy-control-cta {
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.strategy-control-cta > .button {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
width: 100%;
|
|
56
|
+
border: none;
|
|
57
|
+
font-size: 15px;
|
|
58
|
+
font-weight: 400;
|
|
59
|
+
line-height: 24px;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Secondary action keeps full contrast while disabled — the round trip ships
|
|
64
|
+
in a later phase, but the design shows it as a normal grey button. */
|
|
65
|
+
.strategy-control-cta.primary > .button:disabled,
|
|
66
|
+
.strategy-control-cta.primary > .button.disabled {
|
|
67
|
+
opacity: 1;
|
|
68
|
+
color: var(--guido-color-gray-800);
|
|
69
|
+
cursor: default;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* The assigned strategy's name sits in a band that spans the whole panel, so it
|
|
73
|
+
carries its own 16px inset instead of inheriting the section's. */
|
|
74
|
+
.strategy-control-name-band {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
min-height: 48px;
|
|
78
|
+
padding: 0 16px;
|
|
79
|
+
background-color: var(--guido-color-gray-0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.strategy-control-name {
|
|
83
|
+
color: var(--guido-color-gray-800);
|
|
84
|
+
font-size: 15px;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
line-height: 24px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.strategy-control-actions {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
padding: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.strategy-control-action {
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
padding: 0;
|
|
99
|
+
border: none;
|
|
100
|
+
background: none;
|
|
101
|
+
font-size: 15px;
|
|
102
|
+
font-weight: 400;
|
|
103
|
+
line-height: 24px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* The label carries the gap on both sides, which is also what separates Change
|
|
108
|
+
from Remove — matching the design's button wrappers. */
|
|
109
|
+
.strategy-control-action > span {
|
|
110
|
+
padding: 0 8px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Icons are masks rather than inline SVG — Stripo rebuilds the control markup
|
|
114
|
+
through Angular, which recreates <svg> outside the SVG namespace so it never
|
|
115
|
+
paints. A mask is a background, so it survives that round trip. The glyphs
|
|
116
|
+
live in static/assets/icons and reach these vars via useCustomInterfaceAppearance. */
|
|
117
|
+
.strategy-control-action::before,
|
|
118
|
+
.strategy-control-cta.on > .button::before {
|
|
119
|
+
content: '';
|
|
120
|
+
flex: none;
|
|
121
|
+
width: 24px;
|
|
122
|
+
height: 24px;
|
|
123
|
+
background-color: currentcolor;
|
|
124
|
+
mask-repeat: no-repeat;
|
|
125
|
+
mask-position: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* The design system's \`line-change\` glyph fills its 24px box; the 20px glyphs
|
|
129
|
+
are centred inside the same box, as the design draws them. */
|
|
130
|
+
.strategy-control-action--change::before {
|
|
131
|
+
mask-size: 24px 24px;
|
|
132
|
+
mask-image: var(--guido-icon-line-change);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.strategy-control-action--remove::before {
|
|
136
|
+
mask-size: 20px 20px;
|
|
137
|
+
mask-image: var(--guido-icon-line-delete);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.strategy-control-cta.on > .button::before {
|
|
141
|
+
mask-size: 20px 20px;
|
|
142
|
+
mask-image: var(--guido-icon-line-plus);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.strategy-control-action--change {
|
|
146
|
+
color: var(--guido-color-primary-500);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.strategy-control-action--remove {
|
|
150
|
+
color: var(--guido-color-danger-500);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.strategy-control-action:hover {
|
|
154
|
+
text-decoration: underline;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Per-block controls (SD-149105). With the flag on the panel carries BOTH the
|
|
158
|
+
legacy and the strategy controls — Stripo reuses one panel across blocks of
|
|
159
|
+
the same type and never re-runs getTemplate() on a switch — and
|
|
160
|
+
\`.strategy-block\` picks which set the selected block shows. */
|
|
161
|
+
.recommendation-controls-container:not(.strategy-block) .strategy-control-container,
|
|
162
|
+
.recommendation-controls-container.strategy-block .product-count-control-container,
|
|
163
|
+
.recommendation-controls-container.strategy-block .algorithm-control-container,
|
|
164
|
+
.recommendation-controls-container.strategy-block .filters-control-container,
|
|
165
|
+
.recommendation-controls-container.strategy-block .shuffle-control-container {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* The RRS panel's order (Figma 4826:7513) is the legacy DOM order with these
|
|
170
|
+
two sent to the end; everything else already lands where the design wants it.
|
|
171
|
+
Only \`.strategy-block\` becomes a flex container, so a legacy block keeps plain
|
|
172
|
+
block flow and stays exactly what it is with the flag off. */
|
|
173
|
+
.recommendation-controls-container.strategy-block {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: column;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.recommendation-controls-container.strategy-block .price-placement-control-container {
|
|
179
|
+
order: 1;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.recommendation-controls-container.strategy-block .product-layout-control-container {
|
|
183
|
+
order: 2;
|
|
184
|
+
}
|
|
185
|
+
`;
|
|
186
|
+
export {
|
|
187
|
+
n as default
|
|
188
|
+
};
|
package/dist/utils/dateUtil.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
import { DEFAULT_LOCALE as
|
|
2
|
-
const
|
|
1
|
+
import { DEFAULT_LOCALE as a, DEFAULT as c, DEFAULT_TZ as s } from "../enums/date.js";
|
|
2
|
+
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), u = () => {
|
|
3
3
|
const t = window.l10n;
|
|
4
|
-
return (t == null ? void 0 : t.locale) ===
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
return (t == null ? void 0 : t.locale) === c ? a : (t == null ? void 0 : t.locale) || a;
|
|
5
|
+
}, f = new Intl.DateTimeFormat().resolvedOptions().timeZone, D = () => {
|
|
6
|
+
const t = window.l10n;
|
|
7
|
+
return (t == null ? void 0 : t.timezone) || f || s;
|
|
8
|
+
}, i = /* @__PURE__ */ new Map(), l = (t, e) => {
|
|
9
|
+
const r = `${t}|${e}`, n = i.get(r);
|
|
10
|
+
if (n)
|
|
11
|
+
return n;
|
|
12
|
+
const o = new Intl.DateTimeFormat(t, {
|
|
13
|
+
year: "numeric",
|
|
14
|
+
month: "2-digit",
|
|
15
|
+
day: "2-digit",
|
|
16
|
+
timeZone: e
|
|
17
|
+
});
|
|
18
|
+
return i.set(r, o), o;
|
|
19
|
+
}, T = (t, e = u(), r = D()) => {
|
|
20
|
+
const n = m(t);
|
|
21
|
+
return l(e, r).format(n);
|
|
22
|
+
}, g = (t) => {
|
|
8
23
|
if (!t)
|
|
9
24
|
return "";
|
|
10
25
|
const e = new Date(t);
|
|
@@ -16,9 +31,13 @@ const i = (t) => {
|
|
|
16
31
|
second: "2-digit",
|
|
17
32
|
hour12: !1
|
|
18
33
|
}).format(e);
|
|
19
|
-
},
|
|
34
|
+
}, w = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
20
35
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
m as convertToDateObject,
|
|
37
|
+
g as formatPatchDate,
|
|
38
|
+
T as formatShortDate,
|
|
39
|
+
w as isAfterDate,
|
|
40
|
+
f as localTz,
|
|
41
|
+
u as locale,
|
|
42
|
+
D as timezone
|
|
24
43
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useTranslations as a } from "../composables/useTranslations.js";
|
|
2
|
+
import { formatShortDate as c } from "./dateUtil.js";
|
|
3
|
+
import { escapeHtml as l } from "./htmlEscape.js";
|
|
4
|
+
const d = "assign-strategy-info-box", o = (e) => typeof e == "string" ? e : typeof e == "number" ? String(e) : "", u = (e, t) => {
|
|
5
|
+
const r = o(e.algorithm) === "MIXED" ? t("discovery-strategy.mixed-algorithm") : t("discovery-strategy.single-algorithm"), n = o(e.algorithm_used).split(",").map((i) => i.trim()).filter(Boolean).map((i) => t(`recommendation-algorithm-names.${i.replaceAll("_", "-").toLowerCase()}`));
|
|
6
|
+
return n.length ? `${r} · ${n.join(", ")}` : r;
|
|
7
|
+
}, m = (e, t) => [
|
|
8
|
+
[e.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
9
|
+
[e.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
10
|
+
[e.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
11
|
+
].filter(([r]) => Number(r) === 1).map(([, r]) => t(r)).join(", "), s = (e) => {
|
|
12
|
+
const t = o(e).trim();
|
|
13
|
+
if (!t)
|
|
14
|
+
return "";
|
|
15
|
+
let r;
|
|
16
|
+
try {
|
|
17
|
+
r = JSON.parse(t);
|
|
18
|
+
} catch {
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(r))
|
|
22
|
+
return r.length ? String(r.length) : "";
|
|
23
|
+
if (r && typeof r == "object") {
|
|
24
|
+
const n = Object.keys(r).length;
|
|
25
|
+
return n ? String(n) : "";
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}, p = (e) => s(e.manual_merchandising) || s(e.manual_merchandising_products), g = (e) => {
|
|
29
|
+
if (Array.isArray(e))
|
|
30
|
+
return e.length;
|
|
31
|
+
const { conditionList: t } = e ?? {};
|
|
32
|
+
return Array.isArray(t) ? t.length : 1;
|
|
33
|
+
}, h = (e) => {
|
|
34
|
+
const t = e.filters;
|
|
35
|
+
if (!t)
|
|
36
|
+
return 0;
|
|
37
|
+
try {
|
|
38
|
+
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
39
|
+
return !r || typeof r != "object" ? 0 : Object.values(r).reduce((n, i) => n + g(i), 0);
|
|
40
|
+
} catch {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
}, f = (e, t) => {
|
|
44
|
+
const r = o(e.updated_at || e.created_at);
|
|
45
|
+
return r ? t("recommendation-strategy.last-updated-on", { value: c(r) }) : "";
|
|
46
|
+
}, y = (e, t = a()) => {
|
|
47
|
+
const r = t("recommendation-strategy.none"), n = h(e);
|
|
48
|
+
return {
|
|
49
|
+
details: [
|
|
50
|
+
{ title: t("gpt-app-builder.algorithms-and-method"), value: u(e, t) },
|
|
51
|
+
{ title: t("gpt-app-builder.exclusions"), value: m(e, t) || r },
|
|
52
|
+
{ title: t("discovery-strategy.filters"), value: n ? String(n) : r },
|
|
53
|
+
{ title: t("action-builder.manual-merchandising"), value: p(e) || r }
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
}, b = (e, t = a()) => ({
|
|
57
|
+
id: `strategy-info-${e.strategy_id}`,
|
|
58
|
+
theme: "light",
|
|
59
|
+
variant: "information",
|
|
60
|
+
className: d,
|
|
61
|
+
titleText: l(o(e.name)),
|
|
62
|
+
descriptionStatus: !0,
|
|
63
|
+
descriptionText: f(e, t),
|
|
64
|
+
slotProps: y(e, t)
|
|
65
|
+
});
|
|
66
|
+
export {
|
|
67
|
+
b as buildStrategyInfoBoxProps
|
|
68
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as
|
|
4
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
5
|
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
@@ -11,20 +11,20 @@ import { useEditorStore as z } from "../stores/editor.js";
|
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
13
|
function O(m) {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const o =
|
|
14
|
+
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
|
+
return i.forEach((s) => {
|
|
16
|
+
const o = s.getAttribute(A.PAGE_LIST);
|
|
17
17
|
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
20
|
async function M(m) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
|
+
if (n.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const i = C();
|
|
25
|
+
n.forEach((t) => {
|
|
26
26
|
var r, l, g, f, c;
|
|
27
|
-
const
|
|
27
|
+
const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
|
|
28
28
|
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -42,24 +42,27 @@ async function M(m) {
|
|
|
42
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy: L(e.strategy) ||
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
strategy: L(e.strategy) || a.strategy,
|
|
46
|
+
// esd-ext-config is the source of truth for the assigned RRS —
|
|
47
|
+
// a strategy-backed block must survive save/reopen from it alone.
|
|
48
|
+
strategyId: e.strategyId ?? a.strategyId,
|
|
49
|
+
language: e.language ?? a.language,
|
|
50
|
+
size: e.size ?? a.size,
|
|
48
51
|
// Spread the default arrays so each block gets a fresh reference
|
|
49
52
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
50
|
-
productIds: e.productIds ?? [...
|
|
51
|
-
filters: e.filters ?? [...
|
|
52
|
-
shuffleProducts: e.shuffleProducts ??
|
|
53
|
+
productIds: e.productIds ?? [...a.productIds],
|
|
54
|
+
filters: e.filters ?? [...a.filters],
|
|
55
|
+
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
53
56
|
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
|
|
54
57
|
currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
|
|
55
58
|
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
|
|
56
59
|
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
|
|
57
60
|
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
|
|
58
61
|
};
|
|
59
|
-
|
|
62
|
+
i.seedBlockUrlConfig(o, h);
|
|
60
63
|
});
|
|
61
64
|
try {
|
|
62
|
-
await
|
|
65
|
+
await i.fetchRecommendationCreateData();
|
|
63
66
|
} catch (t) {
|
|
64
67
|
console.warn(
|
|
65
68
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -68,39 +71,39 @@ async function M(m) {
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
const Z = () => {
|
|
71
|
-
const m = N(), u = z(),
|
|
74
|
+
const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
72
75
|
return {
|
|
73
76
|
prepareTemplateDetails: async () => {
|
|
74
77
|
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
75
78
|
if (e("linkTrackingIds"))
|
|
76
79
|
try {
|
|
77
|
-
const { html:
|
|
78
|
-
u.trackIdSessionFloor =
|
|
79
|
-
} catch (
|
|
80
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
|
|
82
|
+
} catch (S) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", S);
|
|
81
84
|
}
|
|
82
|
-
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await
|
|
85
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
|
|
83
86
|
minimize: !0,
|
|
84
87
|
resetDataSavedFlag: !1
|
|
85
88
|
});
|
|
86
|
-
|
|
87
|
-
const { compiledHtml:
|
|
89
|
+
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
|
|
90
|
+
const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
|
|
88
91
|
return console.debug("HTML Compilation Stats:", {
|
|
89
|
-
originalSize:
|
|
90
|
-
compiledSize:
|
|
91
|
-
reduction: `${
|
|
92
|
-
appliedRules:
|
|
93
|
-
executionTime: `${
|
|
92
|
+
originalSize: y.originalSize,
|
|
93
|
+
compiledSize: y.compiledSize,
|
|
94
|
+
reduction: `${y.reductionPercentage.toFixed(2)}%`,
|
|
95
|
+
appliedRules: w,
|
|
96
|
+
executionTime: `${y.executionTime.toFixed(2)}ms`
|
|
94
97
|
}), {
|
|
95
|
-
dynamicContentList:
|
|
96
|
-
compiledHtml:
|
|
98
|
+
dynamicContentList: E,
|
|
99
|
+
compiledHtml: I,
|
|
97
100
|
rawHtml: r,
|
|
98
101
|
css: l,
|
|
99
|
-
ampHtml:
|
|
102
|
+
ampHtml: D,
|
|
100
103
|
ampErrors: T,
|
|
101
104
|
modules: g.map(Number),
|
|
102
105
|
recommendation: {
|
|
103
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: P.recommendationCampaignUrls,
|
|
104
107
|
configs: {}
|
|
105
108
|
},
|
|
106
109
|
unsubscribe: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0-beta.1631b31",
|
|
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",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
51
|
+
"@useinsider/design-system-organisms": "0.0.3-beta.926f4b6",
|
|
51
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
52
53
|
"@vueuse/core": "11.3.0",
|
|
53
54
|
"lodash-es": "4.17.21",
|