@useinsider/guido 1.0.3-beta.cd0d7f3 → 1.0.3-beta.cdff8ce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +3 -32
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  4. package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
  5. package/dist/composables/useStripo.js +29 -25
  6. package/dist/extensions/Blocks/Checkbox/control.js +15 -14
  7. package/dist/extensions/Blocks/Checkbox/template.js +14 -9
  8. package/dist/extensions/Blocks/Items/block.js +25 -24
  9. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  10. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +92 -0
  11. package/dist/extensions/Blocks/Items/controls/settingsControl.js +90 -83
  12. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  13. package/dist/extensions/Blocks/Items/enums/productEnums.js +8 -6
  14. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -2
  15. package/dist/extensions/Blocks/Items/extension.js +7 -6
  16. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -57
  17. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +67 -56
  18. package/dist/extensions/Blocks/Items/settingsPanel.js +8 -8
  19. package/dist/extensions/Blocks/Items/store/items-block.js +8 -4
  20. package/dist/extensions/Blocks/Items/template.js +70 -69
  21. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +35 -26
  22. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +29 -27
  23. package/dist/extensions/Blocks/RadioButton/control.js +18 -17
  24. package/dist/extensions/Blocks/RadioButton/template.js +18 -9
  25. package/dist/extensions/Blocks/Unsubscribe/block.js +45 -41
  26. package/dist/guido.css +1 -1
  27. package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
  29. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +15 -0
  30. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +5 -2
  31. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  32. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +2 -0
  33. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
  35. package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
  36. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +6 -0
  37. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  38. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +3 -4
  39. package/package.json +5 -10
@@ -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 E } from "../../../enums/unsubscribe.js";
5
+ import { DEFAULT_UNSUBSCRIBE_GROUP as c } 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", a = "select", { get: $ } = L();
8
- class _ extends p {
7
+ const m = "ui-elements-radio-button", u = "select", { get: $ } = L();
8
+ class S extends p {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  o(this, "currentNode");
@@ -16,15 +16,16 @@ class _ extends p {
16
16
  return m;
17
17
  }
18
18
  _setFormValues() {
19
- if (this.currentNode && "getAttribute" in this.currentNode) {
19
+ if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
20
20
  const t = this.currentNode.getAttribute("id");
21
21
  if (t) {
22
- const s = t === E.sendGridId ? t : Number(t);
23
- s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
- [a]: this.selectedUnsubGroup
25
- }));
22
+ const s = t === c.sendGridId ? t : Number(t);
23
+ s && (this.selectedUnsubGroup = s);
26
24
  }
27
25
  }
26
+ this.api.updateValues({
27
+ [u]: this.selectedUnsubGroup
28
+ });
28
29
  }
