@useinsider/guido 3.1.1 → 3.2.0-beta.e01b42a

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.
@@ -75,7 +75,8 @@ const e = {
75
75
  "The image with the invalid link cannot be saved to the image gallery": "Enter a valid image link to continue.",
76
76
  "The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
77
77
  "The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
78
- "The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
78
+ "The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor.",
79
+ "Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
79
80
  };
80
81
  export {
81
82
  e as default
@@ -169,7 +169,7 @@ class q extends b {
169
169
  if (e && e.includes(a))
170
170
  return t;
171
171
  }
172
- return "querySelector" in t ? t.querySelector(`.${a}`) : null;
172
+ return "querySelector" in t ? t.querySelector(`.${a}`) ?? null : null;
173
173
  }
174
174
  /**
175
175
  * Migrate configuration from legacy format
@@ -16,7 +16,7 @@ function M(t) {
16
16
  if (e && e.includes(h))
17
17
  return t;
18
18
  }
19
- return "querySelector" in t ? t.querySelector(`.${h}`) : null;
19
+ return "querySelector" in t ? t.querySelector(`.${h}`) ?? null : null;
20
20
  }
21
21
  function g(t) {
22
22
  const e = M(t);
@@ -1,15 +1,15 @@
1
- var G = Object.defineProperty;
2
- var P = (u, c, t) => c in u ? G(u, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[c] = t;
3
- var h = (u, c, t) => P(u, typeof c != "symbol" ? c + "" : c, t);
4
- import { ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as R } from "../../../common-control.js";
6
- import { DESKTOP_CONTAINER_SELECTOR as m, MOBILE_CONTAINER_SELECTOR as M } from "../../constants/selectors.js";
7
- import { SPACING_STEP as S, MAX_SPACING as _, MIN_SPACING as N, DEFAULT_COLUMN_SPACING as C, DEFAULT_ROW_SPACING as E } from "../../constants/layout.js";
1
+ var P = Object.defineProperty;
2
+ var R = (l, s, t) => s in l ? P(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
+ var C = (l, s, t) => R(l, typeof s != "symbol" ? s + "" : s, t);
4
+ import { ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as w } from "../../../common-control.js";
6
+ import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as E } from "../../constants/selectors.js";
7
+ import { SPACING_STEP as _, MAX_SPACING as N, MIN_SPACING as b, DEFAULT_COLUMN_SPACING as g, DEFAULT_ROW_SPACING as G } from "../../constants/layout.js";
8
8
  import { RecommendationConfigService as p } from "../../services/configService.js";
9
9
  import { useRecommendationExtensionStore as V } from "../../store/recommendation.js";
10
- import { safeGetStyle as A, safeGetParent as w } from "../../utils/tagName.js";
11
- import { getCurrentLayout as b, getBlockElement as B } from "../main/utils.js";
12
- import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
10
+ import { safeGetStyle as L, safeGetParent as I } from "../../utils/tagName.js";
11
+ import { getCurrentLayout as f, getBlockElement as B } from "../main/utils.js";
12
+ import { useDebounceFn as O } from "../../../../../node_modules/@vueuse/shared/index.js";
13
13
  const U = "recommendation-spacing-control", n = {
14
14
  COLUMN_SPACING: "columnSpacing",
15
15
  COLUMN_SPACING_LABEL: "columnSpacingLabel",
@@ -19,46 +19,46 @@ const U = "recommendation-spacing-control", n = {
19
19
  MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
20
20
  MOBILE_ROW_SPACING: "mobileRowSpacing",
21
21
  MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
22
- }, O = {
22
+ }, A = {
23
23
  COLUMN_SPACING: "data-column-spacing",
24
24
  ROW_SPACING: "data-row-spacing",
25
25
  MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
26
26
  MOBILE_ROW_SPACING: "data-mobile-row-spacing"
27
27
  };
28
- function L(u, c) {
29
- if (!u)
30
- return c;
31
- const t = parseFloat(u);
32
- return Number.isNaN(t) ? c : t;
28
+ function y(l, s) {
29
+ if (!l)
30
+ return s;
31
+ const t = parseFloat(l);
32
+ return Number.isNaN(t) ? s : t;
33
33
  }
34
- class j extends R {
34
+ class j extends w {
35
35
  constructor() {
36
36
  super(...arguments);
37
- h(this, "store", V());
38
- h(this, "unsubscribeOrientation", null);
37
+ C(this, "store", V());
38
+ C(this, "unsubscribeOrientation", null);
39
39
  /**
40
40
  * Debounced version of _onColumnSpacingChange
41
41
  * Prevents excessive DOM updates when user rapidly adjusts the counter
42
42
  */
