@useinsider/guido 3.0.0-beta.7a5aecd → 3.0.0-beta.7d3a300
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/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +2 -2
- package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/extensions/Blocks/Recommendation/block.js +4 -1
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +27 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +96 -88
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +83 -81
- package/dist/extensions/Blocks/Recommendation/extension.js +18 -16
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +126 -2
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +124 -106
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +8 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -33
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +8 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/static/styles/components/button.css.js +13 -7
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/static/styles/variables.css.js +3 -0
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { EditorStatePropertyType as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import { DESKTOP_CONTAINER_SELECTOR as
|
|
7
|
-
import { SPACING_STEP as
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var w = (u, s, t) => s in u ? R(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
|
|
3
|
+
var C = (u, s, t) => w(u, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { EditorStatePropertyType as E, PreviewDeviceMode as V, ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as B } from "../../../common-control.js";
|
|
6
|
+
import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as P } from "../../constants/selectors.js";
|
|
7
|
+
import { SPACING_STEP as _, MAX_SPACING as N, MIN_SPACING as b, DEFAULT_COLUMN_SPACING as g, DEFAULT_ROW_SPACING as G } from "../../constants/layout.js";
|
|
8
8
|
import { RecommendationConfigService as d } from "../../services/configService.js";
|
|
9
|
-
import { useRecommendationExtensionStore as
|
|
10
|
-
import { safeGetStyle as
|
|
11
|
-
import { getCurrentLayout as
|
|
12
|
-
import { useDebounceFn as
|
|
9
|
+
import { useRecommendationExtensionStore as U } from "../../store/recommendation.js";
|
|
10
|
+
import { safeGetStyle as L, safeGetParent as I } from "../../utils/tagName.js";
|
|
11
|
+
import { getCurrentLayout as f, getBlockElement as x } from "../main/utils.js";
|
|
12
|
+
import { useDebounceFn as O } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
13
13
|
const W = "recommendation-spacing-control", i = {
|
|
14
14
|
COLUMN_SPACING: "columnSpacing",
|
|
15
15
|
COLUMN_SPACING_LABEL: "columnSpacingLabel",
|
|
@@ -19,46 +19,46 @@ const W = "recommendation-spacing-control", i = {
|
|
|
19
19
|
MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
|
|
20
20
|
MOBILE_ROW_SPACING: "mobileRowSpacing",
|
|
21
21
|
MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
|
|
22
|
-
},
|
|
22
|
+
}, A = {
|
|
23
23
|
COLUMN_SPACING: "data-column-spacing",
|
|
24
24
|
ROW_SPACING: "data-row-spacing",
|
|
25
25
|
MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
|
|
26
26
|
MOBILE_ROW_SPACING: "data-mobile-row-spacing"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
if (!
|
|
30
|
-
return
|
|
31
|
-
const t = parseFloat(
|
|
32
|
-
return Number.isNaN(t) ?
|
|
28
|
+
function M(u, s) {
|
|
29
|
+
if (!u)
|
|
30
|
+
return s;
|
|
31
|
+
const t = parseFloat(u);
|
|
32
|
+
return Number.isNaN(t) ? s : t;
|
|
33
33
|
}
|
|
34
|
-
class X extends
|
|
34
|
+
class X extends B {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
C(this, "store", U());
|
|
38
|
+
C(this, "unsubscribeOrientation", null);
|
|
39
39
|
/**
|
|
40
40
|
* Debounced version of _onColumnSpacingChange
|
|
41
41
|
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
C(this, "_debouncedOnColumnSpacingChange", O((t) => {
|
|
44
44
|
this._onColumnSpacingChange(t);
|
|
45
45
|
}, 300));
|
|
46
46
|
/**
|
|
47
47
|
* Debounced version of _onRowSpacingChange
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
C(this, "_debouncedOnRowSpacingChange", O((t) => {
|
|
50
50
|
this._onRowSpacingChange(t);
|
|
51
51
|
}, 300));
|
|
52
52
|
/**
|
|
53
53
|
* Debounced version of _onMobileColumnSpacingChange
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
C(this, "_debouncedOnMobileColumnSpacingChange", O((t) => {
|
|
56
56
|
this._onMobileColumnSpacingChange(t);
|
|
57
57
|
}, 300));
|
|
58
58
|
/**
|
|
59
59
|
* Debounced version of _onMobileRowSpacingChange
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
C(this, "_debouncedOnMobileRowSpacingChange", O((t) => {
|
|
62
62
|
this._onMobileRowSpacingChange(t);
|
|
63
63
|
}, 300));
|
|
64
64
|
}
|
|
@@ -72,16 +72,16 @@ class X extends V {
|
|
|
72
72
|
this._GuLabel({ text: "Column Spacing on Desktop (px)", name: i.COLUMN_SPACING_LABEL }),
|
|
73
73
|
this._GuCounter({
|
|
74
74
|
name: i.COLUMN_SPACING,
|
|
75
|
-
minValue:
|
|
76
|
-
maxValue:
|
|
77
|
-
step:
|
|
75
|
+
minValue: b,
|
|
76
|
+
maxValue: N,
|
|
77
|
+
step: _
|
|
78
78
|
}),
|
|
79
79
|
this._GuLabel({ text: "Row Spacing on Desktop (px)", name: i.ROW_SPACING_LABEL }),
|
|
80
80
|
this._GuCounter({
|
|
81
81
|
name: i.ROW_SPACING,
|
|
82
|
-
minValue:
|
|
83
|
-
maxValue:
|
|
84
|
-
step:
|
|
82
|
+
minValue: b,
|
|
83
|
+
maxValue: N,
|
|
84
|
+
step: _
|
|
85
85
|
}),
|
|
86
86
|
this._GuLabel({
|
|
87
87
|
text: "Column Spacing on Mobile (px)",
|
|
@@ -89,16 +89,16 @@ class X extends V {
|
|
|
89
89
|
}),
|
|
90
90
|
this._GuCounter({
|
|
91
91
|
name: i.MOBILE_COLUMN_SPACING,
|
|
92
|
-
minValue:
|
|
93
|
-
maxValue:
|
|
94
|
-
step:
|
|
92
|
+
minValue: b,
|
|
93
|
+
maxValue: N,
|
|
94
|
+
step: _
|
|
95
95
|
}),
|
|
96
96
|
this._GuLabel({ text: "Row Spacing on Mobile (px)", name: i.MOBILE_ROW_SPACING_LABEL }),
|
|
97
97
|
this._GuCounter({
|
|
98
98
|
name: i.MOBILE_ROW_SPACING,
|
|
99
|
-
minValue:
|
|
100
|
-
maxValue:
|
|
101
|
-
step:
|
|
99
|
+
minValue: b,
|
|
100
|
+
maxValue: N,
|
|
101
|
+
step: _
|
|
102
102
|
})
|
|
103
103
|
])}
|
|
104
104
|
</div>
|
|
@@ -118,7 +118,7 @@ class X extends V {
|
|
|
118
118
|
* using Stripo's EditorStatePropertyType API.
|
|
119
119
|
*/
|
|
120
120
|
_isMobileMode() {
|
|
121
|
-
return this.api.getEditorState()[
|
|
121
|
+
return this.api.getEditorState()[E.previewDeviceMode] === V.MOBILE;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Updates spacing control visibility based on layout orientation, editor mode,
|
|
@@ -132,8 +132,8 @@ class X extends V {
|
|
|
132
132
|
_updateSpacingVisibility() {
|
|
133
133
|
if (!this.api)
|
|
134
134
|
return;
|
|
135
|
-
const t = d.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, n = t.layout || e ||
|
|
136
|
-
this.api.setVisibility(i.COLUMN_SPACING, o && !r &&
|
|
135
|
+
const t = d.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, n = t.layout || e || f(this.currentNode), o = n === "grid", a = n === "list", r = this._isMobileMode(), c = t.cardsInRow > 1, l = t.mobileCardsInRow > 1;
|
|
136
|
+
this.api.setVisibility(i.COLUMN_SPACING, o && !r && c), this.api.setVisibility(i.COLUMN_SPACING_LABEL, o && !r && c), this.api.setVisibility(i.ROW_SPACING, a || !r), this.api.setVisibility(i.ROW_SPACING_LABEL, a || !r), this.api.setVisibility(i.MOBILE_COLUMN_SPACING, o && r && l), this.api.setVisibility(i.MOBILE_COLUMN_SPACING_LABEL, o && r && l), this.api.setVisibility(i.MOBILE_ROW_SPACING, !a && r), this.api.setVisibility(i.MOBILE_ROW_SPACING_LABEL, !a && r);
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Reads spacing values from node config first, falls back to DOM styles.
|
|
@@ -159,20 +159,20 @@ class X extends V {
|
|
|
159
159
|
*/
|
|
160
160
|
_getStoredColumnSpacing() {
|
|
161
161
|
if (!this.currentNode)
|
|
162
|
-
return
|
|
163
|
-
const t = this.currentNode.querySelector(
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
if (!
|
|
167
|
-
return
|
|
168
|
-
const
|
|
169
|
-
return
|
|
162
|
+
return g;
|
|
163
|
+
const t = this.currentNode.querySelector(S) ?? this.currentNode;
|
|
164
|
+
if (f(this.currentNode) === "grid") {
|
|
165
|
+
const l = t.querySelector(".recommendation-attribute-row"), p = l == null ? void 0 : l.querySelector("td"), h = L(p, "padding");
|
|
166
|
+
if (!h)
|
|
167
|
+
return g;
|
|
168
|
+
const y = h.trim().split(/\s+/);
|
|
169
|
+
return y.length < 2 ? g : M(y[1], g / 2) * 2;
|
|
170
170
|
}
|
|
171
|
-
const n = t.querySelector(".product-card-wrapper"), o =
|
|
171
|
+
const n = t.querySelector(".product-card-wrapper"), o = I(n), a = L(o, "padding");
|
|
172
172
|
if (!a)
|
|
173
|
-
return
|
|
173
|
+
return g;
|
|
174
174
|
const r = a.trim().split(/\s+/);
|
|
175
|
-
return r.length < 2 ?
|
|
175
|
+
return r.length < 2 ? g : M(r[1], g / 2) * 2;
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* Gets stored row spacing from the first spacer element's height style
|
|
@@ -180,9 +180,9 @@ class X extends V {
|
|
|
180
180
|
*/
|
|
181
181
|
_getStoredRowSpacing() {
|
|
182
182
|
if (!this.currentNode)
|
|
183
|
-
return
|
|
184
|
-
const e = (this.currentNode.querySelector(
|
|
185
|
-
return
|
|
183
|
+
return G;
|
|
184
|
+
const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer"), n = L(e, "height");
|
|
185
|
+
return M(n, G);
|
|
186
186
|
}
|
|
187
187
|
// ========================================================================
|
|
188
188
|
// Desktop Spacing Handlers
|
|
@@ -199,17 +199,18 @@ class X extends V {
|
|
|
199
199
|
this.currentNode,
|
|
200
200
|
{ columnSpacing: t },
|
|
201
201
|
`Changed column spacing to ${t}px`
|
|
202
|
-
), this._storeDataAttribute(
|
|
203
|
-
const n = d.getConfig(this.currentNode).layout ||
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
).forEach((
|
|
207
|
-
o.modifyHtml(
|
|
202
|
+
), this._storeDataAttribute(A.COLUMN_SPACING, t);
|
|
203
|
+
const n = d.getConfig(this.currentNode).layout || f(this.currentNode), o = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(S);
|
|
204
|
+
c && (n === "grid" ? Array.from(
|
|
205
|
+
c.querySelectorAll(".attribute-cell")
|
|
206
|
+
).forEach((p) => {
|
|
207
|
+
o.modifyHtml(p).setStyle("padding", r);
|
|
208
208
|
}) : Array.from(
|
|
209
|
-
|
|
210
|
-
).forEach((
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
c.querySelectorAll(".product-card-wrapper")
|
|
210
|
+
).forEach((p) => {
|
|
211
|
+
const h = I(p);
|
|
212
|
+
h && o.modifyHtml(h).setStyle("padding", r);
|
|
213
|
+
}), o.apply(new m(`Update column spacing to ${t}px`)));
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
216
|
* Handles row spacing changes for desktop.
|
|
@@ -223,8 +224,8 @@ class X extends V {
|
|
|
223
224
|
this.currentNode,
|
|
224
225
|
{ rowSpacing: t },
|
|
225
226
|
`Changed row spacing to ${t}px`
|
|
226
|
-
), this._storeDataAttribute(
|
|
227
|
-
const e = this.currentNode.querySelector(
|
|
227
|
+
), this._storeDataAttribute(A.ROW_SPACING, t);
|
|
228
|
+
const e = this.currentNode.querySelector(S);
|
|
228
229
|
if (!e)
|
|
229
230
|
return;
|
|
230
231
|
const n = Array.from(
|
|
@@ -235,7 +236,7 @@ class X extends V {
|
|
|
235
236
|
const o = this.api.getDocumentModifier(), a = `${t}px`;
|
|
236
237
|
n.forEach((r) => {
|
|
237
238
|
o.modifyHtml(r).setStyle("height", a);
|
|
238
|
-
}), o.apply(new
|
|
239
|
+
}), o.apply(new m(`Update row spacing to ${t}px`));
|
|
239
240
|
}
|
|
240
241
|
// ========================================================================
|
|
241
242
|
// Mobile Spacing Handlers
|
|
@@ -252,17 +253,18 @@ class X extends V {
|
|
|
252
253
|
this.currentNode,
|
|
253
254
|
{ mobileColumnSpacing: t },
|
|
254
255
|
`Changed mobile column spacing to ${t}px`
|
|
255
|
-
), this._storeDataAttribute(
|
|
256
|
-
const n = d.getConfig(this.currentNode).layout ||
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
).forEach((
|
|
260
|
-
o.modifyHtml(
|
|
256
|
+
), this._storeDataAttribute(A.MOBILE_COLUMN_SPACING, t);
|
|
257
|
+
const n = d.getConfig(this.currentNode).layout || f(this.currentNode), o = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(P);
|
|
258
|
+
c && (n === "grid" ? Array.from(
|
|
259
|
+
c.querySelectorAll(".attribute-cell")
|
|
260
|
+
).forEach((p) => {
|
|
261
|
+
o.modifyHtml(p).setStyle("padding", r);
|
|
261
262
|
}) : Array.from(
|
|
262
|
-
|
|
263
|
-
).forEach((
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
c.querySelectorAll(".product-card-wrapper")
|
|
264
|
+
).forEach((p) => {
|
|
265
|
+
const h = I(p);
|
|
266
|
+
h && o.modifyHtml(h).setStyle("padding", r);
|
|
267
|
+
}), o.apply(new m(`Update mobile column spacing to ${t}px`)));
|
|
266
268
|
}
|
|
267
269
|
/**
|
|
268
270
|
* Handles row spacing changes for mobile.
|
|
@@ -276,8 +278,8 @@ class X extends V {
|
|
|
276
278
|
this.currentNode,
|
|
277
279
|
{ mobileRowSpacing: t },
|
|
278
280
|
`Changed mobile row spacing to ${t}px`
|
|
279
|
-
), this._storeDataAttribute(
|
|
280
|
-
const e = this.currentNode.querySelector(
|
|
281
|
+
), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
|
|
282
|
+
const e = this.currentNode.querySelector(P);
|
|
281
283
|
if (!e)
|
|
282
284
|
return;
|
|
283
285
|
const n = Array.from(
|
|
@@ -288,7 +290,7 @@ class X extends V {
|
|
|
288
290
|
const o = this.api.getDocumentModifier(), a = `${t}px`;
|
|
289
291
|
n.forEach((r) => {
|
|
290
292
|
o.modifyHtml(r).setStyle("height", a);
|
|
291
|
-
}), o.apply(new
|
|
293
|
+
}), o.apply(new m(`Update mobile row spacing to ${t}px`));
|
|
292
294
|
}
|
|
293
295
|
// ========================================================================
|
|
294
296
|
// Data Attribute Storage
|
|
@@ -298,7 +300,7 @@ class X extends V {
|
|
|
298
300
|
*/
|
|
299
301
|
_storeDataAttribute(t, e) {
|
|
300
302
|
const n = x(this.currentNode);
|
|
301
|
-
n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new
|
|
303
|
+
n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
|
|
302
304
|
}
|
|
303
305
|
// ========================================================================
|
|
304
306
|
// Event Listeners
|
|
@@ -333,7 +335,7 @@ class X extends V {
|
|
|
333
335
|
*/
|
|
334
336
|
_subscribeToEditorModeChanges() {
|
|
335
337
|
this.api.onEditorStatePropUpdated(
|
|
336
|
-
|
|
338
|
+
E.previewDeviceMode,
|
|
337
339
|
() => {
|
|
338
340
|
this._updateSpacingVisibility();
|
|
339
341
|
}
|
|
@@ -8,35 +8,37 @@ import { OldPriceControls as l } from "./controls/oldPrice/index.js";
|
|
|
8
8
|
import { OmnibusPriceControls as s } from "./controls/omnibusPrice/index.js";
|
|
9
9
|
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
10
10
|
import { ButtonControls as p } from "./controls/button/index.js";
|
|
11
|
-
import { ImageControls as
|
|
12
|
-
import {
|
|
11
|
+
import { ImageControls as C } from "./controls/image/index.js";
|
|
12
|
+
import { CustomAttributeControls as c } from "./controls/customAttribute/index.js";
|
|
13
|
+
import { SpacingControl as f } from "./controls/spacing/index.js";
|
|
13
14
|
import { CardBackgroundColorControl as d } from "./controls/cardBackground/index.js";
|
|
14
|
-
import { LayoutControl as
|
|
15
|
-
import { RecommendationCardCompositionControl as
|
|
16
|
-
import { RecommendationIconsRegistry as
|
|
17
|
-
import
|
|
18
|
-
import { SettingsPanel as
|
|
19
|
-
const
|
|
15
|
+
import { LayoutControl as u } from "./controls/layout/index.js";
|
|
16
|
+
import { RecommendationCardCompositionControl as g } from "./controls/cardComposition/index.js";
|
|
17
|
+
import { RecommendationIconsRegistry as R } from "./iconsRegistry.js";
|
|
18
|
+
import y from "./recommendation.css.js";
|
|
19
|
+
import { SettingsPanel as B } from "./settingsPanel.js";
|
|
20
|
+
const b = [
|
|
20
21
|
i,
|
|
21
22
|
e,
|
|
22
23
|
l,
|
|
23
24
|
s,
|
|
24
25
|
a,
|
|
25
26
|
p,
|
|
27
|
+
C,
|
|
26
28
|
c
|
|
27
29
|
], P = [
|
|
28
30
|
n,
|
|
29
31
|
d,
|
|
32
|
+
u,
|
|
30
33
|
f,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
], b = [
|
|
34
|
+
g
|
|
35
|
+
], k = [
|
|
34
36
|
...P,
|
|
35
|
-
...
|
|
36
|
-
],
|
|
37
|
+
...b.flatMap((o) => Object.values(o))
|
|
38
|
+
], J = k.reduce(
|
|
37
39
|
(o, t) => o.addControl(t),
|
|
38
|
-
new r().addBlock(m).withSettingsPanelRegistry(
|
|
39
|
-
).addStyles(
|
|
40
|
+
new r().addBlock(m).withSettingsPanelRegistry(B)
|
|
41
|
+
).addStyles(y).withIconsRegistry(R).build();
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
J as default
|
|
42
44
|
};
|
|
@@ -3,7 +3,7 @@ const n = `/* Utils */
|
|
|
3
3
|
|
|
4
4
|
/* Recommendation Controls - Main settings panel separators */
|
|
5
5
|
.recommendation-controls-container > div {
|
|
6
|
-
border-bottom: 1px solid #
|
|
6
|
+
border-bottom: 1px solid #eee;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.recommendation-controls-container > div:first-child {
|
|
@@ -18,11 +18,135 @@ const n = `/* Utils */
|
|
|
18
18
|
padding: 0
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/* Hide drag icon for list layout (ordering disabled) */
|
|
21
|
+
/* Hide drag icon for list layout (ordering disabled) — legacy UE-ORDERABLE */
|
|
22
22
|
ue-orderable.orderable-disabled .droppable-icon {
|
|
23
23
|
display: none;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/* =============================================
|
|
27
|
+
Custom Orderable List (replaces UE-ORDERABLE)
|
|
28
|
+
============================================= */
|
|
29
|
+
|
|
30
|
+
/* Card Composition Description */
|
|
31
|
+
.card-composition-description {
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
color: var(--guido-color-gray-800);
|
|
34
|
+
margin: 0;
|
|
35
|
+
line-height: 1.4;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Add Attribute button */
|
|
39
|
+
#guido__btn-add-attribute {
|
|
40
|
+
margin: 16px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#guido__btn-add-attribute .button {
|
|
44
|
+
background: var(--guido-color-primary-100);
|
|
45
|
+
color: var(--guido-color-primary-500);
|
|
46
|
+
border: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
#guido__btn-add-attribute .button:not(.disabled):hover {
|
|
50
|
+
background: var(--guido-color-primary-0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#guido__btn-add-attribute .button.disabled {
|
|
54
|
+
background: var(--guido-color-gray-100);
|
|
55
|
+
color: var(--guido-color-gray-500);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Custom attribute select wrapper (inside orderable item) */
|
|
59
|
+
.custom-attr-select-wrap {
|
|
60
|
+
flex: 1;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.custom-attr-select-wrap ue-select {
|
|
65
|
+
width: 270px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Orderable List */
|
|
69
|
+
.orderable-list {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.orderable-item {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
gap: 4px;
|
|
78
|
+
padding: 16px;
|
|
79
|
+
min-height: 72px;
|
|
80
|
+
background: var(--guido-color-white);
|
|
81
|
+
border-top: 1px solid #eee;
|
|
82
|
+
cursor: default;
|
|
83
|
+
transition: background 0.15s;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.orderable-item:first-child {
|
|
88
|
+
border-top: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.orderable-item:hover {
|
|
92
|
+
background: #fafafa;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.orderable-item.dragging {
|
|
96
|
+
opacity: 0.5;
|
|
97
|
+
background: var(--guido-color-gray-1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.orderable-item.drag-over {
|
|
101
|
+
border-top: 2px solid var(--guido-color-primary-500, #0A2ECC);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.drag-handle {
|
|
105
|
+
user-select: none;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: 24px;
|
|
110
|
+
height: 24px;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.drag-handle .drag-handle-btn .button {
|
|
115
|
+
padding: 0;
|
|
116
|
+
min-width: auto;
|
|
117
|
+
cursor: move;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.drag-handle .drag-handle-btn .button .icon-button {
|
|
121
|
+
color: var(--guido-color-gray-600);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.item-label {
|
|
125
|
+
flex: 1;
|
|
126
|
+
font-size: 13px;
|
|
127
|
+
line-height: 16px;
|
|
128
|
+
color: #333;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.item-action {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Custom attribute delete button */
|
|
137
|
+
.custom-attr-delete .button .icon-button {
|
|
138
|
+
color: var(--guido-color-danger-500);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Disable drag for list layout */
|
|
142
|
+
.orderable-list.orderable-disabled .drag-handle {
|
|
143
|
+
display: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.orderable-list.orderable-disabled .orderable-item {
|
|
147
|
+
cursor: default;
|
|
148
|
+
}
|
|
149
|
+
|
|
26
150
|
/* ─── Migration Info Box ─────────────────────────────────────────────── */
|
|
27
151
|
/* Shown in the settings panel title when a block was migrated from legacy */
|
|
28
152
|
|