@useinsider/guido 3.18.2-beta.ec25841 → 3.18.2-beta.eedafd2

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 (81) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +28 -26
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +72 -70
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +52 -70
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
  9. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  10. package/dist/components/organisms/header/EditorActions.vue2.js +86 -56
  11. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  12. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  13. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  14. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
  15. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  16. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
  17. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  18. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  19. package/dist/composables/useCustomInterfaceAppearance.js +46 -56
  20. package/dist/composables/useHtmlCompiler.js +37 -26
  21. package/dist/composables/useHtmlValidator.js +81 -84
  22. package/dist/composables/useHttp.js +24 -22
  23. package/dist/composables/useRecommendation.js +35 -40
  24. package/dist/composables/useSave.js +90 -45
  25. package/dist/composables/useSaveValidation.js +279 -0
  26. package/dist/composables/useSaveValidationRollout.js +9 -0
  27. package/dist/composables/useStripo.js +30 -30
  28. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  29. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  30. package/dist/enums/extensions/recommendationBlock.js +31 -38
  31. package/dist/enums/save-validation.js +4 -0
  32. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  33. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
  34. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +33 -38
  35. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
  36. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +78 -168
  37. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  38. package/dist/guido.css +1 -1
  39. package/dist/services/templateLibraryApi.js +17 -14
  40. package/dist/src/@types/config/schemas.d.ts +4 -0
  41. package/dist/src/@types/save-validation.d.ts +19 -0
  42. package/dist/src/components/Guido.vue.d.ts +17 -1
  43. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  44. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  45. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  46. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  47. package/dist/src/composables/useConfig.d.ts +2 -0
  48. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  49. package/dist/src/composables/useSave.d.ts +6 -1
  50. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  51. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  52. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  53. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  54. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  55. package/dist/src/enums/save-validation.d.ts +27 -0
  56. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  57. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
  59. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
  60. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +3 -73
  61. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  62. package/dist/src/stores/config.d.ts +30 -0
  63. package/dist/src/stores/onboarding.d.ts +0 -377
  64. package/dist/src/stores/save-validation.d.ts +22 -0
  65. package/dist/src/utils/genericUtil.d.ts +6 -0
  66. package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
  67. package/dist/src/utils/templatePreparation.d.ts +30 -0
  68. package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
  69. package/dist/stores/config.js +39 -22
  70. package/dist/stores/onboarding.js +36 -41
  71. package/dist/stores/save-validation.js +30 -0
  72. package/dist/utils/genericUtil.js +63 -54
  73. package/dist/utils/liquidDynamicContent.js +15 -0
  74. package/dist/utils/templatePreparation.js +63 -59
  75. package/package.json +1 -1
  76. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  77. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
  78. package/dist/extensions/Blocks/Recommendation/utils/strategyDetach.js +0 -19
  79. package/dist/src/extensions/Blocks/Recommendation/utils/strategyDetach.d.ts +0 -12
  80. package/dist/static/styles/components/skeleton.css.js +0 -23
  81. /package/dist/src/components/organisms/{onboarding/RecommendationStrategyOnboarding.vue.d.ts → validation/ValidationErrorDrawer.vue.d.ts} +0 -0
@@ -1,47 +1,48 @@
1
- import { defineComponent as I, defineAsyncComponent as S, ref as T, computed as l, watch as h } from "vue";
1
+ import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as A } from "../../../../composables/useToaster.js";
4
- import { useTranslations as C } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as B } from "../../../../enums/date.js";
6
- import { URLS as b } from "../../../../enums/extensions/recommendationBlock.js";
3
+ import { useToaster as x } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as A } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
6
+ import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
7
7
  import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as k } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { commitStrategyDetach as N } from "../../../../extensions/Blocks/Recommendation/utils/strategyDetach.js";
