@useinsider/guido 3.17.0-beta.35560b0 → 3.17.0-beta.3cd7f07

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 (71) hide show
  1. package/README.md +6 -5
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +86 -78
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +131 -0
  7. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  11. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  12. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  13. package/dist/composables/useCustomInterfaceAppearance.js +56 -38
  14. package/dist/composables/useLegacyStrategyConversion.js +52 -0
  15. package/dist/composables/useRecommendation.js +41 -34
  16. package/dist/config/i18n/en/labels.json.js +1 -1
  17. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  18. package/dist/config/migrator/recommendationMigrator.js +5 -4
  19. package/dist/enums/academy.js +2 -1
  20. package/dist/enums/date.js +5 -3
  21. package/dist/enums/extensions/recommendationBlock.js +4 -1
  22. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  23. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +30 -30
  24. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +14 -13
  25. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +60 -59
  26. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +242 -181
  27. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +159 -0
  28. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  29. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +217 -80
  30. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
  31. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  32. package/dist/extensions/Blocks/common-control.js +22 -19
  33. package/dist/guido.css +1 -1
  34. package/dist/services/recommendationApi.js +81 -33
  35. package/dist/src/@types/config/schemas.d.ts +2 -0
  36. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  37. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  38. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  39. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  40. package/dist/src/composables/useConfig.d.ts +2 -0
  41. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  42. package/dist/src/composables/useRecommendation.d.ts +1 -0
  43. package/dist/src/enums/academy.d.ts +1 -0
  44. package/dist/src/enums/date.d.ts +1 -0
  45. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
  46. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
  47. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  48. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +2 -0
  49. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  50. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
  51. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  52. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +229 -10
  53. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
  54. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
  55. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  56. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  57. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  58. package/dist/src/services/recommendationApi.d.ts +5 -1
  59. package/dist/src/stores/config.d.ts +18 -0
  60. package/dist/src/stores/save-as-template.d.ts +4 -3
  61. package/dist/src/utils/genericUtil.d.ts +5 -0
  62. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  63. package/dist/static/assets/icons/line-change.svg.js +5 -0
  64. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  65. package/dist/static/assets/icons/line-info.svg.js +5 -0
  66. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  67. package/dist/static/styles/components/recommendation-strategy.css.js +220 -0
  68. package/dist/utils/dateUtil.js +23 -10
  69. package/dist/utils/genericUtil.js +28 -27
  70. package/dist/utils/templatePreparation.js +35 -34
  71. package/package.json +3 -2
