@useinsider/guido 3.17.0-beta.6255bfc → 3.17.0-beta.77567eb
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 +5 -6
- package/dist/@types/config/schemas.js +6 -12
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +30 -31
- package/dist/composables/useCustomInterfaceAppearance.js +38 -52
- package/dist/composables/useRecommendation.js +44 -52
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -19
- package/dist/config/migrator/recommendationMigrator.js +4 -6
- package/dist/enums/academy.js +1 -2
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +1 -4
- package/dist/extensions/Blocks/Recommendation/block.js +21 -26
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +166 -180
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +110 -251
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +30 -75
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -7
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -15
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -206
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/utils/dateUtil.js +10 -29
- package/dist/utils/templatePreparation.js +34 -37
- package/package.json +3 -4
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -66
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -142
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -30
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -63
- package/dist/src/utils/strategyInfoBox.d.ts +0 -22
- package/dist/static/assets/icons/line-change.svg.js +0 -5
- package/dist/static/assets/icons/line-delete.svg.js +0 -5
- package/dist/static/assets/icons/line-plus.svg.js +0 -5
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -188
- package/dist/utils/strategyInfoBox.js +0 -37
|
@@ -1,188 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useTranslations as m } from "../composables/useTranslations.js";
|
|
2
|
-
import { formatShortDate as u } from "./dateUtil.js";
|
|
3
|
-
import { escapeHtml as c } from "./htmlEscape.js";
|
|
4
|
-
const n = "assign-strategy-info-box", a = (e) => typeof e == "string" ? e : typeof e == "number" ? String(e) : "", p = (e, t) => {
|
|
5
|
-
const r = a(e.algorithm) === "MIXED" ? t("discovery-strategy.mixed-algorithm") : t("discovery-strategy.single-algorithm"), i = a(e.algorithm_used).split(",").map((o) => o.trim()).filter(Boolean).map((o) => t(`recommendation-algorithm-names.${o.replaceAll("_", "-").toLowerCase()}`));
|
|
6
|
-
return i.length ? `${r} · ${i.join(", ")}` : r;
|
|
7
|
-
}, g = (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(", "), h = (e) => a(
|
|
12
|
-
e.manual_merchandising || e.manual_merchandising_products
|
|
13
|
-
).trim(), _ = (e) => {
|
|
14
|
-
const t = e.filters;
|
|
15
|
-
if (!t)
|
|
16
|
-
return 0;
|
|
17
|
-
try {
|
|
18
|
-
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
19
|
-
return Array.isArray(r) ? r.reduce((i, o) => i + (Array.isArray(o) ? o.length : 1), 0) : 0;
|
|
20
|
-
} catch {
|
|
21
|
-
return 0;
|
|
22
|
-
}
|
|
23
|
-
}, s = (e, t) => `<div class="${n}__row"><span class="${n}__label">${c(e)}</span><span class="${n}__value">${c(t)}</span></div>`, v = (e, t = m()) => {
|
|
24
|
-
const r = t("recommendation-strategy.none"), i = a(e.updated_at || e.created_at), o = _(e), d = i ? c(t("recommendation-strategy.last-updated-on", { value: u(i) })) : "", l = d ? `<div class="${n}__updated">${d}</div>` : "";
|
|
25
|
-
return {
|
|
26
|
-
id: `strategy-info-${e.strategy_id}`,
|
|
27
|
-
theme: "light",
|
|
28
|
-
variant: "information",
|
|
29
|
-
className: n,
|
|
30
|
-
titleText: c(a(e.name)),
|
|
31
|
-
descriptionText: l + s(t("gpt-app-builder.algorithms-and-method"), p(e, t)) + s(t("gpt-app-builder.exclusions"), g(e, t) || r) + s(t("discovery-strategy.filters"), o ? String(o) : r) + s(t("action-builder.manual-merchandising"), h(e) || r)
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
n as STRATEGY_INFO_BOX_CLASS,
|
|
36
|
-
v as buildStrategyInfoBoxProps
|
|
37
|
-
};
|