@useinsider/guido 3.17.0-beta.dc7f4d2 → 3.17.0-beta.e23d5cd

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 (88) hide show
  1. package/README.md +6 -5
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +96 -94
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  10. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  11. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  12. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  13. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
  14. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  15. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  16. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  17. package/dist/composables/useHtmlCompiler.js +26 -37
  18. package/dist/composables/useHtmlValidator.js +0 -2
  19. package/dist/composables/useRecommendation.js +41 -34
  20. package/dist/composables/useSave.js +41 -84
  21. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  22. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  23. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  24. package/dist/config/migrator/recommendationMigrator.js +5 -4
  25. package/dist/enums/academy.js +2 -1
  26. package/dist/enums/date.js +5 -3
  27. package/dist/enums/extensions/recommendationBlock.js +3 -1
  28. package/dist/extensions/Blocks/Recommendation/block.js +26 -21
  29. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
  31. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +238 -185
  32. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  33. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -86
  35. package/dist/extensions/Blocks/common-control.js +22 -19
  36. package/dist/guido.css +1 -1
  37. package/dist/services/recommendationApi.js +69 -30
  38. package/dist/src/@types/config/schemas.d.ts +2 -0
  39. package/dist/src/components/Guido.vue.d.ts +1 -17
  40. package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → extensions/recommendation/AssignStrategyDrawer.vue.d.ts} +1 -0
  41. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  42. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  43. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  44. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  45. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  46. package/dist/src/composables/useConfig.d.ts +2 -0
  47. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  48. package/dist/src/composables/useRecommendation.d.ts +1 -0
  49. package/dist/src/composables/useSave.d.ts +1 -6
  50. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  51. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  52. package/dist/src/enums/academy.d.ts +1 -0
  53. package/dist/src/enums/date.d.ts +1 -0
  54. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  55. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
  56. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  59. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  60. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -15
  61. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
  62. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  63. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  64. package/dist/src/services/recommendationApi.d.ts +4 -1
  65. package/dist/src/stores/config.d.ts +18 -5
  66. package/dist/src/stores/save-as-template.d.ts +4 -3
  67. package/dist/src/utils/genericUtil.d.ts +5 -0
  68. package/dist/src/utils/templatePreparation.d.ts +0 -30
  69. package/dist/static/assets/icons/line-change.svg.js +5 -0
  70. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  71. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  72. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  73. package/dist/stores/config.js +6 -13
  74. package/dist/utils/dateUtil.js +23 -10
  75. package/dist/utils/genericUtil.js +28 -27
  76. package/dist/utils/templatePreparation.js +48 -50
  77. package/package.json +3 -2
  78. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  79. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  80. package/dist/composables/useSaveValidation.js +0 -279
  81. package/dist/composables/useSaveValidationRollout.js +0 -9
  82. package/dist/enums/save-validation.js +0 -4
  83. package/dist/src/@types/save-validation.d.ts +0 -19
  84. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  85. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  86. package/dist/src/enums/save-validation.d.ts +0 -27
  87. package/dist/src/stores/save-validation.d.ts +0 -22
  88. package/dist/stores/save-validation.js +0 -30
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
@@ -633,16 +634,16 @@ toaster fires (useful before the host has wired the catalog).
633
634
 
634
635
  ```bash
635
636
  # Install
636
- bun install
637
+ npm install
637
638
 
638
639
  # Start dev server
639
- bun start
640
+ npm start
640
641
 
641
642
  # Build
642
- bun run build
643
+ npm run build
643
644
 
644
645
  # Lint & type-check
645
- bun run lint
646
+ npm run lint
646
647
  ```
647
648
 
648
649
  ### Environment Variables
@@ -660,7 +661,7 @@ VITE_STRIPO_USER=your_user
660
661
 
