@useinsider/guido 2.1.0-beta.411f2a9 → 2.1.0-beta.425dfd0

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 (36) hide show
  1. package/dist/config/migrator/itemsBlockMigrator.js +123 -140
  2. package/dist/extensions/Blocks/Items/block.js +28 -19
  3. package/dist/extensions/Blocks/Items/controls/button/link.js +31 -19
  4. package/dist/extensions/Blocks/Items/controls/cardComposition.js +81 -97
  5. package/dist/extensions/Blocks/Items/controls/image/link.js +31 -19
  6. package/dist/extensions/Blocks/Items/controls/name/trimming.js +40 -28
  7. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +46 -34
  8. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +50 -45
  9. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +51 -40
  10. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +35 -23
  11. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +57 -45
  12. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +62 -42
  13. package/dist/extensions/Blocks/Items/controls/settingsControl.js +191 -184
  14. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
  15. package/dist/extensions/Blocks/Items/extension.js +9 -8
  16. package/dist/extensions/Blocks/Items/store/items-block.js +79 -0
  17. package/dist/extensions/Blocks/Items/template.js +175 -181
  18. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
  19. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +3 -3
  20. package/dist/extensions/Blocks/common-control.js +92 -91
  21. package/dist/src/extensions/Blocks/Items/block.d.ts +1 -0
  22. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +1 -0
  23. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +1 -0
  24. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +1 -0
  25. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +1 -0
  26. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +1 -0
  27. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +1 -0
  28. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +1 -0
  29. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +1 -0
  30. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -0
  31. package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +5 -0
  32. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +12 -10
  33. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +45 -0
  34. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -2
  35. package/dist/src/extensions/Blocks/common-control.d.ts +5 -4
  36. package/package.json +1 -1
