@useinsider/guido 1.0.3-beta.52ded25 → 1.0.3-beta.538b804

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.
package/README.md CHANGED
@@ -600,9 +600,6 @@ Create a `.env` file with the following variables: (You can get env variables fr
600
600
  VITE_STRIPO_PLUGIN_ID=your_plugin_id
601
601
  VITE_STRIPO_SECRET_KEY=your_secret_key
602
602
  VITE_STRIPO_ROLE=your_role
603
-
604
- # Playwright Test Configuration (Optional - for local debugging only)
605
- HEADED=false # Set to 'true' to run tests with visible browser
606
603
  ```
607
604
 
608
605
  ### Project Structure
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "98181b5a"
15
+ "23c413c9"
16
16
  );
17
17
  const v = s.exports;
18
18
  export {
@@ -10,7 +10,7 @@ var s = function() {
10
10
  n,
11
11
  !1,
12
12
  null,
13
- "07c4b2d8"
13
+ "dced5582"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,4 +1,4 @@
1
- import { defineComponent as H, ref as m, computed as _ } from "vue";
1
+ import { defineComponent as H, ref as p, computed as _ } from "vue";
2
2
  import { useConfig as h } from "../../../composables/useConfig.js";
3
3
  import { useExport as V } from "../../../composables/useExport.js";
4
4
  import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
10
10
  import { InButtonV2 as A } from "@useinsider/design-system-vue";
11
11
  const J = /* @__PURE__ */ H({
12
12
  __name: "RightSlot",
13
- setup(k, { expose: c }) {
14
- const { config: u } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = m(!1), s = m(!1), f = x(), v = () => {
15
- if (o.isVersionHistoryOpen) {
13
+ setup(k, { expose: m }) {
14
+ const { config: c } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), t = C(), o = T(), e = p(!1), s = p(!1), u = x(), f = () => {
15
+ if (t.isVersionHistoryOpen) {
16
16
  a();
17
17
  return;
18
18
  }
19
19
  i();
20
- }, d = async () => {
20
+ }, v = async () => {
21
21
  e.value = !0, await r(), e.value = !1;
22
- }, y = () => {
23
- o.isSaveAsTemplateDrawerOpen = !0;
24
- }, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
25
- s.value = !0, o.loadingStatus = !0;
26
- const g = await n(p);
27
- return s.value = !1, p && (o.loadingStatus = !1), g;
22
+ }, d = () => {
23
+ t.isSaveAsTemplateDrawerOpen = !0;
24
+ }, y = _(() => t.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), l = async (S) => {
25
+ s.value = !0, t.loadingStatus = !0;
26
+ const g = await n(S);
27
+ return s.value = !1, t.loadingStatus = !1, g;
28
28
  };
29
- return c({
29
+ return m({
30
30
  handleSave: l
31
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: f, handleVersionHistory: v, handleExport: d, handleSaveAs: y, versionHistoryTooltipText: S, handleSave: l, getTooltipOptions: O, InButtonV2: A };
31
+ }), { __sfc: !0, config: c, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: t, trans: o, isExporting: e, isSaving: s, testEmailClick: u, handleVersionHistory: f, handleExport: v, handleSaveAs: d, versionHistoryTooltipText: y, handleSave: l, getTooltipOptions: O, InButtonV2: A };
32
32
  }
33
33
  });
34
34
  export {
@@ -1,23 +1,23 @@
1
- import { useActionsApi as w } from "./useActionsApi.js";
1
+ import { useActionsApi as h } from "./useActionsApi.js";
2
2
  import { useBlocksConfig as b } from "./useBlocksConfig.js";
3
3
  import { useConfig as k } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
5
  import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
6
6
  import { useToaster as B } from "./useToaster.js";
7
- import { displayConditions as T } from "../enums/displayConditions.js";
8
- import { useStripoApi as A } from "../services/stripoApi.js";
9
- import F from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as M } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
- import v from "../package.json.js";
13
- const J = (c) => {
14
- const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = A(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = b(), E = async (i, r = []) => {
7
+ import { displayConditions as A } from "../enums/displayConditions.js";
8
+ import { useStripoApi as F } from "../services/stripoApi.js";
9
+ import T from "../static/styles/customEditorStyle.css.js";
10
+ import { useEditorStore as v } from "../stores/editor.js";
11
+ import { dynamicContentToMergeTags as I } from "../utils/genericUtil.js";
12
+ import M from "../package.json.js";
13
+ const N = (d) => {
14
+ const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: S } = F(), { handleEvent: C } = _(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
15
15
  var m, g;
16
- const t = M(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: d } = await C();
16
+ const t = v(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: c } = await y();
17
17
  window.UIEditor.initEditor(
18
18
  document.querySelector("#guido-editor"),
19
19
  {
20
- metadata: c,
20
+ metadata: d,
21
21
  html: n,
22
22
  css: p,
23
23
  forceRecreate: a,
@@ -30,16 +30,12 @@ const J = (c) => {
30
30
  customAppearanceMergetags: !0,
31
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: F,
33
+ customViewStyles: T,
34
34
  conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
35
35
  customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
36
- conditionCategories: T,
36
+ conditionCategories: A,
37
37
  enableXSSSecurity: !0,
38
- messageSettingsEnabled: !0,
39
- displayGmailAnnotations: !0,
40
- displayHiddenPreheader: !1,
41
- displayTitle: !1,
42
- displayUTM: !1,
38
+ messageSettingsEnabled: !1,
43
39
  selectElementAfterDrop: !0,
44
40
  ...e ? { baseBlocks: e } : {},
45
41
  editorFonts: {
@@ -49,7 +45,7 @@ const J = (c) => {
49
45
  },
50
46
  mergeTags: [
51
47
  {
52
- entries: U(c.preselectedDynamicContentList)
48
+ entries: I(d.preselectedDynamicContentList)
53
49
  }
54
50
  ],
55
51
  async onTokenRefreshRequest(o) {
@@ -62,8 +58,8 @@ const J = (c) => {
62
58
  },
63
59
  onTemplateLoaded() {
64
60
  try {
65
- const { importCss: o } = V(), { activateCustomViewStyles: s } = w();
66
- o(), s(), c.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
61
+ const { importCss: o } = V(), { activateCustomViewStyles: s } = h();
62
+ o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
67
63
  t.hasChanges = !1;
68
64
  }, 1e3);
69
65
  } catch (o) {
@@ -82,22 +78,22 @@ const J = (c) => {
82
78
  onDataChanged() {
83
79
  t.hasChanges = !0;
84
80
  },
85
- onEvent: S,
81
+ onEvent: C,
86
82
  ignoreClickOutsideSelectors: [
87
83
  "#guido-dynamic-content-modal",
88
84
  ".in-on-board-wrapper",
89
85
  ".in-drawer__container"
90
86
  ],
91
- extensions: d
87
+ extensions: c
92
88
  }
93
89
  );
94
- }, h = (i) => new Promise((r, t) => {
95
- var d;
90
+ }, w = (i) => new Promise((r, t) => {
91
+ var c;
96
92
  if (document.getElementById("UiEditorScript")) {
97
93
  i(), r();
98
94
  return;
99
95
  }
100
- const n = v.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
96
+ const n = M.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
101
97
  e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
102
98
  i(), r();
103
99
  }, e.onerror = () => {
@@ -105,12 +101,12 @@ const J = (c) => {
105
101
  }, document.body.appendChild(e);
106
102
  });
107
103
  return { initPlugin: async (i) => {
108
- await h(async () => {
109
- const r = await y();
104
+ await w(async () => {
105
+ const r = await S();
110
106
  await E(i, r);
111
107
  });
112
108
  } };
113
109
  };
114
110
  export {
115
- J as useStripo
111
+ N as useStripo
116
112
  };
@@ -2,9 +2,9 @@ var d = Object.defineProperty;
2
2
  var l = (r, n, e) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
3
3
  var o = (r, n, e) => l(r, typeof n != "symbol" ? n + "" : n, e);
4
4
  import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
5
+ import { DEFAULT_UNSUBSCRIBE_GROUP as u } from "../../../enums/unsubscribe.js";
6
6
  import { Control as h, UIElementType as i, UEAttr as t, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-checkbox", u = "select", { get: C } = L();
7
+ const m = "ui-elements-checkbox", a = "select", { get: C } = L();
8
8
  class S extends h {
9
9
  constructor() {
10
10
  super(...arguments);
@@ -16,16 +16,15 @@ class S extends h {
16
16
  return m;
17
17
  }
18
18
  _setFormValues() {
19
- if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
19
+ if (this.currentNode && "getAttribute" in this.currentNode) {
20
20
  const e = this.currentNode.getAttribute("id");
21
21
  if (e) {
22
- const s = e === c.sendGridId ? e : Number(e);
23
- s && (this.selectedUnsubGroup = s);
22
+ const s = e === u.sendGridId ? e : Number(e);
23
+ s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
+ [a]: this.selectedUnsubGroup
25
+ }));
24
26
  }
25
27
  }
26
- this.api.updateValues({
27
- [u]: this.selectedUnsubGroup
28
- });
29
28
  }
30
29
  _getLabel(e, s = `${Math.random()}`) {
31
30
  return `
@@ -55,7 +54,7 @@ class S extends h {
55
54
  </${i.LABEL}>
56
55
 
57
56
  <${i.SELECTPICKER}
58
- ${t.SELECTPICKER.name}="${u}"
57
+ ${t.SELECTPICKER.name}="${a}"
59
58
  ${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
60
59
  ${this._getSelect()}
61
60
  </${i.SELECTPICKER}>
@@ -67,21 +66,21 @@ class S extends h {
67
66
  this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
68
67
  }
69
68
  _listenToFormUpdates() {
70
- this.api.onValueChanged(u, (e) => this._onSelectChange(e));
69
+ this.api.onValueChanged(a, (e) => this._onSelectChange(e));
71
70
  }
72
71
  onTemplateNodeUpdated(e) {
73
- this.currentNode = e, this._setFormValues();
72
+ this.currentNode = e;
74
73
  }
75
74
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
76
75
  async onRender() {
77
76
  const e = await C(
78
77
  "/unsubscribe-groups/unsubscribe-list"
79
- ), s = [c, ...e.data], E = s.map((a) => ({
80
- [t.SELECT_ITEM.text]: a.name,
81
- [t.SELECT_ITEM.value]: a.sendGridId
78
+ ), s = [u, ...e.data], E = s.map((c) => ({
79
+ [t.SELECT_ITEM.text]: c.name,
80
+ [t.SELECT_ITEM.value]: c.sendGridId
82
81
  }));
83
82
  this.unsubList = s, this.api.setUIEAttribute(
84
- u,
83
+ a,
85
84
  t.SELECTPICKER.items,
86
85
  E
87
86
  ), this._setFormValues(), this._listenToFormUpdates();
@@ -3,7 +3,7 @@ const e = {
3
3
  TITLE: "Unsubscribe From All Email Lists",
4
4
  DESCRIPTION: "You will still receive important transactional and billing-related emails."
5
5
  }, l = `
6
- <td align="left" class="checkbox-block checkbox-block-v2 esd-block-checkbox es-p20">
6
+ <td align="left" class="checkbox-block-v2 esd-block-checkbox es-p20">
7
7
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
8
8
  <tbody>
9
9
  <tr>
@@ -26,16 +26,11 @@ const e = {
26
26
  </tbody>
27
27
  </table>
28
28
  </td>
29
- `, o = `
30
- <td
31
- align="left"
32
- esd-extension-block-id="checkbox-block"
33
- class="
34
- checkbox-block
35
- checkbox-block-v2
36
- esd-block-checkbox
37
- esd-checkbox-block
38
- esd-extension-block es-p20"
29
+ `, i = `
30
+ <td
31
+ align="left"
32
+ esd-extension-block-id="checkbox-block"
33
+ class="checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20"
39
34
  >
40
35
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
41
36
  <tbody>
@@ -60,10 +55,10 @@ const e = {
60
55
  </table>
61
56
  </td>
62
57
  `;
63
- function a() {
58
+ function c() {
64
59
  return l.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`);
65
60
  }
66
61
  export {
67
- o as default,
68
- a as getDefaultTemplate
62
+ i as default,
63
+ c as getDefaultTemplate
69
64
  };
@@ -44,11 +44,11 @@ class R extends c {
44
44
  }
45
45
  _applyTrimmingStyles(e) {
46
46
  var m;
47
- const o = (m = this.currentNode) == null ? void 0 : m.querySelector("p > a");
47
+ const o = (m = this.currentNode) == null ? void 0 : m.querySelector("p");
48
48
  if (!o)
49
49
  return;
50
50
  const p = e !== void 0 ? e : this.store.nameTrimming, T = this.store.orientation === I.ORIENTATION.VERTICAL;
51
- p ? this.api.getDocumentModifier().modifyHtml(o).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", T ? "130px" : "550px").apply(new n("Text Trimming Enabled")) : this.api.getDocumentModifier().modifyHtml(o).removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow").removeStyle("max-width").apply(new n("Text Trimming Disabled"));
51
+ p ? this.api.getDocumentModifier().modifyHtml(o).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", T ? "130px" : "600px").apply(new n("Text Trimming Enabled")) : this.api.getDocumentModifier().modifyHtml(o).removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow").removeStyle("max-width").apply(new n("Text Trimming Disabled"));
52
52
  }
53
53
  _getTextTrimming() {
54
54
  return `
@@ -1,18 +1,18 @@
1
- var P = Object.defineProperty;
2
- var M = (T, u, e) => u in T ? P(T, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[u] = e;
3
- var C = (T, u, e) => M(T, typeof u != "symbol" ? u + "" : u, e);
4
- import { UEAttr as b, ModificationDescription as d } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ var M = Object.defineProperty;
2
+ var P = (T, u, e) => u in T ? M(T, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[u] = e;
3
+ var b = (T, u, e) => P(T, typeof u != "symbol" ? u + "" : u, e);
4
+ import { UEAttr as C, ModificationDescription as d } 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
7
  import { productPairs as p, templateFirstLine as A } from "../enums/productEnums.js";
8
- import { ItemTypeOptions as R, OrientationOptions as L, ItemInCartOptions as N, SETTINGS_ENUMS as S } from "../enums/settingsEnums.js";
9
- import x from "../layouts/horizontal.html.js";
8
+ import { ItemTypeOptions as R, OrientationOptions as x, ItemInCartOptions as g, SETTINGS_ENUMS as S } from "../enums/settingsEnums.js";
9
+ import L from "../layouts/horizontal.html.js";
10
10
  import H from "../layouts/vertical.html.js";
11
11
  import { useItemsBlockStore as U } from "../store/items-block.js";
12
12
  import { getDefaultTemplate as F } from "../template.js";
13
13
  import { syncCurrencySymbolFromAttributes as $, syncCurrencyLocationFromAttributes as k, syncFormattedPriceFromAttributes as q } from "../utils/syncAttributesFromConfigBlock.js";
14
14
  import { updateConfigBlockAttributes as f } from "../utils/updateAttributes.js";
15
- const w = "ui-elements-items-block", o = {
15
+ const w = "ui-elements-items-block", s = {
16
16
  ITEMS_TYPE: "itemsType",
17
17
  ORIENTATION: "orientation",
18
18
  ITEM_IDS: "itemIds"
@@ -20,7 +20,7 @@ const w = "ui-elements-items-block", o = {
20
20
  class Z extends D {
21
21
  constructor() {
22
22
  super(...arguments);
23
- C(this, "store", U());
23
+ b(this, "store", U());
24
24
  }
25
25
  getId() {
26
26
  return w;
@@ -36,9 +36,9 @@ class Z extends D {
36
36
  }
37
37
  onRender() {
38
38
  this.api.updateValues({
39
- [o.ORIENTATION]: this.store.orientation,
40
- [o.ITEMS_TYPE]: this.store.itemsType,
41
- [o.ITEM_IDS]: this.store.itemIds
39
+ [s.ORIENTATION]: this.store.orientation,
40
+ [s.ITEMS_TYPE]: this.store.itemsType,
41
+ [s.ITEM_IDS]: this.store.itemIds
42
42
  }), this._listenToFormUpdates();
43
43
  }
44
44
  onTemplateNodeUpdated(e) {
@@ -48,9 +48,9 @@ class Z extends D {
48
48
  },
49
49
  () => {
50
50
  this.api.updateValues({
51
- [o.ORIENTATION]: this.store.orientation,
52
- [o.ITEMS_TYPE]: this.store.itemsType,
53
- [o.ITEM_IDS]: this.store.itemIds
51
+ [s.ORIENTATION]: this.store.orientation,
52
+ [s.ITEMS_TYPE]: this.store.itemsType,
53
+ [s.ITEM_IDS]: this.store.itemIds
54
54
  }), this._initializeSelectItems();
55
55
  }
56
56
  );
@@ -64,7 +64,7 @@ class Z extends D {
64
64
  ${this._GuOneColumn([
65
65
  this._GuLabel({ text: "Item Type" }),
66
66
  this._GuSelect({
67
- name: o.ITEMS_TYPE,
67
+ name: s.ITEMS_TYPE,
68
68
  className: "es-100",
69
69
  placeholder: "Select Item Type",
70
70
  options: R
@@ -77,8 +77,8 @@ class Z extends D {
77
77
  ${this._GuTwoColumns([
78
78
  this._GuLabel({ text: "Orientation" }),
79
79
  this._GuRadioButton({
80
- name: o.ORIENTATION,
81
- buttons: L
80
+ name: s.ORIENTATION,
81
+ buttons: x
82
82
  })
83
83
  ])}
84
84
  `;
@@ -88,7 +88,7 @@ class Z extends D {
88
88
  ${this._GuTwoColumns([
89
89
  this._GuLabel({ text: "Item in Cart" }),
90
90
  this._GuSelect({
91
- name: o.ITEM_IDS,
91
+ name: s.ITEM_IDS,
92
92
  className: "es-100",
93
93
  placeholder: "Select Item In Cart",
94
94
  options: []
@@ -97,43 +97,43 @@ class Z extends D {
97
97
  `;
98
98
  }
99
99
  _onOrientationChange(e) {
100
- console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [o.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), this._recalculateTrimming();
100
+ console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), this._recalculateTrimming();
101
101
  }
102
- _onItemsTypeChange(e) {
103
- const i = S.ITEMS_TYPE[e], t = N[e], r = t == null ? void 0 : t[0];
104
- !i || !r || (this.store.setItemsType(i), this.store.setItemIds(r.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(i), this._initializeSelectItems(), this._reFillTemplate());
102
+ _onItemsTypeChange(e, i) {
103
+ const { itemIds: t } = this.store, r = S.ITEMS_TYPE[e], n = g[i].findIndex((a) => a.value === t), o = g[e][n];
104
+ r && (this.store.setItemsType(r), this.store.setItemIds(o.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(r), this._initializeSelectItems(), this._reFillTemplate());
105
105
  }
106
106
  _onItemIdsChange(e) {
107
- console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [o.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
107
+ console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [s.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
108
108
  }
109
109
  _initializeSelectItems() {
110
110
  this.api.setUIEAttribute(
111
- o.ITEMS_TYPE,
112
- b.SELECTPICKER.items,
111
+ s.ITEMS_TYPE,
112
+ C.SELECTPICKER.items,
113
113
  R
114
114
  );
115
115
  const { itemsType: e, itemIds: i } = this.store;
116
116
  this.api.updateValues({
117
- [o.ITEMS_TYPE]: e
117
+ [s.ITEMS_TYPE]: e
118
118
  });
119
- const t = N[e];
119
+ const t = g[e];
120
120
  this.api.setUIEAttribute(
121
- o.ITEM_IDS,
122
- b.SELECTPICKER.items,
121
+ s.ITEM_IDS,
122
+ C.SELECTPICKER.items,
123
123
  t
124
124
  ), this.api.updateValues({
125
- [o.ITEM_IDS]: i
125
+ [s.ITEM_IDS]: i
126
126
  });
127
127
  }
128
128
  _listenToFormUpdates() {
129
129
  this.api.onValueChanged(
130
- o.ITEMS_TYPE,
131
- (e) => this._onItemsTypeChange(e)
130
+ s.ITEMS_TYPE,
131
+ (e, i) => this._onItemsTypeChange(e, i)
132
132
  ), this.api.onValueChanged(
133
- o.ORIENTATION,
133
+ s.ORIENTATION,
134
134
  (e) => this._onOrientationChange(e)
135
135
  ), this.api.onValueChanged(
136
- o.ITEM_IDS,
136
+ s.ITEM_IDS,
137
137
  (e) => this._onItemIdsChange(e)
138
138
  );
139
139
  }
@@ -144,7 +144,7 @@ class Z extends D {
144
144
  itemIds: t,
145
145
  currencySymbol: r,
146
146
  currencyLocation: n,
147
- formattedPrice: s
147
+ formattedPrice: o
148
148
  } = this.store;
149
149
  this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(F({
150
150
  orientation: e,
@@ -152,11 +152,11 @@ class Z extends D {
152
152
  itemId: t,
153
153
  currencySymbol: r,
154
154
  currencyLocation: n,
155
- formattedPrice: s
155
+ formattedPrice: o
156
156
  })).apply(new d("Updated template"));
157
157
  }
158
158
  _getTemplateData() {
159
- const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = N[e].findIndex((s) => s.value === i), n = r > -1 ? r : 0;
159
+ const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = g[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
160
160
  return {
161
161
  imageSrc: p.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
162
162
  name: p.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
@@ -188,7 +188,7 @@ class Z extends D {
188
188
  const t = this._getParagraphFromBlock(i);
189
189
  if (!t)
190
190
  return;
191
- const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: s, currencyLocation: a } = this.store, l = (s == null ? void 0 : s.trim()) || "", c = this._removeCurrencySymbol(n, l), h = this._replacePriceNumber(c, e), I = this._buildPriceContent(h, l, a), _ = r.replace(n, I);
191
+ const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, l = (o == null ? void 0 : o.trim()) || "", c = this._removeCurrencySymbol(n, l), I = this._replacePriceNumber(c, e), h = this._buildPriceContent(I, l, a), _ = r.replace(n, h);
192
192
  this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(_).apply(new d("Updated price"));
193
193
  }
194
194
  _updateOriginalPrice(e) {
@@ -204,8 +204,8 @@ class Z extends D {
204
204
  const r = t.querySelector("s");
205
205
  if (!r)
206
206
  return;
207
- const n = r.getInnerHTML() || "", s = r.getInnerText() || "", { currencySymbol: a, currencyLocation: l } = this.store, c = (a == null ? void 0 : a.trim()) || "", h = this._removeCurrencySymbol(s, c), I = this._replacePriceNumber(h, e), _ = this._buildPriceContent(I, c, l), g = `<s>${n.replace(s, _)}</s>`;
208
- this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(g).apply(new d("Updated original price"));
207
+ const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: l } = this.store, c = (a == null ? void 0 : a.trim()) || "", I = this._removeCurrencySymbol(o, c), h = this._replacePriceNumber(I, e), _ = this._buildPriceContent(h, c, l), N = `<s>${n.replace(o, _)}</s>`;
208
+ this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(N).apply(new d("Updated original price"));
209
209
  }
210
210
  _updateQuantity(e) {
211
211
  var a;
@@ -213,37 +213,46 @@ class Z extends D {
213
213
  if (!t)
214
214
  return;
215
215
  const r = t.getStyle("display") === "none", n = t.getInnerText().trim();
216
- let s = t.getInnerHTML();
217
- s = s.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(s).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
216
+ let o = t.getInnerHTML();
217
+ o = o.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(o).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
218
+ }
219
+ _updateButton(e) {
220
+ var n;
221
+ const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`);
222
+ if (!i)
223
+ return;
224
+ const t = i.getInnerText().trim();
225
+ let r = i.getInnerHTML();
226
+ r = r.replace(t, e), this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(r).apply(new d("Updated button"));
218
227
  }
219
228
  /**
220
229
  * @todo Optimize template reordering for performance.
221
230
  * @description Reorders the template structure based on current orientation and visibility settings.
222
231
  */
223
232
  _reOrderTemplate() {
224
- var h, I, _, E, g, y, O;
225
- const e = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), i = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.NAME}"]`), t = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(
233
+ var I, h, _, E, N, y, O;
234
+ const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), i = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${m.NAME}"]`), t = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(
226
235
  `[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
227
- ), n = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), s = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`), a = (O = this.currentNode) == null ? void 0 : O.querySelector("esd-config-block");
228
- if (!e || !i || !t || !r || !n || !s || !a)
236
+ ), n = (N = this.currentNode) == null ? void 0 : N.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), o = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`), a = (O = this.currentNode) == null ? void 0 : O.querySelector("esd-config-block");
237
+ if (!e || !i || !t || !r || !n || !o || !a)
229
238
  return;
230
239
  const { orientation: l } = this.store;
231
- let c = l === S.ORIENTATION.VERTICAL ? H : x;
232
- c = c.replace("{-{-TEMPLATE_FIRST_LINE-}-}", A).replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", s.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), c = c.trim().replace(A, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(c).apply(new d("Reordered template"));
240
+ let c = l === S.ORIENTATION.VERTICAL ? H : L;
241
+ c = c.replace("{-{-TEMPLATE_FIRST_LINE-}-}", A).replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), c = c.trim().replace(A, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(c).apply(new d("Reordered template"));
233
242
  }
234
243
  _updateDataTypeAttributes(e) {
235
244
  if (!this.currentNode)
236
245
  return;
237
246
  const i = this.currentNode.closest(".ins-product-td"), t = this.api.getDocumentModifier();
238
247
  i && t.modifyHtml(i).setAttribute("data-type", e), this.currentNode.querySelectorAll("[data-type]").forEach((n) => {
239
- const s = n;
240
- t.modifyHtml(s).setAttribute("data-type", e);
248
+ const o = n;
249
+ t.modifyHtml(o).setAttribute("data-type", e);
241
250
  }), t.apply(new d("Updated data-type attribute"));
242
251
  }
243
252
  _updateDataNumberAttributes(e) {
244
253
  if (!this.currentNode)
245
254
  return;
246
- const { itemsType: i } = this.store, t = N[i].findIndex((l) => l.value === e);
255
+ const { itemsType: i } = this.store, t = g[i].findIndex((l) => l.value === e);
247
256
  let r = "1";
248
257
  if (t >= 0)
249
258
  r = String(t + 1);
@@ -254,15 +263,15 @@ class Z extends D {
254
263
  r = c;
255
264
  }
256
265
  }
257
- const n = this.currentNode.closest(".ins-product-td"), s = this.api.getDocumentModifier();
258
- n && s.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((l) => {
266
+ const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
267
+ n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((l) => {
259
268
  const c = l;
260
- s.modifyHtml(c).setAttribute("data-number", r);
261
- }), s.apply(new d("Updated data-number attribute"));
269
+ o.modifyHtml(c).setAttribute("data-number", r);
270
+ }), o.apply(new d("Updated data-number attribute"));
262
271
  }
263
272
  _reFillTemplate() {
264
273
  const e = this._getTemplateData();
265
- this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity);
274
+ this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity), this._updateButton(e.button);
266
275
  }
267
276
  _recalculateTrimming() {
268
277
  var r;
@@ -292,7 +301,7 @@ class Z extends D {
292
301
  } else {
293
302
  const n = t.match(/([^0-9.,\s]+)/);
294
303
  if (n && n[1]) {
295
- const s = n[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
304
+ const o = n[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(o)}\\s*`);
296
305
  r = t.replace(a, "").trim();
297
306
  }
298
307
  }
@@ -1,26 +1,27 @@
1
- import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { BLOCK_ID as S } from "./block.js";
3
- import { COMPOSITION_CONTROL_BLOCK_ID as R } from "./controls/cardComposition.js";
4
- import { CONTROL_BLOCK_ID as A } from "./controls/settingsControl.js";
1
+ import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as N, ContainerControls as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { BLOCK_ID as R } from "./block.js";
3
+ import { COMPOSITION_CONTROL_BLOCK_ID as A } from "./controls/cardComposition.js";
4
+ import { CONTROL_BLOCK_ID as L } from "./controls/settingsControl.js";
5
5
  import { ItemsBlockId as E, ItemsBlockControlId as I } from "./enums/controlEnums.js";
6
- class U extends O {
7
- registerBlockControls(N) {
8
- N[S] = [
6
+ class n extends O {
7
+ registerBlockControls(_) {
8
+ _[R] = [
9
9
  new T(
10
- _.SETTINGS,
10
+ N.SETTINGS,
11
11
  [
12
- A
12
+ L,
13
+ S.EXTERNAL_INDENTS
13
14
  ]
14
15
  ),
15
16
  new T(
16
17
  "Card Composition",
17
18
  [
18
- R
19
+ A
19
20
  ]
20
21
  ).withLabel("Card Composition")
21
- ], N[E.ORIGINAL_PRICE] = [
22
+ ], _[E.ORIGINAL_PRICE] = [
22
23
  new T(
23
- _.SETTINGS,
24
+ N.SETTINGS,
24
25
  [
25
26
  I.ORIGINAL_PRICE_STYLE,
26
27
  I.ORIGINAL_PRICE_ALIGN,
@@ -28,16 +29,16 @@ class U extends O {
28
29
  ]
29
30
  ),
30
31
  new T(
31
- _.STYLES,
32
+ N.STYLES,
32
33
  [
33
34
  I.ORIGINAL_PRICE_COLOR,
34
35
  I.ORIGINAL_PRICE_FONT_FAMILY,
35
36
  I.ORIGINAL_PRICE_SIZE
36
37
  ]
37
38
  )
38
- ], N[E.PRICE] = [
39
+ ], _[E.PRICE] = [
39
40
  new T(
40
- _.SETTINGS,
41
+ N.SETTINGS,
41
42
  [
42
43
  I.PRICE_STYLE,
43
44
  I.PRICE_ALIGN,
@@ -49,16 +50,16 @@ class U extends O {
49
50
  ]
50
51
  ),
51
52
  new T(
52
- _.STYLES,
53
+ N.STYLES,
53
54
  [
54
55
  I.PRICE_COLOR,
55
56
  I.PRICE_FONT_FAMILY,
56
57
  I.PRICE_SIZE
57
58
  ]
58
59
  )
59
- ], N[E.NAME] = [
60
+ ], _[E.NAME] = [
60
61
  new T(
61
- _.SETTINGS,
62
+ N.SETTINGS,
62
63
  [
63
64
  I.NAME_STYLE,
64
65
  I.NAME_ALIGN,
@@ -67,23 +68,23 @@ class U extends O {
67
68
  ]
68
69
  ),
69
70
  new T(
70
- _.STYLES,
71
+ N.STYLES,
71
72
  [
72
73
  I.NAME_FONT_FAMILY,
73
74
  I.NAME_SIZE,
74
75
  I.NAME_COLOR
75
76
  ]
76
77
  )
77
- ], N[E.QUANTITY] = [
78
+ ], _[E.QUANTITY] = [
78
79
  new T(
79
- _.SETTINGS,
80
+ N.SETTINGS,
80
81
  [
81
82
  I.QUANTITY_FONT_FAMILY,
82
83
  I.QUANTITY_STYLE
83
84
  ]
84
85
  ),
85
86
  new T(
86
- _.STYLES,
87
+ N.STYLES,
87
88
  [
88
89
  I.QUANTITY_ALIGN,
89
90
  I.QUANTITY_SIZE,
@@ -91,18 +92,18 @@ class U extends O {
91
92
  I.QUANTITY_PADDINGS
92
93
  ]
93
94
  )
94
- ], N[E.IMAGE] = [
95
+ ], _[E.IMAGE] = [
95
96
  new T(
96
- _.SETTINGS,
97
+ N.SETTINGS,
97
98
  [
98
99
  I.IMAGE_LINK,
99
100
  I.IMAGE_SIZE,
100
101
  I.IMAGE_MARGINS
101
102
  ]
102
103
  )
103
- ], N[E.BUTTON] = [
104
+ ], _[E.BUTTON] = [
104
105
  new T(
105
- _.SETTINGS,
106
+ N.SETTINGS,
106
107
  [
107
108
  I.BUTTON_LINK,
108
109
  I.BUTTON_TEXT,
@@ -112,7 +113,7 @@ class U extends O {
112
113
  ]
113
114
  ),
114
115
  new T(
115
- _.STYLES,
116
+ N.STYLES,
116
117
  [
117
118
  I.BUTTON_COLOR,
118
119
  I.BUTTON_FONT_FAMILY,
@@ -127,5 +128,5 @@ class U extends O {
127
128
  }
128
129
  }
129
130
  export {
130
- U as SettingsPanel
131
+ n as SettingsPanel
131
132
  };
@@ -2,10 +2,10 @@ var d = Object.defineProperty;
2
2
  var l = (r, n, t) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
3
  var o = (r, n, t) => l(r, typeof n != "symbol" ? n + "" : n, t);
4
4
  import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
5
+ import { DEFAULT_UNSUBSCRIBE_GROUP as E } from "../../../enums/unsubscribe.js";
6
6
  import { Control as p, UIElementType as i, UEAttr as e, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-radio-button", u = "select", { get: $ } = L();
8
- class S extends p {
7
+ const m = "ui-elements-radio-button", a = "select", { get: $ } = L();
8
+ class _ extends p {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  o(this, "currentNode");
@@ -16,16 +16,15 @@ class S extends p {
16
16
  return m;
17
17
  }
18
18
  _setFormValues() {
19
- if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
19
+ if (this.currentNode && "getAttribute" in this.currentNode) {
20
20
  const t = this.currentNode.getAttribute("id");
21
21
  if (t) {
22
- const s = t === c.sendGridId ? t : Number(t);
23
- s && (this.selectedUnsubGroup = s);
22
+ const s = t === E.sendGridId ? t : Number(t);
23
+ s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
+ [a]: this.selectedUnsubGroup
25
+ }));
24
26
  }
25
27
  }
26
- this.api.updateValues({
27
- [u]: this.selectedUnsubGroup
28
- });
29
28
  }
30
29
  _getLabel(t, s = `${Math.random()}`) {
31
30
  return `
@@ -55,7 +54,7 @@ class S extends p {
55
54
  </${i.LABEL}>
56
55
 
57
56
  <${i.SELECTPICKER}
58
- ${e.SELECTPICKER.name}="${u}"
57
+ ${e.SELECTPICKER.name}="${a}"
59
58
  ${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
60
59
  ${this._getSelect()}
61
60
  </${i.SELECTPICKER}>
@@ -67,27 +66,27 @@ class S extends p {
67
66
  this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
68
67
  }
69
68
  _listenToFormUpdates() {
70
- this.api.onValueChanged(u, (t) => this._onSelectChange(t));
69
+ this.api.onValueChanged(a, (t) => this._onSelectChange(t));
71
70
  }
72
71
  onTemplateNodeUpdated(t) {
73
- this.currentNode = t, this._setFormValues();
72
+ this.currentNode = t;
74
73
  }
75
74
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
76
75
  async onRender() {
77
76
  const t = await $(
78
77
  "/unsubscribe-groups/unsubscribe-list"
79
- ), s = [c, ...t.data], E = s.map((a) => ({
80
- [e.SELECT_ITEM.text]: a.name,
81
- [e.SELECT_ITEM.value]: a.sendGridId
78
+ ), s = [E, ...t.data], c = s.map((u) => ({
79
+ [e.SELECT_ITEM.text]: u.name,
80
+ [e.SELECT_ITEM.value]: u.sendGridId
82
81
  }));
83
82
  this.unsubList = s, this.api.setUIEAttribute(
84
- u,
83
+ a,
85
84
  e.SELECTPICKER.items,
86
- E
85
+ c
87
86
  ), this._setFormValues(), this._listenToFormUpdates();
88
87
  }
89
88
  }
90
89
  export {
91
90
  m as CONTROL_BLOCK_ID,
92
- S as RadioButtonControl
91
+ _ as RadioButtonControl
93
92
  };
@@ -5,7 +5,7 @@ const e = {
5
5
  YES: "Yes",
6
6
  NO: "No"
7
7
  }, d = `
8
- <td align="left" class="radio-button radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
8
+ <td align="left" class="radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
9
9
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
10
10
  <tbody>
11
11
  <tr>
@@ -75,21 +75,12 @@ const e = {
75
75
  </tbody>
76
76
  </table>
77
77
  </td>
78
- `, a = `
79
- <td
80
- align="left"
81
- esd-extension-block-id="radio-button-block"
78
+ `, l = `
79
+ <td
80
+ align="left"
81
+ esd-extension-block-id="radio-button-block"
82
82
  esd-handler-name="esd-extension-RadioButtonBlock"
83
- class="
84
- radio-button
85
- radio-button-v2
86
- esd-block-ra
87
- esd-radio-button-block
88
- esd-extension-block
89
- es-p10t
90
- es-p10b
91
- es-p30r
92
- es-p30l"
83
+ class="radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l"
93
84
  >
94
85
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
95
86
  <tbody>
@@ -149,10 +140,10 @@ const e = {
149
140
  </table>
150
141
  </td>
151
142
  `;
152
- function l() {
143
+ function a() {
153
144
  return d.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`).replace("{-{-YES-}-}", `<p path="1">${e.YES}</p>`).replace("{-{-NO-}-}", `<p path="1">${e.NO}</p>`);
154
145
  }
155
146
  export {
156
- a as default,
157
- l as getDefaultTemplate
147
+ l as default,
148
+ a as getDefaultTemplate
158
149
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .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-98181b5a]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-98181b5a]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-98181b5a]{height:calc(100vh - 75px)}[data-v-70835920] .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-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .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-f20b3a9b]{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-0502bceb] .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-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-23c413c9],.guido-editor__container[data-v-23c413c9]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-23c413c9]{height:calc(100vh - 75px)}[data-v-70835920] .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-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .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-f20b3a9b]{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,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"checkbox-block\"\n class=\"\n checkbox-block\n checkbox-block-v2\n esd-block-checkbox\n esd-checkbox-block\n esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -13,7 +13,7 @@ export declare class ItemsBlockControl extends CommonControl {
13
13
  _getOrientation(): string;
14
14
  _getItemInCart(): string;
15
15
  _onOrientationChange(value: string): void;
16
- _onItemsTypeChange(value: string): void;
16
+ _onItemsTypeChange(value: string, oldValue: string): void;
17
17
  _onItemIdsChange(value: string): void;
18
18
  _initializeSelectItems(): void;
19
19
  _listenToFormUpdates(): void;
@@ -31,6 +31,7 @@ export declare class ItemsBlockControl extends CommonControl {
31
31
  _updatePrice(price: string): void;
32
32
  _updateOriginalPrice(originalPrice: string): void;
33
33
  _updateQuantity(quantity: string): void;
34
+ _updateButton(button: string): void;
34
35
  /**
35
36
  * @todo Optimize template reordering for performance.
36
37
  * @description Reorders the template structure based on current orientation and visibility settings.
@@ -1,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"radio-button-block\" \n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.52ded25",
3
+ "version": "1.0.3-beta.538b804",
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",
@@ -41,12 +41,10 @@
41
41
  "vue": "2.7.14"
42
42
  },
43
43
  "devDependencies": {
44
- "@commitlint/cli": "20.2.0",
45
- "@commitlint/config-conventional": "20.2.0",
46
44
  "@cspell/eslint-plugin": "8.17.5",
47
45
  "@eslint/eslintrc": "3.3.0",
48
46
  "@eslint/js": "8.57.1",
49
- "@playwright/test": "1.57.0",
47
+ "@playwright/test": "1.55.0",
50
48
  "@stylistic/eslint-plugin": "3.1.0",
51
49
  "@stylistic/eslint-plugin-migrate": "3.1.0",
52
50
  "@types/eslint": "8.56.12",