29
30
  _getLabel(t, s = `${Math.random()}`) {
30
31
  return `
@@ -54,7 +55,7 @@ class _ extends p {
54
55
  </${i.LABEL}>
55
56
 
56
57
  <${i.SELECTPICKER}
57
- ${e.SELECTPICKER.name}="${a}"
58
+ ${e.SELECTPICKER.name}="${u}"
58
59
  ${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
59
60
  ${this._getSelect()}
60
61
  </${i.SELECTPICKER}>
@@ -66,27 +67,27 @@ class _ extends p {
66
67
  this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
67
68
  }
68
69
  _listenToFormUpdates() {
69
- this.api.onValueChanged(a, (t) => this._onSelectChange(t));
70
+ this.api.onValueChanged(u, (t) => this._onSelectChange(t));
70
71
  }
71
72
  onTemplateNodeUpdated(t) {
72
- this.currentNode = t;
73
+ this.currentNode = t, this._setFormValues();
73
74
  }
74
75
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
75
76
  async onRender() {
76
77
  const t = await $(
77
78
  "/unsubscribe-groups/unsubscribe-list"
78
- ), s = [E, ...t.data], c = s.map((u) => ({
79
- [e.SELECT_ITEM.text]: u.name,
80
- [e.SELECT_ITEM.value]: u.sendGridId
79
+ ), s = [c, ...t.data], E = s.map((a) => ({
80
+ [e.SELECT_ITEM.text]: a.name,
81
+ [e.SELECT_ITEM.value]: a.sendGridId
81
82
  }));
82
83
  this.unsubList = s, this.api.setUIEAttribute(
83
- a,
84
+ u,
84
85
  e.SELECTPICKER.items,
85
- c
86
+ E
86
87
  ), this._setFormValues(), this._listenToFormUpdates();
87
88
  }
88
89
  }
89
90
  export {
90
91
  m as CONTROL_BLOCK_ID,
91
- _ as RadioButtonControl
92
+ S as RadioButtonControl
92
93
  };
@@ -5,7 +5,7 @@ const e = {
5
5
  YES: "Yes",
6
6
  NO: "No"
7
7
  }, d = `
8
- <td align="left" class="radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
8
+ <td align="left" class="radio-button 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,12 +75,21 @@ const e = {
75
75
  </tbody>
76
76
  </table>
77
77
  </td>
78
- `, l = `
79
- <td
80
- align="left"
81
- esd-extension-block-id="radio-button-block"
78
+ `, a = `
79
+ <td
80
+ align="left"
81
+ esd-extension-block-id="radio-button-block"
82
82
  esd-handler-name="esd-extension-RadioButtonBlock"
83
- class="radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l"
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"
84
93
  >
85
94
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
86
95
  <tbody>
@@ -140,10 +149,10 @@ const e = {
140
149
  </table>
141
150
  </td>
142
151
  `;
143
- function a() {
152
+ function l() {
144
153
  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>`);
145
154
  }
146
155
  export {
147
- l as default,
148
- a as getDefaultTemplate
156
+ a as default,
157
+ l as getDefaultTemplate
149
158
  };
