@useinsider/guido 3.16.0 → 3.17.0-beta.1631b31

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 (58) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +12 -6
  3. package/dist/components/Guido.vue.js +9 -9
  4. package/dist/components/Guido.vue2.js +77 -73
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +69 -0
  7. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +13 -0
  9. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  10. package/dist/composables/useRecommendation.js +43 -35
  11. package/dist/composables/useStripo.js +30 -29
  12. package/dist/config/migrator/itemsBlockMigrator.js +1 -1
  13. package/dist/config/migrator/recommendation/settingsMapper.js +19 -17
  14. package/dist/config/migrator/recommendationMigrator.js +6 -4
  15. package/dist/enums/academy.js +2 -1
  16. package/dist/enums/date.js +4 -3
  17. package/dist/enums/extensions/recommendationBlock.js +4 -1
  18. package/dist/enums/recommendation.js +17 -17
  19. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
  20. package/dist/extensions/Blocks/Recommendation/block.js +26 -21
  21. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -34
  22. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
  23. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
  24. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +163 -159
  25. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +142 -0
  26. package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
  27. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +222 -78
  28. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
  29. package/dist/extensions/Blocks/common-control.js +22 -19
  30. package/dist/guido.css +1 -1
  31. package/dist/services/recommendationApi.js +75 -30
  32. package/dist/src/@types/config/schemas.d.ts +12 -0
  33. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  34. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +17 -0
  35. package/dist/src/composables/useConfig.d.ts +2 -0
  36. package/dist/src/composables/useRecommendation.d.ts +1 -0
  37. package/dist/src/enums/academy.d.ts +1 -0
  38. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  39. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +7 -6
  40. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  41. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +16 -3
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +30 -0
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +206 -10
  44. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  45. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
  46. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  47. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  48. package/dist/src/services/recommendationApi.d.ts +4 -1
  49. package/dist/src/stores/config.d.ts +18 -0
  50. package/dist/src/utils/strategyInfoBox.d.ts +35 -0
  51. package/dist/static/assets/icons/line-change.svg.js +5 -0
  52. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  53. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  54. package/dist/static/styles/components/recommendation-strategy.css.js +188 -0
  55. package/dist/utils/dateUtil.js +29 -10
  56. package/dist/utils/strategyInfoBox.js +68 -0
  57. package/dist/utils/templatePreparation.js +37 -34
  58. package/package.json +2 -1
package/README.md CHANGED
@@ -162,6 +162,7 @@ const config: GuidoConfigInput = {
162
162
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
163
163
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
164
164
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
165
+ reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
165
166
  },
166
167
 