661
662
  ```bash
662
663
  # Build the package
663
- bun run build
664
+ npm run build
664
665
 
665
666
  # Create tarball
666
667
  npm pack
@@ -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,8 @@ 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
+ reusableRecommendationStrategy: e(o(), !1)
223
224
  }), B = i([
224
225
  "amp-accordion",
225
226
  "amp-carousel",
@@ -287,7 +288,7 @@ const p = {
287
288
  ...d.entries,
288
289
  type: u("custom"),
289
290
  /** Custom processor function */
290
- processor: k(
291
+ processor: y(
291
292
  (s) => typeof s == "function",
292
293
  "processor must be a function"
293
294
  )
@@ -307,7 +308,7 @@ const p = {
307
308
  * Return false to cancel the save operation.
308
309
  */
309
310
  externalValidation: e(
310
- k(
311
+ y(
311
312
  (s) => typeof s == "function",
312
313
  "externalValidation must be a function"
313
314
  )
@@ -3,18 +3,18 @@ import a from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
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.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : o._e(), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
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), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._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 = [], d = /* @__PURE__ */ i(
9
+ }, s = [], n = /* @__PURE__ */ i(
10
10
  a,
11
11
  t,
12
- n,
12
+ s,
13
13
  !1,
14
14
  null,
15
- "f02fdde0"
15
+ "e6f99d29"
16
16
  );
17
- const c = d.exports;
17
+ const l = n.exports;
18
18
  export {
19
- c as default
19
+ l as default
20
20
  };
@@ -1,154 +1,156 @@
1
- import { defineComponent as J, defineAsyncComponent as M, ref as B, computed as U, watch as _, onMounted as Q, onUnmounted as X } from "vue";
2
- import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ee } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as oe } from "../composables/usePartner.js";
6
- import { useSaveValidationRollout as te } from "../composables/useSaveValidationRollout.js";
7
- import { useStripo as ne } from "../composables/useStripo.js";
8
- import { useTimerClone as re } from "../composables/useTimerClone.js";
9
- import { migrate as N } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as O } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import ie from "./organisms/AutoSaveController.vue.js";
14
- import ce from "./organisms/base/Toaster.vue.js";
15
- import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import me from "./organisms/header/HeaderWrapper.vue.js";
17
- import le from "./organisms/LoadingWrapper.vue.js";
18
- import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
21
- import { useStripoApi as ve } from "../services/stripoApi.js";
22
- import { useConfigStore as ye } from "../stores/config.js";
23
- import { useDynamicContentStore as Se } 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";
24
22
  import { useEditorStore as P } from "../stores/editor.js";
25
- import { usePreviewStore as he } from "../stores/preview.js";
26
- import { useTemplateStore as be } from "../stores/template.js";
27
- import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
28
- import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
29
- const Je = /* @__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({
30
28
  __name: "Guido",
31
29
  props: {
32
30
  config: null,
33
31
  ready: { type: Boolean, default: !0 }
34
32
  },
35
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
36
- setup(W, { expose: x, emit: r }) {
37
- const a = W, G = M(
34
+ setup(x, { expose: G, emit: r }) {
35
+ const a = x, H = S(
38
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
39
- ), H = M(
37
+ ), $ = S(
40
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
41
- ), S = B(), l = B(), u = Se(), h = ge(), t = ye();
42
- a.ready && t.init(a.config);
43
- const c = P(), V = he(), m = U(() => c.hasChanges), { isTestPartner: $ } = oe(), { isEnabled: z } = te(), b = () => {
44
- var o;
45
- return (o = S.value) == null ? void 0 : o.handleSave(!0);
46
- }, g = (o) => {
47
- c.loadingStatus = o;
39
+ ), z = S(
40
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
+ ), h = A(), u = A(), p = ve(), b = be(), o = ge();
42
+ a.ready && o.init(a.config);
43
+ const c = P(), q = Se(), m = l(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
44
+ var t;
45
+ return (t = h.value) == null ? void 0 : t.handleSave(!0);
46
+ }, w = (t) => {
47
+ c.loadingStatus = t;
48
48
  };
49
- Y(), ee();
50
- const p = () => {
51
- var o, e;
49
+ te(), ne();
50
+ const f = () => {
51
+ var t, e;
52
52
  return {
53
- emailId: t.templateId,
54
- userId: t.userId,
55
- username: t.username,
56
- partnerName: t.partnerName,
57
- savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || O.SAVED_MODULES,
58
- defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
53
+ emailId: o.templateId,
54
+ userId: o.userId,
55
+ username: o.username,
56
+ partnerName: o.partnerName,
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
59
59
  };
60
- }, { initPlugin: E, preloadRuntime: w } = ne(), { getDefaultTemplate: D } = ve(), { cloneTimersOnSave: C, hasTimerBlocks: k } = re(), q = U(() => {
61
- var o;
62
- return !((o = t.ui) != null && o.showHeader);
63
- });
64
- Z({
60
+ }, { initPlugin: C, preloadRuntime: D } = se(), { getDefaultTemplate: k } = ye(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ae(), V = l(() => {
61
+ var t;
62
+ return !((t = o.ui) != null && t.showHeader);
63
+ }), j = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), J = l(
64
+ () => !!O().recommendationConfigs.strategyId
65
+ );
66
+ oe({
65
67
  onBack: () => {
66
68
  console.debug("guido:back"), r("back");
67
69
  },
68
70
  onSaveStart: () => {
69
71
  console.debug("guido:save:start"), r("save:start");
70
72
  },
71
- onSaveComplete: (o) => {
72
- const e = { ...o, metadata: p() };
73
+ onSaveComplete: (t) => {
74
+ const e = { ...t, metadata: f() };
73
75
  console.debug("guido:save:complete", e), r("save:complete", e);
74
76
  },
75
77
  onTestEmailClick: () => {
76
78
  console.debug("guido:test-email:click"), r("test-email:click");
77
79
  }
78
80
  });
79
- const T = (o) => {
80
- console.debug("dynamic-content:close", o), u.setSelectedDynamicContent(o), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: o }));
81
- }, 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 = () => {
82
84
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
83
85
  };
84
- _(() => m.value, () => {
86
+ U(() => m.value, () => {
85
87
  r("on-change", m.value);
86
88
  });
87
- const f = (o) => {
88
- const e = o, { attribute: s, position: d } = e.detail;
89
+ const y = (t) => {
90
+ const e = t, { attribute: s, position: d } = e.detail;
89
91
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
90
92
  };
91
93
  let i = null;
92
- const v = () => {
94
+ const g = () => {
93
95
  var e;
94
- const o = document.querySelector(se);
95
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(o == null ? void 0 : o.offsetHeight) ?? 0}px`);
96
- }, y = async () => {
97
- var o;
96
+ const t = document.querySelector(ie);
97
+ (e = u.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
98
+ }, v = async () => {
99
+ var t;
98
100
  try {
99
- t.initialized || t.init(a.config), c.templateId = t.templateId;
100
- const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
101
- h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
102
- const L = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, R = t.isFeatureEnabled("linkTrackingIds");
101
+ o.initialized || o.init(a.config), c.templateId = o.templateId;
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");
103
105
  let n = {
104
- html: s && await N(s, L),
106
+ html: s && await _(s, B),
105
107
  css: d
106
108
  };
107
- n.html || (n = await D(), n.html = await N(n.html, L));
108
- const K = R ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
109
- k(n.html) && (n.html = await C(n.html)), R && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
110
- const j = {
111
- 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,
112
114
  onReady: () => {
113
115
  console.debug("guido:ready"), r("ready");
114
116
  }
115
117
  };
116
- await E(n, p(), j), u.selectedDynamicContentList = I;
118
+ await C(n, f(), X), p.selectedDynamicContentList = L;
117
119
  } catch (e) {
118
120
  console.error("Failed to initialize Stripo editor:", e);
119
121
  }
120
122
  };
121
- return Q(async () => {
123
+ return Z(async () => {
122
124
  var e;
123
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), P().$reset(), be().$reset(), v();
124
- const o = (e = l.value) == null ? void 0 : e.parentElement;
125
- if (o && (i = new ResizeObserver(v), i.observe(o)), w(), a.ready)
126
- await y();
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)
128
+ await v();
127
129
  else {
128
- const s = _(() => a.ready, (d) => {
129
- d && (s(), y());
130
+ const s = U(() => a.ready, (d) => {
131
+ d && (s(), v());
130
132
  });
131
133
  }
132
- document.addEventListener("dynamic-content:open", f);
133
- }), X(() => {
134
- 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);
135
137
  try {
136
138
  window.UIEditor.removeEditor();
137
139
  } catch {
138
140
  console.debug("Failed to remove Stripo editor: No editor found");
139
141
  }
140
- t.reset();
141
- }), x({
142
+ o.reset();
143
+ }), G({
142
144
  dynamicContent: {
143
- insert: T,
144
- close: F
145
+ insert: I,
146
+ close: R
145
147
  },
146
148
  hasChanges: m,
147
- saveSilent: b,
148
- setLoading: g
149
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: t, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: $, isSaveValidationEnabled: z, saveSilent: b, setLoading: g, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: D, cloneTimersOnSave: C, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: v, startEditor: y, AutoSaveController: ie, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe, ValidationErrorDrawer: fe };
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 };
150
152
  }
151
153
  });
