@useinsider/guido 2.0.0-beta.d170da6 → 2.0.0-beta.dbde199

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.
Files changed (32) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +3 -1
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +15 -17
  5. package/dist/composables/useStripo.js +40 -40
  6. package/dist/extensions/Blocks/Items/controls/cardComposition.js +13 -4
  7. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +12 -6
  8. package/dist/extensions/Blocks/Recommendation/constants.js +8 -7
  9. package/dist/extensions/Blocks/Recommendation/control.js +19 -4
  10. package/dist/extensions/Blocks/Recommendation/controls/index.js +123 -96
  11. package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +60 -0
  12. package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +160 -0
  13. package/dist/extensions/Blocks/Recommendation/extension.js +17 -15
  14. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -33
  15. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +15 -12
  16. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +8 -8
  17. package/dist/extensions/Blocks/controlFactories.js +70 -70
  18. package/dist/guido.css +1 -1
  19. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +364 -286
  20. package/dist/package.json.js +1 -1
  21. package/dist/services/stripoApi.js +6 -10
  22. package/dist/src/@types/config/schemas.d.ts +4 -0
  23. package/dist/src/composables/useConfig.d.ts +2 -0
  24. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +4 -0
  25. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +9 -1
  26. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +62 -0
  27. package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +16 -0
  28. package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +50 -0
  29. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +1 -1
  30. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +1 -1
  31. package/dist/src/stores/config.d.ts +17 -0
  32. package/package.json +3 -3
@@ -1,245 +1,272 @@
1
- import { createButtonAlignControl as c, createButtonBorderControl as _, createButtonBorderRadiusControl as T, createButtonColorControl as i, createButtonFitToContainerControl as B, createButtonFontFamilyControl as s, createButtonMarginsControl as S, createButtonPaddingsControl as E, createButtonTextControl as P, createButtonTextSizeControl as U, createButtonTextStyleAndFontColorControl as R, createImageMarginsControl as a, createImageSizeControl as M, createTextAlignControl as C, createTextBackgroundColorControl as r, createTextColorControl as O, createTextFontFamilyControl as I, createPaddingsControl as e, createTextSizeControl as N, createTextStyleControl as l } from "../../controlFactories.js";
1
+ import { createButtonAlignControl as _, createButtonBorderControl as i, createButtonBorderRadiusControl as S, createButtonColorControl as T, createButtonFitToContainerControl as E, createButtonFontFamilyControl as B, createButtonMarginsControl as s, createButtonPaddingsControl as P, createButtonTextControl as U, createButtonTextSizeControl as a, createButtonTextStyleAndFontColorControl as R, createImageMarginsControl as M, createImageSizeControl as A, createTextAlignControl as C, createTextBackgroundColorControl as r, createTextColorControl as I, createTextFontFamilyControl as O, createTextLineSpacingControl as N, createPaddingsControl as e, createTextSizeControl as c, createTextStyleControl as l } from "../../controlFactories.js";
2
2
  import { RecommendationBlockId as o, RecommendationControlId as t } from "../constants.js";
