@useinsider/guido 3.17.0-beta.edf4165 → 3.17.0-beta.f7536b7

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 (61) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +6 -7
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +83 -83
  5. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  6. package/dist/components/organisms/header/EditorActions.vue2.js +50 -39
  7. package/dist/composables/useActionsApi.js +82 -67
  8. package/dist/composables/useAutoSave.js +31 -26
  9. package/dist/composables/useCustomInterfaceAppearance.js +38 -52
  10. package/dist/composables/useEditorLock.js +20 -0
  11. package/dist/composables/useGuidoStateBridge.js +37 -31
  12. package/dist/composables/useRecommendation.js +34 -41
  13. package/dist/composables/useSave.js +39 -36
  14. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  15. package/dist/config/migrator/recommendationMigrator.js +4 -5
  16. package/dist/enums/academy.js +1 -2
  17. package/dist/enums/date.js +3 -5
  18. package/dist/enums/extensions/recommendationBlock.js +1 -3
  19. package/dist/extensions/Blocks/Recommendation/block.js +21 -26
  20. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
  21. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
  22. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +166 -162
  23. package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
  24. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +79 -165
  25. package/dist/extensions/Blocks/common-control.js +19 -22
  26. package/dist/guido.css +1 -1
  27. package/dist/services/recommendationApi.js +30 -69
  28. package/dist/src/@types/config/schemas.d.ts +0 -2
  29. package/dist/src/composables/useConfig.d.ts +0 -2
  30. package/dist/src/composables/useEditorLock.d.ts +10 -0
  31. package/dist/src/composables/useRecommendation.d.ts +0 -1
  32. package/dist/src/enums/academy.d.ts +0 -1
  33. package/dist/src/enums/date.d.ts +0 -1
  34. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  35. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -2
  36. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  37. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +4 -10
  38. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -150
  39. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -1
  40. package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
  41. package/dist/src/services/recommendationApi.d.ts +1 -4
  42. package/dist/src/stores/config.d.ts +0 -18
  43. package/dist/src/stores/save-as-template.d.ts +3 -4
  44. package/dist/src/utils/genericUtil.d.ts +0 -5
  45. package/dist/utils/dateUtil.js +10 -23
  46. package/dist/utils/genericUtil.js +27 -28
  47. package/dist/utils/templatePreparation.js +34 -35
  48. package/package.json +1 -2
  49. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -21
  50. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -106
  51. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +0 -19
  52. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +0 -63
  53. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -124
  54. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
  55. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +0 -15
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -16
  57. package/dist/src/mock/api/recommendation-strategies.d.ts +0 -2
  58. package/dist/static/assets/icons/line-change.svg.js +0 -5
  59. package/dist/static/assets/icons/line-delete.svg.js +0 -5
  60. package/dist/static/assets/icons/line-plus.svg.js +0 -5
  61. package/dist/static/styles/components/recommendation-strategy.css.js +0 -155
package/README.md CHANGED
@@ -162,7 +162,6 @@ const config: GuidoConfigInput = {
162
162
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
163
163
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
164
164
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
165
- reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
166
165
  },
167
166
 
