@useinsider/guido 3.19.0-beta.4b9be3a → 3.19.0-beta.575d19c

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 (120) hide show
  1. package/README.md +21 -3
  2. package/dist/@types/config/schemas.js +76 -67
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +94 -91
  5. package/dist/components/organisms/AutoSaveController.vue2.js +18 -8
  6. package/dist/components/organisms/base/Toaster.vue2.js +13 -12
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  8. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
  9. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  10. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  11. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
  12. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  13. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  14. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  15. package/dist/components/organisms/header/EditorActions.vue2.js +35 -53
  16. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  17. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
  18. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  19. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  20. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  21. package/dist/components/organisms/header/LeftSlot.vue2.js +32 -23
  22. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  23. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  24. package/dist/components/organisms/header/RightSlot.vue.js +9 -8
  25. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  26. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  27. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  28. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  29. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  30. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  31. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  32. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  33. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +56 -34
  34. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  35. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  36. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  37. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  38. package/dist/composables/useAccessibilityApi.js +45 -0
  39. package/dist/composables/useActionsApi.js +44 -43
  40. package/dist/composables/useCodeEditorApi.js +23 -9
  41. package/dist/composables/useCortexBlueprintBridge.js +54 -120
  42. package/dist/composables/useCustomInterfaceAppearance.js +67 -52
  43. package/dist/composables/useEmailTemplateApplier.js +51 -96
  44. package/dist/composables/useHtmlValidator.js +87 -82
  45. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  46. package/dist/composables/useRecommendation.js +40 -35
  47. package/dist/composables/useStripo.js +30 -30
  48. package/dist/composables/useToaster.js +14 -20
  49. package/dist/composables/useTranslations.js +3 -2
  50. package/dist/composables/useVersionHistoryApi.js +33 -24
  51. package/dist/config/i18n/en/labels.json.js +36 -4
  52. package/dist/config/i18n/en/tooltips.json.js +2 -1
  53. package/dist/enums/extensions/recommendationBlock.js +49 -33
  54. package/dist/extensions/Blocks/Recommendation/block.js +61 -42
  55. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  56. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +100 -94
  57. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +130 -55
  58. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  59. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +273 -92
  60. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  61. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  62. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  63. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  64. package/dist/guido.css +1 -1
  65. package/dist/services/recommendationApi.js +46 -37
  66. package/dist/sprite.svg +6 -0
  67. package/dist/src/@types/config/schemas.d.ts +18 -0
  68. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
  69. package/dist/src/components/organisms/header/AutoSaveStatus.vue.d.ts +2 -0
  70. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  71. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  72. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
  73. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  74. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  75. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  76. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  77. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  78. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  79. package/dist/src/composables/useActionsApi.d.ts +2 -2
  80. package/dist/src/composables/useConfig.d.ts +6 -0
  81. package/dist/src/composables/useCortexBlueprintBridge.d.ts +3 -4
  82. package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -26
  83. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  84. package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
  85. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  86. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  87. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  88. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  89. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  91. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
  92. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  93. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  94. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  95. package/dist/src/services/recommendationApi.d.ts +2 -1
  96. package/dist/src/stores/config.d.ts +342 -0
  97. package/dist/src/stores/editor.d.ts +109 -0
  98. package/dist/src/stores/guido-email-editor.d.ts +10 -32
  99. package/dist/src/stores/onboarding.d.ts +1865 -136
  100. package/dist/src/stores/version-history.d.ts +1 -1
  101. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  102. package/dist/src/utils/timeUtil.d.ts +5 -0
  103. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  104. package/dist/static/assets/icons/line-info.svg.js +5 -0
  105. package/dist/static/styles/components/accessibility.css.js +234 -0
  106. package/dist/static/styles/components/recommendation-strategy.css.js +104 -9
  107. package/dist/static/styles/components/skeleton.css.js +23 -0
  108. package/dist/static/styles/variables.css.js +2 -0
  109. package/dist/stores/config.js +74 -60
  110. package/dist/stores/editor.js +7 -4
  111. package/dist/stores/guido-email-editor.js +1 -3
  112. package/dist/stores/onboarding.js +79 -47
  113. package/dist/stores/unsubscribe.js +3 -3
  114. package/dist/utils/stripoEditorApi.js +11 -0
  115. package/dist/utils/templatePreparation.js +55 -55
  116. package/dist/utils/timeUtil.js +6 -17
  117. package/package.json +1 -1
  118. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  119. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  120. /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts} +0 -0
