@useinsider/guido 3.18.2-beta.45f708c → 3.18.2-beta.4d2b065

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +21 -3
  2. package/dist/@types/config/schemas.js +59 -51
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +72 -70
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -9
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -66
  7. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +40 -24
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -26
  11. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  12. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  13. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +3 -3
  14. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +20 -21
  15. package/dist/composables/useCustomInterfaceAppearance.js +47 -53
  16. package/dist/composables/useHtmlValidator.js +79 -84
  17. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  18. package/dist/composables/useRecommendation.js +35 -40
  19. package/dist/composables/useStripo.js +30 -30
  20. package/dist/enums/extensions/recommendationBlock.js +41 -39
  21. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  22. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
  23. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +80 -84
  24. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +94 -82
  25. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +97 -96
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +144 -179
  27. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  28. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
  29. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  30. package/dist/guido.css +1 -1
  31. package/dist/services/recommendationApi.js +46 -37
  32. package/dist/src/@types/config/schemas.d.ts +16 -0
  33. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  34. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  35. package/dist/src/composables/useConfig.d.ts +4 -0
  36. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  37. package/dist/src/enums/extensions/recommendationBlock.d.ts +5 -3
  38. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  39. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  40. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
  41. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -8
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +6 -7
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +70 -76
  44. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  45. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  46. package/dist/src/services/recommendationApi.d.ts +2 -1
  47. package/dist/src/stores/config.d.ts +322 -0
  48. package/dist/src/stores/onboarding.d.ts +421 -0
  49. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  50. package/dist/static/assets/icons/line-info.svg.js +5 -0
  51. package/dist/static/styles/components/recommendation-strategy.css.js +74 -39
  52. package/dist/stores/config.js +74 -60
  53. package/dist/stores/onboarding.js +6 -1
  54. package/dist/utils/templatePreparation.js +55 -55
  55. package/package.json +5 -5
  56. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
  57. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
  58. package/dist/static/styles/components/skeleton.css.js +0 -23