168
167
  // Optional: Callbacks
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as k, boolean as o, array as c, transform as C, record as y, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -76,7 +76,7 @@ const p = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), N = k(
79
+ })), N = y(
80
80
  t(),
81
81
  R(c(S), [])
82
82
  ), P = g({
@@ -132,7 +132,7 @@ const p = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- k(t(), P),
135
+ y(t(), P),
136
136
  {}
137
137
  )
138
138
  }), x = a({
@@ -219,8 +219,7 @@ const p = {
219
219
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
220
220
  allowlistEnabled: e(o(), !1),
221
221
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
- linkTrackingIds: e(o(), !1),
223
- reusableRecommendationStrategy: e(o(), !1)
222
+ linkTrackingIds: e(o(), !1)
224
223
  }), B = i([
225
224
  "amp-accordion",
226
225
  "amp-carousel",
@@ -288,7 +287,7 @@ const p = {
288
287
  ...d.entries,
289
288
  type: u("custom"),
290
289
  /** Custom processor function */
291
- processor: y(
290
+ processor: k(
292
291
  (s) => typeof s == "function",
293
292
  "processor must be a function"
294
293
  )
@@ -308,7 +307,7 @@ const p = {
308
307
  * Return false to cancel the save operation.
309
308
  */
310
309
  externalValidation: e(
311
- y(
310
+ k(
312
311
  (s) => typeof s == "function",
313
312
  "externalValidation must be a function"
314
313
  )
@@ -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), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), 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
- }, s = [], n = /* @__PURE__ */ i(
10
- a,
9
+ }, n = [], s = /* @__PURE__ */ a(
10
+ i,
11
11
  t,
12
- s,
12
+ n,
13
13
  !1,
14
14
  null,
15
- "e6f99d29"
15
+ "1f2703e5"
16
16
  );
17
- const l = n.exports;
17
+ const l = s.exports;
18
18
  export {
19
19
  l as default
20
20
  };
@@ -1,69 +1,68 @@
1
- import { defineComponent as Y, defineAsyncComponent as S, ref as A, computed as l, watch as U, onMounted as Z, onUnmounted as ee } from "vue";
1
+ import { defineComponent as Y, defineAsyncComponent as N, ref as O, computed as P, watch as x, onMounted as Z, onUnmounted as ee } from "vue";
2
2
  import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as re } from "../composables/usePartner.js";
6
- import { useStripo as se } from "../composables/useStripo.js";
3
+ import { useEditorLock as oe } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as se } from "../composables/usePartner.js";
7
+ import { useStripo as ie } from "../composables/useStripo.js";
7
8
  import { useTimerClone as ae } from "../composables/useTimerClone.js";
8
- import { migrate as _ } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ie } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import ce from "./organisms/AutoSaveController.vue.js";
13
- import de from "./organisms/base/Toaster.vue.js";
14
- import me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import le from "./organisms/header/HeaderWrapper.vue.js";
16
- import ue from "./organisms/LoadingWrapper.vue.js";
17
- import pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import fe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as ye } from "../services/stripoApi.js";
20
- import { useConfigStore as ge } from "../stores/config.js";
21
- import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
22
- import { useEditorStore as P } from "../stores/editor.js";
23
- import { usePreviewStore as Se } from "../stores/preview.js";
24
- import { useTemplateStore as he } from "../stores/template.js";
25
- import { useUnsubscribeStore as be } from "../stores/unsubscribe.js";
26
- import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
27
- const Ve = /* @__PURE__ */ Y({
9
+ import { migrate as A } from "../config/migrator/index.js";
10
+ import { ModuleFolderDefaults as W } from "../enums/defaults.js";
11
+ import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
12
+ import { useRecommendationExtensionStore as de } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
+ import me from "./organisms/AutoSaveController.vue.js";
14
+ import le from "./organisms/base/Toaster.vue.js";
15
+ import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
+ import pe from "./organisms/header/HeaderWrapper.vue.js";
17
+ import fe from "./organisms/LoadingWrapper.vue.js";
18
+ import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
+ import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
+ import { useStripoApi as ge } from "../services/stripoApi.js";
21
+ import { useConfigStore as he } from "../stores/config.js";
22
+ import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
23
+ import { useEditorStore as G } from "../stores/editor.js";
24
+ import { usePreviewStore as be } from "../stores/preview.js";
25
+ import { useTemplateStore as Ee } from "../stores/template.js";
26
+ import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
27
+ import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
28
+ const Qe = /* @__PURE__ */ Y({
28
29
  __name: "Guido",
29
30
  props: {
30
31
  config: null,
31
32
  ready: { type: Boolean, default: !0 }
32
33
  },
33
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
34
- setup(x, { expose: G, emit: r }) {
35
- const a = x, H = S(
35
+ setup($, { expose: z, emit: r }) {
36
+ const i = $, q = N(
36
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), $ = S(
38
+ ), K = N(
38
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), z = S(
40
- () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
- ), h = A(), u = A(), p = ve(), b = be(), o = ge();
42
- a.ready && o.init(a.config);
43
- const c = P(), q = Se(), m = l(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
40
+ ), h = O(), l = O(), u = Se(), S = we(), o = he();
41
+ i.ready && o.init(i.config);
42
+ const c = G(), V = be(), m = P(() => c.hasChanges), { isTestPartner: j } = se(), b = () => {
44
43
  var t;
45
44
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
46
- }, w = (t) => {
45
+ }, E = (t) => {
47
46
  c.loadingStatus = t;
48
47
  };
49
- te(), ne();
50
- const f = () => {
48
+ te(), re();
49
+ const p = () => {
51
50
  var t, e;
52
51
  return {
53
52
  emailId: o.templateId,
54
53
  userId: o.userId,
55
54
  username: o.username,
56
55
  partnerName: o.partnerName,
57
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
58
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
56
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
57
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
59
58
  };
60
- }, { initPlugin: C, preloadRuntime: D } = se(), { getDefaultTemplate: k } = ye(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ae(), V = l(() => {
59
+ }, { initPlugin: w, preloadRuntime: C } = ie(), { runExclusive: k, beginMount: D, isCurrentMount: T } = oe();
60
+ let f = 0;
61
+ const { getDefaultTemplate: F } = ge(), { cloneTimersOnSave: I, hasTimerBlocks: L } = ae(), J = P(() => {
61
62
  var t;
62
63
  return !((t = o.ui) != null && t.showHeader);
63
- }), j = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), J = l(
64
- () => !!O().recommendationConfigs.strategyId
65
- );
66
- oe({
64
+ });
65
+ ne({
67
66
  onBack: () => {
68
67
  console.debug("guido:back"), r("back");
69
68
  },
@@ -71,86 +70,87 @@ const Ve = /* @__PURE__ */ Y({
71
70
  console.debug("guido:save:start"), r("save:start");
72
71
  },
73
72
  onSaveComplete: (t) => {
74
- const e = { ...t, metadata: f() };
73
+ const e = { ...t, metadata: p() };
75
74
  console.debug("guido:save:complete", e), r("save:complete", e);
76
75
  },
77
76
  onTestEmailClick: () => {
78
77
  console.debug("guido:test-email:click"), r("test-email:click");
79
78
  }
80
79
  });
81
- const I = (t) => {
82
- console.debug("dynamic-content:close", t), p.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
80
+ const M = (t) => {
81
+ console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
83
82
  }, R = () => {
84
83
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
85
84
  };
86
- U(() => m.value, () => {
85
+ x(() => m.value, () => {
87
86
  r("on-change", m.value);
88
87
  });
89
- const y = (t) => {
88
+ const v = (t) => {
90
89
  const e = t, { attribute: s, position: d } = e.detail;
91
90
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
92
91
  };
93
- let i = null;
94
- const g = () => {
92
+ let a = null;
93
+ const y = () => {
95
94
  var e;
96
- const t = document.querySelector(ie);
97
- (e = u.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
98
- }, v = async () => {
95
+ const t = document.querySelector(ce);
96
+ (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
97
+ }, g = async () => {
99
98
  var t;
100
99
  try {
101
- o.initialized || o.init(a.config), c.templateId = o.templateId;
102
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
103
- b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
104
- const B = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
100
+ o.initialized || o.init(i.config), c.templateId = o.templateId;
101
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
102
+ S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
103
+ const U = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds");
105
104
  let n = {
106
- html: s && await _(s, B),
105
+ html: s && await A(s, U),
107
106
  css: d
108
107
  };
109
- n.html || (n = await k(), n.html = await _(n.html, B));
110
- const Q = M ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
111
- F(n.html) && (n.html = await T(n.html)), M && (c.trackIdSessionFloor = Math.max(Q, W(n.html)));
108
+ n.html || (n = await F(), n.html = await A(n.html, U));
109
+ const Q = _ ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
110
+ L(n.html) && (n.html = await I(n.html)), _ && (c.trackIdSessionFloor = Math.max(Q, H(n.html)));
112
111
  const X = {
113
- preselectedDynamicContentList: L,
112
+ preselectedDynamicContentList: B,
114
113
  onReady: () => {
115
114
  console.debug("guido:ready"), r("ready");
116
115
  }
117
116
  };
118
- await C(n, f(), X), p.selectedDynamicContentList = L;
117
+ f = D(), await w(n, p(), X), u.selectedDynamicContentList = B;
119
118
  } catch (e) {
120
119
  console.error("Failed to initialize Stripo editor:", e);
121
120
  }
122
121
  };
123
122
  return Z(async () => {
124
123
  var e;
125
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), he().$reset(), g();
126
- const t = (e = u.value) == null ? void 0 : e.parentElement;
127
- if (t && (i = new ResizeObserver(g), i.observe(t)), D(), a.ready)
128
- await v();
124
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), de().$reset(), G().$reset(), Ee().$reset(), y();
125
+ const t = (e = l.value) == null ? void 0 : e.parentElement;
126
+ if (t && (a = new ResizeObserver(y), a.observe(t)), C(), i.ready)
127
+ await g();
129
128
  else {
130
- const s = U(() => a.ready, (d) => {
131
- d && (s(), v());
129
+ const s = x(() => i.ready, (d) => {
130
+ d && (s(), g());
132
131
  });
133
132
  }
134
- document.addEventListener("dynamic-content:open", y);
133
+ document.addEventListener("dynamic-content:open", v);
135
134
  }), ee(() => {
136
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", y);
137
- try {
138
- window.UIEditor.removeEditor();
139
- } catch {
140
- console.debug("Failed to remove Stripo editor: No editor found");
141
- }
142
- o.reset();
143
- }), G({
135
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", v), k(async () => {
136
+ if (T(f))
137
+ try {
138
+ window.UIEditor.removeEditor();
139
+ } catch {
140
+ console.debug("Failed to remove Stripo editor: No editor found");
141
+ }
142
+ }), o.reset();
143
+ }), z({
144
144
  dynamicContent: {
145
- insert: I,
145
+ insert: M,
146
146
  close: R
147
147
  },
148
148
  hasChanges: m,
149
- saveSilent: E,
150
- setLoading: w
151
- }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, headerWrapperRef: h, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: q, hasChanges: m, isTestPartner: K, saveSilent: E, setLoading: w, emit: r, buildMetadata: f, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: V, isRrsEnabled: j, hasAssignedStrategy: J, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: y, ribbonObserver: i, updateRibbonOffset: g, startEditor: v, AutoSaveController: ce, Toaster: de, FilterSelectionDrawer: me, HeaderWrapper: le, LoadingWrapper: ue, SaveAsTemplateDrawer: pe, UnsubscribeWrapper: fe };
149
+ saveSilent: b,
150
+ setLoading: E
151
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: C, runExclusive: k, beginMount: D, isCurrentMount: T, mountGeneration: f, getDefaultTemplate: F, cloneTimersOnSave: I, hasTimerBlocks: L, noHeader: J, insertDynamicContent: M, closeDynamicContent: R, handleDynamicContentOpen: v, ribbonObserver: a, updateRibbonOffset: y, startEditor: g, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: ye };
152
152
  }
153
153
  });
154
154
  export {
155
- Ve as default
155
+ Qe as default
156
156
  };
@@ -9,15 +9,15 @@ var u = function() {
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
11
11
  } } })], 1);
12
- }, p = [], c = /* @__PURE__ */ d(
12
+ }, c = [], p = /* @__PURE__ */ d(
13
13
  l,
14
14
  u,
15
- p,
15
+ c,
16
16
  !1,
17
17
  null,
18
- "6e711fd7"
18
+ "c61cc8ea"
19
19
  );
20
- const v = c.exports;
20
+ const v = p.exports;
21
21
  export {
22
22
  v as default
23
23
  };
@@ -1,66 +1,77 @@
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({
1
+ import { defineComponent as q, ref as n, computed as x } from "vue";
2
+ import { useActionsApi as b } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as k } from "../../../composables/useConfig.js";
4
+ import { useExport as B } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as R } from "../../../composables/useSave.js";
8
+ import { useToaster as z } from "../../../composables/useToaster.js";
9
+ import { useTranslations as I } from "../../../composables/useTranslations.js";
10
+ import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
11
+ import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
12
+ import { useEditorStore as G } from "../../../stores/editor.js";
13
+ import { useTemplateStore as J } from "../../../stores/template.js";
14
+ import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
15
+ import { InButtonV2 as N } from "@useinsider/design-system-vue";
16
+ import { storeToRefs as Q } from "pinia";
17
+ import U from "./MigrationConfirmModal.vue.js";
18
+ const ft = /* @__PURE__ */ q({
18
19
  __name: "EditorActions",
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 = () => {
20
+ setup(W, { expose: w }) {
21
+ const { config: l, isFeatureEnabled: m } = k(), { exportHtml: c } = B(), { save: p } = R(), { openVersionHistory: u, closeVersionHistory: f } = P(), { getCompiledEmail: d } = b(), { compileHtml: v } = L(), { validateLiquidSyntax: y } = j(), { handleError: r } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), s = I(), i = n(!1), a = n(!1), H = n(), h = D(), _ = () => {
21
22
  if (e.isVersionHistoryOpen) {
22
- p();
23
+ f();
23
24
  return;
24
25
  }
25
- c();
26
- }, w = async () => {
27
- i.value = !0, await m(), i.value = !1;
28
- }, _ = () => {
26
+ u();
27
+ }, C = async () => {
28
+ i.value = !0, await c(), i.value = !1;
29
+ }, A = () => {
29
30
  e.isSaveAsTemplateDrawerOpen = !0;
30
- }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
31
+ }, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
31
32
  () => {
32
33
  var t, o;
33
- return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
+ return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
35
  }
35
36
  ), 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;
37
+ a.value = !0, t || (e.loadingStatus = !0);
38
+ let o;
39
+ try {
40
+ o = await p(t);
41
+ } catch (T) {
42
+ r(T, "Failed to save template");
43
+ } finally {
44
+ a.value = !1, !t && !o && (e.loadingStatus = !1);
45
+ }
46
+ return o;
39
47
  }, E = (t) => {
40
48
  var o;
41
- if (!t && g.value) {
42
- (o = S.value) == null || o.open();
49
+ if (!t && S.value) {
50
+ (o = H.value) == null || o.open();
43
51
  return;
44
52
  }
45
53
  return V(t);
46
- }, M = async () => {
47
- if (l("liquidSyntax")) {
54
+ }, F = async () => {
55
+ if (m("liquidSyntax")) {
48
56
  e.loadingStatus = !0;
49
57
  try {
50
- const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
51
- if (!await v(o))
58
+ const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
59
+ if (!await y(o))
52
60
  return;
61
+ } catch (t) {
62
+ r(t, "Failed to prepare test email");
63
+ return;
53
64
  } finally {
54
65
  e.loadingStatus = !1;
55
66
  }
56
67
  }
57
- H();
68
+ h();
58
69
  };
59
- return x({
70
+ return w({
60
71
  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 };
72
+ }), { __sfc: !0, config: l, isFeatureEnabled: m, exportHtml: c, save: p, openVersionHistory: u, closeVersionHistory: f, getCompiledEmail: d, compileHtml: v, validateLiquidSyntax: y, handleError: r, editorStore: e, templateStore: g, hasMigrations: S, trans: s, isExporting: i, isSaving: a, migrationModalRef: H, testEmailClick: h, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: V, handleSave: E, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
62
73
  }
63
74
  });
64
75
  export {
65
- ut as default
76
+ ft as default
66
77
  };