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

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 (52) hide show
  1. package/README.md +5 -5
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +76 -78
  4. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  5. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  6. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  7. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  8. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
  9. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  10. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  11. package/dist/composables/useHtmlCompiler.js +26 -37
  12. package/dist/composables/useHtmlValidator.js +0 -2
  13. package/dist/composables/useSave.js +41 -84
  14. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  15. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  16. package/dist/extensions/Blocks/Items/block.js +98 -49
  17. package/dist/extensions/Blocks/Items/constants/currency.js +11 -0
  18. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
  19. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
  20. package/dist/extensions/Blocks/Items/template.js +153 -152
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
  22. package/dist/guido.css +1 -1
  23. package/dist/src/components/Guido.vue.d.ts +1 -17
  24. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  25. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  26. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  27. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  28. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  29. package/dist/src/composables/useSave.d.ts +1 -6
  30. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  31. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  32. package/dist/src/extensions/Blocks/Items/block.d.ts +21 -0
  33. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +19 -0
  34. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  35. package/dist/src/stores/config.d.ts +0 -5
  36. package/dist/src/utils/templatePreparation.d.ts +0 -30
  37. package/dist/stores/config.js +6 -13
  38. package/dist/utils/pairProductVariables.js +60 -59
  39. package/dist/utils/templatePreparation.js +25 -28
  40. package/package.json +2 -2
  41. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  42. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  43. package/dist/composables/useSaveValidation.js +0 -279
  44. package/dist/composables/useSaveValidationRollout.js +0 -9
  45. package/dist/enums/save-validation.js +0 -4
  46. package/dist/src/@types/save-validation.d.ts +0 -19
  47. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  48. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  49. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  50. package/dist/src/enums/save-validation.d.ts +0 -27
  51. package/dist/src/stores/save-validation.d.ts +0 -22
  52. package/dist/stores/save-validation.js +0 -30
package/README.md CHANGED
@@ -633,16 +633,16 @@ toaster fires (useful before the host has wired the catalog).
633
633
 
634
634
  ```bash
635
635
  # Install
636
- bun install
636
+ npm install
637
637
 
638
638
  # Start dev server
639
- bun start
639
+ npm start
640
640
 
641
641
  # Build
642
- bun run build
642
+ npm run build
643
643
 
644
644
  # Lint & type-check
645
- bun run lint
645
+ npm run lint
646
646
  ```
647
647
 
648
648
  ### Environment Variables
@@ -660,7 +660,7 @@ VITE_STRIPO_USER=your_user
660
660
 