10
- import R from "./StrategyInfoBoxContent.vue.js";
11
- import { formatShortDate as P } from "../../../../utils/dateUtil.js";
12
- import { asText as _ } from "../../../../utils/genericUtil.js";
13
- import { escapeHtml as U } from "../../../../utils/htmlEscape.js";
14
- import { InSkeleton as L } from "@useinsider/design-system-vue";
15
- const rt = /* @__PURE__ */ I({
8
+ import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import B from "./StrategyInfoBoxContent.vue.js";
10
+ import { formatShortDate as I } from "../../../../utils/dateUtil.js";
11
+ import { asText as f } from "../../../../utils/genericUtil.js";
12
+ import { escapeHtml as N } from "../../../../utils/htmlEscape.js";
13
+ import { InSkeleton as b } from "@useinsider/design-system-vue";
14
+ const W = /* @__PURE__ */ v({
16
15
  __name: "AssignStrategyDrawer",
17
- setup(M) {
18
- const g = () => import("@useinsider/design-system-organisms"), d = (t, r) => ({
19
- render: (o) => o(L, { props: { sizing: { width: t, height: r } } })
20
- }), D = S({
21
- loader: async () => (await g()).OrgStrategyDetailModal,
22
- loadingComponent: d(480, 240),
16
+ setup(k) {
17
+ const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
18
+ render: (a) => a(b, { props: { sizing: { width: t, height: r } } })
19
+ }), S = y({
20
+ loader: async () => (await c()).OrgStrategyDetailModal,
21
+ loadingComponent: g(480, 240),
23
22
  delay: 0
24
- }), v = S({
25
- loader: async () => (await g()).OrgStrategyDropdown
26
- }), n = "guido-edit-strategy-", s = C(), e = k(), { showToaster: i } = A(), a = T(null), c = T(!1), w = l(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: b.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
- h(() => e.assignStrategyDrawerStatus, (t) => {
23
+ }), T = y({
24
+ loader: async () => (await c()).OrgStrategyDropdown,
25
+ loadingComponent: g(240, 42),
26
+ delay: 0
27
+ }), o = A(), e = C(), { showToaster: s } = x(), n = u(null), i = u(!1), _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
28
+ O(() => e.assignStrategyDrawerStatus, (t) => {
28
29
  if (!t)
29
30
  return;
30
31
  const { strategyId: r } = e.recommendationConfigs;
31
- a.value = r || null, c.value = !1, e.fetchStrategies().catch(() => {
32
- i({
32
+ n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
33
+ s({
33
34
  type: m.Error,
34
- message: s("discovery-strategy.error-description")
35
+ message: o("discovery-strategy.error-description")
35
36
  });
36
37
  });
37
38
  });
38
- const u = (t) => {
39
- const r = _(t.updated_at || t.created_at);
39
+ const p = (t) => {
40
+ const r = f(t.updated_at || t.created_at);
40
41
  if (!r)
41
42
  return "";
42
- const o = P(r, B);
43
- return s("recommendation-strategy.last-updated-on", { value: o });
44
- }, x = l(() => e.strategies.map((t) => ({
43
+ const a = I(r, E);
44
+ return o("recommendation-strategy.last-updated-on", { value: a });
45
+ }, D = l(() => e.strategies.map((t) => ({
45
46
  text: t.name,
46
47
  value: t.strategy_id,
47
48
  infoBoxProps: {
@@ -49,76 +50,57 @@ const rt = /* @__PURE__ */ I({
49
50
  theme: "light",
50
51
  variant: "information",
51
52
  className: "assign-strategy-info-box",
52
- titleText: U(_(t.name)),
53
+ titleText: N(f(t.name)),
53
54
  descriptionStatus: !0,
54
- descriptionText: u(t),
55
- slot: R,
56
- slotProps: { strategy: t },
57
- // The info box drops the option's value/text, so the id is the only channel
58
- // that can carry the strategy back to the click handler.
59
- buttonOptions: [{
60
- id: `${n}${t.strategy_id}`,
61
- text: s("eureka.edit-strategy"),
62
- type: "text",
63
- // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
64
- // silently render blank space instead of failing.
65
- icon: "line-open-website"
66
- }]
55
+ descriptionText: p(t),
56
+ slot: B,
57
+ slotProps: { strategy: t }
67
58
  }
68
- }))), E = (t) => {
69
- var f;
70
- const r = (f = t == null ? void 0 : t.id) != null && f.startsWith(n) ? t.id.slice(n.length) : "";
71
- if (!r)
72
- return;
73
- const o = e.currentRecommendationId;
74
- String(a.value ?? "") === r && (a.value = null);
75
- const y = e.recommendationConfigs.strategyId === r;
76
- y && e.removeStrategy(), e.openStrategyEdit(r), y && o !== null && N(o);
77
- }, p = l(() => {
78
- const t = e.strategies.find((r) => String(r.strategy_id) === String(a.value ?? ""));
59
+ }))), d = l(() => {
60
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
79
61
  return t ? { ...t, fallback_config: null } : null;
80
- }), O = l(() => ({
62
+ }), w = l(() => ({
81
63
  primaryButton: {
82
64
  styling: "solid",
83
65
  type: "primary",
84
- labelText: s("products.assign-btn")
66
+ labelText: o("products.assign-btn")
85
67
  },
86
68
  cancelOrBackButton: {
87
69
  styling: "ghost",
88
70
  type: "secondary",
89
- labelText: s("products.cancel")
71
+ labelText: o("products.cancel")
90
72
  }
91
73
  }));
92
- return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal: D, OrgStrategyDropdown: v, EDIT_BUTTON_ID_PREFIX: n, trans: s, store: e, showToaster: i, selectedStrategyId: a, showSelectionError: c, drawerDescription: w, lastUpdatedText: u, strategyOptions: x, onInfoBoxButtonClick: E, selectedStrategy: p, footerButtonGroupOptions: O, closeDrawer: () => {
74
+ return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: s, selectedStrategyId: n, showSelectionError: i, drawerDescription: _, lastUpdatedText: p, strategyOptions: D, selectedStrategy: d, footerButtonGroupOptions: w, closeDrawer: () => {
93
75
  e.closeAssignStrategyDrawer();
94
76
  }, assignStrategy: async () => {
95
- const t = p.value;
77
+ const t = d.value;
96
78
  if (!t) {
97
- c.value = !0;
79
+ i.value = !0;
98
80
  return;
99
81
  }
100
82
  let r = "";
101
83
  try {
102
84
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
103
- } catch (o) {
104
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", o);
85
+ } catch (a) {
86
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
105
87
  }
106
88
  if (!r) {
107
- i({
89
+ s({
108
90
  type: m.Error,
109
- message: s("email-editor.strategy-assign-failed", { strategyName: t.name })
91
+ message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
110
92
  });
111
93
  return;
112
94
  }
113
- e.assignStrategy(t), i({
95
+ e.assignStrategy(t), s({
114
96
  type: m.Success,
115
- message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
97
+ message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
116
98
  }), e.closeAssignStrategyDrawer();
117
99
  }, onSelect: (t) => {
118
- a.value = t.value, c.value = !1;
100
+ n.value = t.value, i.value = !1;
119
101
  } };
120
102
  }
121
103
  });
122
104
  export {
123
- rt as default
105
+ W as default
124
106
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as l, computed as a } from "vue";
2
- import d from "../../../wrappers/WpModal.vue.js";
3
- import { useToaster as g } from "../../../../composables/useToaster.js";
4
- import { useTranslations as y } from "../../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
6
- import { useRecommendationExtensionStore as f } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
- import { commitStrategyDetach as _ } from "../../../../extensions/Blocks/Recommendation/utils/strategyDetach.js";
8
- import { escapeHtml as T } from "../../../../utils/htmlEscape.js";
9
- const C = /* @__PURE__ */ l({
1
+ import { defineComponent as u, computed as n } from "vue";
2
+ import y from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as f } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
6
+ import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
8
+ import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
9
+ const P = /* @__PURE__ */ u({
10
10
  __name: "RemoveStrategyModal",
11
- setup(v) {
12
- const t = y(), e = f(), { showToaster: n } = g(), i = a(() => ({
11
+ setup(S) {
12
+ const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
13
13
  cancelOrBackButton: {
14
14
  type: "secondary",
15
15
  labelText: t("products.cancel"),
@@ -19,25 +19,39 @@ const C = /* @__PURE__ */ l({
19
19
  type: "danger",
20
20
  labelText: t("discovery-strategy.remove")
21
21
  }
22
- })), m = a(() => {
22
+ })), m = n(() => {
23
23
  var o;
24
- const { strategyId: s } = e.recommendationConfigs;
25
- return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${s}`;
26
- }), r = "__STRATEGY_NAME__", p = a(() => t("email-editor.remove-strategy-confirm-message", { strategyName: r }).split(r)), c = () => {
24
+ const { strategyId: r } = e.recommendationConfigs;
25
+ return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
26
+ }), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
27
27
  e.closeRemoveStrategyModal();
28
28
  };
29
- return { __sfc: !0, trans: t, store: e, showToaster: n, footerButtonOptions: i, strategyName: m, NAME_TOKEN: r, messageParts: p, close: c, handleConfirm: async () => {
30
- const s = m.value, o = e.currentRecommendationId;
31
- e.removeStrategy(), c(), n({
32
- type: u.Success,
29
+ return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
30
+ const r = m.value, o = e.currentRecommendationId;
31
+ e.removeStrategy(), c();
32
+ const { strategyId: l, size: g } = e.recommendationConfigs;
33
+ if (a({
34
+ type: v.Success,
33
35
  // The toast renders through a sanitizing v-html, so the name is escaped first.
34
36
  message: t("email-editor.strategy-removed-success", {
35
- strategyName: `<b>${T(s)}</b>`
37
+ strategyName: `<b>${R(r)}</b>`
36
38
  })
37
- }), o !== null && await _(o);
38
- }, WpModal: d };
39
+ }), o !== null) {
40
+ try {
41
+ await e.fetchRecommendationProducts();
42
+ } catch (p) {
43
+ console.error("[RemoveStrategyModal] product refetch failed", p);
44
+ }
45
+ h(
46
+ o,
47
+ { strategyId: l, size: g },
48
+ e.recommendationProducts,
49
+ "Removed recommendation strategy"
50
+ );
51
+ }
52
+ }, WpModal: y };
39
53
  }
40
54
  });
41
55
  export {
42
- C as default
56
+ P as default
43
57
  };
@@ -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", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "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", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "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
- "1ca6baf0"
18
+ "f938f128"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,79 +1,109 @@
1
- import { defineComponent as q, ref as l, computed as w } 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({
1
+ import { defineComponent as D, computed as u, ref as c } from "vue";
2
+ import { useActionsApi as z } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as I } from "../../../composables/useConfig.js";
4
+ import { useExport as P } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as W } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as j } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as G } from "../../../composables/useSave.js";
8
+ import { useSaveValidation as J } from "../../../composables/useSaveValidation.js";
9
+ import { useSaveValidationRollout as K } from "../../../composables/useSaveValidationRollout.js";
10
+ import { useToaster as N } from "../../../composables/useToaster.js";
11
+ import { useTranslations as Q } from "../../../composables/useTranslations.js";
12
+ import { useVersionHistoryApi as U } from "../../../composables/useVersionHistoryApi.js";
13
+ import { useLiquidValidator as X } from "../../../composables/validators/useLiquidValidator.js";
14
+ import { ToasterTypeOptions as Y } from "../../../enums/toaster.js";
15
+ import { useConfigStore as Z } from "../../../stores/config.js";
16
+ import { useEditorStore as $ } from "../../../stores/editor.js";
17
+ import { useSaveValidationStore as tt } from "../../../stores/save-validation.js";
18
+ import { useTemplateStore as et } from "../../../stores/template.js";
19
+ import { getTooltipOptions as ot } from "../../../utils/tooltipUtils.js";
20
+ import { InButtonV2 as rt } from "@useinsider/design-system-vue";
21
+ import { storeToRefs as it } from "pinia";
22
+ import at from "./MigrationConfirmModal.vue.js";
23
+ const Ot = /* @__PURE__ */ D({
19
24
  __name: "EditorActions",
20
- setup(W, { expose: x }) {
21
- const { config: m, isFeatureEnabled: c } = k(), { exportHtml: p } = B(), { save: u } = R(), { openVersionHistory: f, closeVersionHistory: d } = P(), { getCompiledEmail: v } = b(), { compileHtml: y } = L(), { validateLiquidSyntax: g } = j(), { handleError: r } = z(), e = G(), h = J(), { hasMigrations: H } = Q(h), s = I(), i = l(!1), a = l(!1), S = l(), V = D(), _ = () => {
22
- if (e.isVersionHistoryOpen) {
23
- d();
25
+ setup(st, { expose: M }) {
26
+ const { config: p, isFeatureEnabled: f } = I(), { exportHtml: d } = P(), { save: v } = G(), { validateCurrentTemplate: y } = J(), { isEnabled: i } = K(), { showToaster: S, handleError: a } = N(), { openVersionHistory: g, closeVersionHistory: h } = U(), { getCompiledEmail: V } = z(), { compileHtml: w } = j(), { validateLiquidSyntax: T } = X(), E = Z(), o = $(), H = tt(), x = et(), { hasMigrations: C } = it(x), r = Q(), b = u(() => i.value && E.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), s = c(!1), n = c(!1), _ = c(), l = W(), k = () => {
27
+ if (o.isVersionHistoryOpen) {
28
+ h();
24
29
  return;
25
30
  }
26
- f();
27
- }, C = async () => {
28
- i.value = !0, await p(), i.value = !1;
29
- }, A = () => {
30
- e.isSaveAsTemplateDrawerOpen = !0;
31
- }, M = w(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = w(
31
+ g();
32
+ }, F = async () => {
33
+ s.value = !0, await d(), s.value = !1;
34
+ }, q = () => {
35
+ o.isSaveAsTemplateDrawerOpen = !0;
36
+ }, B = u(() => o.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), L = u(
32
37
  () => {
33
- var t, o;
34
- return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
38
+ var t, e;
39
+ return ((e = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
35
40
  }
36
- ), E = async (t) => {
37
- a.value = !0, t || (e.loadingStatus = !0);
38
- let o;
41
+ ), A = async (t) => {
42
+ n.value = !0, t || (o.loadingStatus = !0);
43
+ let e;
39
44
  try {
40
- o = await u(t);
41
- } catch (n) {
45
+ e = await v(t);
46
+ } catch (m) {
42
47
  if (t)
43
- throw n;
44
- r(n, "Failed to save template");
48
+ throw m;
49
+ a(m, "Failed to save template");
45
50
  } finally {
46
- a.value = !1, !t && !o && (e.loadingStatus = !1);
51
+ n.value = !1, !t && !e && (o.loadingStatus = !1);
47
52
  }
48
- return o;
49
- }, T = (t) => {
50
- var o;
51
- if (!t && H.value) {
52
- (o = S.value) == null || o.open();
53
+ return e;
54
+ }, O = (t) => {
55
+ var e;
56
+ if (!t && C.value) {
57
+ (e = _.value) == null || e.open();
53
58
  return;
54
59
  }
55
- return E(t);
56
- }, F = async () => {
57
- if (c("liquidSyntax")) {
58
- e.loadingStatus = !0;
60
+ return A(t);
61
+ }, R = async () => {
62
+ if (i.value) {
63
+ o.loadingStatus = !0;
64
+ let t = [];
65
+ try {
66
+ t = await y();
67
+ } catch (e) {
68
+ console.warn("Test-path validation failed; sending without the drawer.", e);
69
+ } finally {
70
+ o.loadingStatus = !1;
71
+ }
72
+ if (t.length) {
73
+ S({
74
+ type: Y.Error,
75
+ message: r("email-editor.validation-errors-found"),
76
+ actionButton: {
77
+ text: r("email-editor.check-errors"),
78
+ onClick: () => H.open(t, "test")
79
+ },
80
+ autoHide: !1
81
+ });
82
+ return;
83
+ }
84
+ l();
85
+ return;
86
+ }
87
+ if (f("liquidSyntax")) {
88
+ o.loadingStatus = !0;
59
89
  try {
60
- const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
61
- if (!await g(o))
90
+ const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: e } = w(t);
91
+ if (!await T(e))
62
92
  return;
63
93
  } catch (t) {
64
- r(t, "Failed to prepare test email");
94
+ a(t, "Failed to prepare test email");
65
95
  return;
66
96
  } finally {
67
- e.loadingStatus = !1;
97
+ o.loadingStatus = !1;
68
98
  }
69
99
  }
70
- V();
100
+ l();
71
101
  };
72
- return x({
73
- handleSave: T
74
- }), { __sfc: !0, config: m, isFeatureEnabled: c, exportHtml: p, save: u, openVersionHistory: f, closeVersionHistory: d, getCompiledEmail: v, compileHtml: y, validateLiquidSyntax: g, handleError: r, editorStore: e, templateStore: h, hasMigrations: H, trans: s, isExporting: i, isSaving: a, migrationModalRef: S, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: E, handleSave: T, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
102
+ return M({
103
+ handleSave: O
104
+ }), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: i, showToaster: S, handleError: a, openVersionHistory: g, closeVersionHistory: h, getCompiledEmail: V, compileHtml: w, validateLiquidSyntax: T, configStore: E, editorStore: o, saveValidationStore: H, templateStore: x, hasMigrations: C, trans: r, saveLabel: b, isExporting: s, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: k, handleExport: F, handleSaveAs: q, versionHistoryTooltipText: B, isVersionHistoryButtonVisible: L, executeSave: A, handleSave: O, handleTestEmail: R, getTooltipOptions: ot, InButtonV2: rt, MigrationConfirmModal: at };
75
105
  }
76
106
  });
77
107
  export {
78
- ft as default
108
+ Ot as default
79
109
  };
@@ -1,16 +1,16 @@
1
1
  import o from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = 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__ */ a(
7
+ }, i = [], r = /* @__PURE__ */ n(
8
8
  o,
9
- n,
9
+ a,
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "73199fa4"
13
+ "b8f24f34"
14
14
  );
15
15
  const f = r.exports;
16
16
  export {
@@ -1,19 +1,19 @@
1
- import { defineComponent as l, computed as p, ref as d } from "vue";
1
+ import { defineComponent as m, computed as p, ref as d } from "vue";
2
2
  import { useConfig as k } from "../../../composables/useConfig.js";
3
3
  import { useBack as B } from "../../../composables/useGuidoActions.js";
4
4
  import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
5
5
  import { useTranslations as v } from "../../../composables/useTranslations.js";
6
6
  import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as V } from "../../../stores/editor.js";
7
+ import { useEditorStore as y } from "../../../stores/editor.js";
8
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({
9
+ import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
10
+ const D = /* @__PURE__ */ m({
11
11
  __name: "LeftSlot",
12
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 = () => {
13
+ const e = y(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), l = p(() => {
14
+ var u, f;
15
+ return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (f = (u = t.value) == null ? void 0 : u.ui) != null && f.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
16
+ }), r = d(!1), a = () => {
17
17
  if (e.isVersionHistoryOpen) {
18
18
  n();
19
19
  return;
@@ -23,11 +23,15 @@ const D = /* @__PURE__ */ l({
23
23
  return;
24
24
  }
25
25
  i();
26
- }, a = y(() => {
27
- c(), r.value = !1;
26
+ }, c = V(async () => {
27
+ try {
28
+ await a();
29
+ } finally {
30
+ r.value = !1;
31
+ }
28
32
  }, 500);
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();
33
+ return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: l, isBackButtonDisabled: r, executeBackAction: a, debouncedBackAction: c, handleBackClick: () => {
34
+ r.value = !0, c();
31
35
  }, InButtonV2: w };
32
36
  }
33
37
  });
@@ -1,28 +1,26 @@
1
1
  import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
2
  import u from "./AMPOnboarding.vue.js";
3
3
  import v from "./GenericOnboarding.vue.js";
4
- import y from "./ItemsOnboarding.vue.js";
5
- import l from "./NewVersionPopup.vue.js";
6
- import S from "./RecommendationStrategyOnboarding.vue.js";
7
- import h from "./TextBlockOnboarding.vue.js";
8
- import w from "./VersionHistoryOnboarding.vue.js";
9
- import { usePartner as P } from "../../../composables/usePartner.js";
10
- import { useEditorStore as _ } from "../../../stores/editor.js";
11
- import { useOnboardingStore as A } from "../../../stores/onboarding.js";
12
- import { usePreviewStore as H } from "../../../stores/preview.js";
13
- const N = /* @__PURE__ */ b({
4
+ import l from "./ItemsOnboarding.vue.js";
5
+ import y from "./NewVersionPopup.vue.js";
6
+ import S from "./TextBlockOnboarding.vue.js";
7
+ import h from "./VersionHistoryOnboarding.vue.js";
8
+ import { usePartner as w } from "../../../composables/usePartner.js";
9
+ import { useEditorStore as P } from "../../../stores/editor.js";
10
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
11
+ import { usePreviewStore as A } from "../../../stores/preview.js";
12
+ const G = /* @__PURE__ */ b({
14
13
  __name: "OnboardingWrapper",
15
14
  emits: ["onboarding-finished"],
16
- setup(M, { emit: g }) {
17
- const o = A(), r = _(), s = H(), { isTestPartner: a } = P(), m = e(() => r.isStripoInitialized), p = e(() => a()), d = [
18
- { type: "newVersionPopup", component: l },
15
+ setup(H, { emit: f }) {
16
+ const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
17
+ { type: "newVersionPopup", component: y },
19
18
  { type: "genericOnboarding", component: v },
20
- { type: "textBlockOnboarding", component: h },
21
- { type: "versionHistoryOnboarding", component: w },
19
+ { type: "textBlockOnboarding", component: S },
20
+ { type: "versionHistoryOnboarding", component: h },
22
21
  { type: "ampOnboarding", component: u },
23
- { type: "itemsOnboarding", component: y },
24
- { type: "recommendationStrategyOnboarding", component: S }
25
- ], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => d.filter((n) => c(n.type)));
22
+ { type: "itemsOnboarding", component: l }
23
+ ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
26
24
  return O(async () => {
27
25
  await o.fetchUserModalState();
28
26
  }), t(
@@ -40,9 +38,9 @@ const N = /* @__PURE__ */ b({
40
38
  (n) => {
41
39
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
42
40
  }
43
- ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: f };
41
+ ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
44
42
  }
45
43
  });
46
44
  export {
47
- N as default
45
+ G as default
48
46
  };