@useinsider/guido 3.17.0-beta.3e9d6e7 → 3.17.0-beta.556d784

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 (127) hide show
  1. package/README.md +5 -5
  2. package/dist/@types/config/schemas.js +0 -5
  3. package/dist/components/Guido.vue.js +9 -9
  4. package/dist/components/Guido.vue2.js +78 -74
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +14 -11
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -37
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  11. package/dist/composables/useCustomInterfaceAppearance.js +50 -39
  12. package/dist/composables/useRecommendation.js +24 -24
  13. package/dist/composables/useStripo.js +14 -14
  14. package/dist/config/i18n/en/labels.json.js +1 -1
  15. package/dist/config/migrator/index.js +9 -8
  16. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  17. package/dist/config/migrator/recommendation/extractors.js +29 -24
  18. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  19. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  20. package/dist/config/migrator/recommendationMigrator.js +30 -26
  21. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  22. package/dist/enums/academy.js +2 -1
  23. package/dist/enums/date.js +5 -4
  24. package/dist/enums/extensions/recommendationBlock.js +24 -24
  25. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  26. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  27. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  28. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
  29. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  31. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +239 -206
  32. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +37 -45
  33. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  34. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  35. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  36. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  37. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  38. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +111 -161
  39. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  40. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  41. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  42. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  43. package/dist/guido.css +1 -1
  44. package/dist/services/recommendationApi.js +43 -53
  45. package/dist/src/@types/config/schemas.d.ts +0 -10
  46. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  47. package/dist/src/components/organisms/extensions/recommendation/{StrategyInfoBox.vue.d.ts → StrategyInfoBoxContent.vue.d.ts} +0 -9
  48. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  49. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  50. package/dist/src/enums/academy.d.ts +1 -0
  51. package/dist/src/enums/date.d.ts +1 -0
  52. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  53. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  54. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  55. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  56. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  57. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  60. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +41 -14
  61. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -22
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  63. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  64. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  65. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +27 -61
  66. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  67. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -5
  68. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  69. package/dist/src/mock/api/recommendation-strategies.d.ts +0 -41
  70. package/dist/src/services/recommendationApi.d.ts +1 -1
  71. package/dist/src/stores/save-as-template.d.ts +4 -3
  72. package/dist/src/utils/genericUtil.d.ts +5 -0
  73. package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
  74. package/dist/static/assets/icons/line-change.svg.js +5 -0
  75. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  76. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  77. package/dist/static/styles/components/recommendation-strategy.css.js +28 -44
  78. package/dist/static/styles/customEditorStyle.css.js +3 -1
  79. package/dist/utils/genericUtil.js +59 -55
  80. package/dist/utils/liquidDynamicContent.js +15 -0
  81. package/dist/utils/templatePreparation.js +0 -2
  82. package/package.json +3 -3
  83. package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +0 -20
  84. package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +0 -55
  85. package/dist/node_modules/@useinsider/design-system-organisms/dist/index-Dc9AygoZ.js +0 -526
  86. package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +0 -9345
  87. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +0 -174
  88. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +0 -381
  89. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +0 -236
  90. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +0 -70
  91. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +0 -350
  92. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +0 -371
  93. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +0 -152
  94. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +0 -141
  95. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +0 -1047
  96. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +0 -96050
  97. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +0 -2042
  98. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +0 -166
  99. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +0 -1098
  100. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +0 -55
  101. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +0 -265
  102. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +0 -184
  103. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +0 -50
  104. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +0 -453
  105. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +0 -145
  106. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +0 -176
  107. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +0 -266
  108. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +0 -114
  109. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +0 -200
  110. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +0 -451
  111. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +0 -49
  112. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +0 -119
  113. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +0 -4309
  114. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +0 -129
  115. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +0 -503
  116. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +0 -253
  117. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +0 -107
  118. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +0 -134
  119. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +0 -464
  120. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +0 -28
  121. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +0 -23
  122. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +0 -29
  123. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +0 -109
  124. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +0 -2339
  125. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +0 -16
  126. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +0 -17
  127. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +0 -188
