@useinsider/guido 2.0.0-beta.ac3cd4d → 2.0.0-beta.afc5689

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 (57) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +38 -50
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +15 -17
  5. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue.js +12 -12
  8. package/dist/components/organisms/header/LeftSlot.vue2.js +6 -6
  9. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  10. package/dist/composables/useConfig.js +27 -29
  11. package/dist/composables/useSave.js +11 -13
  12. package/dist/composables/useStripo.js +40 -40
  13. package/dist/config/migrator/index.js +9 -8
  14. package/dist/config/migrator/itemsBlockMigrator.js +283 -0
  15. package/dist/extensions/Blocks/Items/block.js +39 -40
  16. package/dist/extensions/Blocks/Items/controls/button/link.js +22 -29
  17. package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
  18. package/dist/extensions/Blocks/Items/controls/image/link.js +23 -30
  19. package/dist/extensions/Blocks/Items/controls/name/trimming.js +13 -15
  20. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +1 -1
  21. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
  22. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +15 -17
  23. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -15
  24. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +29 -27
  25. package/dist/extensions/Blocks/Items/controls/settingsControl.js +145 -136
  26. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
  27. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
  28. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
  29. package/dist/extensions/Blocks/Items/settingsPanel.js +4 -4
  30. package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
  31. package/dist/extensions/Blocks/Items/template.js +312 -125
  32. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
  33. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +17 -44
  34. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  35. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  36. package/dist/extensions/Blocks/common-control.js +64 -53
  37. package/dist/extensions/Blocks/controlFactories.js +55 -45
  38. package/dist/guido.css +1 -1
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +364 -285
  40. package/dist/package.json.js +1 -1
  41. package/dist/services/stripoApi.js +6 -10
  42. package/dist/src/@types/config/index.d.ts +2 -2
  43. package/dist/src/@types/config/schemas.d.ts +4 -26
  44. package/dist/src/@types/config/types.d.ts +1 -7
  45. package/dist/src/composables/useConfig.d.ts +2 -6
  46. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
  47. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -2
  48. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -2
  49. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  50. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
  51. package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
  52. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
  53. package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
  54. package/dist/src/stores/config.d.ts +18 -146
  55. package/dist/static/styles/components/button.css.js +1 -1
  56. package/dist/stores/config.js +0 -7
  57. package/package.json +3 -3
