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

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 (52) hide show
  1. package/README.md +5 -5
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +76 -78
  4. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  5. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  6. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  7. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  8. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
  9. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  10. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  11. package/dist/composables/useHtmlCompiler.js +26 -37
  12. package/dist/composables/useHtmlValidator.js +0 -2
  13. package/dist/composables/useSave.js +41 -84
  14. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  15. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  16. package/dist/extensions/Blocks/Items/block.js +98 -49
  17. package/dist/extensions/Blocks/Items/constants/currency.js +11 -0
  18. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
  19. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
  20. package/dist/extensions/Blocks/Items/template.js +153 -152
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
  22. package/dist/guido.css +1 -1
  23. package/dist/src/components/Guido.vue.d.ts +1 -17
  24. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  25. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  26. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  27. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  28. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  29. package/dist/src/composables/useSave.d.ts +1 -6
  30. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  31. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  32. package/dist/src/extensions/Blocks/Items/block.d.ts +21 -0
  33. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +19 -0
  34. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  35. package/dist/src/stores/config.d.ts +0 -5
  36. package/dist/src/utils/templatePreparation.d.ts +0 -30
  37. package/dist/stores/config.js +6 -13
  38. package/dist/utils/pairProductVariables.js +60 -59
  39. package/dist/utils/templatePreparation.js +25 -28
  40. package/package.json +2 -2
  41. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  42. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  43. package/dist/composables/useSaveValidation.js +0 -279
  44. package/dist/composables/useSaveValidationRollout.js +0 -9
  45. package/dist/enums/save-validation.js +0 -4
  46. package/dist/src/@types/save-validation.d.ts +0 -19
  47. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  48. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  49. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  50. package/dist/src/enums/save-validation.d.ts +0 -27
  51. package/dist/src/stores/save-validation.d.ts +0 -22
  52. package/dist/stores/save-validation.js +0 -30
@@ -1,14 +1,15 @@
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";
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";
4
5
  import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
5
- import { getItemsBlockConfig as C, setItemsBlockConfig as I, escapeReplacement as T } from "../../utils/nodeConfigUtils.js";
6
- const E = m.PRICE_CURRENCY_LOCATION, c = {
6
+ import { getItemsBlockConfig as l, setItemsBlockConfig as O, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
7
+ const b = m.PRICE_CURRENCY_LOCATION, c = {
7
8
  CURRENCY_LOCATION: "currencyLocation"
8
9
  };
9
- class A extends N {
10
+ class Y extends L {
10
11
  getId() {
11
- return E;
12
+ return b;
12
13
  }
13
14
  getTemplate() {
14
15
  return `
@@ -18,32 +19,32 @@ class A extends N {
18
19
  `;
19
20
  }
20
21
  onRender() {
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) => {
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) => {
23
24
  this._onCurrencyLocationChange(t);
24
25
  });
25
26
  }
26
27
  onTemplateNodeUpdated(e) {
27
28
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
- const t = C(this.currentNode);
29
+ const t = l(this.currentNode);
29
30
  this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
30
31
  });
31
32
  }
32
33
  _onCurrencyLocationChange(e) {
33
- if (console.debug("Currency location changed to: ", e), I(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
34
+ if (console.debug("Currency location changed to: ", e), O(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
34
35
  return;
35
36
  const t = this._getPriceBlocks();
36
37
  if (!t || t.length === 0)
37
38
  return;
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)
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)
42
43
  return;
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"}`
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}`
47
48
  ));
48
49
  }
49
50
  _getPriceBlocks() {
@@ -65,8 +66,8 @@ class A extends N {
65
66
  } else {
66
67
  const o = r.match(/([^0-9.,\s]+)/);
67
68
  if (o && o[1]) {
68
- const i = o[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
69
- n = r.replace(a, "").trim();
69
+ const i = o[1].trim(), s = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
70
+ n = r.replace(s, "").trim();
70
71
  }
71
72
  }
72
73
  return n;
@@ -85,13 +86,13 @@ class A extends N {
85
86
  this._GuSelect({
86
87
  name: c.CURRENCY_LOCATION,
87
88
  placeholder: "",
88
- options: u
89
+ options: p
89
90
  })
90
91
  ])}
91
92
  `;
92
93
  }
93
94
  }
94
95
  export {
95
- E as CONTROL_BLOCK_ID,
96
- A as PriceCurrencyLocationControl
96
+ b as CONTROL_BLOCK_ID,
97
+ Y as PriceCurrencyLocationControl
97
98
  };
@@ -1,20 +1,21 @@
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 B } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as E } from "../../../common-control.js";
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";
6
7
  import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
7
- import { getItemsBlockConfig as p, setItemsBlockConfig as x, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
8
- const I = y.PRICE_CURRENCY_SYMBOL, u = {
8
+ import { getItemsBlockConfig as p, setItemsBlockConfig as Y, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
9
+ const x = y.PRICE_CURRENCY_SYMBOL, u = {
9
10
  CURRENCY_SYMBOL: "currencySymbol"
10
11
  };
11
- class P extends E {
12
+ class $ extends B {
12
13
  constructor() {
13
14
  super(...arguments);
14
15
  h(this, "originalPriceContents", /* @__PURE__ */ new Map());
15
16
  }
16
17
  getId() {
17
- return I;
18
+ return x;
18
19
  }
19
20
  getTemplate() {
20
21
  return `
@@ -42,7 +43,7 @@ class P extends E {
42
43
  var a;
43
44
  console.debug("Currency symbol changed to: ", e);
44
45
  const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
45
- if (x(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
46
+ if (Y(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
46
47
  return;
47
48
  const r = this._getPriceBlocks();
48
49
  if (!r || r.length === 0)
@@ -53,8 +54,8 @@ class P extends E {
53
54
  if (!m)
54
55
  return;
55
56
  const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, f(S));
56
- i.modifyHtml(m).setInnerHtml(b).setAttribute("data-currency_symbol", n);
57
- }), i.apply(new B(
57
+ i.modifyHtml(m).setInnerHtml(b).setAttribute(T.SYMBOL, n);
58
+ }), i.apply(new E(
58
59
  `Updated currency symbol to ${n || "removed"}`
59
60
  ));
60
61
  }
@@ -115,6 +116,6 @@ class P extends E {
115
116
  }
116
117
  }
117
118
  export {
118
- I as CONTROL_BLOCK_ID,
119
- P as PriceCurrencySymbolControl
119
+ x as CONTROL_BLOCK_ID,
120
+ $ as PriceCurrencySymbolControl
120
121
  };