@useinsider/guido 3.2.0-beta.2e5aafb → 3.2.0-beta.31dade2

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 (123) hide show
  1. package/README.md +92 -0
  2. package/dist/@types/config/schemas.js +150 -94
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +88 -87
  5. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  6. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  7. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  8. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  9. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  10. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  11. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  12. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  13. package/dist/composables/useActionsApi.js +4 -4
  14. package/dist/composables/useFullStoryBridge.js +14 -0
  15. package/dist/composables/useRecommendation.js +46 -26
  16. package/dist/composables/useRibbonOffset.js +21 -0
  17. package/dist/composables/useSave.js +21 -18
  18. package/dist/composables/useStripo.js +40 -40
  19. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  20. package/dist/config/compiler/recommendationCompilerRules.js +79 -74
  21. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  22. package/dist/config/compiler/utils/recommendationCompilerUtils.js +107 -71
  23. package/dist/config/migrator/index.js +9 -9
  24. package/dist/config/migrator/radioButtonMigrator.js +50 -41
  25. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  26. package/dist/config/migrator/recommendation/extractors.js +27 -0
  27. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  28. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  29. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  30. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  31. package/dist/config/migrator/recommendationMigrator.js +74 -290
  32. package/dist/enums/extensions/recommendationBlock.js +2 -1
  33. package/dist/enums/onboarding.js +7 -2
  34. package/dist/enums/unsubscribe.js +34 -27
  35. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
  36. package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
  37. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  38. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  39. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  40. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  41. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  42. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  43. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
  44. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  45. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  46. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  47. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  48. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  49. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  50. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +123 -79
  51. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
  52. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  53. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
  54. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  55. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  56. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  57. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  58. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  59. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  60. package/dist/guido.css +1 -1
  61. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
  62. package/dist/node_modules/valibot/dist/index.js +450 -235
  63. package/dist/package.json.js +1 -1
  64. package/dist/services/templateLibraryApi.js +5 -4
  65. package/dist/src/@types/config/defaults.d.ts +5 -1
  66. package/dist/src/@types/config/index.d.ts +3 -3
  67. package/dist/src/@types/config/schemas.d.ts +213 -0
  68. package/dist/src/@types/config/types.d.ts +9 -1
  69. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  70. package/dist/src/composables/useActionsApi.d.ts +1 -1
  71. package/dist/src/composables/useConfig.d.ts +56 -0
  72. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  73. package/dist/src/composables/useRecommendation.d.ts +10 -1
  74. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  75. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  76. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  77. package/dist/src/config/migrator/index.d.ts +2 -1
  78. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  79. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  80. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  81. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  82. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  83. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  84. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  85. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  86. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  87. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  88. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  89. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  90. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  91. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  92. package/dist/src/enums/onboarding.d.ts +6 -0
  93. package/dist/src/enums/unsubscribe.d.ts +5 -0
  94. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  95. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  97. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  100. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  101. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  102. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  103. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
  104. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  105. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  106. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  107. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  108. package/dist/src/library.d.ts +1 -1
  109. package/dist/src/stores/config.d.ts +504 -0
  110. package/dist/src/stores/onboarding.d.ts +4 -0
  111. package/dist/src/utils/htmlEscape.d.ts +5 -0
  112. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  113. package/dist/static/styles/components/button.css.js +16 -9
  114. package/dist/static/styles/components/loader.css.js +4 -0
  115. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  116. package/dist/stores/onboarding.js +4 -0
  117. package/dist/utils/htmlEscape.js +13 -0
  118. package/dist/utils/pairProductVariables.js +89 -88
  119. package/dist/utils/templatePreparation.js +72 -32
  120. package/package.json +7 -3
  121. package/dist/enums/displayConditions.js +0 -80
  122. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  123. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,74 +1,63 @@
