@useinsider/guido 1.0.3-beta.cd0d7f3 → 1.0.3-beta.cdff8ce

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 (39) hide show
  1. package/README.md +3 -32
  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/useStripo.js +29 -25
  6. package/dist/extensions/Blocks/Checkbox/control.js +15 -14
  7. package/dist/extensions/Blocks/Checkbox/template.js +14 -9
  8. package/dist/extensions/Blocks/Items/block.js +25 -24
  9. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  10. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +92 -0
  11. package/dist/extensions/Blocks/Items/controls/settingsControl.js +90 -83
  12. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  13. package/dist/extensions/Blocks/Items/enums/productEnums.js +8 -6
  14. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -2
  15. package/dist/extensions/Blocks/Items/extension.js +7 -6
  16. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -57
  17. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +67 -56
  18. package/dist/extensions/Blocks/Items/settingsPanel.js +8 -8
  19. package/dist/extensions/Blocks/Items/store/items-block.js +8 -4
  20. package/dist/extensions/Blocks/Items/template.js +70 -69
  21. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +35 -26
  22. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +29 -27
  23. package/dist/extensions/Blocks/RadioButton/control.js +18 -17
  24. package/dist/extensions/Blocks/RadioButton/template.js +18 -9
  25. package/dist/extensions/Blocks/Unsubscribe/block.js +45 -41
  26. package/dist/guido.css +1 -1
  27. package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
  29. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +15 -0
  30. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +5 -2
  31. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  32. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +2 -0
  33. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
  35. package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
  36. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +6 -0
  37. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  38. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +3 -4
  39. package/package.json +5 -10
@@ -1,59 +1,70 @@
1
- const t = `<td align="center" class="ins-product-td items-block items-block-v2">
2
- <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
3
- {-{-CONFIG_BLOCK-}-}
4
- <tbody>
5
- <tr>
6
- <td style="padding: 16px 9px;">
7
- <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left"
8
- width="100%">
9
- <tbody>
10
- <tr>
11
- <td class="product-image-class" data-slot-1>
12
- {-{-PRODUCT_IMAGE-}-}
13
- </td>
14
- <td class="product-name-class" data-slot-2 width="130px">
15
- <table width="130">
16
- <tbody>
17
- {-{-PRODUCT_NAME-}-}
18
- </tbody>
19
- </table>
20
- </td>
21
- <td class="product-quantity-class" data-slot-3>
22
- <table width="100%">
23
- <tbody>
24
- {-{-PRODUCT_QUANTITY-}-}
25
- </tbody>
26
- </table>
27
- </td>
28
- <td class="product-price-class" data-slot-4>
29
-
30
- <table width="100%">
31
- <tbody>
32
- {-{-PRODUCT_PRICE-}-}
33
- </tbody>
34
- </table>
35
- </td>
36
- <td class="product-original-price-class" data-slot-5>
37
- <table width="100%">
38
- <tbody>
39
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
40
- </tbody>
41
- </table>
42
- </td>
43
- <td class="product-button-class" data-slot-6>
44
- <table width="100%">
45
- <tbody>
46
- {-{-PRODUCT_BUTTON-}-}
47
- </tbody>
48
- </table>
49
- </td>
50
- </tr>
51
- </tbody>
52
- </table>
53
- </td>
54
- </tr>
55
- </tbody>
56
- </table>
1
+ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
2
+ <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
3
+ {-{-CONFIG_BLOCK-}-}
4
+ <tbody>
5
+ <tr>
6
+ <td style="padding: 16px 9px;">
7
+ <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left" width="100%">
8
+ <tbody>
9
+ <tr>
10
+ <td class="product-image-class" data-slot-1>
11
+ {-{-PRODUCT_IMAGE-}-}
12
+ </td>
13
+ <td class="product-name-class" data-slot-2>
14
+ <table>
15
+ <tbody>
16
+ {-{-PRODUCT_NAME-}-}
17
+ </tbody>
18
+ </table>
19
+ </td>
20
+ <td class="product-quantity-class" data-slot-3>
21
+ <table width="100%">
22
+ <tbody>
23
+ {-{-PRODUCT_QUANTITY-}-}
24
+ </tbody>
25
+ </table>
26
+ </td>
27
+ <td class="product-price-class horizontal-price" data-slot-4>
28
+ <table width="100%">
29
+ <tbody>
30
+ {-{-PRODUCT_PRICE-}-}
31
+ </tbody>
32
+ </table>
33
+ </td>
34
+ <td class="product-original-price-class horizontal-price" data-slot-5>
35
+ <table width="100%">
36
+ <tbody>
37
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
38
+ </tbody>
39
+ </table>
40
+ </td>
41
+ <td class="product-price-container vertical-price" data-slot-4 style="display: none;">
42
+ <table class="product-price-class" width="100%" data-slot-4>
43
+ <tbody>
44
+ {-{-PRODUCT_PRICE-}-}
45
+ </tbody>
46
+ </table>
47
+ <table class="product-original-price-class product-original-price-container"
48
+ width="100%" data-slot-5>
49
+ <tbody>
50
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
51
+ </tbody>
52
+ </table>
53
+ </td>
54
+ <td class="product-button-class" data-slot-6>
55
+ <table width="100%">
56
+ <tbody>
57
+ {-{-PRODUCT_BUTTON-}-}
58
+ </tbody>
59
+ </table>
60
+ </td>
61
+ </tr>
62
+ </tbody>
63
+ </table>
64
+ </td>
65
+ </tr>
66
+ </tbody>
67
+ </table>
57
68
  </td>
58
69
  `;
