@useinsider/guido 3.18.1-beta.cb31236 → 3.18.1-beta.d0bc5f3

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 (41) hide show
  1. package/dist/@types/config/schemas.js +51 -59
  2. package/dist/components/Guido.vue.js +4 -4
  3. package/dist/components/Guido.vue2.js +70 -72
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -7
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -87
  6. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +22 -24
  7. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +26 -28
  8. package/dist/composables/useCustomInterfaceAppearance.js +42 -46
  9. package/dist/enums/extensions/recommendationBlock.js +29 -25
  10. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +71 -72
  11. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +37 -68
  12. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +44 -45
  13. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +119 -105
  14. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
  15. package/dist/guido.css +1 -1
  16. package/dist/services/recommendationApi.js +84 -93
  17. package/dist/src/@types/config/schemas.d.ts +0 -16
  18. package/dist/src/composables/useConfig.d.ts +0 -4
  19. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -3
  20. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -1
  21. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -4
  22. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +45 -54
  23. package/dist/src/services/recommendationApi.d.ts +1 -2
  24. package/dist/src/stores/config.d.ts +0 -322
  25. package/dist/src/stores/onboarding.d.ts +0 -421
  26. package/dist/static/styles/components/recommendation-strategy.css.js +41 -74
  27. package/dist/stores/config.js +60 -74
  28. package/dist/stores/onboarding.js +1 -6
  29. package/package.json +1 -1
  30. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
  31. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
  32. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
  33. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
  34. package/dist/composables/useLegacyStrategyConversion.js +0 -58
  35. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -72
  36. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
  37. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +0 -2
  38. package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
  39. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -44
  40. package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
  41. package/dist/static/assets/icons/line-info.svg.js +0 -5
@@ -26,40 +26,6 @@ const n = `.strategy-control-header {
26
26
  text-decoration: underline;
27
27
  }
28
28
 
29
- .strategy-control-notice-row {
30
- padding: 0 16px 16px;
31
- }
32
-
33
- .strategy-control-notice {
34
- display: flex;
35
- gap: 8px;
36
- align-items: center;
37
- padding: 12px;
38
- border: 1px solid var(--guido-color-border-onpage-message-info);
39
- border-radius: 4px;
40
- background-color: var(--guido-color-background-onpage-message-info);
41
- }
42
-
43
- .strategy-control-notice::before {
44
- content: '';
45
- flex: none;
46
- width: 24px;
47
- height: 24px;
48
- background-color: var(--guido-color-border-onpage-message-info);
49
- mask-image: var(--guido-icon-line-info);
50
- mask-repeat: no-repeat;
51
- mask-position: center;
52
- mask-size: 24px 24px;
53
- }
54
-
55
- .strategy-control-notice-text {
56
- margin: 0;
57
- padding: 4px 0;
58
- color: var(--guido-color-neutral-700);
59
- font-size: 13px;
60
- line-height: 16px;
61
- }
62
-
63
29
  .recommendation-controls-container .container.strategy-control-cta-row {
64
30
  grid-template-columns: repeat(2, minmax(0, 180px));
65
31
  justify-content: start;
@@ -83,11 +49,8 @@ const n = `.strategy-control-header {
83
49
  white-space: nowrap;
84
50
  }
85
51
 
