@useinsider/guido 3.16.0 → 3.17.0-beta.3e9d6e7

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 +1 -0
  2. package/dist/@types/config/schemas.js +12 -6
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +63 -61
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +67 -0
  7. package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +20 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +55 -0
  9. package/dist/composables/useCustomInterfaceAppearance.js +19 -16
  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/recommendationMigrator.js +6 -4
  14. package/dist/enums/date.js +4 -3
  15. package/dist/enums/extensions/recommendationBlock.js +25 -23
  16. package/dist/enums/recommendation.js +17 -17
  17. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
  18. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +13 -11
  19. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
  20. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +115 -87
  21. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +132 -0
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +198 -51
  23. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
  24. package/dist/extensions/Blocks/common-control.js +22 -19
  25. package/dist/guido.css +1 -1
  26. package/dist/node_modules/@useinsider/design-system-organisms/dist/index-Dc9AygoZ.js +526 -0
  27. package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +9345 -0
  28. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +174 -0
  29. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +381 -0
  30. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +236 -0
  31. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +70 -0
  32. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +350 -0
  33. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +371 -0
  34. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +152 -0
  35. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +141 -0
  36. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +1047 -0
  37. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +96050 -0
  38. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +2042 -0
  39. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +166 -0
  40. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +1098 -0
  41. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +55 -0
  42. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +265 -0
  43. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +184 -0
  44. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +50 -0
  45. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +453 -0
  46. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +145 -0
  47. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +176 -0
  48. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +266 -0
  49. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +114 -0
  50. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +200 -0
  51. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +451 -0
  52. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +49 -0
  53. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +119 -0
  54. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +4309 -0
  55. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +129 -0
  56. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +503 -0
  57. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +253 -0
  58. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +107 -0
  59. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +134 -0
  60. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +464 -0
  61. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +28 -0
  62. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +23 -0
  63. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +29 -0
  64. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +109 -0
  65. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +2339 -0
  66. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +16 -0
  67. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +17 -0
  68. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +188 -0
  69. package/dist/services/recommendationApi.js +77 -28
  70. package/dist/src/@types/config/schemas.d.ts +12 -0
  71. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  72. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +24 -0
  73. package/dist/src/composables/useConfig.d.ts +2 -0
  74. package/dist/src/composables/useRecommendation.d.ts +1 -0
  75. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  76. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -3
  77. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +37 -0
  78. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +210 -10
  79. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  80. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
  81. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  82. package/dist/src/mock/api/recommendation-strategies.d.ts +43 -0
  83. package/dist/src/services/recommendationApi.d.ts +4 -1
  84. package/dist/src/stores/config.d.ts +18 -0
  85. package/dist/static/styles/components/recommendation-strategy.css.js +171 -0
  86. package/dist/utils/dateUtil.js +23 -10
  87. package/dist/utils/templatePreparation.js +37 -34
  88. 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,18 +1,18 @@
