@useinsider/guido 3.18.1-beta.e9a6c91 → 3.18.1-beta.fefef3c

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 (48) 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 +83 -72
  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 +24 -22
  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/composables/useCustomInterfaceAppearance.js +46 -42
  14. package/dist/composables/useHtmlValidator.js +79 -84
  15. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  16. package/dist/composables/useRecommendation.js +18 -21
  17. package/dist/enums/extensions/recommendationBlock.js +25 -29
  18. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  19. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +72 -71
  20. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +70 -40
  21. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +45 -44
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +108 -138
  23. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +72 -0
  24. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
  25. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  26. package/dist/guido.css +1 -1
  27. package/dist/services/recommendationApi.js +93 -84
  28. package/dist/src/@types/config/schemas.d.ts +16 -0
  29. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  30. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  31. package/dist/src/composables/useConfig.d.ts +4 -0
  32. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  33. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -2
  34. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -0
  35. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -0
  36. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +54 -50
  37. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +44 -0
  38. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  39. package/dist/src/services/recommendationApi.d.ts +2 -1
  40. package/dist/src/stores/config.d.ts +322 -0
  41. package/dist/src/stores/onboarding.d.ts +421 -0
  42. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  43. package/dist/static/assets/icons/line-info.svg.js +5 -0
  44. package/dist/static/styles/components/recommendation-strategy.css.js +74 -43
  45. package/dist/stores/config.js +74 -60
  46. package/dist/stores/onboarding.js +6 -1
  47. package/dist/utils/templatePreparation.js +50 -50
  48. package/package.json +1 -1
@@ -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,43 +113,6 @@ const n = `.strategy-control-header {
68
113
  line-height: 24px;
69
114
  }
70
115
 
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
- /* Sized and spaced to sit where the real Change / Remove buttons land, so the
94
- panel does not shift when the skeleton is retired. */
95
- .guido-skeleton--strategy-action {
96
- width: 88px;
97
- height: 16px;
98
- }
99
-
100
- .guido-skeleton--strategy-action + .guido-skeleton--strategy-action {
101
- margin-left: 24px;
102
- }
103
-
104
- [data-strategy-loading-state] .guido-skeleton {
105
- display: block;
106
- }
107
-
108
116
  .strategy-control-actions {
109
117
  display: flex;
110
118
  align-items: center;
@@ -151,6 +159,15 @@ const n = `.strategy-control-header {
151
159
  mask-image: var(--guido-icon-line-plus);
152
160
  }
153
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,
154
171
  .strategy-control-action--change {
155
172
  color: var(--guido-color-primary-500);
156
173
  }
