@useinsider/guido 3.20.0-beta.7b31fec → 3.20.0-beta.af394f2

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 (109) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +102 -87
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +100 -86
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
  6. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  7. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +5 -5
  9. package/dist/components/organisms/header/EditorActions.vue2.js +90 -57
  10. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  12. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  13. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +49 -0
  14. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  15. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  16. package/dist/components/wrappers/WpModal.vue.js +1 -1
  17. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  18. package/dist/composables/useActionsApi.js +52 -47
  19. package/dist/composables/useAuthError.js +52 -0
  20. package/dist/composables/useAutoSave.js +11 -11
  21. package/dist/composables/useCodeEditorApi.js +23 -9
  22. package/dist/composables/useCortexBlueprintBridge.js +122 -54
  23. package/dist/composables/useEmailTemplateApplier.js +111 -50
  24. package/dist/composables/useHtmlCompiler.js +37 -26
  25. package/dist/composables/useHtmlValidator.js +2 -0
  26. package/dist/composables/useHttp.js +64 -54
  27. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  28. package/dist/composables/useSave.js +90 -45
  29. package/dist/composables/useSaveValidation.js +282 -0
  30. package/dist/composables/useSaveValidationRollout.js +9 -0
  31. package/dist/composables/useStripo.js +24 -20
  32. package/dist/composables/useToaster.js +17 -15
  33. package/dist/composables/useTranslations.js +3 -2
  34. package/dist/composables/useVersionHistoryApi.js +33 -24
  35. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  36. package/dist/composables/validators/useLiquidValidator.js +15 -15
  37. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  38. package/dist/config/migrator/index.js +14 -13
  39. package/dist/config/migrator/itemsBlockMigrator.js +236 -248
  40. package/dist/config/migrator/recommendationMigrator.js +28 -21
  41. package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
  42. package/dist/enums/extensions/recommendationBlock.js +30 -29
  43. package/dist/enums/save-validation.js +4 -0
  44. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  45. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  46. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  47. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  48. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  49. package/dist/extensions/Blocks/Items/template.js +219 -204
  50. package/dist/extensions/Blocks/Recommendation/block.js +15 -14
  51. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +249 -199
  52. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
  53. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
  54. package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +3 -1
  55. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
  56. package/dist/guido.css +1 -1
  57. package/dist/src/@types/config/schemas.d.ts +20 -0
  58. package/dist/src/@types/save-validation.d.ts +19 -0
  59. package/dist/src/components/Guido.vue.d.ts +17 -1
  60. package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
  61. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  62. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  63. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  64. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  65. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  66. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  67. package/dist/src/composables/useAuthError.d.ts +12 -0
  68. package/dist/src/composables/useConfig.d.ts +4 -0
  69. package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
  70. package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
  71. package/dist/src/composables/useGuidoActions.d.ts +2 -0
  72. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  73. package/dist/src/composables/useHttp.d.ts +2 -0
  74. package/dist/src/composables/useSave.d.ts +6 -1
  75. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  76. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  77. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  78. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  79. package/dist/src/config/migrator/index.d.ts +2 -1
  80. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  81. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  82. package/dist/src/enums/save-validation.d.ts +27 -0
  83. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  84. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  85. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -0
  87. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  88. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
  89. package/dist/src/mock/cortexChatStore.d.ts +12 -0
  90. package/dist/src/stores/config.d.ts +52 -0
  91. package/dist/src/stores/guido-email-editor.d.ts +20 -10
  92. package/dist/src/stores/onboarding.d.ts +4 -0
  93. package/dist/src/stores/recommendation.d.ts +5 -0
  94. package/dist/src/stores/save-validation.d.ts +22 -0
  95. package/dist/src/utils/dateUtil.d.ts +10 -0
  96. package/dist/src/utils/genericUtil.d.ts +3 -0
  97. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  98. package/dist/src/utils/templatePreparation.d.ts +30 -0
  99. package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
  100. package/dist/static/styles/components/version-history.css.js +2 -6
  101. package/dist/stores/config.js +84 -67
  102. package/dist/stores/guido-email-editor.js +3 -1
  103. package/dist/stores/onboarding.js +4 -0
  104. package/dist/stores/save-validation.js +30 -0
  105. package/dist/stores/unsubscribe.js +3 -3
  106. package/dist/utils/pairProductVariables.js +71 -71
  107. package/dist/utils/stripoEditorApi.js +11 -0
  108. package/dist/utils/templatePreparation.js +39 -36
  109. package/package.json +2 -1
