@useinsider/guido 2.1.0-beta.bc18abc → 2.1.0-beta.da327fa

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