@useinsider/guido 2.1.0-beta.9ba2e9d → 2.1.0-beta.a67f307

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 (51) hide show
  1. package/README.md +36 -0
  2. package/dist/@types/config/schemas.js +70 -65
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +69 -58
  5. package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
  6. package/dist/composables/useBlocksConfig.js +26 -16
  7. package/dist/composables/useHtmlValidator.js +107 -119
  8. package/dist/config/compiler/utils/recommendationCompilerUtils.js +70 -96
  9. package/dist/config/migrator/itemsBlockMigrator.js +101 -97
  10. package/dist/enums/defaults.js +8 -4
  11. package/dist/enums/extensions/recommendationBlock.js +1 -1
  12. package/dist/extensions/Blocks/Recommendation/block.js +26 -23
  13. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
  14. package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
  15. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -70
  17. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
  18. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
  19. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  20. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +117 -107
  21. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
  22. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
  23. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
  24. package/dist/extensions/Blocks/Recommendation/templates/utils.js +43 -31
  25. package/dist/extensions/ModulesTabIcons/extension.js +17 -0
  26. package/dist/guido.css +1 -1
  27. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
  28. package/dist/services/recommendationApi.js +11 -9
  29. package/dist/src/@types/config/schemas.d.ts +8 -0
  30. package/dist/src/composables/useConfig.d.ts +4 -0
  31. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
  32. package/dist/src/enums/defaults.d.ts +4 -0
  33. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  34. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
  35. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
  36. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -1
  37. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
  39. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  40. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -0
  41. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
  43. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -3
  44. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  45. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  46. package/dist/src/stores/config.d.ts +36 -0
  47. package/dist/static/styles/components/notification.css.js +1 -0
  48. package/dist/static/styles/components/version-history.css.js +10 -2
  49. package/dist/static/styles/components/wide-panel.css.js +18 -2
  50. package/dist/static/styles/customEditorStyle.css.js +10 -9
  51. package/package.json +2 -2
