@useinsider/guido 3.17.0-beta.ddd4dde → 3.17.0-beta.e23d5cd

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 (62) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +77 -73
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  7. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  9. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  10. package/dist/composables/useRecommendation.js +41 -34
  11. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  12. package/dist/config/migrator/recommendationMigrator.js +5 -4
  13. package/dist/enums/academy.js +2 -1
  14. package/dist/enums/date.js +5 -3
  15. package/dist/enums/extensions/recommendationBlock.js +3 -1
  16. package/dist/extensions/Blocks/Items/block.js +49 -98
  17. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
  18. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +11 -12
  19. package/dist/extensions/Blocks/Items/template.js +152 -153
  20. package/dist/extensions/Blocks/Recommendation/block.js +26 -21
  21. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
  22. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
  23. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +238 -185
  24. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  25. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -79
  27. package/dist/extensions/Blocks/common-control.js +22 -19
  28. package/dist/guido.css +1 -1
  29. package/dist/services/recommendationApi.js +69 -30
  30. package/dist/src/@types/config/schemas.d.ts +2 -0
  31. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  32. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  33. package/dist/src/composables/useConfig.d.ts +2 -0
  34. package/dist/src/composables/useRecommendation.d.ts +1 -0
  35. package/dist/src/enums/academy.d.ts +1 -0
  36. package/dist/src/enums/date.d.ts +1 -0
  37. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  38. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -21
  39. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
  40. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  41. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  43. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  44. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -10
  45. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
  46. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  47. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  48. package/dist/src/services/recommendationApi.d.ts +4 -1
  49. package/dist/src/stores/config.d.ts +18 -0
  50. package/dist/src/stores/save-as-template.d.ts +4 -3
  51. package/dist/src/utils/genericUtil.d.ts +5 -0
  52. package/dist/static/assets/icons/line-change.svg.js +5 -0
  53. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  54. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  55. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  56. package/dist/utils/dateUtil.js +23 -10
  57. package/dist/utils/genericUtil.js +28 -27
  58. package/dist/utils/pairProductVariables.js +59 -60
  59. package/dist/utils/templatePreparation.js +35 -34
  60. package/package.json +2 -1
  61. package/dist/extensions/Blocks/Items/constants/currency.js +0 -11
  62. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -19
@@ -1,15 +1,14 @@
1
- import { currencyLocationMaps as p } from "../../../../../enums/extensions/recommendationBlock.js";
2
- import { UEAttr as N, ModificationDescription as I } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
- import { CommonControl as L } from "../../../common-control.js";
4
- import { ITEMS_CURRENCY_ATTR as T, currencyPositionFromLocation as E } from "../../constants/currency.js";
1
+ import { currencyLocationMaps as u } from "../../../../../enums/extensions/recommendationBlock.js";
2
+ import { UEAttr as R, ModificationDescription as L } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { CommonControl as N } from "../../../common-control.js";
5
4
  import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
6
- import { getItemsBlockConfig as l, setItemsBlockConfig as O, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
7
- const b = m.PRICE_CURRENCY_LOCATION, c = {
5
+ import { getItemsBlockConfig as C, setItemsBlockConfig as I, escapeReplacement as T } from "../../utils/nodeConfigUtils.js";
6
+ const E = m.PRICE_CURRENCY_LOCATION, c = {
8
7
  CURRENCY_LOCATION: "currencyLocation"
9
8
  };
10
- class Y extends L {
9
+ class A extends N {
11
10
  getId() {
12
- return b;
11
+ return E;
13
12
  }
14
13
  getTemplate() {
15
14
  return `
@@ -19,32 +18,32 @@ class Y extends L {
19
18
  `;
20
19
  }
21
20
  onRender() {
22
- const e = l(this.currentNode);
23
- this.api.setUIEAttribute(c.CURRENCY_LOCATION, N.SELECTPICKER.items, p), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
21
+ const e = C(this.currentNode);
22
+ this.api.setUIEAttribute(c.CURRENCY_LOCATION, R.SELECTPICKER.items, u), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
24
23
  this._onCurrencyLocationChange(t);
25
24
  });
26
25
  }
27
26
  onTemplateNodeUpdated(e) {
28
27
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
29
- const t = l(this.currentNode);
28
+ const t = C(this.currentNode);
30
29
  this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
31
30
  });
32
31
  }