@@ -1,74 +1,83 @@
1
- import { defineComponent as ne, defineAsyncComponent as u, ref as P, computed as p, watch as x, onMounted as re, onUnmounted as se } from "vue";
2
- import { useCortexBlueprintBridge as ie } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ae } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as me } from "../composables/usePartner.js";
7
- import { useStripo as le } from "../composables/useStripo.js";
8
- import { useTimerClone as ue } 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 pe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as z } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import fe from "./organisms/AutoSaveController.vue.js";
14
- import ye from "./organisms/base/Toaster.vue.js";
15
- import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import ve from "./organisms/header/HeaderWrapper.vue.js";
17
- import Se from "./organisms/LoadingWrapper.vue.js";
1
+ import { defineComponent as re, defineAsyncComponent as m, ref as _, computed as u, watch as x, onMounted as se, onUnmounted as ie } from "vue";
2
+ import { useCortexBlueprintBridge as ae } 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 H } 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 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
18
  import he from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import be from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as Ee } from "../services/stripoApi.js";
21
- import { useConfigStore as we } from "../stores/config.js";
22
- import { useDynamicContentStore as Ce } from "../stores/dynamic-content.js";
23
- import { useEditorStore as E } from "../stores/editor.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 ke } from "../stores/dynamic-content.js";
23
+ import { useEditorStore as G } from "../stores/editor.js";
24
24
  import { usePreviewStore as De } from "../stores/preview.js";