43
- h(this, "_debouncedOnColumnSpacingChange", f((t) => {
43
+ C(this, "_debouncedOnColumnSpacingChange", O((t) => {
44
44
  this._onColumnSpacingChange(t);
45
45
  }, 300));
46
46
  /**
47
47
  * Debounced version of _onRowSpacingChange
48
48
  */
49
- h(this, "_debouncedOnRowSpacingChange", f((t) => {
49
+ C(this, "_debouncedOnRowSpacingChange", O((t) => {
50
50
  this._onRowSpacingChange(t);
51
51
  }, 300));
52
52
  /**
53
53
  * Debounced version of _onMobileColumnSpacingChange
54
54
  */
55
- h(this, "_debouncedOnMobileColumnSpacingChange", f((t) => {
55
+ C(this, "_debouncedOnMobileColumnSpacingChange", O((t) => {
56
56
  this._onMobileColumnSpacingChange(t);
57
57
  }, 300));
58
58
  /**
59
59
  * Debounced version of _onMobileRowSpacingChange
60
60
  */
61
- h(this, "_debouncedOnMobileRowSpacingChange", f((t) => {
61
+ C(this, "_debouncedOnMobileRowSpacingChange", O((t) => {
62
62
  this._onMobileRowSpacingChange(t);
63
63
  }, 300));
64
64
  }
@@ -75,9 +75,9 @@ class j extends R {
75
75
  }),
76
76
  this._GuCounter({
77
77
  name: n.COLUMN_SPACING,
78
- minValue: N,
79
- maxValue: _,
80
- step: S
78
+ minValue: b,
79
+ maxValue: N,
80
+ step: _
81
81
  }),
82
82
  this._GuLabel({
83
83
  text: this.api.translate("Row Spacing (px)"),
@@ -85,9 +85,9 @@ class j extends R {
85
85
  }),
86
86
  this._GuCounter({
87
87
  name: n.ROW_SPACING,
88
- minValue: N,
89
- maxValue: _,
90
- step: S
88
+ minValue: b,
89
+ maxValue: N,
90
+ step: _
91
91
  }),
92
92
  this._GuLabel({
93
93
  text: this.api.translate("Column Spacing on Mobile (px)"),
@@ -95,9 +95,9 @@ class j extends R {
95
95
  }),
96
96
  this._GuCounter({
97
97
  name: n.MOBILE_COLUMN_SPACING,
98
- minValue: N,
99
- maxValue: _,
100
- step: S
98
+ minValue: b,
99
+ maxValue: N,
100
+ step: _
101
101
  }),
102
102
  this._GuLabel({
103
103
  text: this.api.translate("Row Spacing on Mobile (px)"),
@@ -105,9 +105,9 @@ class j extends R {
105
105
  }),
106
106
  this._GuCounter({
107
107
  name: n.MOBILE_ROW_SPACING,
108
- minValue: N,
109
- maxValue: _,
110
- step: S
108
+ minValue: b,
109
+ maxValue: N,
110
+ step: _
111
111
  })
112
112
  ])}
113
113
  </div>
@@ -132,13 +132,13 @@ class j extends R {
132
132
  _updateSpacingVisibility() {
133
133
  if (!this.api)
134
134
  return;
135
- const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || b(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, l = t.mobileCardsInRow > 1;
135
+ const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || f(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, c = t.mobileCardsInRow > 1;
136
136
  this.api.setVisibility(n.COLUMN_SPACING, i && r), this.api.setVisibility(n.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(n.ROW_SPACING, !0), this.api.setVisibility(n.ROW_SPACING_LABEL, !0), this.api.setVisibility(
137
137
  n.MOBILE_COLUMN_SPACING,
138
- i && a && l
138
+ i && a && c
139
139
  ), this.api.setVisibility(
140
140
  n.MOBILE_COLUMN_SPACING_LABEL,
141
- i && a && l
141
+ i && a && c
142
142
  ), this.api.setVisibility(n.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(n.MOBILE_ROW_SPACING_LABEL, i && a);
143
143
  }
144
144
  /**
@@ -165,20 +165,20 @@ class j extends R {
165
165
  */
166
166
  _getStoredColumnSpacing() {
167
167
  if (!this.currentNode)
168
- return C;
169
- const t = this.currentNode.querySelector(m) ?? this.currentNode;
170
- if (b(this.currentNode) === "grid") {
171
- const d = t.querySelector(".recommendation-attribute-row"), s = d == null ? void 0 : d.querySelector("td"), I = A(s, "padding");
172
- if (!I)
173
- return C;
174
- const y = I.trim().split(/\s+/);
175
- return y.length < 2 ? C : L(y[1], C / 2) * 2;
168
+ return g;
169
+ const t = this.currentNode.querySelector(S) ?? this.currentNode;
170
+ if (f(this.currentNode) === "grid") {
171
+ const h = t.querySelector(".recommendation-attribute-row"), u = h == null ? void 0 : h.querySelector("td"), d = L(u, "padding");
172
+ if (!d)
173
+ return g;
174
+ const M = d.trim().split(/\s+/);
175
+ return M.length < 2 ? g : y(M[1], g / 2) * 2;
176
176
  }
177
- const o = t.querySelector(".product-card-wrapper"), i = w(o), a = A(i, "padding");
177
+ const o = t.querySelector(".product-card-wrapper"), i = I(o), a = L(i, "padding");
178
178
  if (!a)
179
- return C;
179
+ return g;
180
180
  const r = a.trim().split(/\s+/);
181
- return r.length < 2 ? C : L(r[1], C / 2) * 2;
181
+ return r.length < 2 ? g : y(r[1], g / 2) * 2;
182
182
  }
183
183
  /**
184
184
  * Gets stored row spacing from the first spacer element's height style
@@ -186,9 +186,9 @@ class j extends R {
186
186
  */
187
187
  _getStoredRowSpacing() {
188
188
  if (!this.currentNode)
189
- return E;
190
- const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer"), o = A(e, "height");
191
- return L(o, E);
189
+ return G;
190
+ const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer"), o = L(e, "height");
191
+ return y(o, G);
192
192
  }
193
193
  // ========================================================================
194
194
  // Desktop Spacing Handlers
@@ -205,17 +205,18 @@ class j extends R {
205
205
  this.currentNode,
206
206
  { columnSpacing: t },
207
207
  `Changed column spacing to ${t}px`
208
- ), this._storeDataAttribute(O.COLUMN_SPACING, t);
209
- const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(m);
210
- l && (o === "grid" ? Array.from(
211
- l.querySelectorAll(".attribute-cell")
212
- ).forEach((s) => {
213
- i.modifyHtml(s).setStyle("padding", r);
208
+ ), this._storeDataAttribute(A.COLUMN_SPACING, t);
209
+ const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(S);
210
+ c && (o === "grid" ? Array.from(
211
+ c.querySelectorAll(".attribute-cell")
212
+ ).forEach((u) => {
213
+ i.modifyHtml(u).setStyle("padding", r);
214
214
  }) : Array.from(
215
- l.querySelectorAll(".product-card-wrapper")
216
- ).forEach((s) => {
217
- "parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
218
- }), i.apply(new g(`Update column spacing to ${t}px`)));
215
+ c.querySelectorAll(".product-card-wrapper")
216
+ ).forEach((u) => {
217
+ const d = I(u);
218
+ d && i.modifyHtml(d).setStyle("padding", r);
219
+ }), i.apply(new m(`Update column spacing to ${t}px`)));
219
220
  }
220
221
  /**
221
222
  * Handles row spacing changes for desktop.
@@ -229,8 +230,8 @@ class j extends R {
229
230
  this.currentNode,
230
231
  { rowSpacing: t },
231
232
  `Changed row spacing to ${t}px`
232
- ), this._storeDataAttribute(O.ROW_SPACING, t);
233
- const e = this.currentNode.querySelector(m);
233
+ ), this._storeDataAttribute(A.ROW_SPACING, t);
234
+ const e = this.currentNode.querySelector(S);
234
235
  if (!e)
235
236
  return;
236
237
  const o = Array.from(
@@ -241,7 +242,7 @@ class j extends R {
241
242
  const i = this.api.getDocumentModifier(), a = `${t}px`;
242
243
  o.forEach((r) => {
243
244
  i.modifyHtml(r).setStyle("height", a);
244
- }), i.apply(new g(`Update row spacing to ${t}px`));
245
+ }), i.apply(new m(`Update row spacing to ${t}px`));
245
246
  }
246
247
  // ========================================================================
247
248
  // Mobile Spacing Handlers
@@ -258,17 +259,18 @@ class j extends R {
258
259
  this.currentNode,
259
260
  { mobileColumnSpacing: t },
260
261
  `Changed mobile column spacing to ${t}px`
261
- ), this._storeDataAttribute(O.MOBILE_COLUMN_SPACING, t);
262
- const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(M);
263
- l && (o === "grid" ? Array.from(
264
- l.querySelectorAll(".attribute-cell")
265
- ).forEach((s) => {
266
- i.modifyHtml(s).setStyle("padding", r);
262
+ ), this._storeDataAttribute(A.MOBILE_COLUMN_SPACING, t);
263
+ const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(E);
264
+ c && (o === "grid" ? Array.from(
265
+ c.querySelectorAll(".attribute-cell")
266
+ ).forEach((u) => {
267
+ i.modifyHtml(u).setStyle("padding", r);
267
268
  }) : Array.from(
268
- l.querySelectorAll(".product-card-wrapper")
269
- ).forEach((s) => {
270
- "parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
271
- }), i.apply(new g(`Update mobile column spacing to ${t}px`)));
269
+ c.querySelectorAll(".product-card-wrapper")
270
+ ).forEach((u) => {
271
+ const d = I(u);
272
+ d && i.modifyHtml(d).setStyle("padding", r);
273
+ }), i.apply(new m(`Update mobile column spacing to ${t}px`)));
272
274
  }
273
275
  /**
274
276
  * Handles row spacing changes for mobile.
@@ -282,8 +284,8 @@ class j extends R {
282
284
  this.currentNode,
283
285
  { mobileRowSpacing: t },
284
286
  `Changed mobile row spacing to ${t}px`
285
- ), this._storeDataAttribute(O.MOBILE_ROW_SPACING, t);
286
- const e = this.currentNode.querySelector(M);
287
+ ), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
288
+ const e = this.currentNode.querySelector(E);
287
289
  if (!e)
288
290
  return;
289
291
  const o = Array.from(
@@ -294,7 +296,7 @@ class j extends R {
294
296
  const i = this.api.getDocumentModifier(), a = `${t}px`;
295
297
  o.forEach((r) => {
296
298
  i.modifyHtml(r).setStyle("height", a);
297
- }), i.apply(new g(`Update mobile row spacing to ${t}px`));
299
+ }), i.apply(new m(`Update mobile row spacing to ${t}px`));
298
300
  }
299
301
  // ========================================================================
300
302
  // Data Attribute Storage
@@ -304,7 +306,7 @@ class j extends R {
304
306
  */
305
307
  _storeDataAttribute(t, e) {
306
308
  const o = B(this.currentNode);
307
- o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new g(`Store ${t}`));
309
+ o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
308
310
  }
309
311
  // ========================================================================
310
312
  // Event Listeners
@@ -1,10 +1,10 @@
1
1
  function a(t) {
2
2
  return typeof t == "object" && t !== null && "tagName" in t && typeof t.tagName == "string";
3
3
  }
4
- function r(t) {
4
+ function n(t) {
5
5
  return typeof t == "object" && t !== null && "getTagName" in t && typeof t.getTagName == "function";
6
6
  }
7
- function n(t) {
7
+ function r(t) {
8
8
  return typeof t == "object" && t !== null && "getStyle" in t && typeof t.getStyle == "function";
9
9
  }
10
10
  function u(t) {
@@ -14,13 +14,13 @@ function g(t) {
14
14
  return typeof t == "object" && t !== null && "tagName" in t && t.tagName === "TD";
15
15
  }
16
16
  function p(t, e) {
17
- return !t || !n(t) ? null : t.getStyle(e);
17
+ return !t || !r(t) ? null : t.getStyle(e);
18
18
  }
19
19
  function N(t) {
20
- return !t || !u(t) ? null : t.parent();
20
+ return !t || !u(t) ? null : t.parent() ?? null;
21
21
  }
22
22
  function l(t, e = "UNKNOWN") {
23
- return t ? a(t) ? t.tagName.toUpperCase() : r(t) ? t.getTagName().toUpperCase() : e : e;
23
+ return t ? a(t) ? t.tagName.toUpperCase() : n(t) ? t.getTagName().toUpperCase() : e : e;
24
24
  }
25
25
  const f = /* @__PURE__ */ new Set(["TD", "BLOCK_IMAGE", "BLOCK_BUTTON"]);
26
26
  function i(t) {
@@ -36,7 +36,7 @@ function s(t) {
36
36
  export {
37
37
  s as getTableDisplayValue,
38
38
  l as getTagName,
39
- n as hasGetStyle,
39
+ r as hasGetStyle,
40
40
  u as hasParent,
41
41
  c as isTableCellNode,
42
42
  i as isTableCellTag,
@@ -1,35 +1,34 @@
1
- import { SettingsPanelRegistry as e, SettingsPanelTab as N, SettingsTab as t, TextControls as O } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { SettingsPanelRegistry as e, SettingsPanelTab as O, SettingsTab as t, TextControls as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { UNSUBSCRIBE_BLOCK_ID as I } from "./block.js";
3
3
  import { UNSUBSCRIBE_CONTROL_ID as _ } from "./control.js";
4
- class R extends e {
4
+ class o extends e {
5
5
  registerBlockControls(T) {
6
6
  T[I] = [
7
- new N(
7
+ new O(
8
8
  t.SETTINGS,
9
9
  [
10
10
  _,
11
- O.FORMAT,
12
- O.ALIGN,
13
- O.LINE_HEIGHT,
14
- O.DIRECTION,
15
- O.INTERNAL_INDENTS,
16
- O.HIDDEN_NODE
11
+ N.FORMAT,
12
+ N.ALIGN,
13
+ N.LINE_HEIGHT,
14
+ N.DIRECTION,
15
+ N.INTERNAL_INDENTS,
16
+ N.HIDDEN_NODE
17
17
  ]
18
18
  ),
19
- new N(
19
+ new O(
20
20
  t.STYLES,
21
21
  [
22
- O.TEXT_BLOCK_BACKGROUND_COLOR,
23
- O.FONT_FAMILY,
24
- O.FONT_SIZE,
25
- O.FONT_COLOR,
26
- O.FONT_BACKGROUND_COLOR,
27
- O.LINKS_COLOR
22
+ N.TEXT_BLOCK_BACKGROUND_COLOR,
23
+ N.FONT_FAMILY,
24
+ N.FONT_SIZE,
25
+ N.FONT_COLOR,
26
+ N.FONT_BACKGROUND_COLOR
28
27
  ]
29
28
  )
30
29
  ];
31
30
  }
32
31
  }
33
32
  export {
34
- R as SettingsPanel
33
+ o as SettingsPanel
35
34
  };