@@ -1,37 +1,38 @@
1
- import { ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { RecommendationBlockId as f } from "../../constants/blockIds.js";
3
- import { CURRENCY_ATTR as y, CONTAINER_SELECTOR as I } from "../../constants/selectors.js";
4
- import { useRecommendationExtensionStore as A } from "../../store/recommendation.js";
1
+ import { ModificationDescription as S } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { RecommendationBlockId as m } from "../../constants/blockIds.js";
3
+ import { CURRENCY_ATTR as y, MOBILE_CONTAINER_SELECTOR as T, DESKTOP_CONTAINER_SELECTOR as w, CONTAINER_SELECTOR as _ } from "../../constants/selectors.js";
4
+ import { RecommendationConfigService as k } from "../../services/configService.js";
5
+ import { useRecommendationExtensionStore as b } from "../../store/recommendation.js";
5
6
  import { prepareProductRows as R } from "../../templates/index.js";
6
- import { formatPrice as O } from "../../utils/priceFormatter.js";
7
- import { isTdNode as T } from "../../utils/tagName.js";
8
- import { sanitizeImageUrl as k, getDefaultProducts as _, DEFAULT_CARD_COMPOSITION as P } from "../../templates/utils.js";
9
- const C = "ins-recommendation-v3-block-v2";
10
- function b(o) {
7
+ import { formatPrice as D } from "../../utils/priceFormatter.js";
8
+ import { isTdNode as L } from "../../utils/tagName.js";
9
+ import { sanitizeImageUrl as U, getDefaultProducts as H, DEFAULT_CARD_COMPOSITION as C } from "../../templates/utils.js";
10
+ const q = "ins-recommendation-v3-block-v2";
11
+ function E(o) {
11
12
  if (!o)
12
13
  return null;
13
14
  if ("getAttribute" in o) {
14
15
  const e = o.getAttribute("class");
15
- if (e && e.includes(C))
16
+ if (e && e.includes(q))
16
17
  return o;
17
18
  }
18
- return "querySelector" in o ? o.querySelector(`.${C}`) : null;
19
+ return "querySelector" in o ? o.querySelector(`.${q}`) : null;
19
20
  }
20
- function q(o) {
21
- const e = b(o);
21
+ function P(o) {
22
+ const e = E(o);
22
23
  if (!e || !("getAttribute" in e))
23
24
  return "grid";
24
25
  const t = e.getAttribute("data-layout");
25
26
  return t === "list" || t === "horizontal" ? "list" : "grid";
26
27
  }
27
- function D(o) {
28
- const e = b(o);
28
+ function N(o) {
29
+ const e = E(o);
29
30
  if (!e || !("getAttribute" in e))
30
- return P;
31
+ return C;
31
32
  const t = e.getAttribute("data-card-composition");
32
- return t ? t.split(",").filter(Boolean) : P;
33
+ return t ? t.split(",").filter(Boolean) : C;
33
34
  }
34
- function S(o, e, t) {
35
+ function g(o, e, t) {
35
36
  if (!e || !("childNodes" in e))
36
37
  return !1;
37
38
  const n = e.childNodes().find(
@@ -39,23 +40,42 @@ function S(o, e, t) {
39
40
  );
40
41
  return n ? (o.modifyHtml(n).setText(t), !0) : !1;
41
42
  }
42
- function w(o, e) {
43
- return o && o.length > 0 ? o : e.length > 0 ? e : _();
43
+ function h(o, e) {
44
+ return o && o.length > 0 ? o : e.length > 0 ? e : H();
44
45
  }
45
- function U(o) {
46
- const { currentNode: e, documentModifier: t, afterRegenerate: r, products: n, layout: i } = o;
46
+ function $(o) {
47
+ const { currentNode: e, documentModifier: t, products: r, layout: n } = o;
48
+ if (!e || !("querySelector" in e))
49
+ return;
50
+ const i = e.querySelector(T);
51
+ if (!i)
52
+ return;
53
+ const c = b(), u = k.getConfig(e), l = h(r, c.recommendationProducts), s = N(e), d = n ?? P(e), a = R(l, d, {
54
+ productsPerRow: u.mobileCardsInRow,
55
+ composition: s
56
+ });
57
+ t.modifyHtml(i).setInnerHtml(a).apply(new S("Updated mobile product rows"));
58
+ }
59
+ function x(o) {
60
+ const {
61
+ currentNode: e,
62
+ documentModifier: t,
63
+ afterRegenerate: r,
64
+ products: n,
65
+ layout: i
66
+ } = o;
47
67
  if (!e || !("querySelector" in e))
48
68
  return;
49
- const c = e.querySelector(I);
69
+ const c = e.querySelector(w) ?? e.querySelector(_);
50
70
  if (!c)
51
71
  return;
52
- const s = A(), l = w(n, s.recommendationProducts), { cardsInRow: u } = s.recommendationConfigs, d = D(e), a = i ?? q(e), p = R(l, a, {
53
- productsPerRow: u,
72
+ const u = b(), l = h(n, u.recommendationProducts), { cardsInRow: s } = u.recommendationConfigs, d = N(e), a = i ?? P(e), p = R(l, a, {
73
+ productsPerRow: s,
54
74
  composition: d
55
75
  });
56
- t.modifyHtml(c).setInnerHtml(p).apply(new g("Updated product")), r == null || r();
76
+ t.modifyHtml(c).setInnerHtml(p).apply(new S("Updated product")), $(o), r == null || r();
57
77
  }
58
- function $(o, e, t, r) {
78
+ function B(o, e, t, r) {
59
79
  const i = `0 ${Math.floor(t / 2)}px`;
60
80
  let c = !1;
61
81
  return r === "grid" ? Array.from(
@@ -65,29 +85,29 @@ function $(o, e, t, r) {
65
85
  }) : Array.from(
66
86
  o.querySelectorAll(".product-card-wrapper")
67
87
  ).forEach((l) => {
68
- const u = "parentNode" in l ? l.parentNode : null;
69
- u && T(u) && (e.modifyHtml(u).setStyle("padding", i), c = !0);
88
+ const s = "parentNode" in l ? l.parentNode : null;
89
+ s && L(s) && (e.modifyHtml(s).setStyle("padding", i), c = !0);
70
90
  }), c;
71
91
  }
72
- function L(o, e, t) {
92
+ function v(o, e, t) {
73
93
  const r = `${t}px`, n = Array.from(o.querySelectorAll(".spacer"));
74
94
  let i = !1;
75
95
  return n.forEach((c) => {
76
96
  e.modifyHtml(c).setStyle("height", r), i = !0;
77
97
  }), i;
78
98
  }
79
- function H(o) {
99
+ function V(o) {
80
100
  const { currentNode: e, documentModifier: t } = o;
81
101
  if (!e)
82
102
  return;
83
- const r = b(e);
103
+ const r = E(e);
84
104
  if (!r || !("getAttribute" in r))
85
105
  return;
86
- const n = r.getAttribute("data-column-spacing"), i = r.getAttribute("data-row-spacing"), c = q(e);
87
- let s = !1;
106
+ const n = r.getAttribute("data-column-spacing"), i = r.getAttribute("data-row-spacing"), c = P(e);
107
+ let u = !1;
88
108
  if (n) {
89
109
  const l = parseInt(n);
90
- Number.isNaN(l) || (s = $(
110
+ Number.isNaN(l) || (u = B(
91
111
  e,
92
112
  t,
93
113
  l,
@@ -97,28 +117,28 @@ function H(o) {
97
117
  if (i) {
98
118
  const l = parseInt(i);
99
119
  if (!Number.isNaN(l)) {
100
- const u = L(e, t, l);
101
- s = s || u;
120
+ const s = v(e, t, l);
121
+ u = u || s;
102
122
  }
103
123
  }
104
- s && t.apply(new g("Reapply spacing after regeneration"));
124
+ u && t.apply(new S("Reapply spacing after regeneration"));
105
125
  }
106
- function K(o) {
126
+ function ee(o) {
107
127
  const { currentNode: e, documentModifier: t, afterRegenerate: r, products: n, layout: i } = o;
108
- e && U({
128
+ e && x({
109
129
  currentNode: e,
110
130
  documentModifier: t,
111
131
  products: n,
112
132
  layout: i,
113
133
  afterRegenerate: () => {
114
134
  setTimeout(() => {
115
- H({ currentNode: e, documentModifier: t });
135
+ V({ currentNode: e, documentModifier: t });
116
136
  }, 0), r == null || r();
117
137
  }
118
138
  });
119
139
  }
120
- function h() {
121
- const o = A(), { currencySettings: e } = o.recommendationConfigs;
140
+ function M() {
141
+ const o = b(), { currencySettings: e } = o.recommendationConfigs;
122
142
  return {
123
143
  code: e.value,
124
144
  symbol: e.symbol,
@@ -128,40 +148,40 @@ function h() {
128
148
  thousandSeparator: e.thousandSeparator
129
149
  };
130
150
  }
131
- function E(o, e = "price") {
132
- const t = h(), r = o[e], n = (r == null ? void 0 : r[t.code]) ?? Object.values(r ?? {})[0] ?? 0;
133
- return O({
151
+ function A(o, e = "price") {
152
+ const t = M(), r = o[e], n = (r == null ? void 0 : r[t.code]) ?? Object.values(r ?? {})[0] ?? 0;
153
+ return D({
134
154
  price: n,
135
155
  currency: t
136
156
  });
137
157
  }
138
- function x(o) {
158
+ function j(o) {
139
159
  var i, c;
140
- const e = h(), t = ((i = o.original_price) == null ? void 0 : i[e.code]) ?? Object.values(o.original_price ?? {})[0] ?? 0, r = ((c = o.price) == null ? void 0 : c[e.code]) ?? Object.values(o.price ?? {})[0] ?? 0, n = t > 0 ? Math.round((t - r) / t * 100) : 0;
160
+ const e = M(), t = ((i = o.original_price) == null ? void 0 : i[e.code]) ?? Object.values(o.original_price ?? {})[0] ?? 0, r = ((c = o.price) == null ? void 0 : c[e.code]) ?? Object.values(o.price ?? {})[0] ?? 0, n = t > 0 ? Math.round((t - r) / t * 100) : 0;
141
161
  return n > 0 ? `-${n}%` : "0%";
142
162
  }
143
- function N(o) {
163
+ function I(o) {
144
164
  const { documentModifier: e, product: t, priceEl: r, oldPriceEl: n, omnibusPriceEl: i, omnibusDiscountEl: c } = o;
145
- let s = !1;
165
+ let u = !1;
146
166
  if (r && "querySelector" in r) {
147
- const l = r.querySelector("strong"), u = E(t, "price");
148
- S(e, l, u) && (s = !0);
167
+ const l = r.querySelector("strong"), s = A(t, "price");
168
+ g(e, l, s) && (u = !0);
149
169
  }
150
170
  if (n && "querySelector" in n) {
151
- const l = n.querySelector("strong"), u = E(t, "original_price");
152
- S(e, l, u) && (s = !0);
171
+ const l = n.querySelector("strong"), s = A(t, "original_price");
172
+ g(e, l, s) && (u = !0);
153
173
  }
154
174
  if (i && "querySelector" in i) {
155
- const l = i.querySelector(".omnibus-price-value"), u = E(t, "original_price");
156
- S(e, l, u) && (s = !0);
175
+ const l = i.querySelector(".omnibus-price-value"), s = A(t, "original_price");
176
+ g(e, l, s) && (u = !0);
157
177
  }
158
178
  if (c && "querySelector" in c) {
159
- const l = c.querySelector(".omnibus-discount-value"), u = x(t);
160
- S(e, l, u) && (s = !0);
179
+ const l = c.querySelector(".omnibus-discount-value"), s = j(t);
180
+ g(e, l, s) && (u = !0);
161
181
  }
162
- return s;
182
+ return u;
163
183
  }
164
- function B(o) {
184
+ function W(o) {
165
185
  const {
166
186
  documentModifier: e,
167
187
  product: t,
@@ -169,118 +189,119 @@ function B(o) {
169
189
  nameEl: n,
170
190
  priceEl: i,
171
191
  oldPriceEl: c,
172
- omnibusPriceEl: s,
192
+ omnibusPriceEl: u,
173
193
  omnibusDiscountEl: l,
174
- buttonEl: u
194
+ buttonEl: s
175
195
  } = o;
176
196
  let d = !1;
177
197
  if (r && "querySelector" in r) {
178
198
  const a = r.querySelector("img");
179
- a && (e.modifyHtml(a).setAttribute("src", k(t.image_url)).setAttribute("alt", t.name), d = !0);
199
+ a && (e.modifyHtml(a).setAttribute("src", U(t.image_url)).setAttribute("alt", t.name), d = !0);
180
200
  const p = r.querySelector("a");
181
201
  p && (e.modifyHtml(p).setAttribute("href", t.url), d = !0);
182
202
  }
183
203
  if (n && "querySelector" in n) {
184
204
  const a = n.querySelector("strong");
185
- S(e, a, t.name) && (d = !0);
205
+ g(e, a, t.name) && (d = !0);
186
206
  }
187
- if (N({
207
+ if (I({
188
208
  documentModifier: e,
189
209
  product: t,
190
210
  priceEl: i,
191
211
  oldPriceEl: c,
192
- omnibusPriceEl: s,
212
+ omnibusPriceEl: u,
193
213
  omnibusDiscountEl: l
194
- }) && (d = !0), u && "querySelector" in u) {
195
- const a = u.querySelector("a.es-button") || u.querySelector("a");
214
+ }) && (d = !0), s && "querySelector" in s) {
215
+ const a = s.querySelector("a.es-button") || s.querySelector("a");
196
216
  a && (e.modifyHtml(a).setAttribute("href", t.url), d = !0);
197
217
  }
198
218
  return d;
199
219
  }
200
- function J(o) {
220
+ function te(o) {
201
221
  const { currentNode: e, documentModifier: t, products: r } = o;
202
222
  if (!e || !("querySelectorAll" in e))
203
223
  return !1;
204
224
  const n = e.querySelectorAll(
205
- `[esd-extension-block-id="${f.IMAGE}"]`
225
+ `[esd-extension-block-id="${m.IMAGE}"]`
206
226
  ), i = e.querySelectorAll(
207
- `[esd-extension-block-id="${f.NAME}"]`
227
+ `[esd-extension-block-id="${m.NAME}"]`
208
228
  ), c = e.querySelectorAll(
209
- `[esd-extension-block-id="${f.PRICE}"]`
210
- ), s = e.querySelectorAll(
211
- `[esd-extension-block-id="${f.OLD_PRICE}"]`
212
- ), l = e.querySelectorAll(
213
- `[esd-extension-block-id="${f.OMNIBUS_PRICE}"]`
229
+ `[esd-extension-block-id="${m.PRICE}"]`
214
230
  ), u = e.querySelectorAll(
215
- `[esd-extension-block-id="${f.OMNIBUS_DISCOUNT}"]`
231
+ `[esd-extension-block-id="${m.OLD_PRICE}"]`
232
+ ), l = e.querySelectorAll(
233
+ `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
234
+ ), s = e.querySelectorAll(
235
+ `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
216
236
  ), d = e.querySelectorAll(
217
- `[esd-extension-block-id="${f.BUTTON}"]`
237
+ `[esd-extension-block-id="${m.BUTTON}"]`
218
238
  );
219
239
  if (n.length !== r.length)
220
240
  return !1;
221
241
  let a = !1;
222
- return r.forEach((p, m) => {
223
- const M = B({
242
+ return r.forEach((p, f) => {
243
+ const O = W({
224
244
  documentModifier: t,
225
245
  product: p,
226
- imageEl: n[m] ?? null,
227
- nameEl: i[m] ?? null,
228
- priceEl: c[m] ?? null,
229
- oldPriceEl: s[m] ?? null,
230
- omnibusPriceEl: l[m] ?? null,
231
- omnibusDiscountEl: u[m] ?? null,
232
- buttonEl: d[m] ?? null
246
+ imageEl: n[f] ?? null,
247
+ nameEl: i[f] ?? null,
248
+ priceEl: c[f] ?? null,
249
+ oldPriceEl: u[f] ?? null,
250
+ omnibusPriceEl: l[f] ?? null,
251
+ omnibusDiscountEl: s[f] ?? null,
252
+ buttonEl: d[f] ?? null
233
253
  });
234
- a = a || M;
235
- }), a && t.apply(new g("Updated product content in-place")), !0;
254
+ a = a || O;
255
+ }), a && t.apply(new S("Updated product content in-place")), !0;
236
256
  }
237
- function Q(o) {
257
+ function oe(o) {
238
258
  const { currentNode: e, documentModifier: t } = o;
239
259
  if (!e || !("querySelectorAll" in e))
240
260
  return !1;
241
- const n = A().recommendationProducts;
261
+ const n = b().recommendationProducts;
242
262
  if (n.length === 0)
243
263
  return !1;
244
264
  const i = e.querySelectorAll(
245
- `[esd-extension-block-id="${f.PRICE}"]`
265
+ `[esd-extension-block-id="${m.PRICE}"]`
246
266
  ), c = e.querySelectorAll(
247
- `[esd-extension-block-id="${f.OLD_PRICE}"]`
248
- ), s = e.querySelectorAll(
249
- `[esd-extension-block-id="${f.OMNIBUS_PRICE}"]`
267
+ `[esd-extension-block-id="${m.OLD_PRICE}"]`
268
+ ), u = e.querySelectorAll(
269
+ `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
250
270
  ), l = e.querySelectorAll(
251
- `[esd-extension-block-id="${f.OMNIBUS_DISCOUNT}"]`
271
+ `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
252
272
  );
253
- let u = !1;
273
+ let s = !1;
254
274
  return n.forEach((d, a) => {
255
- N({
275
+ I({
256
276
  documentModifier: t,
257
277
  product: d,
258
278
  priceEl: i[a] ?? null,
259
279
  oldPriceEl: c[a] ?? null,
260
- omnibusPriceEl: s[a] ?? null,
280
+ omnibusPriceEl: u[a] ?? null,
261
281
  omnibusDiscountEl: l[a] ?? null
262
- }) && (u = !0);
263
- }), u && t.apply(new g("Updated price formatting in-place")), u;
282
+ }) && (s = !0);
283
+ }), s && t.apply(new S("Updated price formatting in-place")), s;
264
284
  }
265
- function X(o) {
266
- const { currentNode: e, documentModifier: t, currency: r } = o, n = b(e);
285
+ function re(o) {
286
+ const { currentNode: e, documentModifier: t, currency: r } = o, n = E(e);
267
287
  if (!n)
268
288
  return;
269
- const i = r.alignment === "before" ? "0" : "1", c = (s, l) => {
270
- t.modifyHtml(n).setAttribute(s, l);
289
+ const i = r.alignment === "before" ? "0" : "1", c = (u, l) => {
290
+ t.modifyHtml(n).setAttribute(u, l);
271
291
  };
272
- c(y.CURRENCY, r.code), c(y.SYMBOL, r.symbol), c(y.ALIGNMENT, i), c(y.THOUSAND_SEPARATOR, r.thousandSeparator), c(y.DECIMAL_SEPARATOR, r.decimalSeparator), c(y.DECIMAL_COUNT, r.decimalCount.toString()), t.apply(new g("Update currency attributes"));
292
+ c(y.CURRENCY, r.code), c(y.SYMBOL, r.symbol), c(y.ALIGNMENT, i), c(y.THOUSAND_SEPARATOR, r.thousandSeparator), c(y.DECIMAL_SEPARATOR, r.decimalSeparator), c(y.DECIMAL_COUNT, r.decimalCount.toString()), t.apply(new S("Update currency attributes"));
273
293
  }
274
294
  export {
275
- E as formatProductPrice,
276
- b as getBlockElement,
277
- D as getCardComposition,
278
- q as getCurrentLayout,
279
- H as reapplySpacing,
280
- U as regenerateProductRows,
281
- K as regenerateProductRowsWithStyles,
282
- X as setCurrencyAttributes,
283
- Q as updatePricesInPlace,
284
- J as updateProductContentInPlace,
285
- B as updateSingleProductContent
295
+ A as formatProductPrice,
296
+ E as getBlockElement,
297
+ N as getCardComposition,
298
+ P as getCurrentLayout,
299
+ V as reapplySpacing,
300
+ $ as regenerateMobileProductRows,
301
+ x as regenerateProductRows,
302
+ ee as regenerateProductRowsWithStyles,
303
+ re as setCurrencyAttributes,
304
+ oe as updatePricesInPlace,
305
+ te as updateProductContentInPlace,
306
+ W as updateSingleProductContent
286
307
  };
@@ -0,0 +1,21 @@
1
+ import { ModificationDescription as r } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ const i = "ins-recommendation-desktop-container", s = "ins-recommendation-mobile-container", l = `.${s} { display: none; }`, u = `@media only screen and (max-width: 480px) { .${i} { display: none !important; } .${s} { display: table !important; } }`, c = `.${s}`;
3
+ function a(o, e) {
4
+ return !!o.querySelector(e);
5
+ }
6
+ function d(o) {
7
+ return o.querySelectorAll(`*${i}`).length > 0;
8
+ }
9
+ function p(o) {
10
+ const e = o.getDocumentRootCssNode();
11
+ if (!e)
12
+ return;
13
+ const n = o.getDocumentModifier();
14
+ let t = !1;
15
+ a(e, c) || (n.modifyCss(e).appendRule(l), t = !0), d(e) || (n.modifyCss(e).appendRule(u), t = !0), t && n.apply(new r("Add mobile layout CSS rules"));
16
+ }
17
+ export {
18
+ i as CSS_CLASS_DESKTOP_CONTAINER,
19
+ s as CSS_CLASS_MOBILE_CONTAINER,
20
+ p as ensureMobileCssRulesExist
21
+ };