@@ -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,56 +1,67 @@
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 C from "../static/styles/components/combobox.css.js";
8
- import s 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/recommendation-strategy.css.js";
14
- import l from "../static/styles/components/switcher.css.js";
15
- import h from "../static/styles/components/tabs.css.js";
16
- import w from "../static/styles/components/tools.css.js";
17
- import y from "../static/styles/components/version-history.css.js";
18
- import B from "../static/styles/components/wide-panel.css.js";
19
- import b from "../static/styles/variables.css.js";
20
- const A = [
21
- b,
22
- // Must be on top
23
- S,
1
+ import S from "../static/assets/icons/line-change.svg.js";
2
+ import i from "../static/assets/icons/line-delete.svg.js";
3
+ import n from "../static/assets/icons/line-plus.svg.js";
4
+ import p from "../static/styles/base.css.js";
5
+ import s from "../static/styles/components/alert-message.css.js";
6
+ import C from "../static/styles/components/amp-block.css.js";
7
+ import a from "../static/styles/components/base-input.css.js";
8
+ import f from "../static/styles/components/button-group.css.js";
9
+ import c from "../static/styles/components/button.css.js";
10
+ import u from "../static/styles/components/combobox.css.js";
11
+ import l from "../static/styles/components/counter.css.js";
12
+ import d from "../static/styles/components/dropdown-menu.css.js";
13
+ import h from "../static/styles/components/loader.css.js";
14
+ import g from "../static/styles/components/narrow-panel.css.js";
15
+ import I from "../static/styles/components/popup.css.js";
16
+ import w from "../static/styles/components/recommendation-strategy.css.js";
17
+ import y from "../static/styles/components/switcher.css.js";
18
+ import b from "../static/styles/components/tabs.css.js";
19
+ import B from "../static/styles/components/tools.css.js";
20
+ import $ from "../static/styles/components/version-history.css.js";
21
+ import P from "../static/styles/components/wide-panel.css.js";
22
+ import x from "../static/styles/variables.css.js";
23
+ function r(t, o) {
24
+ return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
25
+ }
26
+ const A = `:host {
27
+ ${r("line-change", S)}
28
+ ${r("line-delete", i)}
29
+ ${r("line-plus", n)}
30
+ }`, R = [
31
+ x,
24
32
  // Must be on top
25
- m,
26
- e,
27
- i,
33
+ A,
28
34
  p,
29
- n,
30
- C,
35
+ // Must be on top
31
36
  s,
32
- f,
37
+ C,
33
38
  a,
34
- u,
39
+ f,
35
40
  c,
41
+ u,
36
42
  l,
43
+ d,
37
44
  h,
38
- w,
45
+ g,
46
+ I,
39
47
  y,
48
+ b,
40
49
  B,
41
- d
50
+ $,
51
+ P,
52
+ w
42
53
  // Last: overrides button.css / wide-panel.css defaults
43
54
  ].join(`
44
55
 
45
- `), F = () => ({ importCss: () => {
56
+ `), Y = () => ({ importCss: () => {
46
57
  const o = new CSSStyleSheet();
47
- o.replaceSync(A);
48
- const r = document.querySelector("ui-editor");
49
- if (!r)
58
+ o.replaceSync(R);
59
+ const e = document.querySelector("ui-editor");
60
+ if (!e)
50
61
  return;
51
- const t = r.shadowRoot;
52
- t && (t.adoptedStyleSheets = [o]);
62
+ const m = e.shadowRoot;
63
+ m && (m.adoptedStyleSheets = [o]);
53
64
  } });
54
65
  export {
55
- F as useCustomInterfaceAppearance
66
+ Y as useCustomInterfaceAppearance
56
67
  };
@@ -7,17 +7,17 @@ import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/uti
7
7
  import { useConfigStore as P } from "../stores/config.js";
8
8
  const B = () => ({
9
9
  calculateCardWidth: ({
10
- mobileLeftPadding: a,
10
+ mobileLeftPadding: i,
11
11
  mobileRightPadding: c,
12
12
  cardsInRow: s,
13
- unresponsive: o
13
+ unresponsive: n
14
14
  }) => {
15
- const n = o ? s : 1, e = a + c + (n - 1) * R;
16
- return (C - e) / n;
15
+ const o = n ? s : 1, e = i + c + (o - 1) * R;
16
+ return (C - e) / o;
17
17
  },
18
- getRecommendationCampaignData: (a) => {
19
- const c = l(), s = Number(a), o = c.blockStates[s];
20
- if (!o)
18
+ getRecommendationCampaignData: (i) => {
19
+ const c = l(), s = Number(i), n = c.blockStates[s];
20
+ if (!n)
21
21
  return {
22
22
  textTrimming: !1,
23
23
  orientation: "vertical",
@@ -30,31 +30,31 @@ const B = () => ({
30
30
  discountBeforeTextValue: "",
31
31
  discountAfterTextValue: ""
32
32
  };
33
- const { recommendationConfigs: n } = o, e = n.orientation === "grid" ? "vertical" : "horizontal";
33
+ const { recommendationConfigs: o } = n, e = o.orientation === "grid" ? "vertical" : "horizontal";
34
34
  return {
35
- textTrimming: n.textTrimming,
35
+ textTrimming: o.textTrimming,
36
36
  orientation: e,
37
37
  mobileLeftPadding: 0,
38
38
  mobileRightPadding: 0,
39
- cardsInRow: n.cardsInRow,
40
- unresponsive: n.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, c) => {
47
+ buildCampaignUrl: (i, c) => {
48
48
  var m;
49
- const s = l(), o = P(), n = Number(a);
49
+ const s = l(), n = P(), o = Number(i);
50
50
  let e;
51
51
  if (c)
52
52
  e = c;
53
53
  else {
54
- const i = s.blockStates[n];
55
- if (!i)
54
+ const a = s.blockStates[o];
55
+ if (!a)
56
56
  return "";
57
- const { recommendationConfigs: r } = i;
57
+ const { recommendationConfigs: r } = a;
58
58
  e = {
59
59
  strategy: r.strategy,
60
60
  strategyId: r.strategyId,
@@ -66,18 +66,18 @@ const B = () => ({
66
66
  shuffleProducts: r.shuffleProducts
67
67
  };
68
68
  }
69
- if (e.strategyId)
70
- return s.recommendationCampaignUrls[a] = {
69
+ if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
70
+ return s.recommendationCampaignUrls[i] = {
71
71
  strategyId: e.strategyId,
72
72
  locale: e.language,
73
73
  currency: e.currencyCode
74
74
  }, "";
75
- const f = ((m = y().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
76
- 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", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
77
- const g = e.filters.filter((i) => i.isValid), d = b(g);
78
- d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(o.partnerName, e.strategy)).forEach(([i, r]) => t.set(i, r));
79
- const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
80
- return s.recommendationCampaignUrls[a] = u, u;
75
+ const g = ((m = y().find((a) => a.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
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}");
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;
81
81
  }
82
82
  });
83
83
  export {
@@ -17,13 +17,13 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
17
17
  import Z from "../package.json.js";
18
18
  let n = null;
19
19
  const Ce = () => {
20
- const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: M, getCustomFonts: T, getSyncModulesStatus: v } = K(), { handleEvent: B } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
21
- var l;
20
+ const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
21
+ var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  i();
24
24
  return;
25
25
  }
26
- const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, e = document.createElement("script");
26
+ const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
27
  e.id = "UiEditorScript", e.type = "module", e.src = r, e.onload = () => i(), e.onerror = () => {
28
28
  e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
29
29
  }, document.body.appendChild(e);
@@ -31,12 +31,12 @@ const Ce = () => {
31
31
  n = null;
32
32
  }), n), _ = async (i, s, o, a = [], r = !1) => {
33
33
  var y, E, h, C;
34
- const e = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
34
+ const e = b(), { html: d, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1);
35
35
  await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
38
38
  metadata: s,
39
- html: l,
39
+ html: d,
40
40
  css: D,
41
41
  forceRecreate: U,
42
42
  locale: "en",
@@ -80,16 +80,16 @@ const Ce = () => {
80
80
  ],
81
81
  async onTokenRefreshRequest(t) {
82
82
  try {
83
- const d = await M();
84
- t(d);
85
- } catch (d) {
86
- p(d, "Failed to refresh token");
83
+ const l = await B();
84
+ t(l);
85
+ } catch (l) {
86
+ p(l, "Failed to refresh token");
87
87
  }
88
88
  },
89
89
  onTemplateLoaded() {
90
90
  try {
91
- const { importCss: t } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
92
- t(), d(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
91
+ const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
92
+ t(), l(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
93
93
  e.hasChanges = !1;
94
94
  }, 1e3);
95
95
  } catch (t) {
@@ -108,7 +108,7 @@ const Ce = () => {
108
108
  onDataChanged() {
109
109
  e.hasChanges = !0;
110
110
  },
111
- onEvent: B,
111
+ onEvent: v,
112
112
  onModuleAdd: F,
113
113
  notifications: V(),
114
114
  ignoreClickOutsideSelectors: [
@@ -126,8 +126,8 @@ const Ce = () => {
126
126
  try {
127
127
  await f();
128
128
  const [r, e] = await Promise.all([
129
- T(),
130
- v()
129
+ M(),
130
+ T()
131
131
  ]);
132
132
  a.syncModulesEnabled = e, await _(i, s, o, r, e);
133
133
  } catch {
@@ -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.",
@@ -2,14 +2,15 @@ import { migrateCheckbox as t } from "./checkboxMigrator.js";
2
2
  import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
3
3
  import { migrateItemsBlock as e } from "./itemsBlockMigrator.js";
4
4
  import { migrateProductNameLink as a } from "./productNameLinkMigrator.js";
5
- import { migrateRadioButton as c } from "./radioButtonMigrator.js";
6
- import { migrateRecommendation as g } from "./recommendationMigrator.js";
7
- import { migrateSocialIcons as n } from "./socialIconMigrator.js";
8
- import { migrateUnsubscribe as p } from "./unsubscribeMigrator.js";
9
- const x = async (r, o = {}) => {
10
- let m = r;
11
- return m = t(m), m = c(m), m = await p(m), m = i(m), m = g(m, o), m = e(m), m = a(m), m = n(m), m;
5
+ import { migrateRadioButton as n } from "./radioButtonMigrator.js";
6
+ import { migrateRecommendation as c } from "./recommendationMigrator.js";
7
+ import { migrateRecommendationTitle as g } from "./recommendationTitleMigrator.js";
8
+ import { migrateSocialIcons as p } from "./socialIconMigrator.js";
9
+ import { migrateUnsubscribe as f } from "./unsubscribeMigrator.js";
10
+ const C = async (o, r = {}) => {
11
+ let m = o;
12
+ return m = t(m), m = n(m), m = await f(m), m = i(m), m = c(m, r), m = g(m), m = e(m), m = a(m), m = p(m), m;
12
13
  };
13
14
  export {
14
- x as migrate
15
+ C as migrate
15
16
  };
@@ -1,34 +1,34 @@
1
1
  import { DEFAULT_COMPOSITION as p, DEFAULT_VISIBILITY as I } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
- import { ATTR_CUSTOM_PREFIX as l, ATTR_PRODUCT_BUTTON as k, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as R, ATTR_PRODUCT_NAME as h, ATTR_PRODUCT_IMAGE as y } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
- import { mapTextTheme as E, mapButtonTheme as O, mapImageTheme as b } from "./themeMapper.js";
4
- const C = "__title__", a = "product_attribute.";
5
- function N(r) {
2
+ import { ATTR_RECOMMENDATION_TITLE as l, ATTR_CUSTOM_PREFIX as k, ATTR_PRODUCT_BUTTON as A, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as h, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as O } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
+ import { mapTextTheme as b, mapButtonTheme as y, mapImageTheme as N } from "./themeMapper.js";
4
+ const C = "__title__", T = "product_attribute.";
5
+ function P(r) {
6
6
  const t = r.variable ?? "";
7
7
  switch (t) {
8
8
  case "p_recommendation_title":
9
9
  return { key: C, kind: "title" };
10
10
  case "p_image":
11
- return { key: y, kind: "image" };
11
+ return { key: O, kind: "image" };
12
12
  case "p_name":
13
- return { key: h, kind: "text" };
13
+ return { key: E, kind: "text" };
14
14
  case "p_price":
15
- return { key: R, kind: "text" };
15
+ return { key: h, kind: "text" };
16
16
  case "p_original_price":
17
17
  return { key: f, kind: "text" };
18
18
  case "p_omnibus_price":
19
19
  return { key: x, kind: "text" };
20
20
  case "p_omnibus_discount":
21
- return { key: A, kind: "text" };
21
+ return { key: R, kind: "text" };
22
22
  case "p_button":
23
- return { key: k, kind: "button" };
23
+ return { key: A, kind: "button" };
24
24
  default:
25
25
  if (r.variableType === "p_attribute" || t.startsWith("p_attribute_")) {
26
- const o = r.value ?? "", s = o.startsWith(a) ? o.slice(a.length) : o;
26
+ const o = r.value ?? "", s = o.startsWith(T) ? o.slice(T.length) : o;
27
27
  if (!s)
28
28
  return null;
29
- const e = o || `${a}${s}`;
29
+ const e = o || `${T}${s}`;
30
30
  return {
31
- key: `${l}${e}`,
31
+ key: `${k}${e}`,
32
32
  kind: "custom",
33
33
  customAttrName: s,
34
34
  customAttrValue: e
@@ -41,7 +41,7 @@ function _(r) {
41
41
  const t = p.indexOf(r);
42
42
  return t === -1 ? Number.POSITIVE_INFINITY : t;
43
43
  }
44
- function S(r) {
44
+ function V(r) {
45
45
  const t = {
46
46
  composition: [],
47
47
  visibility: { ...I },
@@ -54,10 +54,10 @@ function S(r) {
54
54
  return t.composition = [...p], t;
55
55
  const o = [];
56
56
  r.forEach((e, i) => {
57
- const n = N(e);
57
+ const n = P(e);
58
58
  if (n) {
59
59
  if (n.kind === "title") {
60
- t.titleVariable = e;
60
+ t.titleVariable = e, t.visibility[l] = e.hidden !== !0;
61
61
  return;
62
62
  }
63
63
  o.push({
@@ -82,20 +82,20 @@ function S(r) {
82
82
  const { key: i, kind: n, hidden: u, legacy: c, customAttrName: d, customAttrValue: m } = e;
83
83
  switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" && d && m && (t.customAttributes.includes(m) || t.customAttributes.push(m), t.customAttrValues[i] = m), n) {
84
84
  case "image":
85
- s[i] = b(c.theme);
85
+ s[i] = N(c.theme);
86
86
  break;
87
87
  case "button":
88
- s[i] = O(c.theme);
88
+ s[i] = y(c.theme);
89
89
  break;
90
90
  case "text":
91
91
  case "custom": {
92
- const T = E(c.theme);
93
- s[i] = T, T.textTrimming && (t.anyTextTrimming = !0);
92
+ const a = b(c.theme);
93
+ s[i] = a, a.textTrimming && (t.anyTextTrimming = !0);
94
94
  break;
95
95
  }
96
96
  }
97
97
  }), t.perElementStyles = s, t;
98
98
  }
99
99
  export {
100
- S as mapComposition
100
+ V as mapComposition
101
101
  };
@@ -1,49 +1,54 @@
1
1
  import { CURRENCY_ATTR as n, CSS_CLASS_SKIP_COMPILE as c } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
2
2
  const a = "You May Also Like!";
3
- function l(t) {
4
- var o;
5
- const r = t.querySelector(".ext-recommendation-title");
6
- if (!r)
3
+ function A(t) {
4
+ var i;
5
+ const e = t.querySelector(".ext-recommendation-title");
6
+ if (!e)
7
7
  return a;
8
- const e = (o = r.textContent) == null ? void 0 : o.trim();
9
- return e && e.length > 0 ? e : a;
8
+ const r = (i = e.textContent) == null ? void 0 : i.trim();
9
+ return r && r.length > 0 ? r : a;
10
10
  }
11
11
  function m(t) {
12
- const r = [
12
+ const e = t.querySelector(".ext-recommendation-title");
13
+ return e ? !/display\s*:\s*none/i.test(e.getAttribute("style") ?? "") : !1;
14
+ }
15
+ function d(t) {
16
+ const e = [
13
17
  t,
14
18
  ...Array.from(t.querySelectorAll(".product-card, .ext-recommendation-card"))
15
19
  ];
16
- let e = "";
17
- return r.some((o) => {
18
- const i = o.getAttribute("bgcolor");
19
- if (i && i.trim())
20
- return e = i.trim(), !0;
21
- const u = (o.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
22
- return u && u[1] ? (e = u[1].trim(), !0) : !1;
23
- }), e;
20
+ let r = "";
21
+ return e.some((i) => {
22
+ const o = i.getAttribute("bgcolor");
23
+ if (o && o.trim())
24
+ return r = o.trim(), !0;
25
+ const u = (i.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
26
+ return u && u[1] ? (r = u[1].trim(), !0) : !1;
27
+ }), r;
24
28
  }
25
29
  function C(t) {
26
- const r = t.getAttribute(n.CURRENCY);
27
- if (!r)
30
+ const e = t.getAttribute(n.CURRENCY);
31
+ if (!e)
28
32
  return;
29
- const e = t.getAttribute(n.SYMBOL);
33
+ const r = t.getAttribute(n.SYMBOL);
30
34
  return {
31
- value: r,
35
+ value: e,
32
36
  // An empty `currency-symbol` is omitted so `mapCurrency` falls back to
33
37
  // the currency code as the symbol.
34
- ...e ? { symbol: e } : {},
38
+ ...r ? { symbol: r } : {},
35
39
  alignment: t.getAttribute(n.ALIGNMENT) ?? "",
36
40
  decimalCount: t.getAttribute(n.DECIMAL_COUNT) ?? "",
37
41
  decimalSeparator: t.getAttribute(n.DECIMAL_SEPARATOR) ?? "",
38
42
  thousandSeparator: t.getAttribute(n.THOUSAND_SEPARATOR) ?? ""
39
43
  };
40
44
  }
41
- function d(t) {
45
+ function g(t) {
42
46
  return t.classList.contains(c);
43
47
  }
44
48
  export {
45
- m as extractCardBgColor,
49
+ d as extractCardBgColor,
46
50
  C as extractCurrencyFromBlock,
47
- l as extractTitleText,
48
- d as isPartnerManagedBlock
51
+ A as extractTitleText,
52
+ m as hasVisibleTitle,
53
+ g as isPartnerManagedBlock
49
54
  };