3
- const n = ".ins-recommendation-product-container", u = C(
3
+ import { PriceInlineLayoutControl as mo } from "./priceInlineLayoutControl.js";
4
+ const n = ".ins-recommendation-product-container", L = C(
4
5
  t.NAME_ALIGN,
5
6
  o.NAME,
6
7
  n
7
- ), d = O(
8
+ ), m = I(
8
9
  t.NAME_COLOR,
9
10
  o.NAME,
10
11
  n
11
- ), m = N(
12
+ ), d = c(
12
13
  t.NAME_SIZE,
13
14
  o.NAME,
14
15
  n
15
- ), L = l(
16
+ ), g = l(
16
17
  t.NAME_STYLE,
17
18
  o.NAME,
18
19
  n
19
- ), F = I(
20
+ ), F = O(
20
21
  t.NAME_FONT_FAMILY,
21
22
  o.NAME,
22
23
  n
23
- ), g = r(
24
+ ), G = r(
24
25
  t.NAME_BACKGROUND,
25
26
  o.NAME,
26
27
  n
27
- ), G = e(
28
+ ), y = e(
28
29
  t.NAME_PADDINGS,
29
30
  o.NAME,
30
31
  n
31
- ), y = C(
32
+ ), b = N(
33
+ t.NAME_LINE_SPACING,
34
+ o.NAME,
35
+ n
36
+ ), x = C(
32
37
  t.PRICE_ALIGN,
33
38
  o.PRICE,
34
39
  n
35
- ), b = O(
40
+ ), Y = I(
36
41
  t.PRICE_COLOR,
37
42
  o.PRICE,
38
43
  n
39
- ), x = N(
44
+ ), p = c(
40
45
  t.PRICE_SIZE,
41
46
  o.PRICE,
42
47
  n
43
- ), Y = l(
48
+ ), z = l(
44
49
  t.PRICE_STYLE,
45
50
  o.PRICE,
46
51
  n
47
- ), z = I(
52
+ ), k = O(
48
53
  t.PRICE_FONT_FAMILY,
49
54
  o.PRICE,
50
55
  n
51
- ), k = r(
56
+ ), Z = r(
52
57
  t.PRICE_BACKGROUND,
53
58
  o.PRICE,
54
59
  n
55
- ), Z = e(
60
+ ), K = e(
56
61
  t.PRICE_PADDINGS,
57
62
  o.PRICE,
58
63
  n
59
- ), K = C(
64
+ ), f = N(
65
+ t.PRICE_LINE_SPACING,
66
+ o.PRICE,
67
+ n
68
+ ), X = C(
60
69
  t.OLD_PRICE_ALIGN,
61
70
  o.OLD_PRICE,
62
71
  n
63
- ), p = O(
72
+ ), h = I(
64
73
  t.OLD_PRICE_COLOR,
65
74
  o.OLD_PRICE,
66
75
  n
67
- ), X = N(
76
+ ), j = c(
68
77
  t.OLD_PRICE_SIZE,
69
78
  o.OLD_PRICE,
70
79
  n
71
- ), f = l(
80
+ ), q = l(
72
81
  t.OLD_PRICE_STYLE,
73
82
  o.OLD_PRICE,
74
83
  n
75
- ), h = I(
84
+ ), v = O(
76
85
  t.OLD_PRICE_FONT_FAMILY,
77
86
  o.OLD_PRICE,
78
87
  n
79
- ), j = r(
88
+ ), w = r(
80
89
  t.OLD_PRICE_BACKGROUND,
81
90
  o.OLD_PRICE,
82
91
  n
83
- ), q = e(
92
+ ), H = e(
84
93
  t.OLD_PRICE_PADDINGS,
85
94
  o.OLD_PRICE,
86
95
  n
87
- ), v = C(
96
+ ), J = N(
97
+ t.OLD_PRICE_LINE_SPACING,
98
+ o.OLD_PRICE,
99
+ n
100
+ ), Q = C(
88
101
  t.OMNIBUS_PRICE_ALIGN,
89
102
  o.OMNIBUS_PRICE,
90
103
  n
91
- ), w = O(
104
+ ), V = I(
92
105
  t.OMNIBUS_PRICE_COLOR,
93
106
  o.OMNIBUS_PRICE,
94
107
  n
95
- ), H = N(
108
+ ), W = c(
96
109
  t.OMNIBUS_PRICE_SIZE,
97
110
  o.OMNIBUS_PRICE,
98
111
  n
99
- ), J = l(
112
+ ), $ = l(
100
113
  t.OMNIBUS_PRICE_STYLE,
101
114
  o.OMNIBUS_PRICE,
102
115
  n
103
- ), Q = I(
116
+ ), oo = O(
104
117
  t.OMNIBUS_PRICE_FONT_FAMILY,
105
118
  o.OMNIBUS_PRICE,
106
119
  n
107
- ), V = r(
120
+ ), to = r(
108
121
  t.OMNIBUS_PRICE_BACKGROUND,
109
122
  o.OMNIBUS_PRICE,
110
123
  n
111
- ), W = e(
124
+ ), no = e(
112
125
  t.OMNIBUS_PRICE_PADDINGS,
113
126
  o.OMNIBUS_PRICE,
114
127
  n
115
- ), $ = C(
128
+ ), Co = N(
129
+ t.OMNIBUS_PRICE_LINE_SPACING,
130
+ o.OMNIBUS_PRICE,
131
+ n
132
+ ), ro = C(
116
133
  t.OMNIBUS_DISCOUNT_ALIGN,
117
134
  o.OMNIBUS_DISCOUNT,
118
135
  n
119
- ), oo = O(
136
+ ), Io = I(
120
137
  t.OMNIBUS_DISCOUNT_COLOR,
121
138
  o.OMNIBUS_DISCOUNT,
122
139
  n
123
- ), to = N(
140
+ ), Oo = c(
124
141
  t.OMNIBUS_DISCOUNT_SIZE,
125
142
  o.OMNIBUS_DISCOUNT,
126
143
  n
127
- ), no = l(
144
+ ), No = l(
128
145
  t.OMNIBUS_DISCOUNT_STYLE,
129
146
  o.OMNIBUS_DISCOUNT,
130
147
  n
131
- ), Co = I(
148
+ ), eo = O(
132
149
  t.OMNIBUS_DISCOUNT_FONT_FAMILY,
133
150
  o.OMNIBUS_DISCOUNT,
134
151
  n
135
- ), ro = r(
152
+ ), co = r(
136
153
  t.OMNIBUS_DISCOUNT_BACKGROUND,
137
154
  o.OMNIBUS_DISCOUNT,
138
155
  n
139
- ), Oo = e(
156
+ ), lo = e(
140
157
  t.OMNIBUS_DISCOUNT_PADDINGS,
141
158
  o.OMNIBUS_DISCOUNT,
142
159
  n
143
- ), Io = c(
160
+ ), _o = N(
161
+ t.OMNIBUS_DISCOUNT_LINE_SPACING,
162
+ o.OMNIBUS_DISCOUNT,
163
+ n
164
+ ), io = _(
144
165
  t.BUTTON_ALIGN,
145
166
  o.BUTTON,
146
167
  n
147
- ), eo = _(
168
+ ), So = i(
148
169
  t.BUTTON_BORDER,
149
170
  o.BUTTON,
150
171
  n
151
- ), No = T(
172
+ ), To = S(
152
173
  t.BUTTON_BORDER_RADIUS,
153
174
  o.BUTTON,
154
175
  n
155
- ), lo = i(
176
+ ), Eo = T(
156
177
  t.BUTTON_COLOR,
157
178
  o.BUTTON,
158
179
  n
159
- ), co = s(
180
+ ), Bo = B(
160
181
  t.BUTTON_FONT_FAMILY,
161
182
  o.BUTTON,
162
183
  n
163
- ), _o = S(
184
+ ), so = s(
164
185
  t.BUTTON_MARGINS,
165
186
  o.BUTTON,
166
187
  n
167
- ), To = E(
188
+ ), Po = P(
168
189
  t.BUTTON_PADDINGS,
169
190
  o.BUTTON,
170
191
  n
171
- ), io = P(
192
+ ), Uo = U(
172
193
  t.BUTTON_TEXT,
173
194
  o.BUTTON,
174
195
  n
175
- ), Bo = U(
196
+ ), ao = a(
176
197
  t.BUTTON_TEXT_SIZE,
177
198
  o.BUTTON,
178
199
  n
179
- ), so = R(
200
+ ), Ro = R(
180
201
  t.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
181
202
  o.BUTTON,
182
203
  n
183
- ), So = B(
204
+ ), Mo = E(
184
205
  t.BUTTON_FIT_TO_CONTENT,
185
206
  o.BUTTON,
186
207
  n
187
- ), Eo = M(
208
+ ), Ao = A(
188
209
  t.IMAGE_SIZE,
189
210
  o.IMAGE,
190
211
  n
191
- ), Po = a(
212
+ ), Do = M(
192
213
  t.IMAGE_MARGINS,
193
214
  o.IMAGE,
194
215
  n
195
216
  );
196
217
  export {
197
- Io as ButtonAlignControl,
198
- eo as ButtonBorderControl,
199
- No as ButtonBorderRadiusControl,
200
- lo as ButtonColorControl,
201
- So as ButtonFitToContentControl,
202
- co as ButtonFontFamilyControl,
203
- _o as ButtonMarginsControl,
204
- To as ButtonPaddingsControl,
205
- io as ButtonTextControl,
206
- Bo as ButtonTextSizeControl,
207
- so as ButtonTextStyleAndFontColorControl,
208
- Po as ImageMarginsControl,
209
- Eo as ImageSizeControl,
210
- u as NameAlignControl,
211
- g as NameBackgroundControl,
212
- d as NameColorControl,
218
+ io as ButtonAlignControl,
219
+ So as ButtonBorderControl,
220
+ To as ButtonBorderRadiusControl,
221
+ Eo as ButtonColorControl,
222
+ Mo as ButtonFitToContentControl,
223
+ Bo as ButtonFontFamilyControl,
224
+ so as ButtonMarginsControl,
225
+ Po as ButtonPaddingsControl,
226
+ Uo as ButtonTextControl,
227
+ ao as ButtonTextSizeControl,
228
+ Ro as ButtonTextStyleAndFontColorControl,
229
+ Do as ImageMarginsControl,
230
+ Ao as ImageSizeControl,
231
+ L as NameAlignControl,
232
+ G as NameBackgroundControl,
233
+ m as NameColorControl,
213
234
  F as NameFontFamilyControl,
214
- G as NamePaddingsControl,
215
- m as NameSizeControl,
216
- L as NameStyleControl,
217
- K as OldPriceAlignControl,
218
- j as OldPriceBackgroundControl,
219
- p as OldPriceColorControl,
220
- h as OldPriceFontFamilyControl,
221
- q as OldPricePaddingsControl,
222
- X as OldPriceSizeControl,
223
- f as OldPriceStyleControl,
224
- $ as OmnibusDiscountAlignControl,
225
- ro as OmnibusDiscountBackgroundControl,
226
- oo as OmnibusDiscountColorControl,
227
- Co as OmnibusDiscountFontFamilyControl,
228
- Oo as OmnibusDiscountPaddingsControl,
229
- to as OmnibusDiscountSizeControl,
230
- no as OmnibusDiscountStyleControl,
231
- v as OmnibusPriceAlignControl,
232
- V as OmnibusPriceBackgroundControl,
233
- w as OmnibusPriceColorControl,
234
- Q as OmnibusPriceFontFamilyControl,
235
- W as OmnibusPricePaddingsControl,
236
- H as OmnibusPriceSizeControl,
237
- J as OmnibusPriceStyleControl,
238
- y as PriceAlignControl,
239
- k as PriceBackgroundControl,
240
- b as PriceColorControl,
241
- z as PriceFontFamilyControl,
242
- Z as PricePaddingsControl,
243
- x as PriceSizeControl,
244
- Y as PriceStyleControl
235
+ b as NameLineSpacingControl,
236
+ y as NamePaddingsControl,
237
+ d as NameSizeControl,
238
+ g as NameStyleControl,
239
+ X as OldPriceAlignControl,
240
+ w as OldPriceBackgroundControl,
241
+ h as OldPriceColorControl,
242
+ v as OldPriceFontFamilyControl,
243
+ J as OldPriceLineSpacingControl,
244
+ H as OldPricePaddingsControl,
245
+ j as OldPriceSizeControl,
246
+ q as OldPriceStyleControl,
247
+ ro as OmnibusDiscountAlignControl,
248
+ co as OmnibusDiscountBackgroundControl,
249
+ Io as OmnibusDiscountColorControl,
250
+ eo as OmnibusDiscountFontFamilyControl,
251
+ _o as OmnibusDiscountLineSpacingControl,
252
+ lo as OmnibusDiscountPaddingsControl,
253
+ Oo as OmnibusDiscountSizeControl,
254
+ No as OmnibusDiscountStyleControl,
255
+ Q as OmnibusPriceAlignControl,
256
+ to as OmnibusPriceBackgroundControl,
257
+ V as OmnibusPriceColorControl,
258
+ oo as OmnibusPriceFontFamilyControl,
259
+ Co as OmnibusPriceLineSpacingControl,
260
+ no as OmnibusPricePaddingsControl,
261
+ W as OmnibusPriceSizeControl,
262
+ $ as OmnibusPriceStyleControl,
263
+ x as PriceAlignControl,
264
+ Z as PriceBackgroundControl,
265
+ Y as PriceColorControl,
266
+ k as PriceFontFamilyControl,
267
+ mo as PriceInlineLayoutControl,
268
+ f as PriceLineSpacingControl,
269
+ K as PricePaddingsControl,
270
+ p as PriceSizeControl,
271
+ z as PriceStyleControl
245
272
  };
@@ -0,0 +1,60 @@
1
+ import { ModificationDescription as n } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as d } from "../../common-control.js";
3
+ import { RecommendationControlId as c } from "../constants.js";
4
+ const i = {
5
+ HIDE_PRICE: "hidePriceIfSame"
6
+ }, o = "hide-price", s = ".ins-recommendation-v3-block-v2";
7
+ class h extends d {
8
+ getId() {
9
+ return c.PRICE_HIDE_IF_SAME;
10
+ }
11
+ getTemplate() {
12
+ return `
13
+ <div class="price-hide-control-container">
14
+ ${this._GuTwoColumns([
15
+ this._GuLabel({ text: "Hide if same as discounted" }),
16
+ this._GuToggle(i.HIDE_PRICE)
17
+ ])}
18
+ </div>
19
+ `;
20
+ }
21
+ onRender() {
22
+ this._setFormValues(), this._listenToFormUpdates();
23
+ }
24
+ onTemplateNodeUpdated(e) {
25
+ super.onTemplateNodeUpdated(e), this._setFormValues();
26
+ }
27
+ _setFormValues() {
28
+ const e = this._getCurrentHideState();
29
+ this.api.updateValues({
30
+ [i.HIDE_PRICE]: e
31
+ });
32
+ }
33
+ _getCurrentHideState() {
34
+ if (!this.currentNode || !("closest" in this.currentNode))
35
+ return !1;
36
+ const e = this.currentNode.closest(s);
37
+ return !e || !("getAttribute" in e) ? !1 : e.getAttribute(o) === "true";
38
+ }
39
+ _onHidePriceChange(e) {
40
+ if (!this.currentNode || !("closest" in this.currentNode))
41
+ return;
42
+ const t = this.currentNode.closest(s);
43
+ if (!t)
44
+ return;
45
+ const r = this.api.getDocumentModifier();
46
+ r.modifyHtml(t).setAttribute(o, e ? "true" : "false"), r.apply(
47
+ new n(
48
+ e ? "Enable hide price if same as discounted" : "Disable hide price if same as discounted"
49
+ )
50
+ );
51
+ }
52
+ _listenToFormUpdates() {
53
+ this.api.onValueChanged(i.HIDE_PRICE, (e) => {
54
+ this._onHidePriceChange(e);
55
+ });
56
+ }
57
+ }
58
+ export {
59
+ h as PriceHideControl
60
+ };
@@ -0,0 +1,160 @@
1
+ import { ModificationDescription as M } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as w } from "../../common-control.js";
3
+ import { RecommendationControlId as N, ATTR_DATA_PRICE_INLINE as E, RecommendationBlockId as g } from "../constants.js";
4
+ const k = N.PRICE_INLINE_LAYOUT, b = ".recommendation-attribute-row", B = "tr.recommendation-product-row", m = "data-attribute-type", T = "data-inline-merged", C = "data-visibility";
5
+ class V extends w {
6
+ getId() {
7
+ return k;
8
+ }
9
+ getTemplate() {
10
+ return `
11
+ <div class="container">
12
+ ${this._GuTwoColumns([
13
+ this._GuLabel({ text: "Move to Next Line" }),
14
+ this._GuToggle("priceNextLine")
15
+ ])}
16
+ <div style="color: #666; font-size: 12px; margin-top: 8px; padding-left: 8px;">
17
+ When disabled, Price and Old Price will appear side by side
18
+ </div>
19
+ </div>
20
+ `;
21
+ }
22
+ onRender() {
23
+ this._initializePriceInlineState(), this._registerValueChangeListener();
24
+ }
25
+ onTemplateNodeUpdated(e) {
26
+ super.onTemplateNodeUpdated(e), this._initializePriceInlineState();
27
+ }
28
+ /**
29
+ * Reads the current price inline state from the block's data attribute
30
+ * and updates the toggle UI
31
+ * Note: Toggle ON = separate rows (next line), Toggle OFF = inline (same row)
32
+ */
33
+ _initializePriceInlineState() {
34
+ const r = !this._readPriceInlineState();
35
+ this.api.updateValues({
36
+ priceNextLine: r
37
+ });
38
+ }
39
+ /**
40
+ * Reads the price inline state from the block wrapper's data attribute
41
+ */
42
+ _readPriceInlineState() {
43
+ if (!this.currentNode || !("getAttribute" in this.currentNode))
44
+ return !1;
45
+ const e = this.currentNode.getAttribute(E);
46
+ return console.debug("inline attr", e), e === "1" || e === "true";
47
+ }
48
+ /**
49
+ * Registers listener for toggle changes
50
+ */
51
+ _registerValueChangeListener() {
52
+ this.api.onValueChanged("priceNextLine", (e) => {
53
+ const r = !e;
54
+ this._applyPriceInlineLayout(r);
55
+ });
56
+ }
57
+ /**
58
+ * Applies the price inline layout by restructuring the DOM
59
+ * When enabling inline: Merges Old Price content into Price row (side by side)
60
+ * When disabling inline: Separates them back into individual rows
61
+ */
62
+ _applyPriceInlineLayout(e) {
63
+ if (!this.currentNode)
64
+ return;
65
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(E, e ? "1" : "0").apply(new M("Update price inline attribute"));
66
+ const r = this.currentNode.querySelectorAll(B);
67
+ if (!(r != null && r.length))
68
+ return;
69
+ const i = this.api.getDocumentModifier();
70
+ r.forEach((t) => {
71
+ e ? this._mergeOldPriceIntoPrice(t, i) : this._separateOldPriceFromPrice(t, i);
72
+ }), i.apply(new M(
73
+ e ? "Merge price rows into inline layout" : "Separate price rows"
74
+ ));
75
+ }
76
+ /**
77
+ * Merges Old Price content into the same row as Price (inline layout)
78
+ * Creates a structure where both prices are side by side in one row
79
+ */
80
+ _mergeOldPriceIntoPrice(e, r) {
81
+ const i = e.querySelector(
82
+ `${b}[${m}="productPrice"]`
83
+ ), t = e.querySelector(
84
+ `${b}[${m}="productOldPrice"]`
85
+ );
86
+ if (!i || !t || "getAttribute" in t && t.getAttribute(T) === "1" || !("querySelectorAll" in i) || !("querySelectorAll" in t))
87
+ return;
88
+ const a = Array.from(i.querySelectorAll("table.product-card-wrapper")), u = Array.from(t.querySelectorAll("table.product-card-wrapper"));
89
+ a.length !== u.length || a.length === 0 || (a.forEach((o, _) => {
90
+ const s = u[_];
91
+ if (!o || !s || !("querySelector" in o) || !("querySelector" in s))
92
+ return;
93
+ const c = `[esd-extension-block-id="${g.PRICE}"]`, f = `[esd-extension-block-id="${g.OLD_PRICE}"]`, n = o.querySelector(c), l = s.querySelector(f);
94
+ if (!n || !l || !("getOuterHTML" in n) || !("getOuterHTML" in l))
95
+ return;
96
+ const h = n.getOuterHTML(), P = `
97
+ <tr data-inline-price-wrapper="1">
98
+ <td width="50%" style="vertical-align: middle;">
99
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
100
+ <tbody>
101
+ <tr><td>${l.getOuterHTML()}</td></tr>
102
+ </tbody>
103
+ </table>
104
+ </td>
105
+ <td width="50%" style="vertical-align: middle;">
106
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
107
+ <tbody>
108
+ <tr><td>${h}</td></tr>
109
+ </tbody>
110
+ </table>
111
+ </td>
112
+ </tr>
113
+ `, y = o.querySelector(".product-attribute-cell");
114
+ if (!y)
115
+ return;
116
+ const d = y.querySelector("tbody");
117
+ d && r.modifyHtml(d).setInnerHtml(P);
118
+ }), r.modifyHtml(t).setStyle("display", "none").setAttribute(T, "1"));
119
+ }
120
+ /**
121
+ * Separates Old Price from Price row back into individual rows
122
+ * Restores the original separate row structure
123
+ */
124
+ _separateOldPriceFromPrice(e, r) {
125
+ const i = e.querySelector(
126
+ `${b}[${m}="productPrice"]`
127
+ ), t = e.querySelector(
128
+ `${b}[${m}="productOldPrice"]`
129
+ );
130
+ if (!i || !t || !("getAttribute" in t) || !(t.getAttribute(T) === "1") || !("querySelectorAll" in i) || !("querySelectorAll" in t))
131
+ return;
132
+ const u = Array.from(i.querySelectorAll("table.product-card-wrapper")), o = Array.from(t.querySelectorAll("table.product-card-wrapper"));
133
+ u.forEach((c, f) => {
134
+ if (!c || !("querySelector" in c))
135
+ return;
136
+ const n = o[f];
137
+ if (!n || !("querySelector" in n))
138
+ return;
139
+ const l = c.querySelector('[data-inline-price-wrapper="1"]');
140
+ if (!l || !("querySelectorAll" in l))
141
+ return;
142
+ const p = Array.from(l.querySelectorAll("td")).filter((O) => "getAttribute" in O && O.getAttribute("width") === "50%");
143
+ if (p.length !== 2)
144
+ return;
145
+ const P = `[esd-extension-block-id="${g.OLD_PRICE}"]`, y = `[esd-extension-block-id="${g.PRICE}"]`, d = p[0].querySelector(P), A = p[1].querySelector(y);
146
+ if (!d || !A || !("getOuterHTML" in d) || !("getOuterHTML" in A))
147
+ return;
148
+ const H = A.getOuterHTML(), R = d.getOuterHTML(), S = c.querySelector(".product-attribute-cell"), L = S == null ? void 0 : S.querySelector("tbody");
149
+ L && r.modifyHtml(L).setInnerHtml(`<tr><td>${H}</td></tr>`);
150
+ const I = n.querySelector(".product-attribute-cell"), q = I == null ? void 0 : I.querySelector("tbody");
151
+ q && r.modifyHtml(q).setInnerHtml(`<tr><td>${R}</td></tr>`);
152
+ });
153
+ const s = t.getAttribute(C) === "0" ? "none" : "table-row";
154
+ r.modifyHtml(t).setStyle("display", s).removeAttribute(T);
155
+ }
156
+ }
157
+ export {
158
+ k as PRICE_INLINE_LAYOUT_CONTROL_ID,
159
+ V as PriceInlineLayoutControl
160
+ };
@@ -1,19 +1,21 @@
1
1
  import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { RecommendationBlock as t } from "./block.js";
