@useinsider/guido 3.2.0-beta.ec6228c → 3.2.0-beta.ecc7c6c

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 (59) hide show
  1. package/README.md +1 -24
  2. package/dist/@types/config/schemas.js +36 -38
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +34 -35
  5. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  6. package/dist/components/organisms/header/RightSlot.vue2.js +8 -9
  7. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  8. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  9. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  10. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  11. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  12. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  13. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  14. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  15. package/dist/composables/useHtmlValidator.js +41 -36
  16. package/dist/composables/useRibbonOffset.js +21 -0
  17. package/dist/composables/useSave.js +21 -18
  18. package/dist/composables/useStripo.js +14 -16
  19. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  20. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  21. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  22. package/dist/config/migrator/radioButtonMigrator.js +64 -44
  23. package/dist/enums/onboarding.js +7 -2
  24. package/dist/enums/unsubscribe.js +34 -27
  25. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +18 -9
  27. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
  30. package/dist/package.json.js +1 -1
  31. package/dist/services/templateLibraryApi.js +5 -4
  32. package/dist/src/@types/config/schemas.d.ts +0 -4
  33. package/dist/src/composables/useConfig.d.ts +0 -2
  34. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  35. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  36. package/dist/src/enums/onboarding.d.ts +6 -0
  37. package/dist/src/enums/unsubscribe.d.ts +5 -0
  38. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  40. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  41. package/dist/src/stores/config.d.ts +0 -18
  42. package/dist/src/stores/onboarding.d.ts +4 -0
  43. package/dist/stores/onboarding.js +4 -0
  44. package/dist/utils/pairProductVariables.js +89 -88
  45. package/package.json +3 -3
  46. package/dist/components/organisms/AutoSaveController.vue.js +0 -17
  47. package/dist/components/organisms/AutoSaveController.vue2.js +0 -13
  48. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  49. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  50. package/dist/composables/useAutoSave.js +0 -68
  51. package/dist/enums/displayConditions.js +0 -80
  52. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +0 -2
  53. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +0 -2
  54. package/dist/src/composables/useAutoSave.d.ts +0 -3
  55. package/dist/src/enums/displayConditions.d.ts +0 -2
  56. package/dist/src/stores/autosave.d.ts +0 -6
  57. package/dist/src/utils/timeUtil.d.ts +0 -8
  58. package/dist/stores/autosave.js +0 -11
  59. package/dist/utils/timeUtil.js +0 -19
@@ -13,7 +13,7 @@ var l = function() {
13
13
  c,
14
14
  !1,
15
15
  null,
16
- "dd1a237a"
16
+ "796d193b"
17
17
  );
18
18
  const I = p.exports;
