@useinsider/guido 3.17.0-beta.dc7f4d2 → 3.17.0-beta.e23d5cd

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 (88) hide show
  1. package/README.md +6 -5
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +96 -94
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  10. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  11. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  12. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  13. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
  14. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  15. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  16. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  17. package/dist/composables/useHtmlCompiler.js +26 -37
  18. package/dist/composables/useHtmlValidator.js +0 -2
  19. package/dist/composables/useRecommendation.js +41 -34
  20. package/dist/composables/useSave.js +41 -84
  21. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  22. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  23. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  24. package/dist/config/migrator/recommendationMigrator.js +5 -4
  25. package/dist/enums/academy.js +2 -1
  26. package/dist/enums/date.js +5 -3
  27. package/dist/enums/extensions/recommendationBlock.js +3 -1
  28. package/dist/extensions/Blocks/Recommendation/block.js +26 -21
  29. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
  31. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +238 -185
  32. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  33. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -86
  35. package/dist/extensions/Blocks/common-control.js +22 -19
  36. package/dist/guido.css +1 -1
  37. package/dist/services/recommendationApi.js +69 -30
  38. package/dist/src/@types/config/schemas.d.ts +2 -0
  39. package/dist/src/components/Guido.vue.d.ts +1 -17
  40. package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → extensions/recommendation/AssignStrategyDrawer.vue.d.ts} +1 -0
  41. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  42. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  43. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  44. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  45. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  46. package/dist/src/composables/useConfig.d.ts +2 -0
  47. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  48. package/dist/src/composables/useRecommendation.d.ts +1 -0
  49. package/dist/src/composables/useSave.d.ts +1 -6
  50. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  51. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  52. package/dist/src/enums/academy.d.ts +1 -0
  53. package/dist/src/enums/date.d.ts +1 -0
  54. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  55. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
  56. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  59. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  60. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -15
  61. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
  62. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  63. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  64. package/dist/src/services/recommendationApi.d.ts +4 -1
  65. package/dist/src/stores/config.d.ts +18 -5
  66. package/dist/src/stores/save-as-template.d.ts +4 -3
  67. package/dist/src/utils/genericUtil.d.ts +5 -0
  68. package/dist/src/utils/templatePreparation.d.ts +0 -30
  69. package/dist/static/assets/icons/line-change.svg.js +5 -0
  70. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  71. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  72. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  73. package/dist/stores/config.js +6 -13
  74. package/dist/utils/dateUtil.js +23 -10
  75. package/dist/utils/genericUtil.js +28 -27
  76. package/dist/utils/templatePreparation.js +48 -50
  77. package/package.json +3 -2
  78. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  79. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  80. package/dist/composables/useSaveValidation.js +0 -279
  81. package/dist/composables/useSaveValidationRollout.js +0 -9
  82. package/dist/enums/save-validation.js +0 -4
  83. package/dist/src/@types/save-validation.d.ts +0 -19
  84. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  85. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  86. package/dist/src/enums/save-validation.d.ts +0 -27
  87. package/dist/src/stores/save-validation.d.ts +0 -22
  88. package/dist/stores/save-validation.js +0 -30
@@ -1,94 +1,51 @@
1
- import { useActionsApi as h } from "./useActionsApi.js";
2
- import { useConfig as L } from "./useConfig.js";
3
- import { useSaveStart as A, useSaveComplete as q } from "./useGuidoActions.js";
4
- import { useSaveValidation as M } from "./useSaveValidation.js";
5
- import { useSaveValidationRollout as R } from "./useSaveValidationRollout.js";
6
- import { useSyncModuleExtractor as O } from "./useSyncModuleExtractor.js";
7
- import { ToasterTypeOptions as W } from "../enums/toaster.js";
1
+ import { useActionsApi as T } from "./useActionsApi.js";
2
+ import { useConfig as k } from "./useConfig.js";
3
+ import { useSaveStart as B, useSaveComplete as E } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
5
+ import { ToasterTypeOptions as C } from "../enums/toaster.js";
8
6
  import { useStripoApi as D } from "../services/stripoApi.js";