@@ -1,76 +1,80 @@
1
- import { defineComponent as re, defineAsyncComponent as m, ref as O, computed as u, watch as x, onMounted as se, onUnmounted as ae } from "vue";
2
- import { useCortexBlueprintBridge as ie } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ce } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as de } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as me } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as le } from "../composables/usePartner.js";
7
- import { useStripo as ue } from "../composables/useStripo.js";
8
- import { useTimerClone as pe } from "../composables/useTimerClone.js";
9
- import { migrate as W } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as fe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import ye from "./organisms/AutoSaveController.vue.js";
14
- import ge from "./organisms/base/Toaster.vue.js";
15
- import ve from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import Se from "./organisms/header/HeaderWrapper.vue.js";
17
- import be from "./organisms/LoadingWrapper.vue.js";
18
- import he from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import Ee from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as we } from "../services/stripoApi.js";
21
- import { useConfigStore as Ce } from "../stores/config.js";
22
- import { useDynamicContentStore as De } from "../stores/dynamic-content.js";
23
- import { useEditorStore as H } from "../stores/editor.js";
24
- import { usePreviewStore as ke } from "../stores/preview.js";
25
- import { useTemplateStore as Te } from "../stores/template.js";
26
- import { useUnsubscribeStore as Fe } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
28
- const tt = /* @__PURE__ */ re({
1
+ import { defineComponent as se, defineAsyncComponent as m, ref as W, computed as p, watch as G, onMounted as ie, onUnmounted as ce } from "vue";
2
+ import { useCortexBlueprintBridge as de } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as me } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as le } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as ue } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as pe } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as fe } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as ye } from "../composables/useStripo.js";
9
+ import { useTimerClone as ge } from "../composables/useTimerClone.js";
10
+ import { migrate as V } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
12
+ import { RIBBON_SELECTOR as Se } from "../enums/onboarding.js";
13
+ import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
+ import ve from "./organisms/AutoSaveController.vue.js";
15
+ import be from "./organisms/base/AuthErrorModal.vue.js";
16
+ import he from "./organisms/base/Toaster.vue.js";
17
+ import Ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
+ import we from "./organisms/header/HeaderWrapper.vue.js";
19
+ import De from "./organisms/LoadingWrapper.vue.js";
20
+ import Ce from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
+ import ke from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
+ import Fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
+ import { useStripoApi as Re } from "../services/stripoApi.js";
24
+ import { useConfigStore as Me } from "../stores/config.js";
25
+ import { useDynamicContentStore as Te } from "../stores/dynamic-content.js";
26
+ import { useEditorStore as w } from "../stores/editor.js";
27
+ import { usePreviewStore as Ie } from "../stores/preview.js";
28
+ import { useSaveValidationStore as Le } from "../stores/save-validation.js";
29
+ import { useTemplateStore as Ue } from "../stores/template.js";
30
+ import { useUnsubscribeStore as Ae } from "../stores/unsubscribe.js";
31
+ import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
32
+ const lt = /* @__PURE__ */ se({
29
33
  __name: "Guido",
30
34
  props: {
31
35
  config: null,
32
36
  ready: { type: Boolean, default: !0 }
33
37
  },
34
38
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup(z, { expose: q, emit: r }) {
36
- const a = z, K = m(
39
+ setup(H, { expose: q, emit: r }) {
40
+ const s = H, K = m(
37
41
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), V = m(
39
- () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
42
  ), j = m(
41
- () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
43
+ () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
42
44
  ), J = m(
43
- () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
45
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
44
46
  ), Q = m(
47
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
48
+ ), X = m(
45
49
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
46
- ), E = O(), p = O(), f = De(), w = Fe(), o = Ce();
47
- a.ready && o.init(a.config);
48
- const c = H(), X = ke(), l = u(() => c.hasChanges), { isTestPartner: Y } = le(), C = () => {
50
+ ), D = W(), f = W(), y = Te(), C = Ae(), o = Me();
51
+ s.ready && o.init(s.config);
52
+ const c = w(), Y = Ie(), l = p(() => c.hasChanges), { isTestPartner: Z } = pe(), { isEnabled: ee } = fe(), k = () => {
49
53
  var t;
50
- return (t = E.value) == null ? void 0 : t.handleSave(!0);
51
- }, D = (t) => {
54
+ return (t = D.value) == null ? void 0 : t.handleSave(!0);
55
+ }, F = (t) => {
52
56
  c.loadingStatus = t;
53
57
  };
54
- ie(), me();
55
- const y = () => {
58
+ de(), ue();
59
+ const g = () => {
56
60
  var t, e;
57
61
  return {
58
62
  emailId: o.templateId,
59
63
  userId: o.userId,
60
64
  username: o.username,
61
65
  partnerName: o.partnerName,
62
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
63
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
66
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
67
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
64
68
  };
65
- }, { initPlugin: k, preloadRuntime: T } = ue(), { runExclusive: F, beginMount: M, isCurrentMount: R } = ce();
66
- let g = 0;
67
- const { getDefaultTemplate: I } = we(), { cloneTimersOnSave: L, hasTimerBlocks: B } = pe(), Z = u(() => {
69
+ }, { initPlugin: R, preloadRuntime: M } = ye(), { runExclusive: T, beginMount: I, isCurrentMount: S } = me();
70
+ let u = 0;
71
+ const { getDefaultTemplate: L } = Re(), { cloneTimersOnSave: U, hasTimerBlocks: A } = ge(), te = p(() => {
68
72
  var t;
69
73
  return !((t = o.ui) != null && t.showHeader);
70
- }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
71
- () => !!h().recommendationConfigs.strategyId
74
+ }), oe = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ne = p(
75
+ () => !!E().recommendationConfigs.strategyId
72
76
  );
73
- de({
77
+ le({
74
78
  onBack: () => {
75
79
  console.debug("guido:back"), r("back");
76
80
  },
@@ -78,70 +82,80 @@ const tt = /* @__PURE__ */ re({
78
82
  console.debug("guido:save:start"), r("save:start");
79
83
  },
80
84
  onSaveComplete: (t) => {
81
- const e = { ...t, metadata: y() };
85
+ const e = { ...t, metadata: g() };
82
86
  console.debug("guido:save:complete", e), r("save:complete", e);
83
87
  },
84
88
  onTestEmailClick: () => {
85
89
  console.debug("guido:test-email:click"), r("test-email:click");
86
90
  }
87
91
  });
88
- const U = (t) => {
89
- console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
90
- }, A = () => {
92
+ const B = (t) => {
93
+ console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
94
+ }, N = () => {
91
95
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
92
96
  };
93
- x(() => l.value, () => {
97
+ G(() => l.value, () => {
94
98
  r("on-change", l.value);
95
99
  });
96
100
  const v = (t) => {
97
- const e = t, { attribute: s, position: d } = e.detail;
98
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
101
+ const e = t, { attribute: a, position: d } = e.detail;
102
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, d);
99
103
  };
100
104
  let i = null;
101
- const S = () => {
105
+ const b = () => {
102
106
  var e;
103
- const t = document.querySelector(fe);
104
- (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
105
- }, b = async () => {
107
+ const t = document.querySelector(Se);
108
+ (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
109
+ }, h = async () => {
106
110
  var t;
107
111
  try {
108
- o.initialized || o.init(a.config), c.templateId = o.templateId;
109
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
110
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
111
- const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
112
+ o.initialized || o.init(s.config), c.templateId = o.templateId;
113
+ const e = o.template, a = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
114
+ C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
115
+ const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
116
+ partnerName: o.partnerName,
117
+ campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
118
+ rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
119
+ };
112
120
  let n = {
113
- html: s && await W(s, _),
121
+ html: a && await V(a, _, x),
114
122
  css: d
115
123
  };
116
- n.html || (n = await I(), n.html = await W(n.html, _));
117
- const oe = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
118
- B(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(oe, $(n.html)));
119
- const ne = {
124
+ n.html || (n = await L(), n.html = await V(n.html, _, x));
125
+ const re = O ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
126
+ A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(re, z(n.html)));
127
+ const ae = {
120
128
  preselectedDynamicContentList: P,
121
129
  onReady: () => {
122
130
  console.debug("guido:ready"), r("ready");
123
131
  }
124
132
  };
125
- g = M(), await k(n, y(), ne), f.selectedDynamicContentList = P;
133
+ u = I(), await R(n, g(), ae), y.selectedDynamicContentList = P;
126
134
  } catch (e) {
127
135
  console.error("Failed to initialize Stripo editor:", e);
128
136
  }
129
137
  };
130
- return se(async () => {
138
+ return ie(async () => {
131
139
  var e;
132
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), Te().$reset(), S();
133
- const t = (e = p.value) == null ? void 0 : e.parentElement;
134
- if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
135
- await b();
140
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Ue().$reset(), Le().$reset(), b();
141
+ const t = (e = f.value) == null ? void 0 : e.parentElement;
142
+ if (t && (i = new ResizeObserver(b), i.observe(t)), M(), s.ready)
143
+ await h();
136
144
  else {
137
- const s = x(() => a.ready, (d) => {
138
- d && (s(), b());
145
+ const a = G(() => s.ready, (d) => {
146
+ d && (a(), h());
139
147
  });
140
148
  }
141
149
  document.addEventListener("dynamic-content:open", v);
142
- }), ae(() => {
143
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
144
- if (R(g))
150
+ }), ce(() => {
151
+ if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), S(u))
152
+ try {
153
+ w().isStripoInitialized = !1;
154
+ } catch (t) {
155
+ console.debug("Failed to close the editor readiness gate on unmount", t);
156
+ }
157
+ T(async () => {
158
+ if (S(u))
145
159
  try {
146
160
  window.UIEditor.removeEditor();
147
161
  } catch {
@@ -150,15 +164,15 @@ const tt = /* @__PURE__ */ re({
150
164
  }), o.reset();
151
165
  }), q({
152
166
  dynamicContent: {
153
- insert: U,
154
- close: A
167
+ insert: B,
168
+ close: N
155
169
  },
156
170
  hasChanges: l,
157
- saveSilent: C,
158
- setLoading: D
159
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, LegacyStrategyUpdatedModal: Q, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: T, runExclusive: F, beginMount: M, isCurrentMount: R, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: U, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: ye, Toaster: ge, FilterSelectionDrawer: ve, HeaderWrapper: Se, LoadingWrapper: be, SaveAsTemplateDrawer: he, UnsubscribeWrapper: Ee };
171
+ saveSilent: k,
172
+ setLoading: F
173
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: D, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: s, configStore: o, editorStore: c, previewStore: Y, hasChanges: l, isTestPartner: Z, isSaveValidationEnabled: ee, saveSilent: k, setLoading: F, emit: r, buildMetadata: g, initPlugin: R, preloadRuntime: M, runExclusive: T, beginMount: I, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: L, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: ne, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: ve, AuthErrorModal: be, Toaster: he, FilterSelectionDrawer: Ee, HeaderWrapper: we, LoadingWrapper: De, SaveAsTemplateDrawer: Ce, UnsubscribeWrapper: ke, ValidationErrorDrawer: Fe };
160
174
  }
161
175
  });
162
176
  export {
163
- tt as default
177
+ lt as default
164
178
  };
@@ -1,13 +1,14 @@
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({
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({
5
6
  __name: "AutoSaveController",
6
- setup(a) {
7
- const { save: e } = s(), o = () => e(!1, !0);
8
- return r(o), { __sfc: !0, save: e, backgroundSave: o };
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 };
9
10
  }
10
11
  });
11
12
  export {
12
- f as default
13
+ v as default
13
14
  };
@@ -0,0 +1,18 @@
1
+ import e from "./AuthErrorModal.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var o = this, r = o._self._c, t = o._self._setupProxy;
6
+ return t.authError ? r("div", { staticClass: "auth-error-modal" }, [r(t.WpModal, { attrs: { id: "guido__auth-error-modal", state: "warning", "close-button-status": !1, "close-on-outside-click": !1, "footer-button-options": t.footerButtonOptions, title: t.title }, on: { close: t.dismiss, "primary-action": t.recover } }, [r("p", [o._v(o._s(t.message))])])], 1) : o._e();
7
+ }, n = [], i = /* @__PURE__ */ s(
8
+ e,
9
+ a,
10
+ n,
11
+ !1,
12
+ null,
13
+ "b4d7ae51"
14
+ );
15
+ const m = i.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,42 @@
1
+ import { defineComponent as c, computed as n } from "vue";
2
+ import p from "../../wrappers/WpModal.vue.js";
3
+ import { useAuthError as d } from "../../../composables/useAuthError.js";
4
+ import { useTranslations as m } from "../../../composables/useTranslations.js";
5
+ const _ = /* @__PURE__ */ c({
6
+ __name: "AuthErrorModal",
7
+ setup(v) {
8
+ const e = m(), { authError: t } = d(), r = n(() => {
9
+ var o;
10
+ return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data !== null;
11
+ }), s = n(() => {
12
+ var o;
13
+ return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data === null;
14
+ }), i = n(() => r.value ? e("integration-hub.reload-this-page") : e("action-builder.session-expired")), u = n(() => r.value ? e("auth.error-occurred-refresh") : s.value ? e("settings.session-on-another-device") : e("journey-builder.login-session-expired")), l = n(() => ({
15
+ primaryButton: {
16
+ type: "primary",
17
+ labelText: r.value ? e("integration-hub.reload") : e("journey-builder.login-popup-button")
18
+ },
19
+ cancelOrBackButton: {
20
+ type: "secondary",
21
+ styling: "ghost",
22
+ labelText: e("settings.cancel")
23
+ }
24
+ })), a = () => {
25
+ if (r.value) {
26
+ window.location.reload();
27
+ return;
28
+ }
29
+ window.location.replace("/");
30
+ };
31
+ return { __sfc: !0, trans: e, authError: t, isPageExpired: r, isTakenOver: s, title: i, message: u, footerButtonOptions: l, recover: a, dismiss: () => {
32
+ if (r.value) {
33
+ t.value = null;
34
+ return;
35
+ }
36
+ a();
37
+ }, WpModal: p };
38
+ }
39
+ });
40
+ export {
41
+ _ as default
42
+ };
@@ -4,20 +4,20 @@ 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);
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
- "1ca6baf0"
18
+ "2cccbd44"
19
19
  );
20
- const v = c.exports;
20
+ const v = p.exports;
21
21
  export {
22
22
  v as default
23
23
  };
@@ -1,79 +1,112 @@
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 I, computed as c, ref as u } from "vue";
2
+ import { useActionsApi as P } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as W } from "../../../composables/useConfig.js";
4
+ import { useExport as j } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as G } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as J } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as K } from "../../../composables/useSave.js";
8
+ import { useSaveValidation as N } from "../../../composables/useSaveValidation.js";
9
+ import { useSaveValidationRollout as Q } from "../../../composables/useSaveValidationRollout.js";
10
+ import { useToaster as U } from "../../../composables/useToaster.js";
11
+ import { useTranslations as X } from "../../../composables/useTranslations.js";
12
+ import { useVersionHistoryApi as Y } from "../../../composables/useVersionHistoryApi.js";
13
+ import { useLiquidValidator as Z } from "../../../composables/validators/useLiquidValidator.js";
14
+ import { ToasterTypeOptions as $ } from "../../../enums/toaster.js";
15
+ import { useConfigStore as tt } from "../../../stores/config.js";
16
+ import { useEditorStore as ot } from "../../../stores/editor.js";
17
+ import { useSaveValidationStore as et } from "../../../stores/save-validation.js";
18
+ import { useTemplateStore as rt } from "../../../stores/template.js";
19
+ import { getTooltipOptions as it } from "../../../utils/tooltipUtils.js";
20
+ import { InButtonV2 as st } from "@useinsider/design-system-vue";
21
+ import { storeToRefs as at } from "pinia";
22
+ import nt from "./MigrationConfirmModal.vue.js";
23
+ const bt = /* @__PURE__ */ I({
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(lt, { expose: k }) {
26
+ const { config: p, isFeatureEnabled: f } = W(), { exportHtml: d } = j(), { save: v } = K(), { validateCurrentTemplate: y } = N(), { isEnabled: i } = Q(), { showToaster: S, handleError: s } = U(), { openVersionHistory: g, closeVersionHistory: h } = Y(), { getCompiledEmail: T } = P(), { compileHtml: w } = J(), { validateLiquidSyntax: E } = Z(), V = tt(), o = ot(), H = et(), x = rt(), { hasMigrations: C } = at(x), r = X(), F = c(() => i.value && V.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), a = u(!1), n = u(!1), _ = u(), l = G(), q = () => {
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
+ }, B = async () => {
33
+ a.value = !0, await d(), a.value = !1;
34
+ }, L = () => {
35
+ o.isSaveAsTemplateDrawerOpen = !0;
36
+ }, R = c(() => o.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), D = c(
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) {
42
- if (t)
43
- throw n;
44
- r(n, "Failed to save template");
45
+ e = await v(t);
46
+ } catch (b) {
47
+ s(b, "Failed to save template");
45
48
  } finally {
46
- a.value = !1, !t && !o && (e.loadingStatus = !1);
49
+ n.value = !1, !t && !e && (o.loadingStatus = !1);
47
50
  }
48
- return o;
49
- }, T = (t) => {
50
- var o;
51
- if (!t && H.value) {
52
- (o = S.value) == null || o.open();
51
+ return e;
52
+ }, O = (t) => {
53
+ var e;
54
+ if (!t && C.value) {
55
+ (e = _.value) == null || e.open();
53
56
  return;
54
57
  }
55
- return E(t);
56
- }, F = async () => {
57
- if (c("liquidSyntax")) {
58
- e.loadingStatus = !0;
58
+ return A(t);
59
+ }, m = async () => {
60
+ o.loadingStatus = !0;
61
+ try {
62
+ return await y();
63
+ } catch (t) {
64
+ return console.warn("Test-path validation failed; sending without the drawer.", t), [];
65
+ } finally {
66
+ o.loadingStatus = !1;
67
+ }
68
+ }, M = async () => {
69
+ const t = await m();
70
+ t.length && H.open(t, "test");
71
+ }, z = async () => {
72
+ if (i.value) {
73
+ if ((await m()).length) {
74
+ S({
75
+ type: $.Error,
76
+ message: r("email-editor.validation-errors-found"),
77
+ actionButton: {
78
+ text: r("email-editor.check-errors"),
79
+ onClick: () => {
80
+ M();
81
+ }
82
+ },
83
+ autoHide: !1
84
+ });
85
+ return;
86
+ }
87
+ l();
88
+ return;
89
+ }
90
+ if (f("liquidSyntax")) {
91
+ o.loadingStatus = !0;
59
92
  try {
60
- const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
61
- if (!await g(o))
93
+ const { html: t } = await T({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: e } = w(t);
94
+ if (!await E(e))
62
95
  return;
63
96
  } catch (t) {
64
- r(t, "Failed to prepare test email");
97
+ s(t, "Failed to prepare test email");
65
98
  return;
66
99
  } finally {
67
- e.loadingStatus = !1;
100
+ o.loadingStatus = !1;
68
101
  }
69
102
  }
70
- V();
103
+ l();
71
104
  };
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 };
105
+ return k({
106
+ handleSave: O
107
+ }), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: i, showToaster: S, handleError: s, openVersionHistory: g, closeVersionHistory: h, getCompiledEmail: T, compileHtml: w, validateLiquidSyntax: E, configStore: V, editorStore: o, saveValidationStore: H, templateStore: x, hasMigrations: C, trans: r, saveLabel: F, isExporting: a, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: q, handleExport: B, handleSaveAs: L, versionHistoryTooltipText: R, isVersionHistoryButtonVisible: D, executeSave: A, handleSave: O, collectTestErrors: m, openTestErrors: M, handleTestEmail: z, getTooltipOptions: it, InButtonV2: st, MigrationConfirmModal: nt };
75
108
  }
76
109
  });
77
110
  export {
78
- ft as default
111
+ bt as default
79
112
  };
@@ -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 {