@useinsider/guido 3.17.0-beta.24a776b → 3.17.0-beta.2ff8586

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 (54) hide show
  1. package/README.md +5 -6
  2. package/dist/@types/config/schemas.js +6 -12
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +63 -66
  5. package/dist/composables/useConfig.js +30 -37
  6. package/dist/composables/useCustomInterfaceAppearance.js +38 -52
  7. package/dist/composables/useRecommendation.js +41 -49
  8. package/dist/config/migrator/recommendation/settingsMapper.js +17 -19
  9. package/dist/config/migrator/recommendationMigrator.js +37 -56
  10. package/dist/enums/academy.js +1 -2
  11. package/dist/enums/date.js +3 -4
  12. package/dist/enums/extensions/recommendationBlock.js +1 -4
  13. package/dist/extensions/Blocks/Recommendation/block.js +21 -26
  14. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -36
  15. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +154 -151
  17. package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
  18. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +109 -248
  19. package/dist/extensions/Blocks/common-control.js +19 -22
  20. package/dist/guido.css +1 -1
  21. package/dist/services/recommendationApi.js +30 -72
  22. package/dist/src/@types/config/schemas.d.ts +0 -12
  23. package/dist/src/composables/useConfig.d.ts +0 -3
  24. package/dist/src/composables/useRecommendation.d.ts +0 -1
  25. package/dist/src/enums/academy.d.ts +0 -1
  26. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  27. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -7
  28. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  29. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -9
  30. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -204
  31. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
  32. package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
  33. package/dist/src/services/recommendationApi.d.ts +1 -4
  34. package/dist/src/stores/config.d.ts +0 -18
  35. package/dist/src/stores/template.d.ts +0 -14
  36. package/dist/src/utils/liquidDynamicContent.d.ts +18 -0
  37. package/dist/stores/template.js +8 -13
  38. package/dist/utils/dateUtil.js +10 -23
  39. package/dist/utils/genericUtil.js +49 -38
  40. package/dist/utils/liquidDynamicContent.js +9 -0
  41. package/dist/utils/templatePreparation.js +34 -37
  42. package/package.json +2 -3
  43. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
  44. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -65
  45. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -136
  46. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
  47. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -29
  48. package/dist/src/mock/api/recommendation-strategies.d.ts +0 -63
  49. package/dist/src/utils/strategyInfoBox.d.ts +0 -18
  50. package/dist/static/assets/icons/line-change.svg.js +0 -5
  51. package/dist/static/assets/icons/line-delete.svg.js +0 -5
  52. package/dist/static/assets/icons/line-plus.svg.js +0 -5
  53. package/dist/static/styles/components/recommendation-strategy.css.js +0 -172
  54. package/dist/utils/strategyInfoBox.js +0 -37
