@useinsider/guido 2.0.0-beta.087a24f → 2.0.0-beta.13a02f6

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,18 +1,18 @@
1
- import s from "./LeftSlot.vue2.js";
1
+ import o from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var e = this, o = e._self._c, t = e._self._setupProxy;
6
- return o("div", { staticClass: "d-f a-i-c" }, [o(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "text", type: "secondary", "label-text": t.backButtonLabel }, on: { click: t.handleBackClick } }), t.editorStore.isVersionHistoryOpen ? o(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
7
- }, a = [], i = /* @__PURE__ */ r(
8
- s,
9
- n,
10
- a,
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
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(
8
+ o,
9
+ r,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "06e6f7a7"
13
+ "3bf5c743"
14
14
  );
15
- const p = i.exports;
15
+ const d = a.exports;
16
16
  export {
17
- p as default
17
+ d as default
18
18
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as u, computed as m } from "vue";
1
+ import { defineComponent as c, computed as m } from "vue";
2
2
  import { useConfig as f } from "../../../composables/useConfig.js";
3
3
  import { useBack as p } from "../../../composables/useGuidoActions.js";
4
4
  import { usePreviewMode as l } from "../../../composables/usePreviewMode.js";
@@ -7,14 +7,14 @@ import { useVersionHistoryApi as k } from "../../../composables/useVersionHistor
7
7
  import { useEditorStore as B } from "../../../stores/editor.js";
8
8
  import { InButtonV2 as b } from "@useinsider/design-system-vue";
9
9
  import _ from "./version-history/RestoreButton.vue.js";
10
- const h = /* @__PURE__ */ u({
10
+ const S = /* @__PURE__ */ c({
11
11
  __name: "LeftSlot",
12
12
  setup(v) {
13
- const o = B(), r = p(), { closeVersionHistory: i } = k(), { closePreviewMode: n } = l(), e = d(), { config: t } = f(), c = m(() => {
13
+ const o = B(), r = p(), { closeVersionHistory: i } = k(), { closePreviewMode: n } = l(), e = d(), { config: t } = f(), u = m(() => {
14
14
  var s, a;
15
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
16
  });
17
- return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: i, closePreviewMode: n, trans: e, config: t, backButtonLabel: c, handleBackClick: () => {
17
+ return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: i, closePreviewMode: n, trans: e, config: t, backButtonLabel: u, handleBackClick: () => {
18
18
  if (o.isVersionHistoryOpen) {
19
19
  i();
20
20
  return;
@@ -23,10 +23,10 @@ const h = /* @__PURE__ */ u({
23
23
  n();
24
24
  return;
25
25
  }
26
- r();
26
+ o.loadingStatus = !0, r();
27
27
  }, InButtonV2: b, RestoreButton: _ };
28
28
  }
29
29
  });
30
30
  export {
31
- h as default
31
+ S as default
32
32
  };
@@ -1,25 +1,26 @@
1
- import { useActionsApi as _ } from "./useActionsApi.js";
2
- import { useBlocksConfig as k } from "./useBlocksConfig.js";
3
- import { useConfig as B } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as A } from "./useStripoEventHandler.js";
6
- import { useToaster as v } from "./useToaster.js";
1
+ import { useActionsApi as T } from "./useActionsApi.js";
2
+ import { useBlocksConfig as V } from "./useBlocksConfig.js";
3
+ import { useConfig as _ } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as v } from "./useStripoEventHandler.js";
6
+ import { useToaster as A } from "./useToaster.js";
7
7
  import { displayConditions as F } from "../enums/displayConditions.js";
8
8
  import { useStripoApi as D } from "../services/stripoApi.js";
9
9
  import I from "../static/styles/customEditorStyle.css.js";
10
10
  import { useEditorStore as M } from "../stores/editor.js";
11
11
  import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
- const $ = (a) => {
13
- const { features: d } = B(), { handleError: c } = v(), { getToken: g, getCustomFonts: f } = D(), { handleEvent: y } = A(), { getStripoBlocksConfig: C } = k(), S = async (i, n = []) => {
14
- var p, m;
15
- const o = M(), { html: s, css: t, forceRecreate: h } = i, { baseBlocks: l, extensions: w } = await C(), u = ((p = d.value) == null ? void 0 : p.displayConditions) ?? !0, b = ((m = d.value) == null ? void 0 : m.modulesDisabled) ?? !1;
12
+ import P from "../package.json.js";
13
+ const K = (c) => {
14
+ const { features: l } = _(), { handleError: u } = A(), { getToken: y, getCustomFonts: S } = D(), { handleEvent: C } = v(), { getStripoBlocksConfig: E } = V(), h = async (i, n = []) => {
15
+ var g, f;
16
+ const o = M(), { html: r, css: p, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await E(), m = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, b = ((f = l.value) == null ? void 0 : f.modulesDisabled) ?? !1;
16
17
  window.UIEditor.initEditor(
17
18
  document.querySelector("#guido-editor"),
18
19
  {
19
- metadata: a,
20
- html: s,
21
- css: t,
22
- forceRecreate: h,
20
+ metadata: c,
21
+ html: r,
22
+ css: p,
23
+ forceRecreate: a,
23
24
  locale: "en",
24
25
  undoButtonSelector: "#guido__undo-button",
25
26
  redoButtonSelector: "#guido__redo-button",
@@ -30,8 +31,8 @@ const $ = (a) => {
30
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
31
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
32
33
  customViewStyles: I,
33
- conditionsEnabled: u,
34
- customConditionsEnabled: u,
34
+ conditionsEnabled: m,
35
+ customConditionsEnabled: m,
35
36
  conditionCategories: F,
36
37
  enableXSSSecurity: !0,
37
38
  modulesDisabled: b,
@@ -41,7 +42,7 @@ const $ = (a) => {
41
42
  displayTitle: !1,
42
43
  displayUTM: !1,
43
44
  selectElementAfterDrop: !0,
44
- ...l ? { baseBlocks: l } : {},
45
+ ...t ? { baseBlocks: t } : {},
45
46
  editorFonts: {
46
47
  showDefaultStandardFonts: !0,
47
48
  showDefaultNotStandardFonts: !0,
@@ -49,25 +50,25 @@ const $ = (a) => {
49
50
  },
50
51
  mergeTags: [
51
52
  {
52
- entries: U(a.preselectedDynamicContentList)
53
+ entries: U(c.preselectedDynamicContentList)
53
54
  }
54
55
  ],
55
56
  async onTokenRefreshRequest(e) {
56
57
  try {
57
- const r = await g();
58
- e(r);
59
- } catch (r) {
60
- c(r, "Failed to refresh token");
58
+ const s = await y();
59
+ e(s);
60
+ } catch (s) {
61
+ u(s, "Failed to refresh token");
61
62
  }
62
63
  },
63
64
  onTemplateLoaded() {
64
65
  try {
65
- const { importCss: e } = V(), { activateCustomViewStyles: r, updateTimerInClonedTemplate: T } = _();
66
- e(), r(), T(), a.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
66
+ const { importCss: e } = B(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: k } = T();
67
+ e(), s(), k(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
67
68
  o.hasChanges = !1;
68
69
  }, 1e3);
69
70
  } catch (e) {
70
- c(e, "Failed to load custom interface appearance");
71
+ u(e, "Failed to load custom interface appearance");
71
72
  }
72
73
  },
73
74
  onCodeEditorVisibilityChanged(e) {
@@ -82,34 +83,35 @@ const $ = (a) => {
82
83
  onDataChanged() {
83
84
  o.hasChanges = !0;
84
85
  },
85
- onEvent: y,
86
+ onEvent: C,
86
87
  ignoreClickOutsideSelectors: [
87
88
  "#guido-dynamic-content-modal",
88
89
  ".in-on-board-wrapper",
89
90
  ".in-drawer__container"
90
91
  ],
91
- extensions: w
92
+ extensions: d
92
93
  }
93
94
  );
94
- }, E = (i) => new Promise((n, o) => {
95
+ }, w = (i) => new Promise((n, o) => {
96
+ var d;
95
97
  if (document.getElementById("UiEditorScript")) {
96
98
  i(), n();
97
99
  return;
98
100
  }
99
- const s = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t = document.createElement("script");
100
- t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
101
+ const r = P.guido, a = `https://email-static.useinsider.com/guido/${(d = r == null ? void 0 : r.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
102
+ t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
101
103
  i(), n();
102
104
  }, t.onerror = () => {
103
- o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
105
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
104
106
  }, document.body.appendChild(t);
105
107
  });
106
108
  return { initPlugin: async (i) => {
107
- await E(async () => {
108
- const n = await f();
109
- await S(i, n);
109
+ await w(async () => {
110
+ const n = await S();
111
+ await h(i, n);
110
112
  });
111
113
  } };
112
114
  };
113
115
  export {
114
- $ as useStripo
116
+ K as useStripo
115
117
  };
@@ -1,59 +1,52 @@
1
- var r = Object.defineProperty;
2
- var a = (o, e, t) => e in o ? r(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var s = (o, e, t) => a(o, typeof e != "symbol" ? e + "" : e, t);
1
+ var a = Object.defineProperty;
2
+ var l = (e, t, n) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var i = (e, t, n) => l(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { CommonControl as u } from "../../../common-control.js";
5
5
  import { ItemsBlockControlId as d } from "../../enums/controlEnums.js";
6
- import { useItemsBlockStore as l } from "../../store/items-block.js";
7
- import { syncButtonLinkFromAttributes as h } from "../../utils/syncAttributesFromConfigBlock.js";
8
- import { updateConfigBlockAttributes as m } from "../../utils/updateAttributes.js";
9
- const i = d.BUTTON_LINK, n = {
6
+ import { useItemsBlockStore as m } from "../../store/items-block.js";
7
+ import { getItemsBlockConfig as L } from "../../utils/nodeConfigUtils.js";
8
+ const r = d.BUTTON_LINK, s = {
10
9
  LINK: "link"
11
10
  };
12
- class C extends u {
11
+ class N extends u {
13
12
  constructor() {
14
13
  super(...arguments);
15
- s(this, "store", l());
14
+ i(this, "store", m());
16
15
  }
17
16
  getId() {
18
- return i;
17
+ return r;
19
18
  }
20
19
  getTemplate() {
21
20
  return `
22
- <div class="${i}">
21
+ <div class="container ${r}">
23
22
  ${this._getLink()}
24
23
  </div>
25
24
  `;
26
25
  }
27
26
  onRender() {
28
27
  this.api.updateValues({
29
- [n.LINK]: this.store.buttonLink
30
- }), this._listenToFormUpdates();
28
+ [s.LINK]: this.store.buttonLink
29
+ });
31
30
  }
32
- onTemplateNodeUpdated(t) {
33
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
34
- () => h(this.currentNode),
31
+ onTemplateNodeUpdated(n) {
32
+ super.onTemplateNodeUpdated(n), this.handleBlockInstanceChange(
33
+ () => {
34
+ const o = L(this.currentNode);
35
+ o != null && o.buttonLink && this.store.setButtonLink(o.buttonLink);
36
+ },
35
37
  () => {
36
38
  this.api.updateValues({
37
- [n.LINK]: this.store.buttonLink
39
+ [s.LINK]: this.store.buttonLink
38
40
  });
39
41
  }
40
42
  );
41
43
  }
42
- _listenToFormUpdates() {
43
- this.api.onValueChanged(
44
- n.LINK,
45
- (t) => this._onLinkChange(t)
46
- );
47
- }
48
- _onLinkChange(t) {
49
- console.debug("Button link changed to: ", t), this.store.setButtonLink(t), m(this.currentNode, this.api);
50
- }
51
44
  _getLink() {
52
45
  return `
53
46
  ${this._GuOneColumn([
54
47
  this._GuLabel({ text: "Link" }),
55
48
  this._GuTextInput({
56
- name: n.LINK,
49
+ name: s.LINK,
57
50
  placeholder: "Enter Link",
58
51
  className: "es-100",
59
52
  disabled: !0
@@ -63,6 +56,6 @@ class C extends u {
63
56
  }
64
57
  }
65
58
  export {
66
- C as ButtonLinkControl,
67
- i as CONTROL_BLOCK_ID
59
+ N as ButtonLinkControl,
60
+ r as CONTROL_BLOCK_ID
68
61
  };
@@ -1,59 +1,52 @@
1
- var r = Object.defineProperty;
2
- var a = (o, t, e) => t in o ? r(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var i = (o, t, e) => a(o, typeof t != "symbol" ? t + "" : t, e);
4
- import { CommonControl as m } from "../../../common-control.js";
1
+ var a = Object.defineProperty;
2
+ var m = (t, e, n) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var s = (t, e, n) => m(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommonControl as l } from "../../../common-control.js";
5
5
  import { ItemsBlockControlId as d } from "../../enums/controlEnums.js";
6
- import { useItemsBlockStore as l } from "../../store/items-block.js";
7
- import { syncImageLinkFromAttributes as h } from "../../utils/syncAttributesFromConfigBlock.js";
8
- import { updateConfigBlockAttributes as p } from "../../utils/updateAttributes.js";
9
- const s = d.IMAGE_LINK, n = {
6
+ import { useItemsBlockStore as L } from "../../store/items-block.js";
7
+ import { getItemsBlockConfig as p } from "../../utils/nodeConfigUtils.js";
8
+ const r = d.IMAGE_LINK, i = {
10
9
  LINK: "link"
11
10
  };
12
- class N extends m {
11
+ class g extends l {
13
12
  constructor() {
14
13
  super(...arguments);
15
- i(this, "store", l());
14
+ s(this, "store", L());
16
15
  }
17
16
  getId() {
18
- return s;
17
+ return r;
19
18
  }
20
19
  getTemplate() {
21
20
  return `
22
- <div class="${s}">
21
+ <div class="container ${r}">
23
22
  ${this._getLink()}
24
23
  </div>
25
24
  `;
26
25
  }
27
26
  onRender() {
28
27
  this.api.updateValues({
29
- [n.LINK]: this.store.imageLink
30
- }), this._listenToFormUpdates();
28
+ [i.LINK]: this.store.imageLink
29
+ });
31
30
  }
32
- onTemplateNodeUpdated(e) {
33
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
34
- () => h(this.currentNode),
31
+ onTemplateNodeUpdated(n) {
32
+ super.onTemplateNodeUpdated(n), this.handleBlockInstanceChange(
33
+ () => {
34
+ const o = p(this.currentNode);
35
+ o != null && o.imageLink && this.store.setImageLink(o.imageLink);
36
+ },
35
37
  () => {
36
38
  this.api.updateValues({
37
- [n.LINK]: this.store.imageLink
39
+ [i.LINK]: this.store.imageLink
38
40
  });
39
41
  }
40
42
  );
41
43
  }
42
- _listenToFormUpdates() {
43
- this.api.onValueChanged(
44
- n.LINK,
45
- (e) => this._onLinkChange(e)
46
- );
47
- }
48
- _onLinkChange(e) {
49
- console.debug("Image link changed to: ", e), this.store.setImageLink(e), p(this.currentNode, this.api);
50
- }
51
44
  _getLink() {
52
45
  return `
53
46
  ${this._GuOneColumn([
54
47
  this._GuLabel({ text: "Link" }),
55
48
  this._GuTextInput({
56
- name: n.LINK,
49
+ name: i.LINK,
57
50
  placeholder: "Enter Link",
58
51
  className: "es-100",
59
52
  disabled: !0
@@ -63,6 +56,6 @@ class N extends m {
63
56
  }
64
57
  }
65
58
  export {
66
- s as CONTROL_BLOCK_ID,
67
- N as ImageLinkControl
59
+ r as CONTROL_BLOCK_ID,
60
+ g as ImageLinkControl
68
61
  };
@@ -1,6 +1,6 @@
1
1
  var d = Object.defineProperty;
2
2
  var h = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var n = (i, t, e) => h(i, typeof t != "symbol" ? t + "" : t, e);
3
+ var s = (i, t, e) => h(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { ModificationDescription as a, UIElementType as l, UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as c } from "../../../common-control.js";
6
6
  import { ItemsBlockControlId as p } from "../../enums/controlEnums.js";
@@ -11,17 +11,17 @@ import { updateConfigBlockAttributes as u } from "../../utils/updateAttributes.j
11
11
  const y = p.NAME_TRIMMING, o = {
12
12
  TRIMMING: "trimming"
13
13
  };
14
- class _ extends c {
14
+ class v extends c {
15
15
  constructor() {
16
16
  super(...arguments);
17
- n(this, "store", N());
17
+ s(this, "store", N());
18
18
  }
19
19
  getId() {
20
20
  return y;
21
21
  }
22
22
  getTemplate() {
23
23
  return `
24
- <div class="${p.NAME_TRIMMING}">
24
+ <div class="container ${p.NAME_TRIMMING}">
25
25
  ${this._getTextTrimming()}
26
26
  </div>
27
27
  `;
@@ -43,8 +43,8 @@ class _ extends c {
43
43
  this.store.setNameTrimming(e), u(this.currentNode, this.api), this.api.updateValues({ [o.TRIMMING]: e }), this._applyTrimmingStyles(e);
44
44
  }
45
45
  _applyTrimmingStyles(e) {
46
- var s;
47
- const r = (s = this.currentNode) == null ? void 0 : s.querySelector("p > a");
46
+ var n;
47
+ const r = (n = this.currentNode) == null ? void 0 : n.querySelector("p > a");
48
48
  if (!r)
49
49
  return;
50
50
  const T = e !== void 0 ? e : this.store.nameTrimming, m = this.store.orientation === I.ORIENTATION.VERTICAL;
@@ -52,19 +52,17 @@ class _ extends c {
52
52
  }
53
53
  _getTextTrimming() {
54
54
  return `
55
- <div class="container">
56
- <div class="display-flex align-items-center justify-content-between">
57
- <${l.LABEL}
58
- ${g.LABEL.text}="${this.api.translate("Text Trimming")}"
59
- >
60
- </${l.LABEL}>
61
- ${this._GuToggle(o.TRIMMING)}
62
- </div>
55
+ <div class="display-flex align-items-center justify-content-between">
56
+ <${l.LABEL}
57
+ ${g.LABEL.text}="${this.api.translate("Text Trimming")}"
58
+ >
59
+ </${l.LABEL}>
60
+ ${this._GuToggle(o.TRIMMING)}
63
61
  </div>
64
62
  `;
65
63
  }
66
64
  }
67
65
  export {
68
66
  y as CONTROL_BLOCK_ID,
69
- _ as NameTrimmingControl
67
+ v as NameTrimmingControl
70
68
  };
@@ -21,7 +21,7 @@ class Y extends T {
21
21
  }
22
22
  getTemplate() {
23
23
  return `
24
- <div class="${h.PRICE_CURRENCY_LOCATION}">
24
+ <div class="container ${h.PRICE_CURRENCY_LOCATION}">
25
25
  ${this._getCurrencyLocation()}
26
26
  </div>
27
27
  `;
@@ -21,7 +21,7 @@ class P extends R {
21
21
  }
22
22
  getTemplate() {
23
23
  return `
24
- <div class="${h.PRICE_CURRENCY_SYMBOL}">
24
+ <div class="container ${h.PRICE_CURRENCY_SYMBOL}">
25
25
  ${this._getCurrencySymbol()}
26
26
  </div>
27
27
  `;
@@ -3,12 +3,12 @@ var I = (r, e, t) => e in r ? _(r, e, { enumerable: !0, configurable: !0, writab
3
3
  var P = (r, e, t) => I(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { ModificationDescription as F, UIElementType as m, 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 A } from "../../enums/controlEnums.js";
6
+ import { ItemsBlockControlId as p, ItemsBlockId as A } from "../../enums/controlEnums.js";
7
7
  import { productPairs as T } from "../../enums/productEnums.js";
8
8
  import { useItemsBlockStore as u } from "../../store/items-block.js";
9
9
  import { syncFormattedPriceFromAttributes as g } from "../../utils/syncAttributesFromConfigBlock.js";
10
10
  import { updateConfigBlockAttributes as D } from "../../utils/updateAttributes.js";
11
- const f = l.PRICE_FORMATTED_PRICE, n = {
11
+ const f = p.PRICE_FORMATTED_PRICE, s = {
12
12
  FORMATTED_PRICE: "formattedPrice"
13
13
  };
14
14
  class y extends h {
@@ -21,13 +21,13 @@ class y extends h {
21
21
  }
22
22
  getTemplate() {
23
23
  return `
24
- <div class="${l.PRICE_FORMATTED_PRICE}">
24
+ <div class="container ${p.PRICE_FORMATTED_PRICE}">
25
25
  ${this._getFormattedPrice()}
26
26
  </div>
27
27
  `;
28
28
  }
29
29
  onRender() {
30
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (t) => {
30
+ this.api.updateValues({ [s.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(s.FORMATTED_PRICE, (t) => {
31
31
  this._onFormattedPriceChange(t);
32
32
  });
33
33
  }
@@ -35,14 +35,14 @@ class y extends h {
35
35
  super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
36
36
  () => g(this.currentNode),
37
37
  () => {
38
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
38
+ this.api.updateValues({ [s.FORMATTED_PRICE]: this.store.formattedPrice });
39
39
  }
40
40
  );
41
41
  }
42
42
  _onFormattedPriceChange(t) {
43
43
  if (console.debug("Formatted price changed to: ", t), this.store.setFormattedPrice(t), D(this.currentNode, this.api), !this.currentNode)
44
44
  return;
45
- const { itemsType: s } = this.store, i = T.PAIRS_FOR_EXTENSION.price[s], o = T.PAIRS_FOR_EXTENSION.originalPrice[s], [c, a] = t ? [i.DEFAULT_PRICE, i.DEFAULT_PRICE_FORMATTED] : [i.DEFAULT_PRICE_FORMATTED, i.DEFAULT_PRICE], [p, R] = t ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE];
45
+ const { itemsType: n } = this.store, i = T.PAIRS_FOR_EXTENSION.price[n], o = T.PAIRS_FOR_EXTENSION.originalPrice[n], [c, a] = t ? [i.DEFAULT_PRICE, i.DEFAULT_PRICE_FORMATTED] : [i.DEFAULT_PRICE_FORMATTED, i.DEFAULT_PRICE], [l, R] = t ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE];
46
46
  this._updatePriceBlock(
47
47
  this.currentNode,
48
48
  c,
@@ -50,22 +50,20 @@ class y extends h {
50
50
  "price"
51
51
  );
52
52
  const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${A.ORIGINAL_PRICE}"]`);
53
- E && this._updatePriceBlock(E, p, R, "original price");
53
+ E && this._updatePriceBlock(E, l, R, "original price");
54
54
  }
55
- _updatePriceBlock(t, s, i, o) {
56
- const c = t.getInnerHTML().replace(s, i), a = `Updated ${o} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
55
+ _updatePriceBlock(t, n, i, o) {
56
+ const c = t.getInnerHTML().replace(n, i), a = `Updated ${o} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
57
57
  this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(c).apply(new F(a));
58
58
  }
59
59
  _getFormattedPrice() {
60
60
  return `
61
- <div class="container">
62
- <div class="display-flex align-items-center justify-content-between">
63
- <${m.LABEL}
64
- ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
65
- >
66
- </${m.LABEL}>
67
- ${this._GuToggle(n.FORMATTED_PRICE)}
68
- </div>
61
+ <div class="display-flex align-items-center justify-content-between">
62
+ <${m.LABEL}
63
+ ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
64
+ >
65
+ </${m.LABEL}>
66
+ ${this._GuToggle(s.FORMATTED_PRICE)}
69
67
  </div>
70
68
  `;
71
69
  }
@@ -1,32 +1,32 @@
1
1
  var d = Object.defineProperty;
2
2
  var a = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var o = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { UIElementType as n, UEAttr as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as u } from "../../../common-control.js";
3
+ var s = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { UIElementType as n, UEAttr as u } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as c } from "../../../common-control.js";
6
6
  import { ItemsBlockControlId as r } from "../../enums/controlEnums.js";
7
7
  import { useItemsBlockStore as D } from "../../store/items-block.js";
8
8
  import { syncHideDiscountFromAttributes as p } from "../../utils/syncAttributesFromConfigBlock.js";
9
9
  import { updateConfigBlockAttributes as I } from "../../utils/updateAttributes.js";
10
- const l = r.PRICE_HIDE_DISCOUNT, s = {
10
+ const h = r.PRICE_HIDE_DISCOUNT, o = {
11
11
  HIDE_DISCOUNT: "hideDiscount"
12
12
  };
13
- class N extends u {
13
+ class N extends c {
14
14
  constructor() {
15
15
  super(...arguments);
16
- o(this, "store", D());
16
+ s(this, "store", D());
17
17
  }
18
18
  getId() {
19
- return l;
19
+ return h;
20
20
  }
21
21
  getTemplate() {
22
22
  return `
23
- <div class="${r.PRICE_HIDE_DISCOUNT}">
23
+ <div class="container ${r.PRICE_HIDE_DISCOUNT}">
24
24
  ${this._getHideDiscount()}
25
25
  </div>
26
26
  `;
27
27
  }
28
28
  onRender() {
29
- this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount }), this.api.onValueChanged(s.HIDE_DISCOUNT, (t) => {
29
+ this.api.updateValues({ [o.HIDE_DISCOUNT]: this.store.hideDiscount }), this.api.onValueChanged(o.HIDE_DISCOUNT, (t) => {
30
30
  this._onHideDiscountChange(t);
31
31
  });
32
32
  }
@@ -34,28 +34,28 @@ class N extends u {
34
34
  super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
35
35
  () => p(this.currentNode),
36
36
  () => {
37
- this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount });
37
+ this.api.updateValues({ [o.HIDE_DISCOUNT]: this.store.hideDiscount });
38
38
  }
39
39
  );
40
40
  }
41
41
  _onHideDiscountChange(t) {
42
- this.store.setHideDiscount(t), I(this.currentNode, this.api), this.api.updateValues({ [s.HIDE_DISCOUNT]: t });
42
+ this.store.setHideDiscount(t), I(this.currentNode, this.api), this.api.updateValues({ [o.HIDE_DISCOUNT]: t });
43
43
  }
44
44
  _getHideDiscount() {
45
45
  return `
46
- <div class="container">
46
+
47
47
  <div class="display-flex align-items-center justify-content-between">
48
48
  <${n.LABEL}
49
- ${c.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
49
+ ${u.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
50
50
  >
51
51
  </${n.LABEL}>
52
- ${this._GuToggle(s.HIDE_DISCOUNT)}
52
+ ${this._GuToggle(o.HIDE_DISCOUNT)}
53
53
  </div>
54
54
  </div>
55
55
  `;
56
56
  }
57
57
  }
58
58
  export {
59
- l as CONTROL_BLOCK_ID,
59
+ h as CONTROL_BLOCK_ID,
60
60
  N as PriceHideDiscountControl
61
61
  };
@@ -23,7 +23,7 @@ class H extends y {
23
23
  }
24
24
  getTemplate() {
25
25
  return `
26
- <div class="${O.PRICE_ORIENTATION}">
26
+ <div class="container ${O.PRICE_ORIENTATION}">
27
27
  ${this._getPriceOrientation()}
28
28
  </div>
29
29
  `;