@useinsider/guido 3.17.0-beta.6255bfc → 3.17.0-beta.6b5cdfc

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 (52) hide show
  1. package/README.md +5 -6
  2. package/dist/@types/config/schemas.js +6 -12
  3. package/dist/components/Guido.vue.js +2 -2
  4. package/dist/components/Guido.vue2.js +30 -31
  5. package/dist/composables/useCustomInterfaceAppearance.js +38 -52
  6. package/dist/composables/useRecommendation.js +44 -52
  7. package/dist/config/migrator/recommendation/settingsMapper.js +17 -19
  8. package/dist/config/migrator/recommendationMigrator.js +4 -6
  9. package/dist/enums/academy.js +1 -2
  10. package/dist/enums/date.js +3 -4
  11. package/dist/enums/extensions/recommendationBlock.js +1 -4
  12. package/dist/extensions/Blocks/Recommendation/block.js +21 -26
  13. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -36
  14. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
  15. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +166 -180
  16. package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
  17. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +110 -251
  18. package/dist/extensions/Blocks/common-control.js +19 -22
  19. package/dist/guido.css +1 -1
  20. package/dist/services/recommendationApi.js +30 -75
  21. package/dist/src/@types/config/schemas.d.ts +0 -12
  22. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  23. package/dist/src/composables/useConfig.d.ts +0 -2
  24. package/dist/src/composables/useRecommendation.d.ts +0 -1
  25. package/dist/src/enums/academy.d.ts +0 -1
  26. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  27. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -7
  28. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  29. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -15
  30. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -206
  31. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
  32. package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
  33. package/dist/src/services/recommendationApi.d.ts +1 -4
  34. package/dist/src/stores/config.d.ts +0 -18
  35. package/dist/src/utils/liquidDynamicContent.d.ts +18 -0
  36. package/dist/utils/dateUtil.js +10 -29
  37. package/dist/utils/genericUtil.js +54 -54
  38. package/dist/utils/liquidDynamicContent.js +14 -0
  39. package/dist/utils/templatePreparation.js +34 -37
  40. package/package.json +2 -3
  41. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
  42. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -66
  43. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -142
  44. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -30
  46. package/dist/src/mock/api/recommendation-strategies.d.ts +0 -63
  47. package/dist/src/utils/strategyInfoBox.d.ts +0 -22
  48. package/dist/static/assets/icons/line-change.svg.js +0 -5
  49. package/dist/static/assets/icons/line-delete.svg.js +0 -5
  50. package/dist/static/assets/icons/line-plus.svg.js +0 -5
  51. package/dist/static/styles/components/recommendation-strategy.css.js +0 -188
  52. package/dist/utils/strategyInfoBox.js +0 -37
package/README.md CHANGED
@@ -162,7 +162,6 @@ 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.
166
165
  },
167
166
 
168
167
  // Optional: Callbacks
@@ -634,16 +633,16 @@ toaster fires (useful before the host has wired the catalog).
634
633
 
635
634
  ```bash
636
635
  # Install
637
- bun install
636
+ npm install
638
637
 
639
638
  # Start dev server
640
- bun start
639
+ npm start
641
640
 
642
641
  # Build
643
- bun run build
642
+ npm run build
644
643
 
645
644
  # Lint & type-check
646
- bun run lint
645
+ npm run lint
647
646
  ```
648
647
 
649
648
  ### Environment Variables
@@ -661,7 +660,7 @@ VITE_STRIPO_USER=your_user
661
660
 
