@useinsider/guido 2.0.0-beta.4f6e85f → 2.0.0-beta.522e9d9

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 (106) hide show
  1. package/README.md +0 -2
  2. package/dist/@types/config/schemas.js +39 -55
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +17 -15
  5. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  6. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
  7. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
  9. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  10. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
  11. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
  12. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  13. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +12 -11
  14. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  15. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  16. package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
  17. package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
  18. package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
  19. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
  20. package/dist/components/organisms/header/RightSlot.vue.js +12 -12
  21. package/dist/components/organisms/header/RightSlot.vue2.js +26 -20
  22. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  23. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  24. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  25. package/dist/composables/useConfig.js +27 -29
  26. package/dist/composables/useSave.js +11 -13
  27. package/dist/composables/useStripo.js +40 -40
  28. package/dist/config/migrator/index.js +8 -9
  29. package/dist/enums/academy.js +8 -0
  30. package/dist/enums/onboarding.js +1 -2
  31. package/dist/enums/unsubscribe.js +20 -21
  32. package/dist/extensions/Blocks/Items/block.js +40 -39
  33. package/dist/extensions/Blocks/Items/controls/button/link.js +29 -22
  34. package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -66
  35. package/dist/extensions/Blocks/Items/controls/image/link.js +30 -23
  36. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  37. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +17 -19
  38. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +29 -31
  39. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
  40. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +19 -21
  41. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +27 -29
  42. package/dist/extensions/Blocks/Items/controls/settingsControl.js +143 -152
  43. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  44. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -43
  45. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -4
  46. package/dist/extensions/Blocks/Items/extension.js +6 -7
  47. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +49 -58
  48. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +59 -48
  49. package/dist/extensions/Blocks/Items/settingsPanel.js +26 -27
  50. package/dist/extensions/Blocks/Items/store/items-block.js +7 -11
  51. package/dist/extensions/Blocks/Items/template.js +129 -366
  52. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  53. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  54. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +76 -0
  55. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +46 -0
  56. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  57. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  58. package/dist/extensions/Blocks/common-control.js +30 -29
  59. package/dist/extensions/Blocks/controlFactories.js +45 -55
  60. package/dist/guido.css +1 -1
  61. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +285 -364
  62. package/dist/package.json.js +1 -1
  63. package/dist/services/stripoApi.js +10 -6
  64. package/dist/src/@types/config/index.d.ts +2 -2
  65. package/dist/src/@types/config/schemas.d.ts +0 -30
  66. package/dist/src/@types/config/types.d.ts +1 -7
  67. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  68. package/dist/src/composables/useConfig.d.ts +0 -8
  69. package/dist/src/enums/academy.d.ts +12 -0
  70. package/dist/src/enums/onboarding.d.ts +0 -1
  71. package/dist/src/enums/unsubscribe.d.ts +0 -1
  72. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +2 -0
  73. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -9
  74. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +2 -0
  75. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  76. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
  77. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
  78. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +26 -24
  79. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -1
  80. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -2
  81. package/dist/src/extensions/Blocks/Items/template.d.ts +1 -22
  82. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  83. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  84. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +50 -0
  85. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  86. package/dist/src/extensions/Blocks/common-control.d.ts +10 -9
  87. package/dist/src/stores/config.d.ts +1 -164
  88. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  89. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  90. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  91. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  92. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  93. package/dist/static/styles/components/button.css.js +1 -1
  94. package/dist/stores/config.js +0 -7
  95. package/dist/utils/pairProductVariables.js +58 -61
  96. package/package.json +3 -3
  97. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  98. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  99. package/dist/config/migrator/itemsBlockMigrator.js +0 -342
  100. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +0 -93
  101. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -184
  102. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
  103. package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -18
  104. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -73
  105. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  106. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,76 +1,76 @@
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";
1
+ var _ = Object.defineProperty;
2
+ var I = (r, e, t) => e in r ? _(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var P = (r, e, t) => I(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ModificationDescription as F, UIElementType as m, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as h } from "../../../common-control.js";
6
- import { ItemsBlockControlId as p, ItemsBlockId as g } from "../../enums/controlEnums.js";
6
+ import { ItemsBlockControlId as l, ItemsBlockId as A } from "../../enums/controlEnums.js";
7
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 = {
8
+ import { useItemsBlockStore as u } from "../../store/items-block.js";
9
+ import { syncFormattedPriceFromAttributes as g } from "../../utils/syncAttributesFromConfigBlock.js";
10
+ import { updateConfigBlockAttributes as D } from "../../utils/updateAttributes.js";
11
+ const f = l.PRICE_FORMATTED_PRICE, n = {
11
12
  FORMATTED_PRICE: "formattedPrice"
12
13
  };
13
- class k extends h {
14
+ class y extends h {
14
15
  constructor() {
15
16
  super(...arguments);
16
- m(this, "store", A());
17
+ P(this, "store", u());
17
18
  }
18
19
  getId() {
19
- return D;
20
+ return f;
20
21
  }
21
22
  getTemplate() {
22
23
  return `
23
- <div class="container ${p.PRICE_FORMATTED_PRICE}">
24
+ <div class="${l.PRICE_FORMATTED_PRICE}">
24
25
  ${this._getFormattedPrice()}
25
26
  </div>
26
27
  `;
27
28
  }
28
29
  onRender() {
29
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (e) => {
30
- this._onFormattedPriceChange(e);
30
+ this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (t) => {
31
+ this._onFormattedPriceChange(t);
31
32
  });
32
33
  }
33
- onTemplateNodeUpdated(e) {
34
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
35
- () => {
36
- const r = f(this.currentNode);
37
- r && this.store.setFormattedPrice(r.priceFormatted ?? !0);
38
- },
34
+ onTemplateNodeUpdated(t) {
35
+ super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
36
+ () => g(this.currentNode),
39
37
  () => {
40
38
  this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
41
39
  }
42
40
  );
43
41
  }
44
- _onFormattedPriceChange(e) {
45
- if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), u(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
42
+ _onFormattedPriceChange(t) {
43
+ if (console.debug("Formatted price changed to: ", t), this.store.setFormattedPrice(t), D(this.currentNode, this.api), !this.currentNode)
46
44
  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];
45
+ const { itemsType: s } = this.store, i = T.PAIRS_FOR_EXTENSION.price[s], o = T.PAIRS_FOR_EXTENSION.originalPrice[s], [c, a] = t ? [i.DEFAULT_PRICE, i.DEFAULT_PRICE_FORMATTED] : [i.DEFAULT_PRICE_FORMATTED, i.DEFAULT_PRICE], [p, R] = t ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE];
48
46
  this._updatePriceBlock(
49
47
  this.currentNode,
50
48
  c,
51
49
  a,
52
50
  "price"
53
51
  );
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");
52
+ const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${A.ORIGINAL_PRICE}"]`);
53
+ E && this._updatePriceBlock(E, p, R, "original price");
56
54
  }
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));
55
+ _updatePriceBlock(t, s, i, o) {
56
+ const c = t.getInnerHTML().replace(s, i), a = `Updated ${o} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
57
+ this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(c).apply(new F(a));
60
58
  }
61
59
  _getFormattedPrice() {
62
60
  return `
63
- <div class="display-flex align-items-center justify-content-between">
64
- <${P.LABEL}
65
- ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
66
- >
67
- </${P.LABEL}>
68
- ${this._GuToggle(n.FORMATTED_PRICE)}
61
+ <div class="container">
62
+ <div class="display-flex align-items-center justify-content-between">
63
+ <${m.LABEL}
64
+ ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
65
+ >
66
+ </${m.LABEL}>
67
+ ${this._GuToggle(n.FORMATTED_PRICE)}
68
+ </div>
69
69
  </div>
70
70
  `;
71
71
  }
72
72
  }
73
73
  export {
74
- D as CONTROL_BLOCK_ID,
75
- k as PriceFormattedPriceControl
74
+ f as CONTROL_BLOCK_ID,
75
+ y as PriceFormattedPriceControl
76
76
  };
@@ -1,25 +1,26 @@
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";
1
+ var d = Object.defineProperty;
2
+ var a = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var o = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { UIElementType as n, UEAttr as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
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 = {
6
+ import { ItemsBlockControlId as r } from "../../enums/controlEnums.js";
7
+ import { useItemsBlockStore as D } from "../../store/items-block.js";
8
+ import { syncHideDiscountFromAttributes as p } from "../../utils/syncAttributesFromConfigBlock.js";
9
+ import { updateConfigBlockAttributes as I } from "../../utils/updateAttributes.js";
10
+ const l = r.PRICE_HIDE_DISCOUNT, s = {
10
11
  HIDE_DISCOUNT: "hideDiscount"
11
12
  };
12
- class T extends u {
13
+ class N extends u {
13
14
  constructor() {
14
15
  super(...arguments);
15
- n(this, "store", I());
16
+ o(this, "store", D());
16
17
  }
17
18
  getId() {
18
19
  return l;
19
20
  }
20
21
  getTemplate() {
21
22
  return `
22
- <div class="container ${d.PRICE_HIDE_DISCOUNT}">
23
+ <div class="${r.PRICE_HIDE_DISCOUNT}">
23
24
  ${this._getHideDiscount()}
24
25
  </div>
25
26
  `;
@@ -31,26 +32,23 @@ class T extends u {
31
32
  }
32
33
  onTemplateNodeUpdated(t) {
33
34
  super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
34
- () => {
35
- const o = p(this.currentNode);
36
- o && this.store.setHideDiscount(o.priceHideDiscount ?? !0);
37
- },
35
+ () => p(this.currentNode),
38
36
  () => {
39
37
  this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount });
40
38
  }
41
39
  );
42
40
  }
43
41
  _onHideDiscountChange(t) {
44
- this.store.setHideDiscount(t), h(this.currentNode, this.api, { priceHideDiscount: t }), this.api.updateValues({ [s.HIDE_DISCOUNT]: t });
42
+ this.store.setHideDiscount(t), I(this.currentNode, this.api), this.api.updateValues({ [s.HIDE_DISCOUNT]: t });
45
43
  }
46
44
  _getHideDiscount() {
47
45
  return `
48
-
46
+ <div class="container">
49
47
  <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 ")}"
48
+ <${n.LABEL}
49
+ ${c.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
52
50
  >
53
- </${r.LABEL}>
51
+ </${n.LABEL}>
54
52
  ${this._GuToggle(s.HIDE_DISCOUNT)}
55
53
  </div>
56
54
  </div>
@@ -59,5 +57,5 @@ class T extends u {
59
57
  }
60
58
  export {
61
59
  l as CONTROL_BLOCK_ID,
62
- T as PriceHideDiscountControl
60
+ N as PriceHideDiscountControl
63
61
  };
@@ -1,43 +1,43 @@
1
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";
2
+ var y = (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) => y(n, typeof o != "symbol" ? o + "" : o, t);
4
+ import { ModificationDescription as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
6
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";
7
+ import { SETTINGS_ENUMS as N } from "../../enums/settingsEnums.js";
8
+ import { useItemsBlockStore as f } from "../../store/items-block.js";
9
+ import { syncPriceOrientationFromAttributes as T } from "../../utils/syncAttributesFromConfigBlock.js";
10
+ import { updateConfigBlockAttributes as P } from "../../utils/updateAttributes.js";
10
11
  const _ = O.PRICE_ORIENTATION, p = {
11
12
  PRICE_ORIENTATION: "priceOrientation"
12
- }, P = [
13
+ }, C = [
13
14
  { icon: "vertical-orientation", value: "vertical" },
14
15
  { icon: "horizontal-orientation", value: "horizontal" }
15
16
  ];
16
- class H extends y {
17
+ class v extends E {
17
18
  constructor() {
18
19
  super(...arguments);
19
- m(this, "store", N());
20
+ m(this, "store", f());
20
21
  }
21
22
  getId() {
22
23
  return _;
23
24
  }
24
25
  getTemplate() {
25
26
  return `
26
- <div class="container ${O.PRICE_ORIENTATION}">
27
+ <div class="${O.PRICE_ORIENTATION}">
27
28
  ${this._getPriceOrientation()}
28
29
  </div>
29
30
  `;
30
31
  }
31
32
  onRender() {
32
33
  this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation }), this.api.onValueChanged(p.PRICE_ORIENTATION, (t) => {
33
- typeof t == "string" && this._onPriceOrientationChange(t);
34
+ this._onPriceOrientationChange(t);
34
35
  });
35
36
  }
36
37
  onTemplateNodeUpdated(t) {
37
38
  super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
38
39
  () => {
39
- const i = T(this.currentNode);
40
- i && this.store.setPriceOrientation(i.priceOrientation || "horizontal");
40
+ T(this.currentNode);
41
41
  },
42
42
  () => {
43
43
  this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation });
@@ -45,26 +45,24 @@ class H extends y {
45
45
  );
46
46
  }
47
47
  _onPriceOrientationChange(t) {
48
- if (this.store.setPriceOrientation(t), C(this.currentNode, this.api, {
49
- priceOrientation: t
50
- }), !this.currentNode)
48
+ if (console.debug("Price orientation changed to: ", t), this.store.setPriceOrientation(t), P(this.currentNode, this.api), !this.currentNode)
51
49
  return;
52
- const { orientation: i } = this.store, r = i === E.ORIENTATION.VERTICAL, e = t === "horizontal";
50
+ const { orientation: i } = this.store, r = i === N.ORIENTATION.VERTICAL, e = t === "horizontal";
53
51
  r ? this._updateVerticalLayout(e) : this._updateHorizontalLayout(e);
54
52
  }
55
- _updateVerticalLayout(t) {
53
+ _updateHorizontalLayout(t) {
56
54
  var c, l, d, a;
57
55
  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
56
  if (!i || !r)
59
57
  return;
60
58
  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}`));
59
+ i.forEach((u) => {
60
+ s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
61
+ }), r.forEach((u) => {
62
+ s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
63
+ }), s.apply(new h(`Updated original price element width to ${e}`));
66
64
  }
67
- _updateHorizontalLayout(t) {
65
+ _updateVerticalLayout(t) {
68
66
  var s, c, l, d;
69
67
  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
68
  if (!i || !r || i.length === 0)
@@ -72,9 +70,9 @@ class H extends y {
72
70
  const e = this.api.getDocumentModifier();
73
71
  t ? (i.forEach((a) => {
74
72
  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) => {
73
+ }), e.modifyHtml(r).setStyle("display", "none").apply(new h("Hide vertical price element"))) : (i.forEach((a) => {
76
74
  e.modifyHtml(a).setStyle("display", "none");
77
- }), e.modifyHtml(r).setStyle("display", "table-cell"), e.apply(new u("Show vertical price orientation")));
75
+ }), e.modifyHtml(r).setStyle("display", "table-cell").apply(new h("Show vertical price element")));
78
76
  }
79
77
  _getPriceOrientation() {
80
78
  return `
@@ -82,7 +80,7 @@ class H extends y {
82
80
  this._GuLabel({ text: "Price Orientation" }),
83
81
  this._GuRadioButton({
84
82
  name: p.PRICE_ORIENTATION,
85
- buttons: P
83
+ buttons: C
86
84
  })
87
85
  ])}
88
86
  `;
@@ -90,5 +88,5 @@ class H extends y {
90
88
  }
91
89
  export {
92
90
  _ as CONTROL_BLOCK_ID,
93
- H as PriceOrientationControl
91
+ v as PriceOrientationControl
94
92
  };