661
661
  ```bash
662
662
  # Build the package
663
- bun run build
663
+ npm run build
664
664
 
665
665
  # Create tarball
666
666
  npm pack
@@ -1,20 +1,20 @@
1
- import a from "./Guido.vue2.js";
1
+ import i from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import i from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : o._e(), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], d = /* @__PURE__ */ i(
10
- a,
9
+ }, n = [], s = /* @__PURE__ */ a(
10
+ i,
11
11
  t,
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "f02fdde0"
15
+ "b0d3b445"
16
16
  );
17
- const c = d.exports;
17
+ const l = s.exports;
18
18
  export {
19
- c as default
19
+ l as default
20
20
  };
@@ -1,32 +1,30 @@
1
- import { defineComponent as J, defineAsyncComponent as M, ref as B, computed as U, watch as _, onMounted as Q, onUnmounted as X } from "vue";
2
- import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ee } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as oe } from "../composables/usePartner.js";
6
- import { useSaveValidationRollout as te } from "../composables/useSaveValidationRollout.js";
7
- import { useStripo as ne } from "../composables/useStripo.js";
8
- import { useTimerClone as re } from "../composables/useTimerClone.js";
1
+ import { defineComponent as j, defineAsyncComponent as R, ref as B, computed as U, watch as _, onMounted as J, onUnmounted as Q } from "vue";
2
+ import { useCortexBlueprintBridge as X } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ee } from "../composables/usePartner.js";
6
+ import { useStripo as te } from "../composables/useStripo.js";
7
+ import { useTimerClone as oe } from "../composables/useTimerClone.js";
9
8
  import { migrate as N } from "../config/migrator/index.js";
10
9
  import { ModuleFolderDefaults as O } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import ie from "./organisms/AutoSaveController.vue.js";
14
- import ce from "./organisms/base/Toaster.vue.js";
15
- import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import me from "./organisms/header/HeaderWrapper.vue.js";
17
- import le from "./organisms/LoadingWrapper.vue.js";
18
- import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
21
- import { useStripoApi as ve } from "../services/stripoApi.js";
22
- import { useConfigStore as ye } from "../stores/config.js";
23
- import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
10
+ import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import se from "./organisms/AutoSaveController.vue.js";
13
+ import ae from "./organisms/base/Toaster.vue.js";
14
+ import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import ce from "./organisms/header/HeaderWrapper.vue.js";
16
+ import de from "./organisms/LoadingWrapper.vue.js";
17
+ import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ue } from "../services/stripoApi.js";
20
+ import { useConfigStore as pe } from "../stores/config.js";
21
+ import { useDynamicContentStore as fe } from "../stores/dynamic-content.js";
24
22
  import { useEditorStore as P } from "../stores/editor.js";
25
- import { usePreviewStore as he } from "../stores/preview.js";
26
- import { useTemplateStore as be } from "../stores/template.js";
27
- import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
23
+ import { usePreviewStore as ye } from "../stores/preview.js";
24
+ import { useTemplateStore as ve } from "../stores/template.js";
25
+ import { useUnsubscribeStore as he } from "../stores/unsubscribe.js";
28
26
  import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
29
- const Je = /* @__PURE__ */ J({
27
+ const ze = /* @__PURE__ */ j({
30
28
  __name: "Guido",
31
29
  props: {
32
30
  config: null,
@@ -34,121 +32,121 @@ const Je = /* @__PURE__ */ J({
34
32
  },
35
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
36
34
  setup(W, { expose: x, emit: r }) {
37
- const a = W, G = M(
35
+ const a = W, G = R(
38
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
39
- ), H = M(
37
+ ), H = R(
40
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
41
- ), S = B(), l = B(), u = Se(), h = ge(), t = ye();
42
- a.ready && t.init(a.config);
43
- const c = P(), V = he(), m = U(() => c.hasChanges), { isTestPartner: $ } = oe(), { isEnabled: z } = te(), b = () => {
44
- var o;
45
- return (o = S.value) == null ? void 0 : o.handleSave(!0);
46
- }, g = (o) => {
47
- c.loadingStatus = o;
39
+ ), h = B(), l = B(), u = fe(), S = he(), o = pe();
40
+ a.ready && o.init(a.config);
41
+ const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
42
+ var t;
43
+ return (t = h.value) == null ? void 0 : t.handleSave(!0);
44
+ }, b = (t) => {
45
+ c.loadingStatus = t;
48
46
  };
49
- Y(), ee();
47
+ X(), Z();
50
48
  const p = () => {
51
- var o, e;
49
+ var t, e;
52
50
  return {
53
- emailId: t.templateId,
54
- userId: t.userId,
55
- username: t.username,
56
- partnerName: t.partnerName,
57
- savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || O.SAVED_MODULES,
58
- defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
51
+ emailId: o.templateId,
52
+ userId: o.userId,
53
+ username: o.username,
54
+ partnerName: o.partnerName,
55
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || O.SAVED_MODULES,
56
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
59
57
  };
60
- }, { initPlugin: E, preloadRuntime: w } = ne(), { getDefaultTemplate: D } = ve(), { cloneTimersOnSave: C, hasTimerBlocks: k } = re(), q = U(() => {
61
- var o;
62
- return !((o = t.ui) != null && o.showHeader);
58
+ }, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: k } = oe(), q = U(() => {
59
+ var t;
60
+ return !((t = o.ui) != null && t.showHeader);
63
61
  });
64
- Z({
62
+ Y({
65
63
  onBack: () => {
66
64
  console.debug("guido:back"), r("back");
67
65
  },
68
66
  onSaveStart: () => {
69
67
  console.debug("guido:save:start"), r("save:start");
70
68
  },
71
- onSaveComplete: (o) => {
72
- const e = { ...o, metadata: p() };
69
+ onSaveComplete: (t) => {
70
+ const e = { ...t, metadata: p() };
73
71
  console.debug("guido:save:complete", e), r("save:complete", e);
74
72
  },
75
73
  onTestEmailClick: () => {
76
74
  console.debug("guido:test-email:click"), r("test-email:click");
77
75
  }
78
76
  });
79
- const T = (o) => {
80
- console.debug("dynamic-content:close", o), u.setSelectedDynamicContent(o), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: o }));
77
+ const T = (t) => {
78
+ console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
81
79
  }, F = () => {
82
80
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
83
81
  };
84
82
  _(() => m.value, () => {
85
83
  r("on-change", m.value);
86
84
  });
87
- const f = (o) => {
88
- const e = o, { attribute: s, position: d } = e.detail;
85
+ const f = (t) => {
86
+ const e = t, { attribute: s, position: d } = e.detail;
89
87
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
90
88
  };
91
89
  let i = null;
92
- const v = () => {
90
+ const y = () => {
93
91
  var e;
94
- const o = document.querySelector(se);
95
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(o == null ? void 0 : o.offsetHeight) ?? 0}px`);
96
- }, y = async () => {
97
- var o;
92
+ const t = document.querySelector(ne);
93
+ (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
94
+ }, v = async () => {
95
+ var t;
98
96
  try {
99
- t.initialized || t.init(a.config), c.templateId = t.templateId;
100
- const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
101
- h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
102
- const L = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, R = t.isFeatureEnabled("linkTrackingIds");
97
+ o.initialized || o.init(a.config), c.templateId = o.templateId;
98
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
99
+ S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
100
+ const L = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
103
101
  let n = {
104
102
  html: s && await N(s, L),
105
103
  css: d
106
104
  };
107
- n.html || (n = await D(), n.html = await N(n.html, L));
108
- const K = R ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
109
- k(n.html) && (n.html = await C(n.html)), R && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
110
- const j = {
105
+ n.html || (n = await C(), n.html = await N(n.html, L));
106
+ const K = M ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
107
+ k(n.html) && (n.html = await D(n.html)), M && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
108
+ const V = {
111
109
  preselectedDynamicContentList: I,
112
110
  onReady: () => {
113
111
  console.debug("guido:ready"), r("ready");
114
112
  }
115
113
  };
116
- await E(n, p(), j), u.selectedDynamicContentList = I;
114
+ await E(n, p(), V), u.selectedDynamicContentList = I;
117
115
  } catch (e) {
118
116
  console.error("Failed to initialize Stripo editor:", e);
119
117
  }
120
118
  };
121
- return Q(async () => {
119
+ return J(async () => {
122
120
  var e;
123
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), P().$reset(), be().$reset(), v();
124
- const o = (e = l.value) == null ? void 0 : e.parentElement;
125
- if (o && (i = new ResizeObserver(v), i.observe(o)), w(), a.ready)
126
- await y();
121
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
122
+ const t = (e = l.value) == null ? void 0 : e.parentElement;
123
+ if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
124
+ await v();
127
125
  else {
128
126
  const s = _(() => a.ready, (d) => {
129
- d && (s(), y());
127
+ d && (s(), v());
130
128
  });
131
129
  }
132
130
  document.addEventListener("dynamic-content:open", f);
133
- }), X(() => {
131
+ }), Q(() => {
134
132
  i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
135
133
  try {
136
134
  window.UIEditor.removeEditor();
137
135
  } catch {
138
136
  console.debug("Failed to remove Stripo editor: No editor found");
139
137
  }
140
- t.reset();
138
+ o.reset();
141
139
  }), x({
142
140
  dynamicContent: {
143
141
  insert: T,
144
142
  close: F
145
143
  },
146
144
  hasChanges: m,
147
- saveSilent: b,
148
- setLoading: g
149
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: t, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: $, isSaveValidationEnabled: z, saveSilent: b, setLoading: g, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: D, cloneTimersOnSave: C, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: v, startEditor: y, AutoSaveController: ie, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe, ValidationErrorDrawer: fe };
145
+ saveSilent: g,
146
+ setLoading: b
147
+ }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: a, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: z, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: se, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: ce, LoadingWrapper: de, SaveAsTemplateDrawer: me, UnsubscribeWrapper: le };
150
148
  }
151
149
  });