@@ -163,24 +180,38 @@ const n = `.strategy-control-header {
163
180
  text-decoration: underline;
164
181
  }
165
182
 
166
- .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,
167
191
  .recommendation-controls-container.strategy-block .product-count-control-container,
168
192
  .recommendation-controls-container.strategy-block .algorithm-control-container,
169
193
  .recommendation-controls-container.strategy-block .filters-control-container,
170
- .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 {
171
199
  display: none;
172
200
  }
173
201
 
174
- .recommendation-controls-container.strategy-block {
202
+ .recommendation-controls-container.strategy-block,
203
+ .recommendation-controls-container.legacy-strategy-block {
175
204
  display: flex;
176
205
  flex-direction: column;
177
206
  }
178
207
 
179
- .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 {
180
210
  order: 1;
181
211
  }
182
212
 
183
- .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 {
184
215
  order: 2;
185
216
  }
186
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,31 +1,31 @@
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 { CURRENT_CONFIG_VERSION as U, DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { mapLegacyStrategy as x } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
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 d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
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 _ } from "../stores/editor.js";
11
- import { useUnsubscribeStore as O } from "../stores/unsubscribe.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 _ } from "../stores/unsubscribe.js";
12
12
  import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
- function B(m) {
13
+ function O(m) {
14
14
  const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
15
  return i.forEach((s) => {
16
- const r = s.getAttribute(A.PAGE_LIST);
17
- r && t.push(...L(r));
16
+ const o = s.getAttribute(A.PAGE_LIST);
17
+ o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function G(m) {
20
+ async function M(m) {
21
21
  const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (n.length === 0)
23
23
  return;
24
- const i = T();
24
+ const i = C();
25
25
  n.forEach((t) => {
26
- var l, g, f, c, y;
27
- const s = t.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
28
- if (!Number.isFinite(r))
26
+ var r, l, g, f, c;
27
+ const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
28
+ if (!Number.isFinite(o))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
31
31
  if (!p)
@@ -38,11 +38,11 @@ async function G(m) {
38
38
  }
39
39
  if (!e || typeof e != "object" || Array.isArray(e))
40
40
  return;
41
- const b = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
41
+ const h = {
42
42
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
43
43
  // already-saved blocks that never re-run the migrator don't emit a
44
44
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
45
- strategy: x(e.strategy) || (b ? "" : a.strategy),
45
+ strategy: L(e.strategy) || a.strategy,
46
46
  strategyId: e.strategyId ?? a.strategyId,
47
47
  language: e.language ?? a.language,
48
48
  size: e.size ?? a.size,
@@ -51,13 +51,13 @@ async function G(m) {
51
51
  productIds: e.productIds ?? [...a.productIds],
52
52
  filters: e.filters ?? [...a.filters],
53
53
  shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
54
- currencyCode: ((l = e.currency) == null ? void 0 : l.code) ?? d.code,
55
- currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? d.alignment,
56
- currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? d.decimalCount,
57
- currencyDecimalSeparator: ((c = e.currency) == null ? void 0 : c.decimalSeparator) ?? d.decimalSeparator,
58
- currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
54
+ currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
55
+ currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
56
+ currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
57
+ currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
58
+ currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
59
59
  };
60
- i.seedBlockUrlConfig(r, o);
60
+ i.seedBlockUrlConfig(o, h);
61
61
  });
62
62
  try {
63
63
  await i.fetchRecommendationCreateData();
@@ -68,51 +68,51 @@ async function G(m) {
68
68
  );
69
69
  }
70
70
  }
71
- const ee = () => {
72
- const m = z(), u = _(), n = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
71
+ const Z = () => {
72
+ const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
73
73
  return {
74
74
  prepareTemplateDetails: async () => {
75
- let { html: o, css: l, syncModulesIds: g = [] } = await t();
75
+ let { html: r, css: l, syncModulesIds: g = [] } = await t();
76
76
  if (e("linkTrackingIds"))
77
77
  try {
78
- const { html: h, changed: P, nextSeq: H } = v(o, u.trackIdSessionFloor);
79
- u.trackIdSessionFloor = H, P && (o = h, await s(h, l));
80
- } catch (h) {
81
- console.error("Tracking-id step failed, saving anyway:", h);
78
+ const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
79
+ u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
80
+ } catch (S) {
81
+ console.error("Tracking-id step failed, saving anyway:", S);
82
82
  }
83
- const { html: f, ampHtml: c = "", ampErrors: y = [] } = await i({
83
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
84
84
  minimize: !0,
85
85
  resetDataSavedFlag: !1
86
86
  });
87
- n.selectedUnsubscribePages.length && await n.fetchTemplates(), await G(o);
88
- const { compiledHtml: I, stats: S, appliedRules: E } = r(f), w = c && p(c).compiledHtml, D = m.getSelectedDynamicContentList, F = T(), C = B(o);
87
+ n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
88
+ const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
89
89
  return console.debug("HTML Compilation Stats:", {
90
- originalSize: S.originalSize,
91
- compiledSize: S.compiledSize,
92
- reduction: `${S.reductionPercentage.toFixed(2)}%`,
93
- appliedRules: E,
94
- executionTime: `${S.executionTime.toFixed(2)}ms`
90
+ originalSize: y.originalSize,
91
+ compiledSize: y.compiledSize,
92
+ reduction: `${y.reductionPercentage.toFixed(2)}%`,
93
+ appliedRules: w,
94
+ executionTime: `${y.executionTime.toFixed(2)}ms`
95
95
  }), {
96
- dynamicContentList: D,
96
+ dynamicContentList: E,
97
97
  compiledHtml: I,
98
- rawHtml: o,
98
+ rawHtml: r,
99
99
  css: l,
100
- ampHtml: w,
101
- ampErrors: y,
100
+ ampHtml: D,
101
+ ampErrors: T,
102
102
  modules: g.map(Number),
103
103
  recommendation: {
104
- campaignUrls: F.recommendationCampaignUrls,
104
+ campaignUrls: P.recommendationCampaignUrls,
105
105
  configs: {}
106
106
  },
107
107
  unsubscribe: {
108
- status: C.length > 0,
109
- config: C
108
+ status: b.length > 0,
109
+ config: b
110
110
  }
111
111
  };
112
112
  }
113
113
  };
114
114
  };
115
115
  export {
116
- B as getHtmlReferencedUnsubscribePages,
117
- ee as useTemplatePreparation
116
+ O as getHtmlReferencedUnsubscribePages,
117
+ Z as useTemplatePreparation
118
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.1-beta.e9a6c91",
3
+ "version": "3.18.1-beta.fefef3c",
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",