167
168
  // Optional: Callbacks
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as k, boolean as o, array as c, transform as C, record as y, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -76,7 +76,7 @@ const p = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), N = y(
79
+ })), N = k(
80
80
  t(),
81
81
  R(c(S), [])
82
82
  ), P = g({
@@ -132,7 +132,7 @@ const p = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- y(t(), P),
135
+ k(t(), P),
136
136
  {}
137
137
  )
138
138
  }), x = a({
@@ -219,7 +219,13 @@ const p = {
219
219
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
220
220
  allowlistEnabled: e(o(), !1),
221
221
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
- linkTrackingIds: e(o(), !1)
222
+ linkTrackingIds: e(o(), !1),
223
+ /**
224
+ * Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
225
+ * per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
226
+ * (they live on the strategy) and adds the Assign Strategy flow.
227
+ */
228
+ reusableRecommendationStrategy: e(o(), !1)
223
229
  }), B = i([
224
230
  "amp-accordion",
225
231
  "amp-carousel",
@@ -287,7 +293,7 @@ const p = {
287
293
  ...d.entries,
288
294
  type: u("custom"),
289
295
  /** Custom processor function */
290
- processor: k(
296
+ processor: y(
291
297
  (s) => typeof s == "function",
292
298
  "processor must be a function"
293
299
  )
@@ -307,7 +313,7 @@ const p = {
307
313
  * Return false to cancel the save operation.
308
314
  */
309
315
  externalValidation: e(
310
- k(
316
+ y(
311
317
  (s) => typeof s == "function",
312
318
  "externalValidation must be a function"
313
319
  )
@@ -1,20 +1,20 @@
1
- import i from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
- var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
5
+ var a = this, r = a._self._c, e = a._self._setupProxy;
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ a(
10
- i,
9
+ }, s = [], n = /* @__PURE__ */ i(
10
+ o,
11
11
  t,
12
- n,
12
+ s,
13
13
  !1,
14
14
  null,
15
- "b0d3b445"
15
+ "79df0a6e"
16
16
  );
17
- const l = s.exports;
17
+ const l = n.exports;
18
18
  export {
19
19
  l as default
20
20
  };
@@ -1,65 +1,69 @@
1
- import { defineComponent as j, defineAsyncComponent as R, ref as B, computed as U, watch as _, onMounted as J, onUnmounted as Q } from "vue";
2
- import { useCortexBlueprintBridge as X } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as ee } from "../composables/usePartner.js";
6
- import { useStripo as te } from "../composables/useStripo.js";
7
- import { useTimerClone as oe } from "../composables/useTimerClone.js";
8
- import { migrate as N } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as O } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import se from "./organisms/AutoSaveController.vue.js";
13
- import ae from "./organisms/base/Toaster.vue.js";
14
- import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import ce from "./organisms/header/HeaderWrapper.vue.js";
16
- import de from "./organisms/LoadingWrapper.vue.js";
17
- import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as ue } from "../services/stripoApi.js";
20
- import { useConfigStore as pe } from "../stores/config.js";
21
- import { useDynamicContentStore as fe } from "../stores/dynamic-content.js";
1
+ import { defineComponent as Y, defineAsyncComponent as S, ref as A, computed as l, watch as U, onMounted as Z, onUnmounted as ee } from "vue";
2
+ import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as re } from "../composables/usePartner.js";
6
+ import { useStripo as se } from "../composables/useStripo.js";
7
+ import { useTimerClone as ae } from "../composables/useTimerClone.js";
8
+ import { migrate as _ } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as ie } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import ce from "./organisms/AutoSaveController.vue.js";
13
+ import de from "./organisms/base/Toaster.vue.js";
14
+ import me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import le from "./organisms/header/HeaderWrapper.vue.js";
16
+ import ue from "./organisms/LoadingWrapper.vue.js";
17
+ import pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import fe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ye } from "../services/stripoApi.js";
20
+ import { useConfigStore as ge } from "../stores/config.js";
21
+ import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
22
22
  import { useEditorStore as P } from "../stores/editor.js";
23
- import { usePreviewStore as ye } from "../stores/preview.js";
24
- import { useTemplateStore as ve } from "../stores/template.js";
25
- import { useUnsubscribeStore as he } from "../stores/unsubscribe.js";
26
- import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
27
- const ze = /* @__PURE__ */ j({
23
+ import { usePreviewStore as Se } from "../stores/preview.js";
24
+ import { useTemplateStore as he } from "../stores/template.js";
25
+ import { useUnsubscribeStore as be } from "../stores/unsubscribe.js";
26
+ import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
27
+ const Ve = /* @__PURE__ */ Y({
28
28
  __name: "Guido",
29
29
  props: {
30
30
  config: null,
31
31
  ready: { type: Boolean, default: !0 }
32
32
  },
33
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
34
- setup(W, { expose: x, emit: r }) {
35
- const a = W, G = R(
34
+ setup(x, { expose: G, emit: r }) {
35
+ const a = x, H = S(
36
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), H = R(
37
+ ), $ = S(
38
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), h = B(), l = B(), u = fe(), S = he(), o = pe();
39
+ ), z = S(
40
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
+ ), h = A(), u = A(), p = ve(), b = be(), o = ge();
40
42
  a.ready && o.init(a.config);
41
- const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
43
+ const c = P(), q = Se(), m = l(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
42
44
  var t;
43
45
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
44
- }, b = (t) => {
46
+ }, w = (t) => {
45
47
  c.loadingStatus = t;
46
48
  };
47
- X(), Z();
48
- const p = () => {
49
+ te(), ne();
50
+ const f = () => {
49
51
  var t, e;
50
52
  return {
51
53
  emailId: o.templateId,
52
54
  userId: o.userId,
53
55
  username: o.username,
54
56
  partnerName: o.partnerName,
55
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || O.SAVED_MODULES,
56
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
57
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
58
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
57
59
  };
58
- }, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: k } = oe(), q = U(() => {
60
+ }, { initPlugin: C, preloadRuntime: D } = se(), { getDefaultTemplate: k } = ye(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ae(), V = l(() => {
59
61
  var t;
60
62
  return !((t = o.ui) != null && t.showHeader);
61
- });
62
- Y({
63
+ }), j = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), J = l(
64
+ () => !!O().recommendationConfigs.strategyId
65
+ );
66
+ oe({
63
67
  onBack: () => {
64
68
  console.debug("guido:back"), r("back");
65
69
  },
@@ -67,86 +71,86 @@ const ze = /* @__PURE__ */ j({
67
71
  console.debug("guido:save:start"), r("save:start");
68
72
  },
69
73
  onSaveComplete: (t) => {
70
- const e = { ...t, metadata: p() };
74
+ const e = { ...t, metadata: f() };
71
75
  console.debug("guido:save:complete", e), r("save:complete", e);
72
76
  },
73
77
  onTestEmailClick: () => {
74
78
  console.debug("guido:test-email:click"), r("test-email:click");
75
79
  }
76
80
  });
77
- const T = (t) => {
78
- console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
79
- }, F = () => {
81
+ const I = (t) => {
82
+ console.debug("dynamic-content:close", t), p.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
83
+ }, R = () => {
80
84
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
85
  };
82
- _(() => m.value, () => {
86
+ U(() => m.value, () => {
83
87
  r("on-change", m.value);
84
88
  });
85
- const f = (t) => {
89
+ const y = (t) => {
86
90
  const e = t, { attribute: s, position: d } = e.detail;
87
91
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
88
92
  };
89
93
  let i = null;
90
- const y = () => {
94
+ const g = () => {
91
95
  var e;
92
- const t = document.querySelector(ne);
93
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
96
+ const t = document.querySelector(ie);
97
+ (e = u.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
94
98
  }, v = async () => {
95
99
  var t;
96
100
  try {
97
101
  o.initialized || o.init(a.config), c.templateId = o.templateId;
98
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
99
- S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
100
- const L = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
102
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
103
+ b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
104
+ const B = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
101
105
  let n = {
102
- html: s && await N(s, L),
106
+ html: s && await _(s, B),
103
107
  css: d
104
108
  };
105
- n.html || (n = await C(), n.html = await N(n.html, L));
106
- const K = M ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
107
- k(n.html) && (n.html = await D(n.html)), M && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
108
- const V = {
109
- preselectedDynamicContentList: I,
109
+ n.html || (n = await k(), n.html = await _(n.html, B));
110
+ const Q = M ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
111
+ F(n.html) && (n.html = await T(n.html)), M && (c.trackIdSessionFloor = Math.max(Q, W(n.html)));
112
+ const X = {
113
+ preselectedDynamicContentList: L,
110
114
  onReady: () => {
111
115
  console.debug("guido:ready"), r("ready");
112
116
  }
113
117
  };
114
- await E(n, p(), V), u.selectedDynamicContentList = I;
118
+ await C(n, f(), X), p.selectedDynamicContentList = L;
115
119
  } catch (e) {
116
120
  console.error("Failed to initialize Stripo editor:", e);
117
121
  }
118
122
  };
119
- return J(async () => {
123
+ return Z(async () => {
120
124
  var e;
121
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
122
- const t = (e = l.value) == null ? void 0 : e.parentElement;
123
- if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
125
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), he().$reset(), g();
126
+ const t = (e = u.value) == null ? void 0 : e.parentElement;
127
+ if (t && (i = new ResizeObserver(g), i.observe(t)), D(), a.ready)
124
128
  await v();
125
129
  else {
126
- const s = _(() => a.ready, (d) => {
130
+ const s = U(() => a.ready, (d) => {
127
131
  d && (s(), v());
128
132
  });
129
133
  }
130
- document.addEventListener("dynamic-content:open", f);
131
- }), Q(() => {
132
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
134
+ document.addEventListener("dynamic-content:open", y);
135
+ }), ee(() => {
136
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", y);
133
137
  try {
134
138
  window.UIEditor.removeEditor();
135
139
  } catch {
136
140
  console.debug("Failed to remove Stripo editor: No editor found");
137
141
  }
138
142
  o.reset();
139
- }), x({
143
+ }), G({
140
144
  dynamicContent: {
141
- insert: T,
142
- close: F
145
+ insert: I,
146
+ close: R
143
147
  },
144
148
  hasChanges: m,
145
- saveSilent: g,
146
- setLoading: b
147
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: a, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: z, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: se, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: ce, LoadingWrapper: de, SaveAsTemplateDrawer: me, UnsubscribeWrapper: le };
149
+ saveSilent: E,
150
+ setLoading: w
151
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, headerWrapperRef: h, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: q, hasChanges: m, isTestPartner: K, saveSilent: E, setLoading: w, emit: r, buildMetadata: f, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: V, isRrsEnabled: j, hasAssignedStrategy: J, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: y, ribbonObserver: i, updateRibbonOffset: g, startEditor: v, AutoSaveController: ce, Toaster: de, FilterSelectionDrawer: me, HeaderWrapper: le, LoadingWrapper: ue, SaveAsTemplateDrawer: pe, UnsubscribeWrapper: fe };
148
152
  }
149
153
  });
150
154
  export {
151
- ze as default
155
+ Ve as default
152
156
  };
@@ -0,0 +1,21 @@
1
+ import r from "./AssignStrategyDrawer.vue2.js";
2
+ /* empty css */
3
+ /* empty css */
4
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
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, "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, 5799417) }) : e._e();
10
+ }, n = [], i = /* @__PURE__ */ o(
11
+ r,
12
+ a,
13
+ n,
14
+ !1,
15
+ null,
16
+ "110d75e5"
17
+ );
18
+ const y = i.exports;
19
+ export {
20
+ y as default
21
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as f, defineAsyncComponent as g, ref as l, computed as a, watch as w } from "vue";
2
+ import "@useinsider/design-system-organisms/style";
3
+ import { useToaster as _ } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as D } from "../../../../composables/useTranslations.js";
5
+ import { URLS as v } from "../../../../enums/extensions/recommendationBlock.js";
6
+ import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
7
+ import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import O from "./StrategyInfoBoxContent.vue.js";
9
+ import { buildStrategyInfoBoxProps as x } from "../../../../utils/strategyInfoBox.js";
10
+ const L = /* @__PURE__ */ f({
11
+ __name: "AssignStrategyDrawer",
12
+ setup(A) {
13
+ const m = g(
14
+ async () => (await import("@useinsider/design-system-organisms")).OrgStrategyDetailModal
15
+ ), y = g(
16
+ async () => (await import("@useinsider/design-system-organisms")).OrgStrategyDropdown
17
+ ), r = D(), e = T(), { showToaster: n } = _(), s = l(null), o = l(!1), u = a(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: v.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
18
+ w(() => e.assignStrategyDrawerStatus, (t) => {
19
+ if (!t)
20
+ return;
21
+ const { strategyId: i } = e.recommendationConfigs;
22
+ s.value = i || null, o.value = !1, e.fetchStrategies().catch(() => {
23
+ n({
24
+ type: p.Error,
25
+ message: r("discovery-strategy.error-description")
26
+ });
27
+ });
28
+ });
29
+ const d = a(() => e.strategies.map((t) => ({
30
+ text: t.name,
31
+ value: t.strategy_id,
32
+ // `slot` lives here, not in the util: the design system renders it with
33
+ // `<component :is>` inside its own info box, and a util must not import one.
34
+ infoBoxProps: { ...x(t, r), slot: O }
35
+ }))), c = a(() => {
36
+ const t = e.strategies.find((i) => String(i.strategy_id) === String(s.value ?? ""));
37
+ return t ? { ...t, fallback_config: null } : null;
38
+ }), S = a(() => ({
39
+ primaryButton: {
40
+ styling: "solid",
41
+ type: "primary",
42
+ labelText: r("products.assign-btn")
43
+ },
44
+ cancelOrBackButton: {
45
+ styling: "ghost",
46
+ type: "secondary",
47
+ labelText: r("products.cancel")
48
+ }
49
+ }));
50
+ return { __sfc: !0, OrgStrategyDetailModal: m, OrgStrategyDropdown: y, trans: r, store: e, showToaster: n, selectedStrategyId: s, showSelectionError: o, drawerDescription: u, strategyOptions: d, selectedStrategy: c, footerButtonGroupOptions: S, closeDrawer: () => {
51
+ e.closeAssignStrategyDrawer();
52
+ }, assignStrategy: () => {
53
+ const t = c.value;
54
+ if (!t) {
55
+ o.value = !0;
56
+ return;
57
+ }
58
+ e.assignStrategy(t), n({
59
+ type: p.Success,
60
+ message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
61
+ }), e.closeAssignStrategyDrawer();
62
+ }, onSelect: (t) => {
63
+ s.value = t.value, o.value = !1;
64
+ } };
65
+ }
66
+ });
67
+ export {
68
+ L as default
69
+ };
@@ -0,0 +1,19 @@
1
+ import a from "./StrategyInfoBoxContent.vue2.js";
2
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var t = this, s = t._self._c;
5
+ return t._self._setupProxy, s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(t.details, function(n, e) {
6
+ return s("div", { key: n.title, staticClass: "d-f f-d-c", class: { "mt-2": e > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(n.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(n.value))])]);
7
+ }), 0);
8
+ }, c = [], f = /* @__PURE__ */ r(
9
+ a,
10
+ _,
11
+ c,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const m = f.exports;
17
+ export {
18
+ m as default
19
+ };
@@ -0,0 +1,13 @@
1
+ import { defineComponent as t } from "vue";
2
+ const o = /* @__PURE__ */ t({
3
+ __name: "StrategyInfoBoxContent",
4
+ props: {
5
+ details: null
6
+ },
7
+ setup(e) {
8
+ return { __sfc: !0 };
9
+ }
10
+ });
11
+ export {
12
+ o as default
13
+ };
@@ -1,53 +1,67 @@
1
- import S from "../static/styles/base.css.js";
2
- import m from "../static/styles/components/alert-message.css.js";
3
- import e from "../static/styles/components/amp-block.css.js";
4
- import i from "../static/styles/components/base-input.css.js";
5
- import p from "../static/styles/components/button-group.css.js";
6
- import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
9
- import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/loader.css.js";
11
- import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/popup.css.js";
13
- import d from "../static/styles/components/switcher.css.js";
14
- import l from "../static/styles/components/tabs.css.js";
15
- import h from "../static/styles/components/tools.css.js";
16
- import w from "../static/styles/components/version-history.css.js";
17
- import y from "../static/styles/components/wide-panel.css.js";
18
- import B from "../static/styles/variables.css.js";
19
- const b = [
20
- B,
21
- // Must be on top
22
- S,
1
+ import S from "../static/assets/icons/line-change.svg.js";
2
+ import i from "../static/assets/icons/line-delete.svg.js";
3
+ import n from "../static/assets/icons/line-plus.svg.js";
4
+ import p from "../static/styles/base.css.js";
5
+ import s from "../static/styles/components/alert-message.css.js";
6
+ import C from "../static/styles/components/amp-block.css.js";
7
+ import a from "../static/styles/components/base-input.css.js";
8
+ import f from "../static/styles/components/button-group.css.js";
9
+ import c from "../static/styles/components/button.css.js";
10
+ import u from "../static/styles/components/combobox.css.js";
11
+ import l from "../static/styles/components/counter.css.js";
12
+ import d from "../static/styles/components/dropdown-menu.css.js";
13
+ import h from "../static/styles/components/loader.css.js";
14
+ import g from "../static/styles/components/narrow-panel.css.js";
15
+ import I from "../static/styles/components/popup.css.js";
16
+ import w from "../static/styles/components/recommendation-strategy.css.js";
17
+ import y from "../static/styles/components/switcher.css.js";
18
+ import b from "../static/styles/components/tabs.css.js";
19
+ import B from "../static/styles/components/tools.css.js";
20
+ import $ from "../static/styles/components/version-history.css.js";
21
+ import P from "../static/styles/components/wide-panel.css.js";
22
+ import x from "../static/styles/variables.css.js";
23
+ function r(t, o) {
24
+ return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
25
+ }
26
+ const A = `:host {
27
+ ${r("line-change", S)}
28
+ ${r("line-delete", i)}
29
+ ${r("line-plus", n)}
30
+ }`, R = [
31
+ x,
23
32
  // Must be on top
24
- m,
25
- e,
26
- i,
33
+ A,
27
34
  p,
28
- n,
35
+ // Must be on top
29
36
  s,
30
37
  C,
31
- f,
32
38
  a,
33
- u,
39
+ f,
34
40
  c,
35
- d,
41
+ u,
36
42
  l,
43
+ d,
37
44
  h,
38
- w,
39
- y
45
+ g,
46
+ I,
47
+ y,
48
+ b,
49
+ B,
50
+ $,
51
+ P,
52
+ w
53
+ // Last: overrides button.css / wide-panel.css defaults
40
54
  ].join(`
41
55
 
42
- `), v = () => ({ importCss: () => {
56
+ `), Y = () => ({ importCss: () => {
43
57
  const o = new CSSStyleSheet();
44
- o.replaceSync(b);
45
- const r = document.querySelector("ui-editor");
46
- if (!r)
58
+ o.replaceSync(R);
59
+ const e = document.querySelector("ui-editor");
60
+ if (!e)
47
61
  return;
48
- const t = r.shadowRoot;
49
- t && (t.adoptedStyleSheets = [o]);
62
+ const m = e.shadowRoot;
63
+ m && (m.adoptedStyleSheets = [o]);
50
64
  } });
51
65
  export {
52
- v as useCustomInterfaceAppearance
66
+ Y as useCustomInterfaceAppearance
53
67
  };