@useinsider/guido 1.0.3-beta.ea69f4a → 1.0.3-beta.f2389d0

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 (33) hide show
  1. package/README.md +3 -0
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  4. package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
  5. package/dist/composables/useActionsApi.js +23 -32
  6. package/dist/composables/useStripo.js +46 -48
  7. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  8. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +92 -0
  9. package/dist/extensions/Blocks/Items/controls/settingsControl.js +94 -90
  10. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  11. package/dist/extensions/Blocks/Items/enums/productEnums.js +3 -2
  12. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -2
  13. package/dist/extensions/Blocks/Items/extension.js +7 -6
  14. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +2 -2
  15. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +17 -5
  16. package/dist/extensions/Blocks/Items/settingsPanel.js +25 -24
  17. package/dist/extensions/Blocks/Items/store/items-block.js +8 -4
  18. package/dist/extensions/Blocks/Items/template.js +65 -59
  19. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +35 -26
  20. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +29 -27
  21. package/dist/extensions/Blocks/Unsubscribe/block.js +34 -30
  22. package/dist/guido.css +1 -1
  23. package/dist/src/composables/useActionsApi.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +15 -0
  25. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  26. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +1 -0
  27. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
  28. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
  29. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +6 -0
  30. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +3 -4
  31. package/package.json +3 -1
  32. package/dist/composables/useTimerClone.js +0 -67
  33. package/dist/src/composables/useTimerClone.d.ts +0 -5
@@ -1,13 +1,13 @@
1
- import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { BLOCK_ID as S } from "./block.js";
3
- import { COMPOSITION_CONTROL_BLOCK_ID as R } from "./controls/cardComposition.js";
1
+ import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { BLOCK_ID as R } from "./block.js";
3
+ import { COMPOSITION_CONTROL_BLOCK_ID as S } from "./controls/cardComposition.js";
4
4
  import { CONTROL_BLOCK_ID as A } from "./controls/settingsControl.js";
5
5
  import { ItemsBlockId as E, ItemsBlockControlId as I } from "./enums/controlEnums.js";
