@useinsider/guido 2.1.0-beta.13ada05 → 2.1.0-beta.1d0cd94

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.
@@ -1,50 +1,50 @@
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";
4
- 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 = {
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 = {
7
7
  CURRENCY_LOCATION: "currencyLocation"
8
8
  };
9
- class A extends N {
9
+ class $ extends L {
10
10
  getId() {
11
- return E;
11
+ return T;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
- <div class="container ${m.PRICE_CURRENCY_LOCATION}">
15
+ <div class="container ${u.PRICE_CURRENCY_LOCATION}">
16
16
  ${this._getCurrencyLocation()}
17
17
  </div>
18
18
  `;
19
19
  }
20
20
  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) => {
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
23
  this._onCurrencyLocationChange(t);
24
24
  });
25
25
  }
26
26
  onTemplateNodeUpdated(e) {
27
27
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
- const t = C(this.currentNode);
29
- this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
28
+ const t = l(this.currentNode);
29
+ this.api.updateValues({ [i.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
30
30
  });
31
31
  }
32
32
  _onCurrencyLocationChange(e) {
33
- if (console.debug("Currency location changed to: ", e), I(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)
34
34
  return;
35
35
  const t = this._getPriceBlocks();
36
36
  if (!t || t.length === 0)
37
37
  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)
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)
42
42
  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"}`
47
- ));
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"}`
46
+ ));
47
+ });
48
48
  }
49
49
  _getPriceBlocks() {
50
50
  var e, t;
@@ -65,8 +65,8 @@ class A extends N {
65
65
  } else {
66
66
  const o = r.match(/([^0-9.,\s]+)/);
67
67
  if (o && o[1]) {
68
- const i = o[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
69
- n = r.replace(a, "").trim();
68
+ const s = o[1].trim(), c = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
69
+ n = r.replace(c, "").trim();
70
70
  }
71
71
  }
72
72
  return n;
@@ -83,15 +83,15 @@ class A extends N {
83
83
  ${this._GuTwoColumns([
84
84
  this._GuLabel({ text: "Currency Location" }),
85
85
  this._GuSelect({
86
- name: c.CURRENCY_LOCATION,
86
+ name: i.CURRENCY_LOCATION,
87
87
  placeholder: "",
88
- options: u
88
+ options: p
89
89
  })
90
90
  ])}
91
91
  `;
92
92
  }
93
93
  }
94
94
  export {
95
- E as CONTROL_BLOCK_ID,
96
- A as PriceCurrencyLocationControl
95
+ T as CONTROL_BLOCK_ID,
96
+ $ as PriceCurrencyLocationControl
97
97
  };
@@ -1,14 +1,14 @@
1
- var R = Object.defineProperty;
2
- var N = (s, c, e) => c in s ? R(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
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";
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
6
  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 = {
7
+ import { getItemsBlockConfig as m, setItemsBlockConfig as E, escapeReplacement as x } from "../../utils/nodeConfigUtils.js";
8
+ const I = y.PRICE_CURRENCY_SYMBOL, p = {
9
9
  CURRENCY_SYMBOL: "currencySymbol"
10
10
  };
11
- class P extends E {
11
+ class O extends B {
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  h(this, "originalPriceContents", /* @__PURE__ */ new Map());
@@ -24,8 +24,8 @@ class P extends E {
24
24
  `;
25
25
  }
26
26
  onRender() {
27
- const e = p(this.currentNode);
28
- this.api.updateValues({ [u.CURRENCY_SYMBOL]: (e == null ? void 0 : e.priceCurrencySymbol) ?? "" }), this._storeOriginalContents(), this.api.onValueChanged(u.CURRENCY_SYMBOL, (t) => {
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
29
  this._onCurrencySymbolChange(t);
30
30
  });
31
31
  }
@@ -34,42 +34,42 @@ class P extends E {
34
34
  }
35
35
  onTemplateNodeUpdated(e) {
36
36
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
37
- const t = p(this.currentNode);
38
- this.api.updateValues({ [u.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
37
+ const t = m(this.currentNode);
38
+ this.api.updateValues({ [p.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
39
39
  });
40
40
  }
41
41
  _onCurrencySymbolChange(e) {
42
- var a;
42
+ var i;
43
43
  console.debug("Currency symbol changed to: ", e);
44
- 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)
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)
46
46
  return;
47
47
  const r = this._getPriceBlocks();
48
48
  if (!r || r.length === 0)
49
49
  return;
50
- const n = (e == null ? void 0 : e.trim()) || "", l = (t == null ? void 0 : t.priceCurrencyLocation) ?? "0", i = this.api.getDocumentModifier();
51
- r.forEach((d) => {
52
- const m = this._getParagraph(d);
53
- if (!m)
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);
53
+ if (!a)
54
54
  return;
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));
56
- i.modifyHtml(m).setInnerHtml(b);
57
- }), i.apply(new B(
58
- `Updated currency symbol to ${n || "removed"}`
59
- ));
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"}`
58
+ ));
59
+ });
60
60
  }