@@ -1,46 +1,46 @@
1
1
  import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { DefaultConfigValues as o, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
3
- function _() {
2
+ import { DefaultConfigValues as i, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
3
+ function d() {
4
4
  return String(Date.now() + Math.floor(Math.random() * 1e3));
5
5
  }
6
- const E = (r) => r.replace(/\$/g, "$$$$");
6
+ const E = (o) => o.replace(/\$/g, "$$$$");
7
7
  function S() {
8
8
  return {
9
9
  initialized: !0,
10
- blockInstanceId: _(),
10
+ blockInstanceId: d(),
11
11
  source: n.ITEMS_TYPE.CART_ITEMS,
12
12
  type: n.ITEMS_TYPE.CART_ITEMS,
13
- itemsSelectValue: o.cartItemsSelectControlValue,
13
+ itemsSelectValue: i.cartItemsSelectControlValue,
14
14
  orientation: n.ORIENTATION.VERTICAL,
15
- nameTrimming: o.productNameTrimmingControlValue === "1",
16
- priceHideDiscount: o.productPriceHideDiscountControlValue === "1",
17
- priceFormatted: o.productPriceFormattedControlValue === "1",
15
+ nameTrimming: i.productNameTrimmingControlValue === "1",
16
+ priceHideDiscount: i.productPriceHideDiscountControlValue === "1",
17
+ priceFormatted: i.productPriceFormattedControlValue === "1",
18
18
  priceSinglePrice: !1,
19
- priceCurrencySymbol: o.productPriceCurrencySymbolControlValue,
20
- priceCurrencyLocation: o.productPriceCurrencyLocationControlValue,
19
+ priceCurrencySymbol: i.productPriceCurrencySymbolControlValue,
20
+ priceCurrencyLocation: i.productPriceCurrencyLocationControlValue,
21
21
  priceOrientation: "horizontal",
22
- quantityControlEnabled: o.productQuantityControlEnabled === "1",
23
- buttonLink: o.productButtonLinkControlValue,
24
- imageLink: o.productImageLinkControlValue,
22
+ quantityControlEnabled: i.productQuantityControlEnabled === "1",
23
+ buttonLink: i.productButtonLinkControlValue,
24
+ imageLink: i.productImageLinkControlValue,
25
25
  buttonLabel: "Buy",
26
26
  buttonFullWidth: !0,
27
27
  // Default to full width (es-fw class)
28
- imageVisible: o.productImageVisible === "1",
29
- nameVisible: o.productNameVisible === "1",
30
- quantityVisible: o.productQuantityVisible === "1",
31
- priceVisible: o.productPriceVisible === "1",
32
- originalPriceVisible: o.productOriginalPriceVisible === "1",
33
- buttonVisible: o.productButtonVisible === "1"
28
+ imageVisible: i.productImageVisible === "1",
29
+ nameVisible: i.productNameVisible === "1",
30
+ quantityVisible: i.productQuantityVisible === "1",
31
+ priceVisible: i.productPriceVisible === "1",
32
+ originalPriceVisible: i.productOriginalPriceVisible === "1",
33
+ buttonVisible: i.productButtonVisible === "1"
34
34
  };
35
35
  }
36
- function p(r) {
37
- if (!r)
36
+ function s(o) {
37
+ if (!o)
38
38
  return null;
39
- const t = r.closest(".items-block-v2");
40
- return t || r.closest(".esd-cart-items-block");
39
+ const t = o.closest(".items-block-v2");
40
+ return t || o.closest(".esd-cart-items-block");
41
41
  }
42
- function m(r) {
43
- return r ? {
42
+ function m(o) {
43
+ return o ? {
44
44
  CartItems: n.ITEMS_TYPE.CART_ITEMS,
45
45
  BrowsedItems: n.ITEMS_TYPE.BROWSED_ITEMS,
46
46
  PurchasedItems: n.ITEMS_TYPE.PURCHASED_ITEMS,
@@ -48,34 +48,34 @@ function m(r) {
48
48
  CART_ITEMS: n.ITEMS_TYPE.CART_ITEMS,
49
49
  BROWSED_ITEMS: n.ITEMS_TYPE.BROWSED_ITEMS,
50
50
  PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
51
- }[r] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
51
+ }[o] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
52
52
  }
53
- function I(r, t) {
54
- if (!r)
55
- return o.cartItemsSelectControlValue;
56
- if (r.includes("{{"))
57
- return r;
58
- if (/^\d+$/.test(r)) {
59
- const e = parseInt(r) - 1, i = g[t];
60
- if (i && i[e])
61
- return i[e].value;
53
+ function I(o, t) {
54
+ if (!o)
55
+ return i.cartItemsSelectControlValue;
56
+ if (o.includes("{{"))
57
+ return o;
58
+ if (/^\d+$/.test(o)) {
59
+ const e = parseInt(o) - 1, r = g[t];
60
+ if (r && r[e])
61
+ return r[e].value;
62
62
  }
63
- return o.cartItemsSelectControlValue;
63
+ return i.cartItemsSelectControlValue;
64
64
  }
65
- function C(r) {
66
- const t = r.querySelector("esd-config-block");
65
+ function C(o) {
66
+ const t = o.querySelector("esd-config-block");
67
67
  if (!t)
68
68
  return null;
69
- const e = (c, s) => c == null ? s : c === "1" || c === "true", i = (c, s) => c || s, u = t.getAttribute("data-type"), a = m(u), d = t.getAttribute("data-cart_items_select_control_value"), l = I(d, a);
69
+ const e = (c, a) => c == null ? a : c === "1" || c === "true", r = (c, a) => c || a, l = t.getAttribute("data-type"), u = m(l), _ = t.getAttribute("data-cart_items_select_control_value"), p = I(_, u);
70
70
  return {
71
71
  initialized: e(t.getAttribute("data-initialized"), !1),
72
- blockInstanceId: i(
72
+ blockInstanceId: r(
73
73
  t.getAttribute("data-block-instance-id"),
74
- _()
74
+ d()
75
75
  ),
76
- source: a,
77
- type: a,
78
- itemsSelectValue: l,
76
+ source: u,
77
+ type: u,
78
+ itemsSelectValue: p,
79
79
  orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
80
80
  nameTrimming: e(
81
81
  t.getAttribute("data-product_name_control_trim"),
@@ -93,28 +93,28 @@ function C(r) {
93
93
  t.getAttribute("data-product_price_control_single_price"),
94
94
  !1
95
95
  ),
96
- priceCurrencySymbol: i(
97
- t.getAttribute("data-product_price_control_currency_symbol"),
98
- o.productPriceCurrencySymbolControlValue
96
+ priceCurrencySymbol: r(
97
+ t.getAttribute("data-product_price_currency_symbol"),
98
+ i.productPriceCurrencySymbolControlValue
99
99
  ),
100
- priceCurrencyLocation: i(
100
+ priceCurrencyLocation: r(
101
101
  t.getAttribute("data-product_price_currency_location"),
102
- o.productPriceCurrencyLocationControlValue
102
+ i.productPriceCurrencyLocationControlValue
103
103
  ),
104
104
  priceOrientation: t.getAttribute("data-product_original_price_control_orientation") || "horizontal",
105
105
  quantityControlEnabled: e(
106
106
  t.getAttribute("data-product_quantity_control_enabled"),
107
107
  !0
108
108
  ),
109
- buttonLink: i(
109
+ buttonLink: r(
110
110
  t.getAttribute("data-product_button_link"),
111
- o.productButtonLinkControlValue
111
+ i.productButtonLinkControlValue
112
112
  ),
113
- imageLink: i(
113
+ imageLink: r(
114
114
  t.getAttribute("data-product_image_link"),
115
- o.productImageLinkControlValue
115
+ i.productImageLinkControlValue
116
116
  ),
117
- buttonLabel: i(
117
+ buttonLabel: r(
118
118
  t.getAttribute("data-product_button_control_label"),
119
119
  "Buy"
120
120
  ),
@@ -149,28 +149,28 @@ function C(r) {
149
149
  )
150
150
  };
151
151
  }
152
- function y(r) {
153
- const t = p(r);
152
+ function y(o) {
153
+ const t = s(o);
154
154
  if (!t)
155
155
  return null;
156
156
  const e = t.getNodeConfig();
157
157
  if (e && e.initialized)
158
158
  return e;
159
- const i = C(t);
160
- return i || null;
159
+ const r = C(t);
160
+ return r || null;
161
161
  }
162
- function A(r, t, e, i) {
163
- const u = p(r);
164
- if (!u)
162
+ function A(o, t, e) {
163
+ const r = s(o);
164
+ if (!r)
165
165
  return;
166
- const d = { ...u.getNodeConfig() || {}, ...e }, l = i ?? t.getDocumentModifier();
167
- l.modifyHtml(u).setNodeConfig(d), i || l.apply(new b("Update Items block configuration"));
166
+ const u = { ...r.getNodeConfig() || {}, ...e };
167
+ t.getDocumentModifier().modifyHtml(r).setNodeConfig(u).apply(new b("Update Items block configuration"));
168
168
  }
169
169
  export {
170
170
  E as escapeReplacement,
171
- _ as generateBlockInstanceId,
171
+ d as generateBlockInstanceId,
172
172
  S as getDefaultItemsBlockConfig,
173
173
  y as getItemsBlockConfig,
174
- p as getItemsBlockContainer,
174
+ s as getItemsBlockContainer,
175
175
  A as setItemsBlockConfig
176
176
  };
@@ -1,7 +1,7 @@
1
1
  function a(n) {
2
- return "getInnerHTML" in n && typeof n.getInnerHTML == "function" ? n.getInnerHTML().trim() : "innerHTML" in n ? n.innerHTML : "";
2
+ return "getInnerHTML" in n && typeof n.getInnerHTML == "function" ? n.getInnerHTML() : "innerHTML" in n ? n.innerHTML : "";
3
3
  }
4
- function m(n, t) {
4
+ function H(n, t) {
5
5
  if (!n)
6
6
  return t;
7
7
  const r = a(n);
@@ -21,5 +21,5 @@ function m(n, t) {
21
21
  return i.length > 0 ? i.join("") + t + s.join("") : t;
22
22
  }
23
23
  export {
24
- m as preserveTextStyles
24
+ H as preserveTextStyles
25
25
  };
@@ -1,8 +1,8 @@
1
1
  var I = Object.defineProperty;
2
- var O = (T, r, e) => r in T ? I(T, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[r] = e;
3
- var u = (T, r, e) => O(T, typeof r != "symbol" ? r + "" : r, e);
4
- import { Control as c, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- class _ extends c {
2
+ var c = (T, r, e) => r in T ? I(T, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[r] = e;
3
+ var u = (T, r, e) => c(T, typeof r != "symbol" ? r + "" : r, e);
4
+ import { Control as O, UIElementType as t, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ class _ extends O {
6
6
  constructor() {
7
7
  super(...arguments);
8
8
  u(this, "currentNode");
@@ -33,100 +33,101 @@ class _ extends c {
33
33
  const e = this.getItemsBlockContainer();
34
34
  if (!e)
35
35
  return null;
36
- const t = e.getNodeConfig();
37
- return t && typeof t.blockInstanceId == "string" ? t.blockInstanceId : null;
36
+ const n = e.getNodeConfig();
37
+ return n && typeof n.blockInstanceId == "string" ? n.blockInstanceId : null;
38
38
  }
39
39
  /**
40
- * Handles block instance change detection and UI updates.
41
- * This is a helper method for controls that need to update UI when switching between block instances.
40
+ * Handles block instance change detection and syncing.
41
+ * This is a helper method for controls that need to sync config when switching between block instances.
42
42
  * Uses Stripo V2 nodeConfig API for block instance tracking.
43
- * @param updateUI - Function to call to update the UI (called on every update)
43
+ * @param syncFunction - Function to call when block instance changes (to sync from node config)
44
+ * @param updateUI - Function to call to update the UI (called both on change and when same block)
44
45
  * @returns true if block instance changed, false otherwise
45
46
  */
46
- handleBlockInstanceChange(e) {
47
- const t = this.getBlockInstanceId();
48
- if (!t)
47
+ handleBlockInstanceChange(e, n) {
48
+ const E = this.getBlockInstanceId();
49
+ if (!E)
49
50
  return !1;
50
- const E = t !== this.lastBlockInstanceId;
51
- return e(), E && (this.lastBlockInstanceId = t), E;
51
+ const o = E !== this.lastBlockInstanceId;
52
+ return o ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = E) : n(), o;
52
53
  }
53
- _GuLabel({ text: e, name: t = "" }) {
54
+ _GuLabel({ text: e, name: n = "" }) {
54
55
  return `
55
- <${n.LABEL}
56
+ <${t.LABEL}
56
57
  ${$.LABEL.text}="${e}"
57
- ${$.LABEL.name}="${t || `${e} Label`}">
58
- </${n.LABEL}>
58
+ ${$.LABEL.name}="${n || `${e} Label`}">
59
+ </${t.LABEL}>
59
60
  `;
60
61
  }
61
62
  _GuToggle(e) {
62
63
  return `
63
- <${n.SWITCHER}
64
+ <${t.SWITCHER}
64
65
  ${$.SWITCHER.name}="${e}">
65
- </${n.SWITCHER}>
66
+ </${t.SWITCHER}>
66
67
  `;
67
68
  }
68
- _GuSelectItem({ text: e, value: t }) {
69
+ _GuSelectItem({ text: e, value: n }) {
69
70
  return `
70
- <${n.SELECT_ITEM}
71
+ <${t.SELECT_ITEM}
71
72
  ${$.SELECT_ITEM.text}="${e}"
72
- ${$.SELECT_ITEM.value}="${t}">
73
- </${n.SELECT_ITEM}>`;
73
+ ${$.SELECT_ITEM.value}="${n}">
74
+ </${t.SELECT_ITEM}>`;
74
75
  }
75
- _GuSelect({ name: e, placeholder: t, options: E, className: o = "es-180w" }) {
76
+ _GuSelect({ name: e, placeholder: n, options: E, className: o = "es-180w" }) {
76
77
  return `
77
- <${n.SELECTPICKER}
78
+ <${t.SELECTPICKER}
78
79
  class="${o}"
79
80
  ${$.SELECTPICKER.name}="${e}"
80
- ${$.SELECTPICKER.placeholder}="${t}">
81
+ ${$.SELECTPICKER.placeholder}="${n}">
81
82
  ${E.map((a) => this._GuSelectItem(a)).join("")}
82
- </${n.SELECTPICKER}>
83
+ </${t.SELECTPICKER}>
83
84
  `;
84
85
  }
85
- _GuTextInput({ name: e, placeholder: t, className: E = "", disabled: o = !1 }) {
86
+ _GuTextInput({ name: e, placeholder: n, className: E = "", disabled: o = !1 }) {
86
87
  return `
87
- <${n.TEXT}
88
+ <${t.TEXT}
88
89
  class=${E}
89
90
  ${$.TEXT.name}="${e}"
90
- placeholder="${t || e}"
91
+ placeholder="${n || e}"
91
92
  ${o ? `${$.TEXT.disabled}="true"` : ""}>
92
- </${n.TEXT}>
93
+ </${t.TEXT}>
93
94
  `;
94
95
  }
95
- _GuCounter({ name: e, maxValue: t, minValue: E = 1, step: o = 1 }) {
96
+ _GuCounter({ name: e, maxValue: n, minValue: E = 1, step: o = 1 }) {
96
97
  return `
97
- <${n.COUNTER}
98
+ <${t.COUNTER}
98
99
  ${$.COUNTER.name}="${e}"
99
100
  ${$.COUNTER.minValue}="${E}"
100
- ${$.COUNTER.maxValue}="${t}"
101
+ ${$.COUNTER.maxValue}="${n}"
101
102
  ${$.COUNTER.step}="${o}">
102
- </${n.COUNTER}>
103
+ </${t.COUNTER}>
103
104
  `;
104
105
  }
105
- _GuRadioButtonItem({ text: e, value: t, icon: E }) {
106
+ _GuRadioButtonItem({ text: e, value: n, icon: E }) {
106
107
  return `
107
- <${n.RADIO_ITEM}
108
- ${$.RADIO_ITEM.value}="${t}"
108
+ <${t.RADIO_ITEM}
109
+ ${$.RADIO_ITEM.value}="${n}"
109
110
  ${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
110
111
  ${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
111
- </${n.RADIO_ITEM}>
112
+ </${t.RADIO_ITEM}>
112
113
  `;
113
114
  }
114
- _GuRadioButton({ name: e, buttons: t, id: E = "" }) {
115
+ _GuRadioButton({ name: e, buttons: n, id: E = "" }) {
115
116
  return `
116
- <${n.RADIO_BUTTONS}
117
+ <${t.RADIO_BUTTONS}
117
118
  ${E ? `id="${E}"` : ""}
118
119
  ${$.RADIO_BUTTONS.name}="${e}">
119
- ${t.map((o) => this._GuRadioButtonItem(o)).join("")}
120
- </${n.RADIO_BUTTONS}>
120
+ ${n.map((o) => this._GuRadioButtonItem(o)).join("")}
121
+ </${t.RADIO_BUTTONS}>
121
122
  `;
122
123
  }
123
- _GuButton({ name: e, label: t, id: E = "" }) {
124
+ _GuButton({ name: e, label: n, id: E = "" }) {
124
125
  return `
125
- <${n.BUTTON}
126
+ <${t.BUTTON}
126
127
  ${$.BUTTON.name}="${e}"
127
128
  ${E ? `id="${E}"` : ""}
128
- ${$.BUTTON.caption}="${t}"}>
129
- </${n.BUTTON}>
129
+ ${$.BUTTON.caption}="${n}"}>
130
+ </${t.BUTTON}>
130
131
  `;
131
132
  }
132
133
  /**
@@ -134,25 +135,25 @@ class _ extends c {
134
135
  * @param param0
135
136
  * @returns It returns a button with an icon.
136
137
  */
137
- _GuIconButton({ name: e, icon: t, className: E = "" }) {
138
+ _GuIconButton({ name: e, icon: n, className: E = "" }) {
138
139
  return `
139
- <${n.BUTTON}
140
+ <${t.BUTTON}
140
141
  class="${E}"
141
142
  ${$.BUTTON.name}="${e}"
142
- ${$.BUTTON.icon}="${t}">
143
- </${n.BUTTON}>
143
+ ${$.BUTTON.icon}="${n}">
144
+ </${t.BUTTON}>
144
145
  `;
145
146
  }
146
- _GuOneColumn(e, t = "") {
147
+ _GuOneColumn(e, n = "") {
147
148
  return `
148
- <div class="container one-column ${t}">
149
+ <div class="container one-column ${n}">
149
150
  ${e.join("")}
150
151
  </div>
151
152
  `;
152
153
  }
153
- _GuTwoColumns(e, t = "") {
154
+ _GuTwoColumns(e, n = "") {
154
155
  return `
155
- <div class="container two-columns ${t}">
156
+ <div class="container two-columns ${n}">
156
157
  ${e.join("")}
157
158
  </div>
158
159
  `;
@@ -164,79 +165,79 @@ class _ extends c {
164
165
  * @param itemLabels - Optional array of objects with key and label properties for display
165
166
  * @returns HTML string for the orderable control
166
167
  */
167
- _GuOrderable(e, t) {
168
+ _GuOrderable(e, n) {
168
169
  let E = "";
169
- t.forEach((a) => {
170
+ n.forEach((a) => {
170
171
  const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
171
172
  E += `
172
- <${n.ORDERABLE_ITEM} ${l}="${a.key}">
173
+ <${t.ORDERABLE_ITEM} ${l}="${a.key}">
173
174
  ${a.content}
174
- </${n.ORDERABLE_ITEM}>
175
+ </${t.ORDERABLE_ITEM}>
175
176
  `;
176
177
  });
177
178
  const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
178
179
  return `
179
- <${n.ORDERABLE} ${o}="${e}">
180
+ <${t.ORDERABLE} ${o}="${e}">
180
181
  ${E}
181
- </${n.ORDERABLE}>
182
+ </${t.ORDERABLE}>
182
183
  `;
183
184
  }
184
- _GuNestedControl(e, t) {
185
+ _GuNestedControl(e, n) {
185
186
  return `
186
- <${n.NESTED_CONTROL} ${$.NESTED_CONTROL.controlId}="${e}">
187
- ${t}
188
- </${n.NESTED_CONTROL}>
187
+ <${t.NESTED_CONTROL} ${$.NESTED_CONTROL.controlId}="${e}">
188
+ ${n}
189
+ </${t.NESTED_CONTROL}>
189
190
  `;
190
191
  }
191
- _GuExpandable(e, t) {
192
+ _GuExpandable(e, n) {
192
193
  return `
193
- <${n.EXPANDABLE}>
194
- <${n.EXPANDABLE_HEADER}>
195
- <${n.LABEL} ${$.LABEL.text}="${e}"></${n.LABEL}>
196
- </${n.EXPANDABLE_HEADER}>
197
- <${n.EXPANDABLE_CONTENT}>
194
+ <${t.EXPANDABLE}>
195
+ <${t.EXPANDABLE_HEADER}>
196
+ <${t.LABEL} ${$.LABEL.text}="${e}"></${t.LABEL}>
197
+ </${t.EXPANDABLE_HEADER}>
198
+ <${t.EXPANDABLE_CONTENT}>
198
199
 
199
- ${t}
200
+ ${n}
200
201
 
201
- </${n.EXPANDABLE_CONTENT}>
202
- </${n.EXPANDABLE}>
202
+ </${t.EXPANDABLE_CONTENT}>
203
+ </${t.EXPANDABLE}>
203
204
  `;
204
205
  }
205
206
  _GuColorPicker(e) {
206
207
  return `
207
- <${n.COLOR}
208
+ <${t.COLOR}
208
209
  ${$.COLOR.name}="${e}">
209
- </${n.COLOR}>
210
+ </${t.COLOR}>
210
211
  `;
211
212
  }
212
- _GuFontFamily(e, t = "Select Font") {
213
+ _GuFontFamily(e, n = "Select Font") {
213
214
  return `
214
- <${n.FONT_FAMILY_SELECT}
215
+ <${t.FONT_FAMILY_SELECT}
215
216
  ${$.FONT_FAMILY_SELECT.name}="${e}"
216
- ${$.FONT_FAMILY_SELECT.placeholder}="${t}">
217
- </${n.FONT_FAMILY_SELECT}>
217
+ ${$.FONT_FAMILY_SELECT.placeholder}="${n}">
218
+ </${t.FONT_FAMILY_SELECT}>
218
219
  `;
219
220
  }
220
- _GuRadioButtons(e, t) {
221
- const E = t.map((o) => `
222
- <${n.RADIO_ITEM}
221
+ _GuRadioButtons(e, n) {
222
+ const E = n.map((o) => `
223
+ <${t.RADIO_ITEM}
223
224
  ${$.RADIO_ITEM.text}="${o.text}"
224
225
  ${$.RADIO_ITEM.value}="${o.value}">
225
- </${n.RADIO_ITEM}>
226
+ </${t.RADIO_ITEM}>
226
227
  `).join("");
227
228
  return `
228
- <${n.RADIO_BUTTONS}
229
+ <${t.RADIO_BUTTONS}
229
230
  ${$.RADIO_BUTTONS.name}="${e}">
230
231
  ${E}
231
- </${n.RADIO_BUTTONS}>
232
+ </${t.RADIO_BUTTONS}>
232
233
  `;
233
234
  }
234
- _GuCheckbox(e, t) {
235
+ _GuCheckbox(e, n) {
235
236
  return `
236
- <${n.CHECKBOX}
237
+ <${t.CHECKBOX}
237
238
  ${$.CHECKBOX.name}="${e}"
238
- ${$.CHECKBOX.caption}="${t}">
239
- </${n.CHECKBOX}>
239
+ ${$.CHECKBOX.caption}="${n}">
240
+ </${t.CHECKBOX}>
240
241
  `;
241
242
  }
242
243
  }
@@ -23,4 +23,5 @@ export declare class ItemsBlock extends Block {
23
23
  getTemplate(): string;
24
24
  allowInnerBlocksDND(): boolean;
25
25
  onCreated(node: ImmutableHtmlNode): void;
26
+ onSelect(node: ImmutableHtmlNode): void;
26
27
  }
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.BUTTON_LINK;
5
5
  export declare class ButtonLinkControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -2,6 +2,7 @@ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
2
  import { CommonControl } from '../../common-control';
3
3
  export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-items-card-composition-block";
4
4
  export declare class ItemsBlockCardCompositionControl extends CommonControl {
5
+ private store;
5
6
  private visibilityState;
6
7
  getId(): string;
7
8
  getTemplate(): string;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.IMAGE_LINK;
5
5
  export declare class ImageLinkControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.NAME_TRIMMING;
5
5
  export declare class NameTrimmingControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_CURRENCY_LOCATION;
5
5
  export declare class PriceCurrencyLocationControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_CURRENCY_SYMBOL;
5
5
  export declare class PriceCurrencySymbolControl extends CommonControl {
6
+ private store;
6
7
  private originalPriceContents;
7
8
  getId(): string;
8
9
  getTemplate(): string;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_FORMATTED_PRICE;
5
5
  export declare class PriceFormattedPriceControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_HIDE_DISCOUNT;
5
5
  export declare class PriceHideDiscountControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_ORIENTATION;
5
5
  export declare class PriceOrientationControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
@@ -3,10 +3,15 @@ import { CommonControl } from '../../../common-control';
3
3
  import { ItemsBlockControlId } from '../../enums/controlEnums';
4
4
  export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_SINGLE_PRICE;
5
5
  export declare class PriceSinglePriceControl extends CommonControl {
6
+ private store;
6
7
  getId(): string;
7
8
  getTemplate(): string;
8
9
  onRender(): void;
9
10
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ /**
12
+ * Syncs single price state from nodeConfig.
13
+ */
14
+ private _syncSinglePriceFromNodeConfig;
10
15
  _onSinglePriceChange(value: boolean): void;
11
16
  private _updatePriceBlock;
12
17
  _getSinglePrice(): string;