@useinsider/guido 2.0.0-beta.6e688eb → 2.0.0-beta.782343a

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 (64) 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/constants/blockIds.js +4 -0
  8. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
  9. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -0
  10. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
  11. package/dist/extensions/Blocks/Recommendation/controls/{cardBackgroundColorControl.js → cardBackground/index.js} +2 -2
  12. package/dist/extensions/Blocks/Recommendation/{cardCompositionControl.js → controls/cardComposition/index.js} +18 -26
  13. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
  14. package/dist/extensions/Blocks/Recommendation/{control.js → controls/main/index.js} +44 -25
  15. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
  16. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +76 -0
  17. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
  18. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
  19. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +15 -13
  20. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +15 -13
  21. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
  22. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
  23. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
  24. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
  25. package/dist/extensions/Blocks/Recommendation/controls/{spacingControl.js → spacing/index.js} +57 -62
  26. package/dist/extensions/Blocks/Recommendation/extension.js +37 -17
  27. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -10
  28. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +20 -20
  29. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +17 -16
  30. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +62 -87
  32. package/dist/guido.css +1 -1
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +364 -286
  34. package/dist/package.json.js +1 -1
  35. package/dist/services/stripoApi.js +6 -10
  36. package/dist/src/@types/config/schemas.d.ts +4 -0
  37. package/dist/src/composables/useConfig.d.ts +2 -0
  38. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
  39. package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
  40. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +11 -0
  41. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +19 -0
  42. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
  43. package/dist/src/extensions/Blocks/Recommendation/controls/{cardBackgroundColorControl.d.ts → cardBackground/index.d.ts} +1 -1
  44. package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +1 -1
  45. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +19 -589
  47. package/dist/src/extensions/Blocks/Recommendation/{control.d.ts → controls/main/index.d.ts} +1 -1
  48. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
  49. package/dist/src/extensions/Blocks/Recommendation/controls/{nameTextTrimControl.d.ts → name/textTrim.d.ts} +1 -1
  50. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
  51. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
  52. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.d.ts → omnibusDiscount/textAfter.d.ts} +1 -1
  53. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.d.ts → omnibusDiscount/textBefore.d.ts} +1 -1
  54. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
  55. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.d.ts → omnibusPrice/textAfter.d.ts} +1 -1
  56. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.d.ts → omnibusPrice/textBefore.d.ts} +1 -1
  57. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/{spacingControl.d.ts → spacing/index.d.ts} +2 -5
  59. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
  60. package/dist/src/stores/config.d.ts +17 -0
  61. package/package.json +3 -3
  62. package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
  63. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
  64. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
@@ -1,25 +1,37 @@
1
1
  var C = Object.defineProperty;
