@useinsider/guido 3.2.0 → 3.3.0-beta.e7d65e1

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 (145) 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 +90 -88
  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/AutoSaveToggle.vue.js +22 -0
  8. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  9. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  10. package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
  11. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  12. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  13. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  14. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  15. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  16. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  17. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  18. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  19. package/dist/composables/useActionsApi.js +4 -4
  20. package/dist/composables/useAutoSave.js +71 -0
  21. package/dist/composables/useFullStoryBridge.js +14 -0
  22. package/dist/composables/useRecommendation.js +46 -26
  23. package/dist/composables/useRibbonOffset.js +21 -0
  24. package/dist/composables/useSave.js +19 -16
  25. package/dist/composables/useStripo.js +40 -40
  26. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  27. package/dist/config/compiler/recommendationCompilerRules.js +79 -74
  28. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  29. package/dist/config/compiler/utils/recommendationCompilerUtils.js +107 -71
  30. package/dist/config/migrator/index.js +9 -9
  31. package/dist/config/migrator/radioButtonMigrator.js +64 -44
  32. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  33. package/dist/config/migrator/recommendation/extractors.js +27 -0
  34. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  35. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  36. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  37. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  38. package/dist/config/migrator/recommendationMigrator.js +74 -290
  39. package/dist/enums/extensions/recommendationBlock.js +2 -1
  40. package/dist/enums/onboarding.js +7 -2
  41. package/dist/enums/unsubscribe.js +34 -27
  42. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
  43. package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
  44. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  45. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  46. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  47. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  48. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  49. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
  51. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  52. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  53. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  54. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  55. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  56. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  57. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +123 -79
  58. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
  59. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  60. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
  61. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  62. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  63. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  64. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  65. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  66. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  67. package/dist/guido.css +1 -1
  68. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
  69. package/dist/node_modules/valibot/dist/index.js +450 -235
  70. package/dist/package.json.js +1 -1
  71. package/dist/services/templateLibraryApi.js +5 -4
  72. package/dist/services/unsubscribeApi.js +6 -6
  73. package/dist/src/@types/config/defaults.d.ts +5 -1
  74. package/dist/src/@types/config/index.d.ts +3 -3
  75. package/dist/src/@types/config/schemas.d.ts +217 -0
  76. package/dist/src/@types/config/types.d.ts +9 -1
  77. package/dist/src/components/Guido.vue.d.ts +1 -1
  78. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  79. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  80. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  81. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  82. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  83. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  84. package/dist/src/composables/useActionsApi.d.ts +1 -1
  85. package/dist/src/composables/useAutoSave.d.ts +3 -0
  86. package/dist/src/composables/useConfig.d.ts +58 -0
  87. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  88. package/dist/src/composables/useRecommendation.d.ts +10 -1
  89. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  90. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  91. package/dist/src/composables/useSave.d.ts +1 -1
  92. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  93. package/dist/src/config/migrator/index.d.ts +2 -1
  94. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  95. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  96. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  97. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  98. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  99. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  100. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  101. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  102. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  103. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  104. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  105. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  106. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  107. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  108. package/dist/src/enums/onboarding.d.ts +6 -0
  109. package/dist/src/enums/unsubscribe.d.ts +5 -0
  110. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  111. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  112. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  113. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  114. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  115. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  116. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  117. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  118. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  119. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
  120. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  121. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  122. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  123. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  124. package/dist/src/library.d.ts +1 -1
  125. package/dist/src/stores/autosave.d.ts +12 -0
  126. package/dist/src/stores/config.d.ts +522 -0
  127. package/dist/src/stores/editor.d.ts +23 -0
  128. package/dist/src/stores/onboarding.d.ts +4 -0
  129. package/dist/src/utils/htmlEscape.d.ts +5 -0
  130. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  131. package/dist/src/utils/timeUtil.d.ts +8 -0
  132. package/dist/static/styles/components/button.css.js +16 -9
  133. package/dist/static/styles/components/loader.css.js +4 -0
  134. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  135. package/dist/stores/autosave.js +17 -0
  136. package/dist/stores/editor.js +3 -1
  137. package/dist/stores/onboarding.js +4 -0
  138. package/dist/utils/htmlEscape.js +13 -0
  139. package/dist/utils/pairProductVariables.js +89 -88
  140. package/dist/utils/templatePreparation.js +72 -32
  141. package/dist/utils/timeUtil.js +19 -0
  142. package/package.json +7 -3
  143. package/dist/enums/displayConditions.js +0 -80
  144. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  145. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,131 +1,133 @@