662
661
  ```bash
663
662
  # Build the package
664
- bun run build
663
+ npm run build
665
664
 
666
665
  # Create tarball
667
666
  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 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";
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";
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 = k(
79
+ })), N = y(
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
- k(t(), P),
135
+ y(t(), P),
136
136
  {}
137
137
  )
138
138
  }), x = a({
@@ -219,13 +219,7 @@ 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),
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)
222
+ linkTrackingIds: e(o(), !1)
229
223
  }), B = i([
230
224
  "amp-accordion",
231
225
  "amp-carousel",
@@ -293,7 +287,7 @@ const p = {
293
287
  ...d.entries,
294
288
  type: u("custom"),
295
289
  /** Custom processor function */
296
- processor: y(
290
+ processor: k(
297
291
  (s) => typeof s == "function",
298
292
  "processor must be a function"
299
293
  )
@@ -313,7 +307,7 @@ const p = {
313
307
  * Return false to cancel the save operation.
314
308
  */
315
309
  externalValidation: e(
316
- y(
310
+ k(
317
311
  (s) => typeof s == "function",
318
312
  "externalValidation must be a function"
319
313
  )
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
3
3
  import a 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.AssignStrategyDrawer), 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), 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
9
  }, n = [], s = /* @__PURE__ */ a(
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "003398e6"
15
+ "b0d3b445"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -5,27 +5,26 @@ import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js"
5
5
  import { usePartner as ee } from "../composables/usePartner.js";
6
6
  import { useStripo as te } from "../composables/useStripo.js";
7
7
  import { useTimerClone as oe } from "../composables/useTimerClone.js";
8
- import { migrate as A } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as N } from "../enums/defaults.js";
8
+ import { migrate as N } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as O } from "../enums/defaults.js";
10
10
  import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
11
11
  import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
12
  import se from "./organisms/AutoSaveController.vue.js";
13
13
  import ae from "./organisms/base/Toaster.vue.js";
14
- import ie from "./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js";
15
- import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import de from "./organisms/header/HeaderWrapper.vue.js";
17
- import me from "./organisms/LoadingWrapper.vue.js";
18
- import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as pe } from "../services/stripoApi.js";
21
- import { useConfigStore as fe } from "../stores/config.js";
22
- import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
23
- import { useEditorStore as O } from "../stores/editor.js";
24
- import { usePreviewStore as ve } from "../stores/preview.js";
25
- import { useTemplateStore as ge } from "../stores/template.js";
26
- import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as P } from "../utils/linkTrackingIds.js";
28
- const Ke = /* @__PURE__ */ j({
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({
29
28
  __name: "Guido",
30
29
  props: {
31
30
  config: null,
@@ -37,11 +36,11 @@ const Ke = /* @__PURE__ */ j({
37
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
37
  ), H = R(
39
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), g = B(), l = B(), u = ye(), S = Se(), o = fe();
39
+ ), h = B(), l = B(), u = fe(), S = he(), o = pe();
41
40
  a.ready && o.init(a.config);
42
- const c = O(), $ = ve(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), h = () => {
41
+ const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
43
42
  var t;
44
- return (t = g.value) == null ? void 0 : t.handleSave(!0);
43
+ return (t = h.value) == null ? void 0 : t.handleSave(!0);
45
44
  }, b = (t) => {
46
45
  c.loadingStatus = t;
47
46
  };
@@ -53,10 +52,10 @@ const Ke = /* @__PURE__ */ j({
53
52
  userId: o.userId,
54
53
  username: o.username,
55
54
  partnerName: o.partnerName,
56
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
57
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
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
58
57
  };
59
- }, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: D } = pe(), { cloneTimersOnSave: C, hasTimerBlocks: k } = oe(), q = U(() => {
58
+ }, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: k } = oe(), q = U(() => {
60
59
  var t;
61
60
  return !((t = o.ui) != null && t.showHeader);
62
61
  });
@@ -100,12 +99,12 @@ const Ke = /* @__PURE__ */ j({
100
99
  S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
101
100
  const L = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
102
101
  let n = {
103
- html: s && await A(s, L),
102
+ html: s && await N(s, L),
104
103
  css: d
105
104
  };
106
- n.html || (n = await D(), n.html = await A(n.html, L));
107
- const K = M ? P(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
108
- k(n.html) && (n.html = await C(n.html)), M && (c.trackIdSessionFloor = Math.max(K, P(n.html)));
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)));
109
108
  const V = {
110
109
  preselectedDynamicContentList: I,
111
110
  onReady: () => {
@@ -119,7 +118,7 @@ const Ke = /* @__PURE__ */ j({
119
118
  };
120
119
  return J(async () => {
121
120
  var e;
122
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), O().$reset(), ge().$reset(), y();
121
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
123
122
  const t = (e = l.value) == null ? void 0 : e.parentElement;
124
123
  if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
125
124
  await v();
@@ -143,11 +142,11 @@ const Ke = /* @__PURE__ */ j({
143
142
  close: F
144
143
  },
145
144
  hasChanges: m,
146
- saveSilent: h,
145
+ saveSilent: g,
147
146
  setLoading: b
148
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: a, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: z, saveSilent: h, setLoading: b, 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: y, startEditor: v, AutoSaveController: se, Toaster: ae, AssignStrategyDrawer: ie, FilterSelectionDrawer: ce, HeaderWrapper: de, LoadingWrapper: me, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
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
148
  }
150
149
  });
151
150
  export {
152
- Ke as default
151
+ ze as default
153
152
  };
@@ -1,67 +1,53 @@
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,
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,
32
21
  // Must be on top
33
- A,
34
- p,
22
+ S,
35
23
  // Must be on top
24
+ m,
25
+ e,
26
+ i,
27
+ p,
28
+ n,
36
29
  s,
37
30
  C,
38
- a,
39
31
  f,
40
- c,
32
+ a,
41
33
  u,
42
- l,
34
+ c,
43
35
  d,
36
+ l,
44
37
  h,
45
- g,
46
- I,
47
- y,
48
- b,
49
- B,
50
- $,
51
- P,
52
- w
53
- // Last: overrides button.css / wide-panel.css defaults
38
+ w,
39
+ y
54
40
  ].join(`