1
- import { defineComponent as u, computed as a, watch as b } from "vue";
2
- import { useTranslations as m } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as k } from "../../../stores/onboarding.js";
4
- import { InOnboard as B } from "@useinsider/design-system-vue";
5
- const y = /* @__PURE__ */ u({
1
+ import { defineComponent as l, computed as c, watch as g } from "vue";
2
+ import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as x } from "../../../composables/useTranslations.js";
4
+ import { useOnboardingStore as u } from "../../../stores/onboarding.js";
5
+ import { InOnboard as p } from "@useinsider/design-system-vue";
6
+ const O = /* @__PURE__ */ l({
6
7
  __name: "TextBlockOnboarding",
7
- setup(h) {
8
- const i = m(), o = k(), e = a(() => {
9
- const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
10
- return {
11
- settings: {
12
- top: `${r}px`,
13
- position: r + d + g > n ? "Right Bottom" : "Right Top"
14
- },
15
- dynamic: {
16
- top: `${s}px`,
17
- position: s + d + g > n ? "Right Bottom" : "Right Top"
18
- }
19
- };
20
- }), c = a(() => [
8
+ setup(k) {
9
+ const n = x(), o = u(), { getTopPosition: i } = b(), r = c(() => [
21
10
  {
22
11
  classes: "guido-text-block-onboarding-settings",
23
12
  right: "426px",
24
- top: e.value.settings.top,
25
- position: e.value.settings.position,
26
- title: i("email-editor.onboarding-text-block-title"),
27
- description: i("email-editor.onboarding-text-block-description"),
13
+ top: i(90),
14
+ position: "Right Top",
15
+ title: n("email-editor.onboarding-text-block-title"),
16
+ description: n("email-editor.onboarding-text-block-description"),
28
17
  imageSource: "",
29
18
  backButtonClick: () => {
30
19
  },
31
20
  nextButtonType: "text",
32
- nextButtonText: i("products.next"),
21
+ nextButtonText: n("products.next"),
33
22
  nextButtonClick: () => {
34
23
  o.next("textBlockOnboarding");
35
24
  }
36
25
  },
37
26
  {
38
27
  classes: "guido-text-block-onboarding-dynamic",
39
- right: "426px",
40
- top: e.value.dynamic.top,
41
- position: e.value.dynamic.position,
42
- title: i("email-editor.onboarding-dynamic-content-title"),
43
- description: i("email-editor.onboarding-dynamic-content-description"),
28
+ right: "409px",
29
+ top: i(607),
30
+ position: "Right Top",
31
+ title: n("email-editor.onboarding-dynamic-content-title"),
32
+ description: n("email-editor.onboarding-dynamic-content-description"),
44
33
  imageSource: "",
45
34
  backButtonType: "text",
46
- backButtonText: i("ds-steps.back"),
35
+ backButtonText: n("ds-steps.back"),
47
36
  backButtonClick: () => {
48
37
  o.previous("textBlockOnboarding");
49
38
  },
50
39
  nextButtonType: "text",
51
- nextButtonText: i("action-builder.ok"),
40
+ nextButtonText: n("action-builder.ok"),
52
41
  nextButtonClick: () => {
53
42
  o.close("textBlockOnboarding");
54
43
  }
55
44
  }
56
- ]), l = a(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), p = () => {
57
- var t, n;
58
- (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
59
- }, x = () => {
60
- var t, n;
61
- (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
45
+ ]), a = c(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), s = () => {
46
+ var t, e;
47
+ (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
48
+ }, d = () => {
49
+ var t, e;
50
+ (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
62
51
  };
63
- return b(
52
+ return g(
64
53
  () => o.isActive("textBlockOnboarding"),
65
54
  (t) => {
66
- t && o.setConfig("textBlockOnboarding", c.value);
55
+ t && o.setConfig("textBlockOnboarding", r.value);
67
56
  },
68
57
  { immediate: !0 }
69
- ), { __sfc: !0, trans: i, onboardingStore: o, dynamicPosition: e, onboardingCardsConfig: c, isVisible: l, handleNext: p, handleBack: x, InOnboard: B };
58
+ ), { __sfc: !0, trans: n, onboardingStore: o, getTopPosition: i, onboardingCardsConfig: r, isVisible: a, handleNext: s, handleBack: d, InOnboard: p };
70
59
  }
71
60
  });
72
61
  export {
73
- y as default
62
+ O as default
74
63
  };
@@ -1,15 +1,16 @@
1
- import { defineComponent as c, computed as e, watch as g } from "vue";
2
- import { useTranslations as b } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as u } from "../../../stores/onboarding.js";
4
- import { InOnboard as l } from "@useinsider/design-system-vue";
5
- const C = /* @__PURE__ */ c({
1
+ import { defineComponent as g, computed as s, watch as b } from "vue";
2
+ import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import { useOnboardingStore as m } from "../../../stores/onboarding.js";
5
+ import { InOnboard as p } from "@useinsider/design-system-vue";
6
+ const k = /* @__PURE__ */ g({
6
7
  __name: "VersionHistoryOnboarding",
7
- setup(p) {
8
- const t = b(), n = u(), r = e(() => [
8
+ setup(f) {
9
+ const t = l(), n = m(), { getTopPosition: r } = u(), e = s(() => [
9
10
  {
10
11
  classes: "guido-version-history-onboarding",
11
12
  left: "409px",
12
- top: "192px",
13
+ top: r(192),
13
14
  position: "Left Top",
14
15
  title: t("email-editor.onboarding-version-history-title"),
15
16
  description: t("email-editor.onboarding-version-history-description"),
@@ -20,18 +21,18 @@ const C = /* @__PURE__ */ c({
20
21
  nextButtonText: t("action-builder.ok"),
21
22
  nextButtonClick: () => void n.close("versionHistoryOnboarding")
22
23
  }
23
- ]), s = e(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), a = () => {
24
+ ]), a = s(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), d = () => {
24
25
  var o, i;
25
26
  (i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.nextButtonClick) == null || i.call(o);
26
- }, d = () => {
27
+ }, c = () => {
27
28
  var o, i;
28
29
  (i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.backButtonClick) == null || i.call(o);
29
30
  };
30
- return g(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
31
- o && n.setConfig("versionHistoryOnboarding", r.value);
32
- }, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, onboardingCardsConfig: r, isVisible: s, handleNext: a, handleBack: d, InOnboard: l };
31
+ return b(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
32
+ o && n.setConfig("versionHistoryOnboarding", e.value);
33
+ }, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, getTopPosition: r, onboardingCardsConfig: e, isVisible: a, handleNext: d, handleBack: c, InOnboard: p };
33
34
  }
34
35
  });
35
36
  export {
36
- C as default
37
+ k as default
37
38
  };
@@ -89,11 +89,11 @@ const v = () => {
89
89
  updateHtmlAndCss: (t, e) => {
90
90
  window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
91
91
  },
92
- editorSave: () => {
93
- window.StripoEditorApi.actionsApi.save((t) => {
94
- t && n(t, "Failed to save template");
92
+ editorSave: () => new Promise((t) => {
93
+ window.StripoEditorApi.actionsApi.save((e) => {
94
+ e && n(e, "Failed to save template"), t();
95
95
  });
96
- }
96
+ })
97
97
  };
98
98
  };
99
99
  export {
@@ -0,0 +1,14 @@
1
+ const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
2
+ var n;
3
+ const s = window;
4
+ if (typeof s._fs_org != "string" || !s._fs_org)
5
+ return;
6
+ const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
7
+ if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
8
+ return;
9
+ const t = e.createElement("script");
10
+ t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
11
+ } });
12
+ export {
13
+ u as useFullStoryBridge
14
+ };
@@ -1,21 +1,21 @@
1
- import { RecommendationFeedSourceMaps as g, URLS as p } from "../enums/extensions/recommendationBlock.js";
1
+ import { RecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
2
2
  import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
3
- import { useRecommendationExtensionStore as u } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
- import { useConfigStore as I } from "../stores/config.js";
6
- const N = () => ({
3
+ import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { useConfigStore as x } from "../stores/config.js";
6
+ const w = () => ({
7
7
  calculateCardWidth: ({
8
- mobileLeftPadding: i,
9
- mobileRightPadding: n,
10
- cardsInRow: o,
11
- unresponsive: a
8
+ mobileLeftPadding: s,
9
+ mobileRightPadding: a,
10
+ cardsInRow: c,
11
+ unresponsive: n
12
12
  }) => {
13
- const r = a ? o : 1, e = i + n + (r - 1) * b;
13
+ const r = n ? c : 1, e = s + a + (r - 1) * b;
14
14
  return (R - e) / r;
15
15
  },
16
- getRecommendationCampaignData: (i) => {
17
- const n = u(), o = Number(i), a = n.blockStates[o];
18
- if (!a)
16
+ getRecommendationCampaignData: (s) => {
17
+ const a = m(), c = Number(s), n = a.blockStates[c];
18
+ if (!n)
19
19
  return {
20
20
  textTrimming: !1,
21
21
  orientation: "vertical",
@@ -28,7 +28,7 @@ const N = () => ({
28
28
  discountBeforeTextValue: "",
29
29
  discountAfterTextValue: ""
30
30
  };
31
- const { recommendationConfigs: r } = a, e = r.orientation === "grid" ? "vertical" : "horizontal";
31
+ const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
32
32
  return {
33
33
  textTrimming: r.textTrimming,
34
34
  orientation: e,
@@ -42,19 +42,39 @@ const N = () => ({
42
42
  discountAfterTextValue: ""
43
43
  };
44
44
  },
45
- buildCampaignUrl: (i) => {
46
- var m;
47
- const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
48
- if (!r)
49
- return "";
50
- const { recommendationConfigs: e } = r, l = ((m = g.find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
51
- t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
52
- const f = e.filters.filter((s) => s.isValid), c = x(f);
53
- c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
54
- const d = `${p.RECOMMENDATION_API_URL}/v2/${l}?${t.toString()}`;
55
- return n.recommendationCampaignUrls[i] = d, d;
45
+ buildCampaignUrl: (s, a) => {
46
+ var l;
47
+ const c = m(), n = x(), r = Number(s);
48
+ let e;
49
+ if (a)
50
+ e = a;
51
+ else {
52
+ const i = c.blockStates[r];
53
+ if (!i)
54
+ return "";
55
+ const { recommendationConfigs: o } = i;
56
+ e = {
57
+ strategy: o.strategy,
58
+ language: o.language,
59
+ currencyCode: o.currencySettings.value,
60
+ size: o.size,
61
+ productIds: o.productIds,
62
+ filters: o.filters,
63
+ shuffleProducts: o.shuffleProducts
64
+ };
65
+ }
66
+ const f = ((l = I.find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
67
+ if (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") {
68
+ const i = parseInt(e.size) || 6;
69
+ t.set("productId", e.productIds.slice(0, i).join(","));
70
+ } else e.strategy === "similarViewed" && t.set("productId", "{itemId}");
71
+ e.strategy === "userBased" && t.set("userId", "{user_id}");
72
+ const g = e.filters.filter((i) => i.isValid), d = h(g);
73
+ d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
74
+ const p = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
75
+ return c.recommendationCampaignUrls[s] = u, u;
56
76
  }
57
77
  });
58
78
  export {
59
- N as useRecommendation
79
+ w as useRecommendation
60
80
  };
@@ -0,0 +1,21 @@
1
+ import { RIBBON_SELECTOR as r } from "../enums/onboarding.js";
2
+ import { ref as f, onMounted as c, onBeforeUnmount as i } from "vue";
3
+ const m = () => {
4
+ const o = f(0);
5
+ let e = null;
6
+ const n = () => {
7
+ const t = document.querySelector(r), s = (t == null ? void 0 : t.offsetHeight) ?? 0;
8
+ o.value !== s && (o.value = s);
9
+ }, u = (t) => `${t + o.value}px`;
10
+ return c(() => {
11
+ n(), e = new MutationObserver(n), e.observe(document.body, {
12
+ childList: !0,
13
+ subtree: !0
14
+ });
15
+ }), i(() => {
16
+ e == null || e.disconnect();
17
+ }), { ribbonOffset: o, getTopPosition: u };
18
+ };
19
+ export {
20
+ m as useRibbonOffset
21
+ };
@@ -1,29 +1,32 @@
1
- import { useActionsApi as S } from "./useActionsApi.js";
2
- import { useConfig as V } from "./useConfig.js";
3
- import { useSaveStart as x, useSaveComplete as y } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as w } from "./useSyncModuleExtractor.js";
5
- import { useStripoApi as b } from "../services/stripoApi.js";
6
- import { useTemplatePreparation as q } from "../utils/templatePreparation.js";
7
- import { useHtmlValidator as H } from "./useHtmlValidator.js";
8
- import { useLiquidValidator as L } from "./validators/useLiquidValidator.js";
9
- const F = () => {
10
- const o = x(), s = y(), { validateHtml: r } = H(), { validateLiquidSyntax: n } = L(), { callbacks: a, isFeatureEnabled: l } = V(), { extractSyncModuleData: d } = w(), { setSyncModuleUnsubscriptionPages: u } = b(), { editorSave: c } = S();
11
- return { save: async (m = !1) => {
1
+ import { useActionsApi as V } from "./useActionsApi.js";
2
+ import { useConfig as x } from "./useConfig.js";
3
+ import { useSaveStart as y, useSaveComplete as w } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as C } from "./useSyncModuleExtractor.js";
5
+ import { useStripoApi as H } from "../services/stripoApi.js";
6
+ import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
7
+ import { useHtmlValidator as q } from "./useHtmlValidator.js";
8
+ import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
9
+ import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
10
+ const h = () => {
11
+ const o = y(), s = w(), { validateHtml: r } = q(), { validateLiquidSyntax: l } = P(), { validateCouponBlockTags: n } = L(), { callbacks: a, isFeatureEnabled: d } = x(), { extractSyncModuleData: u } = C(), { setSyncModuleUnsubscriptionPages: c } = H(), { editorSave: m } = V();
12
+ return { save: async (p = !1) => {
12
13
  var i;
13
14
  o();
14
- const { prepareTemplateDetails: p } = q(), t = await p();
15
- if (l("liquidSyntax")) {
16
- if (!await n(t.compiledHtml))
15
+ const { prepareTemplateDetails: f } = b(), t = await f();
16
+ if (!n(t.compiledHtml))
17
+ return;
18
+ if (d("liquidSyntax")) {
19
+ if (!await l(t.compiledHtml))
17
20
  return;
18
21
  } else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
19
22
  return;
20
23
  if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
21
24
  return;
22
- c();
23
- const { unsubscribePayload: f, stripoModules: v } = d(t.rawHtml);
24
- return await u(f), t.modules = v, m || s(t), t;
25
+ await m();
26
+ const { unsubscribePayload: v, stripoModules: S } = u(t.rawHtml);
27
+ return await c(v), t.modules = S, p || s(t), t;
25
28
  } };
26
29
  };
27
30
  export {
28
- F as useSave
31
+ h as useSave
29
32
  };
@@ -1,27 +1,27 @@
1
- import { useActionsApi as F } from "./useActionsApi.js";
2
- import { useBlocksConfig as D } from "./useBlocksConfig.js";
3
- import { useConfig as I } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as P } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
6
- import { useToaster as R } from "./useToaster.js";
7
- import { localePatch as q } from "../config/i18n/index.js";
8
- import { displayConditions as x } from "../enums/displayConditions.js";
9
- import { useStripoApi as H } from "../services/stripoApi.js";
10
- import O from "../static/styles/customEditorStyle.css.js";
11
- import { useEditorStore as C } from "../stores/editor.js";
1
+ import { useActionsApi as D } from "./useActionsApi.js";
2
+ import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
+ import { useConfig as P } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
+ import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
+ import { useToaster as x } from "./useToaster.js";
8
+ import { localePatch as H } from "../config/i18n/index.js";
9
+ import { useStripoApi as O } from "../services/stripoApi.js";
10
+ import j from "../static/styles/customEditorStyle.css.js";
11
+ import { useEditorStore as E } from "../stores/editor.js";
12
12
  import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
13
  import $ from "../package.json.js";
14
- const ie = (E, c) => {
15
- const { features: l, template: h, isFeatureEnabled: u } = I(), { handleError: m } = R(), { getToken: b, getCustomFonts: w, getSyncModulesStatus: k } = H(), { handleEvent: T } = U(), { getStripoBlocksConfig: V } = D(), _ = async (i, n = [], r = !1) => {
16
- var g, y, S;
17
- const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), f = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, v = ((y = l.value) == null ? void 0 : y.modulesDisabled) ?? !1, M = ((S = h.value) == null ? void 0 : S.forceRecreate) ?? !1;
14
+ const se = (C, l) => {
15
+ const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: B } = q(), { getStripoBlocksConfig: T } = I(), V = async (i, r = [], s = !1) => {
16
+ var g, S, y;
17
+ const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await T(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, F = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
18
  window.UIEditor.initEditor(
19
19
  document.querySelector("#guido-editor"),
20
20
  {
21
- metadata: E,
21
+ metadata: C,
22
22
  html: p,
23
23
  css: a,
24
- forceRecreate: M,
24
+ forceRecreate: v,
25
25
  locale: "en",
26
26
  undoButtonSelector: "#guido__undo-button",
27
27
  redoButtonSelector: "#guido__redo-button",
@@ -31,45 +31,45 @@ const ie = (E, c) => {
31
31
  customAppearanceMergetags: !u("liquidSyntax"),
32
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: O,
34
+ customViewStyles: j,
35
35
  conditionsEnabled: f,
36
36
  customConditionsEnabled: f,
37
- conditionCategories: x,
38
37
  enableXSSSecurity: !0,
39
- modulesDisabled: v,
40
- syncModulesEnabled: r,
38
+ modulesDisabled: F,
39
+ syncModulesEnabled: s,
41
40
  messageSettingsEnabled: !0,
42
41
  displayGmailAnnotations: !0,
43
42
  displayHiddenPreheader: !1,
44
43
  displayTitle: !1,
45
44
  displayUTM: !1,
46
45
  selectElementAfterDrop: !0,
46
+ allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
47
47
  ...o ? { baseBlocks: o } : {},
48
48
  editorFonts: {
49
49
  showDefaultStandardFonts: !0,
50
50
  showDefaultNotStandardFonts: !0,
51
- customFonts: n
51
+ customFonts: r
52
52
  },
53
53
  mergeTags: [
54
54
  {
55
55
  entries: L(
56
- c.preselectedDynamicContentList,
56
+ l.preselectedDynamicContentList,
57
57
  u("liquidSyntax")
58
58
  )
59
59
  }
60
60
  ],
61
61
  async onTokenRefreshRequest(t) {
62
62
  try {
63
- const s = await b();
64
- t(s);
65
- } catch (s) {
66
- m(s, "Failed to refresh token");
63
+ const n = await w();
64
+ t(n);
65
+ } catch (n) {
66
+ m(n, "Failed to refresh token");
67
67
  }
68
68
  },
69
69
  onTemplateLoaded() {
70
70
  try {
71
- const { importCss: t } = P(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: A } = F();
72
- t(), s(), A(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
71
+ const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
72
+ t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
73
73
  e.hasChanges = !1;
74
74
  }, 1e3);
75
75
  } catch (t) {
@@ -88,39 +88,39 @@ const ie = (E, c) => {
88
88
  onDataChanged() {
89
89
  e.hasChanges = !0;
90
90
  },
91
- onEvent: T,
91
+ onEvent: B,
92
92
  ignoreClickOutsideSelectors: [
93
93
  "#guido-dynamic-content-modal",
94
94
  ".in-on-board-wrapper",
95
95
  ".in-drawer__container"
96
96
  ],
97
97
  extensions: d,
98
- localePatch: q
98
+ localePatch: H
99
99
  }
100
100
  );
101
- }, B = (i) => new Promise((n, r) => {
101
+ }, _ = (i) => new Promise((r, s) => {
102
102
  var d;
103
103
  if (document.getElementById("UiEditorScript")) {
104
- i(), n();
104
+ i(), r();
105
105
  return;
106
106
  }
107
107
  const e = $.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
108
108
  o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
109
- i(), n();
109
+ i(), r();
110
110
  }, o.onerror = () => {
111
- r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
111
+ s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
112
112
  }, document.body.appendChild(o);
113
113
  });
114
114
  return { initPlugin: async (i) => {
115
- await B(async () => {
116
- const n = C(), [r, e] = await Promise.all([
117
- w(),
115
+ await _(async () => {
116
+ const r = E(), [s, e] = await Promise.all([
117
+ b(),
118
118
  k()
119
119
  ]);
120
- n.syncModulesEnabled = e, await _(i, r, e);
120
+ r.syncModulesEnabled = e, await V(i, s, e);
121
121
  });
122
122
  } };
123
123
  };
124
124
  export {
125
- ie as useStripo
125
+ se as useStripo
126
126
  };
@@ -0,0 +1,24 @@
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
+ } };
21
+ };
22
+ export {
23
+ A as useCouponBlockValidator
24
+ };