33
32
  _onCurrencyLocationChange(e) {
34
- if (console.debug("Currency location changed to: ", e), O(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
33
+ if (console.debug("Currency location changed to: ", e), I(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
35
34
  return;
36
35
  const t = this._getPriceBlocks();
37
36
  if (!t || t.length === 0)
38
37
  return;
39
- const r = l(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = E(n), s = this.api.getDocumentModifier();
40
- t.forEach((h) => {
41
- const a = this._getParagraph(h);
42
- if (!a)
38
+ const r = C(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = this.api.getDocumentModifier();
39
+ t.forEach((a) => {
40
+ const s = this._getParagraph(a);
41
+ if (!s)
43
42
  return;
44
- const d = a.getInnerHTML().trim() || "", C = a.getInnerText().trim() || "", u = (o == null ? void 0 : o.trim()) || "", _ = this._removeCurrencySymbol(C, u), g = this._detectSymbolInText(C) || u, R = this._buildPriceContent(_, g, n), y = d.replace(C, f(R));
45
- s.modifyHtml(a).setInnerHtml(y).setAttribute(T.POSITION, i);
46
- }), s.apply(new I(
47
- `Updated currency location to ${i}`
43
+ const h = s.getInnerHTML().trim() || "", l = s.getInnerText().trim() || "", p = (o == null ? void 0 : o.trim()) || "", d = this._removeCurrencySymbol(l, p), g = this._detectSymbolInText(l) || p, _ = this._buildPriceContent(d, g, n), y = h.replace(l, T(_));
44
+ i.modifyHtml(s).setInnerHtml(y);
45
+ }), i.apply(new L(
46
+ `Updated currency location to ${n === "1" ? "after" : "before"}`
48
47
  ));
49
48
  }
50
49
  _getPriceBlocks() {
@@ -66,8 +65,8 @@ class Y extends L {
66
65
  } else {
67
66
  const o = r.match(/([^0-9.,\s]+)/);
68
67
  if (o && o[1]) {
69
- const i = o[1].trim(), s = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
70
- n = r.replace(s, "").trim();
68
+ const i = o[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
69
+ n = r.replace(a, "").trim();
71
70
  }
72
71
  }
73
72
  return n;
@@ -86,13 +85,13 @@ class Y extends L {
86
85
  this._GuSelect({
87
86
  name: c.CURRENCY_LOCATION,
88
87
  placeholder: "",
89
- options: p
88
+ options: u
90
89
  })
91
90
  ])}
92
91
  `;
93
92
  }
94
93
  }
95
94
  export {
96
- b as CONTROL_BLOCK_ID,
97
- Y as PriceCurrencyLocationControl
95
+ E as CONTROL_BLOCK_ID,
96
+ A as PriceCurrencyLocationControl
98
97
  };
@@ -1,21 +1,20 @@
1
1
  var R = Object.defineProperty;
2
2
  var N = (s, c, e) => c in s ? R(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
3
3
  var h = (s, c, e) => N(s, typeof c != "symbol" ? c + "" : c, e);
4
- import { ModificationDescription as E } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as B } from "../../../common-control.js";
6
- import { ITEMS_CURRENCY_ATTR as T } from "../../constants/currency.js";
4
+ import { ModificationDescription as B } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
7
6
  import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
8
- import { getItemsBlockConfig as p, setItemsBlockConfig as Y, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
9
- const x = y.PRICE_CURRENCY_SYMBOL, u = {
7
+ import { getItemsBlockConfig as p, setItemsBlockConfig as x, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
8
+ const I = y.PRICE_CURRENCY_SYMBOL, u = {
10
9
  CURRENCY_SYMBOL: "currencySymbol"
11
10
  };
12
- class $ extends B {
11
+ class P extends E {
13
12
  constructor() {
14
13
  super(...arguments);
15
14
  h(this, "originalPriceContents", /* @__PURE__ */ new Map());
16
15
  }
17
16
  getId() {
18
- return x;
17
+ return I;
19
18
  }
20
19
  getTemplate() {
21
20
  return `
@@ -43,7 +42,7 @@ class $ extends B {
43
42
  var a;
44
43
  console.debug("Currency symbol changed to: ", e);
45
44
  const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
46
- if (Y(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
45
+ if (x(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
47
46
  return;
48
47
  const r = this._getPriceBlocks();
49
48
  if (!r || r.length === 0)
@@ -54,8 +53,8 @@ class $ extends B {
54
53
  if (!m)
55
54
  return;
56
55
  const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, f(S));
57
- i.modifyHtml(m).setInnerHtml(b).setAttribute(T.SYMBOL, n);
58
- }), i.apply(new E(
56
+ i.modifyHtml(m).setInnerHtml(b).setAttribute("data-currency_symbol", n);
57
+ }), i.apply(new B(
59
58
  `Updated currency symbol to ${n || "removed"}`
60
59
  ));
61
60
  }
@@ -116,6 +115,6 @@ class $ extends B {
116
115
  }
117
116
  }
118
117
  export {
119
- x as CONTROL_BLOCK_ID,
120
- $ as PriceCurrencySymbolControl
118
+ I as CONTROL_BLOCK_ID,
119
+ P as PriceCurrencySymbolControl
121
120
  };