152
154
  export {
153
- Je as default
155
+ Ve as default
154
156
  };
@@ -1,14 +1,13 @@
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({
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({
6
5
  __name: "AutoSaveController",
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 };
6
+ setup(a) {
7
+ const { save: e } = s(), o = () => e(!1, !0);
8
+ return r(o), { __sfc: !0, save: e, backgroundSave: o };
10
9
  }
11
10
  });
12
11
  export {
13
- v as default
12
+ f as default
14
13
  };
@@ -0,0 +1,21 @@
1
+ import r from "./AssignStrategyDrawer.vue2.js";
2
+ /* empty css */
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,
13
+ n,
14
+ !1,
15
+ null,
16
+ "2580a7d9"
17
+ );
18
+ const y = i.exports;
19
+ export {
20
+ y as default
21
+ };
@@ -0,0 +1,106 @@
1
+ import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
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({
15
+ __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),
22
+ 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) => {
29
+ if (!t)
30
+ return;
31
+ 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")
36
+ });
37
+ });
38
+ });
39
+ const p = (t) => {
40
+ const r = f(t.updated_at || t.created_at);
41
+ if (!r)
42
+ return "";
43
+ const a = I(r, E);
44
+ return o("recommendation-strategy.last-updated-on", { value: a });
45
+ }, D = l(() => e.strategies.map((t) => ({
46
+ text: t.name,
47
+ value: t.strategy_id,
48
+ infoBoxProps: {
49
+ id: `strategy-info-${t.strategy_id}`,
50
+ theme: "light",
51
+ variant: "information",
52
+ className: "assign-strategy-info-box",
53
+ titleText: N(f(t.name)),
54
+ descriptionStatus: !0,
55
+ descriptionText: p(t),
56
+ slot: B,
57
+ slotProps: { strategy: t }
58
+ }
59
+ }))), d = l(() => {
60
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
61
+ return t ? { ...t, fallback_config: null } : null;
62
+ }), w = l(() => ({
63
+ primaryButton: {
64
+ styling: "solid",
65
+ type: "primary",
66
+ labelText: o("products.assign-btn")
67
+ },
68
+ cancelOrBackButton: {
69
+ styling: "ghost",
70
+ type: "secondary",
71
+ labelText: o("products.cancel")
72
+ }
73
+ }));
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: () => {
75
+ e.closeAssignStrategyDrawer();
76
+ }, assignStrategy: async () => {
77
+ const t = d.value;
78
+ if (!t) {
79
+ i.value = !0;
80
+ return;
81
+ }
82
+ let r = "";
83
+ try {
84
+ r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
85
+ } catch (a) {
86
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
87
+ }
88
+ if (!r) {
89
+ s({
90
+ type: m.Error,
91
+ message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
92
+ });
93
+ return;
94
+ }
95
+ e.assignStrategy(t), s({
96
+ type: m.Success,
97
+ message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
98
+ }), e.closeAssignStrategyDrawer();
99
+ }, onSelect: (t) => {
100
+ n.value = t.value, i.value = !1;
101
+ } };
102
+ }
103
+ });
104
+ export {
105
+ W as default
106
+ };
@@ -0,0 +1,19 @@
1
+ import r from "./StrategyInfoBoxContent.vue2.js";
2
+ import _ from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var c = function() {
4
+ var t = this, s = t._self._c, n = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(n.details, function(e, a) {
6
+ return s("div", { key: e.title, staticClass: "d-f f-d-c", class: { "mt-2": a > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(e.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(e.value))])]);
7
+ }), 0);
8
+ }, f = [], l = /* @__PURE__ */ _(
9
+ r,
10
+ c,
11
+ f,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const p = l.exports;
17
+ export {
18
+ p as default
19
+ };
@@ -0,0 +1,63 @@
1
+ import { defineComponent as f, computed as i } from "vue";
2
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
3
+ import { asText as c } from "../../../../utils/genericUtil.js";
4
+ const j = /* @__PURE__ */ f({
5
+ __name: "StrategyInfoBoxContent",
6
+ props: {
7
+ strategy: null
8
+ },
9
+ setup(p) {
10
+ const a = p, n = _(), s = i(() => n("recommendation-strategy.none")), u = i(() => {
11
+ const e = c(a.strategy.algorithm) === "MIXED" ? n("discovery-strategy.mixed-algorithm") : n("discovery-strategy.single-algorithm"), t = c(a.strategy.algorithm_used).split(",").map((r) => r.trim()).filter(Boolean).map((r) => n(`recommendation-algorithm-names.${r.replaceAll("_", "-").toLowerCase()}`));
12
+ return t.length ? `${e} · ${t.join(", ")}` : e;
13
+ }), d = i(() => [
14
+ [a.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
15
+ [a.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
16
+ [a.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
17
+ ].filter(([e]) => Number(e) === 1).map(([, e]) => n(e)).join(", ") || s.value), l = (e) => {
18
+ const t = c(e).trim();
19
+ if (!t)
20
+ return "";
21
+ let r;
22
+ try {
23
+ r = JSON.parse(t);
24
+ } catch {
25
+ return t;
26
+ }
27
+ if (Array.isArray(r))
28
+ return r.length ? String(r.length) : "";
29
+ if (r && typeof r == "object") {
30
+ const o = Object.keys(r).length;
31
+ return o ? String(o) : "";
32
+ }
33
+ return t;
34
+ }, m = i(() => l(a.strategy.manual_merchandising) || l(a.strategy.manual_merchandising_products) || s.value), g = (e) => {
35
+ if (Array.isArray(e))
36
+ return e.length;
37
+ const { conditionList: t } = e ?? {};
38
+ return Array.isArray(t) ? t.length : 1;
39
+ }, y = i(() => {
40
+ const e = a.strategy.filters;
41
+ if (!e)
42
+ return s.value;
43
+ try {
44
+ const t = typeof e == "string" ? JSON.parse(e) : e;
45
+ if (!t || typeof t != "object")
46
+ return s.value;
47
+ const r = Object.values(t).reduce((o, v) => o + g(v), 0);
48
+ return r ? String(r) : s.value;
49
+ } catch {
50
+ return s.value;
51
+ }
52
+ }), h = i(() => [
53
+ { title: n("gpt-app-builder.algorithms-and-method"), value: u.value },
54
+ { title: n("gpt-app-builder.exclusions"), value: d.value },
55
+ { title: n("discovery-strategy.filters"), value: y.value },
56
+ { title: n("action-builder.manual-merchandising"), value: m.value }
57
+ ]);
58
+ return { __sfc: !0, props: a, trans: n, none: s, algorithmsAndMethod: u, exclusions: d, asMerchandising: l, manualMerchandising: m, conditionsIn: g, filters: y, details: h };
59
+ }
60
+ });
61
+ export {
62
+ j as default
63
+ };
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var u = function() {
5
5
  var s, i, n, a;
6
6
  var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
@@ -15,7 +15,7 @@ var u = function() {
15
15
  p,
16
16
  !1,
17
17
  null,
18
- "44d8e7c8"
18
+ "6e711fd7"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {