@useinsider/guido 3.7.2-beta.13c9a35 → 3.7.2-beta.1489585
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/@types/config/schemas.js +66 -70
- package/dist/composables/usePreviewMode.js +14 -15
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +78 -92
- package/dist/config/migrator/recommendation/htmlBuilder.js +58 -59
- package/dist/config/migrator/recommendation/settingsMapper.js +33 -38
- package/dist/extensions/Blocks/Recommendation/block.js +41 -60
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +32 -41
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -10
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +288 -369
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +82 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +30 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +28 -34
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +288 -338
- package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +7 -21
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -64
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +5 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +155 -215
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -31
- package/dist/extensions/Blocks/Recommendation/templates/index.js +29 -10
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +145 -133
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +43 -22
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +109 -92
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +216 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +30 -22
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- package/dist/src/@types/config/schemas.d.ts +0 -16
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -29
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +20 -47
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +163 -41
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +78 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +29 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/dist/src/stores/config.d.ts +0 -36
- package/package.json +1 -1
- package/dist/composables/useRecommendationPreview.js +0 -100
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +0 -133
- package/dist/src/composables/useRecommendationPreview.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +0 -59
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
|
@@ -2,12 +2,13 @@ import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-edito
|
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import { RecommendationBlockControl as n } from "./controls/main/index.js";
|
|
4
4
|
import "./store/recommendation.js";
|
|
5
|
+
import "./utils/captureStyleTemplates.js";
|
|
5
6
|
import { NameControls as i } from "./controls/name/index.js";
|
|
6
7
|
import { PriceControls as e } from "./controls/price/index.js";
|
|
7
8
|
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
8
9
|
import { OmnibusPriceControls as l } from "./controls/omnibusPrice/index.js";
|
|
9
|
-
import { OmnibusDiscountControls as
|
|
10
|
-
import { ButtonControls as
|
|
10
|
+
import { OmnibusDiscountControls as p } from "./controls/omnibusDiscount/index.js";
|
|
11
|
+
import { ButtonControls as a } from "./controls/button/index.js";
|
|
11
12
|
import { ImageControls as c } from "./controls/image/index.js";
|
|
12
13
|
import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
|
|
13
14
|
import { SpacingControl as f } from "./controls/spacing/index.js";
|
|
@@ -22,8 +23,8 @@ const b = [
|
|
|
22
23
|
e,
|
|
23
24
|
s,
|
|
24
25
|
l,
|
|
25
|
-
a,
|
|
26
26
|
p,
|
|
27
|
+
a,
|
|
27
28
|
c,
|
|
28
29
|
C
|
|
29
30
|
], P = [
|
|
@@ -35,10 +36,10 @@ const b = [
|
|
|
35
36
|
], S = [
|
|
36
37
|
...P,
|
|
37
38
|
...b.flatMap((o) => Object.values(o))
|
|
38
|
-
],
|
|
39
|
+
], L = S.reduce(
|
|
39
40
|
(o, t) => o.addControl(t),
|
|
40
41
|
new r().addBlock(m).withSettingsPanelRegistry(B)
|
|
41
42
|
).addStyles(y).withIconsRegistry(R).build();
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
L as default
|
|
44
45
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import r from "../../../static/assets/info.svg.js";
|
|
2
|
-
import { IconsRegistry as
|
|
3
|
-
class h extends
|
|
4
|
-
registerIconsSvg(
|
|
5
|
-
|
|
2
|
+
import { IconsRegistry as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
class h extends t {
|
|
4
|
+
registerIconsSvg(C) {
|
|
5
|
+
C["recommendation-icon"] = `
|
|
6
6
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
7
7
|
<path d="M10 4.4C10 4.73137 9.73012 4.99622 9.40108 5.0355C6.92202 5.33143 5 7.44126 5 10C5 12.5587
|
|
8
8
|
6.92202 14.6686 9.40108 14.9645C9.73012 15.0038 10 15.2686 10 15.6V18.4C10 18.7314 9.73137 19 9.4
|
|
@@ -44,14 +44,14 @@ class h extends C {
|
|
|
44
44
|
3.40029 12.0082 3.25285 11.7656 3.15234C11.365 2.98638 11.0001 2.64849 11 2.21484V2Z"
|
|
45
45
|
fill="currentColor"/>
|
|
46
46
|
</svg>
|
|
47
|
-
`,
|
|
47
|
+
`, C["grid-orientation"] = `
|
|
48
48
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
49
49
|
<rect x="1" y="1" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
50
50
|
<rect x="12" y="1" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
51
51
|
<rect x="1" y="12" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
52
52
|
<rect x="12" y="12" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
53
53
|
</svg>
|
|
54
|
-
`,
|
|
54
|
+
`, C["list-orientation"] = `
|
|
55
55
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
56
56
|
<circle cx="3" cy="4" r="1" stroke="currentColor" stroke-width="1"/>
|
|
57
57
|
<rect x="7" y="3" width="11" height="2" rx="1"/>
|
|
@@ -60,21 +60,7 @@ class h extends C {
|
|
|
60
60
|
<circle cx="3" cy="16" r="1" stroke="currentColor" stroke-width="1"/>
|
|
61
61
|
<rect x="7" y="15" width="11" height="2" rx="1"/>
|
|
62
62
|
</svg>
|
|
63
|
-
`,
|
|
64
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
65
|
-
<path d="M19 10V16C19 16.5523 18.5523 17 18 17H2C1.44772 17 1 16.5523 1 16V10H19Z"
|
|
66
|
-
stroke="currentColor" stroke-width="2" fill="none"/>
|
|
67
|
-
<path d="M2 3H18C18.5523 3 19 3.44772 19 4V10H1V4C1 3.44772 1.44772 3 2 3Z" stroke="currentColor"
|
|
68
|
-
stroke-width="2" fill="none"/>
|
|
69
|
-
</svg>
|
|
70
|
-
`, t["horizontal-orientation"] = `
|
|
71
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
|
72
|
-
<path d="M10 19H4C3.44772 19 3 18.5523 3 18V2C3 1.44772 3.44772 1 4 1H10V19Z" stroke="currentColor"
|
|
73
|
-
stroke-width="2" fill="none"/>
|
|
74
|
-
<path d="M17 2V18C17 18.5523 16.5523 19 16 19H10V1H16C16.5523 1 17 1.44772 17 2Z" stroke="currentColor"
|
|
75
|
-
stroke-width="2" fill="none"/>
|
|
76
|
-
</svg>
|
|
77
|
-
`, t["migration-info-icon"] = r;
|
|
63
|
+
`, C["migration-info-icon"] = r;
|
|
78
64
|
}
|
|
79
65
|
}
|
|
80
66
|
export {
|
|
@@ -18,13 +18,6 @@ const n = `/* Utils */
|
|
|
18
18
|
padding: 0
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/* Group the two price-placement rows (orientation + hide-if-same) into one
|
|
22
|
-
container — drop the divider the editor adds between stacked setting rows.
|
|
23
|
-
Ancestor added so this out-specifies the editor's \`.two-columns:not(:first-child)\`. */
|
|
24
|
-
.recommendation-controls-container .price-placement-control-container .container.two-columns {
|
|
25
|
-
border-top: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
21
|
/* Right-align the mobile layout toggle within the two-column grid */
|
|
29
22
|
.product-layout-control-container ue-switcher {
|
|
30
23
|
justify-self: end;
|
|
@@ -150,68 +143,15 @@ ue-orderable.orderable-disabled .droppable-icon {
|
|
|
150
143
|
color: var(--guido-color-danger-500);
|
|
151
144
|
}
|
|
152
145
|
|
|
153
|
-
/*
|
|
154
|
-
.orderable-
|
|
155
|
-
|
|
156
|
-
align-items: stretch;
|
|
157
|
-
gap: 8px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.price-group-header {
|
|
161
|
-
display: flex;
|
|
162
|
-
align-items: center;
|
|
163
|
-
gap: 4px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.price-suborderable-list {
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
margin-left: 4px;
|
|
170
|
-
padding-left: 8px;
|
|
171
|
-
border-left: 2px solid #eee;
|
|
146
|
+
/* Disable drag for list layout */
|
|
147
|
+
.orderable-list.orderable-disabled .drag-handle {
|
|
148
|
+
display: none;
|
|
172
149
|
}
|
|
173
150
|
|
|
174
|
-
.
|
|
175
|
-
display: flex;
|
|
176
|
-
align-items: center;
|
|
177
|
-
gap: 4px;
|
|
178
|
-
padding: 8px 0;
|
|
179
|
-
background: var(--guido-color-white);
|
|
151
|
+
.orderable-list.orderable-disabled .orderable-item {
|
|
180
152
|
cursor: default;
|
|
181
|
-
transition: background 0.15s;
|
|
182
|
-
box-sizing: border-box;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.price-suborderable-item:hover {
|
|
186
|
-
background: #fafafa;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.price-suborderable-item.dragging {
|
|
190
|
-
opacity: 0.5;
|
|
191
|
-
background: var(--guido-color-gray-1);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.price-suborderable-item.drag-over {
|
|
195
|
-
border-top: 2px solid var(--guido-color-primary-500, #0A2ECC);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.price-suborderable-item .item-label {
|
|
199
|
-
font-size: 13px;
|
|
200
153
|
}
|
|
201
154
|
|
|
202
|
-
.sub-drag-handle {
|
|
203
|
-
display: flex;
|
|
204
|
-
align-items: center;
|
|
205
|
-
justify-content: center;
|
|
206
|
-
flex-shrink: 0;
|
|
207
|
-
width: 24px;
|
|
208
|
-
height: 24px;
|
|
209
|
-
cursor: move;
|
|
210
|
-
user-select: none;
|
|
211
|
-
color: var(--guido-color-gray-600);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
155
|
/* ─── Migration Info Box ─────────────────────────────────────────────── */
|
|
216
156
|
/* Shown in the settings panel title when a block was migrated from legacy */
|
|
217
157
|
|
|
@@ -4,6 +4,7 @@ import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
|
+
import "./utils/captureStyleTemplates.js";
|
|
7
8
|
import "./controls/name/index.js";
|
|
8
9
|
import "./controls/price/index.js";
|
|
9
10
|
import "./controls/oldPrice/index.js";
|
|
@@ -15,7 +16,7 @@ import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
|
|
|
15
16
|
import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
|
|
16
17
|
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
17
18
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
18
|
-
class
|
|
19
|
+
class a extends E {
|
|
19
20
|
registerBlockControls(I) {
|
|
20
21
|
I[U] = [
|
|
21
22
|
new _(
|
|
@@ -194,5 +195,5 @@ class Z extends E {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
export {
|
|
197
|
-
|
|
198
|
+
a as SettingsPanel
|
|
198
199
|
};
|
|
@@ -3,10 +3,10 @@ import { useRecommendationApi as y } from "../../../../services/recommendationAp
|
|
|
3
3
|
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
4
|
import { defineStore as P } from "pinia";
|
|
5
5
|
import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
6
|
-
import { EXCLUDED_ALGORITHM_IDS as
|
|
6
|
+
import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
|
-
import { getPartnerRecommendationParams as
|
|
9
|
+
import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
|
|
10
10
|
import { isFilterValid as N } from "../validation/filterSchema.js";
|
|
11
11
|
import { isConfigValid as x } from "../validation/requiredFields.js";
|
|
12
12
|
const h = y();
|
|
@@ -37,9 +37,7 @@ function k() {
|
|
|
37
37
|
textTrimming: !0,
|
|
38
38
|
unresponsive: !1,
|
|
39
39
|
size: "6",
|
|
40
|
-
customAttributes: []
|
|
41
|
-
priceMovedToNextLine: !0,
|
|
42
|
-
priceHideIfSameAsDiscounted: !1
|
|
40
|
+
customAttributes: []
|
|
43
41
|
};
|
|
44
42
|
}
|
|
45
43
|
function I() {
|
|
@@ -119,7 +117,7 @@ const L = () => ({
|
|
|
119
117
|
},
|
|
120
118
|
getActivePredictiveAlgorithms: (t) => {
|
|
121
119
|
const e = g(), r = [];
|
|
122
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
120
|
+
return t.activePredictiveAlgorithms.filter((n) => !w.includes(n)).forEach((n) => {
|
|
123
121
|
r.push(...e.filter((c) => c.id === n));
|
|
124
122
|
}), r.map((n) => ({
|
|
125
123
|
text: n.name,
|
|
@@ -459,7 +457,7 @@ const L = () => ({
|
|
|
459
457
|
};
|
|
460
458
|
r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
461
459
|
a,
|
|
462
|
-
|
|
460
|
+
v(o.partnerName, r.strategy)
|
|
463
461
|
);
|
|
464
462
|
let f;
|
|
465
463
|
try {
|