86
- .strategy-control-cta.primary > .button:disabled,
87
- .strategy-control-cta.primary > .button.disabled {
88
- opacity: 1;
52
+ .strategy-control-cta.primary > .button {
89
53
  color: var(--guido-color-gray-800);
90
- cursor: default;
91
54
  }
92
55
 
93
56
  .strategy-control-name-band {
@@ -98,14 +61,6 @@ const n = `.strategy-control-header {
98
61
  background-color: var(--guido-color-gray-0);
99
62
  }
100
63
 
101
- /* Figma gives the legacy band a 59px row: 17.5px above and below its 24px content. */
102
- [data-strategy-legacy-state] .strategy-control-name-band {
103
- gap: 8px;
104
- justify-content: space-between;
105
- min-height: auto;
106
- padding: 17.5px 16px;
107
- }
108
-
109
64
  .strategy-control-name {
110
65
  color: var(--guido-color-gray-800);
111
66
  font-size: 15px;
@@ -113,6 +68,41 @@ const n = `.strategy-control-header {
113
68
  line-height: 24px;
114
69
  }
115
70
 
71
+ /*
72
+ * Mirrors the design system's InSkeleton 1:1 (gradient stops, 200% size, 1.6s linear).
73
+ * The Stripo panel lives in the editor's shadow root and is built from raw HTML strings,
74
+ * so the Vue component cannot be used there. Hex values are literal in the DS too.
75
+ */
76
+ .guido-skeleton {
77
+ display: none;
78
+ border-radius: 4px;
79
+ background: linear-gradient(90deg, #f0f0f0 39.5%, #e1e1e1 66.02%, #f0f0f0 89.42%);
80
+ background-size: 200% 100%;
81
+ animation: guido-skeleton-shine 1.6s linear infinite;
82
+ }
83
+
84
+ @keyframes guido-skeleton-shine {
85
+ to { background-position-x: -200%; }
86
+ }
87
+
88
+ .guido-skeleton--strategy-name {
89
+ width: 140px;
90
+ height: 16px;
91
+ }
92
+
93
+ .guido-skeleton--strategy-action {
94
+ width: 72px;
95
+ height: 16px;
96
+ }
97
+
98
+ .guido-skeleton--strategy-action + .guido-skeleton--strategy-action {
99
+ margin-left: 16px;
100
+ }
101
+
102
+ [data-strategy-loading-state] .guido-skeleton {
103
+ display: block;
104
+ }
105
+
116
106
  .strategy-control-actions {
117
107
  display: flex;
118
108
  align-items: center;
@@ -159,15 +149,6 @@ const n = `.strategy-control-header {
159
149
  mask-image: var(--guido-icon-line-plus);
160
150
  }
161
151
 
162
- .strategy-control-action--update::before {
163
- mask-image: var(--guido-icon-filled-arrow-rising);
164
- }
165
-
166
- .strategy-control-name-band .strategy-control-action > span {
167
- padding: 0 0 0 8px;
168
- }
169
-
170
- .strategy-control-action--update,
171
152
  .strategy-control-action--change {
172
153
  color: var(--guido-color-primary-500);
173
154
  }
@@ -180,38 +161,24 @@ const n = `.strategy-control-header {
180
161
  text-decoration: underline;
181
162
  }
182
163
 
183
- .strategy-control-action:disabled,
184
- .strategy-control-action:disabled:hover {
185
- color: var(--guido-color-gray-700);
186
- text-decoration: none;
187
- cursor: default;
188
- }
189
-
190
- .recommendation-controls-container:not(.strategy-block):not(.legacy-strategy-block) .strategy-control-container,
164
+ .recommendation-controls-container:not(.strategy-block) .strategy-control-container,
191
165
  .recommendation-controls-container.strategy-block .product-count-control-container,
192
166
  .recommendation-controls-container.strategy-block .algorithm-control-container,
193
167
  .recommendation-controls-container.strategy-block .filters-control-container,
194
- .recommendation-controls-container.strategy-block .shuffle-control-container,
195
- .recommendation-controls-container.legacy-strategy-block .product-count-control-container,
196
- .recommendation-controls-container.legacy-strategy-block .algorithm-control-container,
197
- .recommendation-controls-container.legacy-strategy-block .filters-control-container,
198
- .recommendation-controls-container.legacy-strategy-block .shuffle-control-container {
168
+ .recommendation-controls-container.strategy-block .shuffle-control-container {
199
169
  display: none;
200
170
  }
201
171
 
202
- .recommendation-controls-container.strategy-block,
203
- .recommendation-controls-container.legacy-strategy-block {
172
+ .recommendation-controls-container.strategy-block {
204
173
  display: flex;
205
174
  flex-direction: column;
206
175
  }
207
176
 
208
- .recommendation-controls-container.strategy-block .price-placement-control-container,
209
- .recommendation-controls-container.legacy-strategy-block .price-placement-control-container {
177
+ .recommendation-controls-container.strategy-block .price-placement-control-container {
210
178
  order: 1;
211
179
  }
212
180
 
213
- .recommendation-controls-container.strategy-block .product-layout-control-container,
214
- .recommendation-controls-container.legacy-strategy-block .product-layout-control-container {
181
+ .recommendation-controls-container.strategy-block .product-layout-control-container {
215
182
  order: 2;
216
183
  }
217
184
  `;
@@ -1,8 +1,8 @@
1
1
  import "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
3
  import { parseConfig as o } from "../@types/config/validator.js";
4
- import { defineStore as a } from "pinia";
5
- const s = a("guido-config", {
4
+ import { defineStore as r } from "pinia";
5
+ const f = r("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -11,135 +11,121 @@ const s = a("guido-config", {
11
11
  /**
12
12
  * Get the identity configuration
13
13
  */
14
- identity: (e) => {
15
- var i;
16
- return ((i = e.config) == null ? void 0 : i.identity) ?? null;
14
+ identity: (i) => {
15
+ var e;
16
+ return ((e = i.config) == null ? void 0 : e.identity) ?? null;
17
17
  },
18
18
  /**
19
19
  * Get the partner configuration
20
20
  */
21
- partner: (e) => {
22
- var i;
23
- return ((i = e.config) == null ? void 0 : i.partner) ?? null;
21
+ partner: (i) => {
22
+ var e;
23
+ return ((e = i.config) == null ? void 0 : e.partner) ?? null;
24
24
  },
25
25
  /**
26
26
  * Get the template configuration
27
27
  */
28
- template: (e) => {
29
- var i;
30
- return ((i = e.config) == null ? void 0 : i.template) ?? null;
28
+ template: (i) => {
29
+ var e;
30
+ return ((e = i.config) == null ? void 0 : e.template) ?? null;
31
31
  },
32
32
  /**
33
33
  * Get the editor configuration
34
34
  */
35
- editor: (e) => {
36
- var i;
37
- return ((i = e.config) == null ? void 0 : i.editor) ?? null;
35
+ editor: (i) => {
36
+ var e;
37
+ return ((e = i.config) == null ? void 0 : e.editor) ?? null;
38
38
  },
39
39
  /**
40
40
  * Get the UI configuration
41
41
  */
42
- ui: (e) => {
43
- var i;
44
- return ((i = e.config) == null ? void 0 : i.ui) ?? null;
42
+ ui: (i) => {
43
+ var e;
44
+ return ((e = i.config) == null ? void 0 : e.ui) ?? null;
45
45
  },
46
46
  /**
47
47
  * Get the features configuration
48
48
  */
49
- features: (e) => {
50
- var i;
51
- return ((i = e.config) == null ? void 0 : i.features) ?? null;
49
+ features: (i) => {
50
+ var e;
51
+ return ((e = i.config) == null ? void 0 : e.features) ?? null;
52
52
  },
53
53
  /**
54
54
  * Get the blocks configuration
55
55
  */
56
- blocks: (e) => {
57
- var i;
58
- return ((i = e.config) == null ? void 0 : i.blocks) ?? null;
56
+ blocks: (i) => {
57
+ var e;
58
+ return ((e = i.config) == null ? void 0 : e.blocks) ?? null;
59
59
  },
60
60
  /**
61
61
  * Get the compiler configuration
62
62
  */
63
- compiler: (e) => {
64
- var i;
65
- return ((i = e.config) == null ? void 0 : i.compiler) ?? null;
63
+ compiler: (i) => {
64
+ var e;
65
+ return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
66
66
  },
67
67
  /**
68
68
  * Get the callbacks configuration
69
69
  */
70
- callbacks: (e) => {
71
- var i;
72
- return ((i = e.config) == null ? void 0 : i.callbacks) ?? null;
70
+ callbacks: (i) => {
71
+ var e;
72
+ return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
73
73
  },
74
74
  /**
75
75
  * Get the template ID
76
76
  */
77
- templateId: (e) => {
78
- var i, t;
79
- return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.templateId) ?? "";
77
+ templateId: (i) => {
78
+ var e, n;
79
+ return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.templateId) ?? "";
80
80
  },
81
81
  /**
82
82
  * Get the user ID
83
83
  */
84
- userId: (e) => {
85
- var i, t;
86
- return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.userId) ?? "";
84
+ userId: (i) => {
85
+ var e, n;
86
+ return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.userId) ?? "";
87
87
  },
88
88
  /**
89
89
  * Get the variation ID
90
90
  */
91
- variationId: (e) => {
92
- var i, t;
93
- return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.variationId) ?? "";
94
- },
95
- /**
96
- * Get the campaign ID
97
- */
98
- campaignId: (e) => {
99
- var i, t;
100
- return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.campaignId) ?? "";
101
- },
102
- /**
103
- * Get the template-library ID of the host template
104
- */
105
- templateLibraryId: (e) => {
106
- var i, t;
107
- return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.templateLibraryId) ?? "";
91
+ variationId: (i) => {
92
+ var e, n;
93
+ return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.variationId) ?? "";
108
94
  },
109
95
  /**
110
96
  * Get the partner name
111
97
  */
112
- partnerName: (e) => {
113
- var i, t;
114
- return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.name) ?? "";
98
+ partnerName: (i) => {
99
+ var e, n;
100
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.name) ?? "";
115
101
  },
116
102
  /**
117
103
  * Get the product type
118
104
  */
119
- productType: (e) => {
120
- var i, t;
121
- return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.productType) ?? 60;
105
+ productType: (i) => {
106
+ var e, n;
107
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.productType) ?? 60;
122
108
  },
123
109
  /**
124
110
  * Get the message type
125
111
  */
126
- messageType: (e) => {
127
- var i, t;
128
- return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.messageType) ?? 1;
112
+ messageType: (i) => {
113
+ var e, n;
114
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
129
115
  },
130
116
  /**
131
117
  * Get the username
132
118
  */
133
- username: (e) => {
134
- var i, t;
135
- return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.username) ?? "Guido User";
119
+ username: (i) => {
120
+ var e, n;
121
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.username) ?? "Guido User";
136
122
  },
137
123
  /**
138
124
  * Check if header should be shown
139
125
  */
140
- showHeader: (e) => {
141
- var i, t;
142
- return ((t = (i = e.config) == null ? void 0 : i.ui) == null ? void 0 : t.showHeader) ?? !0;
126
+ showHeader: (i) => {
127
+ var e, n;
128
+ return ((n = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : n.showHeader) ?? !0;
143
129
  },
144
130
  /**
145
131
  * Check if a specific feature is enabled.
@@ -147,18 +133,18 @@ const s = a("guido-config", {
147
133
  * flash on during loading, then disappear once config resolves.
148
134
  */
149
135
  // eslint-disable-next-line @stylistic/max-len
150
- isFeatureEnabled: (e) => (i) => {
151
- var t, n;
152
- return ((n = (t = e.config) == null ? void 0 : t.features) == null ? void 0 : n[i]) ?? !1;
136
+ isFeatureEnabled: (i) => (e) => {
137
+ var n, t;
138
+ return ((t = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : t[e]) ?? !1;
153
139
  }
154
140
  },
155
141
  actions: {
156
142
  /**
157
143
  * Initialize the config store with validated configuration
158
144
  */
159
- init(e) {
160
- const i = o(e);
161
- this.config = i, this.initialized = !0;
145
+ init(i) {
146
+ const e = o(i);
147
+ this.config = e, this.initialized = !0;
162
148
  },
163
149
  /**
164
150
  * Reset the config store
@@ -169,5 +155,5 @@ const s = a("guido-config", {
169
155
  }
170
156
  });
171
157
  export {
172
- s as useConfigStore
158
+ f as useConfigStore
173
159
  };
@@ -12,8 +12,7 @@ const t = () => ({
12
12
  versionHistoryOnboarding: t(),
13
13
  ampOnboarding: t(),
14
14
  itemsOnboarding: t(),
15
- recommendationStrategyOnboarding: t(),
16
- recommendationLegacyStrategyOnboarding: t()
15
+ recommendationStrategyOnboarding: t()
17
16
  },
18
17
  userModalState: {},
19
18
  isFetched: !1
@@ -50,10 +49,6 @@ const t = () => ({
50
49
  const { recommendationStrategyOnboarding: o } = n.onboardings;
51
50
  return o.config[o.cardIndex];
52
51
  },
53
- getRecommendationLegacyStrategyCurrentCard: (n) => {
54
- const { recommendationLegacyStrategyOnboarding: o } = n.onboardings;
55
- return o.config[o.cardIndex];
56
- },
57
52
  shouldShowOnboarding: (n) => (o) => {
58
53
  const i = n.userModalState.Guido;
59
54
  return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.1-beta.cb31236",
3
+ "version": "3.18.1-beta.d0bc5f3",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,18 +0,0 @@
1
- import s from "./LegacyStrategyUpdatedModal.vue2.js";
2
- /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var r = function() {
5
- var t = this, a = t._self._c, e = t._self._setupProxy;
6
- return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
7
- }, l = [], n = /* @__PURE__ */ o(
8
- s,
9
- r,
10
- l,
11
- !1,
12
- null,
13
- "da2225a1"
14
- );
15
- const m = n.exports;
16
- export {
17
- m as default
18
- };
@@ -1,25 +0,0 @@
1
- import { defineComponent as i, computed as s } from "vue";
2
- import p from "../../../wrappers/WpModal.vue.js";
3
- import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
- import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- const M = /* @__PURE__ */ i({
6
- __name: "LegacyStrategyUpdatedModal",
7
- setup(l) {
8
- const e = d(), t = g(), n = s(() => ({
9
- primaryButton: {
10
- type: "primary",
11
- labelText: e("action-builder.ok")
12
- }
13
- })), m = s(() => {
14
- var r;
15
- const { strategyId: a } = t.recommendationConfigs;
16
- return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
17
- }), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
18
- return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
19
- t.closeLegacyStrategyUpdatedModal();
20
- }, WpModal: p };
21
- }
22
- });
23
- export {
24
- M as default
25
- };
@@ -1,21 +0,0 @@
1
- import s from "./RecommendationLegacyStrategyOnboarding.vue2.js";
2
- /* empty css */
3
- import c from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var d = function() {
5
- var t, n, r, a, i;
6
- var o = this, g = o._self._c, e = o._self._setupProxy;
7
- return e.isVisible ? g(e.InOnboard, { key: "guido__recommendation-legacy-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (t = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__recommendation-legacy-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": e.onboardingStore.onboardings.recommendationLegacyStrategyOnboarding.config, "pointer-position": (r = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (a = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : i.top }, on: { close: function(p) {
8
- return e.onboardingStore.close(e.ONBOARDING_TYPE);
9
- }, nextButtonClick: e.handleNext } }) : o._e();
10
- }, m = [], l = /* @__PURE__ */ c(
11
- s,
12
- d,
13
- m,
14
- !1,
15
- null,
16
- "19d8cb42"
17
- );
18
- const f = l.exports;
19
- export {
20
- f as default
21
- };
@@ -1,46 +0,0 @@
1
- import { defineComponent as d, computed as g, watch as l } from "vue";
2
- import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
3
- import { useTranslations as p } from "../../../composables/useTranslations.js";
4
- import { ACADEMY_LINKS as u } from "../../../enums/academy.js";
5
- import { useOnboardingStore as y } from "../../../stores/onboarding.js";
6
- import { InOnboard as f } from "@useinsider/design-system-vue";
7
- const A = /* @__PURE__ */ d({
8
- __name: "RecommendationLegacyStrategyOnboarding",
9
- setup(O) {
10
- const n = "recommendationLegacyStrategyOnboarding", o = p(), t = y(), { getTopPosition: i } = b(), r = `<a href="${u.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${o("action-builder.visit-academy")}</a>`, a = () => [
11
- {
12
- classes: "guido-recommendation-legacy-strategy-onboarding",
13
- right: "40px",
14
- top: i(485),
15
- position: "Top Right",
16
- title: o("email-editor.onboarding-recommendation-strategy-legacy-title"),
17
- description: o("email-editor.onboarding-recommendation-strategy-legacy-description", {
18
- academyLink: r
19
- }),
20
- imageSource: "",
21
- backButtonClick: () => {
22
- },
23
- nextButtonType: "text",
24
- nextButtonText: o("action-builder.ok"),
25
- nextButtonClick: () => {
26
- t.close(n);
27
- }
28
- }
29
- ], s = g(
30
- () => t.onboardings.recommendationLegacyStrategyOnboarding.config.length > 0 && t.onboardings.recommendationLegacyStrategyOnboarding.isActive
31
- ), m = () => {
32
- var e, c;
33
- (c = (e = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : e.nextButtonClick) == null || c.call(e);
34
- };
35
- return l(
36
- () => t.isActive(n),
37
- (e) => {
38
- e && t.setConfig(n, a());
39
- },
40
- { immediate: !0 }
41
- ), { __sfc: !0, ONBOARDING_TYPE: n, trans: o, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: s, handleNext: m, InOnboard: f };
42
- }
43
- });
44
- export {
45
- A as default
46
- };
@@ -1,58 +0,0 @@
1
- import { useRecommendation as f } from "./useRecommendation.js";
2
- import { useToaster as S } from "./useToaster.js";
3
- import { useTranslations as I } from "./useTranslations.js";
4
- import { ToasterTypeOptions as C } from "../enums/toaster.js";
5
- import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
- import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
- import { useRecommendationExtensionStore as v } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { resolveMigrationTarget as b, buildLegacyMigrationPayload as R } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
- import { commitBlockChangeOutsidePanel as T } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
- import { useConfigStore as h } from "../stores/config.js";
11
- const V = () => {
12
- const t = v(), o = h(), { buildCampaignUrl: s } = f(), { showToaster: m } = S(), g = I();
13
- return { convertLegacyStrategy: async () => {
14
- const e = t.currentRecommendationId;
15
- if (e === null || !t.isLegacyStrategyBlock || t.legacyConversionLoading)
16
- return "";
17
- const { strategy: d, productIds: l, filters: y } = t.recommendationConfigs, n = b({
18
- campaignId: o.campaignId,
19
- templateLibraryId: o.templateLibraryId
20
- }), p = R({
21
- blockId: e,
22
- url: s(String(e)),
23
- campaignId: o.campaignId,
24
- variationId: o.variationId,
25
- strategy: d,
26
- productIds: l,
27
- filters: y,
28
- attributes: t.getFilterList,
29
- target: n
30
- });
31
- let r;
32
- try {
33
- r = await t.convertLegacyStrategy(p, n);
34
- } catch (a) {
35
- return console.error("[useLegacyStrategyConversion] migration failed", a), m({
36
- type: C.Error,
37
- message: g("email-editor.legacy-strategy-update-failed")
38
- }), "";
39
- }
40
- const i = t.currentRecommendationId === e;
41
- if (i)
42
- try {
43
- await t.fetchRecommendationProducts();
44
- } catch (a) {
45
- console.error("[useLegacyStrategyConversion] product refetch failed", a);
46
- }
47
- const c = t.blockStates[e], { size: u } = c.recommendationConfigs;
48
- return T(
49
- e,
50
- { strategyId: r, size: u, configVersion: L },
51
- c.recommendationProducts,
52
- "Converted legacy recommendation strategy"
53
- ), i && t.openLegacyStrategyUpdatedModal(), r;
54
- } };
55
- };
56
- export {
57
- V as useLegacyStrategyConversion
58
- };
@@ -1,72 +0,0 @@
1
- import { OP_ANY_OF as p } from "../../../../enums/extensions/recommendationBlock.js";
2
- import "../constants/selectors.js";
3
- import { CURRENT_CONFIG_VERSION as l } from "../constants/defaultConfig.js";
4
- import { parseTagList as I } from "./filterUtil.js";
5
- import { sanitizeProductIds as N } from "./productIds.js";
6
- const b = "String", f = "manualMerchandising";
7
- function A({ strategyId: t, nodeConfigVersion: o }) {
8
- return !t && o < l;
9
- }
10
- const m = (t) => {
11
- const o = String(t ?? "").trim();
12
- return /^[1-9]\d*$/.test(o) ? o : null;
13
- };
14
- function O({ campaignId: t, templateLibraryId: o }) {
15
- if (m(t))
16
- return { scope: "campaign" };
17
- const e = m(o);
18
- return e ? { scope: "template", templateId: e } : { scope: "campaign" };
19
- }
20
- const d = (t) => t === "|" ? "or" : "and", y = (t, o) => {
21
- var e;
22
- return {
23
- conditionLogic: d(t.innerGroupOperator),
24
- attribute: {
25
- attributeName: t.attribute,
26
- attributeType: ((e = o.find((r) => r.value === t.attribute)) == null ? void 0 : e.type) || b
27
- },
28
- operator: { operator: t.operator === p ? "=" : t.operator },
29
- value: t.operator === p ? I(t.value).join(p) : t.value
30
- };
31
- };
32
- function L(t, o) {
33
- const e = /* @__PURE__ */ new Map();
34
- return t.filter((r) => r.isValid).forEach((r) => {
35
- e.set(r.filterGroup, [...e.get(r.filterGroup) ?? [], r]);
36
- }), [...e.keys()].sort((r, n) => r - n).map((r) => {
37
- const n = [...e.get(r) ?? []].sort((i, a) => i.filterNumber - a.filterNumber);
38
- return {
39
- groupLogic: d(n[0].outerGroupOperator),
40
- conditionList: n.map((i) => y(i, o))
41
- };
42
- });
43
- }
44
- function S({
45
- blockId: t,
46
- url: o,
47
- campaignId: e,
48
- variationId: r,
49
- strategy: n,
50
- productIds: i,
51
- filters: a,
52
- attributes: g,
53
- target: u
54
- }) {
55
- const s = L(a, g), c = n === f ? N(i).split(",").filter(Boolean) : [];
56
- return {
57
- ...u.scope === "template" ? { templateId: Number.parseInt(u.templateId) } : {
58
- campaignId: Number.parseInt(e) || 0,
59
- variationId: Number.parseInt(r) || 0
60
- },
61
- blockId: String(t),
62
- url: o,
63
- ...s.length ? { filters: s } : {},
64
- ...c.length ? { productIds: c } : {}
65
- };
66
- }
67
- export {
68
- S as buildLegacyMigrationPayload,
69
- A as isLegacyStrategyConfig,
70
- O as resolveMigrationTarget,
71
- L as toMigrationFilterGroups
72
- };