3
- import { RecommendationCardCompositionControl as n } from "./cardCompositionControl.js";
2
+ import { RecommendationBlock as n } from "./block.js";
3
+ import { RecommendationCardCompositionControl as t } from "./cardCompositionControl.js";
4
4
  import { RecommendationBlockControl as r } from "./control.js";
5
- import { ButtonAlignControl as l, ButtonBorderControl as d, ButtonBorderRadiusControl as C, ButtonColorControl as i, ButtonFitToContentControl as a, ButtonFontFamilyControl as e, ButtonMarginsControl as m, ButtonPaddingsControl as s, ButtonTextControl as c, ButtonTextSizeControl as u, ButtonTextStyleAndFontColorControl as P, ImageMarginsControl as g, ImageSizeControl as B, NameAlignControl as O, NameBackgroundControl as f, NameColorControl as b, NameFontFamilyControl as p, NamePaddingsControl as y, NameSizeControl as S, NameStyleControl as F, OldPriceAlignControl as x, OldPriceBackgroundControl as T, OldPriceColorControl as k, OldPriceFontFamilyControl as A, OldPricePaddingsControl as D, OldPriceSizeControl as N, OldPriceStyleControl as R, OmnibusPriceAlignControl as z, OmnibusPriceBackgroundControl as I, OmnibusPriceColorControl as w, OmnibusPriceFontFamilyControl as h, OmnibusPricePaddingsControl as M, OmnibusPriceSizeControl as E, OmnibusPriceStyleControl as j, OmnibusDiscountAlignControl as q, OmnibusDiscountBackgroundControl as v, OmnibusDiscountColorControl as G, OmnibusDiscountFontFamilyControl as H, OmnibusDiscountPaddingsControl as J, OmnibusDiscountSizeControl as K, OmnibusDiscountStyleControl as L, PriceAlignControl as Q, PriceBackgroundControl as U, PriceColorControl as V, PriceFontFamilyControl as W, PricePaddingsControl as X, PriceSizeControl as Y, PriceStyleControl as Z } from "./controls/index.js";
6
- import { RecommendationIconsRegistry as _ } from "./iconsRegistry.js";
7
- import $ from "./recommendation.css.js";
8
- import { SettingsPanel as oo } from "./settingsPanel.js";
9
- import { CardBackgroundColorControl as to } from "./controls/cardBackgroundColorControl.js";
10
- import { SpacingControl as no } from "./controls/spacingControl.js";
11
- import { NameTextTrimControl as ro } from "./controls/nameTextTrimControl.js";
12
- import { OmnibusPriceTextBeforeControl as lo } from "./controls/omnibusPriceTextBeforeControl.js";
13
- import { OmnibusPriceTextAfterControl as Co } from "./controls/omnibusPriceTextAfterControl.js";
14
- import { OmnibusDiscountTextBeforeControl as io } from "./controls/omnibusDiscountTextBeforeControl.js";
15
- import { OmnibusDiscountTextAfterControl as ao } from "./controls/omnibusDiscountTextAfterControl.js";
16
- const xo = new o().addBlock(t).withSettingsPanelRegistry(oo).addControl(r).addControl(to).addControl(no).addControl(l).addControl(d).addControl(C).addControl(i).addControl(a).addControl(e).addControl(m).addControl(s).addControl(c).addControl(u).addControl(P).addControl(g).addControl(B).addControl(O).addControl(f).addControl(b).addControl(p).addControl(y).addControl(S).addControl(F).addControl(ro).addControl(x).addControl(T).addControl(k).addControl(A).addControl(D).addControl(N).addControl(R).addControl(z).addControl(I).addControl(w).addControl(h).addControl(M).addControl(E).addControl(j).addControl(lo).addControl(Co).addControl(q).addControl(v).addControl(G).addControl(H).addControl(J).addControl(K).addControl(L).addControl(io).addControl(ao).addControl(Q).addControl(U).addControl(V).addControl(W).addControl(X).addControl(Y).addControl(Z).addControl(n).addStyles($).withIconsRegistry(_).build();
5
+ import { ButtonAlignControl as l, ButtonBorderControl as d, ButtonBorderRadiusControl as C, ButtonColorControl as i, ButtonFitToContentControl as a, ButtonFontFamilyControl as e, ButtonMarginsControl as m, ButtonPaddingsControl as c, ButtonTextControl as s, ButtonTextSizeControl as u, ButtonTextStyleAndFontColorControl as P, ImageMarginsControl as g, ImageSizeControl as O, NameAlignControl as p, NameBackgroundControl as B, NameColorControl as f, NameFontFamilyControl as S, NameLineSpacingControl as b, NamePaddingsControl as y, NameSizeControl as F, NameStyleControl as x, OldPriceAlignControl as D, OldPriceBackgroundControl as T, OldPriceColorControl as k, OldPriceFontFamilyControl as A, OldPriceLineSpacingControl as N, OldPricePaddingsControl as R, OldPriceSizeControl as z, OldPriceStyleControl as L, OmnibusPriceAlignControl as I, OmnibusPriceBackgroundControl as w, OmnibusPriceColorControl as h, OmnibusPriceFontFamilyControl as M, OmnibusPriceLineSpacingControl as E, OmnibusPricePaddingsControl as H, OmnibusPriceSizeControl as j, OmnibusPriceStyleControl as q, OmnibusDiscountAlignControl as v, OmnibusDiscountBackgroundControl as G, OmnibusDiscountColorControl as J, OmnibusDiscountFontFamilyControl as K, OmnibusDiscountLineSpacingControl as Q, OmnibusDiscountPaddingsControl as U, OmnibusDiscountSizeControl as V, OmnibusDiscountStyleControl as W, PriceAlignControl as X, PriceBackgroundControl as Y, PriceColorControl as Z, PriceFontFamilyControl as _, PriceLineSpacingControl as $, PricePaddingsControl as oo, PriceSizeControl as no, PriceStyleControl as to } from "./controls/index.js";
6
+ import { RecommendationIconsRegistry as ro } from "./iconsRegistry.js";
7
+ import lo from "./recommendation.css.js";
8
+ import { SettingsPanel as Co } from "./settingsPanel.js";
9
+ import { CardBackgroundColorControl as io } from "./controls/cardBackgroundColorControl.js";
10
+ import { SpacingControl as ao } from "./controls/spacingControl.js";
11
+ import { PriceInlineLayoutControl as eo } from "./controls/priceInlineLayoutControl.js";
12
+ import { NameTextTrimControl as mo } from "./controls/nameTextTrimControl.js";
13
+ import { OmnibusPriceTextBeforeControl as co } from "./controls/omnibusPriceTextBeforeControl.js";
14
+ import { OmnibusPriceTextAfterControl as so } from "./controls/omnibusPriceTextAfterControl.js";
15
+ import { OmnibusDiscountTextBeforeControl as uo } from "./controls/omnibusDiscountTextBeforeControl.js";
16
+ import { OmnibusDiscountTextAfterControl as Po } from "./controls/omnibusDiscountTextAfterControl.js";
17
+ import { PriceHideControl as go } from "./controls/priceHideControl.js";
18
+ const Io = new o().addBlock(n).withSettingsPanelRegistry(Co).addControl(r).addControl(io).addControl(ao).addControl(eo).addControl(l).addControl(d).addControl(C).addControl(i).addControl(a).addControl(e).addControl(m).addControl(c).addControl(s).addControl(u).addControl(P).addControl(g).addControl(O).addControl(p).addControl(B).addControl(f).addControl(S).addControl(b).addControl(y).addControl(F).addControl(x).addControl(mo).addControl(D).addControl(T).addControl(k).addControl(A).addControl(N).addControl(R).addControl(z).addControl(L).addControl(I).addControl(w).addControl(h).addControl(M).addControl(E).addControl(H).addControl(j).addControl(q).addControl(co).addControl(so).addControl(v).addControl(G).addControl(J).addControl(K).addControl(Q).addControl(U).addControl(V).addControl(W).addControl(uo).addControl(Po).addControl(X).addControl(Y).addControl(Z).addControl(_).addControl(go).addControl($).addControl(oo).addControl(no).addControl(to).addControl(t).addStyles(lo).withIconsRegistry(ro).build();
17
19
  export {
18
- xo as default
20
+ Io as default
19
21
  };