59
70
  export {
@@ -1,22 +1,21 @@
1
- import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as N, ContainerControls as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { BLOCK_ID as R } from "./block.js";
3
- import { COMPOSITION_CONTROL_BLOCK_ID as A } from "./controls/cardComposition.js";
4
- import { CONTROL_BLOCK_ID as L } from "./controls/settingsControl.js";
3
+ import { COMPOSITION_CONTROL_BLOCK_ID as S } from "./controls/cardComposition.js";
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
- class n extends O {
6
+ class U extends O {
7
7
  registerBlockControls(_) {
8
8
  _[R] = [
9
9
  new T(
10
10
  N.SETTINGS,
11
11
  [
12
- L,
13
- S.EXTERNAL_INDENTS
12
+ A
14
13
  ]
15
14
  ),
16
15
  new T(
17
16
  "Card Composition",
18
17
  [
19
- A
18
+ S
20
19
  ]
21
20
  ).withLabel("Card Composition")
22
21
  ], _[E.ORIGINAL_PRICE] = [
@@ -46,6 +45,7 @@ class n extends O {
46
45
  I.PRICE_FORMATTED_PRICE,
47
46
  I.PRICE_CURRENCY_SYMBOL,
48
47
  I.PRICE_CURRENCY_LOCATION,
48
+ I.PRICE_ORIENTATION,
49
49
  I.PRICE_PADDINGS
50
50
  ]
51
51
  ),
@@ -128,5 +128,5 @@ class n extends O {
128
128
  }
129
129
  }
130
130
  export {
131
- n as SettingsPanel
131
+ U as SettingsPanel
132
132
  };
@@ -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,35 +1,23 @@
1
- import { BlockType as l, BlockAttr as I } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { ItemsBlockId as T } from "./enums/controlEnums.js";
3
- import { productPairs as r } from "./enums/productEnums.js";
4
- import { ItemInCartOptions as N, SETTINGS_ENUMS as A } from "./enums/settingsEnums.js";
5
- import P from "./layouts/horizontal.html.js";
6
- import S from "./layouts/vertical.html.js";
7
- const B = `text-decoration:none;
8
- font-family:-apple-system,
9
- BlinkMacSystemFont,
10
- 'Segoe UI',
11
- Roboto,
12
- Helvetica,
13
- Arial,
14
- sans-serif,
15
- 'Apple Color Emoji',
16
- 'Segoe UI Emoji',
17
- 'Segoe UI Symbol'
18
- `;
19
- let [R] = r.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [C] = r.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [_] = r.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [$] = r.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = r.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
20
- const f = (a, t) => `
3
+ import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
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) => `
21
9
  <${l.BLOCK_IMAGE}
22
- ${I.BLOCK_IMAGE.src}="${R}"
23
- ${I.BLOCK_IMAGE.alt}="Product Image"
24
- ${I.BLOCK_IMAGE.href}="#!"
25
- ${I.BLOCK_IMAGE.width}="70"
10
+ ${_.BLOCK_IMAGE.src}="${C}"
11
+ ${_.BLOCK_IMAGE.alt}="${A}"
12
+ ${_.BLOCK_IMAGE.href}="#!"
13
+ ${_.BLOCK_IMAGE.width}=${P.productImageWidth}
26
14
  esd-extension-block-id="${T.IMAGE}"
27
15
  data-slot-1
28
16
  product-attr="imageSrc"
29
17
  data-type="${a}"
30
18
  data-number="${t}"
31
19
  />
32
- `, g = (a) => `
20
+ `, F = (a) => `
33
21
  <${l.BLOCK_TEXT}
34
22
  width="100%"
35
23
  align="center"
@@ -40,21 +28,34 @@ const f = (a, t) => `
40
28
  <p contenteditable="false">
41
29
  <a
42
30
  href="#!"
43
- style="${B}"
31
+ style="
32
+ text-decoration:none;
33
+ font-size: inherit;
34
+ font-weight: inherit;
35
+ line-height: inherit;
36
+ font-family: inherit;
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;
44
+ "
44
45
  product-attr="name"
45
46
  data-slot-2
46
47
  width="100%">
47
- ${C}
48
+ ${A}
48
49
  </a>
49
50
  </p>
50
51
  </${l.BLOCK_TEXT}>
51
- `, F = (a, t, o, e, i) => {
52
- let n = _;
52
+ `, S = (a, t, o, e, c) => {
53
+ let n = p;
53
54
  if (e && e.trim()) {
54
- const d = `&nbsp;${e.trim()}&nbsp;`;
55
- n = (i || "0") === "1" ? `${_}${d}` : `${d}${_}`;
55
+ const E = `&nbsp;${e.trim()}&nbsp;`;
56
+ n = (c || "0") === "1" ? `${p}${E}` : `${E}${p}`;
56
57
  }
57
- const c = i === "1" ? "after" : "before", s = `data-formated="${o ? "true" : "false"}"`, E = `data-curency="${c}"`;
58
+ const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
58
59
  return `
59
60
  <${l.BLOCK_TEXT}
60
61
  esd-extension-block-id="${T.PRICE}"
@@ -68,21 +69,21 @@ const f = (a, t) => `
68
69
  data-slot-4
69
70
  data-type="${a}"
70
71
  data-number="${t}"
72
+ ${d}
71
73
  ${s}
72
- ${E}
73
74
  ${e ? `data-currency_symbol="${e}"` : ""}
74
75
  >
75
76
  ${n}
76
77
  </p>
77
78
  </${l.BLOCK_TEXT}>
78
79
  `;
79
- }, b = (a, t, o, e, i) => {
80
- let n = $;
80
+ }, L = (a, t, o, e, c) => {
81
+ let n = I;
81
82
  if (e && e.trim()) {
82
- const d = `&nbsp;${e.trim()}&nbsp;`;
83
- n = (i || "0") === "1" ? `${$}${d}` : `${d}${$}`;
83
+ const E = `&nbsp;${e.trim()}&nbsp;`;
84
+ n = (c || "0") === "1" ? `${I}${E}` : `${E}${I}`;
84
85
  }
85
- const c = i === "1" ? "after" : "before", s = `data-formated="${o ? "true" : "false"}"`, E = `data-curency="${c}"`;
86
+ const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
86
87
  return `
87
88
  <${l.BLOCK_TEXT}
88
89
  class="items-block-price"
@@ -97,15 +98,15 @@ const f = (a, t) => `
97
98
  style="color: #cc0000"
98
99
  data-type="${a}"
99
100
  data-number="${t}"
101
+ ${d}
100
102
  ${s}
101
- ${E}
102
103
  ${e ? `data-currency_symbol="${e}"` : ""}
103
104
  >
104
105
  <s>${n}</s>
105
106
  </p>
106
107
  </${l.BLOCK_TEXT}>
107
108
  `;
108
- }, U = () => `
109
+ }, b = () => `
109
110
  <${l.BLOCK_TEXT}
110
111
  width="100%"
111
112
  align="center"
@@ -120,7 +121,7 @@ const f = (a, t) => `
120
121
  ${u}
121
122
  </p>
122
123
  </${l.BLOCK_TEXT}>
123
- `, L = (a, t) => `
124
+ `, U = (a, t) => `
124
125
  <${l.BLOCK_BUTTON}
125
126
  width="100%"
126
127
  class="ins-button"
@@ -134,61 +135,61 @@ const f = (a, t) => `
134
135
  data-number="${t}"
135
136
  >Buy
136
137
  </${l.BLOCK_BUTTON}>
137
- `, m = () => `
138
+ `, D = () => `
138
139
  <esd-config-block style="display: none;"></esd-config-block>
139
- `, O = (a, t, o, e, i, n, c, s) => {
140
- const p = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
140
+ `, R = (a, t, o, e, c, n, r, d) => {
141
+ const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
141
142
  return a.replace(
142
143
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
143
- `<td$1 ${p}>`
144
- ).replace("{-{-PRODUCT_IMAGE-}-}", f(t, o)).replace("{-{-PRODUCT_NAME-}-}", g(t)).replace(
144
+ `<td$1 ${$}>`
145
+ ).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", h(t, o)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replaceAll(
145
146
  "{-{-PRODUCT_PRICE-}-}",
146
- F(t, o, i, n, c)
147
- ).replace(
147
+ S(t, o, c, n, r)
148
+ ).replaceAll(
148
149
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
149
- b(
150
+ L(
150
151
  t,
151
152
  o,
152
- i,
153
+ c,
153
154
  n,
154
- c
155
+ r
155
156
  )
156
- ).replace("{-{-PRODUCT_QUANTITY-}-}", U()).replace("{-{-PRODUCT_BUTTON-}-}", L(t, o)).replace("{-{-CONFIG_BLOCK-}-}", m());
157
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", U(t, o)).replace("{-{-CONFIG_BLOCK-}-}", D());
157
158
  };
158
- function x({
159
+ function G({
159
160
  orientation: a,
160
- itemsType: t = A.ITEMS_TYPE.CART_ITEMS,
161
+ itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
161
162
  itemId: o,
162
163
  currencySymbol: e,
163
- currencyLocation: i,
164
+ currencyLocation: c,
164
165
  formattedPrice: n = !0
165
166
  }) {
166
- const c = N[t].findIndex((E) => E.value === o);
167
- let s = "1";
168
- if (c >= 0)
169
- s = String(c + 1);
167
+ const r = f[t].findIndex((s) => s.value === o);
168
+ let d = "1";
169
+ if (r >= 0)
170
+ d = String(r + 1);
170
171
  else if (o) {
171
- const E = o.match(/\((\d+)\)/);
172
- E && ([s] = E);
172
+ const s = o.match(/\((\d+)\)/);
173
+ s && s[1] && ([, d] = s);
173
174
  }
174
- return R = r.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[c >= 0 ? c : 0], C = r.PAIRS_FOR_EXTENSION.name[t].DEFAULT[c >= 0 ? c : 0], _ = n ? r.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : r.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, $ = n ? r.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : r.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = r.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === A.ORIENTATION.VERTICAL ? O(
175
- S,
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,
176
177
  t,
177
- s,
178
+ d,
178
179
  a,
179
180
  n,
180
181
  e,
181
- i
182
- ) : O(
183
- P,
182
+ c
183
+ ) : R(
184
+ B,
184
185
  t,
185
- s,
186
+ d,
186
187
  a,
187
188
  n,
188
189
  e,
189
- i
190
+ c
190
191
  );
191
192
  }
192
193
  export {
193
- x as getDefaultTemplate
194
+ G as getDefaultTemplate
194
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
  };