152
150
  export {
153
- Je as default
151
+ ze as default
154
152
  };
@@ -1,14 +1,13 @@
1
- import { defineComponent as r } from "vue";
2
- import { useAutoSave as s } from "../../composables/useAutoSave.js";
3
- import { useSave as n } from "../../composables/useSave.js";
4
- import { useSaveValidationRollout as u } from "../../composables/useSaveValidationRollout.js";
5
- const v = /* @__PURE__ */ r({
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({
6
5
  __name: "AutoSaveController",
7
- setup(m) {
8
- const { save: e, saveRawOnly: o } = n(), { isEnabled: t } = u(), a = () => t.value ? o() : e(!1, !0);
9
- return s(a), { __sfc: !0, save: e, saveRawOnly: o, isEnabled: t, backgroundSave: a };
6
+ setup(a) {
7
+ const { save: e } = s(), o = () => e(!1, !0);
8
+ return r(o), { __sfc: !0, save: e, backgroundSave: o };
10
9
  }
11
10
  });
12
11
  export {
13
- v as default
12
+ f as default
14
13
  };
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var u = function() {
5
5
  var s, i, n, a;
6
6
  var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
@@ -15,7 +15,7 @@ var u = function() {
15
15
  p,
16
16
  !1,
17
17
  null,
18
- "44d8e7c8"
18
+ "6e711fd7"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,97 +1,66 @@
1
- import { defineComponent as R, computed as l, ref as m } from "vue";
2
- import { useActionsApi as D } from "../../../composables/useActionsApi.js";
3
- import { useConfig as F } from "../../../composables/useConfig.js";
4
- import { useExport as z } from "../../../composables/useExport.js";
5
- import { useTestEmailClick as I } from "../../../composables/useGuidoActions.js";
6
- import { useHtmlCompiler as P } from "../../../composables/useHtmlCompiler.js";
7
- import { useSave as j } from "../../../composables/useSave.js";
8
- import { useSaveValidation as G } from "../../../composables/useSaveValidation.js";
9
- import { useSaveValidationRollout as J } from "../../../composables/useSaveValidationRollout.js";
10
- import { useToaster as K } from "../../../composables/useToaster.js";
11
- import { useTranslations as N } from "../../../composables/useTranslations.js";
12
- import { useVersionHistoryApi as Q } from "../../../composables/useVersionHistoryApi.js";
13
- import { useLiquidValidator as U } from "../../../composables/validators/useLiquidValidator.js";
14
- import { ToasterTypeOptions as W } from "../../../enums/toaster.js";
15
- import { useConfigStore as X } from "../../../stores/config.js";
16
- import { useEditorStore as Y } from "../../../stores/editor.js";
17
- import { useSaveValidationStore as Z } from "../../../stores/save-validation.js";
18
- import { useTemplateStore as $ } from "../../../stores/template.js";
19
- import { getTooltipOptions as tt } from "../../../utils/tooltipUtils.js";
20
- import { InButtonV2 as ot } from "@useinsider/design-system-vue";
21
- import { storeToRefs as et } from "pinia";
22
- import rt from "./MigrationConfirmModal.vue.js";
23
- const At = /* @__PURE__ */ R({
1
+ import { defineComponent as O, ref as n, computed as h } from "vue";
2
+ import { useActionsApi as q } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as b } from "../../../composables/useConfig.js";
4
+ import { useExport as k } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as B } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as D } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as F } from "../../../composables/useSave.js";
8
+ import { useTranslations as L } from "../../../composables/useTranslations.js";
9
+ import { useVersionHistoryApi as R } from "../../../composables/useVersionHistoryApi.js";
10
+ import { useLiquidValidator as z } from "../../../composables/validators/useLiquidValidator.js";
11
+ import { useEditorStore as I } from "../../../stores/editor.js";
12
+ import { useTemplateStore as P } from "../../../stores/template.js";
13
+ import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
14
+ import { InButtonV2 as G } from "@useinsider/design-system-vue";
15
+ import { storeToRefs as J } from "pinia";
16
+ import K from "./MigrationConfirmModal.vue.js";
17
+ const ut = /* @__PURE__ */ O({
24
18
  __name: "EditorActions",
25
- setup(it, { expose: A }) {
26
- const { config: u, isFeatureEnabled: c } = F(), { exportHtml: f } = z(), { save: p } = j(), { validateCurrentTemplate: d } = G(), { isEnabled: i } = J(), { showToaster: v } = K(), { openVersionHistory: S, closeVersionHistory: y } = Q(), { getCompiledEmail: g } = D(), { compileHtml: h } = P(), { validateLiquidSyntax: T } = U(), V = X(), e = Y(), H = Z(), w = $(), { hasMigrations: E } = et(w), r = N(), O = l(() => i.value && !V.isTransactional ? r("email-editor.save-and-continue") : "Save"), s = m(!1), a = m(!1), x = m(), n = I(), M = () => {
19
+ setup(N, { expose: x }) {
20
+ const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: g } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), H = B(), T = () => {
27
21
  if (e.isVersionHistoryOpen) {
28
- y();
22
+ p();
29
23
  return;
30
24
  }
31
- S();
32
- }, b = async () => {
33
- s.value = !0, await f(), s.value = !1;
34
- }, k = () => {
25
+ c();
26
+ }, w = async () => {
27
+ i.value = !0, await m(), i.value = !1;
28
+ }, _ = () => {
35
29
  e.isSaveAsTemplateDrawerOpen = !0;
36
- }, q = l(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), B = l(
30
+ }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
37
31
  () => {
38
32
  var t, o;
39
- return ((o = (t = u.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
33
+ return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
40
34
  }
41
- ), C = async (t) => {
42
- a.value = !0, t || (e.loadingStatus = !0);
43
- const o = await p(t);
44
- return a.value = !1, !t && !o && (e.loadingStatus = !1), o;
45
- }, _ = (t) => {
35
+ ), V = async (t) => {
36
+ r.value = !0, t || (e.loadingStatus = !0);
37
+ const o = await u(t);
38
+ return r.value = !1, !t && !o && (e.loadingStatus = !1), o;
39
+ }, E = (t) => {
46
40
  var o;
47
- if (!t && E.value) {
48
- (o = x.value) == null || o.open();
41
+ if (!t && g.value) {
42
+ (o = S.value) == null || o.open();
49
43
  return;
50
44
  }
51
- return C(t);
52
- }, L = async () => {
53
- if (i.value) {
45
+ return V(t);
46
+ }, M = async () => {
47
+ if (l("liquidSyntax")) {
54
48
  e.loadingStatus = !0;
55
- let t = [];
56
49
  try {
57
- t = await d();
58
- } catch (o) {
59
- console.warn("Test-path validation failed; sending without the drawer.", o);
60
- } finally {
61
- e.loadingStatus = !1;
62
- }
63
- if (t.length) {
64
- v({
65
- type: W.Error,
66
- message: r("email-editor.validation-errors-found"),
67
- actionButton: {
68
- text: r("email-editor.check-errors"),
69
- onClick: () => H.open(t, "test")
70
- },
71
- autoHide: !1
72
- });
73
- return;
74
- }
75
- n();
76
- return;
77
- }
78
- if (c("liquidSyntax")) {
79
- e.loadingStatus = !0;
80
- try {
81
- const { html: t } = await g({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = h(t);
82
- if (!await T(o))
50
+ const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
51
+ if (!await v(o))
83
52
  return;
84
53
  } finally {
85
54
  e.loadingStatus = !1;
86
55
  }
87
56
  }
88
- n();
57
+ H();
89
58
  };
90
- return A({
91
- handleSave: _
92
- }), { __sfc: !0, config: u, isFeatureEnabled: c, exportHtml: f, save: p, validateCurrentTemplate: d, isEnabled: i, showToaster: v, openVersionHistory: S, closeVersionHistory: y, getCompiledEmail: g, compileHtml: h, validateLiquidSyntax: T, configStore: V, editorStore: e, saveValidationStore: H, templateStore: w, hasMigrations: E, trans: r, saveLabel: O, isExporting: s, isSaving: a, migrationModalRef: x, testEmailClick: n, handleVersionHistory: M, handleExport: b, handleSaveAs: k, versionHistoryTooltipText: q, isVersionHistoryButtonVisible: B, executeSave: C, handleSave: _, handleTestEmail: L, getTooltipOptions: tt, InButtonV2: ot, MigrationConfirmModal: rt };
59
+ return x({
60
+ handleSave: E
61
+ }), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: g, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
93
62
  }
94
63
  });
95
64
  export {
96
- At as default
65
+ ut as default
97
66
  };
@@ -1,16 +1,16 @@
1
1
  import o from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
- import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
5
  var e = this, s = e._self._c, t = e._self._setupProxy;
6
6
  return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "ghost", type: "secondary", "disabled-status": t.isBackButtonDisabled, "label-text": t.backButtonLabel, "skeleton-sizing": { width: 150, height: 26 }, "skeleton-status": t.editorStore.loadingStatus }, on: { click: t.handleBackClick } })], 1);
7
- }, i = [], r = /* @__PURE__ */ n(
7
+ }, i = [], r = /* @__PURE__ */ a(
8
8
  o,
9
- a,
9
+ n,
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "74d455fc"
13
+ "73199fa4"
14
14
  );
15
15
  const f = r.exports;
16
16
  export {
@@ -1,59 +1,36 @@
1
- import { defineComponent as v, computed as b, ref as B } from "vue";
2
- import { useConfig as S } from "../../../composables/useConfig.js";
3
- import { useBack as y } from "../../../composables/useGuidoActions.js";
4
- import { usePreviewMode as g } from "../../../composables/usePreviewMode.js";
5
- import { useSaveValidation as w } from "../../../composables/useSaveValidation.js";
6
- import { useSaveValidationRollout as V } from "../../../composables/useSaveValidationRollout.js";
7
- import { useTranslations as h } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as l, computed as p, ref as d } from "vue";
2
+ import { useConfig as k } from "../../../composables/useConfig.js";
3
+ import { useBack as B } from "../../../composables/useGuidoActions.js";
4
+ import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
5
+ import { useTranslations as v } from "../../../composables/useTranslations.js";
8
6
  import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
9
- import { useConfigStore as C } from "../../../stores/config.js";
10
- import { useEditorStore as H } from "../../../stores/editor.js";
11
- import { useSaveValidationStore as L } from "../../../stores/save-validation.js";
12
- import { InButtonV2 as M } from "@useinsider/design-system-vue";
13
- import { useDebounceFn as O } from "../../../node_modules/@vueuse/shared/index.js";
14
- const N = /* @__PURE__ */ v({
7
+ import { useEditorStore as V } from "../../../stores/editor.js";
8
+ import { InButtonV2 as w } from "@useinsider/design-system-vue";
9
+ import { useDebounceFn as y } from "../../../node_modules/@vueuse/shared/index.js";
10
+ const D = /* @__PURE__ */ l({
15
11
  __name: "LeftSlot",
16
- setup(P) {
17
- const e = H(), a = y(), { closeVersionHistory: s } = _(), { closePreviewMode: c } = g(), { validateCurrentTemplate: l } = w(), { isEnabled: u } = V(), f = L(), m = C(), r = h(), { config: i } = S(), k = b(() => {
18
- var o, t;
19
- return e.isVersionHistoryOpen || e.isPreviewModeOpen ? r("email-editor.back-to-editor") : (t = (o = i.value) == null ? void 0 : o.ui) != null && t.backButtonLabel ? i.value.ui.backButtonLabel : r("email-editor.back-to-design");
20
- }), n = B(!1), d = async () => {
12
+ setup(C) {
13
+ const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f = p(() => {
14
+ var u, m;
15
+ return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (m = (u = t.value) == null ? void 0 : u.ui) != null && m.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
16
+ }), r = d(!1), c = () => {
21
17
  if (e.isVersionHistoryOpen) {
22
- s();
18
+ n();
23
19
  return;
24
20
  }
25
21
  if (e.isPreviewModeOpen) {
26
- c();
22
+ s();
27
23
  return;
28
24
  }
29
- if (u.value && !m.isTransactional) {
30
- e.loadingStatus = !0;
31
- let o = [];
32
- try {
33
- o = await l();
34
- } catch (t) {
35
- console.warn("Back-path validation failed; leaving without the drawer.", t);
36
- } finally {
37
- e.loadingStatus = !1;
38
- }
39
- if (o.length) {
40
- f.open(o, "back");
41
- return;
42
- }
43
- }
44
- a();
45
- }, p = O(async () => {
46
- try {
47
- await d();
48
- } finally {
49
- n.value = !1;
50
- }
25
+ i();
26
+ }, a = y(() => {
27
+ c(), r.value = !1;
51
28
  }, 500);
52
- return { __sfc: !0, editorStore: e, handleBack: a, closeVersionHistory: s, closePreviewMode: c, validateCurrentTemplate: l, isEnabled: u, saveValidationStore: f, configStore: m, trans: r, config: i, backButtonLabel: k, isBackButtonDisabled: n, executeBackAction: d, debouncedBackAction: p, handleBackClick: () => {
53
- n.value = !0, p();
54
- }, InButtonV2: M };
29
+ return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: f, isBackButtonDisabled: r, executeBackAction: c, debouncedBackAction: a, handleBackClick: () => {
30
+ r.value = !0, a();
31
+ }, InButtonV2: w };
55
32
  }
56
33
  });
57
34
  export {
58
- N as default
35
+ D as default
59
36
  };