19
19
  export {
@@ -1,33 +1,31 @@
1
- import { defineComponent as l, computed as a, watch as u } from "vue";
1
+ import { defineComponent as b, computed as d, watch as m } from "vue";
2
+ import { useRibbonOffset as l } from "../../../composables/useRibbonOffset.js";
2
3
  import { useTranslations as x } from "../../../composables/useTranslations.js";
3
- import { RIBBON_SELECTOR as T, UI_EDITOR_SELECTOR as O, CARD_COMPOSITION_TAB_SELECTOR as B, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
4
- import { useOnboardingStore as C } from "../../../stores/onboarding.js";
5
- import { InOnboard as k } from "@useinsider/design-system-vue";
6
- const E = /* @__PURE__ */ l({
4
+ import { UI_EDITOR_SELECTOR as T, CARD_COMPOSITION_TAB_SELECTOR as O, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
5
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
6
+ import { InOnboard as B } from "@useinsider/design-system-vue";
7
+ const E = /* @__PURE__ */ b({
7
8
  __name: "ItemsOnboarding",
8
- setup(_) {
9
- const e = x(), o = C(), c = a(() => {
10
- const t = document.querySelector(T);
11
- return (t == null ? void 0 : t.offsetHeight) ?? 0;
12
- }), n = (t) => `${t + c.value}px`, r = (t) => {
13
- const i = document.querySelector(O);
14
- if (!(i != null && i.shadowRoot))
9
+ setup(C) {
10
+ const i = x(), o = k(), { getTopPosition: n } = l(), r = (t) => {
11
+ const e = document.querySelector(T);
12
+ if (!(e != null && e.shadowRoot))
15
13
  return;
16
- const { shadowRoot: s } = i, m = s.querySelector(t);
17
- m && m.click();
18
- }, d = a(() => [
14
+ const { shadowRoot: s } = e, c = s.querySelector(t);
15
+ c && c.click();
16
+ }, a = d(() => [
19
17
  {
20
18
  classes: "guido-items-onboarding-card-1",
21
19
  right: "426px",
22
20
  top: n(90),
23
21
  position: "Right Top",
24
- title: e("email-editor.onboarding-items-title"),
25
- description: e("email-editor.onboarding-items-description"),
22
+ title: i("email-editor.onboarding-items-title"),
23
+ description: i("email-editor.onboarding-items-description"),
26
24
  imageSource: "",
27
25
  backButtonClick: () => {
28
26
  },
29
27
  nextButtonType: "text",
30
- nextButtonText: e("products.next"),
28
+ nextButtonText: i("products.next"),
31
29
  nextButtonClick: () => {
32
30
  o.next("itemsOnboarding");
33
31
  }
@@ -37,16 +35,16 @@ const E = /* @__PURE__ */ l({
37
35
  right: "426px",
38
36
  top: n(218),
39
37
  position: "Right Top",
40
- title: e("email-editor.onboarding-items-item-type-title"),
41
- description: e("email-editor.onboarding-items-item-type-description"),
38
+ title: i("email-editor.onboarding-items-item-type-title"),
39
+ description: i("email-editor.onboarding-items-item-type-description"),
42
40
  imageSource: "",
43
41
  backButtonType: "text",
44
- backButtonText: e("ds-steps.back"),
42
+ backButtonText: i("ds-steps.back"),
45
43
  backButtonClick: () => {
46
44
  o.previous("itemsOnboarding");
47
45
  },
48
46
  nextButtonType: "text",
49
- nextButtonText: e("products.next"),
47
+ nextButtonText: i("products.next"),
50
48
  nextButtonClick: () => {
51
49
  o.next("itemsOnboarding");
52
50
  }
@@ -56,42 +54,42 @@ const E = /* @__PURE__ */ l({
56
54
  right: "426px",
57
55
  top: n(140),
58
56
  position: "Right Top",
59
- title: e("email-editor.onboarding-items-composition-title"),
60
- description: e("email-editor.onboarding-items-composition-description"),
57
+ title: i("email-editor.onboarding-items-composition-title"),
58
+ description: i("email-editor.onboarding-items-composition-description"),
61
59
  imageSource: "",
62
60
  backButtonType: "text",
63
- backButtonText: e("ds-steps.back"),
61
+ backButtonText: i("ds-steps.back"),
64
62
  backButtonClick: () => {
65
63
  o.previous("itemsOnboarding");
66
64
  },
67
65
  nextButtonType: "text",
68
- nextButtonText: e("action-builder.ok"),
66
+ nextButtonText: i("action-builder.ok"),
69
67
  nextButtonClick: () => {
70
68
  o.close("itemsOnboarding");
71
69
  }
72
70
  }
73
- ]), g = a(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
74
- var t, i;
75
- (i = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || i.call(t);
76
- }, b = () => {
77
- var t, i;
78
- (i = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || i.call(t);
71
+ ]), g = d(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
72
+ var t, e;
73
+ (e = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
74
+ }, u = () => {
75
+ var t, e;
76
+ (e = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
79
77
  };
80
- return u(
78
+ return m(
81
79
  () => o.isActive("itemsOnboarding"),
82
80
  (t) => {
83
- t && o.setConfig("itemsOnboarding", d.value);
81
+ t && o.setConfig("itemsOnboarding", a.value);
84
82
  },
85
83
  { immediate: !0 }
86
- ), u(
84
+ ), m(
87
85
  () => o.onboardings.itemsOnboarding.cardIndex,
88
- (t, i) => {
86
+ (t, e) => {
89
87
  if (!o.isActive("itemsOnboarding"))
90
88
  return;
91
- const s = `${i}-${t}`;
92
- s === "1-2" && r(B), s === "2-1" && r(f);
89
+ const s = `${e}-${t}`;
90
+ s === "1-2" && r(O), s === "2-1" && r(f);
93
91
  }
94
- ), { __sfc: !0, trans: e, onboardingStore: o, ribbonOffset: c, getTopPosition: n, switchTab: r, onboardingCardsConfig: d, isVisible: g, handleNext: p, handleBack: b, InOnboard: k };
92
+ ), { __sfc: !0, trans: i, onboardingStore: o, getTopPosition: n, switchTab: r, onboardingCardsConfig: a, isVisible: g, handleNext: p, handleBack: u, InOnboard: B };
95
93
  }
96
94
  });
97
95
  export {
@@ -13,9 +13,9 @@ var g = function() {
13
13
  b,
14
14
  !1,
15
15
  null,
16
- "d073b1dc"
16
+ "cadfc82d"
17
17
  );
18
- const f = p.exports;
18
+ const C = p.exports;
19
19
  export {
20
- f as default
20
+ C as default
21
21
  };
@@ -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
  };
@@ -1,35 +1,37 @@
1
- import { useConfig as L } from "./useConfig.js";
2
- import { TemplateTypes as V } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as _, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as G } from "../enums/html-validator.js";
1
+ import { useConfig as _ } from "./useConfig.js";
2
+ import { TemplateTypes as H } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
4
4
  import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as M } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
- import { base64EncodeWithSpecialChars as X } from "../utils/base64.js";
8
- import { useHttp as j } from "./useHttp.js";
9
- import { useToaster as q } from "./useToaster.js";
10
- import { useTranslations as z } from "./useTranslations.js";
11
- const K = /recommendation-id="(\d+)"/g;
12
- function U(a) {
13
- return [...a.matchAll(K)].map((u) => u[1]);
5
+ import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
8
+ import { useRecommendationStore as K } from "../stores/recommendation.js";
9
+ import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
10
+ import { useHttp as U } from "./useHttp.js";
11
+ import { useToaster as Y } from "./useToaster.js";
12
+ import { useTranslations as Z } from "./useTranslations.js";
13
+ const J = /recommendation-id="(\d+)"/g;
14
+ function Q(a) {
15
+ return [...a.matchAll(J)].map((u) => u[1]);
14
16
  }
15
- function Y(a, u) {
17
+ function ee(a, u) {
16
18
  return u.some((d) => a.startsWith(`${d}_`));
17
19
  }
18
- const ce = () => {
20
+ const ge = () => {
19
21
  var y, h;
20
- const { showToaster: a } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, b = async (e) => {
22
+ const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
21
23
  const t = await u(
22
24
  "/newsletter/template-library/check-template-html-body",
23
- { html: X(e) }
25
+ { html: z(e) }
24
26
  ), { status: n, message: l } = t.data;
25
27
  return n || a({
26
28
  type: c.Alert,
27
29
  message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
28
- }), r(P), l === r(G) && a({
30
+ }), r(M), l === r($) && a({
29
31
  type: c.Alert,
30
32
  message: r("newsletter.already-in-progress")
31
33
  }), n;
32
- }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
34
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
33
35
  const t = e.match(/({%(.*?)%})/g);
34
36
  let n = !0;
35
37
  return t !== null && !p && t.forEach((l) => {
@@ -42,13 +44,13 @@ const ce = () => {
42
44
  }), n = !1);
43
45
  }
44
46
  }), n;
45
- }, A = async (e, s, t) => {
47
+ }, k = async (e, s, t) => {
46
48
  const n = t ? await b(e) : !0;
47
- return E(e, s) && n;
48
- }, I = (e) => e.length > 0 ? !0 : (a({
49
+ return A(e, s) && n;
50
+ }, x = (e) => e.length > 0 ? !0 : (a({
49
51
  type: c.Warning,
50
52
  message: r("newsletter.html-content-is-empty")
51
- }), !1), k = (e) => {
53
+ }), !1), I = (e) => {
52
54
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
53
55
  return s > t && a({
54
56
  type: c.Warning,
@@ -57,7 +59,7 @@ const ce = () => {
57
59
  type: c.Warning,
58
60
  message: r("custom-fields.missing-opening-braces")
59
61
  }), s === t;
60
- }, x = (e) => {
62
+ }, F = (e) => {
61
63
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
62
64
  return s || a({
63
65
  type: c.Warning,
@@ -66,10 +68,10 @@ const ce = () => {
66
68
  }, T = (e, s) => {
67
69
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
68
70
  if (t && !p) {
69
- const n = new Set(s.map((i) => i.toLowerCase())), l = U(e), o = [];
71
+ const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
70
72
  if (t.forEach((i) => {
71
73
  const m = i.slice(2, -2).trim().toLowerCase();
72
- (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
74
+ (!n.has(m) || m === "") && !ee(m, l) && o.push(m);
73
75
  }), o.length > 0) {
74
76
  const i = `
75
77
  <ul>
@@ -83,11 +85,11 @@ const ce = () => {
83
85
  }
84
86
  }
85
87
  return !0;
86
- }, F = (e) => {
88
+ }, R = (e) => {
87
89
  const s = e.match(/{%(.*?)%}/g), t = [];
88
90
  let n = !0;
89
91
  if (s && s.forEach((l) => {
90
- const o = l.match(_), i = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
92
+ const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
91
93
  (!o || l !== m) && !i && (a({
92
94
  type: c.Alert,
93
95
  message: r("newsletter.display-conditions-invalid-syntax")
@@ -98,7 +100,7 @@ const ce = () => {
98
100
  }), n = !1);
99
101
  const v = f.match(/^[a-zA-Z]*$/g);
100
102
  v && v.forEach((C) => {
101
- S(C) && t.push(C);
103
+ E(C) && t.push(C);
102
104
  });
103
105
  });
104
106
  }), t.length) {
@@ -109,25 +111,28 @@ const ce = () => {
109
111
  }), n = !1);
110
112
  }
111
113
  return n;
112
- }, W = (e) => {
114
+ }, B = (e) => {
113
115
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
114
116
  return n || a({
115
117
  type: c.Warning,
116
118
  message: r("custom-conditions.no-space-after-braces")
117
119
  }), n;
118
- }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
120
+ }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
119
121
  type: c.Warning,
120
122
  message: r("custom-conditions.no-braces-inside-if-tag")
123
+ }), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
124
+ type: c.Alert,
125
+ message: r(j)
121
126
  }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
122
127
  type: c.Alert,
123
128
  message: r("newsletter.fill-all-necessary-fields")
124
- }), !1) : !0, B = (e) => {
129
+ }), !1) : !0, D = (e) => {
125
130
  const s = /src="[^"]*\.(svg|pst)"/gm;
126
131
  return e.match(s) === null ? !0 : (a({
127
132
  type: c.Alert,
128
133
  message: r("newsletter.invalid-image-type")
129
134
  }), !1);
130
- }, R = (e) => {
135
+ }, L = (e) => {
131
136
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
132
137
  return Array.from(n).find((o) => {
133
138
  var i;
@@ -136,7 +141,7 @@ const ce = () => {
136
141
  type: c.Alert,
137
142
  message: r("unsubscribe-templates.select-checkbox-groups")
138
143
  }), !1) : !0;
139
- }, D = (e) => {
144
+ }, V = (e) => {
140
145
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
141
146
  return Array.from(n).find((o) => {
142
147
  var i;
@@ -150,12 +155,12 @@ const ce = () => {
150
155
  var o, i;
151
156
  const n = [
152
157
  ...s.map((m) => m.value),
153
- ...M,
158
+ ...q,
154
159
  ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
155
160
  ];
156
- return await A(e, n, t) && I(e) && k(e) && x(e) && T(e, n) && F(e) && W(e) && N(e) && O() && B(e) && R(e) && D(e);
161
+ return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
157
162
  } };
158
163
  };
159
164
  export {
160
- ce as useHtmlValidator
165
+ ge as useHtmlValidator
161
166
  };
@@ -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
- await 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
  };
@@ -6,20 +6,19 @@ import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
6
  import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
7
  import { useToaster as x } from "./useToaster.js";
8
8
  import { localePatch as H } from "../config/i18n/index.js";
9
- import { displayConditions as O } from "../enums/displayConditions.js";
10
- import { useStripoApi as j } from "../services/stripoApi.js";
11
- import L from "../static/styles/customEditorStyle.css.js";
12
- import { useEditorStore as C } from "../stores/editor.js";
13
- import { dynamicContentToMergeTags as $ } from "../utils/genericUtil.js";
14
- import z from "../package.json.js";
15
- const ae = (E, l) => {
16
- const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = j(), { handleEvent: B } = q(), { getStripoBlocksConfig: T } = I(), V = async (i, r = [], s = !1) => {
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
+ import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
+ import $ from "../package.json.js";
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) => {
17
16
  var g, S, y;
18
- const e = C(), { 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;
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;
19
18
  window.UIEditor.initEditor(
20
19
  document.querySelector("#guido-editor"),
21
20
  {
22
- metadata: E,
21
+ metadata: C,
23
22
  html: p,
24
23
  css: a,
25
24
  forceRecreate: v,
@@ -32,10 +31,9 @@ const ae = (E, l) => {
32
31
  customAppearanceMergetags: !u("liquidSyntax"),
33
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
34
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
35
- customViewStyles: L,
34
+ customViewStyles: j,
36
35
  conditionsEnabled: f,
37
36
  customConditionsEnabled: f,
38
- conditionCategories: O,
39
37
  enableXSSSecurity: !0,
40
38
  modulesDisabled: F,
41
39
  syncModulesEnabled: s,
@@ -54,7 +52,7 @@ const ae = (E, l) => {
54
52
  },
55
53
  mergeTags: [
56
54
  {
57
- entries: $(
55
+ entries: L(
58
56
  l.preselectedDynamicContentList,
59
57
  u("liquidSyntax")
60
58
  )
@@ -106,7 +104,7 @@ const ae = (E, l) => {
106
104
  i(), r();
107
105
  return;
108
106
  }
109
- const e = z.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");
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");
110
108
  o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
111
109
  i(), r();
112
110
  }, o.onerror = () => {
@@ -115,7 +113,7 @@ const ae = (E, l) => {
115
113
  });
116
114
  return { initPlugin: async (i) => {
117
115
  await _(async () => {
118
- const r = C(), [s, e] = await Promise.all([
116
+ const r = E(), [s, e] = await Promise.all([
119
117
  b(),
120
118
  k()
121
119
  ]);
@@ -124,5 +122,5 @@ const ae = (E, l) => {
124
122
  } };
125
123
  };
126
124
  export {
127
- ae as useStripo
125
+ se as useStripo
128
126
  };