@@ -0,0 +1,19 @@
1
+ import r from "./StrategyInfoBoxContent.vue2.js";
2
+ import _ from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var c = function() {
4
+ var t = this, s = t._self._c, n = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(n.details, function(e, a) {
6
+ return s("div", { key: e.title, staticClass: "d-f f-d-c", class: { "mt-2": a > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(e.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(e.value))])]);
7
+ }), 0);
8
+ }, f = [], l = /* @__PURE__ */ _(
9
+ r,
10
+ c,
11
+ f,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const p = l.exports;
17
+ export {
18
+ p as default
19
+ };
@@ -0,0 +1,63 @@
1
+ import { defineComponent as f, computed as i } from "vue";
2
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
3
+ import { asText as c } from "../../../../utils/genericUtil.js";
4
+ const j = /* @__PURE__ */ f({
5
+ __name: "StrategyInfoBoxContent",
6
+ props: {
7
+ strategy: null
8
+ },
9
+ setup(p) {
10
+ const a = p, n = _(), s = i(() => n("recommendation-strategy.none")), u = i(() => {
11
+ const e = c(a.strategy.algorithm) === "MIXED" ? n("discovery-strategy.mixed-algorithm") : n("discovery-strategy.single-algorithm"), t = c(a.strategy.algorithm_used).split(",").map((r) => r.trim()).filter(Boolean).map((r) => n(`recommendation-algorithm-names.${r.replaceAll("_", "-").toLowerCase()}`));
12
+ return t.length ? `${e} · ${t.join(", ")}` : e;
13
+ }), d = i(() => [
14
+ [a.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
15
+ [a.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
16
+ [a.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
17
+ ].filter(([e]) => Number(e) === 1).map(([, e]) => n(e)).join(", ") || s.value), l = (e) => {
18
+ const t = c(e).trim();
19
+ if (!t)
20
+ return "";
21
+ let r;
22
+ try {
23
+ r = JSON.parse(t);
24
+ } catch {
25
+ return t;
26
+ }
27
+ if (Array.isArray(r))
28
+ return r.length ? String(r.length) : "";
29
+ if (r && typeof r == "object") {
30
+ const o = Object.keys(r).length;
31
+ return o ? String(o) : "";
32
+ }
33
+ return t;
34
+ }, m = i(() => l(a.strategy.manual_merchandising) || l(a.strategy.manual_merchandising_products) || s.value), g = (e) => {
35
+ if (Array.isArray(e))
36
+ return e.length;
37
+ const { conditionList: t } = e ?? {};
38
+ return Array.isArray(t) ? t.length : 1;
39
+ }, y = i(() => {
40
+ const e = a.strategy.filters;
41
+ if (!e)
42
+ return s.value;
43
+ try {
44
+ const t = typeof e == "string" ? JSON.parse(e) : e;
45
+ if (!t || typeof t != "object")
46
+ return s.value;
47
+ const r = Object.values(t).reduce((o, v) => o + g(v), 0);
48
+ return r ? String(r) : s.value;
49
+ } catch {
50
+ return s.value;
51
+ }
52
+ }), h = i(() => [
53
+ { title: n("gpt-app-builder.algorithms-and-method"), value: u.value },
54
+ { title: n("gpt-app-builder.exclusions"), value: d.value },
55
+ { title: n("discovery-strategy.filters"), value: y.value },
56
+ { title: n("action-builder.manual-merchandising"), value: m.value }
57
+ ]);
58
+ return { __sfc: !0, props: a, trans: n, none: s, algorithmsAndMethod: u, exclusions: d, asMerchandising: l, manualMerchandising: m, conditionsIn: g, filters: y, details: h };
59
+ }
60
+ });
61
+ export {
62
+ j as default
63
+ };
@@ -1,53 +1,71 @@
1
- import S from "../static/styles/base.css.js";
2
- import m from "../static/styles/components/alert-message.css.js";
3
- import e from "../static/styles/components/amp-block.css.js";
4
- import i from "../static/styles/components/base-input.css.js";
5
- import p from "../static/styles/components/button-group.css.js";
6
- import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
9
- import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/loader.css.js";
11
- import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/popup.css.js";
13
- import d from "../static/styles/components/switcher.css.js";
14
- import l from "../static/styles/components/tabs.css.js";
15
- import h from "../static/styles/components/tools.css.js";
16
- import w from "../static/styles/components/version-history.css.js";
17
- import y from "../static/styles/components/wide-panel.css.js";
18
- import B from "../static/styles/variables.css.js";
19
- const b = [
20
- B,
1
+ import i from "../static/assets/icons/filled-arrow-rising.svg.js";
2
+ import n from "../static/assets/icons/line-change.svg.js";
3
+ import S from "../static/assets/icons/line-delete.svg.js";
4
+ import p from "../static/assets/icons/line-info.svg.js";
5
+ import s from "../static/assets/icons/line-plus.svg.js";
6
+ import f from "../static/styles/base.css.js";
7
+ import C from "../static/styles/components/alert-message.css.js";
8
+ import a from "../static/styles/components/amp-block.css.js";
9
+ import c from "../static/styles/components/base-input.css.js";
10
+ import l from "../static/styles/components/button-group.css.js";
11
+ import u from "../static/styles/components/button.css.js";
12
+ import d from "../static/styles/components/combobox.css.js";
13
+ import I from "../static/styles/components/counter.css.js";
14
+ import g from "../static/styles/components/dropdown-menu.css.js";
15
+ import h from "../static/styles/components/loader.css.js";
16
+ import w from "../static/styles/components/narrow-panel.css.js";
17
+ import $ from "../static/styles/components/popup.css.js";
18
+ import y from "../static/styles/components/recommendation-strategy.css.js";
19
+ import b from "../static/styles/components/switcher.css.js";
20
+ import B from "../static/styles/components/tabs.css.js";
21
+ import A from "../static/styles/components/tools.css.js";
22
+ import P from "../static/styles/components/version-history.css.js";
23
+ import R from "../static/styles/components/wide-panel.css.js";
24
+ import x from "../static/styles/variables.css.js";
25
+ function o(t, r) {
26
+ return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
27
+ }
28
+ const V = `:host {
29
+ ${o("line-change", n)}
30
+ ${o("line-delete", S)}
31
+ ${o("filled-arrow-rising", i)}
32
+ ${o("line-info", p)}
33
+ ${o("line-plus", s)}
34
+ }`, D = [
35
+ x,
21
36
  // Must be on top
22
- S,
37
+ V,
38
+ f,
23
39
  // Must be on top
24
- m,
25
- e,
26
- i,
27
- p,
28
- n,
29
- s,
30
40
  C,
31
- f,
32
41
  a,
33
- u,
34
42
  c,
35
- d,
36
43
  l,
44
+ u,
45
+ d,
46
+ I,
47
+ g,
37
48
  h,
38
49
  w,
50
+ $,
51
+ b,
52
+ B,
53
+ A,
54
+ P,
55
+ R,
39
56
  y
57
+ // Last: overrides button.css / wide-panel.css defaults
40
58
  ].join(`
41
59
 
42
- `), v = () => ({ importCss: () => {
43
- const o = new CSSStyleSheet();
44
- o.replaceSync(b);
45
- const r = document.querySelector("ui-editor");
46
- if (!r)
60
+ `), ro = () => ({ importCss: () => {
61
+ const r = new CSSStyleSheet();
62
+ r.replaceSync(D);
63
+ const e = document.querySelector("ui-editor");
64
+ if (!e)
47
65
  return;
48
- const t = r.shadowRoot;
49
- t && (t.adoptedStyleSheets = [o]);
66
+ const m = e.shadowRoot;
67
+ m && (m.adoptedStyleSheets = [r]);
50
68
  } });
51
69
  export {
52
- v as useCustomInterfaceAppearance
70
+ ro as useCustomInterfaceAppearance
53
71
  };
@@ -0,0 +1,52 @@
1
+ import { useRecommendation as l } from "./useRecommendation.js";
2
+ import { useToaster as u } from "./useToaster.js";
3
+ import { useTranslations as p } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as f } from "../enums/toaster.js";
5
+ import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
+ import { CURRENT_CONFIG_VERSION as S } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { buildLegacyMigrationPayload as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
+ import { commitBlockChangeOutsidePanel as v } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
+ import { useConfigStore as I } from "../stores/config.js";
11
+ const x = () => {
12
+ const t = C(), a = I(), { buildCampaignUrl: n } = l(), { showToaster: i } = u(), c = p();
13
+ return { convertLegacyStrategy: async () => {
14
+ const e = t.currentRecommendationId;
15
+ if (e === null || !t.isLegacyStrategyBlock || t.legacyConversionLoading)
16
+ return "";
17
+ const { strategy: s, productIds: m, filters: g } = t.recommendationConfigs, d = L({
18
+ blockId: e,
19
+ url: n(String(e)),
20
+ templateId: a.templateId,
21
+ variationId: a.variationId,
22
+ strategy: s,
23
+ productIds: m,
24
+ filters: g,
25
+ attributes: t.getFilterList
26
+ });
27
+ let o;
28
+ try {
29
+ o = await t.convertLegacyStrategy(d);
30
+ } catch (r) {
31
+ return console.error("[useLegacyStrategyConversion] migration failed", r), i({
32
+ type: f.Error,
33
+ message: c("email-editor.legacy-strategy-update-failed")
34
+ }), "";
35
+ }
36
+ const { size: y } = t.recommendationConfigs;
37
+ try {
38
+ await t.fetchRecommendationProducts();
39
+ } catch (r) {
40
+ console.error("[useLegacyStrategyConversion] product refetch failed", r);
41
+ }
42
+ return v(
43
+ e,
44
+ { strategyId: o, size: y, configVersion: S },
45
+ t.recommendationProducts,
46
+ "Converted legacy recommendation strategy"
47
+ ), t.openLegacyStrategyUpdatedModal(), o;
48
+ } };
49
+ };
50
+ export {
51
+ x as useLegacyStrategyConversion
52
+ };
@@ -1,22 +1,22 @@
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";
1
+ import { getRecommendationFeedSourceMaps as y, URLS as I } from "../enums/extensions/recommendationBlock.js";
2
+ import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommendation.js";
3
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";
4
+ import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
6
  import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
7
7
  import { useConfigStore as P } from "../stores/config.js";
8
8
  const B = () => ({
9
9
  calculateCardWidth: ({
10
- mobileLeftPadding: a,
11
- mobileRightPadding: s,
12
- cardsInRow: c,
10
+ mobileLeftPadding: i,
11
+ mobileRightPadding: c,
12
+ cardsInRow: s,
13
13
  unresponsive: n
14
14
  }) => {
15
- const r = n ? c : 1, e = a + s + (r - 1) * b;
16
- return (C - e) / r;
15
+ const o = n ? s : 1, e = i + c + (o - 1) * R;
16
+ return (C - e) / o;
17
17
  },
18
- getRecommendationCampaignData: (a) => {
19
- const s = l(), c = Number(a), n = s.blockStates[c];
18
+ getRecommendationCampaignData: (i) => {
19
+ const c = l(), s = Number(i), n = c.blockStates[s];
20
20
  if (!n)
21
21
  return {
22
22
  textTrimming: !1,
@@ -30,47 +30,54 @@ const B = () => ({
30
30
  discountBeforeTextValue: "",
31
31
  discountAfterTextValue: ""
32
32
  };
33
- const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
33
+ const { recommendationConfigs: o } = n, e = o.orientation === "grid" ? "vertical" : "horizontal";
34
34
  return {
35
- textTrimming: r.textTrimming,
35
+ textTrimming: o.textTrimming,
36
36
  orientation: e,
37
37
  mobileLeftPadding: 0,
38
38
  mobileRightPadding: 0,
39
- cardsInRow: r.cardsInRow,
40
- unresponsive: r.unresponsive,
39
+ cardsInRow: o.cardsInRow,
40
+ unresponsive: o.unresponsive,
41
41
  priceBeforeTextValue: "",
42
42
  priceAfterTextValue: "",
43
43
  discountBeforeTextValue: "",
44
44
  discountAfterTextValue: ""
45
45
  };
46
46
  },
47
- buildCampaignUrl: (a, s) => {
47
+ buildCampaignUrl: (i, c) => {
48
48
  var m;
49
- const c = l(), n = P(), r = Number(a);
49
+ const s = l(), n = P(), o = Number(i);
50
50
  let e;
51
- if (s)
52
- e = s;
51
+ if (c)
52
+ e = c;
53
53
  else {
54
- const i = c.blockStates[r];
55
- if (!i)
54
+ const a = s.blockStates[o];
55
+ if (!a)
56
56
  return "";
57
- const { recommendationConfigs: o } = i;
57
+ const { recommendationConfigs: r } = a;
58
58
  e = {
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
59
+ strategy: r.strategy,
60
+ strategyId: r.strategyId,
61
+ language: r.language,
62
+ currencyCode: r.currencySettings.value,
63
+ size: r.size,
64
+ productIds: r.productIds,
65
+ filters: r.filters,
66
+ shuffleProducts: r.shuffleProducts
66
67
  };
67
68
  }
68
- const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
69
+ if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
70
+ return s.recommendationCampaignUrls[i] = {
71
+ strategyId: e.strategyId,
72
+ locale: e.language,
73
+ currency: e.currencyCode
74
+ }, "";
75
+ const g = ((m = y().find((a) => a.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
69
76
  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;
77
+ const f = e.filters.filter((a) => a.isValid), d = b(f);
78
+ d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(n.partnerName, e.strategy)).forEach(([a, r]) => t.set(a, r));
79
+ const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${g}?${p}`;
80
+ return s.recommendationCampaignUrls[i] = u, u;
74
81
  }
75
82
  });
76
83
  export {
@@ -1,7 +1,7 @@
1
1
  const e = "Items", o = "Default", t = "Custom", s = {
2
2
  "Global Styles & Layout": "Global Styles and Layout",
3
3
  "Structures & Modules": "Structures and Modules",
4
- "Recommendation Block": "Recommendation",
4
+ "Recommendation Block": "Recommendation Block",
5
5
  Items: e,
6
6
  "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.": "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.",
7
7
  "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
@@ -1,10 +1,10 @@
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";
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";
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 I(t) {
7
+ function _(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 I(t) {
14
14
  }
15
15
  return i.decimalCount;
16
16
  }
17
- function _(t) {
17
+ function I(t) {
18
18
  return t === "." || t === "," || t === " " || t === "" ? t : ",";
19
19
  }
20
- function N(t) {
20
+ function A(t) {
21
21
  return t === "." || t === "," || t === " " ? t : ".";
22
22
  }
23
- function A(t) {
23
+ function L(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 A(t) {
28
28
  code: n,
29
29
  symbol: r,
30
30
  alignment: c(o.alignment),
31
- decimalCount: I(o.decimalCount),
32
- decimalSeparator: N(o.decimalSeparator),
33
- thousandSeparator: _(o.thousandSeparator)
31
+ decimalCount: _(o.decimalCount),
32
+ decimalSeparator: A(o.decimalSeparator),
33
+ thousandSeparator: I(o.thousandSeparator)
34
34
  };
35
35
  }
36
- function L(t) {
36
+ function N(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 U(t, o, n) {
42
+ function O(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 U(t, o, n) {
48
48
  size: String(u),
49
49
  shuffleProducts: !!t.shuffleProducts,
50
50
  language: t.language ?? "en_US",
51
- currency: A(t.currencySettings),
51
+ currency: L(t.currencySettings),
52
52
  filters: (t.filters ?? []).map((e) => ({ ...e })),
53
- layout: L(t.orientation ?? o.orientation),
53
+ layout: N(t.orientation ?? o.orientation),
54
54
  cardsInRow: r,
55
55
  mobileCardsInRow: a,
56
56
  mobileLayoutEnabled: !1,
57
57
  previousMobileCardsInRow: a,
58
- columnSpacing: S,
59
- rowSpacing: f,
58
+ columnSpacing: f,
59
+ rowSpacing: S,
60
60
  mobileColumnSpacing: d,
61
61
  mobileRowSpacing: p,
62
62
  omnibusPrice: { textBefore: "", textAfter: "" },
@@ -70,6 +70,6 @@ function U(t, o, n) {
70
70
  };
71
71
  }
72
72
  export {
73
- A as mapCurrency,
74
- U as mapSettings
73
+ L as mapCurrency,
74
+ O as mapSettings
75
75
  };
@@ -1,7 +1,7 @@
1
1
  import { BlockId as f } from "../../enums/block.js";
2
2
  import { DEFAULT_NODE_CONFIG as b } from "../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
3
- import { ATTR_RECOMMENDATION_TITLE as T } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
4
- import { useTemplateStore as y } from "../../stores/template.js";
3
+ import { ATTR_RECOMMENDATION_TITLE as y } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
4
+ import { useTemplateStore as T } from "../../stores/template.js";
5
5
  import { mapComposition as v } from "./recommendation/compositionMapper.js";
6
6
  import { extractCurrencyFromBlock as C, extractTitleText as M, hasVisibleTitle as R, extractCardBgColor as S, isPartnerManagedBlock as h } from "./recommendation/extractors.js";
7
7
  import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
@@ -23,9 +23,10 @@ function B(n, t, a) {
23
23
  const i = a[String(o)] ?? {
24
24
  currencySettings: C(t)
25
25
  }, c = A(i, r, o), e = v((l = r.composition) == null ? void 0 : l.variables), d = M(t);
26
- e.titleVariable || (e.visibility[T] = R(t));
26
+ e.titleVariable || (e.visibility[y] = R(t));
27
27
  const p = S(t), g = {
28
28
  ...c,
29
+ strategyId: "",
29
30
  composition: e.composition,
30
31
  visibility: e.visibility,
31
32
  previousTitleHtml: b.previousTitleHtml,
@@ -61,7 +62,7 @@ function B(n, t, a) {
61
62
  function G(n, t = {}) {
62
63
  const a = new DOMParser(), o = a.parseFromString(n, "text/html"), r = Array.from(o.querySelectorAll(H));
63
64
  try {
64
- y().$patch((e) => {
65
+ T().$patch((e) => {
65
66
  e.migrations = {
66
67
  ...e.migrations,
67
68
  [f.Recommendation]: r.length
@@ -1,7 +1,8 @@
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`
4
+ AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
5
+ EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
5
6
  };
6
7
  export {
7
8
  o as ACADEMY_LINKS
@@ -1,5 +1,7 @@
1
- const t = "tr-TR", L = "default";
1
+ const T = "tr-TR", t = "tr-TR", E = "default", L = "UTC";
2
2
  export {
3
- L as DEFAULT,
4
- t as DEFAULT_LOCALE
3
+ E as DEFAULT,
4
+ T as DEFAULT_LOCALE,
5
+ L as DEFAULT_TZ,
6
+ t as DOTTED_DATE_LOCALE
5
7
  };
@@ -2,7 +2,10 @@ 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"
5
+ PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
+ RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
7
+ RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies",
8
+ NEWSLETTER_RECOMMENDATIONS_PATH: "/newsletter/recommendations"
6
9
  }, c = {
7
10
  CLIENT_ID: "clientId"
8
11
  }, d = () => {