@useinsider/guido 2.0.0-beta.689d09e → 2.0.0-beta.6b1a3c9

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.
@@ -3,7 +3,7 @@ import o from "./AmpToggle.vue2.js";
3
3
  import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
5
  var r = this, t = r._self._c, e = r._self._setupProxy;
6
- return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
6
+ return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-3 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
7
7
  return e.previewStore.openErrorModal();
8
8
  } } }) : r._e()], 1)]);
9
9
  }, a = [], i = /* @__PURE__ */ n(
@@ -12,7 +12,7 @@ var s = function() {
12
12
  a,
13
13
  !1,
14
14
  null,
15
- "b5997368"
15
+ "5196584c"
16
16
  );
17
17
  const d = i.exports;
18
18
  export {
@@ -1,18 +1,18 @@
1
1
  import o from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
- import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var r = function() {
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = function() {
5
5
  var e = this, s = e._self._c, t = e._self._setupProxy;
6
- return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "text", type: "secondary", "label-text": t.backButtonLabel, "skeleton-sizing": { width: 150, height: 26 }, "skeleton-status": t.editorStore.loadingStatus }, on: { click: t.handleBackClick } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
7
- }, i = [], a = /* @__PURE__ */ n(
6
+ return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "text", type: "secondary", "disabled-status": t.isBackButtonDisabled, "label-text": t.backButtonLabel, "skeleton-sizing": { width: 150, height: 26 }, "skeleton-status": t.editorStore.loadingStatus }, on: { click: t.handleBackClick } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
7
+ }, n = [], r = /* @__PURE__ */ a(
8
8
  o,
9
- r,
10
9
  i,
10
+ n,
11
11
  !1,
12
12
  null,
13
- "3bf5c743"
13
+ "7f267190"
14
14
  );
15
- const d = a.exports;
15
+ const f = r.exports;
16
16
  export {
17
- d as default
17
+ f as default
18
18
  };
@@ -1,32 +1,37 @@
1
- import { defineComponent as c, computed as m } from "vue";
2
- import { useConfig as f } from "../../../composables/useConfig.js";
3
- import { useBack as p } from "../../../composables/useGuidoActions.js";
4
- import { usePreviewMode as l } from "../../../composables/usePreviewMode.js";
5
- import { useTranslations as d } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as k } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as B } from "../../../stores/editor.js";
8
- import { InButtonV2 as b } from "@useinsider/design-system-vue";
9
- import _ from "./version-history/RestoreButton.vue.js";
10
- const S = /* @__PURE__ */ c({
1
+ import { defineComponent as l, computed as p, ref as d } from "vue";
2
+ import { useConfig as k } from "../../../composables/useConfig.js";
3
+ import { useBack as B } from "../../../composables/useGuidoActions.js";
4
+ import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
5
+ import { useTranslations as v } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useEditorStore as V } from "../../../stores/editor.js";
8
+ import { InButtonV2 as w } from "@useinsider/design-system-vue";
9
+ import y from "./version-history/RestoreButton.vue.js";
10
+ import { useDebounceFn as C } from "../../../node_modules/@vueuse/shared/index.js";
11
+ const F = /* @__PURE__ */ l({
11
12
  __name: "LeftSlot",
12
- setup(v) {
13
- const o = B(), r = p(), { closeVersionHistory: i } = k(), { closePreviewMode: n } = l(), e = d(), { config: t } = f(), u = m(() => {
14
- var s, a;
15
- return o.isVersionHistoryOpen || o.isPreviewModeOpen ? e("email-editor.back-to-editor") : (a = (s = t.value) == null ? void 0 : s.ui) != null && a.backButtonLabel ? t.value.ui.backButtonLabel : e("email-editor.back-to-design");
16
- });
17
- return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: i, closePreviewMode: n, trans: e, config: t, backButtonLabel: u, handleBackClick: () => {
18
- if (o.isVersionHistoryOpen) {
19
- i();
13
+ setup(H) {
14
+ const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f = p(() => {
15
+ var u, m;
16
+ return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (m = (u = t.value) == null ? void 0 : u.ui) != null && m.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
17
+ }), r = d(!1), c = () => {
18
+ if (e.isVersionHistoryOpen) {
19
+ n();
20
20
  return;
21
21
  }
22
- if (o.isPreviewModeOpen) {
23
- n();
22
+ if (e.isPreviewModeOpen) {
23
+ s();
24
24
  return;
25
25
  }
26
- o.loadingStatus = !0, r();
27
- }, InButtonV2: b, RestoreButton: _ };
26
+ i();
27
+ }, a = C(() => {
28
+ c(), r.value = !1;
29
+ }, 500);
30
+ return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: f, isBackButtonDisabled: r, executeBackAction: c, debouncedBackAction: a, handleBackClick: () => {
31
+ r.value = !0, a();
32
+ }, InButtonV2: w, RestoreButton: y };
28
33
  }
29
34
  });
30
35
  export {
31
- S as default
36
+ F as default
32
37
  };
@@ -1,82 +1,76 @@
1
- var C = Object.defineProperty;
2
- var A = (n, r, e) => r in n ? C(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
3
- var _ = (n, r, e) => A(n, typeof r != "symbol" ? r + "" : r, e);
4
- import { ModificationDescription as L, UIElementType as m, UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ var R = Object.defineProperty;
2
+ var _ = (i, t, e) => t in i ? R(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var m = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { ModificationDescription as F, UIElementType as P, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as h } from "../../../common-control.js";
6
- import { ItemsBlockControlId as l, ItemsBlockId as D } from "../../enums/controlEnums.js";
7
- import { productPairs as I } from "../../enums/productEnums.js";
8
- import { useItemsBlockStore as O } from "../../store/items-block.js";
9
- import { getItemsBlockConfig as u, setItemsBlockConfig as f } from "../../utils/nodeConfigUtils.js";
10
- const N = l.PRICE_FORMATTED_PRICE, c = {
6
+ import { ItemsBlockControlId as p, ItemsBlockId as g } from "../../enums/controlEnums.js";
7
+ import { productPairs as T } from "../../enums/productEnums.js";
8
+ import { useItemsBlockStore as A } from "../../store/items-block.js";
9
+ import { getItemsBlockConfig as f, setItemsBlockConfig as u } from "../../utils/nodeConfigUtils.js";
10
+ const D = p.PRICE_FORMATTED_PRICE, n = {
11
11
  FORMATTED_PRICE: "formattedPrice"
12
12
  };
13
- class y extends h {
13
+ class k extends h {
14
14
  constructor() {
15
15
  super(...arguments);
16
- _(this, "store", O());
16
+ m(this, "store", A());
17
17
  }
18
18
  getId() {
19
- return N;
19
+ return D;
20
20
  }
21
21
  getTemplate() {
22
22
  return `
23
- <div class="container ${l.PRICE_FORMATTED_PRICE}">
23
+ <div class="container ${p.PRICE_FORMATTED_PRICE}">
24
24
  ${this._getFormattedPrice()}
25
25
  </div>
26
26
  `;
27
27
  }
28
28
  onRender() {
29
- this.api.updateValues({ [c.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(c.FORMATTED_PRICE, (e) => {
29
+ this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (e) => {
30
30
  this._onFormattedPriceChange(e);
31
31
  });
32
32
  }
33
33
  onTemplateNodeUpdated(e) {
34
34
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
35
35
  () => {
36
- const o = u(this.currentNode);
37
- o && this.store.setFormattedPrice(o.priceFormatted ?? !0);
36
+ const r = f(this.currentNode);
37
+ r && this.store.setFormattedPrice(r.priceFormatted ?? !0);
38
38
  },
39
39
  () => {
40
- this.api.updateValues({ [c.FORMATTED_PRICE]: this.store.formattedPrice });
40
+ this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
41
41
  }
42
42
  );
43
43
  }
44
44
  _onFormattedPriceChange(e) {
45
- if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), f(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
45
+ if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), u(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
46
46
  return;
47
- const { itemsType: o, singlePrice: i } = this.store, t = I.PAIRS_FOR_EXTENSION.price[o], s = I.PAIRS_FOR_EXTENSION.originalPrice[o], [E, R] = e ? [
48
- i ? t.DEFAULT_SINGLE_PRICE : t.DEFAULT_PRICE,
49
- i ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_PRICE_FORMATTED
50
- ] : [
51
- i ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_PRICE_FORMATTED,
52
- i ? t.DEFAULT_SINGLE_PRICE : t.DEFAULT_PRICE
53
- ], d = i ? s.DEFAULT_SINGLE_PRICE : s.DEFAULT_PRICE, P = i ? s.DEFAULT_SINGLE_PRICE_FORMATTED : s.DEFAULT_PRICE_FORMATTED, [p, F] = e ? [d, P] : [P, d];
47
+ const { itemsType: r } = this.store, o = T.PAIRS_FOR_EXTENSION.price[r], s = T.PAIRS_FOR_EXTENSION.originalPrice[r], [c, a] = e ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE], [l, I] = e ? [s.DEFAULT_PRICE, s.DEFAULT_PRICE_FORMATTED] : [s.DEFAULT_PRICE_FORMATTED, s.DEFAULT_PRICE];
54
48
  this._updatePriceBlock(
55
49
  this.currentNode,
56
- E,
57
- R,
50
+ c,
51
+ a,
58
52
  "price"
59
53
  );
60
- const a = this.currentNode.closest(".items-block"), T = a == null ? void 0 : a.querySelector(`[esd-extension-block-id="${D.ORIGINAL_PRICE}"]`);
61
- T && this._updatePriceBlock(T, p, F, "original price");
54
+ const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${g.ORIGINAL_PRICE}"]`);
55
+ E && this._updatePriceBlock(E, l, I, "original price");
62
56
  }
63
- _updatePriceBlock(e, o, i, t) {
64
- const s = e.getInnerHTML().replace(o, i), E = `Updated ${t} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
65
- this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(s).apply(new L(E));
57
+ _updatePriceBlock(e, r, o, s) {
58
+ const c = e.getInnerHTML().replace(r, o), a = `Updated ${s} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
59
+ this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(c).apply(new F(a));
66
60
  }
67
61
  _getFormattedPrice() {
68
62
  return `
69
63
  <div class="display-flex align-items-center justify-content-between">
70
- <${m.LABEL}
71
- ${g.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
64
+ <${P.LABEL}
65
+ ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
72
66
  >
73
- </${m.LABEL}>
74
- ${this._GuToggle(c.FORMATTED_PRICE)}
67
+ </${P.LABEL}>
68
+ ${this._GuToggle(n.FORMATTED_PRICE)}
75
69
  </div>
76
70
  `;
77
71
  }
78
72
  }
79
73
  export {
80
- N as CONTROL_BLOCK_ID,
81
- y as PriceFormattedPriceControl
74
+ D as CONTROL_BLOCK_ID,
75
+ k as PriceFormattedPriceControl
82
76
  };
@@ -1,17 +1,17 @@
1
1
  var L = Object.defineProperty;
2
- var M = (h, d, e) => d in h ? L(h, d, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[d] = e;
3
- var O = (h, d, e) => M(h, typeof d != "symbol" ? d + "" : d, e);
4
- import { UEAttr as C, ModificationDescription as u } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ var M = (g, p, e) => p in g ? L(g, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[p] = e;
3
+ var C = (g, p, e) => M(g, typeof p != "symbol" ? p + "" : p, e);
4
+ import { UEAttr as O, ModificationDescription as u } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as D } from "../../common-control.js";
6
6
  import { ItemsBlockId as m } from "../enums/controlEnums.js";
7
- import { productPairs as p, templateFirstLine as b } from "../enums/productEnums.js";
7
+ import { productPairs as _, templateFirstLine as b } from "../enums/productEnums.js";
8
8
  import { ItemTypeOptions as R, OrientationOptions as x, ItemInCartOptions as N, SETTINGS_ENUMS as S, DefaultConfigValues as A } from "../enums/settingsEnums.js";
9
9
  import H from "../layouts/horizontal.html.js";
10
10
  import k from "../layouts/vertical.html.js";
11
11
  import { useItemsBlockStore as U } from "../store/items-block.js";
12
- import { getDefaultTemplate as F } from "../template.js";
12
+ import { getDefaultTemplate as $ } from "../template.js";
13
13
  import { getItemsBlockConfig as P, setItemsBlockConfig as f } from "../utils/nodeConfigUtils.js";
14
- const $ = "ui-elements-items-block", a = {
14
+ const F = "ui-elements-items-block", a = {
15
15
  ITEMS_TYPE: "itemsType",
16
16
  ORIENTATION: "orientation",
17
17
  ITEM_IDS: "itemIds"
@@ -19,10 +19,10 @@ const $ = "ui-elements-items-block", a = {
19
19
  class K extends D {
20
20
  constructor() {
21
21
  super(...arguments);
22
- O(this, "store", U());
22
+ C(this, "store", U());
23
23
  }
24
24
  getId() {
25
- return $;
25
+ return F;
26
26
  }
27
27
  getTemplate() {
28
28
  return `
@@ -124,7 +124,7 @@ class K extends D {
124
124
  _initializeSelectItems() {
125
125
  this.api.setUIEAttribute(
126
126
  a.ITEMS_TYPE,
127
- C.SELECTPICKER.items,
127
+ O.SELECTPICKER.items,
128
128
  R
129
129
  );
130
130
  const { itemsType: e, itemIds: t } = this.store;
@@ -134,7 +134,7 @@ class K extends D {
134
134
  const i = N[e];
135
135
  this.api.setUIEAttribute(
136
136
  a.ITEM_IDS,
137
- C.SELECTPICKER.items,
137
+ O.SELECTPICKER.items,
138
138
  i
139
139
  ), this.api.updateValues({
140
140
  [a.ITEM_IDS]: t
@@ -161,7 +161,7 @@ class K extends D {
161
161
  currencyLocation: n,
162
162
  formattedPrice: s
163
163
  } = this.store;
164
- this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(F({
164
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml($({
165
165
  orientation: e,
166
166
  itemsType: t,
167
167
  itemId: i,
@@ -173,12 +173,12 @@ class K extends D {
173
173
  _getTemplateData() {
174
174
  const { itemsType: e, itemIds: t, formattedPrice: i } = this.store, r = N[e].findIndex((s) => s.value === t), n = r > -1 ? r : 0;
175
175
  return {
176
- imageSrc: p.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
177
- name: p.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
178
- price: i ? p.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : p.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
179
- originalPrice: i ? p.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : p.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
180
- quantity: p.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
181
- button: p.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
176
+ imageSrc: _.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
177
+ name: _.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
178
+ price: i ? _.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : _.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
179
+ originalPrice: i ? _.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : _.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
180
+ quantity: _.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
181
+ button: _.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
182
182
  };
183
183
  }
184
184
  _updateImageSrc(e) {
@@ -196,15 +196,15 @@ class K extends D {
196
196
  r = r.replace(i, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(r).apply(new u("Updated name"));
197
197
  }
198
198
  _updatePrice(e) {
199
- var g;
200
- const t = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${m.PRICE}"]`);
199
+ var I;
200
+ const t = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.PRICE}"]`);
201
201
  if (!t)
202
202
  return;
203
203
  const i = this._getParagraphFromBlock(t);
204
204
  if (!i)
205
205
  return;
206
- const r = i.getInnerHTML() || "", n = i.getInnerText() || "", { currencySymbol: s, currencyLocation: l } = this.store, o = (s == null ? void 0 : s.trim()) || "", c = this._removeCurrencySymbol(n, o), T = this._replacePriceNumber(c, e), I = this._buildPriceContent(T, o, l), _ = r.replace(n, I);
207
- this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(_).apply(new u("Updated price"));
206
+ const r = i.getInnerHTML() || "", n = i.getInnerText() || "", { currencySymbol: s, currencyLocation: l } = this.store, o = (s == null ? void 0 : s.trim()) || "", c = this._removeCurrencySymbol(n, o), d = this._replacePriceNumber(c, e), h = this._buildPriceContent(d, o, l), T = r.replace(n, h);
207
+ this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(T).apply(new u("Updated price"));
208
208
  }
209
209
  _updateOriginalPrice(e) {
210
210
  var E;
@@ -219,21 +219,27 @@ class K extends D {
219
219
  const r = i.querySelector("s");
220
220
  if (!r)
221
221
  return;
222
- const n = r.getInnerHTML() || "", s = r.getInnerText() || "", { currencySymbol: l, currencyLocation: o } = this.store, c = (l == null ? void 0 : l.trim()) || "", T = this._removeCurrencySymbol(s, c), I = this._replacePriceNumber(T, e), _ = this._buildPriceContent(I, c, o), y = `<s>${n.replace(s, _)}</s>`;
222
+ const n = r.getInnerHTML() || "", s = r.getInnerText() || "", { currencySymbol: l, currencyLocation: o } = this.store, c = (l == null ? void 0 : l.trim()) || "", d = this._removeCurrencySymbol(s, c), h = this._replacePriceNumber(d, e), T = this._buildPriceContent(h, c, o), y = `<s>${n.replace(s, T)}</s>`;
223
223
  this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(y).apply(new u("Updated original price"));
224
224
  }
225
225
  _updateQuantity(e) {
226
- var c;
227
- const t = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, i = P(this.currentNode), r = (i == null ? void 0 : i.quantityControlEnabled) !== !1, n = t && r, s = (c = this.currentNode) == null ? void 0 : c.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`);
226
+ var d;
227
+ const t = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, i = P(this.currentNode), r = (i == null ? void 0 : i.quantityControlEnabled) !== !1, n = t && r, s = (d = this.currentNode) == null ? void 0 : d.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`);
228
228
  if (!s)
229
229
  return;
230
230
  const l = s.getInnerText().trim();
231
231
  let o = s.getInnerHTML();
232
- o = o.replace(l, e), this.api.getDocumentModifier().modifyHtml(s).setInnerHtml(o).setStyle("display", n ? "table-cell" : "none").apply(new u("Updated quantity"));
232
+ function c(h, T, I) {
233
+ return h.replace(
234
+ new RegExp(`(>\\s*)${T}(\\s*<)`, "g"),
235
+ `$1${I}$2`
236
+ );
237
+ }
238
+ o = c(o, l, e), this.api.getDocumentModifier().modifyHtml(s).setInnerHtml(o).setStyle("display", n ? "table-cell" : "none").apply(new u("Updated quantity"));
233
239
  }
234
240
  _reOrderTemplate() {
235
- var T, I, _, g, y, E;
236
- const e = (T = this.currentNode) == null ? void 0 : T.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), t = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.NAME}"]`), i = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (g = this.currentNode) == null ? void 0 : g.querySelector(
241
+ var d, h, T, I, y, E;
242
+ const e = (d = this.currentNode) == null ? void 0 : d.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), t = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${m.NAME}"]`), i = (T = this.currentNode) == null ? void 0 : T.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (I = this.currentNode) == null ? void 0 : I.querySelector(
237
243
  `[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
238
244
  ), n = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), s = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`);
239
245
  if (!e || !t || !i || !r || !n || !s)
@@ -320,6 +326,6 @@ class K extends D {
320
326
  }
321
327
  }
322
328
  export {
323
- $ as CONTROL_BLOCK_ID,
329
+ F as CONTROL_BLOCK_ID,
324
330
  K as ItemsBlockControl
325
331
  };
@@ -51,10 +51,9 @@ class _ extends O {
51
51
  const o = E !== this.lastBlockInstanceId;
52
52
  return o ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = E) : n(), o;
53
53
  }
54
- _GuLabel({ text: e, name: n = "", position: E = "top" }) {
54
+ _GuLabel({ text: e, name: n = "" }) {
55
55
  return `
56
56
  <${t.LABEL}
57
- style="${E === "top" ? "margin-bottom: 8px;" : ""}"
58
57
  ${$.LABEL.text}="${e}"
59
58
  ${$.LABEL.name}="${n || `${e} Label`}">
60
59
  </${t.LABEL}>
package/dist/guido.css CHANGED
@@ -1 +1 @@
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}
1
+ .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-7f267190] .in-button-v2__wrapper{line-height:0}[data-v-5196584c] .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}
@@ -74,7 +74,7 @@ export declare abstract class CommonControl extends Control {
74
74
  * @returns true if block instance changed, false otherwise
75
75
  */
76
76
  protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void): boolean;
77
- _GuLabel({ text, name, position }: LabelProps): string;
77
+ _GuLabel({ text, name }: LabelProps): string;
78
78
  _GuToggle(name: string): string;
79
79
  _GuSelectItem({ text, value }: {
80
80
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.689d09e",
3
+ "version": "2.0.0-beta.6b1a3c9",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",