@@ -1,23 +1,22 @@
1
- import { useConfig as I } from "./useConfig.js";
2
- import { getRecommendationFeedSourceMaps as C, URLS as R } from "../enums/extensions/recommendationBlock.js";
3
- import { MinDeviceViewport as b, DefaultPadding as h } from "../enums/recommendation.js";
4
- import { useRecommendationExtensionStore as f } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
6
- import { getPartnerRecommendationParams as P } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
7
- import { sanitizeProductIds as S } from "../extensions/Blocks/Recommendation/utils/productIds.js";
8
- import { useConfigStore as T } from "../stores/config.js";
9
- const M = () => ({
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
+ import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
+ import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
7
+ import { useConfigStore as P } from "../stores/config.js";
8
+ const B = () => ({
10
9
  calculateCardWidth: ({
11
- mobileLeftPadding: s,
12
- mobileRightPadding: c,
13
- cardsInRow: a,
10
+ mobileLeftPadding: a,
11
+ mobileRightPadding: s,
12
+ cardsInRow: c,
14
13
  unresponsive: n
15
14
  }) => {
16
- const o = n ? a : 1, d = s + c + (o - 1) * h;
17
- return (b - d) / o;
15
+ const r = n ? c : 1, e = a + s + (r - 1) * b;
16
+ return (C - e) / r;
18
17
  },
19
- getRecommendationCampaignData: (s) => {
20
- const c = f(), a = Number(s), n = c.blockStates[a];
18
+ getRecommendationCampaignData: (a) => {
19
+ const s = l(), c = Number(a), n = s.blockStates[c];
21
20
  if (!n)
22
21
  return {
23
22
  textTrimming: !1,
@@ -31,56 +30,49 @@ const M = () => ({
31
30
  discountBeforeTextValue: "",
32
31
  discountAfterTextValue: ""
33
32
  };
34
- const { recommendationConfigs: o } = n, d = o.orientation === "grid" ? "vertical" : "horizontal";
33
+ const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
35
34
  return {
36
- textTrimming: o.textTrimming,
37
- orientation: d,
35
+ textTrimming: r.textTrimming,
36
+ orientation: e,
38
37
  mobileLeftPadding: 0,
39
38
  mobileRightPadding: 0,
40
- cardsInRow: o.cardsInRow,
41
- unresponsive: o.unresponsive,
39
+ cardsInRow: r.cardsInRow,
40
+ unresponsive: r.unresponsive,
42
41
  priceBeforeTextValue: "",
43
42
  priceAfterTextValue: "",
44
43
  discountBeforeTextValue: "",
45
44
  discountAfterTextValue: ""
46
45
  };
47
46
  },
48
- buildCampaignUrl: (s, c) => {
49
- var l;
50
- const a = f(), n = T(), { isRrsSessionActive: o } = I(), d = Number(s);
47
+ buildCampaignUrl: (a, s) => {
48
+ var m;
49
+ const c = l(), n = P(), r = Number(a);
51
50
  let e;
52
- if (c)
53
- e = c;
51
+ if (s)
52
+ e = s;
54
53
  else {
55
- const i = a.blockStates[d];
54
+ const i = c.blockStates[r];
56
55
  if (!i)
57
56
  return "";
58
- const { recommendationConfigs: r } = i;
57
+ const { recommendationConfigs: o } = i;
59
58
  e = {
60
- strategy: r.strategy,
61
- strategyId: r.strategyId,
62
- language: r.language,
63
- currencyCode: r.currencySettings.value,
64
- size: r.size,
65
- productIds: r.productIds,
66
- filters: r.filters,
67
- shuffleProducts: r.shuffleProducts
59
+ strategy: o.strategy,
60
+ language: o.language,
61
+ currencyCode: o.currencySettings.value,
62
+ size: o.size,
63
+ productIds: o.productIds,
64
+ filters: o.filters,
65
+ shuffleProducts: o.shuffleProducts
68
66
  };
69
67
  }
70
- if (o() && e.strategyId)
71
- return a.recommendationCampaignUrls[s] = {
72
- strategyId: e.strategyId,
73
- locale: e.language,
74
- currency: e.currencyCode
75
- }, "";
76
- const g = ((l = C().find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
77
- 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", S(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
78
- const p = e.filters.filter((i) => i.isValid), u = x(p);
79
- u && t.set("filter", u), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(P(n.partnerName, e.strategy)).forEach(([i, r]) => t.set(i, r));
80
- const y = decodeURIComponent(t.toString()), m = `${R.RECOMMENDATION_API_URL}/v2/${g}?${y}`;
81
- return a.recommendationCampaignUrls[s] = m, m;
68
+ const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
69
+ 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", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
70
+ const g = e.filters.filter((i) => i.isValid), d = h(g);
71
+ d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(n.partnerName, e.strategy)).forEach(([i, o]) => t.set(i, o));
72
+ const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
73
+ return c.recommendationCampaignUrls[a] = u, u;
82
74
  }
83
75
  });
84
76
  export {
85
- M as useRecommendation
77
+ B as useRecommendation
86
78
  };
@@ -1,10 +1,10 @@
1
- import { PRE_RRS_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
- import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as S, DEFAULT_COLUMN_SPACING as f, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
1
+ import { CURRENT_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
+ import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as f, DEFAULT_COLUMN_SPACING as S, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
3
3
  import { mapLegacyStrategy as l } from "../../../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
4
4
  function c(t) {
5
5
  return t === "0" || t === 0 ? "before" : "after";
6
6
  }
7
- function _(t) {
7
+ function I(t) {
8
8
  if (typeof t == "number" && Number.isFinite(t))
9
9
  return t;
10
10
  if (typeof t == "string") {
@@ -14,13 +14,13 @@ function _(t) {
14
14
  }
15
15
  return i.decimalCount;
16
16
  }
17
- function I(t) {
17
+ function _(t) {
18
18
  return t === "." || t === "," || t === " " || t === "" ? t : ",";
19
19
  }
20
- function A(t) {
20
+ function N(t) {
21
21
  return t === "." || t === "," || t === " " ? t : ".";
22
22
  }
23
- function L(t) {
23
+ function A(t) {
24
24
  if (!t || typeof t != "object")
25
25
  return { ...i };
26
26
  const o = t, n = o.value ?? o.name ?? i.code, r = o.symbol ?? n;
@@ -28,18 +28,18 @@ function L(t) {
28
28
  code: n,
29
29
  symbol: r,
30
30
  alignment: c(o.alignment),
31
- decimalCount: _(o.decimalCount),
32
- decimalSeparator: A(o.decimalSeparator),
33
- thousandSeparator: I(o.thousandSeparator)
31
+ decimalCount: I(o.decimalCount),
32
+ decimalSeparator: N(o.decimalSeparator),
33
+ thousandSeparator: _(o.thousandSeparator)
34
34
  };
35
35
  }
36
- function N(t) {
36
+ function L(t) {
37
37
  return t === "horizontal" || t === "list" ? "list" : "grid";
38
38
  }
39
39
  function R(t) {
40
40
  return l(t) || "mostPopular";
41
41
  }
42
- function O(t, o, n) {
42
+ function U(t, o, n) {
43
43
  const r = o.rowCount ?? t.cardsInRow ?? m, u = o.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
44
44
  return {
45
45
  recommendationId: n,
@@ -48,15 +48,15 @@ function O(t, o, n) {
48
48
  size: String(u),
49
49
  shuffleProducts: !!t.shuffleProducts,
50
50
  language: t.language ?? "en_US",
51
- currency: L(t.currencySettings),
51
+ currency: A(t.currencySettings),
52
52
  filters: (t.filters ?? []).map((e) => ({ ...e })),
53
- layout: N(t.orientation ?? o.orientation),
53
+ layout: L(t.orientation ?? o.orientation),
54
54
  cardsInRow: r,
55
55
  mobileCardsInRow: a,
56
56
  mobileLayoutEnabled: !1,
57
57
  previousMobileCardsInRow: a,
58
- columnSpacing: f,
59
- rowSpacing: S,
58
+ columnSpacing: S,
59
+ rowSpacing: f,
60
60
  mobileColumnSpacing: d,
61
61
  mobileRowSpacing: p,
62
62
  omnibusPrice: { textBefore: "", textAfter: "" },
@@ -66,12 +66,10 @@ function O(t, o, n) {
66
66
  // gated). New Guido blocks default differently (see DEFAULT_NODE_CONFIG).
67
67
  priceMovedToNextLine: !!t.isPriceMovedToNextLine,
68
68
  priceHideIfSameAsDiscounted: !!t.isPriceDeletedForZeroSale,
69
- // Legacy blocks stay on the pre-RRS era marker: the campaign they belong
70
- // to keeps the old settings panel until its own migration ships.
71
69
  configVersion: s
72
70
  };
73
71
  }
74
72
  export {
75
- L as mapCurrency,
76
- O as mapSettings
73
+ A as mapCurrency,
74
+ U as mapSettings
77
75
  };
@@ -1,34 +1,31 @@
1
1
  import { BlockId as f } from "../../enums/block.js";
2
- import { PRE_RRS_CONFIG_VERSION as y, CURRENT_CONFIG_VERSION as R } from "../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
3
- import { useTemplateStore as S } from "../../stores/template.js";
4
- import { mapComposition as b } from "./recommendation/compositionMapper.js";
5
- import { extractCurrencyFromBlock as h, extractTitleText as C, extractCardBgColor as v, isPartnerManagedBlock as B } from "./recommendation/extractors.js";
2
+ import { useTemplateStore as b } from "../../stores/template.js";
3
+ import { mapComposition as y } from "./recommendation/compositionMapper.js";
4
+ import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
6
5
  import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
7
- import { parseRecommendationId as x, parseLegacyConfig as A } from "./recommendation/parseLegacyConfig.js";
8
- import { mapSettings as E } from "./recommendation/settingsMapper.js";
9
- const M = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
10
- function T(s, t, o) {
11
- var l;
12
- const e = x(t);
13
- if (e === null)
6
+ import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
7
+ import { mapSettings as T } from "./recommendation/settingsMapper.js";
8
+ const h = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
9
+ function B(i, t, a) {
10
+ var d;
11
+ const o = x(t);
12
+ if (o === null)
14
13
  return console.warn(
15
14
  "[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
16
15
  ), !1;
17
- const r = A(t);
16
+ const r = R(t);
18
17
  if (!r)
19
18
  return console.warn(
20
- `[RecommendationMigrator] Aborting block id=${e} — \`esd-dev-product-config\` missing or unable to be parsed`
19
+ `[RecommendationMigrator] Aborting block id=${o} — \`esd-dev-product-config\` missing or unable to be parsed`
21
20
  ), !1;
22
- const a = o[String(e)] ?? {
23
- currencySettings: h(t)
24
- }, n = E(a, r, e), c = b((l = r.composition) == null ? void 0 : l.variables), i = C(t), g = v(t), p = {
25
- ...n,
26
- // Legacy blocks predate RRS — never strategy-backed.
27
- strategyId: "",
28
- composition: c.composition,
29
- visibility: c.visibility,
30
- textTrimming: c.anyTextTrimming
31
- }, m = B(t), u = `
21
+ const n = a[String(o)] ?? {
22
+ currencySettings: v(t)
23
+ }, c = T(n, r, o), e = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
24
+ ...c,
25
+ composition: e.composition,
26
+ visibility: e.visibility,
27
+ textTrimming: e.anyTextTrimming
28
+ }, m = S(t), u = `
32
29
  <table>
33
30
  <tbody>
34
31
  <tr>
@@ -37,9 +34,9 @@ function T(s, t, o) {
37
34
  <tbody>
38
35
  <tr>${w({
39
36
  nodeConfig: p,
40
- composition: c,
37
+ composition: e,
41
38
  cardBg: g,
42
- titleText: i,
39
+ titleText: l,
43
40
  legacyId: t.getAttribute("id") ?? void 0,
44
41
  legacyBgColor: t.getAttribute("bgcolor") ?? void 0,
45
42
  preserveInnerHtml: m ? t.innerHTML : void 0,
@@ -51,48 +48,32 @@ function T(s, t, o) {
51
48
  </tr>
52
49
  </tbody>
53
50
  </table>
54
- `, d = s.parseFromString(u, "text/html").querySelector("td.esd-structure");
55
- return !d || !t.parentNode ? (console.warn(
56
- `[RecommendationMigrator] Aborting block id=${e} — failed to construct new HTML element`
57
- ), !1) : (t.parentNode.replaceChild(d, t), !0);
51
+ `, s = i.parseFromString(u, "text/html").querySelector("td.esd-structure");
52
+ return !s || !t.parentNode ? (console.warn(
53
+ `[RecommendationMigrator] Aborting block id=${o} — failed to construct new HTML element`
54
+ ), !1) : (t.parentNode.replaceChild(s, t), !0);
58
55
  }
59
- function k(s, t) {
60
- let o = t, e = !1;
61
- return s.querySelectorAll(".recommendation-block-v2").forEach((r) => {
62
- const a = r.getAttribute("esd-ext-config");
63
- if (!a) {
64
- o = !0;
65
- return;
66
- }
67
- try {
68
- const n = JSON.parse(a);
69
- (n.configVersion ?? y) < R && (o = !0), n.strategyId && (e = !0);
70
- } catch {
71
- o = !0;
72
- }
73
- }), { hasPreRrsBlocks: o, hasAssignedStrategy: e };
74
- }
75
- function q(s, t = {}) {
76
- const o = new DOMParser(), e = o.parseFromString(s, "text/html"), r = Array.from(e.querySelectorAll(M)), a = k(e, r.length > 0);
56
+ function q(i, t = {}) {
57
+ const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
77
58
  try {
78
- S().$patch((i) => {
79
- i.migrations = {
80
- ...i.migrations,
59
+ b().$patch((e) => {
60
+ e.migrations = {
61
+ ...e.migrations,
81
62
  [f.Recommendation]: r.length
82
- }, i.hasPreRrsRecommendationBlocks = a.hasPreRrsBlocks, i.hasAssignedStrategyBlocks = a.hasAssignedStrategy;
63
+ };
83
64
  });
84
65
  } catch {
85
66
  }
86
67
  if (r.length === 0)
87
- return s;
68
+ return i;
88
69
  let n = 0;
89
70
  return r.forEach((c) => {
90
71
  try {
91
- T(o, c, t) && (n += 1);
92
- } catch (i) {
93
- console.error("[RecommendationMigrator] Unexpected error migrating block:", i);
72
+ B(a, c, t) && (n += 1);
73
+ } catch (e) {
74
+ console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
94
75
  }
95
- }), n > 0 && console.info(`[RecommendationMigrator] Migrated ${n} legacy Recommendation block(s)`), e.documentElement.outerHTML;
76
+ }), n > 0 && console.info(`[RecommendationMigrator] Migrated ${n} legacy Recommendation block(s)`), o.documentElement.outerHTML;
96
77
  }
97
78
  export {
98
79
  q as migrateRecommendation
@@ -1,8 +1,7 @@
1
1
  const e = "https://academy.insiderone.com", o = {
2
2
  EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
3
3
  GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
- AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
5
- EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
4
+ AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`
6
5
  };
7
6
  export {
8
7
  o as ACADEMY_LINKS
@@ -1,6 +1,5 @@
1
- const t = "tr-TR", T = "default", L = "UTC";
1
+ const t = "tr-TR", L = "default";
2
2
  export {
3
- T as DEFAULT,
4
- t as DEFAULT_LOCALE,
5
- L as DEFAULT_TZ
3
+ L as DEFAULT,
4
+ t as DEFAULT_LOCALE
6
5
  };
@@ -2,10 +2,7 @@ import { useTranslations as r } from "../../composables/useTranslations.js";
2
2
  const l = {
3
3
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
4
4
  // Relative path → same-origin as the embedding inone dashboard.
5
- PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
- RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
7
- // Panel route of the Recommendation Strategies listing.
8
- RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
5
+ PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
9
6
  }, c = {
10
7
  CLIENT_ID: "clientId"
11
8
  }, d = () => {
@@ -1,27 +1,25 @@
1
- var R = Object.defineProperty;
2
- var B = (a, c, t) => c in a ? R(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
3
- var p = (a, c, t) => B(a, typeof c != "symbol" ? c + "" : c, t);
4
- import { useConfig as D } from "../../../composables/useConfig.js";
5
- import { BlockId as C } from "../../../enums/block.js";
1
+ var B = Object.defineProperty;
2
+ var D = (a, c, t) => c in a ? B(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
3
+ var h = (a, c, t) => D(a, typeof c != "symbol" ? c + "" : c, t);
4
+ import { BlockId as R } from "../../../enums/block.js";
6
5
  import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
7
- import { Block as A, BlockCompositionType as b, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { CURRENT_CONFIG_VERSION as E, PRE_RRS_CONFIG_VERSION as S } from "./constants/defaultConfig.js";
9
- import { regenerateMobileProductRows as N } from "./controls/main/utils.js";
10
- import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
6
+ import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
+ import { regenerateMobileProductRows as C } from "./controls/main/utils.js";
8
+ import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as E } from "./controls/mobileLayout/cssRules.js";
11
9
  import { RecommendationConfigService as s } from "./services/configService.js";
12
10
  import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
13
- import { getDefaultTemplate as M } from "./templates/grid/template.js";
14
- import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
15
- const _ = C.Recommendation, m = "recommendation-block-v2", u = "recommendation-id", I = "hide-price";
11
+ import { getDefaultTemplate as S } from "./templates/grid/template.js";
12
+ import { useRecommendationBlockWarning as M } from "./useRecommendationBlockWarning.js";
13
+ const _ = R.Recommendation, m = "recommendation-block-v2", u = "recommendation-id", I = "hide-price";
16
14
  let k = !1;
17
- class K extends A {
15
+ class P extends b {
18
16
  constructor() {
19
17
  super();
20
18
  /**
21
19
  * Stores the ID generated in getTemplate() so onCreated() can reuse it.
22
20
  * This avoids generating a new (different) ID in onCreated().
23
21
  */
24
- p(this, "_pendingBlockId", null);
22
+ h(this, "_pendingBlockId", null);
25
23
  }
26
24
  getId() {
27
25
  return _;
@@ -30,7 +28,7 @@ class K extends A {
30
28
  return "recommendation-icon";
31
29
  }
32
30
  getBlockCompositionType() {
33
- return b.CONTAINER;
31
+ return A.CONTAINER;
34
32
  }
35
33
  getName() {
36
34
  return this.api.translate("Recommendation Block");
@@ -65,7 +63,7 @@ class K extends A {
65
63
  */
66
64
  getTemplate() {
67
65
  const t = this._generateNextId();
68
- return this._pendingBlockId = t, M(t);
66
+ return this._pendingBlockId = t, S(t);
69
67
  }
70
68
  /**
71
69
  * Called when a new block is dropped into the template
@@ -91,15 +89,12 @@ class K extends A {
91
89
  const { config: n, wasFreshDrop: o } = s.initializeConfig(
92
90
  this.api,
93
91
  t,
94
- {
95
- recommendationId: i,
96
- configVersion: D().isRrsSessionActive() ? E : S
97
- }
92
+ { recommendationId: i }
98
93
  ), r = d();
99
94
  if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
100
- h(this.api);
95
+ p(this.api);
101
96
  const l = this._getBlockElement(t);
102
- l && (f(this.api, l, !0), N({
97
+ l && (f(this.api, l, !0), C({
103
98
  currentNode: t,
104
99
  documentModifier: this.api.getDocumentModifier()
105
100
  }));
@@ -126,11 +121,11 @@ class K extends A {
126
121
  }
127
122
  this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
128
123
  try {
129
- k || (h(this.api), k = !0);
124
+ k || (p(this.api), k = !0);
130
125
  const e = s.getConfig(t), i = this._getBlockElement(t);
131
126
  if (i) {
132
127
  const n = !e.mobileLayoutEnabled;
133
- O(i) !== n && f(this.api, i, n);
128
+ E(i) !== n && f(this.api, i, n);
134
129
  }
135
130
  } catch {
136
131
  }
@@ -160,7 +155,7 @@ class K extends A {
160
155
  */
161
156
  _warnIfMultipleBlocks() {
162
157
  try {
163
- w().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
158
+ M().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
164
159
  } catch {
165
160
  }
166
161
  }
@@ -338,5 +333,5 @@ class K extends A {
338
333
  }
339
334
  export {
340
335
  _ as BLOCK_ID,
341
- K as RecommendationBlock
336
+ P as RecommendationBlock
342
337
  };
@@ -1,60 +1,59 @@
1
- import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as n, DEFAULT_MOBILE_ROW_SPACING as s, DEFAULT_MOBILE_COLUMN_SPACING as O, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as U } from "./layout.js";
2
- import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as i } from "./selectors.js";
3
- const C = 1, l = 2, a = {
1
+ import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
2
+ import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as i, ATTR_PRODUCT_BUTTON as I } from "./selectors.js";
3
+ const D = {
4
4
  code: "USD",
5
5
  symbol: "USD",
6
6
  alignment: "after",
7
7
  decimalCount: 2,
8
8
  decimalSeparator: ".",
9
9
  thousandSeparator: ","
10
- }, D = {
10
+ }, O = {
11
11
  textBefore: "",
12
12
  textAfter: ""
13
- }, A = {
13
+ }, a = {
14
14
  textBefore: "",
15
15
  textAfter: ""
16
- }, c = [
16
+ }, A = [
17
17
  o,
18
18
  t,
19
19
  _,
20
20
  T,
21
21
  r,
22
- I,
23
- i
24
- ], E = {
22
+ i,
23
+ I
24
+ ], c = {
25
25
  [o]: !0,
26
26
  [t]: !0,
27
27
  [T]: !0,
28
28
  [_]: !0,
29
29
  [r]: !1,
30
- [I]: !1,
31
- [i]: !0
32
- }, m = {
30
+ [i]: !1,
31
+ [I]: !0
32
+ }, l = {
33
33
  // Settings
34
34
  strategy: "mostPopular",
35
35
  productIds: [],
36
36
  size: "6",
37
37
  shuffleProducts: !1,
38
38
  language: "en_US",
39
- currency: a,
39
+ currency: D,
40
40
  filters: [],
41
- strategyId: "",
42
41
  // Layout
43
42
  layout: "grid",
44
- cardsInRow: U,
43
+ cardsInRow: C,
45
44
  mobileCardsInRow: e,
46
45
  mobileLayoutEnabled: !1,
47
46
  previousMobileCardsInRow: e,
48
- columnSpacing: R,
49
- rowSpacing: n,
50
- mobileColumnSpacing: O,
51
- mobileRowSpacing: s,
47
+ columnSpacing: n,
48
+ rowSpacing: s,
49
+ mobileColumnSpacing: U,
50
+ mobileRowSpacing: R,
52
51
  // Composition
53
- composition: c,
54
- visibility: E,
52
+ composition: A,
53
+ visibility: c,
55
54
  // Element settings
56
- omnibusPrice: D,
57
- omnibusDiscount: A,
55
+ omnibusPrice: O,
56
+ omnibusDiscount: a,
58
57
  textTrimming: !1,
59
58
  // Price placement (block-level, affects all cards)
60
59
  // Default ON = current stacked look, so existing templates are unaffected.
@@ -64,19 +63,18 @@ const C = 1, l = 2, a = {
64
63
  // of "false" (the actual hiding happens server-side at send).
65
64
  priceHideIfSameAsDiscounted: !1,
66
65
  // Meta
67
- // Pre-RRS fallback only — block.ts stamps the era of the live session over
68
- // it on creation. See PRE_RRS_CONFIG_VERSION.
69
- configVersion: C,
66
+ // Version NOT bumped: mergeWithDefaults() backfills the two new fields from
67
+ // defaults, so no data transform (and no needsMigration trigger) is required.
68
+ configVersion: 1,
70
69
  recommendationId: 0
71
- }, u = [11, 12];
70
+ }, N = [11, 12], m = 1;
72
71
  export {
73
- l as CURRENT_CONFIG_VERSION,
74
- c as DEFAULT_COMPOSITION,
75
- a as DEFAULT_CURRENCY,
76
- m as DEFAULT_NODE_CONFIG,
77
- A as DEFAULT_OMNIBUS_DISCOUNT,
78
- D as DEFAULT_OMNIBUS_PRICE,
79
- E as DEFAULT_VISIBILITY,
80
- u as EXCLUDED_ALGORITHM_IDS,
81
- C as PRE_RRS_CONFIG_VERSION
72
+ m as CURRENT_CONFIG_VERSION,
73
+ A as DEFAULT_COMPOSITION,
74
+ D as DEFAULT_CURRENCY,
75
+ l as DEFAULT_NODE_CONFIG,
76
+ a as DEFAULT_OMNIBUS_DISCOUNT,
77
+ O as DEFAULT_OMNIBUS_PRICE,
78
+ c as DEFAULT_VISIBILITY,
79
+ N as EXCLUDED_ALGORITHM_IDS
82
80
  };