@@ -1,17 +1,17 @@
1
- var _ = Object.defineProperty;
2
- var d = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
- var u = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
1
+ var d = Object.defineProperty;
2
+ var _ = (n, i, e) => i in n ? d(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
+ var u = (n, i, e) => _(n, typeof i != "symbol" ? i + "" : i, e);
4
4
  import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
5
5
  import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
6
- import { Block as S, BlockCompositionType as h, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ import { Block as h, BlockCompositionType as S, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
7
  import { getDefaultTemplate as L } from "./template.js";
8
8
  import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
9
- import { parsePageList as m } from "./utils/utils.js";
10
- const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', B = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", C = {
9
+ import { parsePageList as p } from "./utils/utils.js";
10
+ const g = "unsubscribe-block", v = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{ins-unsubscribe-link}}", T = {
11
11
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
12
12
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
13
13
  };
14
- class D extends S {
14
+ class R extends h {
15
15
  constructor() {
16
16
  super();
17
17
  u(this, "selectEventListener", null);
@@ -19,13 +19,13 @@ class D extends S {
19
19
  u(this, "currentNode");
20
20
  }
21
21
  getId() {
22
- return v;
22
+ return g;
23
23
  }
24
24
  getIcon() {
25
25
  return "unsubscribe-icon";
26
26
  }
27
27
  getBlockCompositionType() {
28
- return h.BLOCK;
28
+ return S.BLOCK;
29
29
  }
30
30
  getName() {
31
31
  return this.api.translate("Unsubscribe Block");
@@ -36,11 +36,8 @@ class D extends S {
36
36
  getTemplate() {
37
37
  return L();
38
38
  }
39
- onCreated(e) {
40
- "getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
41
- }
42
39
  onSelect(e) {
43
- this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
40
+ this.currentNode = e, !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
44
41
  }
45
42
  onDelete(e) {
46
43
  this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
@@ -50,8 +47,8 @@ class D extends S {
50
47
  }
51
48
  _setupSelectEventListener() {
52
49
  this._removeSelectEventListener(), this.selectEventListener = (e) => {
53
- const r = e, { collectionType: t, selectedPages: s } = r.detail;
54
- this._updateBlock(t, s.join(","));
50
+ const s = e, { collectionType: t, selectedPages: r } = s.detail;
51
+ this._updateBlock(t, r.join(","));
55
52
  }, document.addEventListener(a.SELECT, this.selectEventListener);
56
53
  }
57
54
  _removeSelectEventListener() {
@@ -66,38 +63,45 @@ class D extends S {
66
63
  this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
67
64
  }
68
65
  _handleCancel() {
69
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
66
+ try {
67
+ if (!this.currentNode)
68
+ return;
69
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
70
+ } catch (e) {
71
+ console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
72
+ }
70
73
  }
71
74
  _removeEventListeners() {
72
75
  this._removeSelectEventListener(), this._removeCancelEventListener();
73
76
  }
74
- _updateBlock(e, r) {
77
+ _updateBlock(e, s) {
75
78
  if (!this.currentNode || !("querySelector" in this.currentNode))
76
79
  return;
77
- const t = this.currentNode.querySelector(g);
80
+ const t = this.currentNode.querySelector(v);
78
81
  if (!t)
79
82
  return;
80
- const s = this._getMergeTag(e);
81
- this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
83
+ const r = this._getMergeTag(e);
84
+ this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new b(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, s).apply(new b("Updated unsubscribe block metadata"));
82
85
  }
83
86
  _getMergeTag(e) {
84
- return C[e] ?? f;
87
+ return T[e] ?? B;
85
88
  }
86
89
  _openDrawer() {
87
- try {
88
- const e = c();
89
- e.typeSelectionDrawerStatus = !0;
90
- } catch (e) {
91
- console.error("[UnsubscribeBlock] Failed to open drawer:", e);
92
- }
90
+ if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
91
+ try {
92
+ const e = c();
93
+ e.typeSelectionDrawerStatus = !0;
94
+ } catch (e) {
95
+ console.error("[UnsubscribeBlock] Failed to open drawer:", e);
96
+ }
93
97
  }
94
98
  _checkExistingBlocks() {
95
99
  const e = c();
96
- e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((t) => {
100
+ e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(f).forEach((t) => {
97
101
  if ("getAttribute" in t) {
98
- const s = t.getAttribute(o.PAGE_TYPE);
99
- if (s) {
100
- const l = Number(s);
102
+ const r = t.getAttribute(o.PAGE_TYPE);
103
+ if (r) {
104
+ const l = Number(r);
101
105
  l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
102
106
  }
103
107
  }
@@ -106,11 +110,11 @@ class D extends S {
106
110
  _loadBlockState(e) {
107
111
  if (!("getAttribute" in e))
108
112
  return;
109
- const r = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
110
- if (!r || !t)
113
+ const s = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
114
+ if (!s || !t)
111
115
  return;
112
- const s = c(), l = Number(r), p = m(t);
113
- s.setCollectionWithoutAutoSelection(l), s.loadSelectedTemplates(p);
116
+ const r = c(), l = Number(s), m = p(t);
117
+ r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(m);
114
118
  }
115
119
  _resetStoreState() {
116
120
  c().$reset();
@@ -118,14 +122,14 @@ class D extends S {
118
122
  _removeBlockTemplatesFromStore(e) {
119
123
  if (!("getAttribute" in e))
120
124
  return;
121
- const r = e.getAttribute(o.PAGE_LIST);
122
- if (!r)
125
+ const s = e.getAttribute(o.PAGE_LIST);
126
+ if (!s)
123
127
  return;
124
- const t = c(), s = m(r);
125
- t.removeUnsubscribePages(s);
128
+ const t = c(), r = p(s);
129
+ t.removeUnsubscribePages(r);
126
130
  }
127
131
  }
128
132
  export {
129
- v as UNSUBSCRIBE_BLOCK_ID,
130
- D as UnsubscribeBlock
133
+ g as UNSUBSCRIBE_BLOCK_ID,
134
+ R as UnsubscribeBlock
131
135
  };
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-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
+ .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,4 +1,4 @@
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";
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";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -1,5 +1,19 @@
1
1
  import { Block, BlockCompositionType, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
2
  export declare const BLOCK_ID = "items-block";
3
+ /**
4
+ * Items Block extension for Stripo email editor.
5
+ *
6
+ * Displays personalized product items (cart items, browsed items, or purchased items)
7
+ * in a configurable card layout with horizontal or vertical orientation.
8
+ *
9
+ * Features:
10
+ * - Multiple product data sources (cart, browsed, purchased)
11
+ * - Configurable card composition (image, name, price, quantity, button)
12
+ * - Orientation control (horizontal/vertical)
13
+ * - Price formatting and currency display options
14
+ * - Product name trimming
15
+ * - Onboarding support
16
+ */
3
17
  export declare class ItemsBlock extends Block {
4
18
  getId(): string;
5
19
  getIcon(): string;
@@ -0,0 +1,15 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { CommonControl } from '../../../common-control';
3
+ import { ItemsBlockControlId } from '../../enums/controlEnums';
4
+ export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_ORIENTATION;
5
+ export declare class PriceOrientationControl extends CommonControl {
6
+ private store;
7
+ getId(): string;
8
+ getTemplate(): string;
9
+ onRender(): void;
10
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _onPriceOrientationChange(value: string): void;
12
+ private _updateHorizontalLayout;
13
+ private _updateVerticalLayout;
14
+ _getPriceOrientation(): string;
15
+ }
@@ -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, oldValue: string): void;
16
+ _onItemsTypeChange(value: string): void;
17
17
  _onItemIdsChange(value: string): void;
18
18
  _initializeSelectItems(): void;
19
19
  _listenToFormUpdates(): void;
@@ -31,7 +31,10 @@ 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
+ * @todo Optimize template reordering for performance.
36
+ * @description Reorders the template structure based on current orientation and visibility settings.
37
+ */
35
38
  _reOrderTemplate(): void;
36
39
  _updateDataTypeAttributes(itemsType: ProductType): void;
37
40
  _updateDataNumberAttributes(itemId: string): void;
@@ -44,6 +44,7 @@ export declare enum ItemsBlockControlId {
44
44
  PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control",
45
45
  PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control",
46
46
  PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control",
47
+ PRICE_ORIENTATION = "items-block-price-orientation-control",
47
48
  NAME_ALIGN = "items-block-name-align-control",
48
49
  NAME_COLOR = "items-block-name-color-control",
49
50
  NAME_SIZE = "items-block-name-size-control",
@@ -1,3 +1,4 @@
1
+ export declare const templateFirstLine = "<td align=\"center\" class=\"ins-product-td items-block items-block-v2\">";
1
2
  export declare const configAttributes: {
2
3
  TYPE: string;
3
4
  ITEMS_INDEX_SELECT_CONTROL_VALUE: string;
@@ -7,6 +8,7 @@ export declare const configAttributes: {
7
8
  PRODUCT_PRICE_FORMATTED: string;
8
9
  PRODUCT_PRICE_CURRENCY_SYMBOL: string;
9
10
  PRODUCT_PRICE_CURRENCY_LOCATION: string;
11
+ PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: string;
10
12
  PRODUCT_BUTTON_LINK: string;
11
13
  PRODUCT_IMAGE_LINK: string;
12
14
  PRODUCT_NAME_CONTROL_VALUE: string;
@@ -40,6 +40,7 @@ export declare const DefaultConfigValues: {
40
40
  productPriceVisible: string;
41
41
  productOriginalPriceVisible: string;
42
42
  productButtonVisible: string;
43
+ productImageWidth: string;
43
44
  };
44
45
  export declare const ItemInCartOptions: {
45
46
  [x: string]: {
@@ -10,6 +10,7 @@ interface ItemsBlockState {
10
10
  currencySymbol: string;
11
11
  currencyLocation: string;
12
12
  formattedPrice: boolean;
13
+ priceOrientation: 'vertical' | 'horizontal';
13
14
  templateData: {
14
15
  imageSrc: string;
15
16
  name: string;
@@ -30,6 +31,7 @@ export declare const useItemsBlockStore: import("pinia").StoreDefinition<"guidoI
30
31
  setCurrencySymbol(currencySymbol: string): void;
31
32
  setCurrencyLocation(currencyLocation: string): void;
32
33
  setFormattedPrice(formattedPrice: boolean): void;
34
+ setPriceOrientation(priceOrientation: "vertical" | "horizontal"): void;
33
35
  setTemplateData(templateData: ItemsBlockState["templateData"]): void;
34
36
  updateFromAttributes(attributes: {
35
37
  itemsType?: string;
@@ -10,7 +10,15 @@ type TemplateParameters = {
10
10
  formattedPrice?: boolean;
11
11
  };
12
12
  /**
13
- * @returns The template for the default checkbox block
13
+ * Generates the default template for the Items Block.
14
+ * @param params - Template parameters including orientation, items type, item ID, and formatting options
15
+ * @param params.orientation - Layout orientation ('vertical' or 'horizontal')
16
+ * @param params.itemsType - Product data source type ('CART_ITEMS', 'BROWSED_ITEMS', or 'PURCHASED_ITEMS')
17
+ * @param params.itemId - The merge tag for the item (e.g., '{{Abandoned Cart Item (1) Url}}')
18
+ * @param params.currencySymbol - Currency symbol to display (e.g., 'USD')
19
+ * @param params.currencyLocation - Currency position ('0' for before, '1' for after)
20
+ * @param params.formattedPrice - Whether to use formatted price display
21
+ * @returns HTML template string for the Items Block
14
22
  */
15
23
  export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, formattedPrice, }: TemplateParameters): string;
16
24
  export default migrationTemplate;
@@ -42,3 +42,9 @@ export declare function syncButtonLinkFromAttributes(currentNode: ImmutableHtmlN
42
42
  * @param currentNode - The current node from the control (usually this.currentNode)
43
43
  */
44
44
  export declare function syncImageLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
45
+ /**
46
+ * Reads price orientation value from esd-config-block attribute and updates the store.
47
+ * This makes the price orientation value mutable by syncing it from the DOM.
48
+ * @param currentNode - The current node from the control (usually this.currentNode)
49
+ */
50
+ export declare function syncPriceOrientationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
@@ -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=\"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";
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";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
1
+ import type { ImmutableHtmlElementNode } from '@stripoinc/ui-editor-extensions';
2
2
  import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
3
3
  export declare const UNSUBSCRIBE_BLOCK_ID = "unsubscribe-block";
4
4
  export declare class UnsubscribeBlock extends Block {
@@ -12,9 +12,8 @@ export declare class UnsubscribeBlock extends Block {
12
12
  getName(): string;
13
13
  getDescription(): string;
14
14
  getTemplate(): string;
15
- onCreated(node: ImmutableHtmlNode): void;
16
- onSelect(node: ImmutableHtmlNode): undefined;
17
- onDelete(node: ImmutableHtmlNode): undefined;
15
+ onSelect(node: ImmutableHtmlElementNode): void;
16
+ onDelete(node: ImmutableHtmlElementNode): void;
18
17
  onDestroy(): void;
19
18
  private _setupSelectEventListener;
20
19
  private _removeSelectEventListener;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.cd0d7f3",
3
+ "version": "1.0.3-beta.cdff8ce",
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",
@@ -27,14 +27,7 @@
27
27
  "test:visual-update": "npx playwright test --update-snapshots --reporter html",
28
28
  "prepare": "husky"
29
29
  },
30
- "keywords": [
31
- "vue",
32
- "typescript",
33
- "email",
34
- "editor",
35
- "stripo",
36
- "useinsider"
37
- ],
30
+ "keywords": [],
38
31
  "author": "",
39
32
  "license": "ISC",
40
33
  "dependencies": {
@@ -48,10 +41,12 @@
48
41
  "vue": "2.7.14"
49
42
  },
50
43
  "devDependencies": {
44
+ "@commitlint/cli": "20.2.0",
45
+ "@commitlint/config-conventional": "20.2.0",
51
46
  "@cspell/eslint-plugin": "8.17.5",
52
47
  "@eslint/eslintrc": "3.3.0",
53
48
  "@eslint/js": "8.57.1",
54
- "@playwright/test": "1.55.0",
49
+ "@playwright/test": "1.57.0",
55
50
  "@stylistic/eslint-plugin": "3.1.0",
56
51
  "@stylistic/eslint-plugin-migrate": "3.1.0",
57
52
  "@types/eslint": "8.56.12",