@useinsider/guido 3.6.0-beta.590990f → 3.6.0-beta.6fd3d23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,22 @@
1
- import { getRecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
2
- import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
3
- import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
1
+ import { getRecommendationFeedSourceMaps as I, URLS as R } from "../enums/extensions/recommendationBlock.js";
2
+ import { MinDeviceViewport as C, DefaultPadding as b } from "../enums/recommendation.js";
3
+ import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
4
  import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
5
6
  import { useConfigStore as x } from "../stores/config.js";
6
- const w = () => ({
7
+ const k = () => ({
7
8
  calculateCardWidth: ({
8
- mobileLeftPadding: o,
9
+ mobileLeftPadding: a,
9
10
  mobileRightPadding: s,
10
- cardsInRow: a,
11
- unresponsive: n
11
+ cardsInRow: c,
12
+ unresponsive: o
12
13
  }) => {
13
- const r = n ? a : 1, e = o + s + (r - 1) * b;
14
- return (R - e) / r;
14
+ const r = o ? c : 1, e = a + s + (r - 1) * b;
15
+ return (C - e) / r;
15
16
  },
16
- getRecommendationCampaignData: (o) => {
17
- const s = m(), a = Number(o), n = s.blockStates[a];
18
- if (!n)
17
+ getRecommendationCampaignData: (a) => {
18
+ const s = l(), c = Number(a), o = s.blockStates[c];
19
+ if (!o)
19
20
  return {
20
21
  textTrimming: !1,
21
22
  orientation: "vertical",
@@ -28,7 +29,7 @@ const w = () => ({
28
29
  discountBeforeTextValue: "",
29
30
  discountAfterTextValue: ""
30
31
  };
31
- const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
32
+ const { recommendationConfigs: r } = o, e = r.orientation === "grid" ? "vertical" : "horizontal";
32
33
  return {
33
34
  textTrimming: r.textTrimming,
34
35
  orientation: e,
@@ -42,35 +43,35 @@ const w = () => ({
42
43
  discountAfterTextValue: ""
43
44
  };
44
45
  },
45
- buildCampaignUrl: (o, s) => {
46
- var l;
47
- const a = m(), n = x(), r = Number(o);
46
+ buildCampaignUrl: (a, s) => {
47
+ var m;
48
+ const c = l(), o = x(), r = Number(a);
48
49
  let e;
49
50
  if (s)
50
51
  e = s;
51
52
  else {
52
- const c = a.blockStates[r];
53
- if (!c)
53
+ const i = c.blockStates[r];
54
+ if (!i)
54
55
  return "";
55
- const { recommendationConfigs: i } = c;
56
+ const { recommendationConfigs: n } = i;
56
57
  e = {
57
- strategy: i.strategy,
58
- language: i.language,
59
- currencyCode: i.currencySettings.value,
60
- size: i.size,
61
- productIds: i.productIds,
62
- filters: i.filters,
63
- shuffleProducts: i.shuffleProducts
58
+ strategy: n.strategy,
59
+ language: n.language,
60
+ currencyCode: n.currencySettings.value,
61
+ size: n.size,
62
+ productIds: n.productIds,
63
+ filters: n.filters,
64
+ shuffleProducts: n.shuffleProducts
64
65
  };
65
66
  }
66
- const f = ((l = I().find((c) => c.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
67
- t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
68
- const g = e.filters.filter((c) => c.isValid), d = h(g);
69
- d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
70
- const p = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
71
- return a.recommendationCampaignUrls[o] = u, u;
67
+ const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
68
+ t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
69
+ const g = e.filters.filter((i) => i.isValid), d = h(g);
70
+ d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(o.partnerName, e.strategy)).forEach(([i, n]) => t.set(i, n));
71
+ const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
72
+ return c.recommendationCampaignUrls[a] = u, u;
72
73
  }
73
74
  });
74
75
  export {
75
- w as useRecommendation
76
+ k as useRecommendation
76
77
  };
@@ -1,32 +1,31 @@
1
1
  import { useActionsApi as x } from "./useActionsApi.js";
2
2
  import { useConfig as y } from "./useConfig.js";
3
- import { useSaveStart as w, useSaveComplete as H } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
5
- import { useStripoApi as C } from "../services/stripoApi.js";
6
- import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
7
- import { useHtmlValidator as k } from "./useHtmlValidator.js";
3
+ import { useSaveStart as w, useSaveComplete as C } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as E } from "./useSyncModuleExtractor.js";
5
+ import { useStripoApi as H } from "../services/stripoApi.js";
6
+ import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
7
+ import { useHtmlValidator as q } from "./useHtmlValidator.js";
8
8
  import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
9
9
  import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
10
- import { useUnsubscribeBlockValidator as B } from "./validators/useUnsubscribeBlockValidator.js";
11
- const J = () => {
12
- const o = w(), s = H(), { validateHtml: r } = k(), { validateLiquidSyntax: n } = P(), { validateCouponBlockTags: l } = L(), { validateUnsubscribeBlockUniqueness: d } = B(), { callbacks: i, isFeatureEnabled: u } = y(), { extractSyncModuleData: c } = q(), { setSyncModuleUnsubscriptionPages: m } = C(), { editorSave: p } = x();
13
- return { save: async (f = !1, v = !1) => {
14
- var a;
10
+ const z = () => {
11
+ const o = w(), s = C(), { validateHtml: r } = q(), { validateLiquidSyntax: n } = P(), { validateCouponBlockTags: l } = L(), { callbacks: a, isFeatureEnabled: d } = y(), { extractSyncModuleData: u } = E(), { setSyncModuleUnsubscriptionPages: c } = H(), { editorSave: m } = x();
12
+ return { save: async (p = !1, f = !1) => {
13
+ var i;
15
14
  o();
16
- const { prepareTemplateDetails: S } = E(), t = await S();
17
- if (!l(t.compiledHtml) || !d(t.compiledHtml))
15
+ const { prepareTemplateDetails: v } = b(), t = await v();
16
+ if (!l(t.compiledHtml))
18
17
  return;
19
- if (u("liquidSyntax")) {
18
+ if (d("liquidSyntax")) {
20
19
  if (!await n(t.compiledHtml))
21
20
  return;
22
21
  } else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
23
22
  return;
24
- if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await p())
23
+ if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t) || !await m())
25
24
  return;
26
- const { unsubscribePayload: V, stripoModules: b } = c(t.rawHtml);
27
- return await m(V), t.modules = b, f || s({ ...t, silent: v }), t;
25
+ const { unsubscribePayload: S, stripoModules: V } = u(t.rawHtml);
26
+ return await c(S), t.modules = V, p || s({ ...t, silent: f }), t;
28
27
  } };
29
28
  };
30
29
  export {
31
- J as useSave
30
+ z as useSave
32
31
  };
@@ -1,6 +1,6 @@
1
- var O = Object.defineProperty;
2
- var p = (o, e, t) => e in o ? O(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var r = (o, e, t) => p(o, typeof e != "symbol" ? e + "" : e, t);
1
+ var p = Object.defineProperty;
2
+ var A = (o, e, t) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var r = (o, e, t) => A(o, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { ModificationDescription as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as N } from "../../../common-control.js";
6
6
  import { ATTR_DATA_CUSTOM_ATTRIBUTES as L } from "../../constants/selectors.js";
@@ -9,9 +9,9 @@ import { DEFAULT_COMPOSITION as _ } from "../../constants/defaultConfig.js";
9
9
  import { RecommendationConfigService as s } from "../../services/configService.js";
10
10
  import { useRecommendationExtensionStore as f } from "../../store/recommendation.js";
11
11
  import { getCurrentLayout as C, getBlockElement as I, regenerateProductRowsWithStyles as S } from "./utils.js";
12
- const U = "recommendation-layout-orientation-control", A = "recommendationInfoBannerTest", a = {
12
+ const U = "recommendation-layout-orientation-control", O = "recommendationInfoBannerTest", a = {
13
13
  LAYOUT: "layout"
14
- }, y = "data-card-composition", i = {
14
+ }, y = "data-card-composition", n = {
15
15
  LAYOUT: "data-layout",
16
16
  COLUMN_SPACING: "data-column-spacing",
17
17
  ROW_SPACING: "data-row-spacing",
@@ -30,7 +30,7 @@ class Y extends N {
30
30
  getTemplate() {
31
31
  return `
32
32
  <div class="layout-control-container">
33
- ${this._GuOnPageMessage({ name: A })}
33
+ ${this._GuOnPageMessage({ name: O })}
34
34
 
35
35
  ${this._GuTwoColumns([
36
36
  this._GuLabel({ text: this.api.translate("Layout Orientation") }),
@@ -44,10 +44,11 @@ class Y extends N {
44
44
  }
45
45
  onRender() {
46
46
  this._setInfoMessageValue(
47
- A,
47
+ O,
48
48
  this.api.translate(
49
- `Note that updating the Layout Orientation, Number of Products and
50
- Products in One Row settings resets the style of your Recommendation block.`
49
+ `Note that updating the Layout Orientation, Number of Products,
50
+ Products in One Row and Mobile Layout Optimization settings
51
+ resets the style of your Recommendation block.`
51
52
  )
52
53
  ), this._setFormValues(), this._listenToFormUpdates();
53
54
  }
@@ -83,8 +84,8 @@ class Y extends N {
83
84
  },
84
85
  `Changed layout to ${t}`
85
86
  ), this.store.patchCurrentBlockConfig({ orientation: t });
86
- const n = this.api.getDocumentModifier().modifyHtml(c).setAttribute(i.LAYOUT, t).setAttribute(i.COLUMN_SPACING, g.toString()).setAttribute(i.ROW_SPACING, l.toString()).setAttribute(i.MOBILE_COLUMN_SPACING, d.toString()).setAttribute(i.MOBILE_ROW_SPACING, m.toString());
87
- t === "list" ? (n.setClass("es-m-p0"), n.setClass("ins-recommendation-list-layout")) : (n.removeClass("es-m-p0"), n.removeClass("ins-recommendation-list-layout")), n.setAttribute(y, _.join(",")).setAttribute(L, "[]"), n.apply(new h(`Update layout to ${t}`)), this._regenerateProductRows(t);
87
+ const i = this.api.getDocumentModifier().modifyHtml(c).setAttribute(n.LAYOUT, t).setAttribute(n.COLUMN_SPACING, g.toString()).setAttribute(n.ROW_SPACING, l.toString()).setAttribute(n.MOBILE_COLUMN_SPACING, d.toString()).setAttribute(n.MOBILE_ROW_SPACING, m.toString());
88
+ t === "list" ? (i.setClass("es-m-p0"), i.setClass("ins-recommendation-list-layout")) : (i.removeClass("es-m-p0"), i.removeClass("ins-recommendation-list-layout")), i.setAttribute(y, _.join(",")).setAttribute(L, "[]"), i.apply(new h(`Update layout to ${t}`)), this._regenerateProductRows(t);
88
89
  } finally {
89
90
  this.isChangingLayout = !1;
90
91
  }
@@ -6,8 +6,9 @@ import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
6
6
  import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
7
7
  import { getDefaultProducts as S } from "../templates/utils.js";
8
8
  import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
9
- import { isFilterValid as v } from "../validation/filterSchema.js";
10
- import { isConfigValid as w } from "../validation/requiredFields.js";
9
+ import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
10
+ import { isFilterValid as w } from "../validation/filterSchema.js";
11
+ import { isConfigValid as N } from "../validation/requiredFields.js";
11
12
  const h = y();
12
13
  let m = null, u = null, d = null;
13
14
  function I() {
@@ -49,7 +50,7 @@ function k() {
49
50
  filterSnapshot: null
50
51
  };
51
52
  }
52
- const N = () => ({
53
+ const x = () => ({
53
54
  recommendationCampaignUrls: {},
54
55
  activePredictiveAlgorithms: [],
55
56
  languages: {},
@@ -58,8 +59,8 @@ const N = () => ({
58
59
  blockStates: {},
59
60
  currentRecommendationId: null,
60
61
  configVersion: 0
61
- }), M = P("guidoRecommendationExtension", {
62
- state: () => N(),
62
+ }), T = P("guidoRecommendationExtension", {
63
+ state: () => x(),
63
64
  getters: {
64
65
  // ====================================================================
65
66
  // Proxy Getters — Backward Compatible Access to Current Block State
@@ -378,7 +379,7 @@ const N = () => ({
378
379
  const n = [...e.recommendationConfigs.filters];
379
380
  n[r] = {
380
381
  ...t,
381
- isValid: v(t)
382
+ isValid: w(t)
382
383
  }, e.recommendationConfigs.filters = n;
383
384
  }
384
385
  },
@@ -424,7 +425,7 @@ const N = () => ({
424
425
  * every block's recommendationConfigs across user edits.
425
426
  */
426
427
  hasInvalidBlock() {
427
- return Object.values(this.blockStates).some((t) => !w(t.recommendationConfigs, this));
428
+ return Object.values(this.blockStates).some((t) => !N(t.recommendationConfigs, this));
428
429
  },
429
430
  // ====================================================================
430
431
  // Per-Block Product Fetching
@@ -453,7 +454,10 @@ const N = () => ({
453
454
  details: !0,
454
455
  campaignId: o.variationId
455
456
  };
456
- r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0);
457
+ r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
458
+ a,
459
+ v(o.partnerName, r.strategy)
460
+ );
457
461
  let f;
458
462
  try {
459
463
  f = await h.fetchRecommendationProducts(i, a);
@@ -471,5 +475,5 @@ const N = () => ({
471
475
  }
472
476
  });
473
477
  export {
474
- M as useRecommendationExtensionStore
478
+ T as useRecommendationExtensionStore
475
479
  };
@@ -115,8 +115,10 @@ const S = {
115
115
  class="esd-block-text product-old-price es-p15l es-p15r"
116
116
  align="center"
117
117
  esd-extension-block-id="${s.OLD_PRICE}">
118
- <p contenteditable="false" style="font-size: 14px; color: #999999;">
119
- <strong>${i(t, "original_price")}</strong>
118
+ <p
119
+ contenteditable="false"
120
+ style="font-size: 14px; color: #999999;">
121
+ <s><strong>${i(t, "original_price")}</strong></s>
120
122
  </p>
121
123
  </td>
122
124
  </tr>
@@ -14,10 +14,10 @@ function b() {
14
14
  thousandSeparator: e.thousandSeparator
15
15
  };
16
16
  }
17
- function s(t, e = "price") {
18
- const n = b(), a = t[e], r = (a == null ? void 0 : a[n.code]) ?? Object.values(a ?? {})[0] ?? 0;
17
+ function r(t, e = "price") {
18
+ const n = b(), s = t[e], a = (s == null ? void 0 : s[n.code]) ?? Object.values(s ?? {})[0] ?? 0;
19
19
  return R({
20
- price: r,
20
+ price: a,
21
21
  currency: n
22
22
  });
23
23
  }
@@ -69,7 +69,7 @@ const I = {
69
69
  esd-extension-block-id="${o.PRICE}"
70
70
  align="left">
71
71
  <p contenteditable="false" style="font-size: 16px; color: #333333; font-weight: bold; margin: 0;">
72
- <strong>${s(t, "price")}</strong>
72
+ <strong>${r(t, "price")}</strong>
73
73
  </p>
74
74
  </td>
75
75
  </tr>
@@ -85,8 +85,8 @@ const I = {
85
85
  align="left">
86
86
  <p
87
87
  contenteditable="false"
88
- style="font-size: 14px; color: #999999; text-decoration: line-through; margin: 0;">
89
- <strong>${s(t, "original_price")}</strong>
88
+ style="font-size: 14px; color: #999999; margin: 0;">
89
+ <s><strong>${r(t, "original_price")}</strong></s>
90
90
  </p>
91
91
  </td>
92
92
  </tr>
@@ -104,7 +104,7 @@ const I = {
104
104
  align="left">
105
105
  <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
106
106
  <span class="omnibus-text-before">Lowest 30-day price: </span>
107
- <span class="omnibus-price-value">${s(t, "original_price")}</span>
107
+ <span class="omnibus-price-value">${r(t, "original_price")}</span>
108
108
  <span class="omnibus-text-after"></span>
109
109
  </p>
110
110
  </td>
@@ -115,7 +115,7 @@ const I = {
115
115
  */
116
116
  [g]: (t) => {
117
117
  var i, l;
118
- const e = b(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, a = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - a) / n * 100) : 0, m = r > 0 ? `-${r}%` : "0%";
118
+ const e = b(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, s = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - s) / n * 100) : 0, m = a > 0 ? `-${a}%` : "0%";
119
119
  return `
120
120
  <tr>
121
121
  <td
@@ -0,0 +1,21 @@
1
+ const i = [
2
+ "ozonebg",
3
+ "ozonehr",
4
+ "ozonero",
5
+ "ozoneinfo",
6
+ "babybg",
7
+ "ozongr",
8
+ "iboodat",
9
+ "iboodbe",
10
+ "iboodde",
11
+ "iboodfr",
12
+ "iboodnl",
13
+ "iboodpl"
14
+ ], r = ["interencheres", "interencherespreprod"], d = ["lodenfrey", "lodenfreyuat"], c = "manualMerchandising";
15
+ function s(e, n) {
16
+ const o = {};
17
+ return i.includes(e) && (o.excludePurchaseDay = "30", o.userId = "{user_id}"), r.includes(e) && (o.hp = "1"), d.includes(e) && n === c && (o.includeOutOfStockItems = "true"), o;
18
+ }
19
+ export {
20
+ s as getPartnerRecommendationParams
21
+ };
@@ -1,29 +1,29 @@
1
- function d(a, t) {
2
- const { thousandSeparator: s, decimalSeparator: e, decimalCount: r } = t, u = Math.abs(a).toFixed(r), [c, o] = u.split("."), n = c.replace(
1
+ function d(c, t) {
2
+ const { thousandSeparator: i, decimalSeparator: e, decimalCount: r } = t, [u, o = ""] = String(c).split("."), n = o.slice(0, r).padEnd(r, "0"), a = u.replace(
3
3
  /\B(?=(\d{3})+(?!\d))/g,
4
- s
5
- ), i = a < 0 ? "-" : "";
6
- return r > 0 && o ? `${i}${n}${e}${o}` : `${i}${n}`;
4
+ i
5
+ );
6
+ return r > 0 && n ? `${a}${e}${n}` : a;
7
7
  }
8
- function m(a) {
9
- const { price: t, currency: s } = a, {
8
+ function f(c) {
9
+ const { price: t, currency: i } = c, {
10
10
  symbol: e,
11
11
  alignment: r,
12
12
  thousandSeparator: u,
13
- decimalSeparator: c,
14
- decimalCount: o
15
- } = s;
13
+ decimalSeparator: o,
14
+ decimalCount: n
15
+ } = i;
16
16
  if (typeof t != "number" || Number.isNaN(t)) {
17
- const i = "0".repeat(o), $ = `0${c}${i}`;
18
- return r === "before" ? `${e} ${$}` : `${$} ${e}`;
17
+ const s = "0".repeat(n), m = `0${o}${s}`;
18
+ return r === "before" ? `${e} ${m}` : `${m} ${e}`;
19
19
  }
20
- const n = d(t, {
20
+ const a = d(t, {
21
21
  thousandSeparator: u,
22
- decimalSeparator: c,
23
- decimalCount: o
22
+ decimalSeparator: o,
23
+ decimalCount: n
24
24
  });
25
- return r === "before" ? `${e} ${n}` : `${n} ${e}`;
25
+ return r === "before" ? `${e} ${a}` : `${a} ${e}`;
26
26
  }
27
27
  export {
28
- m as formatPrice
28
+ f as formatPrice
29
29
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Returns the extra recommendation feed query params for an account, if any.
3
+ * Accounts without customizations get an empty object.
4
+ * @param partnerName Account subdomain (`config.partner.name`)
5
+ * @param strategy Recommendation strategy key of the block
6
+ */
7
+ export declare function getPartnerRecommendationParams(partnerName: string, strategy: string): Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.6.0-beta.590990f",
3
+ "version": "3.6.0-beta.6fd3d23",
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,24 +0,0 @@
1
- import { ToasterTypeOptions as p } from "../../enums/toaster.js";
2
- import { PAGE_TYPES as n } from "../../enums/unsubscribe.js";
3
- import { DATA_ATTRIBUTES as b } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
- import { useToaster as f } from "../useToaster.js";
5
- import { useTranslations as m } from "../useTranslations.js";
6
- const E = ".unsubscribe-block-v2", C = () => {
7
- const { showToaster: i } = f(), r = m();
8
- return { validateUnsubscribeBlockUniqueness: (c) => {
9
- const u = new DOMParser().parseFromString(c, "text/html"), a = Array.from(u.querySelectorAll(E));
10
- let s = 0, t = 0;
11
- a.forEach((l) => {
12
- const o = Number(l.getAttribute(b.PAGE_TYPE));
13
- o === n.GLOBAL_UNSUBSCRIBE ? s += 1 : o === n.SUBSCRIPTION_PREFERENCE_CENTER && (t += 1);
14
- });
15
- const e = [];
16
- return s > 1 && e.push(r("unsubscription-preference.global-unsub-added")), t > 1 && e.push(r("unsubscription-preference.pref-center-added")), e.length ? (i({
17
- type: p.Alert,
18
- message: e.join(" ")
19
- }), !1) : !0;
20
- } };
21
- };
22
- export {
23
- C as useUnsubscribeBlockValidator
24
- };
@@ -1,3 +0,0 @@
1
- export declare const useUnsubscribeBlockValidator: () => {
2
- validateUnsubscribeBlockUniqueness: (html: string) => boolean;
3
- };