@@ -26,6 +26,40 @@ 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
+
29
63
  .recommendation-controls-container .container.strategy-control-cta-row {
30
64
  grid-template-columns: repeat(2, minmax(0, 180px));
31
65
  justify-content: start;
@@ -49,8 +83,11 @@ const n = `.strategy-control-header {
49
83
  white-space: nowrap;
50
84
  }
51
85
 
52
- .strategy-control-cta.primary > .button {
86
+ .strategy-control-cta.primary > .button:disabled,
87
+ .strategy-control-cta.primary > .button.disabled {
88
+ opacity: 1;
53
89
  color: var(--guido-color-gray-800);
90
+ cursor: default;
54
91
  }
55
92
 
56
93
  .strategy-control-name-band {
@@ -61,6 +98,14 @@ const n = `.strategy-control-header {
61
98
  background-color: var(--guido-color-gray-0);
62
99
  }
63
100
 
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
+
64
109
  .strategy-control-name {
65
110
  color: var(--guido-color-gray-800);
66
111
  font-size: 15px;
@@ -68,39 +113,6 @@ const n = `.strategy-control-header {
68
113
  line-height: 24px;
69
114
  }
70
115
 
71
- /* Each skeleton mirrors the footprint of the element it stands in for, so retiring
72
- the loading state does not shift the panel. */
73
- .guido-skeleton--strategy-title {
74
- width: 366px;
75
- height: 38px;
76
- }
77
-
78
- .guido-skeleton--strategy-description {
79
- width: 366px;
80
- height: 48px;
81
- }
82
-
83
- .guido-skeleton--strategy-cta {
84
- width: 175px;
85
- height: 40px;
86
- }
87
-
88
- .guido-skeleton--strategy-name {
89
- width: 398px;
90
- height: 48px;
91
- }
92
-
93
- .strategy-control-skeleton-row {
94
- display: flex;
95
- gap: 16px;
96
- padding: 0 16px 16px;
97
- }
98
-
99
- [data-strategy-loading-state] .guido-skeleton {
100
- display: block;
101
- }
102
-
103
-
104
116
  .strategy-control-actions {
105
117
  display: flex;
106
118
  align-items: center;
@@ -147,6 +159,15 @@ const n = `.strategy-control-header {
147
159
  mask-image: var(--guido-icon-line-plus);
148
160
  }
149
161
 
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,
150
171
  .strategy-control-action--change {
151
172
  color: var(--guido-color-primary-500);
152
173
  }
@@ -159,24 +180,38 @@ const n = `.strategy-control-header {
159
180
  text-decoration: underline;
160
181
  }
161
182
 
162
- .recommendation-controls-container:not(.strategy-block) .strategy-control-container,
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,
163
191
  .recommendation-controls-container.strategy-block .product-count-control-container,
164
192
  .recommendation-controls-container.strategy-block .algorithm-control-container,
165
193
  .recommendation-controls-container.strategy-block .filters-control-container,
166
- .recommendation-controls-container.strategy-block .shuffle-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 {
167
199
  display: none;
168
200
  }
169
201
 
170
- .recommendation-controls-container.strategy-block {
202
+ .recommendation-controls-container.strategy-block,
203
+ .recommendation-controls-container.legacy-strategy-block {
171
204
  display: flex;
172
205
  flex-direction: column;
173
206
  }
174
207
 
175
- .recommendation-controls-container.strategy-block .price-placement-control-container {
208
+ .recommendation-controls-container.strategy-block .price-placement-control-container,
209
+ .recommendation-controls-container.legacy-strategy-block .price-placement-control-container {
176
210
  order: 1;
177
211
  }
178
212
 
179
- .recommendation-controls-container.strategy-block .product-layout-control-container {
213
+ .recommendation-controls-container.strategy-block .product-layout-control-container,
214
+ .recommendation-controls-container.legacy-strategy-block .product-layout-control-container {
180
215
  order: 2;
181
216
  }
182
217
  `;
@@ -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 r } from "pinia";
5
- const f = r("guido-config", {
4
+ import { defineStore as a } from "pinia";
5
+ const s = a("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -11,121 +11,135 @@ const f = r("guido-config", {
11
11
  /**
12
12
  * Get the identity configuration
13
13
  */
14
- identity: (i) => {
15
- var e;
16
- return ((e = i.config) == null ? void 0 : e.identity) ?? null;
14
+ identity: (e) => {
15
+ var i;
16
+ return ((i = e.config) == null ? void 0 : i.identity) ?? null;
17
17
  },
18
18
  /**
19
19
  * Get the partner configuration
20
20
  */
21
- partner: (i) => {
22
- var e;
23
- return ((e = i.config) == null ? void 0 : e.partner) ?? null;
21
+ partner: (e) => {
22
+ var i;
23
+ return ((i = e.config) == null ? void 0 : i.partner) ?? null;
24
24
  },
25
25
  /**
26
26
  * Get the template configuration
27
27
  */
28
- template: (i) => {
29
- var e;
30
- return ((e = i.config) == null ? void 0 : e.template) ?? null;
28
+ template: (e) => {
29
+ var i;
30
+ return ((i = e.config) == null ? void 0 : i.template) ?? null;
31
31
  },
32
32
  /**
33
33
  * Get the editor configuration
34
34
  */
35
- editor: (i) => {
36
- var e;
37
- return ((e = i.config) == null ? void 0 : e.editor) ?? null;
35
+ editor: (e) => {
36
+ var i;
37
+ return ((i = e.config) == null ? void 0 : i.editor) ?? null;
38
38
  },
39
39
  /**
40
40
  * Get the UI configuration
41
41
  */
42
- ui: (i) => {
43
- var e;
44
- return ((e = i.config) == null ? void 0 : e.ui) ?? null;
42
+ ui: (e) => {
43
+ var i;
44
+ return ((i = e.config) == null ? void 0 : i.ui) ?? null;
45
45
  },
46
46
  /**
47
47
  * Get the features configuration
48
48
  */
49
- features: (i) => {
50
- var e;
51
- return ((e = i.config) == null ? void 0 : e.features) ?? null;
49
+ features: (e) => {
50
+ var i;
51
+ return ((i = e.config) == null ? void 0 : i.features) ?? null;
52
52
  },
53
53
  /**
54
54
  * Get the blocks configuration
55
55
  */
56
- blocks: (i) => {
57
- var e;
58
- return ((e = i.config) == null ? void 0 : e.blocks) ?? null;
56
+ blocks: (e) => {
57
+ var i;
58
+ return ((i = e.config) == null ? void 0 : i.blocks) ?? null;
59
59
  },
60
60
  /**
61
61
  * Get the compiler configuration
62
62
  */
63
- compiler: (i) => {
64
- var e;
65
- return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
63
+ compiler: (e) => {
64
+ var i;
65
+ return ((i = e.config) == null ? void 0 : i.compiler) ?? null;
66
66
  },
67
67
  /**
68
68
  * Get the callbacks configuration
69
69
  */
70
- callbacks: (i) => {
71
- var e;
72
- return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
70
+ callbacks: (e) => {
71
+ var i;
72
+ return ((i = e.config) == null ? void 0 : i.callbacks) ?? null;
73
73
  },
74
74
  /**
75
75
  * Get the template ID
76
76
  */
77
- templateId: (i) => {
78
- var e, n;
79
- return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.templateId) ?? "";
77
+ templateId: (e) => {
78
+ var i, t;
79
+ return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.templateId) ?? "";
80
80
  },
81
81
  /**
82
82
  * Get the user ID
83
83
  */
84
- userId: (i) => {
85
- var e, n;
86
- return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.userId) ?? "";
84
+ userId: (e) => {
85
+ var i, t;
86
+ return ((t = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : t.userId) ?? "";
87
87
  },
88
88
  /**
89
89
  * Get the variation ID
90
90
  */
91
- variationId: (i) => {
92
- var e, n;
93
- return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.variationId) ?? "";
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) ?? "";
94
108
  },
95
109
  /**
96
110
  * Get the partner name
97
111
  */
98
- partnerName: (i) => {
99
- var e, n;
100
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.name) ?? "";
112
+ partnerName: (e) => {
113
+ var i, t;
114
+ return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.name) ?? "";
101
115
  },
102
116
  /**
103
117
  * Get the product type
104
118
  */
105
- productType: (i) => {
106
- var e, n;
107
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.productType) ?? 60;
119
+ productType: (e) => {
120
+ var i, t;
121
+ return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.productType) ?? 60;
108
122
  },
109
123
  /**
110
124
  * Get the message type
111
125
  */
112
- messageType: (i) => {
113
- var e, n;
114
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
126
+ messageType: (e) => {
127
+ var i, t;
128
+ return ((t = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : t.messageType) ?? 1;
115
129
  },
116
130
  /**
117
131
  * Get the username
118
132
  */
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";
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";
122
136
  },
123
137
  /**
124
138
  * Check if header should be shown
125
139
  */
126
- showHeader: (i) => {
127
- var e, n;
128
- return ((n = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : n.showHeader) ?? !0;
140
+ showHeader: (e) => {
141
+ var i, t;
142
+ return ((t = (i = e.config) == null ? void 0 : i.ui) == null ? void 0 : t.showHeader) ?? !0;
129
143
  },
130
144
  /**
131
145
  * Check if a specific feature is enabled.
@@ -133,18 +147,18 @@ const f = r("guido-config", {
133
147
  * flash on during loading, then disappear once config resolves.
134
148
  */
135
149
  // eslint-disable-next-line @stylistic/max-len
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;
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;
139
153
  }
140
154
  },
141
155
  actions: {
142
156
  /**
143
157
  * Initialize the config store with validated configuration
144
158
  */
145
- init(i) {
146
- const e = o(i);
147
- this.config = e, this.initialized = !0;
159
+ init(e) {
160
+ const i = o(e);
161
+ this.config = i, this.initialized = !0;
148
162
  },
149
163
  /**
150
164
  * Reset the config store
@@ -155,5 +169,5 @@ const f = r("guido-config", {
155
169
  }
156
170
  });
157
171
  export {
158
- f as useConfigStore
172
+ s as useConfigStore
159
173
  };
@@ -12,7 +12,8 @@ const t = () => ({
12
12
  versionHistoryOnboarding: t(),
13
13
  ampOnboarding: t(),
14
14
  itemsOnboarding: t(),
15
- recommendationStrategyOnboarding: t()
15
+ recommendationStrategyOnboarding: t(),
16
+ recommendationLegacyStrategyOnboarding: t()
16
17
  },
17
18
  userModalState: {},
18
19
  isFetched: !1
@@ -49,6 +50,10 @@ const t = () => ({
49
50
  const { recommendationStrategyOnboarding: o } = n.onboardings;
50
51
  return o.config[o.cardIndex];
51
52
  },
53
+ getRecommendationLegacyStrategyCurrentCard: (n) => {
54
+ const { recommendationLegacyStrategyOnboarding: o } = n.onboardings;
55
+ return o.config[o.cardIndex];
56
+ },
52
57
  shouldShowOnboarding: (n) => (o) => {
53
58
  const i = n.userModalState.Guido;
54
59
  return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
@@ -1,32 +1,32 @@
1
- import { useActionsApi as R } from "../composables/useActionsApi.js";
2
- import { useConfig as k } from "../composables/useConfig.js";
3
- import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
4
- import { RRS_CONFIG_VERSION as U, DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as I } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { mapLegacyStrategy as x } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
- import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
- import { parsePageList as L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
- import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
- import { useEditorStore as O } from "../stores/editor.js";
11
- import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
- import { isPlainObject as v } from "./genericUtil.js";
13
- import { assignTrackingIds as B } from "./linkTrackingIds.js";
14
- function G(l) {
15
- const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
16
- return i.forEach((s) => {
17
- const r = s.getAttribute(A.PAGE_LIST);
18
- r && t.push(...L(r));
1
+ import { useActionsApi as k } from "../composables/useActionsApi.js";
2
+ import { useConfig as U } from "../composables/useConfig.js";
3
+ import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
+ import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
+ import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
+ import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
+ import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
+ import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as z } from "../stores/editor.js";
11
+ import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
12
+ import { isPlainObject as _ } from "./genericUtil.js";
13
+ import { assignTrackingIds as v } from "./linkTrackingIds.js";
14
+ function M(l) {
15
+ const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), t = [];
16
+ return i.forEach((c) => {
17
+ const o = c.getAttribute(T.PAGE_LIST);
18
+ o && t.push(...R(o));
19
19
  }), [...new Set(t)];
20
20
  }
21
- async function M(l) {
21
+ async function q(l) {
22
22
  const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
23
23
  if (a.length === 0)
24
24
  return;
25
- const i = I();
25
+ const i = A();
26
26
  a.forEach((t) => {
27
- var d, g, f, c, y, S;
28
- const s = t.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
29
- if (!Number.isFinite(r))
27
+ var r, d, g, f, s, y;
28
+ const c = t.getAttribute("recommendation-id"), o = c ? Number(c) : NaN;
29
+ if (!Number.isFinite(o))
30
30
  return;
31
31
  const p = t.getAttribute("esd-ext-config");
32
32
  if (!p)
@@ -37,13 +37,13 @@ async function M(l) {
37
37
  } catch {
38
38
  return;
39
39
  }
40
- if (!v(e))
40
+ if (!_(e))
41
41
  return;
42
- const C = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
42
+ const b = {
43
43
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
44
44
  // already-saved blocks that never re-run the migrator don't emit a
45
45
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
46
- strategy: x(e.strategy) || (C ? "" : n.strategy),
46
+ strategy: L(e.strategy) || n.strategy,
47
47
  strategyId: e.strategyId ?? n.strategyId,
48
48
  language: e.language ?? n.language,
49
49
  size: e.size ?? n.size,
@@ -52,14 +52,14 @@ async function M(l) {
52
52
  productIds: e.productIds ?? [...n.productIds],
53
53
  filters: e.filters ?? [...n.filters],
54
54
  shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
55
- currencyCode: ((d = e.currency) == null ? void 0 : d.code) ?? m.code,
56
- currencySymbol: ((g = e.currency) == null ? void 0 : g.symbol) ?? m.symbol,
57
- currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? m.alignment,
58
- currencyDecimalCount: ((c = e.currency) == null ? void 0 : c.decimalCount) ?? m.decimalCount,
59
- currencyDecimalSeparator: ((y = e.currency) == null ? void 0 : y.decimalSeparator) ?? m.decimalSeparator,
60
- currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? m.thousandSeparator
55
+ currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? m.code,
56
+ currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
57
+ currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
58
+ currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
59
+ currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
60
+ currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
61
61
  };
62
- i.seedBlockUrlConfig(r, o);
62
+ i.seedBlockUrlConfig(o, b);
63
63
  });
64
64
  try {
65
65
  await i.fetchRecommendationCreateData();
@@ -70,51 +70,51 @@ async function M(l) {
70
70
  );
71
71
  }
72
72
  }
73
- const re = () => {
74
- const l = z(), u = O(), a = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
73
+ const te = () => {
74
+ const l = N(), u = z(), a = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: c } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
75
75
  return {
76
76
  prepareTemplateDetails: async () => {
77
- let { html: o, css: d, syncModulesIds: g = [] } = await t();
77
+ let { html: r, css: d, syncModulesIds: g = [] } = await t();
78
78
  if (e("linkTrackingIds"))
79
79
  try {
80
- const { html: b, changed: F, nextSeq: H } = B(o, u.trackIdSessionFloor);
81
- u.trackIdSessionFloor = H, F && (o = b, await s(b, d));
82
- } catch (b) {
83
- console.error("Tracking-id step failed, saving anyway:", b);
80
+ const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
81
+ u.trackIdSessionFloor = H, F && (r = h, await c(h, d));
82
+ } catch (h) {
83
+ console.error("Tracking-id step failed, saving anyway:", h);
84
84
  }
85
- const { html: f, ampHtml: c = "", ampErrors: y = [] } = await i({
85
+ const { html: f, ampHtml: s = "", ampErrors: y = [] } = await i({
86
86
  minimize: !0,
87
87
  resetDataSavedFlag: !1
88
88
  });
89
- a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(o);
90
- const { compiledHtml: S, stats: h, appliedRules: w } = r(f), D = c && p(c).compiledHtml, E = l.getSelectedDynamicContentList, P = I(), T = G(o);
89
+ a.selectedUnsubscribePages.length && await a.fetchTemplates(), await q(r);
90
+ const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, P = l.getSelectedDynamicContentList, E = A(), C = M(r);
91
91
  return console.debug("HTML Compilation Stats:", {
92
- originalSize: h.originalSize,
93
- compiledSize: h.compiledSize,
94
- reduction: `${h.reductionPercentage.toFixed(2)}%`,
92
+ originalSize: S.originalSize,
93
+ compiledSize: S.compiledSize,
94
+ reduction: `${S.reductionPercentage.toFixed(2)}%`,
95
95
  appliedRules: w,
96
- executionTime: `${h.executionTime.toFixed(2)}ms`
96
+ executionTime: `${S.executionTime.toFixed(2)}ms`
97
97
  }), {
98
- dynamicContentList: E,
99
- compiledHtml: S,
100
- rawHtml: o,
98
+ dynamicContentList: P,
99
+ compiledHtml: I,
100
+ rawHtml: r,
101
101
  css: d,
102
102
  ampHtml: D,
103
103
  ampErrors: y,
104
104
  modules: g.map(Number),
105
105
  recommendation: {
106
- campaignUrls: P.recommendationCampaignUrls,
106
+ campaignUrls: E.recommendationCampaignUrls,
107
107
  configs: {}
108
108
  },
109
109
  unsubscribe: {
110
- status: T.length > 0,
111
- config: T
110
+ status: C.length > 0,
111
+ config: C
112
112
  }
113
113
  };
114
114
  }
115
115
  };
116
116
  };
117
117
  export {
118
- G as getHtmlReferencedUnsubscribePages,
119
- re as useTemplatePreparation
118
+ M as getHtmlReferencedUnsubscribePages,
119
+ te as useTemplatePreparation
120
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.2-beta.45f708c",
3
+ "version": "3.18.2-beta.4d2b065",
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",
@@ -77,7 +77,7 @@
77
77
  "@typescript-eslint/parser": "7.18.0",
78
78
  "@useinsider/eslint-config": "1.5.3",
79
79
  "@vitejs/plugin-vue2": "2.3.1",
80
- "@vitest/coverage-v8": "2.1.9",
80
+ "@vitest/coverage-v8": "4.1.11",
81
81
  "eslint": "8.57.1",
82
82
  "eslint-config-airbnb-base": "15.0.0",
83
83
  "eslint-config-airbnb-typescript": "18.0.0",
@@ -90,17 +90,17 @@
90
90
  "happy-dom": "15.11.7",
91
91
  "husky": "9.1.7",
92
92
  "msw": "2.10.3",
93
- "nyc": "17.1.0",
93
+ "nyc": "18.0.0",
94
94
  "sass": "1.69.7",
95
95
  "typescript": "5.5.4",
96
96
  "typescript-eslint": "8.26.0",
97
97
  "vite-plugin-dts": "4.5.4",
98
98
  "vite-plugin-istanbul": "7.0.0",
99
- "vitest": "2.1.9",
99
+ "vitest": "4.1.11",
100
100
  "vue-tsc": "2.2.10"
101
101
  },
102
102
  "overrides": {
103
- "axios": "1.8.2",
103
+ "axios": "1.20.0",
104
104
  "flatted": "3.4.2",
105
105
  "micromatch": "4.0.8",
106
106
  "path-to-regexp": "6.3.0"
@@ -1,24 +0,0 @@
1
- import { useRecommendationExtensionStore as s } from "../store/recommendation.js";
2
- import { commitBlockChangeOutsidePanel as d } from "./nodeConfigWriter.js";
3
- async function u(e, n) {
4
- const t = s(), o = t.blockStates[e];
5
- if (!o)
6
- return !1;
7
- const { strategyId: a, strategy: c, size: i } = o.recommendationConfigs;
8
- if (t.currentRecommendationId === e)
9
- try {
10
- await t.fetchRecommendationProducts();
11
- } catch (m) {
12
- console.error("[recommendation] product refetch after a strategy change failed", m);
13
- }
14
- const r = d(
15
- e,
16
- { strategyId: a, strategy: c, size: i },
17
- o.recommendationProducts,
18
- n
19
- );
20
- return r || console.error("[recommendation] strategy change did not reach a node", { blockId: e }), r;
21
- }
22
- export {
23
- u as commitStrategyChange
24
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * Writes a strategy change and its products straight to the document, without the settings panel.
3
- *
4
- * Every entry point is host-rendered UI outside `ui-editor`, and none of them can rely on the
5
- * panel control: opening the strategy page deselects the block, so by the time the user comes back
6
- * and presses Assign the control — and with it the subscription that does the node write, the
7
- * product fetch and the repaint — is gone. The assignment then reaches Pinia and nothing else
8
- * (SD-149916).
9
- *
10
- * Call AFTER the store change (`assignStrategy` / `removeStrategy`).
11
- * @param description - labels the undo entry
12
- * @returns whether the write reached a node
13
- */
14
- export declare function commitStrategyChange(blockId: number, description: string): Promise<boolean>;