@useinsider/guido 2.0.0-beta.fd117e6 → 2.1.0-beta.01eaf27

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 (140) hide show
  1. package/dist/@types/config/schemas.js +17 -17
  2. package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
  3. package/dist/components/organisms/header/LeftSlot.vue2.js +25 -20
  4. package/dist/config/migrator/itemsBlockMigrator.js +140 -123
  5. package/dist/extensions/Blocks/Items/block.js +22 -33
  6. package/dist/extensions/Blocks/Items/controls/button/link.js +19 -31
  7. package/dist/extensions/Blocks/Items/controls/cardComposition.js +110 -85
  8. package/dist/extensions/Blocks/Items/controls/image/link.js +19 -31
  9. package/dist/extensions/Blocks/Items/controls/name/trimming.js +28 -40
  10. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +34 -46
  11. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +45 -50
  12. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -43
  13. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +23 -35
  14. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +45 -57
  15. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -62
  16. package/dist/extensions/Blocks/Items/controls/settingsControl.js +171 -178
  17. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -2
  18. package/dist/extensions/Blocks/Items/template.js +182 -177
  19. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +57 -57
  20. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +153 -69
  21. package/dist/extensions/Blocks/Recommendation/constants.js +9 -1
  22. package/dist/extensions/Blocks/Recommendation/control.js +91 -61
  23. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
  24. package/dist/extensions/Blocks/Recommendation/controls/index.js +245 -0
  25. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
  26. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +71 -0
  27. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +71 -0
  28. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +71 -0
  29. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +71 -0
  30. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
  31. package/dist/extensions/Blocks/Recommendation/extension.js +16 -42
  32. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +117 -72
  33. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +85 -64
  34. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +54 -17
  35. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +74 -45
  36. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +25 -0
  37. package/dist/extensions/Blocks/common-control.js +91 -92
  38. package/dist/guido.css +1 -1
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +39 -44
  40. package/dist/src/@types/config/schemas.d.ts +2 -2
  41. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
  42. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -1
  43. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -1
  44. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -1
  45. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -1
  46. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -1
  47. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
  48. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -1
  49. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -1
  50. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -1
  51. package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -5
  52. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +3 -5
  53. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +50 -3
  54. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +32 -0
  55. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +5 -2
  56. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +25 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +592 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +16 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +15 -0
  60. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +15 -0
  61. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +15 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +15 -0
  63. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +60 -0
  64. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
  65. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +15 -7
  66. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +19 -0
  67. package/dist/src/extensions/Blocks/common-control.d.ts +4 -5
  68. package/dist/static/styles/components/wide-panel.css.js +0 -4
  69. package/dist/static/styles/customEditorStyle.css.js +13 -0
  70. package/package.json +1 -1
  71. package/dist/extensions/Blocks/Items/store/items-block.js +0 -79
  72. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  73. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  74. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  75. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  76. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  77. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  78. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  79. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  80. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  81. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  82. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  83. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  84. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  85. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  86. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  87. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  88. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  89. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  90. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  91. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  92. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  93. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  94. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  95. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  96. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  97. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  98. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  99. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  100. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  101. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  102. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  103. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  104. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  105. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  106. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -45
  107. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  108. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  109. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  110. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  111. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  112. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  113. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  114. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  115. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  116. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  117. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  118. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  119. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  120. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  121. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  122. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  123. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  124. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  125. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  126. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  127. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  128. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  129. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  130. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  131. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  132. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  133. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  134. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  135. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  136. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  137. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  138. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  139. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  140. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
