@useinsider/guido 3.7.0-beta.509616e → 3.7.0-beta.7069d11

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.
@@ -2,15 +2,15 @@ import n from "./UnsubscribeTypeSelection.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var i = function() {
5
- var e = this, s = e._self._c, t = e._self._setupProxy;
6
- return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
5
+ var t = this, s = t._self._c, e = t._self._setupProxy;
6
+ return s(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.typeSelectionDrawerStatus, "title-text": e.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.selectCollection } }, [s(e.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: e.isSelecting, "segment-list": e.segmentList, selected: e.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": e.skeletonStatus }, on: { click: e.changeCollection } })], 1);
7
7
  }, r = [], c = /* @__PURE__ */ o(
8
8
  n,
9
9
  i,
10
10
  r,
11
11
  !1,
12
12
  null,
13
- "43c617a7"
13
+ "18e1220a"
14
14
  );
15
15
  const _ = c.exports;
16
16
  export {
@@ -1,108 +1,110 @@
1
- import { defineComponent as h, ref as b, computed as g, watch as _ } from "vue";
2
- import v from "../../wrappers/WpDrawer.vue.js";
3
- import { useToaster as U } from "../../../composables/useToaster.js";
4
- import { useTranslations as N } from "../../../composables/useTranslations.js";
5
- import { ACADEMY_LINKS as w } from "../../../enums/academy.js";
6
- import { ToasterTypeOptions as R } from "../../../enums/toaster.js";
7
- import { PAGE_TYPES as l, getTypeTranslations as D, UNSUBSCRIBE_PAGES_LINK as I } from "../../../enums/unsubscribe.js";
8
- import { useUnsubscribeStore as P } from "../../../stores/unsubscribe.js";
9
- import { InSegments as G } from "@useinsider/design-system-vue";
10
- const V = /* @__PURE__ */ h({
1
+ import { defineComponent as v, ref as b, computed as f, watch as _ } from "vue";
2
+ import U from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as N } from "../../../composables/useToaster.js";
4
+ import { useTranslations as w } from "../../../composables/useTranslations.js";
5
+ import { ACADEMY_LINKS as D } from "../../../enums/academy.js";
6
+ import { ToasterTypeOptions as P } from "../../../enums/toaster.js";
7
+ import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as G } from "../../../enums/unsubscribe.js";
8
+ import { useUnsubscribeStore as I } from "../../../stores/unsubscribe.js";
9
+ import { InSegments as L } from "@useinsider/design-system-vue";
10
+ const W = /* @__PURE__ */ v({
11
11
  __name: "UnsubscribeTypeSelection",
12
- setup(L) {
13
- const e = N(), { showToaster: f } = U(), t = P(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
12
+ setup(O) {
13
+ const t = w(), { showToaster: d } = N(), e = I(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), T = t(
14
14
  "unsubscription-preference.select-unsubscribe-page-description",
15
- { action: `<a href="${w.GLOBAL_UNSUBSCRIBE}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
16
- ), T = g(() => [
15
+ { action: `<a href="${D.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
16
+ ), y = f(() => [
17
17
  {
18
- description: e("unsubscription-preference.type-global-unsubscribe-description"),
18
+ description: t("unsubscription-preference.type-global-unsubscribe-description"),
19
19
  icon: "line-contact-global-unsub-page",
20
- text: e("unsubscription-preference.type-global-unsubscribe"),
20
+ text: t("unsubscription-preference.type-global-unsubscribe"),
21
21
  value: l.GLOBAL_UNSUBSCRIBE,
22
- disable: t.isGlobalUnsubscribeDisabled,
22
+ disable: e.isGlobalUnsubscribeDisabled,
23
23
  position: "bottom",
24
- tooltipText: t.isGlobalUnsubscribeDisabled ? e("unsubscription-preference.global-unsub-added") : ""
24
+ tooltipText: e.isGlobalUnsubscribeDisabled ? t("unsubscription-preference.global-unsub-added") : ""
25
25
  },
26
26
  {
27
- description: e("unsubscription-preference.type-subscription-preferences-center-description"),
27
+ description: t("unsubscription-preference.type-subscription-preferences-center-description"),
28
28
  icon: "line-contact-sub-pref-center-page",
29
- text: e("unsubscription-preference.type-subscription-preferences-center"),
29
+ text: t("unsubscription-preference.type-subscription-preferences-center"),
30
30
  value: l.SUBSCRIPTION_PREFERENCE_CENTER,
31
- disable: t.isSubscriptionPreferencesCenterDisabled,
32
- tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
31
+ disable: e.isSubscriptionPreferencesCenterDisabled,
32
+ tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
33
33
  }
34
- ]), y = g(() => ({
34
+ ]), S = f(
35
+ () => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
36
+ ), C = f(() => ({
35
37
  primaryButton: {
36
38
  styling: "solid",
37
39
  type: "primary",
38
- labelText: e(
40
+ labelText: t(
39
41
  n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
40
42
  ),
41
43
  loadingStatus: n.value,
42
- disabledStatus: !1,
44
+ disabledStatus: S.value,
43
45
  skeletonStatus: i.value,
44
46
  skeletonSizing: { width: 168, height: 40 }
45
47
  },
46
48
  cancelOrBackButton: {
47
49
  styling: "ghost",
48
50
  type: "secondary",
49
- labelText: e("products.cancel"),
51
+ labelText: t("products.cancel"),
50
52
  disabledStatus: n.value,
51
53
  skeletonStatus: i.value,
52
54
  skeletonSizing: { width: 78, height: 40 }
53
55
  }
54
- })), d = (s) => {
55
- t.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
56
+ })), m = (s) => {
57
+ e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
56
58
  s();
57
59
  }, 500);
58
60
  }, E = (s) => {
59
61
  o.value = s;
60
- }, m = () => {
61
- const s = t.hasTemplatesByCollectionType, r = [];
62
+ }, g = () => {
63
+ const s = e.hasTemplatesByCollectionType, r = [];
62
64
  if (Object.entries(s).forEach(([c, p]) => {
63
65
  p || r.push(Number(c));
64
66
  }), r.length === 0)
65
67
  return !0;
66
- const B = D(), a = r.map((c) => B[c]);
68
+ const B = R(), a = r.map((c) => B[c]);
67
69
  let u = "";
68
70
  if (r.length === 1)
69
- u = e("unsubscription-preference.create-page-to-continue", {
71
+ u = t("unsubscription-preference.create-page-to-continue", {
70
72
  page: a[0]
71
73
  });
72
74
  else if (r.length === 2)
73
- u = e("unsubscription-preference.create-pages-to-continue", {
75
+ u = t("unsubscription-preference.create-pages-to-continue", {
74
76
  page1: a[0],
75
77
  page2: a[1]
76
78
  });
77
79
  else {
78
80
  const c = a.pop() ?? "", p = a.join(", ");
79
- u = e("unsubscription-preference.create-multiple-pages-to-continue", {
81
+ u = t("unsubscription-preference.create-multiple-pages-to-continue", {
80
82
  pages: p,
81
83
  lastPage: c
82
84
  });
83
85
  }
84
- return f({
85
- type: R.Warning,
86
+ return d({
87
+ type: P.Warning,
86
88
  message: u,
87
89
  actionButton: {
88
90
  text: "Go to Unsubscribe Pages",
89
91
  onClick: () => {
90
- window.location.href = I;
92
+ window.location.href = G;
91
93
  }
92
94
  }
93
95
  }), !1;
94
- }, C = async () => {
95
- if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !m()) {
96
- n.value = !1, d();
96
+ }, h = async () => {
97
+ if (n.value = !0, await e.fetchTemplates(), e.setCollection(o.value), !g()) {
98
+ n.value = !1, m();
97
99
  return;
98
100
  }
99
- n.value = !1, t.typeSelectionDrawerStatus = !1, t.pageSelectionDrawerStatus = !0;
101
+ n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
100
102
  };
101
- return _(() => t.typeSelectionDrawerStatus, (s) => {
102
- s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
103
- }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: m, selectCollection: C, WpDrawer: v, InSegments: G };
103
+ return _(() => e.typeSelectionDrawerStatus, (s) => {
104
+ s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (o.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
105
+ }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: T, segmentList: y, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: m, changeCollection: E, validateTemplates: g, selectCollection: h, WpDrawer: U, InSegments: L };
104
106
  }
105
107
  });
106
108
  export {
107
- V as default
109
+ W as default
108
110
  };
@@ -1,4 +1,4 @@
1
- var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
1
+ var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r))(c || {});
2
2
  export {
3
3
  c as ToasterTypeOptions
4
4
  };
@@ -1,18 +1,17 @@
1
1
  var k = Object.defineProperty;
2
- var B = (a, r, t) => r in a ? k(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
3
- var d = (a, r, t) => B(a, typeof r != "symbol" ? r + "" : r, t);
4
- import { BlockId as R } from "../../../enums/block.js";
5
- import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
6
- import { Block as D, BlockCompositionType as C, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ var y = (a, r, t) => r in a ? k(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
3
+ var d = (a, r, t) => y(a, typeof r != "symbol" ? r + "" : r, t);
4
+ import { BlockId as B } from "../../../enums/block.js";
5
+ import { getMigrationBannerHtml as D } from "../../../utils/migrationBannerHtml.js";
6
+ import { Block as R, BlockCompositionType as C, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
7
  import { regenerateMobileProductRows as b } from "./controls/main/utils.js";
8
8
  import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as A } from "./controls/mobileLayout/cssRules.js";
9
9
  import { RecommendationConfigService as c } from "./services/configService.js";
10
10
  import { useRecommendationExtensionStore as g } from "./store/recommendation.js";
11
11
  import { getDefaultTemplate as E } from "./templates/grid/template.js";
12
- import { useRecommendationBlockWarning as M } from "./useRecommendationBlockWarning.js";
13
- const I = R.Recommendation, m = "recommendation-block-v2", u = "recommendation-id";
14
- let _ = !1;
15
- class H extends D {
12
+ const _ = B.Recommendation, m = "recommendation-block-v2", u = "recommendation-id";
13
+ let I = !1;
14
+ class q extends R {
16
15
  constructor() {
17
16
  super();
18
17
  /**
@@ -22,7 +21,7 @@ class H extends D {
22
21
  d(this, "_pendingBlockId", null);
23
22
  }
24
23
  getId() {
25
- return I;
24
+ return _;
26
25
  }
27
26
  getIcon() {
28
27
  return "recommendation-icon";
@@ -39,8 +38,8 @@ class H extends D {
39
38
  );
40
39
  }
41
40
  getSettingsPanelTitleHtml() {
42
- return y(
43
- I,
41
+ return D(
42
+ _,
44
43
  this.api.translate("Recommendation Block"),
45
44
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
46
45
  );
@@ -96,7 +95,7 @@ class H extends D {
96
95
  documentModifier: this.api.getDocumentModifier()
97
96
  }));
98
97
  }
99
- s.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 }), this._warnIfMultipleBlocks();
98
+ s.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 });
100
99
  }
101
100
  /**
102
101
  * Called when the document changes or template is loaded
@@ -118,7 +117,7 @@ class H extends D {
118
117
  }
119
118
  this._healLingeringDuplicate(t), c.needsMigration(t) && this._migrateFromLegacy(t);
120
119
  try {
121
- _ || (p(this.api), _ = !0);
120
+ I || (p(this.api), I = !0);
122
121
  const e = c.getConfig(t), i = this._getBlockElement(t);
123
122
  if (i) {
124
123
  const n = !e.mobileLayoutEnabled;
@@ -138,24 +137,6 @@ class H extends D {
138
137
  const e = this._getRecommendationId(t);
139
138
  e && g().removeBlockState(e);
140
139
  }
141
- /**
142
- * Warns (dark advisory toaster) when the design holds more than one live
143
- * recommendation block. Triggered from the user-add paths only (fresh drop
144
- * and duplicate) — never from document-load/migration, so opening a template
145
- * that already has multiple blocks does not fire it. `onCreated` also runs
146
- * for a reco block that arrives inside a saved structure (SD-143028), so this
147
- * covers that case too — no separate `module_dropped` handling is needed.
148
- *
149
- * Counting lives in `useRecommendationBlockWarning`, whose DOM-based logic
150
- * ignores the empty shells deletions leave behind (SD-143028). Wrapped in
151
- * try/catch because the document root may be unavailable during initial load.
152
- */
153
- _warnIfMultipleBlocks() {
154
- try {
155
- M().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
156
- } catch {
157
- }
158
- }
159
140
  /**
160
141
  * Generates the next unique recommendation ID by scanning all existing blocks
161
142
  * in the document and finding the maximum existing ID + 1.
@@ -228,7 +209,7 @@ class H extends D {
228
209
  /** Assigns a fresh id to a duplicated block and syncs DOM, node config and store. */
229
210
  _handleDuplicate(t, e) {
230
211
  const i = this._reassignDuplicateId(t, e), n = g();
231
- n.cloneBlockState(e, i), n.setCurrentBlock(i), this._warnIfMultipleBlocks();
212
+ n.cloneBlockState(e, i), n.setCurrentBlock(i);
232
213
  }
233
214
  /**
234
215
  * Core id-reassignment for a duplicated block: rewrites the DOM
@@ -310,6 +291,6 @@ class H extends D {
310
291
  }
311
292
  }
312
293
  export {
313
- I as BLOCK_ID,
314
- H as RecommendationBlock
294
+ _ as BLOCK_ID,
295
+ q as RecommendationBlock
315
296
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-18e1220a] .guido__verion-history-view-option-selection-desktop svg,[data-v-18e1220a] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-18e1220a] .in-segments-wrapper__button_selected,[data-v-18e1220a] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
@@ -1,6 +1,5 @@
1
1
  export declare enum ToasterTypeOptions {
2
2
  Success = "success",
3
3
  Warning = "warning",
4
- Alert = "alert",
5
- Dark = "dark"
4
+ Alert = "alert"
6
5
  }
@@ -55,19 +55,6 @@ export declare class RecommendationBlock extends Block {
55
55
  * @param node - The block node being deleted
56
56
  */
57
57
  onDelete(node: ImmutableHtmlNode): void;
58
- /**
59
- * Warns (dark advisory toaster) when the design holds more than one live
60
- * recommendation block. Triggered from the user-add paths only (fresh drop
61
- * and duplicate) — never from document-load/migration, so opening a template
62
- * that already has multiple blocks does not fire it. `onCreated` also runs
63
- * for a reco block that arrives inside a saved structure (SD-143028), so this
64
- * covers that case too — no separate `module_dropped` handling is needed.
65
- *
66
- * Counting lives in `useRecommendationBlockWarning`, whose DOM-based logic
67
- * ignores the empty shells deletions leave behind (SD-143028). Wrapped in
68
- * try/catch because the document root may be unavailable during initial load.
69
- */
70
- private _warnIfMultipleBlocks;
71
58
  /**
72
59
  * Generates the next unique recommendation ID by scanning all existing blocks
73
60
  * in the document and finding the maximum existing ID + 1.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.7.0-beta.509616e",
3
+ "version": "3.7.0-beta.7069d11",
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",
@@ -1,16 +0,0 @@
1
- import { useToaster as r } from "../../../composables/useToaster.js";
2
- import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { ToasterTypeOptions as n } from "../../../enums/toaster.js";
4
- import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
5
- const a = "newsletter.multiple-reco-blocks-warning", f = () => {
6
- const { showToaster: o } = r(), t = s();
7
- return { warnIfMultipleBlocks: (e) => {
8
- i(e) > 1 && o({
9
- type: n.Dark,
10
- message: t(a)
11
- });
12
- } };
13
- };
14
- export {
15
- f as useRecommendationBlockWarning
16
- };
@@ -1,9 +0,0 @@
1
- const r = ".recommendation-block-v2", t = ".recommendation-product-row";
2
- function n(o) {
3
- return Array.from(o.querySelectorAll(r)).filter((e) => e.querySelector(t)).length;
4
- }
5
- export {
6
- r as RECOMMENDATION_BLOCK_SELECTOR,
7
- t as RECOMMENDATION_PRODUCT_ROW_SELECTOR,
8
- n as countLiveRecommendationBlocks
9
- };
@@ -1,12 +0,0 @@
1
- import type { QueryableRoot } from './utils/recommendationBlockCount';
2
- /**
3
- * Advisory shown when a design ends up with more than one recommendation block,
4
- * since multiple blocks can slow campaign delivery. Driven from the block
5
- * lifecycle (`onCreated` for direct drop / duplicate, counting the editor's
6
- * document root). `onCreated` also fires for a reco block that arrives inside a
7
- * saved structure (SD-143028), so that case is covered without a separate
8
- * `module_dropped` re-check.
9
- */
10
- export declare const useRecommendationBlockWarning: () => {
11
- warnIfMultipleBlocks: (root: QueryableRoot) => void;
12
- };
@@ -1,28 +0,0 @@
1
- /**
2
- * Counts *live* recommendation blocks in a document.
3
- *
4
- * Deleting a recommendation block strips its inner content but leaves an empty
5
- * `.recommendation-block-v2` container shell behind — present in every document
6
- * representation the editor exposes (`getDocumentRoot`, `getDocumentRootHtmlNode`
7
- * and even `getTemplateData`). A raw class count therefore over-reports after a
8
- * delete→add cycle (SD-143028). The product row (`.recommendation-product-row`)
9
- * is present on every live block from drop time (the default template ships
10
- * product rows, both grid and list layouts) and is removed from a deleted
11
- * block's leftover shell, so filtering by it cleanly separates live blocks from
12
- * ghosts without reading any store.
13
- */
14
- export declare const RECOMMENDATION_BLOCK_SELECTOR = ".recommendation-block-v2";
15
- export declare const RECOMMENDATION_PRODUCT_ROW_SELECTOR = ".recommendation-product-row";
16
- interface QueryableNode {
17
- querySelector(selector: string): unknown;
18
- }
19
- export interface QueryableRoot {
20
- querySelectorAll(selector: string): Iterable<QueryableNode>;
21
- }
22
- /**
23
- * Counts the live recommendation blocks reachable from `root`. Works on the
24
- * editor's `ImmutableHtmlNode` document root (the `onCreated` drop / duplicate
25
- * paths) and on any DOM-like root exposing `querySelectorAll`.
26
- */
27
- export declare function countLiveRecommendationBlocks(root: QueryableRoot): number;
28
- export {};