@@ -1,76 +1,49 @@
1
- import { useItemsBlockStore as e } from "../store/items-block.js";
2
- import { syncAttributeFromConfigBlock as r, createBooleanSyncConfig as i, createStringSyncConfig as s } from "./syncAttributeFromConfigBlock.js";
3
- function m(t) {
4
- const o = e(), n = i(
1
+ import { useItemsBlockStore as r } from "../store/items-block.js";
2
+ import { syncAttributeFromConfigBlock as e, createBooleanSyncConfig as s, createStringSyncConfig as i } from "./syncAttributeFromConfigBlock.js";
3
+ function u(t) {
4
+ const o = r(), n = s(
5
5
  "PRODUCT_NAME_TRIMMING",
6
6
  (c) => o.setNameTrimming(c),
7
7
  !1
8
8
  );
9
- r(t, n);
9
+ e(t, n);
10
10
  }
11
11
  function f(t) {
12
- const o = e(), n = i(
12
+ const o = r(), n = s(
13
13
  "PRODUCT_PRICE_HIDE_DISCOUNT",
14
14
  (c) => o.setHideDiscount(c),
15
- !1
15
+ !0
16
16
  );
17
- r(t, n);
17
+ e(t, n);
18
18
  }
19
19
  function R(t) {
20
- const o = e(), n = i(
20
+ const o = r(), n = s(
21
21
  "PRODUCT_PRICE_FORMATTED",
22
22
  (c) => o.setFormattedPrice(c),
23
23
  !0
24
24
  );
25
- r(t, n);
25
+ e(t, n);
26
26
  }
27
- function O(t) {
28
- const o = e(), n = s(
27
+ function y(t) {
28
+ const o = r(), n = i(
29
29
  "PRODUCT_PRICE_CURRENCY_SYMBOL",
30
30
  (c) => o.setCurrencySymbol(c),
31
31
  ""
32
32
  );
33
- r(t, n);
33
+ e(t, n);
34
34
  }
35
35
  function _(t) {
36
- const o = e(), n = s(
36
+ const o = r(), n = i(
37
37
  "PRODUCT_PRICE_CURRENCY_LOCATION",
38
38
  (c) => o.setCurrencyLocation(c),
39
39
  "0"
40
40
  );
41
- r(t, n);
42
- }
43
- function I(t) {
44
- const o = e(), n = s(
45
- "PRODUCT_BUTTON_LINK",
46
- (c) => o.setButtonLink(c),
47
- ""
48
- );
49
- r(t, n);
50
- }
51
- function T(t) {
52
- const o = e(), n = s(
53
- "PRODUCT_IMAGE_LINK",
54
- (c) => o.setImageLink(c),
55
- ""
56
- );
57
- r(t, n);
58
- }
59
- function y(t) {
60
- const o = e(), n = s(
61
- "PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION",
62
- (c) => o.setPriceOrientation(c),
63
- "horizontal"
64
- );
65
- r(t, n);
41
+ e(t, n);
66
42
  }
67
43
  export {
68
- I as syncButtonLinkFromAttributes,
69
44
  _ as syncCurrencyLocationFromAttributes,
70
- O as syncCurrencySymbolFromAttributes,
45
+ y as syncCurrencySymbolFromAttributes,
71
46
  R as syncFormattedPriceFromAttributes,
72
47
  f as syncHideDiscountFromAttributes,
73
- T as syncImageLinkFromAttributes,
74
- m as syncNameTrimmingFromAttributes,
75
- y as syncPriceOrientationFromAttributes
48
+ u as syncNameTrimmingFromAttributes
76
49
  };
@@ -289,7 +289,7 @@ class b extends g {
289
289
  t.CURRENCY_DECIMAL_COUNT
290
290
  ].forEach((i) => {
291
291
  this.api.onValueChanged(i, (a) => this._onCurrencyConfigChange(i, a));
292
- }), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
292
+ }), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, String(i))), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
293
293
  }
294
294
  _listenStateUpdates() {
295
295
  this.storeUnsubscription = this.store.$subscribe((e) => {
@@ -1,21 +1,21 @@
1
1
  import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { UnsubscribeBlock as i } from "./block.js";
3
3
  import { UnsubscribeControl as t } from "./control.js";
4
- import { PreviewUIElement as s } from "./elements/preview.js";
5
- import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
6
- import { SettingsPanel as r } from "./settingsPanel.js";
4
+ import { PreviewUIElement as o } from "./elements/preview.js";
5
+ import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
6
+ import { SettingsPanel as s } from "./settingsPanel.js";
7
7
  import n from "./styles.css.js";
8
- import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
9
- const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
8
+ import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
9
+ const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
10
10
  en: {
11
- "Unsubscribe Block": "Unsubscribe",
12
- "Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
11
+ "Unsubscribe Block": "Unsubscribe Block",
12
+ "Unsubscribe Block Description": "Add an unsubscribe link to your email",
13
13
  "Select Template": "Select Template",
14
14
  "Unsubscribe Template": "Unsubscribe Template",
15
15
  Showing: "Showing",
16
16
  of: "of"
17
17
  }
18
- }).withUiElementTagRegistry(c).withIconsRegistry(o).build();
18
+ }).withUiElementTagRegistry(l).withIconsRegistry(r).build();
19
19
  export {
20
- g as default
20
+ f as default
21
21
  };
@@ -1,8 +1,8 @@
1
1
  var c = Object.defineProperty;
2
- var I = (a, r, e) => r in a ? c(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
3
- var l = (a, r, e) => I(a, 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 I = (T, r, e) => r in T ? c(T, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[r] = e;
3
+ var l = (T, r, e) => I(T, typeof r != "symbol" ? r + "" : r, e);
4
+ import { Control as s, UIElementType as t, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ class B extends s {
6
6
  constructor() {
7
7
  super(...arguments);
8
8
  l(this, "currentNode");
@@ -19,43 +19,54 @@ class _ extends O {
19
19
  this.lastBlockInstanceId = null;
20
20
  }
21
21
  /**
22
- * Gets the config block element from the current node.
22
+ * Gets the Items block container element from the current node.
23
+ * @returns The container element or null if not found
24
+ */
25
+ getItemsBlockContainer() {
26
+ return this.currentNode ? this.currentNode.closest(".items-block-v2") : null;
27
+ }
28
+ /**
29
+ * Gets the config block element from the current node (legacy support).
30
+ * @deprecated Use getNodeConfig() from nodeConfigUtils instead for Stripo V2
23
31
  * @returns The config block element or null if not found
24
32
  */
25
33
  getConfigBlock() {
26
- if (!this.currentNode)
27
- return null;
28
- const e = this.currentNode.closest(".items-block-v2");
34
+ const e = this.getItemsBlockContainer();
29
35
  return e ? e.querySelector("esd-config-block") : null;
30
36
  }
31
37
  /**
32
- * Gets the current block instance ID from the config block.
33
- * @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
38
+ * Gets the current block instance ID from the node config (Stripo V2) or legacy config block.
34
39
  * @returns The block instance ID or null if not found
35
40
  */
36
- getBlockInstanceId(e = "data-block-instance-id") {
37
- const n = this.getConfigBlock();
38
- return n ? n.getAttribute(e) : null;
41
+ getBlockInstanceId() {
42
+ const e = this.getItemsBlockContainer();
43
+ if (!e)
44
+ return null;
45
+ const n = e.getNodeConfig();
46
+ if (n && typeof n.blockInstanceId == "string")
47
+ return n.blockInstanceId;
48
+ const o = this.getConfigBlock();
49
+ return o ? o.getAttribute("data-block-instance-id") : null;
39
50
  }
40
51
  /**
41
52
  * Handles block instance change detection and syncing.
42
- * This is a helper method for controls that need to sync attributes when switching between block instances.
43
- * @param syncFunction - Function to call when block instance changes (to sync from attributes)
53
+ * This is a helper method for controls that need to sync config when switching between block instances.
54
+ * Uses Stripo V2 nodeConfig API for block instance tracking.
55
+ * @param syncFunction - Function to call when block instance changes (to sync from node config)
44
56
  * @param updateUI - Function to call to update the UI (called both on change and when same block)
45
- * @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
46
57
  * @returns true if block instance changed, false otherwise
47
58
  */
48
- handleBlockInstanceChange(e, n, E = "data-block-instance-id") {
49
- const o = this.getBlockInstanceId(E);
59
+ handleBlockInstanceChange(e, n) {
60
+ const o = this.getBlockInstanceId();
50
61
  if (!o)
51
62
  return !1;
52
- const T = o !== this.lastBlockInstanceId;
53
- return T ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = o) : n(), T;
63
+ const E = o !== this.lastBlockInstanceId;
64
+ return E ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = o) : n(), E;
54
65
  }
55
- _GuLabel({ text: e, name: n = "", position: E = "top" }) {
66
+ _GuLabel({ text: e, name: n = "", position: o = "top" }) {
56
67
  return `
57
68
  <${t.LABEL}
58
- style="${E === "top" ? "margin-bottom: 8px;" : ""}"
69
+ style="${o === "top" ? "margin-bottom: 8px;" : ""}"
59
70
  ${$.LABEL.text}="${e}"
60
71
  ${$.LABEL.name}="${n || `${e} Label`}">
61
72
  </${t.LABEL}>
@@ -75,59 +86,59 @@ class _ extends O {
75
86
  ${$.SELECT_ITEM.value}="${n}">
76
87
  </${t.SELECT_ITEM}>`;
77
88
  }
78
- _GuSelect({ name: e, placeholder: n, options: E, className: o = "es-180w" }) {
89
+ _GuSelect({ name: e, placeholder: n, options: o, className: E = "es-180w" }) {
79
90
  return `
80
91
  <${t.SELECTPICKER}
81
- class="${o}"
92
+ class="${E}"
82
93
  ${$.SELECTPICKER.name}="${e}"
83
94
  ${$.SELECTPICKER.placeholder}="${n}">
84
- ${E.map((T) => this._GuSelectItem(T)).join("")}
95
+ ${o.map((a) => this._GuSelectItem(a)).join("")}
85
96
  </${t.SELECTPICKER}>
86
97
  `;
87
98
  }
88
- _GuTextInput({ name: e, placeholder: n, className: E = "", disabled: o = !1 }) {
99
+ _GuTextInput({ name: e, placeholder: n, className: o = "", disabled: E = !1 }) {
89
100
  return `
90
101
  <${t.TEXT}
91
- class=${E}
102
+ class=${o}
92
103
  ${$.TEXT.name}="${e}"
93
104
  placeholder="${n || e}"
94
- ${o ? `${$.TEXT.disabled}="true"` : ""}>
105
+ ${E ? `${$.TEXT.disabled}="true"` : ""}>
95
106
  </${t.TEXT}>
96
107
  `;
97
108
  }
98
- _GuCounter({ name: e, maxValue: n, minValue: E = 1, step: o = 1 }) {
109
+ _GuCounter({ name: e, maxValue: n, minValue: o = 1, step: E = 1 }) {
99
110
  return `
100
111
  <${t.COUNTER}
101
112
  ${$.COUNTER.name}="${e}"
102
- ${$.COUNTER.minValue}="${E}"
113
+ ${$.COUNTER.minValue}="${o}"
103
114
  ${$.COUNTER.maxValue}="${n}"
104
- ${$.COUNTER.step}="${o}">
115
+ ${$.COUNTER.step}="${E}">
105
116
  </${t.COUNTER}>
106
117
  `;
107
118
  }
108
- _GuRadioButtonItem({ text: e, value: n, icon: E }) {
119
+ _GuRadioButtonItem({ text: e, value: n, icon: o }) {
109
120
  return `
110
121
  <${t.RADIO_ITEM}
111
122
  ${$.RADIO_ITEM.value}="${n}"
112
123
  ${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
113
- ${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
124
+ ${o ? `${$.RADIO_ITEM.icon}="${o}"` : ""}>
114
125
  </${t.RADIO_ITEM}>
115
126
  `;
116
127
  }
117
- _GuRadioButton({ name: e, buttons: n, id: E = "" }) {
128
+ _GuRadioButton({ name: e, buttons: n, id: o = "" }) {
118
129
  return `
119
130
  <${t.RADIO_BUTTONS}
120
- ${E ? `id="${E}"` : ""}
131
+ ${o ? `id="${o}"` : ""}
121
132
  ${$.RADIO_BUTTONS.name}="${e}">
122
- ${n.map((o) => this._GuRadioButtonItem(o)).join("")}
133
+ ${n.map((E) => this._GuRadioButtonItem(E)).join("")}
123
134
  </${t.RADIO_BUTTONS}>
124
135
  `;
125
136
  }
126
- _GuButton({ name: e, label: n, id: E = "" }) {
137
+ _GuButton({ name: e, label: n, id: o = "" }) {
127
138
  return `
128
139
  <${t.BUTTON}
129
140
  ${$.BUTTON.name}="${e}"
130
- ${E ? `id="${E}"` : ""}
141
+ ${o ? `id="${o}"` : ""}
131
142
  ${$.BUTTON.caption}="${n}"}>
132
143
  </${t.BUTTON}>
133
144
  `;
@@ -137,10 +148,10 @@ class _ extends O {
137
148
  * @param param0
138
149
  * @returns It returns a button with an icon.
139
150
  */
140
- _GuIconButton({ name: e, icon: n, className: E = "" }) {
151
+ _GuIconButton({ name: e, icon: n, className: o = "" }) {
141
152
  return `
142
153
  <${t.BUTTON}
143
- class="${E}"
154
+ class="${o}"
144
155
  ${$.BUTTON.name}="${e}"
145
156
  ${$.BUTTON.icon}="${n}">
146
157
  </${t.BUTTON}>
@@ -168,19 +179,19 @@ class _ extends O {
168
179
  * @returns HTML string for the orderable control
169
180
  */
170
181
  _GuOrderable(e, n) {
171
- let E = "";
172
- n.forEach((T) => {
182
+ let o = "";
183
+ n.forEach((a) => {
173
184
  const u = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
174
- E += `
175
- <${t.ORDERABLE_ITEM} ${u}="${T.key}">
176
- ${T.content}
185
+ o += `
186
+ <${t.ORDERABLE_ITEM} ${u}="${a.key}">
187
+ ${a.content}
177
188
  </${t.ORDERABLE_ITEM}>
178
189
  `;
179
190
  });
180
- const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
191
+ const E = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
181
192
  return `
182
- <${t.ORDERABLE} ${o}="${e}">
183
- ${E}
193
+ <${t.ORDERABLE} ${E}="${e}">
194
+ ${o}
184
195
  </${t.ORDERABLE}>
185
196
  `;
186
197
  }
@@ -221,16 +232,16 @@ class _ extends O {
221
232
  `;
222
233
  }
223
234
  _GuRadioButtons(e, n) {
224
- const E = n.map((o) => `
235
+ const o = n.map((E) => `
225
236
  <${t.RADIO_ITEM}
226
- ${$.RADIO_ITEM.text}="${o.text}"
227
- ${$.RADIO_ITEM.value}="${o.value}">
237
+ ${$.RADIO_ITEM.text}="${E.text}"
238
+ ${$.RADIO_ITEM.value}="${E.value}">
228
239
  </${t.RADIO_ITEM}>
229
240
  `).join("");
230
241
  return `
231
242
  <${t.RADIO_BUTTONS}
232
243
  ${$.RADIO_BUTTONS.name}="${e}">
233
- ${E}
244
+ ${o}
234
245
  </${t.RADIO_BUTTONS}>
235
246
  `;
236
247
  }
@@ -244,5 +255,5 @@ class _ extends O {
244
255
  }
245
256
  }
246
257
  export {
247
- _ as CommonControl
258
+ B as CommonControl
248
259
  };
@@ -1,14 +1,4 @@
1
- import { TextAlignBuiltInControl as o, TextColorBuiltInControl as l, TextSizeBuiltInControl as s, TextStyleBuiltInControl as u, TextFontFamilyBuiltInControl as i, ButtonBackgroundColorBuiltInControl as c, TextPaddingsBuiltInControl as d, ImageSizeBuiltInControl as a, ImageMarginsBuiltInControl as g, ButtonAlignBuiltInControl as x, ButtonBorderBuiltInControl as C, ButtonBorderRadiusBuiltInControl as B, ButtonColorBuiltInControl as T, ButtonFontFamilyBuiltInControl as I, ButtonMarginsBuiltInControl as f, ButtonPaddingsBuiltInControl as m, ButtonTextBuiltInControl as y, ButtonTextSizeBuiltInControl as A, ButtonTextStyleAndFontColorBuiltInControl as S, ButtonFitToContainerBuiltInControl as N, TextLineSpacingBuiltInControl as b } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- function $(r, t, n) {
3
- return class extends o {
4
- getId() {
5
- return r;
6
- }
7
- getTargetNodes(e) {
8
- return !t || !n ? [e] : e.closest(n).querySelectorAll(`[esd-extension-block-id="${t}"]`);
9
- }
10
- };
11
- }
1
+ import { TextAlignBuiltInControl as l, TextColorBuiltInControl as s, TextSizeBuiltInControl as u, TextStyleBuiltInControl as i, TextFontFamilyBuiltInControl as c, ButtonBackgroundColorBuiltInControl as d, TextPaddingsBuiltInControl as a, ImageSizeBuiltInControl as g, ImageMarginsBuiltInControl as x, ButtonAlignBuiltInControl as C, ButtonBorderBuiltInControl as B, ButtonBorderRadiusBuiltInControl as T, ButtonColorBuiltInControl as I, ButtonFontFamilyBuiltInControl as f, ButtonMarginsBuiltInControl as y, ButtonPaddingsBuiltInControl as m, ButtonTextBuiltInControl as A, ButtonTextSizeBuiltInControl as S, ButtonTextStyleAndFontColorBuiltInControl as N, ButtonFitToContainerBuiltInControl as b, TextLineSpacingBuiltInControl as q } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
12
2
  function k(r, t, n) {
13
3
  return class extends l {
14
4
  getId() {
@@ -69,28 +59,28 @@ function P(r, t, n) {
69
59
  }
70
60
  };
71
61
  }
72
- function L(r, t, n) {
73
- return class extends b {
62
+ function h(r, t, n) {
63
+ return class extends a {
74
64
  getId() {
75
65
  return r;
76
66
  }
77
67
  getTargetNodes(e) {
78
- return [e];
68
+ return !t || !n ? [e] : e.closest(n).querySelectorAll(`[esd-extension-block-id="${t}"]`);
79
69
  }
80
70
  };
81
71
  }
82
- function R(r, t, n = ".ins-recommendation-product-container") {
83
- return class extends x {
72
+ function L(r, t, n) {
73
+ return class extends q {
84
74
  getId() {
85
75
  return r;
86
76
  }
87
77
  getTargetNodes(e) {
88
- return e.closest(n).querySelectorAll(`[esd-extension-block-id="${t}"]`);
78
+ return [e];
89
79
  }
90
80
  };
91
81
  }
92
- function h(r, t, n = ".ins-recommendation-product-container") {
93
- return class extends T {
82
+ function R(r, t, n = ".ins-recommendation-product-container") {
83
+ return class extends C {
94
84
  getId() {
95
85
  return r;
96
86
  }
@@ -100,7 +90,7 @@ function h(r, t, n = ".ins-recommendation-product-container") {
100
90
  };
101
91
  }
102
92
  function j(r, t, n = ".ins-recommendation-product-container") {
103
- return class extends C {
93
+ return class extends I {
104
94
  getId() {
105
95
  return r;
106
96
  }
@@ -120,7 +110,7 @@ function v(r, t, n = ".ins-recommendation-product-container") {
120
110
  };
121
111
  }
122
112
  function w(r, t, n = ".ins-recommendation-product-container") {
123
- return class extends I {
113
+ return class extends T {
124
114
  getId() {
125
115
  return r;
126
116
  }
@@ -140,7 +130,7 @@ function D(r, t, n = ".ins-recommendation-product-container") {
140
130
  };
141
131
  }
142
132
  function E(r, t, n = ".ins-recommendation-product-container") {
143
- return class extends m {
133
+ return class extends y {
144
134
  getId() {
145
135
  return r;
146
136
  }
@@ -150,7 +140,7 @@ function E(r, t, n = ".ins-recommendation-product-container") {
150
140
  };
151
141
  }
152
142
  function G(r, t, n = ".ins-recommendation-product-container") {
153
- return class extends y {
143
+ return class extends m {
154
144
  getId() {
155
145
  return r;
156
146
  }
@@ -169,7 +159,7 @@ function H(r, t, n = ".ins-recommendation-product-container") {
169
159
  }
170
160
  };
171
161
  }
172
- function J(r, t, n) {
162
+ function J(r, t, n = ".ins-recommendation-product-container") {
173
163
  return class extends S {
174
164
  getId() {
175
165
  return r;
@@ -190,7 +180,7 @@ function K(r, t, n) {
190
180
  };
191
181
  }
192
182
  function O(r, t, n) {
193
- return class extends a {
183
+ return class extends b {
194
184
  getId() {
195
185
  return r;
196
186
  }
@@ -205,30 +195,50 @@ function Q(r, t, n) {
205
195
  return r;
206
196
  }
207
197
  getTargetNodes(e) {
208
- return e.closest(n).querySelectorAll(`[esd-extension-block-id="${t}"]`);
198
+ try {
199
+ const o = e.closest(n);
200
+ return o ? o.querySelectorAll(`[esd-extension-block-id="${t}"]`) : [];
201
+ } catch {
202
+ return [];
203
+ }
204
+ }
205
+ };
206
+ }
207
+ function U(r, t, n) {
208
+ return class extends x {
209
+ getId() {
210
+ return r;
211
+ }
212
+ getTargetNodes(e) {
213
+ try {
214
+ const o = e.closest(n);
215
+ return o ? o.querySelectorAll(`[esd-extension-block-id="${t}"]`) : [];
216
+ } catch {
217
+ return [];
218
+ }
209
219
  }
210
220
  };
211
221
  }
212
222
  export {
213
223
  R as createButtonAlignControl,
214
- j as createButtonBorderControl,
215
- v as createButtonBorderRadiusControl,
216
- h as createButtonColorControl,
217
- K as createButtonFitToContainerControl,
218
- w as createButtonFontFamilyControl,
219
- D as createButtonMarginsControl,
220
- E as createButtonPaddingsControl,
221
- G as createButtonTextControl,
222
- H as createButtonTextSizeControl,
223
- J as createButtonTextStyleAndFontColorControl,
224
- Q as createImageMarginsControl,
225
- O as createImageSizeControl,
226
- P as createPaddingsControl,
227
- $ as createTextAlignControl,
228
- M as createTextBackgroundColorControl,
229
- k as createTextColorControl,
230
- z as createTextFontFamilyControl,
224
+ v as createButtonBorderControl,
225
+ w as createButtonBorderRadiusControl,
226
+ j as createButtonColorControl,
227
+ O as createButtonFitToContainerControl,
228
+ D as createButtonFontFamilyControl,
229
+ E as createButtonMarginsControl,
230
+ G as createButtonPaddingsControl,
231
+ H as createButtonTextControl,
232
+ J as createButtonTextSizeControl,
233
+ K as createButtonTextStyleAndFontColorControl,
234
+ U as createImageMarginsControl,
235
+ Q as createImageSizeControl,
236
+ h as createPaddingsControl,
237
+ k as createTextAlignControl,
238
+ P as createTextBackgroundColorControl,
239
+ p as createTextColorControl,
240
+ M as createTextFontFamilyControl,
231
241
  L as createTextLineSpacingControl,
232
- p as createTextSizeControl,
233
- F as createTextStyleControl
242
+ F as createTextSizeControl,
243
+ z as createTextStyleControl
234
244
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-282ca4d1]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-282ca4d1]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-282ca4d1]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-3bf5c743] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-890b5336]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-890b5336]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-890b5336]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-b37f3f6d],[data-v-b37f3f6d] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}