@@ -1,60 +1,48 @@
1
- var y = Object.defineProperty;
2
- var R = (i, o, e) => o in i ? y(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
3
- var p = (i, o, e) => R(i, typeof o != "symbol" ? o + "" : o, e);
4
- import { currencyLocationMaps as m } from "../../../../../enums/extensions/recommendationBlock.js";
5
- import { UEAttr as I, ModificationDescription as N } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
- import { CommonControl as T } from "../../../common-control.js";
7
- import { ItemsBlockControlId as h } from "../../enums/controlEnums.js";
8
- import { useItemsBlockStore as f } from "../../store/items-block.js";
9
- import { getItemsBlockConfig as E, setItemsBlockConfig as O } from "../../utils/nodeConfigUtils.js";
10
- const b = h.PRICE_CURRENCY_LOCATION, a = {
1
+ import { currencyLocationMaps as p } from "../../../../../enums/extensions/recommendationBlock.js";
2
+ import { UEAttr as y, ModificationDescription as R } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { CommonControl as L } from "../../../common-control.js";
4
+ import { ItemsBlockControlId as u } from "../../enums/controlEnums.js";
5
+ import { getItemsBlockConfig as l, setItemsBlockConfig as N, escapeReplacement as I } from "../../utils/nodeConfigUtils.js";
6
+ const T = u.PRICE_CURRENCY_LOCATION, i = {
11
7
  CURRENCY_LOCATION: "currencyLocation"
12
8
  };
13
- class B extends T {
14
- constructor() {
15
- super(...arguments);
16
- p(this, "store", f());
17
- }
9
+ class $ extends L {
18
10
  getId() {
19
- return b;
11
+ return T;
20
12
  }
21
13
  getTemplate() {
22
14
  return `
23
- <div class="container ${h.PRICE_CURRENCY_LOCATION}">
15
+ <div class="container ${u.PRICE_CURRENCY_LOCATION}">
24
16
  ${this._getCurrencyLocation()}
25
17
  </div>
26
18
  `;
27
19
  }
28
20
  onRender() {
29
- this.api.setUIEAttribute(a.CURRENCY_LOCATION, I.SELECTPICKER.items, m), this.api.updateValues({ [a.CURRENCY_LOCATION]: this.store.currencyLocation }), this.api.onValueChanged(a.CURRENCY_LOCATION, (e) => {
30
- this._onCurrencyLocationChange(e);
21
+ const e = l(this.currentNode);
22
+ this.api.setUIEAttribute(i.CURRENCY_LOCATION, y.SELECTPICKER.items, p), this.api.updateValues({ [i.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(i.CURRENCY_LOCATION, (t) => {
23
+ this._onCurrencyLocationChange(t);
31
24
  });
32
25
  }
33
26
  onTemplateNodeUpdated(e) {
34
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
35
- () => {
36
- const t = E(this.currentNode);
37
- t && this.store.setCurrencyLocation(t.priceCurrencyLocation || "0");
38
- },
39
- () => {
40
- this.api.updateValues({ [a.CURRENCY_LOCATION]: this.store.currencyLocation });
41
- }
42
- );
27
+ super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
+ const t = l(this.currentNode);
29
+ this.api.updateValues({ [i.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
30
+ });
43
31
  }
44
32
  _onCurrencyLocationChange(e) {
45
- if (console.debug("Currency location changed to: ", e), this.store.setCurrencyLocation(e), O(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
33
+ if (console.debug("Currency location changed to: ", e), N(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
46
34
  return;
47
35
  const t = this._getPriceBlocks();
48
36
  if (!t || t.length === 0)
49
37
  return;
50
- const r = e || "0", { currencySymbol: n } = this.store;
51
- t.forEach((c) => {
52
- const s = this._getParagraph(c);
53
- if (!s)
38
+ const r = l(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "";
39
+ t.forEach((s) => {
40
+ const c = this._getParagraph(s);
41
+ if (!c)
54
42
  return;
55
- const C = s.getInnerHTML() || "", l = s.getInnerText() || "", u = (n == null ? void 0 : n.trim()) || "", d = this._removeCurrencySymbol(l, u), g = this._detectSymbolInText(l) || u, _ = this._buildPriceContent(d, g, r), L = C.replace(l, _);
56
- this.api.getDocumentModifier().modifyHtml(s).setInnerHtml(L).apply(new N(
57
- `Updated currency location to ${r === "1" ? "after" : "before"}`
43
+ const m = c.getInnerHTML().trim() || "", a = c.getInnerText().trim() || "", C = (o == null ? void 0 : o.trim()) || "", h = this._removeCurrencySymbol(a, C), d = this._detectSymbolInText(a) || C, g = this._buildPriceContent(h, d, n), _ = m.replace(a, I(g));
44
+ this.api.getDocumentModifier().modifyHtml(c).setInnerHtml(_).apply(new R(
45
+ `Updated currency location to ${n === "1" ? "after" : "before"}`
58
46
  ));
59
47
  });
60
48
  }
@@ -72,13 +60,13 @@ class B extends T {
72
60
  const r = e || "";
73
61
  let n = r;
74
62
  if (t) {
75
- const c = new RegExp(`\\s*${this._escapeRegex(t)}\\s*`);
76
- n = r.replace(c, "").trim();
63
+ const o = new RegExp(`\\s*${this._escapeRegex(t)}\\s*`);
64
+ n = r.replace(o, "").trim();
77
65
  } else {
78
- const c = r.match(/([^0-9.,\s]+)/);
79
- if (c && c[1]) {
80
- const s = c[1].trim(), C = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
81
- n = r.replace(C, "").trim();
66
+ const o = r.match(/([^0-9.,\s]+)/);
67
+ if (o && o[1]) {
68
+ const s = o[1].trim(), c = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
69
+ n = r.replace(c, "").trim();
82
70
  }
83
71
  }
84
72
  return n;
@@ -95,15 +83,15 @@ class B extends T {
95
83
  ${this._GuTwoColumns([
96
84
  this._GuLabel({ text: "Currency Location" }),
97
85
  this._GuSelect({
98
- name: a.CURRENCY_LOCATION,
86
+ name: i.CURRENCY_LOCATION,
99
87
  placeholder: "",
100
- options: m
88
+ options: p
101
89
  })
102
90
  ])}
103
91
  `;
104
92
  }
105
93
  }
106
94
  export {
107
- b as CONTROL_BLOCK_ID,
108
- B as PriceCurrencyLocationControl
95
+ T as CONTROL_BLOCK_ID,
96
+ $ as PriceCurrencyLocationControl
109
97
  };
@@ -1,80 +1,75 @@
1
- var S = Object.defineProperty;
2
- var _ = (c, s, e) => s in c ? S(c, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[s] = e;
3
- var u = (c, s, e) => _(c, typeof s != "symbol" ? s + "" : s, e);
4
- import { ModificationDescription as b } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as R } from "../../../common-control.js";
6
- import { ItemsBlockControlId as h } from "../../enums/controlEnums.js";
7
- import { useItemsBlockStore as f } from "../../store/items-block.js";
8
- import { getItemsBlockConfig as B, setItemsBlockConfig as N } from "../../utils/nodeConfigUtils.js";
9
- const E = h.PRICE_CURRENCY_SYMBOL, m = {
1
+ var b = Object.defineProperty;
2
+ var R = (s, c, e) => c in s ? b(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
3
+ var h = (s, c, e) => R(s, typeof c != "symbol" ? c + "" : c, e);
4
+ import { ModificationDescription as N } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as B } from "../../../common-control.js";
6
+ import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
7
+ import { getItemsBlockConfig as m, setItemsBlockConfig as E, escapeReplacement as x } from "../../utils/nodeConfigUtils.js";
8
+ const I = y.PRICE_CURRENCY_SYMBOL, p = {
10
9
  CURRENCY_SYMBOL: "currencySymbol"
11
10
  };
12
- class M extends R {
11
+ class O extends B {
13
12
  constructor() {
14
13
  super(...arguments);
15
- u(this, "store", f());
16
- u(this, "originalPriceContents", /* @__PURE__ */ new Map());
14
+ h(this, "originalPriceContents", /* @__PURE__ */ new Map());
17
15
  }
18
16
  getId() {
19
- return E;
17
+ return I;
20
18
  }
21
19
  getTemplate() {
22
20
  return `
23
- <div class="container ${h.PRICE_CURRENCY_SYMBOL}">
21
+ <div class="container ${y.PRICE_CURRENCY_SYMBOL}">
24
22
  ${this._getCurrencySymbol()}
25
23
  </div>
26
24
  `;
27
25
  }
28
26
  onRender() {
29
- this.api.updateValues({ [m.CURRENCY_SYMBOL]: this.store.currencySymbol }), this._storeOriginalContents(), this.api.onValueChanged(m.CURRENCY_SYMBOL, (e) => {
30
- this._onCurrencySymbolChange(e);
27
+ const e = m(this.currentNode);
28
+ this.api.updateValues({ [p.CURRENCY_SYMBOL]: (e == null ? void 0 : e.priceCurrencySymbol) ?? "" }), this._storeOriginalContents(), this.api.onValueChanged(p.CURRENCY_SYMBOL, (t) => {
29
+ this._onCurrencySymbolChange(t);
31
30
  });
32
31
  }
33
32
  onDestroy() {
34
33
  super.onDestroy(), this.originalPriceContents.clear();
35
34
  }
36
35
  onTemplateNodeUpdated(e) {
37
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
38
- () => {
39
- const t = B(this.currentNode);
40
- t && this.store.setCurrencySymbol(t.priceCurrencySymbol || "");
41
- },
42
- () => {
43
- this.api.updateValues({ [m.CURRENCY_SYMBOL]: this.store.currencySymbol }), this._storeOriginalContents();
44
- }
45
- );
36
+ super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
37
+ const t = m(this.currentNode);
38
+ this.api.updateValues({ [p.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
39
+ });
46
40
  }
47
41
  _onCurrencySymbolChange(e) {
48
42
  var i;
49
43
  console.debug("Currency symbol changed to: ", e);
50
- const t = ((i = this.store.currencySymbol) == null ? void 0 : i.trim()) || "";
51
- if (this.store.setCurrencySymbol(e), N(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
44
+ const t = m(this.currentNode), o = ((i = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : i.trim()) || "";
45
+ if (E(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
52
46
  return;
53
47
  const r = this._getPriceBlocks();
54
48
  if (!r || r.length === 0)
55
49
  return;
56
- const o = (e == null ? void 0 : e.trim()) || "", { currencyLocation: n } = this.store;
57
- r.forEach((l) => {
58
- const a = this._getParagraph(l);
50
+ const n = (e == null ? void 0 : e.trim()) || "", l = (t == null ? void 0 : t.priceCurrencyLocation) ?? "0";
51
+ r.forEach((u) => {
52
+ const a = this._getParagraph(u);
59
53
  if (!a)
60
54
  return;
61
- const y = a.getInnerHTML() || "", p = a.getInnerText() || "", C = this._removeCurrencySymbol(p, t), g = this._buildPriceContent(C, o, n), d = y.replace(p, g);
62
- this.api.getDocumentModifier().modifyHtml(a).setInnerHtml(d).apply(new b(
63
- `Updated currency symbol to ${o || "removed"}`
55
+ const d = a.getInnerHTML().trim() || "", C = a.getInnerText().trim() || "", g = this._removeCurrencySymbol(C, o), _ = this._buildPriceContent(g, n, l), S = d.replace(C, x(_));
56
+ this.api.getDocumentModifier().modifyHtml(a).setInnerHtml(S).apply(new N(
57
+ `Updated currency symbol to ${n || "removed"}`
64
58
  ));
65
59
  });
66
60
  }
67
61
  _storeOriginalContents() {
68
62
  if (!this.currentNode)
69
63
  return;
64
+ const e = m(this.currentNode);
70
65
  this.currentNode.querySelectorAll(
71
66
  ".items-block-price"
72
- ).forEach((t) => {
73
- var o;
74
- const r = t.querySelector("p");
67
+ ).forEach((o) => {
68
+ var n;
69
+ const r = o.querySelector("p");
75
70
  if (r && !this.originalPriceContents.has(r)) {
76
- const n = r.getInnerText() || "", i = ((o = this.store.currencySymbol) == null ? void 0 : o.trim()) || "", l = this._removeCurrencySymbol(n, i);
77
- this.originalPriceContents.set(r, l);
71
+ const l = r.getInnerText() || "", i = ((n = e == null ? void 0 : e.priceCurrencySymbol) == null ? void 0 : n.trim()) || "", u = this._removeCurrencySymbol(l, i);
72
+ this.originalPriceContents.set(r, u);
78
73
  }
79
74
  });
80
75
  }
@@ -89,29 +84,29 @@ class M extends R {
89
84
  return e.replace(/[-\\^$*+?().|[\]{}]/g, "\\$&");
90
85
  }
91
86
  _removeCurrencySymbol(e, t) {
92
- const r = e || "";
93
- let o = r;
87
+ const o = e || "";
88
+ let r = o;
94
89
  if (t) {
95
90
  const n = new RegExp(`\\s*${this._escapeRegex(t)}\\s*`);
96
- o = r.replace(n, "").trim();
91
+ r = o.replace(n, "").trim();
97
92
  } else {
98
- const n = r.match(/([^0-9.,\s]+)/);
93
+ const n = o.match(/([^0-9.,\s]+)/);
99
94
  if (n && n[1]) {
100
- const i = n[1].trim(), l = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
101
- o = r.replace(l, "").trim();
95
+ const l = n[1].trim(), i = new RegExp(`\\s*${this._escapeRegex(l)}\\s*`);
96
+ r = o.replace(i, "").trim();
102
97
  }
103
98
  }
104
- return o;
99
+ return r;
105
100
  }
106
- _buildPriceContent(e, t, r) {
107
- return t ? r === "1" ? `${e}&nbsp;${t}` : `${t}&nbsp;${e}` : e;
101
+ _buildPriceContent(e, t, o) {
102
+ return t ? o === "1" ? `${e}&nbsp;${t}` : `${t}&nbsp;${e}` : e;
108
103
  }
109
104
  _getCurrencySymbol() {
110
105
  return `
111
106
  ${this._GuTwoColumns([
112
107
  this._GuLabel({ text: "Currency Symbol" }),
113
108
  this._GuTextInput({
114
- name: m.CURRENCY_SYMBOL,
109
+ name: p.CURRENCY_SYMBOL,
115
110
  placeholder: "Enter Currency Symbol",
116
111
  className: "es-180w"
117
112
  })
@@ -120,6 +115,6 @@ class M extends R {
120
115
  }
121
116
  }
122
117
  export {
123
- E as CONTROL_BLOCK_ID,
124
- M as PriceCurrencySymbolControl
118
+ I as CONTROL_BLOCK_ID,
119
+ O as PriceCurrencySymbolControl
125
120
  };
@@ -1,22 +1,14 @@
1
- var R = Object.defineProperty;
2
- var _ = (i, t, e) => t in i ? R(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var m = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { ModificationDescription as F, UIElementType as P, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as h } from "../../../common-control.js";
6
- import { ItemsBlockControlId as p, ItemsBlockId as g } from "../../enums/controlEnums.js";
7
- import { productPairs as T } from "../../enums/productEnums.js";
8
- import { useItemsBlockStore as A } from "../../store/items-block.js";
9
- import { getItemsBlockConfig as f, setItemsBlockConfig as u } from "../../utils/nodeConfigUtils.js";
10
- const D = p.PRICE_FORMATTED_PRICE, n = {
1
+ import { ModificationDescription as A, UIElementType as P, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as L } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as p, ItemsBlockId as _ } from "../../enums/controlEnums.js";
4
+ import { productPairs as I } from "../../enums/productEnums.js";
5
+ import { getItemsBlockConfig as d, setItemsBlockConfig as D, escapeReplacement as h } from "../../utils/nodeConfigUtils.js";
6
+ const g = p.PRICE_FORMATTED_PRICE, s = {
11
7
  FORMATTED_PRICE: "formattedPrice"
12
8
  };
13
- class k extends h {
14
- constructor() {
15
- super(...arguments);
16
- m(this, "store", A());
17
- }
9
+ class $ extends L {
18
10
  getId() {
19
- return D;
11
+ return g;
20
12
  }
21
13
  getTemplate() {
22
14
  return `
@@ -26,37 +18,40 @@ class k extends h {
26
18
  `;
27
19
  }
28
20
  onRender() {
29
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (e) => {
30
- this._onFormattedPriceChange(e);
21
+ const e = d(this.currentNode);
22
+ this.api.updateValues({ [s.FORMATTED_PRICE]: (e == null ? void 0 : e.priceFormatted) ?? !0 }), this.api.onValueChanged(s.FORMATTED_PRICE, (t) => {
23
+ this._onFormattedPriceChange(t);
31
24
  });
32
25
  }
33
26
  onTemplateNodeUpdated(e) {
34
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
35
- () => {
36
- const r = f(this.currentNode);
37
- r && this.store.setFormattedPrice(r.priceFormatted ?? !0);
38
- },
39
- () => {
40
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
41
- }
42
- );
27
+ super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
+ const t = d(this.currentNode);
29
+ this.api.updateValues({ [s.FORMATTED_PRICE]: (t == null ? void 0 : t.priceFormatted) ?? !0 });
30
+ });
43
31
  }
44
32
  _onFormattedPriceChange(e) {
45
- if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), u(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
33
+ if (console.debug("Formatted price changed to: ", e), D(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
46
34
  return;
47
- const { itemsType: r } = this.store, o = T.PAIRS_FOR_EXTENSION.price[r], s = T.PAIRS_FOR_EXTENSION.originalPrice[r], [c, a] = e ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE], [l, I] = e ? [s.DEFAULT_PRICE, s.DEFAULT_PRICE_FORMATTED] : [s.DEFAULT_PRICE_FORMATTED, s.DEFAULT_PRICE];
48
- this._updatePriceBlock(
49
- this.currentNode,
50
- c,
51
- a,
52
- "price"
53
- );
54
- const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${g.ORIGINAL_PRICE}"]`);
55
- E && this._updatePriceBlock(E, l, I, "original price");
35
+ const t = d(this.currentNode), n = (t == null ? void 0 : t.type) ?? "CART_ITEMS", i = (t == null ? void 0 : t.priceSinglePrice) ?? !1, r = I.PAIRS_FOR_EXTENSION.price[n], o = I.PAIRS_FOR_EXTENSION.originalPrice[n], [E, R] = e ? [
36
+ i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE,
37
+ i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED
38
+ ] : [
39
+ i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED,
40
+ i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE
41
+ ], l = i ? o.DEFAULT_SINGLE_PRICE : o.DEFAULT_PRICE, T = i ? o.DEFAULT_SINGLE_PRICE_FORMATTED : o.DEFAULT_PRICE_FORMATTED, [m, F] = e ? [l, T] : [T, l], c = this.currentNode.closest(".items-block");
42
+ ((c == null ? void 0 : c.querySelectorAll(
43
+ `[esd-extension-block-id="${_.PRICE}"]`
44
+ )) || []).forEach((a) => {
45
+ this._updatePriceBlock(a, E, R, e, "price");
46
+ }), ((c == null ? void 0 : c.querySelectorAll(
47
+ `[esd-extension-block-id="${_.ORIGINAL_PRICE}"]`
48
+ )) || []).forEach((a) => {
49
+ this._updatePriceBlock(a, m, F, e, "original price");
50
+ });
56
51
  }
57
- _updatePriceBlock(e, r, o, s) {
58
- const c = e.getInnerHTML().replace(r, o), a = `Updated ${s} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
59
- this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(c).apply(new F(a));
52
+ _updatePriceBlock(e, t, n, i, r) {
53
+ const o = e.getInnerHTML().trim().replace(t, h(n)), E = `Updated ${r} to ${i ? "formatted" : "unformatted"}`;
54
+ this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(o).apply(new A(E));
60
55
  }
61
56
  _getFormattedPrice() {
62
57
  return `
@@ -65,12 +60,12 @@ class k extends h {
65
60
  ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
66
61
  >
67
62
  </${P.LABEL}>
68
- ${this._GuToggle(n.FORMATTED_PRICE)}
63
+ ${this._GuToggle(s.FORMATTED_PRICE)}
69
64
  </div>
70
65
  `;
71
66
  }
72
67
  }
73
68
  export {
74
- D as CONTROL_BLOCK_ID,
75
- k as PriceFormattedPriceControl
69
+ g as CONTROL_BLOCK_ID,
70
+ $ as PriceFormattedPriceControl
76
71
  };
@@ -1,63 +1,51 @@
1
- var c = Object.defineProperty;
2
- var a = (i, e, t) => e in i ? c(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var n = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { UIElementType as r, UEAttr as D } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as u } from "../../../common-control.js";
6
- import { ItemsBlockControlId as d } from "../../enums/controlEnums.js";
7
- import { useItemsBlockStore as I } from "../../store/items-block.js";
8
- import { getItemsBlockConfig as p, setItemsBlockConfig as h } from "../../utils/nodeConfigUtils.js";
9
- const l = d.PRICE_HIDE_DISCOUNT, s = {
1
+ import { UIElementType as o, UEAttr as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as r } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as n } from "../../enums/controlEnums.js";
4
+ import { getItemsBlockConfig as s, setItemsBlockConfig as a } from "../../utils/nodeConfigUtils.js";
5
+ const c = n.PRICE_HIDE_DISCOUNT, i = {
10
6
  HIDE_DISCOUNT: "hideDiscount"
11
7
  };
12
- class T extends u {
13
- constructor() {
14
- super(...arguments);
15
- n(this, "store", I());
16
- }
8
+ class C extends r {
17
9
  getId() {
18
- return l;
10
+ return c;
19
11
  }
20
12
  getTemplate() {
21
13
  return `
22
- <div class="container ${d.PRICE_HIDE_DISCOUNT}">
14
+ <div class="container ${n.PRICE_HIDE_DISCOUNT}">
23
15
  ${this._getHideDiscount()}
24
16
  </div>
25
17
  `;
26
18
  }
27
19
  onRender() {
28
- this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount }), this.api.onValueChanged(s.HIDE_DISCOUNT, (t) => {
20
+ const e = s(this.currentNode);
21
+ this.api.updateValues({ [i.HIDE_DISCOUNT]: (e == null ? void 0 : e.priceHideDiscount) ?? !0 }), this.api.onValueChanged(i.HIDE_DISCOUNT, (t) => {
29
22
  this._onHideDiscountChange(t);
30
23
  });
31
24
  }
32
- onTemplateNodeUpdated(t) {
33
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
34
- () => {
35
- const o = p(this.currentNode);
36
- o && this.store.setHideDiscount(o.priceHideDiscount ?? !0);
37
- },
38
- () => {
39
- this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount });
40
- }
41
- );
25
+ onTemplateNodeUpdated(e) {
26
+ super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
27
+ const t = s(this.currentNode);
28
+ this.api.updateValues({ [i.HIDE_DISCOUNT]: (t == null ? void 0 : t.priceHideDiscount) ?? !0 });
29
+ });
42
30
  }
43
- _onHideDiscountChange(t) {
44
- this.store.setHideDiscount(t), h(this.currentNode, this.api, { priceHideDiscount: t }), this.api.updateValues({ [s.HIDE_DISCOUNT]: t });
31
+ _onHideDiscountChange(e) {
32
+ a(this.currentNode, this.api, { priceHideDiscount: e }), this.api.updateValues({ [i.HIDE_DISCOUNT]: e });
45
33
  }
46
34
  _getHideDiscount() {
47
35
  return `
48
36
 
49
37
  <div class="display-flex align-items-center justify-content-between">
50
- <${r.LABEL}
51
- ${D.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
38
+ <${o.LABEL}
39
+ ${d.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
52
40
  >
53
- </${r.LABEL}>
54
- ${this._GuToggle(s.HIDE_DISCOUNT)}
41
+ </${o.LABEL}>
42
+ ${this._GuToggle(i.HIDE_DISCOUNT)}
55
43
  </div>
56
44
  </div>
57
45
  `;
58
46
  }
59
47
  }
60
48
  export {
61
- l as CONTROL_BLOCK_ID,
62
- T as PriceHideDiscountControl
49
+ c as CONTROL_BLOCK_ID,
50
+ C as PriceHideDiscountControl
63
51
  };
@@ -1,94 +1,82 @@
1
- var I = Object.defineProperty;
2
- var f = (n, o, t) => o in n ? I(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
- var m = (n, o, t) => f(n, typeof o != "symbol" ? o + "" : o, t);
4
- import { ModificationDescription as u } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as y } from "../../../common-control.js";
6
- import { ItemsBlockControlId as O } from "../../enums/controlEnums.js";
7
- import { SETTINGS_ENUMS as E } from "../../enums/settingsEnums.js";
8
- import { useItemsBlockStore as N } from "../../store/items-block.js";
9
- import { getItemsBlockConfig as T, setItemsBlockConfig as C } from "../../utils/nodeConfigUtils.js";
10
- const _ = O.PRICE_ORIENTATION, p = {
1
+ import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as O } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
4
+ import { SETTINGS_ENUMS as h } from "../../enums/settingsEnums.js";
5
+ import { getItemsBlockConfig as u, setItemsBlockConfig as I } from "../../utils/nodeConfigUtils.js";
6
+ const N = m.PRICE_ORIENTATION, c = {
11
7
  PRICE_ORIENTATION: "priceOrientation"
12
- }, P = [
8
+ }, y = [
13
9
  { icon: "vertical-orientation", value: "vertical" },
14
10
  { icon: "horizontal-orientation", value: "horizontal" }
15
11
  ];
16
- class H extends y {
17
- constructor() {
18
- super(...arguments);
19
- m(this, "store", N());
20
- }
12
+ class P extends O {
21
13
  getId() {
22
- return _;
14
+ return N;
23
15
  }
24
16
  getTemplate() {
25
17
  return `
26
- <div class="container ${O.PRICE_ORIENTATION}">
18
+ <div class="container ${m.PRICE_ORIENTATION}">
27
19
  ${this._getPriceOrientation()}
28
20
  </div>
29
21
  `;
30
22
  }
31
23
  onRender() {
32
- this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation }), this.api.onValueChanged(p.PRICE_ORIENTATION, (t) => {
24
+ const i = u(this.currentNode);
25
+ this.api.updateValues({ [c.PRICE_ORIENTATION]: (i == null ? void 0 : i.priceOrientation) ?? "horizontal" }), this.api.onValueChanged(c.PRICE_ORIENTATION, (t) => {
33
26
  typeof t == "string" && this._onPriceOrientationChange(t);
34
27
  });
35
28
  }
36
- onTemplateNodeUpdated(t) {
37
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
38
- () => {
39
- const i = T(this.currentNode);
40
- i && this.store.setPriceOrientation(i.priceOrientation || "horizontal");
41
- },
42
- () => {
43
- this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation });
44
- }
45
- );
29
+ onTemplateNodeUpdated(i) {
30
+ super.onTemplateNodeUpdated(i), this.handleBlockInstanceChange(() => {
31
+ const t = u(this.currentNode);
32
+ this.api.updateValues({ [c.PRICE_ORIENTATION]: (t == null ? void 0 : t.priceOrientation) ?? "horizontal" });
33
+ });
46
34
  }
47
- _onPriceOrientationChange(t) {
48
- if (this.store.setPriceOrientation(t), C(this.currentNode, this.api, {
49
- priceOrientation: t
35
+ _onPriceOrientationChange(i) {
36
+ if (I(this.currentNode, this.api, {
37
+ priceOrientation: i
50
38
  }), !this.currentNode)
51
39
  return;
52
- const { orientation: i } = this.store, r = i === E.ORIENTATION.VERTICAL, e = t === "horizontal";
53
- r ? this._updateVerticalLayout(e) : this._updateHorizontalLayout(e);
40
+ const t = u(this.currentNode), e = ((t == null ? void 0 : t.orientation) ?? h.ORIENTATION.VERTICAL) === h.ORIENTATION.VERTICAL, o = i === "horizontal";
41
+ e ? this._updateVerticalLayout(o) : this._updateHorizontalLayout(o);
54
42
  }
55
- _updateVerticalLayout(t) {
56
- var c, l, d, a;
57
- const i = ((l = (c = this.currentNode) == null ? void 0 : c.closest(".ins-product-td")) == null ? void 0 : l.querySelectorAll(".product-price-class")) || [], r = ((a = (d = this.currentNode) == null ? void 0 : d.closest(".ins-product-td")) == null ? void 0 : a.querySelectorAll(".product-original-price-class")) || [];
58
- if (!i || !r)
43
+ _updateVerticalLayout(i) {
44
+ var a, s, l, n;
45
+ const t = ((s = (a = this.currentNode) == null ? void 0 : a.closest(".ins-product-td")) == null ? void 0 : s.querySelectorAll(".product-price-class")) || [], r = ((n = (l = this.currentNode) == null ? void 0 : l.closest(".ins-product-td")) == null ? void 0 : n.querySelectorAll(".product-original-price-class")) || [];
46
+ if (!t || !r)
59
47
  return;
60
- const e = t ? "50%" : "100%", s = this.api.getDocumentModifier();
61
- i.forEach((h) => {
62
- s.modifyHtml(h).setAttribute("width", e).setStyle("width", e);
63
- }), r.forEach((h) => {
64
- s.modifyHtml(h).setAttribute("width", e).setStyle("width", e);
65
- }), s.apply(new u(`Updated original price element width to ${e}`));
48
+ const e = i ? "50%" : "100%", o = this.api.getDocumentModifier();
49
+ t.forEach((d) => {
50
+ o.modifyHtml(d).setAttribute("width", e).setStyle("width", e);
51
+ }), r.forEach((d) => {
52
+ o.modifyHtml(d).setAttribute("width", e).setStyle("width", e);
53
+ }), o.apply(new p(`Updated original price element width to ${e}`));
66
54
  }
67
- _updateHorizontalLayout(t) {
68
- var s, c, l, d;
69
- const i = ((c = (s = this.currentNode) == null ? void 0 : s.closest(".ins-product-td")) == null ? void 0 : c.querySelectorAll(".horizontal-price")) || [], r = (d = (l = this.currentNode) == null ? void 0 : l.closest(".ins-product-td")) == null ? void 0 : d.querySelector(".vertical-price");
70
- if (!i || !r || i.length === 0)
55
+ _updateHorizontalLayout(i) {
56
+ var o, a, s, l;
57
+ const t = ((a = (o = this.currentNode) == null ? void 0 : o.closest(".ins-product-td")) == null ? void 0 : a.querySelectorAll(".horizontal-price")) || [], r = (l = (s = this.currentNode) == null ? void 0 : s.closest(".ins-product-td")) == null ? void 0 : l.querySelector(".vertical-price");
58
+ if (!t || !r || t.length === 0)
71
59
  return;
72
60
  const e = this.api.getDocumentModifier();
73
- t ? (i.forEach((a) => {
74
- e.modifyHtml(a).setStyle("display", "table-cell");
75
- }), e.modifyHtml(r).setStyle("display", "none"), e.apply(new u("Show horizontal price orientation"))) : (i.forEach((a) => {
76
- e.modifyHtml(a).setStyle("display", "none");
77
- }), e.modifyHtml(r).setStyle("display", "table-cell"), e.apply(new u("Show vertical price orientation")));
61
+ i ? (t.forEach((n) => {
62
+ e.modifyHtml(n).setStyle("display", "table-cell");
63
+ }), e.modifyHtml(r).setStyle("display", "none"), e.apply(new p("Show horizontal price orientation"))) : (t.forEach((n) => {
64
+ e.modifyHtml(n).setStyle("display", "none");
65
+ }), e.modifyHtml(r).setStyle("display", "table-cell"), e.apply(new p("Show vertical price orientation")));
78
66
  }
79
67
  _getPriceOrientation() {
80
68
  return `
81
69
  ${this._GuTwoColumns([
82
70
  this._GuLabel({ text: "Price Orientation" }),
83
71
  this._GuRadioButton({
84
- name: p.PRICE_ORIENTATION,
85
- buttons: P
72
+ name: c.PRICE_ORIENTATION,
73
+ buttons: y
86
74
  })
87
75
  ])}
88
76
  `;
89
77
  }
90
78
  }
91
79
  export {
92
- _ as CONTROL_BLOCK_ID,
93
- H as PriceOrientationControl
80
+ N as CONTROL_BLOCK_ID,
81
+ P as PriceOrientationControl
94
82
  };