1
- import i from "./Guido.vue2.js";
1
+ import a 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
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) {
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.configStore.isFeatureEnabled("reusableRecommendationStrategy") ? 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 = [], s = /* @__PURE__ */ a(
10
- i,
9
+ }, n = [], s = /* @__PURE__ */ i(
10
+ a,
11
11
  t,
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "b0d3b445"
15
+ "f258bc9e"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,30 +1,30 @@
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";
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({
1
+ import { defineComponent as J, defineAsyncComponent as g, 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 te } from "../composables/usePartner.js";
6
+ import { useStripo as oe } from "../composables/useStripo.js";
7
+ import { useTimerClone as ne } from "../composables/useTimerClone.js";
8
+ import { migrate as A } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as re } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as se } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import ae from "./organisms/AutoSaveController.vue.js";
13
+ import ie from "./organisms/base/Toaster.vue.js";
14
+ import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import de from "./organisms/header/HeaderWrapper.vue.js";
16
+ import me from "./organisms/LoadingWrapper.vue.js";
17
+ import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as pe } from "../services/stripoApi.js";
20
+ import { useConfigStore as fe } from "../stores/config.js";
21
+ import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
22
+ import { useEditorStore as O } from "../stores/editor.js";
23
+ import { usePreviewStore as ve } from "../stores/preview.js";
24
+ import { useTemplateStore as ge } from "../stores/template.js";
25
+ import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
26
+ import { readTrackFloor as P } from "../utils/linkTrackingIds.js";
27
+ const qe = /* @__PURE__ */ J({
28
28
  __name: "Guido",
29
29
  props: {
30
30
  config: null,
@@ -32,19 +32,21 @@ const ze = /* @__PURE__ */ j({
32
32
  },
33
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
34
34
  setup(W, { expose: x, emit: r }) {
35
- const a = W, G = R(
35
+ const a = W, G = g(
36
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), H = R(
37
+ ), H = g(
38
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), h = B(), l = B(), u = fe(), S = he(), o = pe();
39
+ ), $ = g(
40
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
+ ), S = B(), l = B(), u = ye(), h = Se(), o = fe();
40
42
  a.ready && o.init(a.config);
41
- const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
43
+ const c = O(), z = ve(), m = U(() => c.hasChanges), { isTestPartner: q } = te(), b = () => {
42
44
  var t;
43
- return (t = h.value) == null ? void 0 : t.handleSave(!0);
44
- }, b = (t) => {
45
+ return (t = S.value) == null ? void 0 : t.handleSave(!0);
46
+ }, E = (t) => {
45
47
  c.loadingStatus = t;
46
48
  };
47
- X(), Z();
49
+ Y(), ee();
48
50
  const p = () => {
49
51
  var t, e;
50
52
  return {
@@ -52,14 +54,14 @@ const ze = /* @__PURE__ */ j({
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: w, preloadRuntime: D } = oe(), { getDefaultTemplate: C } = pe(), { cloneTimersOnSave: k, hasTimerBlocks: T } = ne(), K = U(() => {
59
61
  var t;
60
62
  return !((t = o.ui) != null && t.showHeader);
61
63
  });
62
- Y({
64
+ Z({
63
65
  onBack: () => {
64
66
  console.debug("guido:back"), r("back");
65
67
  },
@@ -74,9 +76,9 @@ const ze = /* @__PURE__ */ j({
74
76
  console.debug("guido:test-email:click"), r("test-email:click");
75
77
  }
76
78
  });
77
- const T = (t) => {
79
+ const F = (t) => {
78
80
  console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
79
- }, F = () => {
81
+ }, I = () => {
80
82
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
83
  };
82
84
  _(() => m.value, () => {
@@ -89,38 +91,38 @@ const ze = /* @__PURE__ */ j({
89
91
  let i = null;
90
92
  const y = () => {
91
93
  var e;
92
- const t = document.querySelector(ne);
94
+ const t = document.querySelector(re);
93
95
  (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
94
96
  }, v = async () => {
95
97
  var t;
96
98
  try {
97
99
  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");
100
+ 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) || [];
101
+ h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
102
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, R = o.isFeatureEnabled("linkTrackingIds");
101
103
  let n = {
102
- html: s && await N(s, L),
104
+ html: s && await A(s, M),
103
105
  css: d
104
106
  };
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,
107
+ n.html || (n = await C(), n.html = await A(n.html, M));
108
+ const V = R ? P(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
109
+ T(n.html) && (n.html = await k(n.html)), R && (c.trackIdSessionFloor = Math.max(V, P(n.html)));
110
+ const j = {
111
+ preselectedDynamicContentList: L,
110
112
  onReady: () => {
111
113
  console.debug("guido:ready"), r("ready");
112
114
  }
113
115
  };
114
- await E(n, p(), V), u.selectedDynamicContentList = I;
116
+ await w(n, p(), j), u.selectedDynamicContentList = L;
115
117
  } catch (e) {
116
118
  console.error("Failed to initialize Stripo editor:", e);
117
119
  }
118
120
  };
119
- return J(async () => {
121
+ return Q(async () => {
120
122
  var e;
121
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
123
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), se().$reset(), O().$reset(), ge().$reset(), y();
122
124
  const t = (e = l.value) == null ? void 0 : e.parentElement;
123
- if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
125
+ if (t && (i = new ResizeObserver(y), i.observe(t)), D(), a.ready)
124
126
  await v();
125
127
  else {
126
128
  const s = _(() => a.ready, (d) => {
@@ -128,7 +130,7 @@ const ze = /* @__PURE__ */ j({
128
130
  });
129
131
  }
130
132
  document.addEventListener("dynamic-content:open", f);
131
- }), Q(() => {
133
+ }), X(() => {
132
134
  i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
133
135
  try {
134
136
  window.UIEditor.removeEditor();
@@ -138,15 +140,15 @@ const ze = /* @__PURE__ */ j({
138
140
  o.reset();
139
141
  }), x({
140
142
  dynamicContent: {
141
- insert: T,
142
- close: F
143
+ insert: F,
144
+ close: I
143
145
  },
144
146
  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 };
147
+ saveSilent: b,
148
+ setLoading: E
149
+ }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, AssignStrategyDrawer: $, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: D, getDefaultTemplate: C, cloneTimersOnSave: k, hasTimerBlocks: T, noHeader: K, insertDynamicContent: F, closeDynamicContent: I, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: ae, Toaster: ie, FilterSelectionDrawer: ce, HeaderWrapper: de, LoadingWrapper: me, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
148
150
  }
149
151
  });
150
152
  export {
151
- ze as default
153
+ qe as default
152
154
  };
@@ -0,0 +1,18 @@
1
+ import a from "./AssignStrategyDrawer.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e(t.WpDrawer, { attrs: { id: "assign-strategy-drawer", "description-status": "", size: "medium", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.assignStrategyDrawerStatus, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { cancelOrBackButtonEvent: t.closeDrawer, onCloseEvent: t.closeDrawer, primaryButtonEvent: t.assignStrategy } }, [t.store.assignStrategyDrawerStatus ? e("div", { staticClass: "assign-strategy-drawer-content" }, [e(t.InSelect, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "search-status": "", "static-child-position": "bottom right", "button-status": !1, "dynamic-child-position": !1, "label-text": t.trans("ds-steps.recommendation-strategy"), options: t.strategyOptions, "placeholder-text": t.trans("ds-steps.select-strategy"), "skeleton-sizing": { width: 240, height: 42 }, "skeleton-status": t.store.strategiesLoading, value: t.selectValue }, on: { select: t.onSelect } }), t.selectedStrategy ? e("div", { key: String(t.selectedStrategy.strategy_id), staticClass: "assign-strategy-detail" }, [e(t.OrgStrategyDetailModal, { attrs: { show: "", "campaign-details-tab-status": t.campaignTabSupported, "footer-status": !1, strategy: t.selectedStrategy } })], 1) : s._e()], 1) : s._e()]);
7
+ }, o = [], i = /* @__PURE__ */ r(
8
+ a,
9
+ n,
10
+ o,
11
+ !1,
12
+ null,
13
+ "2fb85559"
14
+ );
15
+ const p = i.exports;
16
+ export {
17
+ p as default
18
+ };
@@ -0,0 +1,67 @@
1
+ import { defineComponent as v, ref as l, computed as o, watch as _ } from "vue";
2
+ /* empty css */
3
+ import w from "../../../wrappers/WpDrawer.vue.js";
4
+ import { useToaster as D } from "../../../../composables/useToaster.js";
5
+ import { useTranslations as T } from "../../../../composables/useTranslations.js";
6
+ import { ToasterTypeOptions as b } from "../../../../enums/toaster.js";
7
+ import { useRecommendationExtensionStore as h } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { OrgStrategyDetailModal as x } from "../../../../node_modules/@useinsider/design-system-organisms/dist/index.js";
9
+ import { InSelect as B } from "@useinsider/design-system-vue";
10
+ import O from "./StrategyInfoBox.vue.js";
11
+ const $ = /* @__PURE__ */ v({
12
+ __name: "AssignStrategyDrawer",
13
+ setup(A) {
14
+ const c = "/discovery/recommendation-strategies", s = T(), e = h(), { showToaster: g, handleError: u } = D(), r = l(null), a = l(!1), m = l(!1), d = o(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: c }) : "");
15
+ _(() => e.assignStrategyDrawerStatus, (t) => {
16
+ if (!t)
17
+ return;
18
+ const { strategyId: i } = e.recommendationConfigs;
19
+ r.value = i || null, m.value = !!window.l10n, e.fetchStrategies().catch((S) => {
20
+ u(S, s("discovery-strategy.error-description"));
21
+ });
22
+ });
23
+ const p = o(() => e.strategies.map((t) => ({
24
+ text: t.name,
25
+ value: t.strategy_id,
26
+ infoBoxProps: {
27
+ id: `strategy-info-${t.strategy_id}`,
28
+ theme: "light",
29
+ variant: "information",
30
+ className: "assign-strategy-info-box",
31
+ slot: O,
32
+ slotProps: { strategy: t }
33
+ }
34
+ }))), y = o(() => [{ value: r.value }]), n = o(() => {
35
+ const t = e.strategies.find((i) => String(i.strategy_id) === String(r.value ?? ""));
36
+ return t ? { ...t, fallback_config: null } : null;
37
+ }), f = o(() => ({
38
+ primaryButton: {
39
+ styling: "solid",
40
+ type: "primary",
41
+ labelText: s("products.assign-btn"),
42
+ loadingStatus: a.value,
43
+ disabledStatus: !n.value
44
+ },
45
+ cancelOrBackButton: {
46
+ styling: "ghost",
47
+ type: "secondary",
48
+ labelText: s("products.cancel"),
49
+ disabledStatus: a.value
50
+ }
51
+ }));
52
+ return { __sfc: !0, RRS_PANEL_PATH: c, trans: s, store: e, showToaster: g, handleError: u, selectedStrategyId: r, isAssigning: a, campaignTabSupported: m, drawerDescription: d, strategyOptions: p, selectValue: y, selectedStrategy: n, footerButtonGroupOptions: f, closeDrawer: () => {
53
+ e.closeAssignStrategyDrawer();
54
+ }, assignStrategy: () => {
55
+ const t = n.value;
56
+ t && (a.value = !0, e.assignStrategy(t), g({
57
+ type: b.Success,
58
+ message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
59
+ }), e.closeAssignStrategyDrawer(), a.value = !1);
60
+ }, onSelect: (t) => {
61
+ r.value = t.value;
62
+ }, WpDrawer: w, OrgStrategyDetailModal: x, InSelect: B };
63
+ }
64
+ });
65
+ export {
66
+ $ as default
67
+ };
@@ -0,0 +1,20 @@
1
+ import _ from "./StrategyInfoBox.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, s = t._self._c, a = t._self._setupProxy;
6
+ return s("div", { staticClass: "strategy-info-box" }, [s("div", { staticClass: "strategy-info-box__name" }, [t._v(" " + t._s(t.strategy.name) + " ")]), a.lastUpdated ? s("div", { staticClass: "strategy-info-box__updated" }, [t._v(" " + t._s(a.lastUpdated) + " ")]) : t._e(), s("div", { staticClass: "strategy-info-box__rows" }, t._l(a.rows, function(e) {
7
+ return s("div", { key: e.label, staticClass: "strategy-info-box__row" }, [s("div", { staticClass: "strategy-info-box__label" }, [t._v(" " + t._s(e.label) + " ")]), s("div", { staticClass: "strategy-info-box__value" }, [t._v(" " + t._s(e.value) + " ")])]);
8
+ }), 0)]);
9
+ }, i = [], n = /* @__PURE__ */ o(
10
+ _,
11
+ r,
12
+ i,
13
+ !1,
14
+ null,
15
+ "fe4491e6"
16
+ );
17
+ const d = n.exports;
18
+ export {
19
+ d as default
20
+ };
@@ -0,0 +1,55 @@
1
+ import { defineComponent as v, computed as s } from "vue";
2
+ import { useTranslations as h } from "../../../../composables/useTranslations.js";
3
+ import { formatShortDate as f } from "../../../../utils/dateUtil.js";
4
+ const A = /* @__PURE__ */ v({
5
+ __name: "StrategyInfoBox",
6
+ props: {
7
+ strategy: null
8
+ },
9
+ setup(g) {
10
+ const t = g, r = h(), n = (e) => e == null ? "" : String(e), y = s(() => {
11
+ const e = n(t.strategy.updated_at || t.strategy.created_at);
12
+ return e ? r("recommendation-strategy.last-updated-on", { value: f(e) }) : "";
13
+ }), c = s(() => {
14
+ const e = n(t.strategy.algorithm) === "MIXED" ? r("discovery-strategy.mixed-algorithm") : r("discovery-strategy.single-algorithm"), a = n(t.strategy.algorithm_used).split(",").map((o) => o.trim()).filter(Boolean).map((o) => r(`recommendation-algorithm-names.${o.replaceAll("_", "-").toLowerCase()}`));
15
+ return a.length ? `${e} · ${a.join(", ")}` : e;
16
+ }), u = s(() => [
17
+ [t.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
18
+ [t.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
19
+ [t.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
20
+ ].filter(([a]) => Number(a) === 1).map(([, a]) => r(a)).join(", ")), d = s(() => n(
21
+ t.strategy.manual_merchandising || t.strategy.manual_merchandising_products
22
+ ).trim()), i = s(() => {
23
+ const e = t.strategy.filters;
24
+ if (!e)
25
+ return 0;
26
+ try {
27
+ const a = typeof e == "string" ? JSON.parse(e) : e;
28
+ return Array.isArray(a) ? a.reduce((o, m) => o + (Array.isArray(m) ? m.length : 1), 0) : 0;
29
+ } catch {
30
+ return 0;
31
+ }
32
+ }), l = s(() => r("recommendation-strategy.none")), p = s(() => [
33
+ {
34
+ label: r("gpt-app-builder.algorithms-and-method"),
35
+ value: c.value
36
+ },
37
+ {
38
+ label: r("gpt-app-builder.exclusions"),
39
+ value: u.value || l.value
40
+ },
41
+ {
42
+ label: r("discovery-strategy.filters"),
43
+ value: i.value ? String(i.value) : l.value
44
+ },
45
+ {
46
+ label: r("action-builder.manual-merchandising"),
47
+ value: d.value || l.value
48
+ }
49
+ ]);
50
+ return { __sfc: !0, props: t, trans: r, asText: n, lastUpdated: y, algorithmsAndMethod: c, exclusions: u, manualMerchandising: d, filterCount: i, none: l, rows: p };
51
+ }
52
+ });
53
+ export {
54
+ A as default
55
+ };
@@ -4,20 +4,21 @@ import e from "../static/styles/components/amp-block.css.js";
4
4
  import i from "../static/styles/components/base-input.css.js";
5
5
  import p from "../static/styles/components/button-group.css.js";
6
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";
7
+ import C from "../static/styles/components/combobox.css.js";
8
+ import s from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
10
  import a from "../static/styles/components/loader.css.js";
11
11
  import u from "../static/styles/components/narrow-panel.css.js";
12
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,
13
+ import d from "../static/styles/components/recommendation-strategy.css.js";
14
+ import l from "../static/styles/components/switcher.css.js";
15
+ import h from "../static/styles/components/tabs.css.js";
16
+ import w from "../static/styles/components/tools.css.js";
17
+ import y from "../static/styles/components/version-history.css.js";
18
+ import B from "../static/styles/components/wide-panel.css.js";
19
+ import b from "../static/styles/variables.css.js";
20
+ const A = [
21
+ b,
21
22
  // Must be on top
22
23
  S,
23
24
  // Must be on top
@@ -26,22 +27,24 @@ const b = [
26
27
  i,
27
28
  p,
28
29
  n,
29
- s,
30
30
  C,
31
+ s,
31
32
  f,
32
33
  a,
33
34
  u,
34
35
  c,
35
- d,
36
36
  l,
37
37
  h,
38
38
  w,
39
- y
39
+ y,
40
+ B,
41
+ d
42
+ // Last: overrides button.css / wide-panel.css defaults
40
43
  ].join(`
41
44
 
42
- `), v = () => ({ importCss: () => {
45
+ `), F = () => ({ importCss: () => {
43
46
  const o = new CSSStyleSheet();
44
- o.replaceSync(b);
47
+ o.replaceSync(A);
45
48
  const r = document.querySelector("ui-editor");
46
49
  if (!r)
47
50
  return;
@@ -49,5 +52,5 @@ const b = [
49
52
  t && (t.adoptedStyleSheets = [o]);
50
53
  } });
51
54
  export {
52
- v as useCustomInterfaceAppearance
55
+ F as useCustomInterfaceAppearance
53
56
  };