@useinsider/guido 3.2.1-beta.d58ee72 → 3.3.0-beta.1d2853a

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 (161) hide show
  1. package/README.md +117 -1
  2. package/dist/@types/config/schemas.js +153 -95
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +91 -87
  5. package/dist/components/organisms/AutoSaveController.vue.js +17 -0
  6. package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
  7. package/dist/components/organisms/header/AiStatusPill.vue.js +18 -0
  8. package/dist/components/organisms/header/AiStatusPill.vue2.js +13 -0
  9. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  10. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  11. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  12. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  13. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  14. package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
  15. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  16. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  17. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  18. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  19. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  20. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  21. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  22. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  23. package/dist/composables/useAutoSave.js +71 -0
  24. package/dist/composables/useCortexBlueprintBridge.js +91 -0
  25. package/dist/composables/useEmailTemplateApplier.js +41 -0
  26. package/dist/composables/useFullStoryBridge.js +14 -0
  27. package/dist/composables/useGuidoStateBridge.js +48 -0
  28. package/dist/composables/useHtmlValidator.js +41 -36
  29. package/dist/composables/useRecommendation.js +46 -26
  30. package/dist/composables/useRibbonOffset.js +21 -0
  31. package/dist/composables/useSave.js +19 -16
  32. package/dist/composables/useStripo.js +40 -40
  33. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  34. package/dist/config/compiler/recommendationCompilerRules.js +25 -25
  35. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  36. package/dist/config/compiler/utils/recommendationCompilerUtils.js +107 -71
  37. package/dist/config/migrator/index.js +9 -9
  38. package/dist/config/migrator/radioButtonMigrator.js +64 -44
  39. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  40. package/dist/config/migrator/recommendation/extractors.js +27 -0
  41. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  42. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  43. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  44. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  45. package/dist/config/migrator/recommendationMigrator.js +74 -290
  46. package/dist/enums/extensions/recommendationBlock.js +97 -42
  47. package/dist/enums/onboarding.js +7 -2
  48. package/dist/enums/unsubscribe.js +39 -31
  49. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  50. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  51. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  52. package/dist/extensions/Blocks/Recommendation/block.js +60 -50
  53. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  54. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  55. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  56. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
  58. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  59. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  60. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  61. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  62. package/dist/extensions/Blocks/Recommendation/services/configService.js +76 -33
  63. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  64. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +144 -91
  65. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
  66. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  67. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
  68. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  69. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  70. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  71. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  72. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  73. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  74. package/dist/guido.css +1 -1
  75. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
  76. package/dist/node_modules/valibot/dist/index.js +450 -235
  77. package/dist/package.json.js +1 -1
  78. package/dist/services/templateLibraryApi.js +5 -4
  79. package/dist/services/unsubscribeApi.js +6 -6
  80. package/dist/src/@types/config/defaults.d.ts +5 -1
  81. package/dist/src/@types/config/index.d.ts +3 -3
  82. package/dist/src/@types/config/schemas.d.ts +217 -0
  83. package/dist/src/@types/config/types.d.ts +9 -1
  84. package/dist/src/components/Guido.vue.d.ts +1 -1
  85. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  86. package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +2 -0
  87. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  88. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  89. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  90. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  91. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  92. package/dist/src/composables/useAutoSave.d.ts +3 -0
  93. package/dist/src/composables/useConfig.d.ts +58 -0
  94. package/dist/src/composables/useCortexBlueprintBridge.d.ts +28 -0
  95. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  96. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  97. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  98. package/dist/src/composables/useRecommendation.d.ts +10 -1
  99. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  100. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  101. package/dist/src/composables/useSave.d.ts +1 -1
  102. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  103. package/dist/src/config/migrator/index.d.ts +2 -1
  104. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  105. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  106. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  107. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  108. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  109. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  110. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  111. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  112. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  113. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  114. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  115. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  116. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  117. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  118. package/dist/src/enums/extensions/recommendationBlock.d.ts +5 -1
  119. package/dist/src/enums/onboarding.d.ts +6 -0
  120. package/dist/src/enums/unsubscribe.d.ts +13 -3
  121. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  122. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  123. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  124. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  125. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  126. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  127. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  128. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +21 -3
  129. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  130. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +41 -1
  131. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  132. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  133. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  134. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  135. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  136. package/dist/src/library.d.ts +1 -1
  137. package/dist/src/stores/ai-status.d.ts +41 -0
  138. package/dist/src/stores/autosave.d.ts +12 -0
  139. package/dist/src/stores/config.d.ts +522 -0
  140. package/dist/src/stores/editor.d.ts +23 -0
  141. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  142. package/dist/src/stores/onboarding.d.ts +4 -0
  143. package/dist/src/utils/htmlEscape.d.ts +5 -0
  144. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  145. package/dist/src/utils/timeUtil.d.ts +8 -0
  146. package/dist/static/styles/components/button.css.js +16 -9
  147. package/dist/static/styles/components/loader.css.js +4 -0
  148. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  149. package/dist/stores/ai-status.js +25 -0
  150. package/dist/stores/autosave.js +17 -0
  151. package/dist/stores/editor.js +3 -1
  152. package/dist/stores/guido-email-editor.js +20 -0
  153. package/dist/stores/onboarding.js +4 -0
  154. package/dist/utils/htmlEscape.js +13 -0
  155. package/dist/utils/pairProductVariables.js +89 -88
  156. package/dist/utils/templatePreparation.js +72 -32
  157. package/dist/utils/timeUtil.js +19 -0
  158. package/package.json +7 -3
  159. package/dist/enums/displayConditions.js +0 -80
  160. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  161. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,23 +1,24 @@