55
41
 
56
- `), Y = () => ({ importCss: () => {
42
+ `), v = () => ({ importCss: () => {
57
43
  const o = new CSSStyleSheet();
58
- o.replaceSync(R);
59
- const e = document.querySelector("ui-editor");
60
- if (!e)
44
+ o.replaceSync(b);
45
+ const r = document.querySelector("ui-editor");
46
+ if (!r)
61
47
  return;
62
- const m = e.shadowRoot;
63
- m && (m.adoptedStyleSheets = [o]);
48
+ const t = r.shadowRoot;
49
+ t && (t.adoptedStyleSheets = [o]);
64
50
  } });
65
51
  export {
66
- Y as useCustomInterfaceAppearance
52
+ v as useCustomInterfaceAppearance
67
53
  };
@@ -1,24 +1,23 @@
1
- import { useConfig as I } from "./useConfig.js";
2
- import { getRecommendationFeedSourceMaps as C, URLS as R } from "../enums/extensions/recommendationBlock.js";
3
- import { MinDeviceViewport as b, DefaultPadding as h } from "../enums/recommendation.js";
4
- import { useRecommendationExtensionStore as f } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
6
- import { getPartnerRecommendationParams as P } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
7
- import { sanitizeProductIds as S } from "../extensions/Blocks/Recommendation/utils/productIds.js";
8
- import { useConfigStore as T } from "../stores/config.js";
9
- const L = () => ({
1
+ import { getRecommendationFeedSourceMaps as I, URLS as R } from "../enums/extensions/recommendationBlock.js";
2
+ import { MinDeviceViewport as C, DefaultPadding as b } from "../enums/recommendation.js";
3
+ import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
+ import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
7
+ import { useConfigStore as P } from "../stores/config.js";
8
+ const B = () => ({
10
9
  calculateCardWidth: ({
11
- mobileLeftPadding: i,
12
- mobileRightPadding: c,
13
- cardsInRow: s,
14
- unresponsive: o
10
+ mobileLeftPadding: a,
11
+ mobileRightPadding: s,
12
+ cardsInRow: c,
13
+ unresponsive: n
15
14
  }) => {
16
- const n = o ? s : 1, d = i + c + (n - 1) * h;
17
- return (b - d) / n;
15
+ const r = n ? c : 1, e = a + s + (r - 1) * b;
16
+ return (C - e) / r;
18
17
  },
19
- getRecommendationCampaignData: (i) => {
20
- const c = f(), s = Number(i), o = c.blockStates[s];
21
- if (!o)
18
+ getRecommendationCampaignData: (a) => {
19
+ const s = l(), c = Number(a), n = s.blockStates[c];
20
+ if (!n)
22
21
  return {
23
22
  textTrimming: !1,
24
23
  orientation: "vertical",
@@ -31,56 +30,49 @@ const L = () => ({
31
30
  discountBeforeTextValue: "",
32
31
  discountAfterTextValue: ""
33
32
  };
34
- const { recommendationConfigs: n } = o, d = n.orientation === "grid" ? "vertical" : "horizontal";
33
+ const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
35
34
  return {
36
- textTrimming: n.textTrimming,
37
- orientation: d,
35
+ textTrimming: r.textTrimming,
36
+ orientation: e,
38
37
  mobileLeftPadding: 0,
39
38
  mobileRightPadding: 0,
40
- cardsInRow: n.cardsInRow,
41
- unresponsive: n.unresponsive,
39
+ cardsInRow: r.cardsInRow,
40
+ unresponsive: r.unresponsive,
42
41
  priceBeforeTextValue: "",
43
42
  priceAfterTextValue: "",
44
43
  discountBeforeTextValue: "",
45
44
  discountAfterTextValue: ""
46
45
  };
47
46
  },
48
- buildCampaignUrl: (i, c) => {
49
- var l;
50
- const s = f(), o = T(), { isFeatureEnabled: n } = I(), d = Number(i);
47
+ buildCampaignUrl: (a, s) => {
48
+ var m;
49
+ const c = l(), n = P(), r = Number(a);
51
50
  let e;
52
- if (c)
53
- e = c;
51
+ if (s)
52
+ e = s;
54
53
  else {
55
- const a = s.blockStates[d];
56
- if (!a)
54
+ const i = c.blockStates[r];
55
+ if (!i)
57
56
  return "";
58
- const { recommendationConfigs: r } = a;
57
+ const { recommendationConfigs: o } = i;
59
58
  e = {
60
- strategy: r.strategy,
61
- strategyId: r.strategyId,
62
- language: r.language,
63
- currencyCode: r.currencySettings.value,
64
- size: r.size,
65
- productIds: r.productIds,
66
- filters: r.filters,
67
- shuffleProducts: r.shuffleProducts
59
+ strategy: o.strategy,
60
+ language: o.language,
61
+ currencyCode: o.currencySettings.value,
62
+ size: o.size,
63
+ productIds: o.productIds,
64
+ filters: o.filters,
65
+ shuffleProducts: o.shuffleProducts
68
66
  };
69
67
  }
70
- if (n("reusableRecommendationStrategy") && e.strategyId)
71
- return s.recommendationCampaignUrls[i] = {
72
- strategyId: e.strategyId,
73
- locale: e.language,
74
- currency: e.currencyCode
75
- }, "";
76
- const g = ((l = C().find((a) => a.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
77
- t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", S(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
78
- const p = e.filters.filter((a) => a.isValid), u = x(p);
79
- u && t.set("filter", u), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(P(o.partnerName, e.strategy)).forEach(([a, r]) => t.set(a, r));
80
- const y = decodeURIComponent(t.toString()), m = `${R.RECOMMENDATION_API_URL}/v2/${g}?${y}`;
81
- return s.recommendationCampaignUrls[i] = m, m;
68
+ const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
69
+ t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
70
+ const g = e.filters.filter((i) => i.isValid), d = h(g);
71
+ d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(n.partnerName, e.strategy)).forEach(([i, o]) => t.set(i, o));
72
+ const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
73
+ return c.recommendationCampaignUrls[a] = u, u;
82
74
  }
83
75
  });
84
76
  export {
85
- L as useRecommendation
77
+ B as useRecommendation
86
78
  };
@@ -1,10 +1,10 @@
1
- import { PRE_RRS_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
- import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as S, DEFAULT_COLUMN_SPACING as f, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
1
+ import { CURRENT_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
+ import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as f, DEFAULT_COLUMN_SPACING as S, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
3
3
  import { mapLegacyStrategy as l } from "../../../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
4
4
  function c(t) {
5
5
  return t === "0" || t === 0 ? "before" : "after";
6
6
  }
7
- function _(t) {
7
+ function I(t) {
8
8
  if (typeof t == "number" && Number.isFinite(t))
9
9
  return t;
10
10
  if (typeof t == "string") {
@@ -14,13 +14,13 @@ function _(t) {
14
14
  }
15
15
  return i.decimalCount;
16
16
  }
17
- function I(t) {
17
+ function _(t) {
18
18
  return t === "." || t === "," || t === " " || t === "" ? t : ",";
19
19
  }
20
- function A(t) {
20
+ function N(t) {
21
21
  return t === "." || t === "," || t === " " ? t : ".";
22
22
  }
23
- function L(t) {
23
+ function A(t) {
24
24
  if (!t || typeof t != "object")
25
25
  return { ...i };
26
26
  const o = t, n = o.value ?? o.name ?? i.code, r = o.symbol ?? n;
@@ -28,18 +28,18 @@ function L(t) {
28
28
  code: n,
29
29
  symbol: r,
30
30
  alignment: c(o.alignment),
31
- decimalCount: _(o.decimalCount),
32
- decimalSeparator: A(o.decimalSeparator),
33
- thousandSeparator: I(o.thousandSeparator)
31
+ decimalCount: I(o.decimalCount),
32
+ decimalSeparator: N(o.decimalSeparator),
33
+ thousandSeparator: _(o.thousandSeparator)
34
34
  };
35
35
  }
36
- function N(t) {
36
+ function L(t) {
37
37
  return t === "horizontal" || t === "list" ? "list" : "grid";
38
38
  }
39
39
  function R(t) {
40
40
  return l(t) || "mostPopular";
41
41
  }
42
- function O(t, o, n) {
42
+ function U(t, o, n) {
43
43
  const r = o.rowCount ?? t.cardsInRow ?? m, u = o.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
44
44
  return {
45
45
  recommendationId: n,
@@ -48,15 +48,15 @@ function O(t, o, n) {
48
48
  size: String(u),
49
49
  shuffleProducts: !!t.shuffleProducts,
50
50
  language: t.language ?? "en_US",
51
- currency: L(t.currencySettings),
51
+ currency: A(t.currencySettings),
52
52
  filters: (t.filters ?? []).map((e) => ({ ...e })),
53
- layout: N(t.orientation ?? o.orientation),
53
+ layout: L(t.orientation ?? o.orientation),
54
54
  cardsInRow: r,
55
55
  mobileCardsInRow: a,
56
56
  mobileLayoutEnabled: !1,
57
57
  previousMobileCardsInRow: a,
58
- columnSpacing: f,
59
- rowSpacing: S,
58
+ columnSpacing: S,
59
+ rowSpacing: f,
60
60
  mobileColumnSpacing: d,
61
61
  mobileRowSpacing: p,
62
62
  omnibusPrice: { textBefore: "", textAfter: "" },
@@ -66,12 +66,10 @@ function O(t, o, n) {
66
66
  // gated). New Guido blocks default differently (see DEFAULT_NODE_CONFIG).
67
67
  priceMovedToNextLine: !!t.isPriceMovedToNextLine,
68
68
  priceHideIfSameAsDiscounted: !!t.isPriceDeletedForZeroSale,
69
- // Legacy blocks stay on the pre-RRS era marker: the campaign they belong
70
- // to keeps the old settings panel until its own migration ships.
71
69
  configVersion: s
72
70
  };
73
71
  }
74
72
  export {
75
- L as mapCurrency,
76
- O as mapSettings
73
+ A as mapCurrency,
74
+ U as mapSettings
77
75
  };
@@ -1,6 +1,6 @@
1
1
  import { BlockId as f } from "../../enums/block.js";
2
- import { useTemplateStore as y } from "../../stores/template.js";
3
- import { mapComposition as b } from "./recommendation/compositionMapper.js";
2
+ import { useTemplateStore as b } from "../../stores/template.js";
3
+ import { mapComposition as y } from "./recommendation/compositionMapper.js";
4
4
  import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
5
5
  import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
6
6
  import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
@@ -20,10 +20,8 @@ function B(i, t, a) {
20
20
  ), !1;
21
21
  const n = a[String(o)] ?? {
22
22
  currencySettings: v(t)
23
- }, c = T(n, r, o), e = b((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
23
+ }, c = T(n, r, o), e = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
24
24
  ...c,
25
- // Legacy blocks predate RRS — never strategy-backed.
26
- strategyId: "",
27
25
  composition: e.composition,
28
26
  visibility: e.visibility,
29
27
  textTrimming: e.anyTextTrimming
@@ -58,7 +56,7 @@ function B(i, t, a) {
58
56
  function q(i, t = {}) {
59
57
  const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
60
58
  try {
61
- y().$patch((e) => {
59
+ b().$patch((e) => {
62
60
  e.migrations = {
63
61
  ...e.migrations,
64
62
  [f.Recommendation]: r.length
@@ -1,8 +1,7 @@
1
1
  const e = "https://academy.insiderone.com", o = {
2
2
  EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
3
3
  GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
- AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
5
- EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
4
+ AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`
6
5
  };
7
6
  export {
8
7
  o as ACADEMY_LINKS
@@ -1,6 +1,5 @@
1
- const t = "tr-TR", T = "default", L = "UTC";
1
+ const t = "tr-TR", L = "default";
2
2
  export {
3
- T as DEFAULT,
4
- t as DEFAULT_LOCALE,
5
- L as DEFAULT_TZ
3
+ L as DEFAULT,
4
+ t as DEFAULT_LOCALE
6
5
  };
@@ -2,10 +2,7 @@ import { useTranslations as r } from "../../composables/useTranslations.js";
2
2
  const l = {
3
3
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
4
4
  // Relative path → same-origin as the embedding inone dashboard.
5
- PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
- RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
7
- // Panel route of the Recommendation Strategies listing.
8
- RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
5
+ PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
9
6
  }, c = {
10
7
  CLIENT_ID: "clientId"
11
8
  }, d = () => {