@useinsider/guido 3.6.0-beta.4f2bf14 → 3.6.0-beta.596b70e
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/composables/useRecommendation.js +34 -33
- package/dist/composables/useStripoEventHandler.js +11 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +50 -48
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +24 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +310 -338
- package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +117 -146
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +49 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +110 -83
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +31 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +90 -54
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +139 -0
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +20 -16
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +20 -47
- 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.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +127 -11
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +44 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +20 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/package.json +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
- /package/dist/src/{composables/useStripoEventHandler.test.d.ts → extensions/Blocks/Recommendation/templates/grid/elementRenderer.test.d.ts} +0 -0
|
@@ -1,250 +1,276 @@
|
|
|
1
|
-
import { TextAlignBuiltInControl as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { TextAlignBuiltInControl as a, TextColorBuiltInControl as g, TextSizeBuiltInControl as x, TextStyleBuiltInControl as f, TextFontFamilyBuiltInControl as C, ButtonBackgroundColorBuiltInControl as T, TextPaddingsBuiltInControl as B, ImageSizeBuiltInControl as I, ImageMarginsBuiltInControl as y, ButtonAlignBuiltInControl as m, ButtonBorderBuiltInControl as S, ButtonBorderRadiusBuiltInControl as A, ButtonColorBuiltInControl as b, ButtonFontFamilyBuiltInControl as N, ButtonMarginsBuiltInControl as q, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as k, ButtonTextSizeBuiltInControl as p, ButtonTextStyleAndFontColorBuiltInControl as F, ButtonFitToContainerBuiltInControl as h, TextLineSpacingBuiltInControl as M } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const z = "buttonTextStyleForm";
|
|
3
|
+
function P(o, n, r) {
|
|
4
|
+
return class extends a {
|
|
4
5
|
getId() {
|
|
5
6
|
return o;
|
|
6
7
|
}
|
|
7
|
-
getTargetNodes(
|
|
8
|
+
getTargetNodes(e) {
|
|
8
9
|
if (!n || !r)
|
|
9
|
-
return [
|
|
10
|
-
const
|
|
11
|
-
return
|
|
10
|
+
return [e];
|
|
11
|
+
const t = e.closest(r);
|
|
12
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return class extends
|
|
16
|
+
function _(o, n, r) {
|
|
17
|
+
return class extends g {
|
|
17
18
|
getId() {
|
|
18
19
|
return o;
|
|
19
20
|
}
|
|
20
|
-
getTargetNodes(
|
|
21
|
+
getTargetNodes(e) {
|
|
21
22
|
if (!n || !r)
|
|
22
|
-
return [
|
|
23
|
-
const
|
|
24
|
-
return
|
|
23
|
+
return [e];
|
|
24
|
+
const t = e.closest(r);
|
|
25
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return class extends
|
|
29
|
+
function v(o, n, r) {
|
|
30
|
+
return class extends x {
|
|
30
31
|
getId() {
|
|
31
32
|
return o;
|
|
32
33
|
}
|
|
33
|
-
getTargetNodes(
|
|
34
|
+
getTargetNodes(e) {
|
|
34
35
|
if (!n || !r)
|
|
35
|
-
return [
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
return [e];
|
|
37
|
+
const t = e.closest(r);
|
|
38
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
return class extends
|
|
42
|
+
function L(o, n, r) {
|
|
43
|
+
return class extends f {
|
|
43
44
|
getId() {
|
|
44
45
|
return o;
|
|
45
46
|
}
|
|
46
|
-
getTargetNodes(
|
|
47
|
+
getTargetNodes(e) {
|
|
47
48
|
if (!n || !r)
|
|
48
|
-
return [
|
|
49
|
-
const
|
|
50
|
-
return
|
|
49
|
+
return [e];
|
|
50
|
+
const t = e.closest(r);
|
|
51
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
-
return class extends
|
|
55
|
+
function R(o, n, r) {
|
|
56
|
+
return class extends C {
|
|
56
57
|
getId() {
|
|
57
58
|
return o;
|
|
58
59
|
}
|
|
59
|
-
getTargetNodes(
|
|
60
|
+
getTargetNodes(e) {
|
|
60
61
|
if (!n || !r)
|
|
61
|
-
return [
|
|
62
|
-
const
|
|
63
|
-
return
|
|
62
|
+
return [e];
|
|
63
|
+
const t = e.closest(r);
|
|
64
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
return class extends
|
|
68
|
+
function O(o, n, r) {
|
|
69
|
+
return class extends T {
|
|
69
70
|
getId() {
|
|
70
71
|
return o;
|
|
71
72
|
}
|
|
72
|
-
getTargetNodes(
|
|
73
|
+
getTargetNodes(e) {
|
|
73
74
|
if (!n || !r)
|
|
74
|
-
return [
|
|
75
|
-
const
|
|
76
|
-
return
|
|
75
|
+
return [e];
|
|
76
|
+
const t = e.closest(r);
|
|
77
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
77
78
|
}
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
return class extends
|
|
81
|
+
function Y(o, n, r) {
|
|
82
|
+
return class extends B {
|
|
82
83
|
getId() {
|
|
83
84
|
return o;
|
|
84
85
|
}
|
|
85
|
-
getTargetNodes(
|
|
86
|
+
getTargetNodes(e) {
|
|
86
87
|
if (!n || !r)
|
|
87
|
-
return [
|
|
88
|
-
const
|
|
89
|
-
return
|
|
88
|
+
return [e];
|
|
89
|
+
const t = e.closest(r);
|
|
90
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
return class extends
|
|
94
|
+
function w(o, n, r) {
|
|
95
|
+
return class extends M {
|
|
95
96
|
getId() {
|
|
96
97
|
return o;
|
|
97
98
|
}
|
|
98
|
-
getTargetNodes(
|
|
99
|
-
return [
|
|
99
|
+
getTargetNodes(e) {
|
|
100
|
+
return [e];
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
-
return class extends
|
|
104
|
+
function D(o, n, r = ".ins-recommendation-product-container") {
|
|
105
|
+
return class extends m {
|
|
105
106
|
getId() {
|
|
106
107
|
return o;
|
|
107
108
|
}
|
|
108
|
-
getTargetNodes(
|
|
109
|
-
const
|
|
110
|
-
return
|
|
109
|
+
getTargetNodes(e) {
|
|
110
|
+
const t = e.closest(r);
|
|
111
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
111
112
|
}
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
return class extends
|
|
115
|
+
function H(o, n, r = ".ins-recommendation-product-container") {
|
|
116
|
+
return class extends b {
|
|
116
117
|
getId() {
|
|
117
118
|
return o;
|
|
118
119
|
}
|
|
119
|
-
getTargetNodes(
|
|
120
|
-
const
|
|
121
|
-
return
|
|
120
|
+
getTargetNodes(e) {
|
|
121
|
+
const t = e.closest(r);
|
|
122
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
return class extends
|
|
126
|
+
function K(o, n, r = ".ins-recommendation-product-container") {
|
|
127
|
+
return class extends S {
|
|
127
128
|
getId() {
|
|
128
129
|
return o;
|
|
129
130
|
}
|
|
130
|
-
getTargetNodes(
|
|
131
|
-
const
|
|
132
|
-
return
|
|
131
|
+
getTargetNodes(e) {
|
|
132
|
+
const t = e.closest(r);
|
|
133
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
133
134
|
}
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
-
return class extends
|
|
137
|
+
function U(o, n, r = ".ins-recommendation-product-container") {
|
|
138
|
+
return class extends A {
|
|
138
139
|
getId() {
|
|
139
140
|
return o;
|
|
140
141
|
}
|
|
141
|
-
getTargetNodes(
|
|
142
|
-
const
|
|
143
|
-
return
|
|
142
|
+
getTargetNodes(e) {
|
|
143
|
+
const t = e.closest(r);
|
|
144
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
144
145
|
}
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
return class extends
|
|
148
|
+
function V(o, n, r = ".ins-recommendation-product-container") {
|
|
149
|
+
return class extends N {
|
|
149
150
|
getId() {
|
|
150
151
|
return o;
|
|
151
152
|
}
|
|
152
|
-
getTargetNodes(
|
|
153
|
-
const
|
|
154
|
-
return
|
|
153
|
+
getTargetNodes(e) {
|
|
154
|
+
const t = e.closest(r);
|
|
155
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
155
156
|
}
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
-
return class extends
|
|
159
|
+
function W(o, n, r = ".ins-recommendation-product-container") {
|
|
160
|
+
return class extends q {
|
|
160
161
|
getId() {
|
|
161
162
|
return o;
|
|
162
163
|
}
|
|
163
|
-
getTargetNodes(
|
|
164
|
-
const
|
|
165
|
-
return
|
|
164
|
+
getTargetNodes(e) {
|
|
165
|
+
const t = e.closest(r);
|
|
166
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
166
167
|
}
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
-
return class extends
|
|
170
|
+
function X(o, n, r = ".ins-recommendation-product-container") {
|
|
171
|
+
return class extends $ {
|
|
171
172
|
getId() {
|
|
172
173
|
return o;
|
|
173
174
|
}
|
|
174
|
-
getTargetNodes(
|
|
175
|
-
const
|
|
176
|
-
return
|
|
175
|
+
getTargetNodes(e) {
|
|
176
|
+
const t = e.closest(r);
|
|
177
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
177
178
|
}
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
return class extends
|
|
181
|
+
function j(o, n, r = ".ins-recommendation-product-container") {
|
|
182
|
+
return class extends k {
|
|
182
183
|
getId() {
|
|
183
184
|
return o;
|
|
184
185
|
}
|
|
185
|
-
getTargetNodes(
|
|
186
|
-
const
|
|
187
|
-
return
|
|
186
|
+
getTargetNodes(e) {
|
|
187
|
+
const t = e.closest(r);
|
|
188
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
188
189
|
}
|
|
189
190
|
};
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
return class extends
|
|
192
|
+
function G(o, n, r = ".ins-recommendation-product-container") {
|
|
193
|
+
return class extends p {
|
|
193
194
|
getId() {
|
|
194
195
|
return o;
|
|
195
196
|
}
|
|
196
|
-
getTargetNodes(
|
|
197
|
-
const
|
|
198
|
-
return
|
|
197
|
+
getTargetNodes(e) {
|
|
198
|
+
const t = e.closest(r);
|
|
199
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
199
200
|
}
|
|
200
201
|
};
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
-
return class extends
|
|
203
|
+
function J(o, n, r) {
|
|
204
|
+
return class extends F {
|
|
204
205
|
getId() {
|
|
205
206
|
return o;
|
|
206
207
|
}
|
|
207
|
-
getTargetNodes(
|
|
208
|
-
const
|
|
209
|
-
return
|
|
208
|
+
getTargetNodes(e) {
|
|
209
|
+
const t = e.closest(r);
|
|
210
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Propagates Bold/Italic to ALL product buttons, not just the focused one.
|
|
214
|
+
*
|
|
215
|
+
* Stripo's built-in applies font-color/size to every target node but writes
|
|
216
|
+
* the text-style (font-weight/font-style) only to the selected button. Bold/italic
|
|
217
|
+
* are plain inline CSS on the `<a class="es-button">` (no tags), so we mirror them
|
|
218
|
+
* onto every button's anchor. The toggle state comes from the control's form
|
|
219
|
+
* (`buttonTextStyleForm.{bold,italic}`) because the patched node isn't updated yet
|
|
220
|
+
* when this runs. Returned modifications are merged into the parent control's patch.
|
|
221
|
+
*/
|
|
222
|
+
getAdditionalModifications(e) {
|
|
223
|
+
const t = e.closest(r);
|
|
224
|
+
if (!t)
|
|
225
|
+
return;
|
|
226
|
+
const i = t.querySelectorAll(`[esd-extension-block-id="${n}"] a.es-button`);
|
|
227
|
+
if (!i.length)
|
|
228
|
+
return;
|
|
229
|
+
const s = this.api.getValues()[z];
|
|
230
|
+
if (!s)
|
|
231
|
+
return;
|
|
232
|
+
const u = s.bold ? "bold" : "normal", c = s.italic ? "italic" : "normal", l = this.api.getDocumentModifier();
|
|
233
|
+
return i.forEach((d) => {
|
|
234
|
+
l.modifyHtml(d).setStyle("font-weight", u).setStyle("font-style", c);
|
|
235
|
+
}), l;
|
|
210
236
|
}
|
|
211
237
|
};
|
|
212
238
|
}
|
|
213
|
-
function
|
|
214
|
-
return class extends
|
|
239
|
+
function Q(o, n, r) {
|
|
240
|
+
return class extends h {
|
|
215
241
|
getId() {
|
|
216
242
|
return o;
|
|
217
243
|
}
|
|
218
|
-
getTargetNodes(
|
|
219
|
-
const
|
|
220
|
-
return
|
|
244
|
+
getTargetNodes(e) {
|
|
245
|
+
const t = e.closest(r);
|
|
246
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
221
247
|
}
|
|
222
248
|
};
|
|
223
249
|
}
|
|
224
|
-
function
|
|
225
|
-
return class extends
|
|
250
|
+
function Z(o, n, r) {
|
|
251
|
+
return class extends I {
|
|
226
252
|
getId() {
|
|
227
253
|
return o;
|
|
228
254
|
}
|
|
229
|
-
getTargetNodes(
|
|
255
|
+
getTargetNodes(e) {
|
|
230
256
|
try {
|
|
231
|
-
const
|
|
232
|
-
return
|
|
257
|
+
const t = e.closest(r);
|
|
258
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
233
259
|
} catch {
|
|
234
260
|
return [];
|
|
235
261
|
}
|
|
236
262
|
}
|
|
237
263
|
};
|
|
238
264
|
}
|
|
239
|
-
function
|
|
240
|
-
return class extends
|
|
265
|
+
function tt(o, n, r) {
|
|
266
|
+
return class extends y {
|
|
241
267
|
getId() {
|
|
242
268
|
return o;
|
|
243
269
|
}
|
|
244
|
-
getTargetNodes(
|
|
270
|
+
getTargetNodes(e) {
|
|
245
271
|
try {
|
|
246
|
-
const
|
|
247
|
-
return
|
|
272
|
+
const t = e.closest(r);
|
|
273
|
+
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
248
274
|
} catch {
|
|
249
275
|
return [];
|
|
250
276
|
}
|
|
@@ -252,25 +278,25 @@ function U(o, n, r) {
|
|
|
252
278
|
};
|
|
253
279
|
}
|
|
254
280
|
export {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
281
|
+
D as createButtonAlignControl,
|
|
282
|
+
K as createButtonBorderControl,
|
|
283
|
+
U as createButtonBorderRadiusControl,
|
|
284
|
+
H as createButtonColorControl,
|
|
285
|
+
Q as createButtonFitToContainerControl,
|
|
286
|
+
V as createButtonFontFamilyControl,
|
|
287
|
+
W as createButtonMarginsControl,
|
|
288
|
+
X as createButtonPaddingsControl,
|
|
289
|
+
j as createButtonTextControl,
|
|
290
|
+
G as createButtonTextSizeControl,
|
|
291
|
+
J as createButtonTextStyleAndFontColorControl,
|
|
292
|
+
tt as createImageMarginsControl,
|
|
293
|
+
Z as createImageSizeControl,
|
|
294
|
+
Y as createPaddingsControl,
|
|
295
|
+
P as createTextAlignControl,
|
|
296
|
+
O as createTextBackgroundColorControl,
|
|
297
|
+
_ as createTextColorControl,
|
|
298
|
+
R as createTextFontFamilyControl,
|
|
299
|
+
w as createTextLineSpacingControl,
|
|
300
|
+
v as createTextSizeControl,
|
|
301
|
+
L as createTextStyleControl
|
|
276
302
|
};
|
|
@@ -120,11 +120,11 @@ export declare const ButtonControls: {
|
|
|
120
120
|
new (): {
|
|
121
121
|
getId(): string;
|
|
122
122
|
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
123
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
123
124
|
getParentControlId(): string;
|
|
124
125
|
getLabels(): import("@stripoinc/ui-editor-extensions").ButtonTextStyleAndFontColorControlLabels | undefined;
|
|
125
126
|
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
126
127
|
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
127
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
128
128
|
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
129
129
|
};
|
|
130
130
|
};
|
|
@@ -120,11 +120,11 @@ export declare const ButtonControls: {
|
|
|
120
120
|
new (): {
|
|
121
121
|
getId(): string;
|
|
122
122
|
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
123
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
123
124
|
getParentControlId(): string;
|
|
124
125
|
getLabels(): import("@stripoinc/ui-editor-extensions").ButtonTextStyleAndFontColorControlLabels | undefined;
|
|
125
126
|
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
126
127
|
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
127
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
128
128
|
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
129
129
|
};
|
|
130
130
|
};
|
|
@@ -60,39 +60,17 @@ export interface RegenerateProductRowsOptions {
|
|
|
60
60
|
composition?: string[];
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Regenerates only the mobile product container rows.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* Regenerates only the mobile product container rows and commits in a single apply().
|
|
64
|
+
* Standalone entry point for callers that change mobile-only settings
|
|
65
|
+
* (block.ts, productLayout.ts). The combined desktop+mobile regeneration uses the
|
|
66
|
+
* apply-free accumulateMobileProductRows() so the whole rebuild is one commit.
|
|
66
67
|
*
|
|
67
|
-
* For list layout: clears the mobile row content
|
|
68
|
-
* For grid layout with mobileLayoutEnabled
|
|
69
|
-
* For grid layout with mobileLayoutEnabled ON: rebuilds the full mobile row
|
|
70
|
-
* structure (<td><table>...products...</table></td>) in a single operation.
|
|
68
|
+
* For list layout / disabled mobile layout: clears the mobile row content.
|
|
69
|
+
* For grid layout with mobileLayoutEnabled ON: rebuilds the full mobile row.
|
|
71
70
|
*/
|
|
72
71
|
export declare function regenerateMobileProductRows(options: Omit<RegenerateProductRowsOptions, 'afterRegenerate'>): void;
|
|
73
|
-
/**
|
|
74
|
-
* Regenerates product rows in the desktop container based on current store configuration.
|
|
75
|
-
* Also regenerates the mobile container to keep both in sync.
|
|
76
|
-
* Reads products, layout, and composition from store/DOM and rebuilds the HTML.
|
|
77
|
-
* @param options - Configuration options for regeneration
|
|
78
|
-
*/
|
|
79
|
-
export declare function regenerateProductRows(options: RegenerateProductRowsOptions): void;
|
|
80
|
-
export interface ReapplySpacingOptions {
|
|
81
|
-
currentNode: ImmutableHtmlNode | null | undefined;
|
|
82
|
-
documentModifier: DocumentModifier;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Reapplies spacing values after product regeneration.
|
|
86
|
-
* Desktop spacing applies only to the desktop container;
|
|
87
|
-
* mobile spacing applies only to the mobile container.
|
|
88
|
-
*
|
|
89
|
-
* Reads values from node config (primary) with data-attribute fallback
|
|
90
|
-
* for backward compatibility with pre-nodeConfig templates.
|
|
91
|
-
* @param options - Configuration options
|
|
92
|
-
*/
|
|
93
|
-
export declare function reapplySpacing(options: ReapplySpacingOptions): void;
|
|
94
72
|
export interface RegenerateWithStylesOptions extends Omit<RegenerateProductRowsOptions, 'products' | 'layout'> {
|
|
95
|
-
/** Skip style capture
|
|
73
|
+
/** Skip style capture if styles were already handled externally */
|
|
96
74
|
skipStylePreservation?: boolean;
|
|
97
75
|
/** Optional: pass products directly instead of reading from store */
|
|
98
76
|
products?: RecommendationProduct[];
|
|
@@ -100,26 +78,21 @@ export interface RegenerateWithStylesOptions extends Omit<RegenerateProductRowsO
|
|
|
100
78
|
layout?: Orientation;
|
|
101
79
|
}
|
|
102
80
|
/**
|
|
103
|
-
* Regenerates product rows while preserving user-applied styles
|
|
104
|
-
*
|
|
105
|
-
* This unified function handles the complete regeneration flow:
|
|
106
|
-
* 1. Captures existing styles (fonts, colors, button styles, etc.)
|
|
107
|
-
* 2. Regenerates HTML with new products/layout
|
|
108
|
-
* 3. Restores captured styles to new elements
|
|
109
|
-
* 4. Reapplies spacing from data attributes
|
|
81
|
+
* Regenerates product rows while preserving user-applied styles, in a SINGLE commit.
|
|
110
82
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
83
|
+
* Flow:
|
|
84
|
+
* 1. Capture the current per-attribute style templates (tag wrappers + p-style) and
|
|
85
|
+
* spacing — read from the live DOM BEFORE it is replaced.
|
|
86
|
+
* 2. Accumulate the desktop + mobile rebuilds, with spacing and the captured styles
|
|
87
|
+
* baked straight into the generated HTML.
|
|
88
|
+
* 3. Commit everything with ONE apply().
|
|
115
89
|
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* });
|
|
90
|
+
* Why one apply(): each apply() is a Stripo commit boundary that re-resolves the
|
|
91
|
+
* editor's selection against node references. A setInnerHtml rebuild destroys the old
|
|
92
|
+
* text nodes, so a second (or deferred) commit left the inline-format tracker pointing
|
|
93
|
+
* at gone nodes — the "Cannot read properties of undefined (reading 'textContent')"
|
|
94
|
+
* crash when toggling bold/italic/strike afterwards. Baking spacing + styles into the
|
|
95
|
+
* HTML removes the need for any post-rebuild reapply pass.
|
|
123
96
|
* @param options - Configuration options for regeneration
|
|
124
97
|
*/
|
|
125
98
|
export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FiltersResponse, RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { type ElementRenderer } from '../utils';
|
|
2
|
+
import { type ElementRenderer, type RenderOptions } from '../utils';
|
|
3
3
|
/**
|
|
4
4
|
* Generates attribute-aligned product rows for grid layout.
|
|
5
5
|
* Creates rows where each row contains one attribute type from all products.
|
|
@@ -9,7 +9,7 @@ import { type ElementRenderer } from '../utils';
|
|
|
9
9
|
* @param composition - Array defining order of card elements
|
|
10
10
|
* @returns HTML string for attribute-aligned rows
|
|
11
11
|
*/
|
|
12
|
-
export declare function prepareGridAttributeRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[], filterList?: FiltersResponse): string;
|
|
12
|
+
export declare function prepareGridAttributeRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[], filterList?: FiltersResponse, renderOptions?: RenderOptions): string;
|
|
13
13
|
/**
|
|
14
14
|
* Prepares grid product rows with attribute-aligned structure
|
|
15
15
|
* Groups products into rows, then generates attribute-aligned HTML for each group
|
|
@@ -19,7 +19,7 @@ export declare function prepareGridAttributeRows(products: RecommendationProduct
|
|
|
19
19
|
* @param composition - Array defining order of card elements
|
|
20
20
|
* @returns HTML string for all product rows
|
|
21
21
|
*/
|
|
22
|
-
export declare function prepareGridProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[], filterList?: FiltersResponse): string;
|
|
22
|
+
export declare function prepareGridProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[], filterList?: FiltersResponse, renderOptions?: RenderOptions): string;
|
|
23
23
|
/**
|
|
24
24
|
* Prepares grid product rows with attribute-aligned structure.
|
|
25
25
|
* Uses row-based rendering where each attribute type forms a single row across all products.
|
|
@@ -28,6 +28,6 @@ export declare function prepareGridProductRows(products: RecommendationProduct[]
|
|
|
28
28
|
* @param composition - Array defining element order
|
|
29
29
|
* @returns HTML string for product rows
|
|
30
30
|
*/
|
|
31
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[], filterList?: FiltersResponse): string;
|
|
31
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[], filterList?: FiltersResponse, renderOptions?: RenderOptions): string;
|
|
32
32
|
export declare function getDefaultTemplate(recommendationId?: number): string;
|
|
33
33
|
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[], mobileProductsPerRow?: number): string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
8
8
|
import { type Orientation, type PrepareProductRowsOptions } from './utils';
|
|
9
|
-
export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefaultProducts, spacer, sanitizeImageUrl, createBlockTemplate, type Orientation, type PrepareProductRowsOptions, type ElementRenderer, type ProductCardGetter, } from './utils';
|
|
9
|
+
export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefaultProducts, spacer, sanitizeImageUrl, createBlockTemplate, type Orientation, type PrepareProductRowsOptions, type ElementRenderer, type ProductCardGetter, type AttributeStyleTemplate, type AttributeStyleTemplates, type CellBackgroundColors, } from './utils';
|
|
10
10
|
/**
|
|
11
11
|
* Unified function to prepare product rows for any layout.
|
|
12
12
|
* Delegates to the appropriate layout-specific implementation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FiltersResponse, RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
+
import { type RenderOptions } from '../utils';
|
|
2
3
|
/**
|
|
3
4
|
* Generates a list product card with 3-column layout
|
|
4
5
|
* Uses buildElementRenderer to render Image, Info content, and Button
|
|
@@ -11,7 +12,7 @@ import type { FiltersResponse, RecommendationProduct } from '@@/Types/recommenda
|
|
|
11
12
|
* @param composition - Array defining order of card elements
|
|
12
13
|
* @returns HTML string for a single product card row
|
|
13
14
|
*/
|
|
14
|
-
export declare function getListProductCard(product: RecommendationProduct, composition?: string[], filterList?: FiltersResponse): string;
|
|
15
|
+
export declare function getListProductCard(product: RecommendationProduct, composition?: string[], filterList?: FiltersResponse, renderOptions?: RenderOptions): string;
|
|
15
16
|
/**
|
|
16
17
|
* Prepares list product rows
|
|
17
18
|
* Each product is a full-width row with 3-column layout
|
|
@@ -19,6 +20,6 @@ export declare function getListProductCard(product: RecommendationProduct, compo
|
|
|
19
20
|
* @param composition - Array defining order of card elements
|
|
20
21
|
* @returns HTML string for product rows
|
|
21
22
|
*/
|
|
22
|
-
export declare function prepareProductRows(products: RecommendationProduct[], composition?: string[], filterList?: FiltersResponse): string;
|
|
23
|
+
export declare function prepareProductRows(products: RecommendationProduct[], composition?: string[], filterList?: FiltersResponse, renderOptions?: RenderOptions): string;
|
|
23
24
|
export declare function getDefaultTemplate(): string;
|
|
24
25
|
export declare function generateBlockTemplate(products: RecommendationProduct[], title?: string, composition?: string[]): string;
|