1
- import { defineComponent as l, computed as i, watch as b } from "vue";
2
- import { useTranslations as x } from "../../../composables/useTranslations.js";
3
- import { SERVICE_HOVER_SELECTORS as m } from "../../../enums/onboarding.js";
4
- import { useOnboardingStore as k } from "../../../stores/onboarding.js";
5
- import { InOnboard as f } from "@useinsider/design-system-vue";
6
- const S = /* @__PURE__ */ l({
1
+ import { defineComponent as l, computed as r, watch as m } from "vue";
2
+ import { useRibbonOffset as x } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as f } from "../../../composables/useTranslations.js";
4
+ import { SERVICE_HOVER_SELECTORS as k } from "../../../enums/onboarding.js";
5
+ import { useOnboardingStore as B } from "../../../stores/onboarding.js";
6
+ import { InOnboard as C } from "@useinsider/design-system-vue";
7
+ const y = /* @__PURE__ */ l({
7
8
  __name: "GenericOnboarding",
8
- setup(B) {
9
- const e = x(), o = k(), r = i(() => `${window.innerWidth / 2 - 160}px`), c = () => {
9
+ setup(T) {
10
+ const e = f(), o = B(), { getTopPosition: i } = x(), s = r(() => `${window.innerWidth / 2 - 146}px`), c = () => {
10
11
  const t = document.querySelector("ui-editor");
11
- t != null && t.shadowRoot && m.forEach((n) => {
12
- var d;
13
- const a = (d = t.shadowRoot) == null ? void 0 : d.querySelector(n);
14
- a && a.classList.add("hover");
12
+ t != null && t.shadowRoot && k.forEach((n) => {
13
+ var g;
14
+ const d = (g = t.shadowRoot) == null ? void 0 : g.querySelector(n);
15
+ d && d.classList.add("hover");
15
16
  });
16
- }, s = i(() => [
17
+ }, a = r(() => [
17
18
  {
18
19
  classes: "guido-onboarding-blocks",
19
20
  left: "90px",
20
- top: "90px",
21
+ top: i(90),
21
22
  position: "Left Top",
22
23
  title: e("email-editor.onboarding-blocks-title"),
23
24
  description: e("email-editor.onboarding-blocks-description"),
@@ -51,8 +52,8 @@ const S = /* @__PURE__ */ l({
51
52
  },
52
53
  {
53
54
  classes: "guido-onboarding-preview",
54
- left: r.value,
55
- top: "90px",
55
+ left: s.value,
56
+ top: i(68),
56
57
  position: "Top Center",
57
58
  title: e("email-editor.onboarding-preview-title"),
58
59
  description: e("email-editor.onboarding-preview-description"),
@@ -66,18 +67,18 @@ const S = /* @__PURE__ */ l({
66
67
  o.close("genericOnboarding");
67
68
  }
68
69
  }
69
- ]), g = i(() => o.onboardings.genericOnboarding.config.length > 0 && o.onboardings.genericOnboarding.isActive), p = () => {
70
+ ]), p = r(() => o.onboardings.genericOnboarding.config.length > 0 && o.onboardings.genericOnboarding.isActive), u = () => {
70
71
  var t, n;
71
72
  (n = (t = o.getGenericCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
72
- }, u = () => {
73
+ }, b = () => {
73
74
  var t, n;
74
75
  (n = (t = o.getGenericCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
75
76
  };
76
- return b(() => o.onboardings.genericOnboarding.isActive, (t) => {
77
- t && o.setConfig("genericOnboarding", s.value);
78
- }, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, centerLeft: r, addHoverToServiceElements: c, onboardingCardsConfig: s, isVisible: g, handleNext: p, handleBack: u, InOnboard: f };
77
+ return m(() => o.onboardings.genericOnboarding.isActive, (t) => {
78
+ t && o.setConfig("genericOnboarding", a.value);
79
+ }, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, getTopPosition: i, centerLeft: s, addHoverToServiceElements: c, onboardingCardsConfig: a, isVisible: p, handleNext: u, handleBack: b, InOnboard: C };
79
80
  }
80
81
  });
81
82
  export {
82
- S as default
83
+ y as default
83
84
  };
@@ -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
  };
@@ -0,0 +1,71 @@
1
+ import { useConfig as m } from "./useConfig.js";
2
+ import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
3
+ import { useEditorStore as E } from "../stores/editor.js";
4
+ import { computed as f, watch as p, onUnmounted as y } from "vue";
5
+ const I = 18e4, r = 6e4, T = (b) => {
6
+ const { isFeatureEnabled: S } = m(), a = E(), t = A();
7
+ let i = null, c = 0;
8
+ const u = f(
9
+ () => S("autosave") && t.isOn
10
+ ), g = () => a.hasChanges && a.isInSaveableState, h = () => ({
11
+ hasChanges: a.hasChanges,
12
+ isInSaveableState: a.isInSaveableState
13
+ }), l = async (e) => {
14
+ if (!u.value) {
15
+ console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
16
+ return;
17
+ }
18
+ if (!g()) {
19
+ console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
20
+ return;
21
+ }
22
+ if (t.status === s.SAVING) {
23
+ console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
24
+ return;
25
+ }
26
+ console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
27
+ try {
28
+ if (await b() === void 0) {
29
+ console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
30
+ return;
31
+ }
32
+ a.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
33
+ } catch (o) {
34
+ console.debug("guido:autosave:error", { trigger: e, error: o }), t.status = s.ERROR;
35
+ }
36
+ }, n = () => {
37
+ const { visibilityState: e } = document;
38
+ if (console.debug("guido:autosave:visibility-change", {
39
+ visibilityState: e,
40
+ isActive: u.value
41
+ }), e !== "hidden")
42
+ return;
43
+ const o = Date.now() - c;
44
+ if (o < r) {
45
+ console.debug("guido:autosave:visibility-debounced", {
46
+ sinceLastMs: o,
47
+ debounceMs: r
48
+ });
49
+ return;
50
+ }
51
+ c = Date.now(), l("visibility");
52
+ }, d = () => {
53
+ i && (clearInterval(i), i = null);
54
+ }, v = () => {
55
+ document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
56
+ };
57
+ p(
58
+ u,
59
+ (e) => {
60
+ console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
61
+ console.debug("guido:autosave:interval-tick"), l("interval");
62
+ }, I), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), v(), t.status = s.IDLE);
63
+ },
64
+ { immediate: !0 }
65
+ ), y(() => {
66
+ d(), v(), t.status = s.IDLE, t.lastSavedAt = null;
67
+ });
68
+ };
69
+ export {
70
+ T as useAutoSave
71
+ };
@@ -0,0 +1,91 @@
1
+ import { useEmailTemplateApplier as _, resetEmailTemplateApplier as k } from "./useEmailTemplateApplier.js";
2
+ import { useToaster as g } from "./useToaster.js";
3
+ import { useTranslations as I } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as T } from "../enums/toaster.js";
5
+ import { useAiStatusStore as P } from "../stores/ai-status.js";
6
+ import { getActivePinia as W } from "pinia";
7
+ import { watch as B, onUnmounted as D } from "vue";
8
+ const v = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
9
+ if (typeof window > "u")
10
+ return !1;
11
+ try {
12
+ return window.localStorage.getItem(L) === "1";
13
+ } catch {
14
+ return !1;
15
+ }
16
+ }, F = () => {
17
+ const u = W();
18
+ if (!u)
19
+ return;
20
+ const c = u._s, p = c == null ? void 0 : c.get(x);
21
+ if (!p)
22
+ return;
23
+ const { applyTemplate: E, applyTemplateDebounced: A } = _(), i = P(), { showToaster: f } = g(), y = I(), d = (t, r) => {
24
+ const e = y(t);
25
+ return e === t ? r : e;
26
+ }, l = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), h = M(), b = (t, r) => {
27
+ h && console.debug(`[guido:cortex] msg=${t ?? "?"} type=${(r == null ? void 0 : r.type) ?? "?"}`, r);
28
+ }, m = (t) => {
29
+ if (t.blueprintType !== v)
30
+ return;
31
+ const r = t.blueprintId, e = t.blueprintData;
32
+ if (!r || !(e != null && e.html))
33
+ return;
34
+ const n = l.get(r);
35
+ n === void 0 ? (l.set(r, e.html), E(r, e)) : n !== e.html && (l.set(r, e.html), A(r, e));
36
+ }, S = (t) => {
37
+ const r = t.toolCallId ?? "?", e = t.isRunning ? "run" : "done", n = t.error ? "err" : "ok", o = `tool:${r}:${e}:${n}`;
38
+ if (!s.has(o)) {
39
+ if (s.add(o), t.error === !0) {
40
+ i.$patch({ isWorking: !1, currentTool: "", lastError: "tool_error" });
41
+ return;
42
+ }
43
+ t.isRunning === !0 ? i.$patch({
44
+ isWorking: !0,
45
+ currentTool: t.name ?? "",
46
+ lastError: ""
47
+ }) : i.$patch({ isWorking: !1, currentTool: "" });
48
+ }
49
+ }, w = (t, r) => {
50
+ r && a.has(r) || (r && a.add(r), i.$patch({ isWorking: !1, currentTool: "", lastError: t.content ?? "error" }), f({
51
+ type: T.Alert,
52
+ message: d("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
53
+ }));
54
+ }, $ = B(
55
+ () => p.messages,
56
+ (t) => {
57
+ Array.isArray(t) && t.forEach((r) => {
58
+ const e = r == null ? void 0 : r.id;
59
+ (r == null ? void 0 : r.isError) === !0 && e && !a.has(e) && (a.add(e), i.$patch({ isWorking: !1, currentTool: "", lastError: "message_error" }), f({
60
+ type: T.Alert,
61
+ message: d(
62
+ "newsletter.ai-template-failed",
63
+ "AI couldn't generate the template. Please try again."
64
+ )
65
+ }), h && console.debug(`[guido:cortex] message-level error id=${e}`, r));
66
+ const n = r == null ? void 0 : r.segments;
67
+ Array.isArray(n) && n.forEach((o) => {
68
+ if (o)
69
+ switch (b(e, o), o.type) {
70
+ case "blueprint":
71
+ m(o);
72
+ break;
73
+ case "tool":
74
+ S(o);
75
+ break;
76
+ case "error":
77
+ w(o, e);
78
+ break;
79
+ }
80
+ });
81
+ });
82
+ },
83
+ { deep: !0, immediate: !0 }
84
+ );
85
+ D(() => {
86
+ $(), l.clear(), s.clear(), a.clear(), i.$patch({ isWorking: !1, currentTool: "", lastError: "" }), k();
87
+ });
88
+ };
89
+ export {
90
+ F as useCortexBlueprintBridge
91
+ };
@@ -0,0 +1,41 @@
1
+ import { useActionsApi as u } from "./useActionsApi.js";
2
+ import { useToaster as T } from "./useToaster.js";
3
+ import { useTranslations as f } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as n } from "../enums/toaster.js";
5
+ import { ref as y } from "vue";
6
+ const h = 250, s = y({}), o = {}, j = () => {
7
+ const { updateHtmlAndCss: l } = u(), { showToaster: r } = T(), i = f(), c = (e, t, p) => {
8
+ s.value = { ...s.value, [e]: "applying" };
9
+ try {
10
+ l(t, p), s.value = { ...s.value, [e]: "applied" }, r({
11
+ type: n.Success,
12
+ message: i("newsletter.ai-template-applied")
13
+ });
14
+ } catch (a) {
15
+ s.value = { ...s.value, [e]: "failed" }, r({
16
+ type: n.Alert,
17
+ message: a instanceof Error ? a.message : "Failed to apply template"
18
+ });
19
+ }
20
+ }, m = (e) => {
21
+ const t = o[e];
22
+ t && (clearTimeout(t), delete o[e]);
23
+ };
24
+ return { applyStatus: s, applyTemplate: (e, t) => {
25
+ t.html && (m(e), c(e, t.html, t.css ?? ""));
26
+ }, applyTemplateDebounced: (e, t) => {
27
+ if (!t.html)
28
+ return;
29
+ m(e);
30
+ const { html: p } = t, a = t.css ?? "";
31
+ o[e] = setTimeout(() => {
32
+ delete o[e], c(e, p, a);
33
+ }, h);
34
+ } };
35
+ }, w = () => {
36
+ Object.values(o).forEach(clearTimeout), Object.keys(o).forEach((l) => delete o[l]), s.value = {};
37
+ };
38
+ export {
39
+ w as resetEmailTemplateApplier,
40
+ j as useEmailTemplateApplier
41
+ };
@@ -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
+ };
@@ -0,0 +1,48 @@
1
+ import { useActionsApi as g } from "./useActionsApi.js";
2
+ import { useConfigStore as I } from "../stores/config.js";
3
+ import { useEditorStore as b } from "../stores/editor.js";
4
+ import { useGuidoEmailEditorStore as E } from "../stores/guido-email-editor.js";
5
+ import { watch as c, onUnmounted as T } from "vue";
6
+ const w = 500, z = () => {
7
+ const i = b(), a = E(), l = I(), { getTemplateData: m } = g();
8
+ let e = null, n = !1;
9
+ const r = () => {
10
+ e && (clearTimeout(e), e = null);
11
+ }, s = async () => {
12
+ var t, o;
13
+ if (!(n || !i.isStripoInitialized))
14
+ try {
15
+ const { html: f, css: h } = await m(), S = ((o = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : o.templateId) ?? "";
16
+ if (n)
17
+ return;
18
+ a.$patch({
19
+ html: f ?? "",
20
+ css: h ?? "",
21
+ templateId: S,
22
+ lastUpdatedAt: Date.now()
23
+ });
24
+ } catch {
25
+ }
26
+ }, u = () => {
27
+ r(), e = setTimeout(() => {
28
+ e = null, s();
29
+ }, w);
30
+ }, d = c(
31
+ () => i.isStripoInitialized,
32
+ (t) => {
33
+ t && s();
34
+ },
35
+ { immediate: !0 }
36
+ ), p = c(
37
+ () => i.hasChanges,
38
+ (t, o) => {
39
+ i.isStripoInitialized && (t ? u() : o && (r(), s()));
40
+ }
41
+ );
42
+ T(() => {
43
+ n = !0, r(), d(), p();
44
+ });
45
+ };
46
+ export {
47
+ z as useGuidoStateBridge
48
+ };