25
- import { useTemplateStore as ke } from "../stores/template.js";
26
- import { useUnsubscribeStore as Fe } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
28
- const et = /* @__PURE__ */ ne({
25
+ import { useTemplateStore as Te } from "../stores/template.js";
26
+ import { useUnsubscribeStore as Me } from "../stores/unsubscribe.js";
27
+ import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
28
+ const tt = /* @__PURE__ */ re({
29
29
  __name: "Guido",
30
30
  props: {
31
31
  config: null,
32
32
  ready: { type: Boolean, default: !0 }
33
33
  },
34
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup($, { expose: q, emit: r }) {
36
- const i = $, K = u(
35
+ setup(z, { expose: V, emit: r }) {
36
+ const a = z, q = m(
37
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), V = u(
38
+ ), K = m(
39
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), j = u(
40
+ ), j = m(
41
41
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
- ), J = u(
42
+ ), J = m(
43
43
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), w = P(), f = P(), y = Ce(), C = Fe(), o = we();
45
- i.ready && o.init(i.config);
46
- const c = E(), Q = De(), m = p(() => c.hasChanges), { isTestPartner: X } = me(), D = () => {
44
+ ), E = _(), Q = m(
45
+ () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
46
+ ), p = _(), f = ke(), w = Me(), o = Ce();
47
+ a.ready && o.init(a.config);
48
+ const s = G(), X = De(), l = u(() => s.hasChanges), { isTestPartner: Y } = le(), C = () => {
47
49
  var t;
48
- return (t = w.value) == null ? void 0 : t.handleSave(!0);
50
+ if (!s.isNormalMode) {
51
+ console.debug("guido:save:silent:blocked", {
52
+ isVersionHistoryOpen: s.isVersionHistoryOpen,
53
+ isAccessibilityTestingOpen: s.isAccessibilityTestingOpen
54
+ });
55
+ return;
56
+ }
57
+ return (t = E.value) == null ? void 0 : t.saveSilent();
49
58
  }, k = (t) => {
50
- c.loadingStatus = t;
59
+ s.loadingStatus = t;
51
60
  };
52
- ie(), de();
53
- const g = () => {
61
+ ae(), me();
62
+ const y = () => {
54
63
  var t, e;
55
64
  return {
56
65
  emailId: o.templateId,
57
66
  userId: o.userId,
58
67
  username: o.username,
59
68
  partnerName: o.partnerName,
60
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
61
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
69
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
70
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
62
71
  };
63
- }, { initPlugin: F, preloadRuntime: T } = le(), { runExclusive: I, beginMount: M, isCurrentMount: v } = ae();
64
- let l = 0;
65
- const { getDefaultTemplate: R } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = p(() => {
72
+ }, { initPlugin: D, preloadRuntime: T } = ue(), { runExclusive: M, beginMount: F, isCurrentMount: R } = ce();
73
+ let g = 0;
74
+ const { getDefaultTemplate: I } = we(), { cloneTimersOnSave: L, hasTimerBlocks: O } = pe(), Z = u(() => {
66
75
  var t;
67
76
  return !((t = o.ui) != null && t.showHeader);
68
- }), Z = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = p(
69
- () => !!z().recommendationConfigs.strategyId
77
+ }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
78
+ () => !!h().recommendationConfigs.strategyId
70
79
  );
71
- ce({
80
+ de({
72
81
  onBack: () => {
73
82
  console.debug("guido:back"), r("back");
74
83
  },
@@ -76,7 +85,7 @@ const et = /* @__PURE__ */ ne({
76
85
  console.debug("guido:save:start"), r("save:start");
77
86
  },
78
87
  onSaveComplete: (t) => {
79
- const e = { ...t, metadata: g() };
88
+ const e = { ...t, metadata: y() };
80
89
  console.debug("guido:save:complete", e), r("save:complete", e);
81
90
  },
82
91
  onTestEmailClick: () => {
@@ -84,85 +93,79 @@ const et = /* @__PURE__ */ ne({
84
93
  }
85
94
  });
86
95
  const A = (t) => {
87
- console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
88
- }, U = () => {
96
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
97
+ }, B = () => {
89
98
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
90
99
  };
91
- x(() => m.value, () => {
92
- r("on-change", m.value);
100
+ x(() => l.value, () => {
101
+ r("on-change", l.value);
93
102
  });
94
- const S = (t) => {
95
- const e = t, { attribute: s, position: d } = e.detail;
96
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
103
+ const v = (t) => {
104
+ const e = t, { attribute: i, position: d } = e.detail;
105
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", i, d);
97
106
  };
98
- let a = null;
99
- const h = () => {
107
+ let c = null;
108
+ const S = () => {
100
109
  var e;
101
- const t = document.querySelector(pe);
102
- (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
110
+ const t = document.querySelector(fe);
111
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
103
112
  }, b = async () => {
104
113
  var t;
105
114
  try {
106
- o.initialized || o.init(i.config), c.templateId = o.templateId;
107
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", _ = (e == null ? void 0 : e.preselectedDynamicContent) || [];
108
- C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
109
- const N = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds");
115
+ o.initialized || o.init(a.config), s.templateId = o.templateId;
116
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", U = (e == null ? void 0 : e.preselectedDynamicContent) || [];
117
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
118
+ const N = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds");
110
119
  let n = {
111
- html: s && await W(s, N),
120
+ html: i && await H(i, N),
112
121
  css: d
113
122
  };
114
- n.html || (n = await R(), n.html = await W(n.html, N));
115
- const te = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
116
- B(n.html) && (n.html = await L(n.html)), O && (c.trackIdSessionFloor = Math.max(te, H(n.html)));
117
- const oe = {
118
- preselectedDynamicContentList: _,
123
+ n.html || (n = await I(), n.html = await H(n.html, N));
124
+ const oe = P ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
125
+ O(n.html) && (n.html = await L(n.html)), P && (s.trackIdSessionFloor = Math.max(oe, $(n.html)));
126
+ const ne = {
127
+ preselectedDynamicContentList: U,
119
128
  onReady: () => {
120
129
  console.debug("guido:ready"), r("ready");
121
130
  }
122
131
  };
123
- l = M(), await F(n, g(), oe), y.selectedDynamicContentList = _;
132
+ g = F(), await D(n, y(), ne), f.selectedDynamicContentList = U;
124
133
  } catch (e) {
125
134
  console.error("Failed to initialize Stripo editor:", e);
126
135
  }
127
136
  };
128
- return re(async () => {
137
+ return se(async () => {
129
138
  var e;
130
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), ke().$reset(), h();
131
- const t = (e = f.value) == null ? void 0 : e.parentElement;
132
- if (t && (a = new ResizeObserver(h), a.observe(t)), T(), i.ready)
139
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), G().$reset(), Te().$reset(), S();
140
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
141
+ if (t && (c = new ResizeObserver(S), c.observe(t)), T(), a.ready)
133
142
  await b();
134
143
  else {
135
- const s = x(() => i.ready, (d) => {
136
- d && (s(), b());
144
+ const i = x(() => a.ready, (d) => {
145
+ d && (i(), b());
137
146
  });
138
147
  }
139
- document.addEventListener("dynamic-content:open", S);
140
- }), se(() => {
141
- if (a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", S), v(l))
142
- try {
143
- E().isStripoInitialized = !1;
144
- } catch (t) {
145
- console.debug("Failed to close the editor readiness gate on unmount", t);
146
- }
147
- I(async () => {
148
- if (v(l))
148
+ document.addEventListener("dynamic-content:open", v);
149
+ }), ie(() => {
150
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), M(async () => {
151
+ if (R(g))
149
152
  try {
150
153
  window.UIEditor.removeEditor();
151
154
  } catch {
152
155
  console.debug("Failed to remove Stripo editor: No editor found");
153
156
  }
154
157
  }), o.reset();
155
- }), q({
158
+ }), V({
156
159
  dynamicContent: {
157
160
  insert: A,
158
- close: U
161
+ close: B
159
162
  },
160
- hasChanges: m,
161
- saveSilent: D,
163
+ hasChanges: l,
164
+ saveSilent: C,
162
165
  setLoading: k
163
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: i, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: D, setLoading: k, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: T, runExclusive: I, beginMount: M, isCurrentMount: v, mountGeneration: l, getDefaultTemplate: R, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: A, closeDynamicContent: U, handleDynamicContentOpen: S, ribbonObserver: a, updateRibbonOffset: h, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: he, UnsubscribeWrapper: be };
166
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, AssignStrategyDrawer: j, RemoveStrategyModal: J, autoSaveControllerRef: E, LegacyStrategyUpdatedModal: Q, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: s, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: C, setLoading: k, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: T, runExclusive: M, beginMount: F, isCurrentMount: R, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: O, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: v, ribbonObserver: c, updateRibbonOffset: S, startEditor: b, AutoSaveController: ye, Toaster: ge, FilterSelectionDrawer: ve, HeaderWrapper: Se, LoadingWrapper: be, SaveAsTemplateDrawer: he, UnsubscribeWrapper: Ee };
164
167
  }
165
168
  });
166
169
  export {
167
- et as default
170
+ tt as default
168
171
  };
@@ -1,13 +1,23 @@
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 n } from "vue";
2
+ import { useAutoSave as u } from "../../composables/useAutoSave.js";
3
+ import { useSave as m } from "../../composables/useSave.js";
4
+ import { useToaster as c } from "../../composables/useToaster.js";
5
+ const _ = /* @__PURE__ */ n({
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(i, { expose: a }) {
8
+ const { save: e } = m(), { handleError: r } = c(), t = () => e(!1, !0);
9
+ u(t);
10
+ const o = async () => {
11
+ try {
12
+ return await e(!0);
13
+ } catch (s) {
14
+ r(s, "Failed to save template");
15
+ return;
16
+ }
17
+ };
18
+ return a({ saveSilent: o }), { __sfc: !0, save: e, handleError: r, backgroundSave: t, saveSilent: o };
9
19
  }
10
20
  });
11
21
  export {
12
- f as default
22
+ _ as default
13
23
  };
@@ -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
- import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
- var o = 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, "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, 2542767044) }) : e._e();
10
- }, n = [], i = /* @__PURE__ */ a(
11
- r,
12
- o,
4
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
+ var a = function() {
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();
12
+ }, n = [], i = /* @__PURE__ */ o(
13
+ s,
14
+ a,
13
15
  n,
14
16
  !1,
15
17
  null,
16
- "2580a7d9"
18
+ "6ce48dfd"
17
19
  );
18
20
  const y = i.exports;
19
21
  export {
@@ -1,48 +1,51 @@
1
- import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } 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 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
- import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
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({
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(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),
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
- }), 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) => {
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
- n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
33
- s({
34
- type: m.Error,
35
- message: o("discovery-strategy.error-description")
31
+ s.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
+ c({
33
+ type: u.Error,
34
+ message: a("discovery-strategy.error-description")
36
35
  });
37
36
  });
38
37
  });
39
- const p = (t) => {
40
- const r = f(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 a = I(r, E);
44
- return o("recommendation-strategy.last-updated-on", { value: a });
45
- }, D = l(() => e.strategies.map((t) => ({
42
+ const o = M(r, N);
43
+ return a("recommendation-strategy.last-updated-on", { value: o });
44
+ }, S = n(() => ({
45
+ text: a("ds-steps.legacy-strategy"),
46
+ value: m,
47
+ hidden: !0
48
+ })), d = n(() => e.strategies.map((t) => ({
46
49
  text: t.name,
47
50
  value: t.strategy_id,
48
51
  infoBoxProps: {
@@ -50,57 +53,75 @@ const W = /* @__PURE__ */ v({
50
53
  theme: "light",
51
54
  variant: "information",
52
55
  className: "assign-strategy-info-box",
53
- titleText: N(f(t.name)),
56
+ titleText: G(O(t.name)),
54
57
  descriptionStatus: !0,
55
- descriptionText: p(t),
56
- slot: B,
57
- 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
+ }]
58
71
  }
59
- }))), d = l(() => {
60
- const t = e.strategies.find((r) => String(r.strategy_id) === String(n.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 ?? ""));
61
81
  return t ? { ...t, fallback_config: null } : null;
62
- }), w = l(() => ({
82
+ }), C = n(() => ({
63
83
  primaryButton: {
64
84
  styling: "solid",
65
85
  type: "primary",
66
- labelText: o("products.assign-btn")
86
+ labelText: a("products.assign-btn")
67
87
  },
68
88
  cancelOrBackButton: {
69
89
  styling: "ghost",
70
90
  type: "secondary",
71
- labelText: o("products.cancel")
91
+ labelText: a("products.cancel")
72
92
  }
73
93
  }));
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: () => {
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: () => {
75
95
  e.closeAssignStrategyDrawer();
76
96
  }, assignStrategy: async () => {
77
- const t = d.value;
97
+ const t = v.value;
78
98
  if (!t) {
79
- i.value = !0;
99
+ l.value = !0;
80
100
  return;
81
101
  }
82
102
  let r = "";
83
103
  try {
84
104
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
85
- } catch (a) {
86
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
105
+ } catch (y) {
106
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
87
107
  }
88
108
  if (!r) {
89
- s({
90
- type: m.Error,
91
- message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
109
+ c({
110
+ type: u.Error,
111
+ message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
92
112
  });
93
113
  return;
94
114
  }
95
- e.assignStrategy(t), s({
96
- type: m.Success,
97
- message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
98
- }), e.closeAssignStrategyDrawer();
115
+ const o = e.currentRecommendationId;
116
+ e.assignStrategy(t), c({
117
+ type: u.Success,
118
+ message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
119
+ }), e.closeAssignStrategyDrawer(), o !== null && await D(o, "Assigned recommendation strategy");
99
120
  }, onSelect: (t) => {
100
- n.value = t.value, i.value = !1;
121
+ s.value = t.value, l.value = !1;
101
122
  } };
102
123
  }
103
124
  });
104
125
  export {
105
- W as default
126
+ st as default
106
127
  };
@@ -0,0 +1,18 @@
1
+ import s from "./LegacyStrategyUpdatedModal.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, a = t._self._c, e = t._self._setupProxy;
6
+ return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
7
+ }, l = [], n = /* @__PURE__ */ o(
8
+ s,
9
+ r,
10
+ l,
11
+ !1,
12
+ null,
13
+ "da2225a1"
14
+ );
15
+ const m = n.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as i, computed as s } from "vue";
2
+ import p from "../../../wrappers/WpModal.vue.js";
3
+ import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ const M = /* @__PURE__ */ i({
6
+ __name: "LegacyStrategyUpdatedModal",
7
+ setup(l) {
8
+ const e = d(), t = g(), n = s(() => ({
9
+ primaryButton: {
10
+ type: "primary",
11
+ labelText: e("action-builder.ok")
12
+ }
13
+ })), m = s(() => {
14
+ var r;
15
+ const { strategyId: a } = t.recommendationConfigs;
16
+ return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
17
+ }), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
18
+ return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
19
+ t.closeLegacyStrategyUpdatedModal();
20
+ }, WpModal: p };
21
+ }
22
+ });
23
+ export {
24
+ M as default
25
+ };