2
- var g = (i, r, e) => r in i ? C(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
- var S = (i, r, e) => g(i, typeof r != "symbol" ? r + "" : r, e);
4
- import { ModificationDescription as l } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as m } from "../../common-control.js";
6
- import { useDebounceFn as d } from "../../../../node_modules/@vueuse/shared/index.js";
7
- const _ = "recommendation-spacing-control", c = {
2
+ var h = (n, r, e) => r in n ? C(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
3
+ var S = (n, r, e) => h(n, typeof r != "symbol" ? r + "" : r, e);
4
+ import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as _ } from "../../../common-control.js";
6
+ import { useDebounceFn as d } from "../../../../../node_modules/@vueuse/shared/index.js";
7
+ const f = "recommendation-spacing-control", i = {
8
8
  COLUMN_SPACING: "columnSpacing",
9
9
  ROW_SPACING: "rowSpacing"
10
10
  }, N = {
11
11
  COLUMN_SPACING: "data-column-spacing",
12
12
  ROW_SPACING: "data-row-spacing"
13
- }, n = {
13
+ }, a = {
14
14
  COLUMN_SPACING: 10,
15
15
  // 5px on each side = 10px total
16
16
  ROW_SPACING: 20
17
- }, p = {
17
+ }, c = {
18
18
  MIN_SPACING: 0,
19
19
  MAX_SPACING: 50,
20
20
  STEP: 5
21
21
  };
22
- class G extends m {
22
+ function g(n, r) {
23
+ return !n || !("getStyle" in n) ? null : n.getStyle(r);
24
+ }
25
+ function A(n) {
26
+ return !n || !("parent" in n) || typeof n.parent != "function" ? null : n.parent();
27
+ }
28
+ function m(n, r) {
29
+ if (!n)
30
+ return r;
31
+ const e = parseFloat(n);
32
+ return Number.isNaN(e) ? r : e;
33
+ }
34
+ class M extends _ {
23
35
  constructor() {
24
36
  super(...arguments);
25
37
  /**
@@ -38,7 +50,7 @@ class G extends m {
38
50
  }, 300));
39
51
  }
40
52
  getId() {
41
- return _;
53
+ return f;
42
54
  }
43
55
  getTemplate() {
44
56
  return `
@@ -46,17 +58,17 @@ class G extends m {
46
58
  ${this._GuTwoColumns([
47
59
  this._GuLabel({ text: "Column Spacing (px)" }),
48
60
  this._GuCounter({
49
- name: c.COLUMN_SPACING,
50
- minValue: p.MIN_SPACING,
51
- maxValue: p.MAX_SPACING,
52
- step: p.STEP
61
+ name: i.COLUMN_SPACING,
62
+ minValue: c.MIN_SPACING,
63
+ maxValue: c.MAX_SPACING,
64
+ step: c.STEP
53
65
  }),
54
66
  this._GuLabel({ text: "Row Spacing (px)" }),
55
67
  this._GuCounter({
56
- name: c.ROW_SPACING,
57
- minValue: p.MIN_SPACING,
58
- maxValue: p.MAX_SPACING,
59
- step: p.STEP
68
+ name: i.ROW_SPACING,
69
+ minValue: c.MIN_SPACING,
70
+ maxValue: c.MAX_SPACING,
71
+ step: c.STEP
60
72
  })
61
73
  ])}
62
74
  </div>
@@ -74,50 +86,32 @@ class G extends m {
74
86
  _setFormValues() {
75
87
  const e = this._getStoredColumnSpacing(), t = this._getStoredRowSpacing();
76
88
  this.api.updateValues({
77
- [c.COLUMN_SPACING]: e,
78
- [c.ROW_SPACING]: t
89
+ [i.COLUMN_SPACING]: e,
90
+ [i.ROW_SPACING]: t
79
91
  });
80
92
  }
81
93
  /**
82
94
  * Gets stored column spacing from the first product card wrapper's parent element's padding
83
- * Reads the actual padding value instead of relying on data attributes
84
- *
85
95
  * The padding is applied as "0 {halfSpacing}px" on the parent TD element,
86
- * so we need to extract the horizontal padding value and multiply by 2 to get total spacing.
96
+ * so we extract the horizontal padding value and multiply by 2 to get total spacing.
87
97
  */
88
98
  _getStoredColumnSpacing() {
89
99
  if (!this.currentNode)
90
- return n.COLUMN_SPACING;
91
- const e = this.currentNode.querySelector(".product-card-wrapper");
92
- if (!e || !("parent" in e) || typeof e.parent != "function")
93
- return n.COLUMN_SPACING;
94
- const t = e.parent();
95
- if (!t || !("getStyle" in t))
96
- return n.COLUMN_SPACING;
97
- const o = t.getStyle("padding");
100
+ return a.COLUMN_SPACING;
101
+ const e = this.currentNode.querySelector(".product-card-wrapper"), t = A(e), o = g(t, "padding");
98
102
  if (!o)
99
- return n.COLUMN_SPACING;
100
- const u = o.trim().split(/\s+/);
101
- if (u.length < 2)
102
- return n.COLUMN_SPACING;
103
- const [, a] = u, s = parseFloat(a);
104
- return Number.isNaN(s) ? n.COLUMN_SPACING : s * 2;
103
+ return a.COLUMN_SPACING;
104
+ const s = o.trim().split(/\s+/);
105
+ return s.length < 2 ? a.COLUMN_SPACING : m(s[1], a.COLUMN_SPACING / 2) * 2;
105
106
  }
106
107
  /**
107
108
  * Gets stored row spacing from the first spacer element's height style
108
- * Reads the actual height value instead of relying on data attributes
109
109
  */
110
110
  _getStoredRowSpacing() {
111
111
  if (!this.currentNode)
112
- return n.ROW_SPACING;
113
- const e = this.currentNode.querySelector(".spacer");
114
- if (!e || !("getStyle" in e))
115
- return n.ROW_SPACING;
116
- const t = e.getStyle("height");
117
- if (!t)
118
- return n.ROW_SPACING;
119
- const o = parseFloat(t);
120
- return Number.isNaN(o) ? n.ROW_SPACING : o;
112
+ return a.ROW_SPACING;
113
+ const e = this.currentNode.querySelector(".spacer"), t = g(e, "height");
114
+ return m(t, a.ROW_SPACING);
121
115
  }
122
116
  /**
123
117
  * Handles column spacing changes
@@ -126,15 +120,16 @@ class G extends m {
126
120
  _onColumnSpacingChange(e) {
127
121
  if (!this.currentNode)
128
122
  return;
123
+ this._storeColumnSpacing(e);
129
124
  const t = Array.from(
130
125
  this.currentNode.querySelectorAll(".product-card-wrapper")
131
126
  );
132
127
  if (!t)
133
128
  return;
134
- const o = this.api.getDocumentModifier(), a = `0 ${e / 2}px`;
135
- console.debug("padding", a), t.forEach((s) => {
136
- "parent" in s && s.parent() && o.modifyHtml(s.parent()).setStyle("padding", a);
137
- }), o.apply(new l(`Update column spacing to ${e}px`));
129
+ const o = this.api.getDocumentModifier(), u = `0 ${e / 2}px`;
130
+ t.forEach((l) => {
131
+ "parent" in l && l.parent() && o.modifyHtml(l.parent()).setStyle("padding", u);
132
+ }), o.apply(new p(`Update column spacing to ${e}px`));
138
133
  }
139
134
  /**
140
135
  * Handles row spacing changes
@@ -147,12 +142,12 @@ class G extends m {
147
142
  const t = Array.from(
148
143
  this.currentNode.querySelectorAll(".spacer")
149
144
  );
150
- if (console.debug("spacerCells", t), console.debug("spacing", e), !t.length)
145
+ if (!t.length)
151
146
  return;
152
- const o = this.api.getDocumentModifier(), u = `${e}px`;
153
- t.forEach((a) => {
154
- o.modifyHtml(a).setStyle("height", u);
155
- }), o.apply(new l(`Update row spacing to ${e}px`));
147
+ const o = this.api.getDocumentModifier(), s = `${e}px`;
148
+ t.forEach((u) => {
149
+ o.modifyHtml(u).setStyle("height", s);
150
+ }), o.apply(new p(`Update row spacing to ${e}px`));
156
151
  }
157
152
  /**
158
153
  * Stores column spacing value in block data attribute
@@ -161,7 +156,7 @@ class G extends m {
161
156
  if (!this.currentNode)
162
157
  return;
163
158
  const t = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
164
- t && this.api.getDocumentModifier().modifyHtml(t).setAttribute(N.COLUMN_SPACING, e.toString()).apply(new l("Store column spacing"));
159
+ t && this.api.getDocumentModifier().modifyHtml(t).setAttribute(N.COLUMN_SPACING, e.toString()).apply(new p("Store column spacing"));
165
160
  }
166
161
  /**
167
162
  * Stores row spacing value in block data attribute
@@ -170,19 +165,19 @@ class G extends m {
170
165
  if (!this.currentNode)
171
166
  return;
172
167
  const t = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
173
- t && this.api.getDocumentModifier().modifyHtml(t).setAttribute(N.ROW_SPACING, e.toString()).apply(new l("Store row spacing"));
168
+ t && this.api.getDocumentModifier().modifyHtml(t).setAttribute(N.ROW_SPACING, e.toString()).apply(new p("Store row spacing"));
174
169
  }
175
170
  _listenToFormUpdates() {
176
- this.api.onValueChanged(c.COLUMN_SPACING, (e) => {
171
+ this.api.onValueChanged(i.COLUMN_SPACING, (e) => {
177
172
  const t = parseInt(e);
178
173
  Number.isNaN(t) || this._debouncedOnColumnSpacingChange(t);
179
- }), this.api.onValueChanged(c.ROW_SPACING, (e) => {
174
+ }), this.api.onValueChanged(i.ROW_SPACING, (e) => {
180
175
  const t = parseInt(e);
181
176
  Number.isNaN(t) || this._debouncedOnRowSpacingChange(t);
182
177
  });
183
178
  }
184
179
  }
185
180
  export {
186
- _ as SPACING_CONTROL_ID,
187
- G as SpacingControl
181
+ f as SPACING_CONTROL_ID,
182
+ M as SpacingControl
188
183
  };
@@ -1,19 +1,39 @@
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";
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();
1
+ import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { RecommendationBlock as n } from "./block.js";
3
+ import { RecommendationBlockControl as m } from "./controls/main/index.js";
4
+ import { NameControls as i } from "./controls/name/index.js";
5
+ import { PriceControls as e } from "./controls/price/index.js";
6
+ import { OldPriceControls as l } from "./controls/oldPrice/index.js";
7
+ import { OmnibusPriceControls as s } from "./controls/omnibusPrice/index.js";
8
+ import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
9
+ import { ButtonControls as c } from "./controls/button/index.js";
10
+ import { ImageControls as p } from "./controls/image/index.js";
11
+ import { SpacingControl as d } from "./controls/spacing/index.js";
12
+ import { CardBackgroundColorControl as C } from "./controls/cardBackground/index.js";
13
+ import { RecommendationCardCompositionControl as f } from "./controls/cardComposition/index.js";
14
+ import { RecommendationIconsRegistry as u } from "./iconsRegistry.js";
15
+ import g from "./recommendation.css.js";
16
+ import { SettingsPanel as R } from "./settingsPanel.js";
17
+ const B = [
18
+ i,
19
+ e,
20
+ l,
21
+ s,
22
+ a,
23
+ c,
24
+ p
25
+ ], y = [
26
+ m,
27
+ C,
28
+ d,
29
+ f
30
+ ], P = [
31
+ ...y,
32
+ ...B.flatMap((o) => Object.values(o))
33
+ ], z = P.reduce(
34
+ (o, t) => o.addControl(t),
35
+ new r().addBlock(n).withSettingsPanelRegistry(R)
36
+ ).addStyles(g).withIconsRegistry(u).build();
17
37
  export {
18
- xo as default
38
+ z as default
19
39
  };
@@ -1,17 +1,25 @@
1
1
  import { SettingsPanelRegistry as S, SettingsPanelTab as I, SettingsTab as T, ContainerControls as E, TextControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { BLOCK_ID as R } from "./block.js";
3
- import { COMPOSITION_CONTROL_BLOCK_ID as L } from "./cardCompositionControl.js";
4
- import { RecommendationBlockId as N, RecommendationControlId as _ } from "./constants.js";
5
- import { CONTROL_BLOCK_ID as U } from "./control.js";
6
- import { CARD_BACKGROUND_COLOR_CONTROL_ID as B } from "./controls/cardBackgroundColorControl.js";
7
- import { SPACING_CONTROL_ID as D } from "./controls/spacingControl.js";
8
- class m extends S {
3
+ import { RecommendationBlockId as N } from "./constants/blockIds.js";
4
+ import { RecommendationControlId as _ } from "./constants/controlIds.js";
5
+ import { CONTROL_BLOCK_ID as L } from "./controls/main/index.js";
6
+ import "./controls/name/index.js";
7
+ import "./controls/price/index.js";
8
+ import "./controls/oldPrice/index.js";
9
+ import "./controls/omnibusPrice/index.js";
10
+ import "./controls/omnibusDiscount/index.js";
11
+ import "./controls/button/index.js";
12
+ import "./controls/image/index.js";
13
+ import { SPACING_CONTROL_ID as U } from "./controls/spacing/index.js";
14
+ import { CARD_BACKGROUND_COLOR_CONTROL_ID as B } from "./controls/cardBackground/index.js";
15
+ import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
16
+ class X extends S {
9
17
  registerBlockControls(O) {
10
18
  O[R] = [
11
19
  new I(
12
20
  T.SETTINGS,
13
21
  [
14
- U,
22
+ L,
15
23
  E.EXTERNAL_INDENTS
16
24
  ]
17
25
  ),
@@ -20,13 +28,13 @@ class m extends S {
20
28
  [
21
29
  C.TEXT_BLOCK_BACKGROUND_COLOR,
22
30
  B,
23
- D
31
+ U
24
32
  ]
25
33
  ),
26
34
  new I(
27
35
  "Card Composition",
28
36
  [
29
- L
37
+ D
30
38
  ]
31
39
  ).withLabel("Card Composition")
32
40
  ], O[N.NAME] = [
@@ -158,5 +166,5 @@ class m extends S {
158
166
  }
159
167
  }
160
168
  export {
161
- m as SettingsPanel
169
+ X as SettingsPanel
162
170
  };
@@ -1,9 +1,9 @@
1
- import { RecommendationFeedSourceMaps as n, PriceAttributes as u } from "../../../../enums/extensions/recommendationBlock.js";
2
- import { useRecommendationApi as l } from "../../../../services/recommendationApi.js";
3
- import { useConfigStore as c } from "../../../../stores/config.js";
4
- import { defineStore as p } from "pinia";
5
- import { generateCompleteFilterQuery as m } from "../utils/filterUtil.js";
6
- const a = l(), d = () => ({
1
+ import { RecommendationFeedSourceMaps as u, PriceAttributes as c } from "../../../../enums/extensions/recommendationBlock.js";
2
+ import { useRecommendationApi as p } from "../../../../services/recommendationApi.js";
3
+ import { useConfigStore as m } from "../../../../stores/config.js";
4
+ import { defineStore as d } from "pinia";
5
+ import { generateCompleteFilterQuery as l } from "../utils/filterUtil.js";
6
+ const n = p(), f = () => ({
7
7
  recommendationCampaignUrls: {},
8
8
  recommendationProducts: [],
9
9
  recommendationConfigs: {
@@ -134,8 +134,8 @@ const a = l(), d = () => ({
134
134
  filterSelectionDrawerStatus: !1,
135
135
  filterList: {},
136
136
  filterGroup: 1
137
- }), y = p("guidoRecommendationExtension", {
138
- state: () => d(),
137
+ }), C = d("guidoRecommendationExtension", {
138
+ state: () => f(),
139
139
  getters: {
140
140
  hasFilters: (e) => !!e.recommendationConfigs.filters.length,
141
141
  getFilterGroupCount: (e) => {
@@ -145,7 +145,7 @@ const a = l(), d = () => ({
145
145
  getActivePredictiveAlgorithms: (e) => {
146
146
  const t = [];
147
147
  return e.activePredictiveAlgorithms.forEach((r) => {
148
- t.push(...n.filter((i) => i.id === r));
148
+ t.push(...u.filter((i) => i.id === r));
149
149
  }), t.map((r) => ({
150
150
  text: r.name,
151
151
  value: r.key
@@ -160,7 +160,7 @@ const a = l(), d = () => ({
160
160
  value: t.text
161
161
  })),
162
162
  getFilterList: (e) => Object.values(e.filterList).map((t) => {
163
- const r = t.type === "defaultAttribute", i = u.includes(t.attributeName);
163
+ const r = t.type === "defaultAttribute", i = c.includes(t.attributeName);
164
164
  let o = r ? t.attributeName : `product_attributes.${t.attributeName}`;
165
165
  return o = i ? `${o}.${e.recommendationConfigs.currencySettings.value}` : o, {
166
166
  text: t.displayName,
@@ -178,13 +178,13 @@ const a = l(), d = () => ({
178
178
  activePredictiveAlgorithms: e,
179
179
  languages: t,
180
180
  currencies: r
181
- } = await a.fetchRecommendationCreateData();
181
+ } = await n.fetchRecommendationCreateData();
182
182
  this.activePredictiveAlgorithms = e, this.languages = t;
183
183
  const [i] = r;
184
184
  this.recommendationConfigs.currencySettings.name = i.text, this.recommendationConfigs.currencySettings.value = i.value, this.currencyList = r, this.filterStatus = !!this.recommendationConfigs.filters.length;
185
185
  },
186
186
  async fetchRecommendationFilters() {
187
- const e = await a.fetchRecommendationFilters();
187
+ const e = await n.fetchRecommendationFilters();
188
188
  this.filterList = e;
189
189
  },
190
190
  addFilterGroup(e) {
@@ -238,30 +238,30 @@ const a = l(), d = () => ({
238
238
  });
239
239
  },
240
240
  generateFilterQuery() {
241
- return m(this.recommendationConfigs.filters);
241
+ return l(this.recommendationConfigs.filters);
242
242
  },
243
243
  async fetchRecommendationProducts() {
244
- var o;
245
- const e = this.generateFilterQuery(), t = ((o = n.find((s) => s.key === this.recommendationConfigs.strategy)) == null ? void 0 : o.path) || "", r = c(), i = await a.fetchRecommendationProducts(
246
- t,
244
+ var s;
245
+ const e = this.recommendationConfigs.filters.filter((a) => a.isValid), t = l(e), r = ((s = u.find((a) => a.key === this.recommendationConfigs.strategy)) == null ? void 0 : s.path) || "", i = m(), o = await n.fetchRecommendationProducts(
246
+ r,
247
247
  {
248
248
  // TODO: Here will be optimized and filled carefully
249
249
  locale: this.recommendationConfigs.language,
250
250
  currency: this.recommendationConfigs.currencySettings.value,
251
- partnerName: r.partnerName,
251
+ partnerName: i.partnerName,
252
252
  productId: this.recommendationConfigs.strategy === "manualMerchandising" ? this.recommendationConfigs.productIds.join(",") : "{itemId}",
253
253
  size: this.recommendationConfigs.size,
254
254
  details: !0,
255
255
  campaignId: "{campaignId}",
256
- filter: e
256
+ filter: t
257
257
  }
258
258
  );
259
259
  this.$patch({
260
- recommendationProducts: i
260
+ recommendationProducts: o
261
261
  });
262
262
  }
263
263
  }
264
264
  });
265
265
  export {
266
- y as useRecommendationExtensionStore
266
+ C as useRecommendationExtensionStore
267
267
  };
@@ -1,8 +1,9 @@
1
1
  import { BlockType as e, BlockAttr as o } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { RecommendationBlockId as s, ATTR_PRODUCT_BUTTON as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as c, ATTR_PRODUCT_OMNIBUS_PRICE as p, ATTR_PRODUCT_OLD_PRICE as i, ATTR_PRODUCT_PRICE as d, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_IMAGE as b } from "../constants.js";
3
- import { generateTemplate as _, prepareProductRows as O, spacer as u, DEFAULTS as f, getDefaultProducts as C } from "./templateUtils.js";
4
- import { DEFAULT_CARD_COMPOSITION as I, DEFAULT_CARD_VISIBILITY as h } from "./templateUtils.js";
5
- const g = `
2
+ import { RecommendationBlockId as s } from "../constants/blockIds.js";
3
+ import { ATTR_PRODUCT_BUTTON as l, ATTR_PRODUCT_OMNIBUS_DISCOUNT as c, ATTR_PRODUCT_OMNIBUS_PRICE as p, ATTR_PRODUCT_OLD_PRICE as i, ATTR_PRODUCT_PRICE as d, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_IMAGE as b } from "../constants/selectors.js";
4
+ import { prepareProductRows as _, generateTemplate as O, spacer as u, DEFAULTS as f, getDefaultProducts as C } from "./templateUtils.js";
5
+ import { DEFAULT_CARD_COMPOSITION as h, DEFAULT_CARD_VISIBILITY as A } from "./templateUtils.js";
6
+ const m = `
6
7
  <td align="left" class="ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block es-p20">
7
8
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
8
9
  <tr>
@@ -123,7 +124,7 @@ const g = `
123
124
  </p>
124
125
  </${e.BLOCK_TEXT}>
125
126
  `,
126
- [r]: () => `
127
+ [l]: () => `
127
128
  <${e.BLOCK_BUTTON}
128
129
  ${o.BLOCK_BUTTON.href}="#"
129
130
  class="product-button es-p10t es-p10b"
@@ -152,30 +153,30 @@ const g = `
152
153
  </${e.BLOCK_BUTTON}>
153
154
  `
154
155
  };
155
- function x() {
156
+ function E() {
156
157
  const t = C();
157
- return _(
158
- g,
158
+ return O(
159
+ m,
159
160
  t,
160
161
  3,
161
162
  n,
162
163
  f.TITLE
163
164
  );
164
165
  }
165
- function E(t, a, l) {
166
- return O(
166
+ function $(t, a, r) {
167
+ return _(
167
168
  t,
168
169
  a,
169
170
  n,
170
- l
171
+ r
171
172
  );
172
173
  }
173
174
  export {
174
175
  f as DEFAULTS,
175
- I as DEFAULT_CARD_COMPOSITION,
176
- h as DEFAULT_CARD_VISIBILITY,
177
- g as default,
176
+ h as DEFAULT_CARD_COMPOSITION,
177
+ A as DEFAULT_CARD_VISIBILITY,
178
+ m as default,
178
179
  C as getDefaultProducts,
179
- x as getDefaultTemplate,
180
- E as prepareProductRows
180
+ E as getDefaultTemplate,
181
+ $ as prepareProductRows
181
182
  };
@@ -1,4 +1,4 @@
1
- import { ATTR_PRODUCT_BUTTON as o, ATTR_PRODUCT_OMNIBUS_DISCOUNT as a, ATTR_PRODUCT_OMNIBUS_PRICE as s, ATTR_PRODUCT_OLD_PRICE as l, ATTR_PRODUCT_PRICE as c, ATTR_PRODUCT_NAME as r, ATTR_PRODUCT_IMAGE as d } from "../constants.js";
1
+ import { ATTR_PRODUCT_BUTTON as o, ATTR_PRODUCT_OMNIBUS_DISCOUNT as a, ATTR_PRODUCT_OMNIBUS_PRICE as s, ATTR_PRODUCT_OLD_PRICE as l, ATTR_PRODUCT_PRICE as c, ATTR_PRODUCT_NAME as r, ATTR_PRODUCT_IMAGE as d } from "../constants/selectors.js";
2
2
  import { prepareProductRows as i } from "./templateUtils.js";
3
3
  import { DEFAULTS as k, getDefaultProducts as f } from "./templateUtils.js";
4
4
  const g = `