@useinsider/guido 3.9.0-beta.93e438c → 3.9.0-beta.978f9ce

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.
@@ -1,17 +1,24 @@
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";
2
+ import { ItemInCartOptions as p, DefaultConfigValues as i, SETTINGS_ENUMS as c } from "../enums/settingsEnums.js";
3
3
  function _() {
4
4
  return String(Date.now() + Math.floor(Math.random() * 1e3));
5
5
  }
6
- const E = (r) => r.replace(/\$/g, "$$$$");
7
- function y() {
6
+ const S = (r) => r.replace(/\$/g, "$$$$");
7
+ function y(r, t) {
8
+ const e = p[t], n = e ? e.findIndex((u) => u.value === r) : -1;
9
+ if (n >= 0)
10
+ return String(n + 1);
11
+ const o = typeof r == "string" ? r.match(/\((\d+)\)/) : null;
12
+ return (o == null ? void 0 : o[1]) ?? "1";
13
+ }
14
+ function A() {
8
15
  return {
9
16
  initialized: !0,
10
17
  blockInstanceId: _(),
11
- source: n.ITEMS_TYPE.CART_ITEMS,
12
- type: n.ITEMS_TYPE.CART_ITEMS,
18
+ source: c.ITEMS_TYPE.CART_ITEMS,
19
+ type: c.ITEMS_TYPE.CART_ITEMS,
13
20
  itemsSelectValue: i.cartItemsSelectControlValue,
14
- orientation: n.ORIENTATION.VERTICAL,
21
+ orientation: c.ORIENTATION.VERTICAL,
15
22
  nameTrimming: i.productNameTrimmingControlValue === "1",
16
23
  priceHideDiscount: i.productPriceHideDiscountControlValue === "1",
17
24
  priceFormatted: i.productPriceFormattedControlValue === "1",
@@ -33,7 +40,7 @@ function y() {
33
40
  buttonVisible: i.productButtonVisible === "1"
34
41
  };
35
42
  }
36
- function p(r) {
43
+ function g(r) {
37
44
  if (!r)
38
45
  return null;
39
46
  const t = r.closest(".items-block-v2");
@@ -41,14 +48,14 @@ function p(r) {
41
48
  }
42
49
  function m(r) {
43
50
  return r ? {
44
- CartItems: n.ITEMS_TYPE.CART_ITEMS,
45
- BrowsedItems: n.ITEMS_TYPE.BROWSED_ITEMS,
46
- PurchasedItems: n.ITEMS_TYPE.PURCHASED_ITEMS,
51
+ CartItems: c.ITEMS_TYPE.CART_ITEMS,
52
+ BrowsedItems: c.ITEMS_TYPE.BROWSED_ITEMS,
53
+ PurchasedItems: c.ITEMS_TYPE.PURCHASED_ITEMS,
47
54
  // Also handle already correct formats
48
- CART_ITEMS: n.ITEMS_TYPE.CART_ITEMS,
49
- BROWSED_ITEMS: n.ITEMS_TYPE.BROWSED_ITEMS,
50
- PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
51
- }[r] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
55
+ CART_ITEMS: c.ITEMS_TYPE.CART_ITEMS,
56
+ BROWSED_ITEMS: c.ITEMS_TYPE.BROWSED_ITEMS,
57
+ PURCHASED_ITEMS: c.ITEMS_TYPE.PURCHASED_ITEMS
58
+ }[r] || c.ITEMS_TYPE.CART_ITEMS : c.ITEMS_TYPE.CART_ITEMS;
52
59
  }
53
60
  function f(r, t) {
54
61
  if (!r)
@@ -56,27 +63,27 @@ function f(r, t) {
56
63
  if (r.includes("{{"))
57
64
  return r;
58
65
  if (/^\d+$/.test(r)) {
59
- const e = parseInt(r) - 1, o = g[t];
60
- if (o && o[e])
61
- return o[e].value;
66
+ const e = parseInt(r) - 1, n = p[t];
67
+ if (n && n[e])
68
+ return n[e].value;
62
69
  }
63
70
  return i.cartItemsSelectControlValue;
64
71
  }
65
- function C(r) {
72
+ function I(r) {
66
73
  const t = r.querySelector("esd-config-block");
67
74
  if (!t)
68
75
  return null;
69
- const e = (u, s) => u == null ? s : u === "1" || u === "true", o = (u, s) => u || s, c = t.getAttribute("data-type"), a = m(c), d = t.getAttribute("data-cart_items_select_control_value"), l = f(d, a);
76
+ const e = (a, s) => a == null ? s : a === "1" || a === "true", n = (a, s) => a || s, o = t.getAttribute("data-type"), u = m(o), d = t.getAttribute("data-cart_items_select_control_value"), l = f(d, u);
70
77
  return {
71
78
  initialized: e(t.getAttribute("data-initialized"), !1),
72
- blockInstanceId: o(
79
+ blockInstanceId: n(
73
80
  t.getAttribute("data-block-instance-id"),
74
81
  _()
75
82
  ),
76
- source: a,
77
- type: a,
83
+ source: u,
84
+ type: u,
78
85
  itemsSelectValue: l,
79
- orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
86
+ orientation: t.getAttribute("data-card_orientation_control_value") || c.ORIENTATION.VERTICAL,
80
87
  nameTrimming: e(
81
88
  t.getAttribute("data-product_name_control_trim"),
82
89
  !0
@@ -93,11 +100,11 @@ function C(r) {
93
100
  t.getAttribute("data-product_price_control_single_price"),
94
101
  !1
95
102
  ),
96
- priceCurrencySymbol: o(
103
+ priceCurrencySymbol: n(
97
104
  t.getAttribute("data-product_price_control_currency_symbol"),
98
105
  i.productPriceCurrencySymbolControlValue
99
106
  ),
100
- priceCurrencyLocation: o(
107
+ priceCurrencyLocation: n(
101
108
  t.getAttribute("data-product_price_currency_location"),
102
109
  i.productPriceCurrencyLocationControlValue
103
110
  ),
@@ -106,15 +113,15 @@ function C(r) {
106
113
  t.getAttribute("data-product_quantity_control_enabled"),
107
114
  !0
108
115
  ),
109
- buttonLink: o(
116
+ buttonLink: n(
110
117
  t.getAttribute("data-product_button_link"),
111
118
  i.productButtonLinkControlValue
112
119
  ),
113
- imageLink: o(
120
+ imageLink: n(
114
121
  t.getAttribute("data-product_image_link"),
115
122
  i.productImageLinkControlValue
116
123
  ),
117
- buttonLabel: o(
124
+ buttonLabel: n(
118
125
  t.getAttribute("data-product_button_control_label"),
119
126
  "Buy"
120
127
  ),
@@ -149,7 +156,7 @@ function C(r) {
149
156
  )
150
157
  };
151
158
  }
152
- function I(r) {
159
+ function C(r) {
153
160
  if (typeof r.getAttribute != "function")
154
161
  return null;
155
162
  const t = r.getAttribute("esd-ext-config");
@@ -163,31 +170,32 @@ function I(r) {
163
170
  }
164
171
  return null;
165
172
  }
166
- function A(r) {
167
- const t = p(r);
173
+ function V(r) {
174
+ const t = g(r);
168
175
  if (!t)
169
176
  return null;
170
177
  const e = t.getNodeConfig();
171
178
  if (e && e.initialized)
172
179
  return e;
180
+ const n = C(t);
181
+ if (n)
182
+ return n;
173
183
  const o = I(t);
174
- if (o)
175
- return o;
176
- const c = C(t);
177
- return c || null;
184
+ return o || null;
178
185
  }
179
- function V(r, t, e, o) {
180
- const c = p(r);
181
- if (!c)
186
+ function M(r, t, e, n) {
187
+ const o = g(r);
188
+ if (!o)
182
189
  return;
183
- const d = { ...c.getNodeConfig() || {}, ...e }, l = o ?? t.getDocumentModifier();
184
- l.modifyHtml(c).setNodeConfig(d), o || l.apply(new b("Update Items block configuration"));
190
+ const d = { ...o.getNodeConfig() || {}, ...e }, l = n ?? t.getDocumentModifier();
191
+ l.modifyHtml(o).setNodeConfig(d), n || l.apply(new b("Update Items block configuration"));
185
192
  }
186
193
  export {
187
- E as escapeReplacement,
194
+ y as deriveItemNumber,
195
+ S as escapeReplacement,
188
196
  _ as generateBlockInstanceId,
189
- y as getDefaultItemsBlockConfig,
190
- A as getItemsBlockConfig,
191
- p as getItemsBlockContainer,
192
- V as setItemsBlockConfig
197
+ A as getDefaultItemsBlockConfig,
198
+ V as getItemsBlockConfig,
199
+ g as getItemsBlockContainer,
200
+ M as setItemsBlockConfig
193
201
  };
@@ -1,23 +1,23 @@
1
- var c = Object.defineProperty;
2
- var l = (s, o, t) => o in s ? c(s, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[o] = t;
3
- var a = (s, o, t) => l(s, typeof o != "symbol" ? o + "" : o, t);
4
- import { UEAttr as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as d } from "../../../common-control.js";
1
+ var d = Object.defineProperty;
2
+ var h = (o, r, t) => r in o ? d(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t;
3
+ var c = (o, r, t) => h(o, typeof r != "symbol" ? r + "" : r, t);
4
+ import { UEAttr as u } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as m } from "../../../common-control.js";
6
6
  import { RecommendationConfigService as n } from "../../services/configService.js";
7
- import { useRecommendationExtensionStore as m } from "../../store/recommendation.js";
8
- import { mapLegacyStrategy as g } from "../../utils/legacyStrategyMap.js";
9
- const u = "recommendation-algorithm-control", i = {
7
+ import { useRecommendationExtensionStore as g } from "../../store/recommendation.js";
8
+ import { mapLegacyStrategy as p } from "../../utils/legacyStrategyMap.js";
9
+ const C = "recommendation-algorithm-control", i = {
10
10
  ALGORITHM: "strategy",
11
11
  PRODUCT_IDS: "productIds"
12
12
  };
13
- class R extends d {
13
+ class R extends m {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  // Store is used ONLY for API-fetched data (algorithms list), not for config
17
- a(this, "store", m());
17
+ c(this, "store", g());
18
18
  }
19
19
  getId() {
20
- return u;
20
+ return C;
21
21
  }
22
22
  getTemplate() {
23
23
  return `
@@ -30,10 +30,10 @@ class R extends d {
30
30
  options: this.store.getActivePredictiveAlgorithms
31
31
  }),
32
32
  this._GuLabel({ text: this.api.translate("Product Ids"), name: `${i.PRODUCT_IDS}_label` }),
33
- this._GuTextInput({
33
+ this._GuMultiSelect({
34
34
  name: i.PRODUCT_IDS,
35
35
  placeholder: this.api.translate("Enter Product Ids"),
36
- className: "es-180w"
36
+ className: "product-ids-multiselect"
37
37
  })
38
38
  ])}
39
39
  </div>
@@ -46,11 +46,19 @@ class R extends d {
46
46
  super.onTemplateNodeUpdated(t), this._initializeSelectItems(), this._setFormValues();
47
47
  }
48
48
  _setFormValues() {
49
- const t = n.getConfig(this.currentNode), e = g(t.strategy) ?? t.strategy;
49
+ const t = n.getConfig(this.currentNode), e = p(t.strategy) ?? t.strategy;
50
50
  this._setProductIdsVisibility(e), this.api.updateValues({
51
51
  [i.ALGORITHM]: e,
52
- [i.PRODUCT_IDS]: t.productIds.join(",")
53
- });
52
+ // MULTIPLE_SELECT consumes a string[] directly (was a comma-joined string).
53
+ [i.PRODUCT_IDS]: t.productIds
54
+ }), this._clearProductIdsDraft();
55
+ }
56
+ // Stripo reuses one control instance across blocks and updateValues only
57
+ // rebinds the committed chips — clear any un-committed draft text on switch,
58
+ // but not while focused (the user is mid-typing in the current block).
59
+ _clearProductIdsDraft() {
60
+ const t = this.getContainer(), e = t == null ? void 0 : t.querySelector(".product-ids-multiselect .multiple-input");
61
+ e && e.value !== "" && (t == null ? void 0 : t.activeElement) !== e && (e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })));
54
62
  }
55
63
  _initializeSelectItems() {
56
64
  var e;
@@ -59,16 +67,16 @@ class R extends d {
59
67
  try {
60
68
  this.api.setUIEAttribute(
61
69
  i.ALGORITHM,
62
- h.SELECTPICKER.items,
70
+ u.SELECTPICKER.items,
63
71
  t
64
72
  );
65
- } catch (r) {
66
- console.warn("[AlgorithmControl] Failed to set algorithm options:", r);
73
+ } catch (s) {
74
+ console.warn("[AlgorithmControl] Failed to set algorithm options:", s);
67
75
  }
68
76
  }
69
77
  _setProductIdsVisibility(t) {
70
- const r = (t ?? n.getConfig(this.currentNode).strategy) === "manualMerchandising";
71
- this.api.setVisibility(i.PRODUCT_IDS, r), this.api.setVisibility(`${i.PRODUCT_IDS}_label`, r);
78
+ const s = (t ?? n.getConfig(this.currentNode).strategy) === "manualMerchandising";
79
+ this.api.setVisibility(i.PRODUCT_IDS, s), this.api.setVisibility(`${i.PRODUCT_IDS}_label`, s);
72
80
  }
73
81
  _onAlgorithmChange(t) {
74
82
  !this.currentNode || n.getConfig(this.currentNode).strategy === t || (n.updateConfig(
@@ -81,13 +89,13 @@ class R extends d {
81
89
  _onProductIdsChange(t) {
82
90
  if (!this.currentNode)
83
91
  return;
84
- const e = t.split(",").map((r) => r.trim()).filter(Boolean);
85
- n.updateConfig(
92
+ const e = [...new Set((t ?? []).map((a) => String(a).trim()).filter(Boolean))], s = n.getConfig(this.currentNode).productIds;
93
+ s.length === e.length && s.every((a, l) => a === e[l]) || (n.updateConfig(
86
94
  this.api,
87
95
  this.currentNode,
88
96
  { productIds: e },
89
97
  "Updated product IDs"
90
- ), this.store.patchCurrentBlockConfig({ productIds: e });
98
+ ), this.store.patchCurrentBlockConfig({ productIds: e }));
91
99
  }
92
100
  _listenToFormUpdates() {
93
101
  this.api.onValueChanged(i.ALGORITHM, (t) => {
@@ -98,6 +106,6 @@ class R extends d {
98
106
  }
99
107
  }
100
108
  export {
101
- u as ALGORITHM_CONTROL_ID,
109
+ C as ALGORITHM_CONTROL_ID,
102
110
  R as AlgorithmControl
103
111
  };
@@ -1,16 +1,18 @@
1
1
  const n = `/* Utils */
2
- .es-180w { width: 180px; }
2
+ .es-180w {
3
+ width: 180px;
4
+ }
3
5
 
4
6
  /* Recommendation Controls - Main settings panel separators */
5
- .recommendation-controls-container > div {
7
+ .recommendation-controls-container>div {
6
8
  border-bottom: 1px solid #eee;
7
9
  }
8
10
 
9
- .recommendation-controls-container > div:first-child {
11
+ .recommendation-controls-container>div:first-child {
10
12
  padding-top: 0;
11
13
  }
12
14
 
13
- .recommendation-controls-container > div:last-child {
15
+ .recommendation-controls-container>div:last-child {
14
16
  border-bottom: none;
15
17
  }
16
18
 
@@ -289,6 +291,62 @@ ue-orderable.orderable-disabled .droppable-icon {
289
291
  font-weight: 400;
290
292
  line-height: 16px;
291
293
  }
294
+
295
+ /* product ID multiselect — initial */
296
+ .product-ids-multiselect {
297
+ background-color: var(--guido-color-gray-0);
298
+ border: 1px solid var(--guido-color-gray-300);
299
+ width: 180px;
300
+ }
301
+
302
+ /* product ID multiselect — hover */
303
+ .product-ids-multiselect:hover {
304
+ border-color: var(--guido-color-primary-500);
305
+ background-color: var(--guido-color-gray-0) !important;
306
+ }
307
+
308
+ /* product ID multiselect — selected (.on) */
309
+ .product-ids-multiselect.on,
310
+ .product-ids-multiselect.on:hover {
311
+ border-color: var(--guido-color-primary-500);
312
+ box-shadow: 0 0 0 3px var(--guido-color-primary-200) !important;
313
+ background-color: var(--guido-color-gray-0) !important;
314
+ }
315
+
316
+ .product-ids-multiselect .multiple-wrapper .multiple-item {
317
+ display: flex;
318
+ align-items: center;
319
+ border-radius: 4px;
320
+ border: 1px solid var(--guido-color-primary-200);
321
+ background-color: var(--guido-color-primary-0);
322
+ font-size: 13px;
323
+ color: var(--guido-color-primary-500);
324
+ line-height: 16px;
325
+ box-shadow: none;
326
+ padding: 0 4px;
327
+ }
328
+
329
+ /* Close (×): always visible, moved to the right, split off by a left border (Figma).
330
+ Label is a text node (can't be ordered) so the icon gets order:1 to sit after it;
331
+ Stripo toggles visibility inline on hover, hence !important to keep it shown. */
332
+ .product-ids-multiselect .multiple-wrapper .multiple-item .multiple-item-remove-icon {
333
+ visibility: visible !important;
334
+ opacity: 1;
335
+ position: static !important;
336
+ order: 1;
337
+ margin-left: 4px;
338
+ border-left: 1px solid var(--guido-color-primary-200);
339
+ color: var(--guido-color-primary-500);
340
+ cursor: pointer;
341
+ width: 16px;
342
+ height: 16px;
343
+ padding: 4px 0 4px 3px;
344
+ }
345
+
346
+ .product-ids-multiselect .multiple-wrapper .multiple-item:hover {
347
+ background-color: var(--guido-color-primary-0);
348
+ padding: 0 4px;
349
+ }
292
350
  `;
293
351
  export {
294
352
  n as default
@@ -1,12 +1,12 @@
1
1
  var c = Object.defineProperty;
2
- var i = (s, r, e) => r in s ? c(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
- var u = (s, r, e) => i(s, typeof r != "symbol" ? r + "" : r, e);
2
+ var i = (s, a, e) => a in s ? c(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
3
+ var T = (s, a, e) => i(s, typeof a != "symbol" ? a + "" : a, e);
4
4
  import { Control as I, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- class d extends I {
5
+ class _ extends I {
6
6
  constructor() {
7
7
  super(...arguments);
8
- u(this, "currentNode");
9
- u(this, "lastBlockInstanceId", null);
8
+ T(this, "currentNode");
9
+ T(this, "lastBlockInstanceId", null);
10
10
  }
11
11
  getContainer() {
12
12
  var e;
@@ -47,15 +47,15 @@ class d extends I {
47
47
  const t = this.getBlockInstanceId();
48
48
  if (!t)
49
49
  return !1;
50
- const o = t !== this.lastBlockInstanceId;
51
- return e(), o && (this.lastBlockInstanceId = t), o;
50
+ const E = t !== this.lastBlockInstanceId;
51
+ return e(), E && (this.lastBlockInstanceId = t), E;
52
52
  }
53
- _GuLabel({ text: e, name: t = "", hint: o }) {
53
+ _GuLabel({ text: e, name: t = "", hint: E }) {
54
54
  return `
55
55
  <${n.LABEL}
56
56
  ${$.LABEL.text}="${e}"
57
57
  ${$.LABEL.name}="${t || `${e} Label`}"
58
- ${o ? `${$.LABEL.hint}="${o}"` : ""}>
58
+ ${E ? `${$.LABEL.hint}="${E}"` : ""}>
59
59
  </${n.LABEL}>
60
60
  `;
61
61
  }
@@ -73,7 +73,7 @@ class d extends I {
73
73
  * Use in getTemplate() — the icon is registered in a hidden store so Stripo initializes it.
74
74
  * Pair with _setInfoMessageValue() in onRender() to set the text content.
75
75
  */
76
- _GuOnPageMessage({ name: e, icon: t = "not-found", type: o = "info" }) {
76
+ _GuOnPageMessage({ name: e, icon: t = "not-found", type: E = "info" }) {
77
77
  return `
78
78
  <div data-info-message="${e}" style="display: none; padding: 16px 16px 0;">
79
79
  <div class="icon-store" style="display: none;">
@@ -81,7 +81,7 @@ class d extends I {
81
81
  ${this._GuIcon({ src: t, className: "icon" })}
82
82
  </div>
83
83
  </div>
84
- ${this._GuMessage({ name: e, type: o })}
84
+ ${this._GuMessage({ name: e, type: E })}
85
85
  </div>
86
86
  `;
87
87
  }
@@ -91,7 +91,7 @@ class d extends I {
91
91
  * and combines it with the text in Stripo's alert-message layout.
92
92
  */
93
93
  _setInfoMessageValue(e, t) {
94
- const o = this.getContainer(), E = o.querySelector(`[data-icon-key="${e}"]`), a = E == null ? void 0 : E.querySelector("ue-icon-component"), l = (a == null ? void 0 : a.outerHTML) ?? "";
94
+ const E = this.getContainer(), o = E.querySelector(`[data-icon-key="${e}"]`), r = o == null ? void 0 : o.querySelector("ue-icon-component"), l = (r == null ? void 0 : r.outerHTML) ?? "";
95
95
  this.api.setUIEAttribute(
96
96
  e,
97
97
  "value",
@@ -104,8 +104,8 @@ class d extends I {
104
104
  </div>
105
105
  `
106
106
  );
107
- const T = o.querySelector(`[data-info-message="${e}"]`);
108
- T && (T.style.display = "");
107
+ const u = E.querySelector(`[data-info-message="${e}"]`);
108
+ u && (u.style.display = "");
109
109
  }
110
110
  _GuToggle(e) {
111
111
  return `
@@ -121,59 +121,59 @@ class d extends I {
121
121
  ${$.SELECT_ITEM.value}="${t}">
122
122
  </${n.SELECT_ITEM}>`;
123
123
  }
124
- _GuSelect({ name: e, placeholder: t, options: o, className: E = "es-180w" }) {
124
+ _GuSelect({ name: e, placeholder: t, options: E, className: o = "es-180w" }) {
125
125
  return `
126
126
  <${n.SELECTPICKER}
127
- class="${E}"
127
+ class="${o}"
128
128
  ${$.SELECTPICKER.name}="${e}"
129
129
  ${$.SELECTPICKER.placeholder}="${t}">
130
- ${o.map((a) => this._GuSelectItem(a)).join("")}
130
+ ${E.map((r) => this._GuSelectItem(r)).join("")}
131
131
  </${n.SELECTPICKER}>
132
132
  `;
133
133
  }
134
- _GuTextInput({ name: e, placeholder: t, className: o = "", disabled: E = !1 }) {
134
+ _GuTextInput({ name: e, placeholder: t, className: E = "", disabled: o = !1 }) {
135
135
  return `
136
136
  <${n.TEXT}
137
- class=${o}
137
+ class=${E}
138
138
  ${$.TEXT.name}="${e}"
139
139
  placeholder="${t || e}"
140
- ${E ? `${$.TEXT.disabled}="true"` : ""}>
140
+ ${o ? `${$.TEXT.disabled}="true"` : ""}>
141
141
  </${n.TEXT}>
142
142
  `;
143
143
  }
144
- _GuCounter({ name: e, maxValue: t, minValue: o = 1, step: E = 1 }) {
144
+ _GuCounter({ name: e, maxValue: t, minValue: E = 1, step: o = 1 }) {
145
145
  return `
146
146
  <${n.COUNTER}
147
147
  ${$.COUNTER.name}="${e}"
148
- ${$.COUNTER.minValue}="${o}"
148
+ ${$.COUNTER.minValue}="${E}"
149
149
  ${$.COUNTER.maxValue}="${t}"
150
- ${$.COUNTER.step}="${E}">
150
+ ${$.COUNTER.step}="${o}">
151
151
  </${n.COUNTER}>
152
152
  `;
153
153
  }
154
- _GuRadioButtonItem({ text: e, value: t, icon: o }) {
154
+ _GuRadioButtonItem({ text: e, value: t, icon: E }) {
155
155
  return `
156
156
  <${n.RADIO_ITEM}
157
157
  ${$.RADIO_ITEM.value}="${t}"
158
158
  ${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
159
- ${o ? `${$.RADIO_ITEM.icon}="${o}"` : ""}>
159
+ ${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
160
160
  </${n.RADIO_ITEM}>
161
161
  `;
162
162
  }
163
- _GuRadioButton({ name: e, buttons: t, id: o = "" }) {
163
+ _GuRadioButton({ name: e, buttons: t, id: E = "" }) {
164
164
  return `
165
165
  <${n.RADIO_BUTTONS}
166
- ${o ? `id="${o}"` : ""}
166
+ ${E ? `id="${E}"` : ""}
167
167
  ${$.RADIO_BUTTONS.name}="${e}">
168
- ${t.map((E) => this._GuRadioButtonItem(E)).join("")}
168
+ ${t.map((o) => this._GuRadioButtonItem(o)).join("")}
169
169
  </${n.RADIO_BUTTONS}>
170
170
  `;
171
171
  }
172
- _GuButton({ name: e, label: t, id: o = "" }) {
172
+ _GuButton({ name: e, label: t, id: E = "" }) {
173
173
  return `
174
174
  <${n.BUTTON}
175
175
  ${$.BUTTON.name}="${e}"
176
- ${o ? `id="${o}"` : ""}
176
+ ${E ? `id="${E}"` : ""}
177
177
  ${$.BUTTON.caption}="${t}"}>
178
178
  </${n.BUTTON}>
179
179
  `;
@@ -191,10 +191,10 @@ class d extends I {
191
191
  * @param param0
192
192
  * @returns It returns a button with an icon.
193
193
  */
194
- _GuIconButton({ name: e, icon: t, className: o = "" }) {
194
+ _GuIconButton({ name: e, icon: t, className: E = "" }) {
195
195
  return `
196
196
  <${n.BUTTON}
197
- class="${o}"
197
+ class="${E}"
198
198
  ${$.BUTTON.name}="${e}"
199
199
  ${$.BUTTON.icon}="${t}">
200
200
  </${n.BUTTON}>
@@ -222,19 +222,19 @@ class d extends I {
222
222
  * @returns HTML string for the orderable control
223
223
  */
224
224
  _GuOrderable(e, t) {
225
- let o = "";
226
- t.forEach((a) => {
225
+ let E = "";
226
+ t.forEach((r) => {
227
227
  const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
228
- o += `
229
- <${n.ORDERABLE_ITEM} ${l}="${a.key}">
230
- ${a.content}
228
+ E += `
229
+ <${n.ORDERABLE_ITEM} ${l}="${r.key}">
230
+ ${r.content}
231
231
  </${n.ORDERABLE_ITEM}>
232
232
  `;
233
233
  });
234
- const E = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
234
+ const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
235
235
  return `
236
- <${n.ORDERABLE} ${E}="${e}">
237
- ${o}
236
+ <${n.ORDERABLE} ${o}="${e}">
237
+ ${E}
238
238
  </${n.ORDERABLE}>
239
239
  `;
240
240
  }
@@ -275,16 +275,16 @@ class d extends I {
275
275
  `;
276
276
  }
277
277
  _GuRadioButtons(e, t) {
278
- const o = t.map((E) => `
278
+ const E = t.map((o) => `
279
279
  <${n.RADIO_ITEM}
280
- ${$.RADIO_ITEM.text}="${E.text}"
281
- ${$.RADIO_ITEM.value}="${E.value}">
280
+ ${$.RADIO_ITEM.text}="${o.text}"
281
+ ${$.RADIO_ITEM.value}="${o.value}">
282
282
  </${n.RADIO_ITEM}>
283
283
  `).join("");
284
284
  return `
285
285
  <${n.RADIO_BUTTONS}
286
286
  ${$.RADIO_BUTTONS.name}="${e}">
287
- ${o}
287
+ ${E}
288
288
  </${n.RADIO_BUTTONS}>
289
289
  `;
290
290
  }
@@ -296,7 +296,20 @@ class d extends I {
296
296
  </${n.CHECKBOX}>
297
297
  `;
298
298
  }
299
+ // Tag/chips input (Stripo MULTIPLE_SELECT): add-by-Enter, remove-by-×.
300
+ // Value is read/written as a string[] via updateValues / onValueChanged.
301
+ _GuMultiSelect({ name: e, placeholder: t = "", className: E = "", disabled: o = !1 }) {
302
+ const r = [E, o ? "" : "click-enabled"].filter(Boolean).join(" ");
303
+ return `
304
+ <${n.MULTIPLE_SELECT}
305
+ class="${r}"
306
+ ${$.MULTIPLE_SELECT.name}="${e}"
307
+ ${$.MULTIPLE_SELECT.placeholder}="${t}"
308
+ ${o ? `${$.MULTIPLE_SELECT.disabled}="true"` : ""}>
309
+ </${n.MULTIPLE_SELECT}>
310
+ `;
311
+ }
299
312
  }
300
313
  export {
301
- d as CommonControl
314
+ _ as CommonControl
302
315
  };
@@ -33,4 +33,13 @@ export declare class ItemsBlock extends Block {
33
33
  * Guarded to the nodeConfig-empty case so it runs once and never loops.
34
34
  */
35
35
  onDocumentChanged(node: ImmutableHtmlNode): void;
36
+ /**
37
+ * Bakes the compiler-read DOM attributes (`data-type`, `data-number`) onto the
38
+ * `.ins-product-td` container from the recovered config. Required for saved modules:
39
+ * `migrate()` (which backfills these) only runs at template load — never when a module
40
+ * is dropped into a live editor — so this is the one place the namespace + index get
41
+ * restored before export. The name `<a>` carries no data-type/data-number of its own and
42
+ * relies on this td-level fallback in pairProductVariables.
43
+ */
44
+ private _stampProductTdDomAttributes;
36
45
  }
@@ -3,6 +3,13 @@ declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
3
3
  type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
4
4
  type OrientationType = 'vertical' | 'horizontal';
5
5
  type PriceOrientationType = 'vertical' | 'horizontal';
6
+ /**
7
+ * Wraps a bare migrate-block `<td>` in a `<tr>` so it forms a valid table row.
8
+ * Stripo renders its `BlockType.*` tags as full rows, so both the migrate template
9
+ * (here) and the orientation-change rebuild (settingsControl._reOrderTemplate) must
10
+ * emit `<tr><td>` — otherwise the code editor flags the bare cell as invalid.
11
+ */
12
+ export declare const wrapInTableRow: (html: string) => string;
6
13
  type TemplateParameters = {
7
14
  orientation: OrientationType;
8
15
  itemsType: ProductType;