9
- import { useConfigStore as F } from "../stores/config.js";
10
- import { useDynamicContentStore as j } from "../stores/dynamic-content.js";
11
- import { useSaveValidationStore as z } from "../stores/save-validation.js";
12
- import { useTemplatePreparation as G, getHtmlReferencedUnsubscribePages as I } from "../utils/templatePreparation.js";
13
- import { useAllowlist as J } from "./useAllowlist.js";
14
- import { useHtmlValidator as K } from "./useHtmlValidator.js";
15
- import { useToaster as N } from "./useToaster.js";
16
- import { useCouponBlockValidator as Q } from "./validators/useCouponBlockValidator.js";
17
- import { useLiquidValidator as X } from "./validators/useLiquidValidator.js";
18
- import { useUnsubscribeBlockValidator as Y } from "./validators/useUnsubscribeBlockValidator.js";
19
- const bt = () => {
20
- const n = A(), d = q(), { validateHtml: u } = K(), { validateLiquidSyntax: f } = X(), { validateCouponBlockTags: p } = Q(), { validateUnsubscribeBlockUniqueness: v, validateUnsubscribeBlockHasTemplate: y } = Y(), { callbacks: a, isFeatureEnabled: c } = L(), { extractSyncModuleData: S } = O(), { setSyncModuleUnsubscriptionPages: b } = D(), { editorSave: g, getTemplateData: w } = h(), { showToaster: H } = N(), { getBlockedDomains: V, resolveToast: C } = J(), { prepareTemplateDetails: m } = G(), { collectSaveValidationErrors: E } = M(), { isEnabled: x } = R(), k = z(), T = j(), B = F(), r = async (t, e, o) => {
21
- if (!c("allowlistEnabled"))
22
- return !1;
23
- const i = await V(t, e);
24
- if (!i.length)
25
- return !1;
26
- if (!o) {
27
- const s = await C(i);
28
- s != null && s.message && H({
29
- type: W.Warning,
30
- message: s.message,
31
- actionButton: s.actionButton
32
- });
33
- }
34
- return !0;
35
- }, P = async (t) => !p(t.compiledHtml) || !v(t.compiledHtml) || !y(t.compiledHtml) ? !1 : c("liquidSyntax") ? f(t.compiledHtml) : u(t.compiledHtml, t.dynamicContentList, !0), l = async (t, e) => {
36
- if (!await g())
37
- return;
38
- const { unsubscribePayload: i, stripoModules: s } = S(t.rawHtml);
39
- if (await b(i), t.modules = s, !e.suppress) {
40
- const U = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
41
- d({ ...t, ...U, silent: e.silent });
42
- }
43
- return t;
44
- };
45
- return { save: async (t = !1, e = !1) => {
46
- var i;
7
+ import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
8
+ import { useAllowlist as P } from "./useAllowlist.js";
9
+ import { useHtmlValidator as U } from "./useHtmlValidator.js";
10
+ import { useToaster as A } from "./useToaster.js";
11
+ import { useCouponBlockValidator as M } from "./validators/useCouponBlockValidator.js";
12
+ import { useLiquidValidator as h } from "./validators/useLiquidValidator.js";
13
+ import { useUnsubscribeBlockValidator as F } from "./validators/useUnsubscribeBlockValidator.js";
14
+ const $ = () => {
15
+ const n = B(), l = E(), { validateHtml: c } = U(), { validateLiquidSyntax: d } = h(), { validateCouponBlockTags: m } = M(), { validateUnsubscribeBlockUniqueness: u, validateUnsubscribeBlockHasTemplate: p } = F(), { callbacks: e, isFeatureEnabled: a } = k(), { extractSyncModuleData: f } = q(), { setSyncModuleUnsubscriptionPages: v } = D(), { editorSave: S } = T(), { showToaster: b } = A(), { getBlockedDomains: w, resolveToast: V } = P();
16
+ return { save: async (y = !1, s = !1) => {
17
+ var r;
47
18
  n();
48
- const o = await m();
49
- if (x.value && !t && !e) {
50
- const s = await E(
51
- o.compiledHtml,
52
- o.dynamicContentList
53
- );
54
- if (s.length) {
55
- k.open(s, "save");
19
+ const { prepareTemplateDetails: H } = L(), t = await H();
20
+ if (!m(t.compiledHtml) || !u(t.compiledHtml) || !p(t.compiledHtml))
21
+ return;
22
+ if (a("liquidSyntax")) {
23
+ if (!await d(t.compiledHtml))
56
24
  return;
57
- }
58
- } else if (!await P(o))
25
+ } else if (!await c(t.compiledHtml, t.dynamicContentList, !0))
59
26
  return;
60
- if (!((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(o)) && !await r(o.compiledHtml, o.css, e))
61
- return l(o, { silent: e, suppress: t });
62
- }, saveWithErrors: async () => {
63
- var e;
64
- if (B.isTransactional)
27
+ if ((r = e.value) != null && r.externalValidation && !await e.value.externalValidation(t))
65
28
  return;
66
- n();
67
- const t = await m();
68
- if (!((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)) && !await r(t.compiledHtml, t.css, !1))
69
- return l(t, { silent: !1, blankCompiled: !0 });
70
- }, saveRawOnly: async () => {
71
- n();
72
- const { html: t, css: e } = await w();
73
- if (await r(t, e, !0))
74
- return;
75
- const o = I(t), i = {
76
- dynamicContentList: T.getSelectedDynamicContentList,
77
- compiledHtml: "",
78
- rawHtml: t,
79
- css: e,
80
- ampHtml: "",
81
- ampErrors: [],
82
- modules: [],
83
- recommendation: { campaignUrls: {}, configs: {} },
84
- unsubscribe: {
85
- status: o.length > 0,
86
- config: o
29
+ if (a("allowlistEnabled")) {
30
+ const i = await w(t.compiledHtml, t.css);
31
+ if (i.length) {
32
+ if (!s) {
33
+ const o = await V(i);
34
+ o != null && o.message && b({
35
+ type: C.Warning,
36
+ message: o.message,
37
+ actionButton: o.actionButton
38
+ });
39
+ }
40
+ return;
87
41
  }
88
- };
89
- return l(i, { silent: !0 });
42
+ }
43
+ if (!await S())
44
+ return;
45
+ const { unsubscribePayload: g, stripoModules: x } = f(t.rawHtml);
46
+ return await v(g), t.modules = x, y || l({ ...t, silent: s }), t;
90
47
  } };
91
48
  };
92
49
  export {
93
- bt as useSave
50
+ $ as useSave
94
51
  };
@@ -1,27 +1,24 @@
1
- import { ToasterTypeOptions as n } from "../../enums/toaster.js";
2
- import { COUPON_PLACEHOLDER_DEFAULT as s, COUPON_PLACEHOLDER_LIQUID as a } from "../../extensions/Blocks/CouponBlock/template.js";
3
- import { useToaster as i } from "../useToaster.js";
4
- import { useTranslations as l } from "../useTranslations.js";
5
- const c = /* @__PURE__ */ new Set([
6
- s,
7
- a
8
- ]), p = "newsletter.coupon-tag-modified";
9
- function u(r) {
10
- const e = new DOMParser().parseFromString(r, "text/html");
11
- return Array.from(e.querySelectorAll(".coupon-block")).map((o) => {
12
- var t;
13
- return ((t = o.textContent) == null ? void 0 : t.trim()) ?? "";
14
- }).filter((o) => !c.has(o));
15
- }
16
- const T = () => {
17
- const { showToaster: r } = i(), e = l();
18
- return { validateCouponBlockTags: (t) => u(t).length > 0 ? (r({
19
- type: n.Warning,
20
- message: e(p)
21
- }), !1) : !0 };
1
+ import { ToasterTypeOptions as c } from "../../enums/toaster.js";
2
+ import { COUPON_PLACEHOLDER_DEFAULT as i, COUPON_PLACEHOLDER_LIQUID as l } from "../../extensions/Blocks/CouponBlock/template.js";
3
+ import { useToaster as m } from "../useToaster.js";
4
+ import { useTranslations as p } from "../useTranslations.js";
5
+ const u = /* @__PURE__ */ new Set([
6
+ i,
7
+ l
8
+ ]), A = () => {
9
+ const { showToaster: t } = m(), r = p();
10
+ return { validateCouponBlockTags: (e) => {
11
+ const n = new DOMParser().parseFromString(e, "text/html");
12
+ return Array.from(n.querySelectorAll(".coupon-block")).find((s) => {
13
+ var o;
14
+ const a = ((o = s.textContent) == null ? void 0 : o.trim()) ?? "";
15
+ return !u.has(a);
16
+ }) ? (t({
17
+ type: c.Warning,
18
+ message: r("newsletter.coupon-tag-modified")
19
+ }), !1) : !0;
20
+ } };
22
21
  };
23
22
  export {
24
- p as COUPON_TAG_MODIFIED_KEY,
25
- u as findInvalidCouponBlocks,
26
- T as useCouponBlockValidator
23
+ A as useCouponBlockValidator
27
24
  };
@@ -1,8 +1,8 @@
1
- import { ToasterTypeOptions as c } from "../../enums/toaster.js";
1
+ import { ToasterTypeOptions as i } from "../../enums/toaster.js";
2
2
  import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
3
- import { UNSUBSCRIBE_BLOCK_SELECTOR as i, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
- import { useToaster as p } from "../useToaster.js";
5
- import { useTranslations as l } from "../useTranslations.js";
3
+ import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
+ import { useToaster as E } from "../useToaster.js";
5
+ import { useTranslations as m } from "../useTranslations.js";
6
6
  const T = [
7
7
  {
8
8
  pageType: u.GLOBAL_UNSUBSCRIBE,
@@ -12,37 +12,30 @@ const T = [
12
12
  pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
13
13
  messageKey: "unsubscription-preference.duplicate-pref-center"
14
14
  }
15
- ], g = "unsubscription-preference.duplicate-both", E = "unsubscription-preference.select-page-to-continue";
16
- function m(r) {
17
- const s = new DOMParser().parseFromString(r, "text/html"), t = /* @__PURE__ */ new Map();
18
- return s.querySelectorAll(i).forEach((n) => {
19
- const e = Number(n.getAttribute(a.PAGE_TYPE));
20
- t.set(e, (t.get(e) ?? 0) + 1);
21
- }), T.filter((n) => (t.get(n.pageType) ?? 0) > 1);
22
- }
23
- function b(r) {
24
- const s = new DOMParser().parseFromString(r, "text/html");
25
- return Array.from(s.querySelectorAll(i)).filter((t) => {
26
- const n = t.getAttribute(a.PAGE_TYPE), e = t.getAttribute(a.PAGE_LIST);
27
- return !n || !e;
28
- }).length;
29
- }
30
- const y = () => {
31
- const { showToaster: r } = p(), s = l();
32
- return { validateUnsubscribeBlockUniqueness: (e) => {
33
- const o = m(e);
34
- return o.length ? (r({
35
- type: c.Error,
36
- message: s(o.length > 1 ? g : o[0].messageKey)
15
+ ], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
16
+ const { showToaster: c } = E(), p = m();
17
+ return { validateUnsubscribeBlockUniqueness: (n) => {
18
+ const o = new DOMParser().parseFromString(n, "text/html"), r = /* @__PURE__ */ new Map();
19
+ o.querySelectorAll(l).forEach((e) => {
20
+ const s = Number(e.getAttribute(a.PAGE_TYPE));
21
+ r.set(s, (r.get(s) ?? 0) + 1);
22
+ });
23
+ const t = T.filter((e) => (r.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
24
+ return t.length ? (c({
25
+ type: i.Error,
26
+ message: p(t.length > 1 ? g : t[0])
37
27
  }), !1) : !0;
38
- }, validateUnsubscribeBlockHasTemplate: (e) => b(e) === 0 ? !0 : (r({
39
- type: c.Warning,
40
- message: s(E)
41
- }), !1) };
28
+ }, validateUnsubscribeBlockHasTemplate: (n) => {
29
+ const o = new DOMParser().parseFromString(n, "text/html");
30
+ return Array.from(o.querySelectorAll(l)).some((t) => {
31
+ const e = t.getAttribute(a.PAGE_TYPE), s = t.getAttribute(a.PAGE_LIST);
32
+ return !e || !s;
33
+ }) ? (c({
34
+ type: i.Warning,
35
+ message: p(b)
36
+ }), !1) : !0;
37
+ } };
42
38
  };
43
39
  export {
44
- E as EMPTY_BLOCK_KEY,
45
- b as countUnsubBlocksWithoutPage,
46
- m as findDuplicateUnsubPageTypes,
47
- y as useUnsubscribeBlockValidator
40
+ P as useUnsubscribeBlockValidator
48
41
  };
@@ -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,6 +1,6 @@
1
1
  import { BlockId as f } from "../../enums/block.js";
2
- import { useTemplateStore as b } from "../../stores/template.js";
3
- import { mapComposition as y } from "./recommendation/compositionMapper.js";
2
+ import { useTemplateStore as y } from "../../stores/template.js";
3
+ import { mapComposition as b } from "./recommendation/compositionMapper.js";
4
4
  import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
5
5
  import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
6
6
  import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
@@ -20,8 +20,9 @@ function B(i, t, a) {
20
20
  ), !1;
21
21
  const n = a[String(o)] ?? {
22
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 = {
23
+ }, c = T(n, r, o), e = b((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
24
24
  ...c,
25
+ strategyId: "",
25
26
  composition: e.composition,
26
27
  visibility: e.visibility,
27
28
  textTrimming: e.anyTextTrimming
@@ -56,7 +57,7 @@ function B(i, t, a) {
56
57
  function q(i, t = {}) {
57
58
  const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
58
59
  try {
59
- b().$patch((e) => {
60
+ y().$patch((e) => {
60
61
  e.migrations = {
61
62
  ...e.migrations,
62
63
  [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,9 @@ 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"
6
8
  }, c = {
7
9
  CLIENT_ID: "clientId"
8
10
  }, d = () => {
@@ -1,25 +1,27 @@
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";
5
- import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
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 y } from "../../../enums/block.js";
6
+ import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
6
7
  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";
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";
9
11
  import { RecommendationConfigService as s } from "./services/configService.js";
10
12
  import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
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";
13
+ import { getDefaultTemplate as M } from "./templates/grid/template.js";
14
+ import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
15
+ const _ = y.Recommendation, m = "recommendation-block-v2", u = "recommendation-id", I = "hide-price";
14
16
  let k = !1;
15
- class P extends b {
17
+ class K extends b {
16
18
  constructor() {
17
19
  super();
18
20
  /**
19
21
  * Stores the ID generated in getTemplate() so onCreated() can reuse it.
20
22
  * This avoids generating a new (different) ID in onCreated().
21
23
  */
22
- h(this, "_pendingBlockId", null);
24
+ p(this, "_pendingBlockId", null);
23
25
  }
24
26
  getId() {
25
27
  return _;
@@ -39,7 +41,7 @@ class P extends b {
39
41
  );
40
42
  }
41
43
  getSettingsPanelTitleHtml() {
42
- return y(
44
+ return C(
43
45
  _,
44
46
  this.api.translate("Recommendation Block"),
45
47
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
@@ -63,7 +65,7 @@ class P extends b {
63
65
  */
64
66
  getTemplate() {
65
67
  const t = this._generateNextId();
66
- return this._pendingBlockId = t, S(t);
68
+ return this._pendingBlockId = t, M(t);
67
69
  }
68
70
  /**
69
71
  * Called when a new block is dropped into the template
@@ -89,12 +91,15 @@ class P extends b {
89
91
  const { config: n, wasFreshDrop: o } = s.initializeConfig(
90
92
  this.api,
91
93
  t,
92
- { recommendationId: i }
94
+ {
95
+ recommendationId: i,
96
+ configVersion: D().isFeatureEnabled("reusableRecommendationStrategy") ? E : S
97
+ }
93
98
  ), r = d();
94
99
  if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
95
- p(this.api);
100
+ h(this.api);
96
101
  const l = this._getBlockElement(t);
97
- l && (f(this.api, l, !0), C({
102
+ l && (f(this.api, l, !0), N({
98
103
  currentNode: t,
99
104
  documentModifier: this.api.getDocumentModifier()
100
105
  }));
@@ -121,11 +126,11 @@ class P extends b {
121
126
  }
122
127
  this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
123
128
  try {
124
- k || (p(this.api), k = !0);
129
+ k || (h(this.api), k = !0);
125
130
  const e = s.getConfig(t), i = this._getBlockElement(t);
126
131
  if (i) {
127
132
  const n = !e.mobileLayoutEnabled;
128
- E(i) !== n && f(this.api, i, n);
133
+ O(i) !== n && f(this.api, i, n);
129
134
  }
130
135
  } catch {
131
136
  }
@@ -155,7 +160,7 @@ class P extends b {
155
160
  */
156
161
  _warnIfMultipleBlocks() {
157
162
  try {
158
- M().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
163
+ w().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
159
164
  } catch {
160
165
  }
161
166
  }
@@ -333,5 +338,5 @@ class P extends b {
333
338
  }
334
339
  export {
335
340
  _ as BLOCK_ID,
336
- P as RecommendationBlock
341
+ K as RecommendationBlock
337
342
  };
@@ -1,59 +1,60 @@
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 = {
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 = {
4
4
  code: "USD",
5
5
  symbol: "USD",
6
6
  alignment: "after",
7
7
  decimalCount: 2,
8
8
  decimalSeparator: ".",
9
9
  thousandSeparator: ","
10
- }, O = {
10
+ }, D = {
11
11
  textBefore: "",
12
12
  textAfter: ""
13
- }, a = {
13
+ }, A = {
14
14
  textBefore: "",
15
15
  textAfter: ""
16
- }, A = [
16
+ }, c = [
17
17
  o,
18
18
  t,
19
19
  _,
20
20
  T,
21
21
  r,
22
- i,
23
- I
24
- ], c = {
22
+ I,
23
+ i
24
+ ], E = {
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
- }, l = {
30
+ [I]: !1,
31
+ [i]: !0
32
+ }, m = {
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: D,
39
+ currency: a,
40
40
  filters: [],
41
+ strategyId: "",
41
42
  // Layout
42
43
  layout: "grid",
43
- cardsInRow: C,
44
+ cardsInRow: U,
44
45
  mobileCardsInRow: e,
45
46
  mobileLayoutEnabled: !1,
46
47
  previousMobileCardsInRow: e,
47
- columnSpacing: n,
48
- rowSpacing: s,
49
- mobileColumnSpacing: U,
50
- mobileRowSpacing: R,
48
+ columnSpacing: R,
49
+ rowSpacing: n,
50
+ mobileColumnSpacing: O,
51
+ mobileRowSpacing: s,
51
52
  // Composition
52
- composition: A,
53
- visibility: c,
53
+ composition: c,
54
+ visibility: E,
54
55
  // Element settings
55
- omnibusPrice: O,
56
- omnibusDiscount: a,
56
+ omnibusPrice: D,
57
+ omnibusDiscount: A,
57
58
  textTrimming: !1,
58
59
  // Price placement (block-level, affects all cards)
59
60
  // Default ON = current stacked look, so existing templates are unaffected.
@@ -63,18 +64,17 @@ const D = {
63
64
  // of "false" (the actual hiding happens server-side at send).
64
65
  priceHideIfSameAsDiscounted: !1,
65
66
  // Meta
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,
67
+ configVersion: C,
69
68
  recommendationId: 0
70
- }, N = [11, 12], m = 1;
69
+ }, u = [11, 12];
71
70
  export {
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
71
+ l as CURRENT_CONFIG_VERSION,
72
+ c as DEFAULT_COMPOSITION,
73
+ a as DEFAULT_CURRENCY,
74
+ m as DEFAULT_NODE_CONFIG,
75
+ A as DEFAULT_OMNIBUS_DISCOUNT,
76
+ D as DEFAULT_OMNIBUS_PRICE,
77
+ E as DEFAULT_VISIBILITY,
78
+ u as EXCLUDED_ALGORITHM_IDS,
79
+ C as PRE_RRS_CONFIG_VERSION
80
80
  };