1
- import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
2
- import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
3
- import { usePartner as Z } from "../composables/usePartner.js";
4
- import { useStripo as ee } from "../composables/useStripo.js";
1
+ import { defineComponent as J, defineAsyncComponent as I, ref as W, computed as B, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
+ import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
3
+ import { usePartner as ee } from "../composables/usePartner.js";
4
+ import { useStripo as oe } from "../composables/useStripo.js";
5
5
  import { useTimerClone as te } from "../composables/useTimerClone.js";
6
- import { migrate as W } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as B } from "../enums/defaults.js";
8
- import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
9
- import ne from "./organisms/base/Toaster.vue.js";
10
- import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
11
- import re from "./organisms/header/HeaderWrapper.vue.js";
12
- import ce from "./organisms/LoadingWrapper.vue.js";
13
- import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
14
- import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
15
- import { useStripoApi as me } from "../services/stripoApi.js";
16
- import { useConfigStore as de } from "../stores/config.js";
17
- import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
18
- import { useEditorStore as ue } from "../stores/editor.js";
19
- import { usePreviewStore as pe } from "../stores/preview.js";
20
- import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
21
- const Re = /* @__PURE__ */ j({
6
+ import { migrate as H } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as x } from "../enums/defaults.js";
8
+ import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
9
+ import re from "./organisms/AutoSaveController.vue.js";
10
+ import se from "./organisms/base/Toaster.vue.js";
11
+ import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
12
+ import ae from "./organisms/header/HeaderWrapper.vue.js";
13
+ import ie from "./organisms/LoadingWrapper.vue.js";
14
+ import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
15
+ import de from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
16
+ import { useStripoApi as le } from "../services/stripoApi.js";
17
+ import { useConfigStore as ue } from "../stores/config.js";
18
+ import { useDynamicContentStore as pe } from "../stores/dynamic-content.js";
19
+ import { useEditorStore as fe } from "../stores/editor.js";
20
+ import { usePreviewStore as ve } from "../stores/preview.js";
21
+ import { useUnsubscribeStore as ye } from "../stores/unsubscribe.js";
22
+ const We = /* @__PURE__ */ J({
22
23
  __name: "Guido",
23
24
  props: {
24
25
  config: null
25
26
  },
26
27
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
27
- setup(H, { expose: x, emit: s }) {
28
- const b = H, G = R(
28
+ setup(G, { expose: z, emit: n }) {
29
+ const g = G, q = I(
29
30
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
30
- ), z = R(
31
+ ), K = I(
31
32
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
32
- ), S = A(), d = A(), l = le(), g = fe(), a = de();
33
- a.init(b.config);
34
- const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
33
+ ), w = W(), u = W(), p = pe(), E = ye(), i = ue();
34
+ i.init(g.config);
35
+ const f = fe(), V = ve(), m = B(() => f.hasChanges), { isTestPartner: $ } = ee(), D = () => {
35
36
  var e;
36
- return (e = S.value) == null ? void 0 : e.handleSave(!0);
37
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
37
38
  }, {
38
- templateId: p,
39
- userId: E,
40
- partnerName: D,
41
- username: C,
42
- template: t,
43
- editor: r
44
- } = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
45
- u.templateId = p;
46
- const v = {
47
- emailId: p,
48
- userId: E,
49
- username: C,
50
- partnerName: D,
51
- savedModulesFolderName: k,
52
- defaultModulesFolderName: F
53
- }, L = {
54
- preselectedDynamicContentList: f,
39
+ templateId: v,
40
+ userId: C,
41
+ partnerName: T,
42
+ username: k,
43
+ template: o,
44
+ editor: s
45
+ } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || x.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || x.DEFAULT_MODULES;
46
+ f.templateId = v;
47
+ const h = {
48
+ emailId: v,
49
+ userId: C,
50
+ username: k,
51
+ partnerName: T,
52
+ savedModulesFolderName: L,
53
+ defaultModulesFolderName: U
54
+ }, _ = {
55
+ preselectedDynamicContentList: y,
55
56
  onReady: () => {
56
- console.debug("guido:ready"), s("ready");
57
+ console.debug("guido:ready"), n("ready");
57
58
  }
58
- }, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
59
+ }, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = le(), { cloneTimersOnSave: P, hasTimerBlocks: A } = te(), j = B(() => {
59
60
  var e;
60
- return !((e = a.ui) != null && e.showHeader);
61
+ return !((e = i.ui) != null && e.showHeader);
61
62
  });
62
- Y({
63
+ Z({
63
64
  onBack: () => {
64
- console.debug("guido:back"), s("back");
65
+ console.debug("guido:back"), n("back");
65
66
  },
66
67
  onSaveStart: () => {
67
- console.debug("guido:save:start"), s("save:start");
68
+ console.debug("guido:save:start"), n("save:start");
68
69
  },
69
70
  onSaveComplete: (e) => {
70
- const n = { ...e, metadata: v };
71
- console.debug("guido:save:complete", n), s("save:complete", n);
71
+ const t = { ...e, metadata: h };
72
+ console.debug("guido:save:complete", t), n("save:complete", t);
72
73
  },
73
74
  onTestEmailClick: () => {
74
- console.debug("guido:test-email:click"), s("test-email:click");
75
+ console.debug("guido:test-email:click"), n("test-email:click");
75
76
  }
76
77
  });
77
- const P = (e) => {
78
- console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
- }, N = () => {
78
+ const N = (e) => {
79
+ console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
80
+ }, R = () => {
80
81
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
82
  };
82
- J(() => i.value, () => {
83
- s("on-change", i.value);
83
+ Q(() => m.value, () => {
84
+ n("on-change", m.value);
84
85
  });
85
- const y = (e) => {
86
- const n = e, { attribute: o, position: $ } = n.detail;
87
- console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
86
+ const S = (e) => {
87
+ const t = e, { attribute: l, position: a } = t.detail;
88
+ console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
88
89
  };
89
90
  let c = null;
90
- const h = () => {
91
- var n;
92
- const e = document.querySelector(oe);
93
- (n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
91
+ const b = () => {
92
+ var t;
93
+ const e = document.querySelector(ne);
94
+ (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
94
95
  };
95
- return Q(async () => {
96
- var n;
97
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
98
- const e = (n = d.value) == null ? void 0 : n.parentElement;
99
- e && (c = new ResizeObserver(h), c.observe(e));
96
+ return X(async () => {
97
+ var t, l;
98
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
99
+ const e = (t = u.value) == null ? void 0 : t.parentElement;
100
+ e && (c = new ResizeObserver(b), c.observe(e));
100
101
  try {
101
- g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
102
- let o = {
103
- html: m && await W(m),
104
- css: T
102
+ E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
103
+ const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
104
+ let r = {
105
+ html: d && await H(d, a),
106
+ css: F
105
107
  };
106
- o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
107
- } catch (o) {
108
- console.error("Failed to initialize Stripo editor:", o);
108
+ r.html || (r = await O(), r.html = await H(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
109
+ } catch (a) {
110
+ console.error("Failed to initialize Stripo editor:", a);
109
111
  }
110
- document.addEventListener("dynamic-content:open", y);
111
- }), X(() => {
112
- c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
112
+ document.addEventListener("dynamic-content:open", S);
113
+ }), Y(() => {
114
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S);
113
115
  try {
114
116
  window.UIEditor.removeEditor();
115
117
  } catch {
116
118
  console.debug("Failed to remove Stripo editor: No editor found");
117
119
  }
118
- a.reset();
119
- }), x({
120
+ i.reset();
121
+ }), z({
120
122
  dynamicContent: {
121
- insert: P,
122
- close: N
123
+ insert: N,
124
+ close: R
123
125
  },
124
- hasChanges: i,
125
- saveSilent: w
126
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
126
+ hasChanges: m,
127
+ saveSilent: D
128
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: N, closeDynamicContent: R, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: re, Toaster: se, FilterSelectionDrawer: ce, HeaderWrapper: ae, LoadingWrapper: ie, SaveAsTemplateDrawer: me, UnsubscribeWrapper: de };
127
129
  }
128
130
  });
129
131
  export {
130
- Re as default
132
+ We as default
131
133
  };
@@ -0,0 +1,17 @@
1
+ import n from "./AutoSaveController.vue2.js";
2
+ import t from "../../_virtual/_plugin-vue2_normalizer.js";
3
+ var o = function() {
4
+ var r = this, e = r._self._c;
5
+ return r._self._setupProxy, e("div", { staticClass: "d-n" });
6
+ }, s = [], _ = /* @__PURE__ */ t(
7
+ n,
8
+ o,
9
+ s,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const f = _.exports;
15
+ export {
16
+ f as default
17
+ };
@@ -0,0 +1,13 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { useAutoSave as r } from "../../composables/useAutoSave.js";
3
+ import { useSave as s } from "../../composables/useSave.js";
4
+ const f = /* @__PURE__ */ t({
5
+ __name: "AutoSaveController",
6
+ setup(a) {
7
+ const { save: e } = s(), o = () => e(!1, !0);
8
+ return r(o), { __sfc: !0, save: e, backgroundSave: o };
9
+ }
10
+ });
11
+ export {
12
+ f as default
13
+ };
@@ -0,0 +1,22 @@
1
+ import o from "./AutoSaveToggle.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var e = this, a = e._self._c, t = e._self._setupProxy;
6
+ return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
7
+ t.isHovered = !0;
8
+ }, mouseleave: function(s) {
9
+ t.isHovered = !1;
10
+ } } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === t.AUTOSAVE_STATUS.SAVING ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
11
+ }, l = [], r = /* @__PURE__ */ i(
12
+ o,
13
+ n,
14
+ l,
15
+ !1,
16
+ null,
17
+ "2c964af4"
18
+ );
19
+ const d = r.exports;
20
+ export {
21
+ d as default
22
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as i, ref as f, computed as u } from "vue";
2
+ import { useConfig as l } from "../../../composables/useConfig.js";
3
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
4
+ import { useAutosaveStore as c, AUTOSAVE_STATUS as t } from "../../../stores/autosave.js";
5
+ import { useEditorStore as S } from "../../../stores/editor.js";
6
+ import { formatLocalTime as d } from "../../../utils/timeUtil.js";
7
+ import { InToggle as g, InLoading as _, InInfoBox as A } from "@useinsider/design-system-vue";
8
+ const U = /* @__PURE__ */ i({
9
+ __name: "AutoSaveToggle",
10
+ setup(v) {
11
+ const { isFeatureEnabled: e } = l(), r = S(), o = c(), s = p(), n = f(!1), a = u(() => o.status !== t.SAVED || !o.lastSavedAt ? "" : d(o.lastSavedAt));
12
+ return { __sfc: !0, isFeatureEnabled: e, editorStore: r, autosaveStore: o, trans: s, isHovered: n, lastSavedLabel: a, toggle: (m) => {
13
+ o.isOn = m;
14
+ }, AUTOSAVE_STATUS: t, InInfoBox: A, InLoading: _, InToggle: g };
15
+ }
16
+ });
17
+ export {
18
+ U as default
19
+ };
@@ -1,11 +1,11 @@
1
- import i from "./RightSlot.vue2.js";
2
- import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var o = function() {
4
- var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f a-i-c" }, [t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-3", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : s._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
6
- }, a = [], n = /* @__PURE__ */ r(
7
- i,
8
- o,
1
+ import s from "./RightSlot.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var i = this, e = i._self._c, t = i._self._setupProxy;
5
+ return e("div", { staticClass: "d-f a-i-c" }, [t.editorStore.isVersionHistoryOpen ? i._e() : e(t.AutoSaveToggle), t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-1", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : i._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
6
+ }, a = [], n = /* @__PURE__ */ o(
7
+ s,
8
+ r,
9
9
  a,
10
10
  !1,
11
11
  null,
@@ -1,22 +1,23 @@
1
1
  import { defineComponent as a, ref as f, computed as p } from "vue";
2
2
  import { useConfig as u } from "../../../composables/useConfig.js";
3
3
  import { useTranslations as d } from "../../../composables/useTranslations.js";
4
- import { useEditorStore as c } from "../../../stores/editor.js";
5
- import { InChips as l } from "@useinsider/design-system-vue";
6
- import _ from "./EditorActions.vue.js";
7
- import S from "./version-history/RestoreButton.vue.js";
8
- const x = /* @__PURE__ */ a({
4
+ import { useEditorStore as l } from "../../../stores/editor.js";
5
+ import { InChips as c } from "@useinsider/design-system-vue";
6
+ import _ from "./AutoSaveToggle.vue.js";
7
+ import S from "./EditorActions.vue.js";
8
+ import g from "./version-history/RestoreButton.vue.js";
9
+ const T = /* @__PURE__ */ a({
9
10
  __name: "RightSlot",
10
11
  setup(h, { expose: r }) {
11
- const { isFeatureEnabled: o } = u(), n = d(), i = c(), t = f(null), s = p(() => o("liquidSyntax"));
12
+ const { isFeatureEnabled: o } = u(), i = d(), n = l(), t = f(null), s = p(() => o("liquidSyntax"));
12
13
  return r({
13
14
  handleSave: (m) => {
14
15
  var e;
15
16
  return (e = t.value) == null ? void 0 : e.handleSave(m);
16
17
  }
17
- }), { __sfc: !0, isFeatureEnabled: o, trans: n, editorStore: i, editorActionsRef: t, isLiquidEnabled: s, InChips: l, EditorActions: _, RestoreButton: S };
18
+ }), { __sfc: !0, isFeatureEnabled: o, trans: i, editorStore: n, editorActionsRef: t, isLiquidEnabled: s, InChips: c, AutoSaveToggle: _, EditorActions: S, RestoreButton: g };
18
19
  }
19
20
  });
20
21
  export {
21
- x as default
22
+ T as default
22
23
  };
@@ -1,37 +1,57 @@
1
- import { defineComponent as p, computed as e, watch as m } from "vue";
2
- import { useTranslations as g } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as u } from "../../../stores/onboarding.js";
4
- import { InOnboard as b } from "@useinsider/design-system-vue";
5
- const O = /* @__PURE__ */ p({
1
+ import { defineComponent as u, computed as d, watch as b, nextTick as f } from "vue";
2
+ import { useTranslations as C } from "../../../composables/useTranslations.js";
3
+ import { HEADER_SELECTOR as O, AMP_TOGGLE_BUTTON_SELECTOR as _, AMP_TOGGLE_WRAPPER_SELECTOR as T, POPOVER_LEFT_OFFSET as g, POPOVER_TOP_GAP as E } from "../../../enums/onboarding.js";
4
+ import { useOnboardingStore as x } from "../../../stores/onboarding.js";
5
+ import { InOnboard as P } from "@useinsider/design-system-vue";
6
+ const G = /* @__PURE__ */ u({
6
7
  __name: "AMPOnboarding",
7
- setup(l) {
8
- const i = g(), o = u(), r = e(() => `${window.innerWidth / 2 - 110}px`), a = e(() => [
9
- {
10
- classes: "guido-amp-onboarding",
11
- left: r.value,
12
- top: "70px",
13
- position: "Top Center",
14
- title: i("email-editor.onboarding-amp-title"),
15
- description: i("email-editor.onboarding-amp-description"),
16
- imageSource: "",
17
- backButtonClick: () => {
18
- },
19
- nextButtonType: "text",
20
- nextButtonText: i("action-builder.ok"),
21
- nextButtonClick: () => void o.close("ampOnboarding")
22
- }
23
- ]), d = e(() => o.onboardings.ampOnboarding.config.length > 0 && o.onboardings.ampOnboarding.isActive), s = () => {
24
- var n, t;
25
- (t = (n = o.getAmpCurrentCard) == null ? void 0 : n.nextButtonClick) == null || t.call(n);
26
- }, c = () => {
27
- var n, t;
28
- (t = (n = o.getAmpCurrentCard) == null ? void 0 : n.backButtonClick) == null || t.call(n);
8
+ setup(R) {
9
+ const e = C(), o = x(), r = () => {
10
+ const t = document.querySelector(O), n = document.querySelector(_), c = n == null ? void 0 : n.closest(T);
11
+ if (!c || !t)
12
+ return {
13
+ left: `${((t == null ? void 0 : t.offsetWidth) ?? window.innerWidth) / 2 - g}px`,
14
+ top: "68px"
15
+ };
16
+ const s = t.getBoundingClientRect(), i = c.getBoundingClientRect();
17
+ return {
18
+ left: `${i.left - s.left + i.width / 2 - g}px`,
19
+ top: `${i.bottom - s.top + E}px`
20
+ };
21
+ }, a = d(() => {
22
+ const { left: t, top: n } = r();
23
+ return [
24
+ {
25
+ classes: "guido-amp-onboarding",
26
+ left: t,
27
+ top: n,
28
+ position: "Top Center",
29
+ title: e("email-editor.onboarding-amp-title"),
30
+ description: e("email-editor.onboarding-amp-description"),
31
+ imageSource: "",
32
+ backButtonClick: () => {
33
+ },
34
+ nextButtonType: "text",
35
+ nextButtonText: e("action-builder.ok"),
36
+ nextButtonClick: () => void o.close("ampOnboarding")
37
+ }
38
+ ];
39
+ }), l = d(() => o.onboardings.ampOnboarding.config.length > 0 && o.onboardings.ampOnboarding.isActive), p = () => {
40
+ var t, n;
41
+ (n = (t = o.getAmpCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
42
+ }, m = () => {
43
+ var t, n;
44
+ (n = (t = o.getAmpCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
29
45
  };
30
- return m(() => o.onboardings.ampOnboarding.isActive, (n) => {
31
- n && o.setConfig("ampOnboarding", a.value);
32
- }, { immediate: !0 }), { __sfc: !0, trans: i, onboardingStore: o, centerLeft: r, onboardingCardsConfig: a, isVisible: d, handleNext: s, handleBack: c, InOnboard: b };
46
+ return b(
47
+ () => o.onboardings.ampOnboarding.isActive,
48
+ async (t) => {
49
+ t && (await f(), o.setConfig("ampOnboarding", a.value));
50
+ },
51
+ { immediate: !0 }
52
+ ), { __sfc: !0, trans: e, onboardingStore: o, getTogglePosition: r, onboardingCardsConfig: a, isVisible: l, handleNext: p, handleBack: m, InOnboard: P };
33
53
  }
34
54
  });
35
55
  export {
36
- O as default
56
+ G as default
37
57
  };
@@ -13,7 +13,7 @@ var l = function() {
13
13
  p,
14
14
  !1,
15
15
  null,
16
- "29b9af29"
16
+ "7419ae06"
17
17
  );
18
18
  const S = _.exports;
19
19
  export {
@@ -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 {