61
61
  _storeOriginalContents() {
62
62
  if (!this.currentNode)
63
63
  return;
64
- const e = p(this.currentNode);
64
+ const e = m(this.currentNode);
65
65
  this.currentNode.querySelectorAll(
66
66
  ".items-block-price"
67
67
  ).forEach((o) => {
68
68
  var n;
69
69
  const r = o.querySelector("p");
70
70
  if (r && !this.originalPriceContents.has(r)) {
71
- const l = r.getInnerText() || "", i = ((n = e == null ? void 0 : e.priceCurrencySymbol) == null ? void 0 : n.trim()) || "", a = this._removeCurrencySymbol(l, i);
72
- this.originalPriceContents.set(r, a);
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);
73
73
  }
74
74
  });
75
75
  }
@@ -106,7 +106,7 @@ class P extends E {
106
106
  ${this._GuTwoColumns([
107
107
  this._GuLabel({ text: "Currency Symbol" }),
108
108
  this._GuTextInput({
109
- name: u.CURRENCY_SYMBOL,
109
+ name: p.CURRENCY_SYMBOL,
110
110
  placeholder: "Enter Currency Symbol",
111
111
  className: "es-180w"
112
112
  })
@@ -116,5 +116,5 @@ class P extends E {
116
116
  }
117
117
  export {
118
118
  I as CONTROL_BLOCK_ID,
119
- P as PriceCurrencySymbolControl
119
+ O as PriceCurrencySymbolControl
120
120
  };
@@ -1,65 +1,63 @@
1
- import { ModificationDescription as L, UIElementType as P, UEAttr as D } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as h } from "../../../common-control.js";
3
- import { ItemsBlockControlId as R, ItemsBlockId as _ } from "../../enums/controlEnums.js";
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
4
  import { productPairs as I } from "../../enums/productEnums.js";
5
- import { getItemsBlockConfig as d, setItemsBlockConfig as u, escapeReplacement as O } from "../../utils/nodeConfigUtils.js";
6
- const g = R.PRICE_FORMATTED_PRICE, s = {
5
+ import { getItemsBlockConfig as d, setItemsBlockConfig as D, escapeReplacement as h } from "../../utils/nodeConfigUtils.js";
6
+ const g = p.PRICE_FORMATTED_PRICE, s = {
7
7
  FORMATTED_PRICE: "formattedPrice"
8
8
  };
9
- class k extends h {
9
+ class $ extends L {
10
10
  getId() {
11
11
  return g;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
- <div class="container ${R.PRICE_FORMATTED_PRICE}">
15
+ <div class="container ${p.PRICE_FORMATTED_PRICE}">
16
16
  ${this._getFormattedPrice()}
17
17
  </div>
18
18
  `;
19
19
  }
20
20
  onRender() {
21
- const t = d(this.currentNode);
22
- this.api.updateValues({ [s.FORMATTED_PRICE]: (t == null ? void 0 : t.priceFormatted) ?? !0 }), this.api.onValueChanged(s.FORMATTED_PRICE, (e) => {
23
- 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);
24
24
  });
25
25
  }
26
- onTemplateNodeUpdated(t) {
27
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(() => {
28
- const e = d(this.currentNode);
29
- this.api.updateValues({ [s.FORMATTED_PRICE]: (e == null ? void 0 : e.priceFormatted) ?? !0 });
26
+ onTemplateNodeUpdated(e) {
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
30
  });
31
31
  }
32
- _onFormattedPriceChange(t) {
33
- if (console.debug("Formatted price changed to: ", t), u(this.currentNode, this.api, { priceFormatted: t }), !this.currentNode)
32
+ _onFormattedPriceChange(e) {
33
+ if (console.debug("Formatted price changed to: ", e), D(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
34
34
  return;
35
- const e = d(this.currentNode), n = (e == null ? void 0 : e.type) ?? "CART_ITEMS", i = (e == null ? void 0 : e.priceSinglePrice) ?? !1, r = I.PAIRS_FOR_EXTENSION.price[n], c = I.PAIRS_FOR_EXTENSION.originalPrice[n], [p, m] = t ? [
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
36
  i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE,
37
37
  i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED
38
38
  ] : [
39
39
  i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED,
40
40
  i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE
41
- ], l = i ? c.DEFAULT_SINGLE_PRICE : c.DEFAULT_PRICE, T = i ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_PRICE_FORMATTED, [F, A] = t ? [l, T] : [T, l], o = this.currentNode.closest(".items-block"), C = (o == null ? void 0 : o.querySelectorAll(
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(
42
43
  `[esd-extension-block-id="${_.PRICE}"]`
43
- )) || [], E = this.api.getDocumentModifier();
44
- C.forEach((a) => {
45
- this._updatePriceBlock(E, a, p, m);
46
- }), ((o == null ? void 0 : o.querySelectorAll(
44
+ )) || []).forEach((a) => {
45
+ this._updatePriceBlock(a, E, R, e, "price");
46
+ }), ((c == null ? void 0 : c.querySelectorAll(
47
47
  `[esd-extension-block-id="${_.ORIGINAL_PRICE}"]`
48
48
  )) || []).forEach((a) => {
49
- this._updatePriceBlock(E, a, F, A);
50
- }), E.apply(new L(
51
- `Updated price to ${t ? "formatted" : "unformatted"}`
52
- ));
49
+ this._updatePriceBlock(a, m, F, e, "original price");
50
+ });
53
51
  }
54
- _updatePriceBlock(t, e, n, i) {
55
- const r = e.getInnerHTML().trim().replace(n, O(i));
56
- t.modifyHtml(e).setInnerHtml(r);
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));
57
55
  }
58
56
  _getFormattedPrice() {
59
57
  return `
60
58
  <div class="display-flex align-items-center justify-content-between">
61
59
  <${P.LABEL}
62
- ${D.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
60
+ ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
63
61
  >
64
62
  </${P.LABEL}>
65
63
  ${this._GuToggle(s.FORMATTED_PRICE)}
@@ -69,5 +67,5 @@ class k extends h {
69
67
  }
70
68
  export {
71
69
  g as CONTROL_BLOCK_ID,
72
- k as PriceFormattedPriceControl
70
+ $ as PriceFormattedPriceControl
73
71
  };
@@ -33,6 +33,7 @@ class C extends r {
33
33
  }
34
34
  _getHideDiscount() {
35
35
  return `
36
+
36
37
  <div class="display-flex align-items-center justify-content-between">
37
38
  <${o.LABEL}
38
39
  ${d.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
@@ -1,18 +1,18 @@
1
- import { ModificationDescription as m, UIElementType as _, UEAttr as A } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as h } from "../../../common-control.js";
3
- import { ItemsBlockControlId as L, ItemsBlockId as R } from "../../enums/controlEnums.js";
4
- import { productPairs as T } from "../../enums/productEnums.js";
5
- import { getItemsBlockConfig as I, setItemsBlockConfig as u, escapeReplacement as N } from "../../utils/nodeConfigUtils.js";
6
- const D = L.PRICE_SINGLE_PRICE, l = {
1
+ import { ModificationDescription as P, UIElementType as _, UEAttr as S } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as m } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as T, ItemsBlockId as g } from "../../enums/controlEnums.js";
4
+ import { productPairs as R } from "../../enums/productEnums.js";
5
+ import { getItemsBlockConfig as I, setItemsBlockConfig as u, escapeReplacement as A } from "../../utils/nodeConfigUtils.js";
6
+ const h = T.PRICE_SINGLE_PRICE, l = {
7
7
  SINGLE_PRICE: "singlePrice"
8
8
  };
9
- class y extends h {
9
+ class M extends m {
10
10
  getId() {
11
- return D;
11
+ return h;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
- <div class="container ${L.PRICE_SINGLE_PRICE}">
15
+ <div class="container ${T.PRICE_SINGLE_PRICE}">
16
16
  ${this._getSinglePrice()}
17
17
  </div>
18
18
  `;
@@ -32,36 +32,34 @@ class y extends h {
32
32
  _onSinglePriceChange(e) {
33
33
  if (console.debug("Single price changed to: ", e), u(this.currentNode, this.api, { priceSinglePrice: e }), !this.currentNode)
34
34
  return;
35
- const t = I(this.currentNode), o = (t == null ? void 0 : t.type) ?? "CART_ITEMS", r = (t == null ? void 0 : t.priceFormatted) ?? !1, i = T.PAIRS_FOR_EXTENSION.price[o], c = T.PAIRS_FOR_EXTENSION.originalPrice[o], [P, p] = e ? [
35
+ const t = I(this.currentNode), n = (t == null ? void 0 : t.type) ?? "CART_ITEMS", r = (t == null ? void 0 : t.priceFormatted) ?? !1, i = R.PAIRS_FOR_EXTENSION.price[n], c = R.PAIRS_FOR_EXTENSION.originalPrice[n], [E, d] = e ? [
36
36
  r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE,
37
37
  r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE
38
38
  ] : [
39
39
  r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE,
40
40
  r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE
41
- ], s = r ? c.DEFAULT_PRICE_FORMATTED : c.DEFAULT_PRICE, d = r ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_SINGLE_PRICE, [g, C] = e ? [s, d] : [d, s], n = this.currentNode.closest(".items-block"), S = (n == null ? void 0 : n.querySelectorAll(
42
- `[esd-extension-block-id="${R.PRICE}"]`
43
- )) || [], E = this.api.getDocumentModifier();
44
- S.forEach((a) => {
45
- this._updatePriceBlock(E, a, P, p, e);
46
- }), ((n == null ? void 0 : n.querySelectorAll(
47
- `[esd-extension-block-id="${R.ORIGINAL_PRICE}"]`
48
- )) || []).forEach((a) => {
49
- this._updatePriceBlock(E, a, g, C, e);
50
- }), E.apply(new m(
51
- `Updated price to ${e ? "single" : "total"} price`
52
- ));
41
+ ], a = r ? c.DEFAULT_PRICE_FORMATTED : c.DEFAULT_PRICE, s = r ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_SINGLE_PRICE, [L, C] = e ? [a, s] : [s, a], o = this.currentNode.closest(".items-block");
42
+ ((o == null ? void 0 : o.querySelectorAll(
43
+ `[esd-extension-block-id="${g.PRICE}"]`
44
+ )) || []).forEach((p) => {
45
+ this._updatePriceBlock(p, E, d, e, "price");
46
+ }), ((o == null ? void 0 : o.querySelectorAll(
47
+ `[esd-extension-block-id="${g.ORIGINAL_PRICE}"]`
48
+ )) || []).forEach((p) => {
49
+ this._updatePriceBlock(p, L, C, e, "original price");
50
+ });
53
51
  }
54
- _updatePriceBlock(e, t, o, r, i) {
55
- const c = t.getInnerHTML().trim().replace(o, N(r));
56
- e.modifyHtml(t).setInnerHtml(c), t.querySelectorAll('[product-attr="price"], [product-attr="originalPrice"]').forEach((s) => {
57
- e.modifyHtml(s).setAttribute("data-single_price", i ? "true" : "false");
52
+ _updatePriceBlock(e, t, n, r, i) {
53
+ const c = e.getInnerHTML().trim().replace(t, A(n)), E = `Updated ${i} to ${r ? "single" : "total"} price`;
54
+ this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(c).apply(new P(E)), e.querySelectorAll('[product-attr="price"], [product-attr="originalPrice"]').forEach((s) => {
55
+ this.api.getDocumentModifier().modifyHtml(s).setAttribute("data-single_price", r ? "true" : "false").apply(new P("Update single price attribute"));
58
56
  });
59
57
  }
60
58
  _getSinglePrice() {
61
59
  return `
62
60
  <div class="display-flex align-items-center justify-content-between">
63
61
  <${_.LABEL}
64
- ${A.LABEL.text}="${this.api.translate("Show Single Product Price")}"
62
+ ${S.LABEL.text}="${this.api.translate("Show Single Product Price")}"
65
63
  >
66
64
  </${_.LABEL}>
67
65
  ${this._GuToggle(l.SINGLE_PRICE)}
@@ -70,6 +68,6 @@ class y extends h {
70
68
  }
71
69
  }
72
70
  export {
73
- D as CONTROL_BLOCK_ID,
74
- y as PriceSinglePriceControl
71
+ h as CONTROL_BLOCK_ID,
72
+ M as PriceSinglePriceControl
75
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.1.0-beta.13ada05",
3
+ "version": "2.1.0-beta.1d0cd94",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",