6
6
  class U extends O {
7
- registerBlockControls(N) {
8
- N[S] = [
7
+ registerBlockControls(_) {
8
+ _[R] = [
9
9
  new T(
10
- _.SETTINGS,
10
+ N.SETTINGS,
11
11
  [
12
12
  A
13
13
  ]
@@ -15,12 +15,12 @@ class U extends O {
15
15
  new T(
16
16
  "Card Composition",
17
17
  [
18
- R
18
+ S
19
19
  ]
20
20
  ).withLabel("Card Composition")
21
- ], N[E.ORIGINAL_PRICE] = [
21
+ ], _[E.ORIGINAL_PRICE] = [
22
22
  new T(
23
- _.SETTINGS,
23
+ N.SETTINGS,
24
24
  [
25
25
  I.ORIGINAL_PRICE_STYLE,
26
26
  I.ORIGINAL_PRICE_ALIGN,
@@ -28,16 +28,16 @@ class U extends O {
28
28
  ]
29
29
  ),
30
30
  new T(
31
- _.STYLES,
31
+ N.STYLES,
32
32
  [
33
33
  I.ORIGINAL_PRICE_COLOR,
34
34
  I.ORIGINAL_PRICE_FONT_FAMILY,
35
35
  I.ORIGINAL_PRICE_SIZE
36
36
  ]
37
37
  )
38
- ], N[E.PRICE] = [
38
+ ], _[E.PRICE] = [
39
39
  new T(
40
- _.SETTINGS,
40
+ N.SETTINGS,
41
41
  [
42
42
  I.PRICE_STYLE,
43
43
  I.PRICE_ALIGN,
@@ -45,20 +45,21 @@ class U extends O {
45
45
  I.PRICE_FORMATTED_PRICE,
46
46
  I.PRICE_CURRENCY_SYMBOL,
47
47
  I.PRICE_CURRENCY_LOCATION,
48
+ I.PRICE_ORIENTATION,
48
49
  I.PRICE_PADDINGS
49
50
  ]
50
51
  ),
51
52
  new T(
52
- _.STYLES,
53
+ N.STYLES,
53
54
  [
54
55
  I.PRICE_COLOR,
55
56
  I.PRICE_FONT_FAMILY,
56
57
  I.PRICE_SIZE
57
58
  ]
58
59
  )
59
- ], N[E.NAME] = [
60
+ ], _[E.NAME] = [
60
61
  new T(
61
- _.SETTINGS,
62
+ N.SETTINGS,
62
63
  [
63
64
  I.NAME_STYLE,
64
65
  I.NAME_ALIGN,
@@ -67,23 +68,23 @@ class U extends O {
67
68
  ]
68
69
  ),
69
70
  new T(
70
- _.STYLES,
71
+ N.STYLES,
71
72
  [
72
73
  I.NAME_FONT_FAMILY,
73
74
  I.NAME_SIZE,
74
75
  I.NAME_COLOR
75
76
  ]
76
77
  )
77
- ], N[E.QUANTITY] = [
78
+ ], _[E.QUANTITY] = [
78
79
  new T(
79
- _.SETTINGS,
80
+ N.SETTINGS,
80
81
  [
81
82
  I.QUANTITY_FONT_FAMILY,
82
83
  I.QUANTITY_STYLE
83
84
  ]
84
85
  ),
85
86
  new T(
86
- _.STYLES,
87
+ N.STYLES,
87
88
  [
88
89
  I.QUANTITY_ALIGN,
89
90
  I.QUANTITY_SIZE,
@@ -91,18 +92,18 @@ class U extends O {
91
92
  I.QUANTITY_PADDINGS
92
93
  ]
93
94
  )
94
- ], N[E.IMAGE] = [
95
+ ], _[E.IMAGE] = [
95
96
  new T(
96
- _.SETTINGS,
97
+ N.SETTINGS,
97
98
  [
98
99
  I.IMAGE_LINK,
99
100
  I.IMAGE_SIZE,
100
101
  I.IMAGE_MARGINS
101
102
  ]
102
103
  )
103
- ], N[E.BUTTON] = [
104
+ ], _[E.BUTTON] = [
104
105
  new T(
105
- _.SETTINGS,
106
+ N.SETTINGS,
106
107
  [
107
108
  I.BUTTON_LINK,
108
109
  I.BUTTON_TEXT,
@@ -112,7 +113,7 @@ class U extends O {
112
113
  ]
113
114
  ),
114
115
  new T(
115
- _.STYLES,
116
+ N.STYLES,
116
117
  [
117
118
  I.BUTTON_COLOR,
118
119
  I.BUTTON_FONT_FAMILY,
@@ -1,4 +1,4 @@
1
- import { defineStore as s } from "pinia";
1
+ import { defineStore as r } from "pinia";
2
2
  import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
3
3
  const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "Url}"), i = () => {
4
4
  const t = e.cartItemsSelectControlValue;
@@ -8,11 +8,12 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
8
8
  imageLink: n(t),
9
9
  buttonLink: o(t),
10
10
  orientation: e.cardOrientationControlValue,
11
- nameTrimming: !1,
11
+ nameTrimming: !0,
12
12
  hideDiscount: !1,
13
13
  currencySymbol: "USD",
14
14
  currencyLocation: "0",
15
15
  formattedPrice: !0,
16
+ priceOrientation: "horizontal",
16
17
  templateData: {
17
18
  imageSrc: "",
18
19
  name: "",
@@ -22,7 +23,7 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
22
23
  button: ""
23
24
  }
24
25
  };
25
- }, a = s("guidoItemsBlock", {
26
+ }, m = r("guidoItemsBlock", {
26
27
  state: () => i(),
27
28
  actions: {
28
29
  setItemsType(t) {
@@ -55,6 +56,9 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
55
56
  setFormattedPrice(t) {
56
57
  this.formattedPrice = t;
57
58
  },
59
+ setPriceOrientation(t) {
60
+ this.priceOrientation = t;
61
+ },
58
62
  setTemplateData(t) {
59
63
  this.templateData = t;
60
64
  },
@@ -67,5 +71,5 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
67
71
  }
68
72
  });
69
73
  export {
70
- a as useItemsBlockStore
74
+ m as useItemsBlockStore
71
75
  };
@@ -1,17 +1,17 @@
1
1
  import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { ItemsBlockId as d } from "./enums/controlEnums.js";
2
+ import { ItemsBlockId as T } from "./enums/controlEnums.js";
3
3
  import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
4
- import { ItemInCartOptions as P, SETTINGS_ENUMS as O } from "./enums/settingsEnums.js";
5
- import f from "./layouts/horizontal.html.js";
6
- import B from "./layouts/vertical.html.js";
7
- let [R] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [C] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [I] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [$] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
- const g = (a, t) => `
4
+ import { ItemInCartOptions as f, SETTINGS_ENUMS as O, DefaultConfigValues as P } from "./enums/settingsEnums.js";
5
+ import B from "./layouts/horizontal.html.js";
6
+ import g from "./layouts/vertical.html.js";
7
+ let [C] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [p] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [I] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
+ const h = (a, t) => `
9
9
  <${l.BLOCK_IMAGE}
10
- ${_.BLOCK_IMAGE.src}="${R}"
11
- ${_.BLOCK_IMAGE.alt}="Product Image"
10
+ ${_.BLOCK_IMAGE.src}="${C}"
11
+ ${_.BLOCK_IMAGE.alt}="${A}"
12
12
  ${_.BLOCK_IMAGE.href}="#!"
13
- ${_.BLOCK_IMAGE.width}="70"
14
- esd-extension-block-id="${d.IMAGE}"
13
+ ${_.BLOCK_IMAGE.width}=${P.productImageWidth}
14
+ esd-extension-block-id="${T.IMAGE}"
15
15
  data-slot-1
16
16
  product-attr="imageSrc"
17
17
  data-type="${a}"
@@ -23,7 +23,7 @@ const g = (a, t) => `
23
23
  align="center"
24
24
  class="es-p10"
25
25
  data-type="${a}"
26
- esd-extension-block-id="${d.NAME}"
26
+ esd-extension-block-id="${T.NAME}"
27
27
  >
28
28
  <p contenteditable="false">
29
29
  <a
@@ -35,24 +35,30 @@ const g = (a, t) => `
35
35
  line-height: inherit;
36
36
  font-family: inherit;
37
37
  color: inherit;
38
+ display: block;
39
+ word-wrap:break-word;
40
+ white-space: nowrap;
41
+ width: 520px;
42
+ overflow: hidden;
43
+ text-overflow: ellipsis;
38
44
  "
39
45
  product-attr="name"
40
46
  data-slot-2
41
47
  width="100%">
42
- ${C}
48
+ ${A}
43
49
  </a>
44
50
  </p>
45
51
  </${l.BLOCK_TEXT}>
46
- `, S = (a, t, n, e, c) => {
47
- let o = I;
52
+ `, S = (a, t, o, e, c) => {
53
+ let n = p;
48
54
  if (e && e.trim()) {
49
- const T = `&nbsp;${e.trim()}&nbsp;`;
50
- o = (c || "0") === "1" ? `${I}${T}` : `${T}${I}`;
55
+ const E = `&nbsp;${e.trim()}&nbsp;`;
56
+ n = (c || "0") === "1" ? `${p}${E}` : `${E}${p}`;
51
57
  }
52
- const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
58
+ const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
53
59
  return `
54
60
  <${l.BLOCK_TEXT}
55
- esd-extension-block-id="${d.PRICE}"
61
+ esd-extension-block-id="${T.PRICE}"
56
62
  class="items-block-price"
57
63
  width="100%"
58
64
  align="center"
@@ -63,25 +69,25 @@ const g = (a, t) => `
63
69
  data-slot-4
64
70
  data-type="${a}"
65
71
  data-number="${t}"
66
- ${E}
72
+ ${d}
67
73
  ${s}
68
74
  ${e ? `data-currency_symbol="${e}"` : ""}
69
75
  >
70
- ${o}
76
+ ${n}
71
77
  </p>
72
78
  </${l.BLOCK_TEXT}>
73
79
  `;
74
- }, L = (a, t, n, e, c) => {
75
- let o = $;
80
+ }, L = (a, t, o, e, c) => {
81
+ let n = I;
76
82
  if (e && e.trim()) {
77
- const T = `&nbsp;${e.trim()}&nbsp;`;
78
- o = (c || "0") === "1" ? `${$}${T}` : `${T}${$}`;
83
+ const E = `&nbsp;${e.trim()}&nbsp;`;
84
+ n = (c || "0") === "1" ? `${I}${E}` : `${E}${I}`;
79
85
  }
80
- const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
86
+ const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
81
87
  return `
82
88
  <${l.BLOCK_TEXT}
83
89
  class="items-block-price"
84
- esd-extension-block-id="${d.ORIGINAL_PRICE}"
90
+ esd-extension-block-id="${T.ORIGINAL_PRICE}"
85
91
  width="100%"
86
92
  align="center"
87
93
  >
@@ -92,11 +98,11 @@ const g = (a, t) => `
92
98
  style="color: #cc0000"
93
99
  data-type="${a}"
94
100
  data-number="${t}"
95
- ${E}
101
+ ${d}
96
102
  ${s}
97
103
  ${e ? `data-currency_symbol="${e}"` : ""}
98
104
  >
99
- <s>${o}</s>
105
+ <s>${n}</s>
100
106
  </p>
101
107
  </${l.BLOCK_TEXT}>
102
108
  `;
@@ -105,7 +111,7 @@ const g = (a, t) => `
105
111
  width="100%"
106
112
  align="center"
107
113
  class="es-p10"
108
- esd-extension-block-id="${d.QUANTITY}"
114
+ esd-extension-block-id="${T.QUANTITY}"
109
115
  >
110
116
  <p
111
117
  product-attr="quantity"
@@ -115,75 +121,75 @@ const g = (a, t) => `
115
121
  ${u}
116
122
  </p>
117
123
  </${l.BLOCK_TEXT}>
118
- `, h = (a, t) => `
124
+ `, U = (a, t) => `
119
125
  <${l.BLOCK_BUTTON}
120
126
  width="100%"
121
127
  class="ins-button"
122
128
  name="buy-button"
123
129
  caption="Buy"
124
130
  align="center"
125
- esd-extension-block-id="${d.BUTTON}"
131
+ esd-extension-block-id="${T.BUTTON}"
126
132
  product-attr="button"
127
133
  data-slot-6
128
134
  data-type="${a}"
129
135
  data-number="${t}"
130
136
  >Buy
131
137
  </${l.BLOCK_BUTTON}>
132
- `, U = () => `
138
+ `, D = () => `
133
139
  <esd-config-block style="display: none;"></esd-config-block>
134
- `, p = (a, t, n, e, c, o, r, E) => {
135
- const A = `${`data-type="${t}" data-number="${n}"`} data-orientation="${e}"`;
140
+ `, R = (a, t, o, e, c, n, r, d) => {
141
+ const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
136
142
  return a.replace(
137
143
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
138
- `<td$1 ${A}>`
139
- ).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", g(t, n)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replace(
144
+ `<td$1 ${$}>`
145
+ ).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", h(t, o)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replaceAll(
140
146
  "{-{-PRODUCT_PRICE-}-}",
141
- S(t, n, c, o, r)
142
- ).replace(
147
+ S(t, o, c, n, r)
148
+ ).replaceAll(
143
149
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
144
150
  L(
145
151
  t,
146
- n,
147
- c,
148
152
  o,
153
+ c,
154
+ n,
149
155
  r
150
156
  )
151
- ).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", h(t, n)).replace("{-{-CONFIG_BLOCK-}-}", U());
157
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", U(t, o)).replace("{-{-CONFIG_BLOCK-}-}", D());
152
158
  };
153
- function x({
159
+ function G({
154
160
  orientation: a,
155
161
  itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
156
- itemId: n,
162
+ itemId: o,
157
163
  currencySymbol: e,
158
164
  currencyLocation: c,
159
- formattedPrice: o = !0
165
+ formattedPrice: n = !0
160
166
  }) {
161
- const r = P[t].findIndex((s) => s.value === n);
162
- let E = "1";
167
+ const r = f[t].findIndex((s) => s.value === o);
168
+ let d = "1";
163
169
  if (r >= 0)
164
- E = String(r + 1);
165
- else if (n) {
166
- const s = n.match(/\((\d+)\)/);
167
- s && s[1] && ([, E] = s);
170
+ d = String(r + 1);
171
+ else if (o) {
172
+ const s = o.match(/\((\d+)\)/);
173
+ s && s[1] && ([, d] = s);
168
174
  }
169
- return R = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], C = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], I = o ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, $ = o ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? p(
170
- B,
175
+ return C = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], A = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], p = n ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, I = n ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? R(
176
+ g,
171
177
  t,
172
- E,
178
+ d,
173
179
  a,
174
- o,
180
+ n,
175
181
  e,
176
182
  c
177
- ) : p(
178
- f,
183
+ ) : R(
184
+ B,
179
185
  t,
180
- E,
186
+ d,
181
187
  a,
182
- o,
188
+ n,
183
189
  e,
184
190
  c
185
191
  );
186
192
  }
187
193
  export {
188
- x as getDefaultTemplate
194
+ G as getDefaultTemplate
189
195
  };
@@ -1,67 +1,76 @@
1
- import { useItemsBlockStore as s } from "../store/items-block.js";
2
- import { syncAttributeFromConfigBlock as e, createBooleanSyncConfig as i, createStringSyncConfig as r } from "./syncAttributeFromConfigBlock.js";
3
- function C(t) {
4
- const o = s(), n = i(
1
+ import { useItemsBlockStore as e } from "../store/items-block.js";
2
+ import { syncAttributeFromConfigBlock as r, createBooleanSyncConfig as i, createStringSyncConfig as s } from "./syncAttributeFromConfigBlock.js";
3
+ function m(t) {
4
+ const o = e(), n = i(
5
5
  "PRODUCT_NAME_TRIMMING",
6
6
  (c) => o.setNameTrimming(c),
7
7
  !1
8
8
  );
9
- e(t, n);
9
+ r(t, n);
10
10
  }
11
11
  function f(t) {
12
- const o = s(), n = i(
12
+ const o = e(), n = i(
13
13
  "PRODUCT_PRICE_HIDE_DISCOUNT",
14
14
  (c) => o.setHideDiscount(c),
15
15
  !1
16
16
  );
17
- e(t, n);
17
+ r(t, n);
18
18
  }
19
19
  function R(t) {
20
- const o = s(), n = i(
20
+ const o = e(), n = i(
21
21
  "PRODUCT_PRICE_FORMATTED",
22
22
  (c) => o.setFormattedPrice(c),
23
23
  !0
24
24
  );
25
- e(t, n);
25
+ r(t, n);
26
26
  }
27
- function _(t) {
28
- const o = s(), n = r(
27
+ function O(t) {
28
+ const o = e(), n = s(
29
29
  "PRODUCT_PRICE_CURRENCY_SYMBOL",
30
30
  (c) => o.setCurrencySymbol(c),
31
31
  ""
32
32
  );
33
- e(t, n);
33
+ r(t, n);
34
34
  }
35
- function y(t) {
36
- const o = s(), n = r(
35
+ function _(t) {
36
+ const o = e(), n = s(
37
37
  "PRODUCT_PRICE_CURRENCY_LOCATION",
38
38
  (c) => o.setCurrencyLocation(c),
39
39
  "0"
40
40
  );
41
- e(t, n);
41
+ r(t, n);
42
42
  }
43
- function T(t) {
44
- const o = s(), n = r(
43
+ function I(t) {
44
+ const o = e(), n = s(
45
45
  "PRODUCT_BUTTON_LINK",
46
46
  (c) => o.setButtonLink(c),
47
47
  ""
48
48
  );
49
- e(t, n);
49
+ r(t, n);
50
50
  }
51
- function g(t) {
52
- const o = s(), n = r(
51
+ function T(t) {
52
+ const o = e(), n = s(
53
53
  "PRODUCT_IMAGE_LINK",
54
54
  (c) => o.setImageLink(c),
55
55
  ""
56
56
  );
57
- e(t, n);
57
+ r(t, n);
58
+ }
59
+ function y(t) {
60
+ const o = e(), n = s(
61
+ "PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION",
62
+ (c) => o.setPriceOrientation(c),
63
+ "horizontal"
64
+ );
65
+ r(t, n);
58
66
  }
59
67
  export {
60
- T as syncButtonLinkFromAttributes,
61
- y as syncCurrencyLocationFromAttributes,
62
- _ as syncCurrencySymbolFromAttributes,
68
+ I as syncButtonLinkFromAttributes,
69
+ _ as syncCurrencyLocationFromAttributes,
70
+ O as syncCurrencySymbolFromAttributes,
63
71
  R as syncFormattedPriceFromAttributes,
64
72
  f as syncHideDiscountFromAttributes,
65
- g as syncImageLinkFromAttributes,
66
- C as syncNameTrimmingFromAttributes
73
+ T as syncImageLinkFromAttributes,
74
+ m as syncNameTrimmingFromAttributes,
75
+ y as syncPriceOrientationFromAttributes
67
76
  };
@@ -1,44 +1,46 @@
1
- import { ModificationDescription as D } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { ModificationDescription as p } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { configAttributes as t } from "../enums/productEnums.js";
3
- import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
4
- import { useItemsBlockStore as l } from "../store/items-block.js";
5
- import { getConfigBlock as p } from "./configBlockUtils.js";
6
- function b(n, c) {
7
- const i = p(n);
8
- if (!i)
3
+ import { DefaultConfigValues as i } from "../enums/settingsEnums.js";
4
+ import { useItemsBlockStore as s } from "../store/items-block.js";
5
+ import { getConfigBlock as P } from "./configBlockUtils.js";
6
+ function M(n, O) {
7
+ const e = P(n);
8
+ if (!e)
9
9
  return;
10
- const C = l(), {
10
+ const c = s(), {
11
11
  itemsType: r,
12
- itemIds: E,
12
+ itemIds: C,
13
13
  orientation: T,
14
14
  nameTrimming: _,
15
- hideDiscount: O,
16
- formattedPrice: m,
17
- currencySymbol: R,
18
- currencyLocation: N,
15
+ hideDiscount: E,
16
+ formattedPrice: R,
17
+ currencySymbol: N,
18
+ currencyLocation: m,
19
+ priceOrientation: I,
19
20
  buttonLink: a,
20
21
  imageLink: f
21
- } = C, u = {
22
+ } = c, u = {
22
23
  "data-source": r,
23
24
  [t.TYPE]: r,
24
- [t.ITEMS_INDEX_SELECT_CONTROL_VALUE]: E,
25
+ [t.ITEMS_INDEX_SELECT_CONTROL_VALUE]: C,
25
26
  [t.ORIENTATION]: T,
26
27
  [t.PRODUCT_NAME_TRIMMING]: _ ? "1" : "0",
27
- [t.PRODUCT_PRICE_HIDE_DISCOUNT]: O ? "1" : "0",
28
- [t.PRODUCT_PRICE_FORMATTED]: m ? "1" : "0",
29
- [t.PRODUCT_PRICE_CURRENCY_SYMBOL]: R || "",
30
- [t.PRODUCT_PRICE_CURRENCY_LOCATION]: N || "0",
28
+ [t.PRODUCT_PRICE_HIDE_DISCOUNT]: E ? "1" : "0",
29
+ [t.PRODUCT_PRICE_FORMATTED]: R ? "1" : "0",
30
+ [t.PRODUCT_PRICE_CURRENCY_SYMBOL]: N || "",
31
+ [t.PRODUCT_PRICE_CURRENCY_LOCATION]: m || "0",
32
+ [t.PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION]: I || "horizontal",
31
33
  [t.PRODUCT_BUTTON_LINK]: a || "",
32
34
  [t.PRODUCT_IMAGE_LINK]: f || "",
33
- [t.NAME_CONTROL_ENABLED]: e.productNameControlEnabled,
34
- [t.QUANTITY_CONTROL_ENABLED]: e.productQuantityControlEnabled,
35
- [t.PRICE_CONTROL_OPENED]: e.productPriceControlOpened
35
+ [t.NAME_CONTROL_ENABLED]: i.productNameControlEnabled,
36
+ [t.QUANTITY_CONTROL_ENABLED]: i.productQuantityControlEnabled,
37
+ [t.PRICE_CONTROL_OPENED]: i.productPriceControlOpened
36
38
  };
37
- let o = c.getDocumentModifier().modifyHtml(i);
38
- Object.entries(u).forEach(([I, s]) => {
39
- o = o.setAttribute(I, s);
40
- }), o.apply(new D("Update config block attributes from control"));
39
+ let o = O.getDocumentModifier().modifyHtml(e);
40
+ Object.entries(u).forEach(([D, l]) => {
41
+ o = o.setAttribute(D, l);
42
+ }), o.apply(new p("Update config block attributes from control"));
41
43
  }
42
44
  export {
43
- b as updateConfigBlockAttributes
45
+ M as updateConfigBlockAttributes
44
46
  };