@useinsider/guido 3.19.0-beta.f02eaa1 → 3.19.0-beta.f05f865

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 (105) 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 +86 -78
  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/base/Toaster.vue2.js +13 -12
  9. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -7
  10. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +69 -52
  11. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -44
  12. package/dist/components/organisms/header/EditorActions.vue.js +5 -5
  13. package/dist/components/organisms/header/EditorActions.vue2.js +90 -57
  14. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  16. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +3 -3
  17. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +21 -20
  18. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  19. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +49 -0
  20. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  21. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  22. package/dist/components/wrappers/WpModal.vue.js +1 -1
  23. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  24. package/dist/composables/useActionsApi.js +52 -47
  25. package/dist/composables/useAuthError.js +52 -0
  26. package/dist/composables/useCodeEditorApi.js +23 -9
  27. package/dist/composables/useCustomInterfaceAppearance.js +61 -51
  28. package/dist/composables/useHtmlCompiler.js +37 -26
  29. package/dist/composables/useHtmlValidator.js +89 -82
  30. package/dist/composables/useHttp.js +64 -54
  31. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  32. package/dist/composables/useRecommendation.js +40 -35
  33. package/dist/composables/useSave.js +90 -45
  34. package/dist/composables/useSaveValidation.js +282 -0
  35. package/dist/composables/useSaveValidationRollout.js +9 -0
  36. package/dist/composables/useStripo.js +43 -39
  37. package/dist/composables/useToaster.js +18 -22
  38. package/dist/composables/useTranslations.js +3 -2
  39. package/dist/composables/useVersionHistoryApi.js +33 -24
  40. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  41. package/dist/composables/validators/useLiquidValidator.js +15 -15
  42. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  43. package/dist/config/migrator/index.js +14 -13
  44. package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
  45. package/dist/enums/extensions/recommendationBlock.js +43 -35
  46. package/dist/enums/save-validation.js +4 -0
  47. package/dist/extensions/Blocks/Recommendation/block.js +65 -45
  48. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  49. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +70 -58
  50. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +133 -79
  51. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +96 -97
  52. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +212 -94
  53. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +1 -1
  54. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  55. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
  56. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  57. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  58. package/dist/guido.css +1 -1
  59. package/dist/src/@types/config/schemas.d.ts +20 -0
  60. package/dist/src/@types/save-validation.d.ts +19 -0
  61. package/dist/src/components/Guido.vue.d.ts +17 -1
  62. package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
  63. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  64. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  65. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  66. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  67. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  68. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  69. package/dist/src/composables/useAuthError.d.ts +12 -0
  70. package/dist/src/composables/useConfig.d.ts +4 -0
  71. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  72. package/dist/src/composables/useHttp.d.ts +2 -0
  73. package/dist/src/composables/useSave.d.ts +6 -1
  74. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  75. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  76. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  77. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  78. package/dist/src/config/migrator/index.d.ts +2 -1
  79. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  80. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  81. package/dist/src/enums/save-validation.d.ts +27 -0
  82. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  83. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  84. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  85. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +8 -0
  87. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -6
  88. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +92 -0
  89. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  90. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +1 -1
  91. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
  92. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  93. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  94. package/dist/src/stores/config.d.ts +52 -0
  95. package/dist/src/stores/save-validation.d.ts +22 -0
  96. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  97. package/dist/src/utils/templatePreparation.d.ts +30 -0
  98. package/dist/static/styles/components/recommendation-strategy.css.js +43 -4
  99. package/dist/static/styles/components/skeleton.css.js +23 -0
  100. package/dist/stores/config.js +84 -67
  101. package/dist/stores/save-validation.js +30 -0
  102. package/dist/stores/unsubscribe.js +3 -3
  103. package/dist/utils/stripoEditorApi.js +11 -0
  104. package/dist/utils/templatePreparation.js +54 -51
  105. package/package.json +2 -1
@@ -1,31 +1,35 @@
1
- import { defineComponent as re, defineAsyncComponent as m, ref as O, computed as u, watch as P, 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 x } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as W } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as fe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as G } 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 x, computed as u, watch as W, 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 G } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as V } from "../enums/defaults.js";
12
+ import { RIBBON_SELECTOR as Se } from "../enums/onboarding.js";
13
+ import { useRecommendationExtensionStore as h } 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 Re from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
+ import { useStripoApi as Fe } 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 $ } 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 H } from "../utils/linkTrackingIds.js";
32
+ const lt = /* @__PURE__ */ se({
29
33
  __name: "Guido",
30
34
  props: {
31
35
  config: null,
@@ -33,25 +37,25 @@ const tt = /* @__PURE__ */ re({
33
37
  },
34
38
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
39
  setup(z, { expose: q, emit: r }) {
36
- const a = z, K = m(
40
+ const s = z, 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
- ), h = O(), p = O(), f = De(), E = Fe(), o = Ce();
47
- a.ready && o.init(a.config);
48
- const c = H(), X = ke(), l = u(() => c.hasChanges), { isTestPartner: Y } = le(), w = () => {
50
+ ), E = x(), p = x(), f = Te(), w = Ae(), o = Me();
51
+ s.ready && o.init(s.config);
52
+ const c = $(), Y = Ie(), l = u(() => c.hasChanges), { isTestPartner: Z } = pe(), { isEnabled: ee } = fe(), D = () => {
49
53
  var t;
50
- return (t = h.value) == null ? void 0 : t.handleSave(!0);
54
+ return (t = E.value) == null ? void 0 : t.handleSave(!0);
51
55
  }, C = (t) => {
52
56
  c.loadingStatus = t;
53
57
  };
54
- ie(), me();
58
+ de(), ue();
55
59
  const y = () => {
56
60
  var t, e;
57
61
  return {
@@ -59,18 +63,18 @@ const tt = /* @__PURE__ */ re({
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) || W.SAVED_MODULES,
63
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
66
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || V.SAVED_MODULES,
67
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || V.DEFAULT_MODULES
64
68
  };
65
- }, { initPlugin: D, preloadRuntime: k } = ue(), { runExclusive: T, beginMount: F, isCurrentMount: M } = ce();
69
+ }, { initPlugin: k, preloadRuntime: R } = ye(), { runExclusive: F, beginMount: M, isCurrentMount: T } = me();
66
70
  let g = 0;
67
- const { getDefaultTemplate: I } = we(), { cloneTimersOnSave: L, hasTimerBlocks: R } = pe(), Z = u(() => {
71
+ const { getDefaultTemplate: I } = Fe(), { cloneTimersOnSave: L, hasTimerBlocks: U } = ge(), te = u(() => {
68
72
  var t;
69
73
  return !((t = o.ui) != null && t.showHeader);
70
- }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
71
- () => !!G().recommendationConfigs.strategyId
74
+ }), oe = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ne = u(
75
+ () => !!h().recommendationConfigs.strategyId
72
76
  );
73
- de({
77
+ le({
74
78
  onBack: () => {
75
79
  console.debug("guido:back"), r("back");
76
80
  },
@@ -85,63 +89,67 @@ const tt = /* @__PURE__ */ re({
85
89
  console.debug("guido:test-email:click"), r("test-email:click");
86
90
  }
87
91
  });
88
- const B = (t) => {
92
+ const A = (t) => {
89
93
  console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
90
- }, U = () => {
94
+ }, B = () => {
91
95
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
92
96
  };
93
- P(() => l.value, () => {
97
+ W(() => l.value, () => {
94
98
  r("on-change", l.value);
95
99
  });
96
- 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);
100
+ const S = (t) => {
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 v = () => {
102
106
  var e;
103
- const t = document.querySelector(fe);
107
+ const t = document.querySelector(Se);
104
108
  (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
105
109
  }, b = 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) || "", A = (e == null ? void 0 : e.preselectedDynamicContent) || [];
110
- E.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) || "", N = (e == null ? void 0 : e.preselectedDynamicContent) || [];
114
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
115
+ const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), O = {
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 x(s, _),
121
+ html: a && await G(a, P, O),
114
122
  css: d
115
123
  };
116
- n.html || (n = await I(), n.html = await x(n.html, _));
117
- const oe = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
118
- R(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(oe, $(n.html)));
119
- const ne = {
120
- preselectedDynamicContentList: A,
124
+ n.html || (n = await I(), n.html = await G(n.html, P, O));
125
+ const re = _ ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
126
+ U(n.html) && (n.html = await L(n.html)), _ && (c.trackIdSessionFloor = Math.max(re, H(n.html)));
127
+ const ae = {
128
+ preselectedDynamicContentList: N,
121
129
  onReady: () => {
122
130
  console.debug("guido:ready"), r("ready");
123
131
  }
124
132
  };
125
- g = F(), await D(n, y(), ne), f.selectedDynamicContentList = A;
133
+ g = M(), await k(n, y(), ae), f.selectedDynamicContentList = N;
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"), G().$reset(), H().$reset(), Te().$reset(), S();
140
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), $().$reset(), Ue().$reset(), Le().$reset(), v();
133
141
  const t = (e = p.value) == null ? void 0 : e.parentElement;
134
- if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
142
+ if (t && (i = new ResizeObserver(v), i.observe(t)), R(), s.ready)
135
143
  await b();
136
144
  else {
137
- const s = P(() => a.ready, (d) => {
138
- d && (s(), b());
145
+ const a = W(() => s.ready, (d) => {
146
+ d && (a(), b());
139
147
  });
140
148
  }
141
- document.addEventListener("dynamic-content:open", v);
142
- }), ae(() => {
143
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), T(async () => {
144
- if (M(g))
149
+ document.addEventListener("dynamic-content:open", S);
150
+ }), ce(() => {
151
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", S), h().disposeStrategyPageReturn(), F(async () => {
152
+ if (T(g))
145
153
  try {
146
154
  window.UIEditor.removeEditor();
147
155
  } catch {
@@ -150,15 +158,15 @@ const tt = /* @__PURE__ */ re({
150
158
  }), o.reset();
151
159
  }), q({
152
160
  dynamicContent: {
153
- insert: B,
154
- close: U
161
+ insert: A,
162
+ close: B
155
163
  },
156
164
  hasChanges: l,
157
- saveSilent: w,
165
+ saveSilent: D,
158
166
  setLoading: C
159
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, LegacyStrategyUpdatedModal: Q, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, runExclusive: T, beginMount: F, isCurrentMount: M, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: R, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: B, closeDynamicContent: U, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: ye, Toaster: ge, FilterSelectionDrawer: ve, HeaderWrapper: Se, LoadingWrapper: be, SaveAsTemplateDrawer: he, UnsubscribeWrapper: Ee };
167
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: s, configStore: o, editorStore: c, previewStore: Y, hasChanges: l, isTestPartner: Z, isSaveValidationEnabled: ee, saveSilent: D, setLoading: C, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: R, runExclusive: F, beginMount: M, isCurrentMount: T, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: U, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: ne, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: S, ribbonObserver: i, updateRibbonOffset: v, startEditor: b, AutoSaveController: ve, AuthErrorModal: be, Toaster: he, FilterSelectionDrawer: Ee, HeaderWrapper: we, LoadingWrapper: De, SaveAsTemplateDrawer: Ce, UnsubscribeWrapper: ke, ValidationErrorDrawer: Re };
160
168
  }
161
169
  });
162
170
  export {
163
- tt as default
171
+ lt as default
164
172
  };
@@ -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
+ };
@@ -1,18 +1,19 @@
1
- import { defineComponent as a, ref as c, computed as i, onBeforeUnmount as u } from "vue";
2
- import { useToasterStore as f } from "../../../stores/toaster.js";
3
- import { InToasts as m } from "@useinsider/design-system-vue";
4
- const d = /* @__PURE__ */ a({
1
+ import { defineComponent as c, ref as i, computed as u, onBeforeUnmount as m } from "vue";
2
+ import { useToaster as f } from "../../../composables/useToaster.js";
3
+ import { useToasterStore as p } from "../../../stores/toaster.js";
4
+ import { InToasts as l } from "@useinsider/design-system-vue";
5
+ const x = /* @__PURE__ */ c({
5
6
  __name: "Toaster",
6
- setup(p) {
7
- const t = f(), o = c(null), r = i(() => t.actionButton ? [{ text: t.actionButton.text }] : []), s = () => {
8
- t.actionButton && t.actionButton.onClick(), t.hideToaster();
7
+ setup(_) {
8
+ const t = p(), { hideToaster: o } = f(), e = i(null), s = u(() => t.actionButton ? [{ text: t.actionButton.text }] : []), a = () => {
9
+ t.actionButton && t.actionButton.onClick(), o();
9
10
  };
10
- return u(() => {
11
- var e, n;
12
- t.$reset(), (n = (e = o.value) == null ? void 0 : e.$el) == null || n.remove();
13
- }), { __sfc: !0, store: t, toastRef: o, actionButtonsConfig: r, handleActionClick: s, InToasts: m };
11
+ return m(() => {
12
+ var n, r;
13
+ o(), t.$reset(), (r = (n = e.value) == null ? void 0 : n.$el) == null || r.remove();
14
+ }), { __sfc: !0, store: t, hideToaster: o, toastRef: e, actionButtonsConfig: s, handleActionClick: a, InToasts: l };
14
15
  }
15
16
  });
16
17
  export {
17
- d as default
18
+ x as default
18
19
  };
@@ -1,19 +1,21 @@
1
- import r from "./AssignStrategyDrawer.vue2.js";
1
+ import s from "./AssignStrategyDrawer.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
5
  var a = function() {
6
- var e = this, s = e._self._c, t = e._self._setupProxy;
7
- return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
- return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading || t.store.legacyConversionLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
9
- }, proxy: !0 }], null, !1, 1208053566) }) : e._e();
6
+ var e = this, r = e._self._c, t = e._self._setupProxy;
7
+ return t.store.assignStrategyDrawerStatus ? r(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
+ return [r("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [r(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", loading: t.store.strategiesLoading || t.store.legacyConversionLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(l) {
9
+ return t.store.openStrategyCreation();
10
+ }, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
11
+ }, proxy: !0 }], null, !1, 659108535) }) : e._e();
10
12
  }, n = [], i = /* @__PURE__ */ o(
11
- r,
13
+ s,
12
14
  a,
13
15
  n,
14
16
  !1,
15
17
  null,
16
- "6bbe5862"
18
+ "6ce48dfd"
17
19
  );
18
20
  const y = i.exports;
19
21
  export {
@@ -1,52 +1,51 @@
1
- import { defineComponent as E, defineAsyncComponent as S, ref as T, computed as o, watch as x } from "vue";
1
+ import { defineComponent as B, defineAsyncComponent as T, ref as w, computed as n, watch as k } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as h } 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 L } from "../../../../enums/extensions/recommendationBlock.js";
7
- import { ToasterTypeOptions as d } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as I } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import N from "./StrategyInfoBoxContent.vue.js";
10
- import { formatShortDate as k } from "../../../../utils/dateUtil.js";
11
- import { asText as _ } from "../../../../utils/genericUtil.js";
12
- import { escapeHtml as b } from "../../../../utils/htmlEscape.js";
13
- import { InSkeleton as P } from "@useinsider/design-system-vue";
14
- const Z = /* @__PURE__ */ E({
3
+ import { useToaster as b } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as L } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as N } from "../../../../enums/date.js";
6
+ import { URLS as R } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as P } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitStrategyChange as D } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
+ import U from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as M } from "../../../../utils/dateUtil.js";
12
+ import { asText as O } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as G } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as $ } from "@useinsider/design-system-vue";
15
+ const st = /* @__PURE__ */ B({
15
16
  __name: "AssignStrategyDrawer",
16
- setup(U) {
17
- const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
18
- render: (s) => s(P, { props: { sizing: { width: t, height: r } } })
19
- }), v = S({
20
- loader: async () => (await c()).OrgStrategyDetailModal,
21
- loadingComponent: g(480, 240),
17
+ setup(H) {
18
+ const g = () => import("@useinsider/design-system-organisms"), p = (t, r) => ({
19
+ render: (o) => o($, { props: { sizing: { width: t, height: r } } })
20
+ }), E = T({
21
+ loader: async () => (await g()).OrgStrategyDetailModal,
22
+ loadingComponent: p(480, 240),
22
23
  delay: 0
23
- }), D = S({
24
- loader: async () => (await c()).OrgStrategyDropdown,
25
- loadingComponent: g(240, 42),
26
- delay: 0
27
- }), a = C(), e = I(), { showToaster: n } = h(), i = T(null), m = "legacy", l = T(!1), w = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: L.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
28
- x(() => e.assignStrategyDrawerStatus, (t) => {
24
+ }), I = T({
25
+ loader: async () => (await g()).OrgStrategyDropdown
26
+ }), i = "guido-edit-strategy-", a = L(), e = P(), { showToaster: c } = b(), s = w(null), m = "legacy", l = w(!1), x = n(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: R.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
+ k(() => e.assignStrategyDrawerStatus, (t) => {
29
28
  if (!t)
30
29
  return;
31
30
  const { strategyId: r } = e.recommendationConfigs;
32
- i.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.fetchStrategies().catch(() => {
33
- n({
34
- type: d.Error,
31
+ s.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
+ c({
33
+ type: u.Error,
35
34
  message: a("discovery-strategy.error-description")
36
35
  });
37
36
  });
38
37
  });
39
- const y = (t) => {
40
- const r = _(t.updated_at || t.created_at);
38
+ const f = (t) => {
39
+ const r = O(t.updated_at || t.created_at);
41
40
  if (!r)
42
41
  return "";
43
- const s = k(r, B);
44
- return a("recommendation-strategy.last-updated-on", { value: s });
45
- }, u = o(() => ({
42
+ const o = M(r, N);
43
+ return a("recommendation-strategy.last-updated-on", { value: o });
44
+ }, S = n(() => ({
46
45
  text: a("ds-steps.legacy-strategy"),
47
46
  value: m,
48
47
  hidden: !0
49
- })), p = o(() => e.strategies.map((t) => ({
48
+ })), d = n(() => e.strategies.map((t) => ({
50
49
  text: t.name,
51
50
  value: t.strategy_id,
52
51
  infoBoxProps: {
@@ -54,16 +53,33 @@ const Z = /* @__PURE__ */ E({
54
53
  theme: "light",
55
54
  variant: "information",
56
55
  className: "assign-strategy-info-box",
57
- titleText: b(_(t.name)),
56
+ titleText: G(O(t.name)),
58
57
  descriptionStatus: !0,
59
- descriptionText: y(t),
60
- slot: N,
61
- slotProps: { strategy: t }
58
+ descriptionText: f(t),
59
+ slot: U,
60
+ slotProps: { strategy: t },
61
+ // The info box drops the option's value/text, so the id is the only channel
62
+ // that can carry the strategy back to the click handler.
63
+ buttonOptions: [{
64
+ id: `${i}${t.strategy_id}`,
65
+ text: a("eureka.edit-strategy"),
66
+ type: "text",
67
+ // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
68
+ // silently render blank space instead of failing.
69
+ icon: "line-open-website"
70
+ }]
62
71
  }
63
- }))), O = o(() => e.isLegacyStrategyBlock ? [u.value, ...p.value] : p.value), f = o(() => {
64
- const t = e.strategies.find((r) => String(r.strategy_id) === String(i.value ?? ""));
72
+ }))), A = n(() => e.isLegacyStrategyBlock ? [S.value, ...d.value] : d.value), h = (t) => {
73
+ var _;
74
+ const r = (_ = t == null ? void 0 : t.id) != null && _.startsWith(i) ? t.id.slice(i.length) : "";
75
+ if (!r)
76
+ return;
77
+ const o = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
78
+ e.openStrategyEdit(r) && (String(s.value ?? "") === r && (s.value = null), y && (e.removeStrategy(), o !== null && D(o, "Removed recommendation strategy")));
79
+ }, v = n(() => {
80
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(s.value ?? ""));
65
81
  return t ? { ...t, fallback_config: null } : null;
66
- }), A = o(() => ({
82
+ }), C = n(() => ({
67
83
  primaryButton: {
68
84
  styling: "solid",
69
85
  type: "primary",
@@ -75,10 +91,10 @@ const Z = /* @__PURE__ */ E({
75
91
  labelText: a("products.cancel")
76
92
  }
77
93
  }));
78
- return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: v, OrgStrategyDropdown: D, trans: a, store: e, showToaster: n, selectedStrategyId: i, LEGACY_OPTION_VALUE: m, showSelectionError: l, drawerDescription: w, lastUpdatedText: y, legacyStrategyOption: u, remoteStrategyOptions: p, strategyOptions: O, selectedStrategy: f, footerButtonGroupOptions: A, closeDrawer: () => {
94
+ return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal: E, OrgStrategyDropdown: I, EDIT_BUTTON_ID_PREFIX: i, trans: a, store: e, showToaster: c, selectedStrategyId: s, LEGACY_OPTION_VALUE: m, showSelectionError: l, drawerDescription: x, lastUpdatedText: f, legacyStrategyOption: S, remoteStrategyOptions: d, strategyOptions: A, onInfoBoxButtonClick: h, selectedStrategy: v, footerButtonGroupOptions: C, closeDrawer: () => {
79
95
  e.closeAssignStrategyDrawer();
80
96
  }, assignStrategy: async () => {
81
- const t = f.value;
97
+ const t = v.value;
82
98
  if (!t) {
83
99
  l.value = !0;
84
100
  return;
@@ -86,25 +102,26 @@ const Z = /* @__PURE__ */ E({
86
102
  let r = "";
87
103
  try {
88
104
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
89
- } catch (s) {
90
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", s);
105
+ } catch (y) {
106
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
91
107
  }
92
108
  if (!r) {
93
- n({
94
- type: d.Error,
109
+ c({
110
+ type: u.Error,
95
111
  message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
96
112
  });
97
113
  return;
98
114
  }
99
- e.assignStrategy(t), n({
100
- type: d.Success,
115
+ const o = e.currentRecommendationId;
116
+ e.assignStrategy(t), c({
117
+ type: u.Success,
101
118
  message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
102
- }), e.closeAssignStrategyDrawer();
119
+ }), e.closeAssignStrategyDrawer(), o !== null && await D(o, "Assigned recommendation strategy");
103
120
  }, onSelect: (t) => {
104
- i.value = t.value, l.value = !1;
121
+ s.value = t.value, l.value = !1;
105
122
  } };
106
123
  }
107
124
  });
108
125
  export {
109
- Z as default
126
+ st as default
110
127
  };