@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.
- package/README.md +21 -3
- package/dist/@types/config/schemas.js +59 -51
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +72 -70
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -9
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +83 -72
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +24 -22
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -26
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
- package/dist/composables/useCustomInterfaceAppearance.js +46 -42
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useLegacyStrategyConversion.js +61 -0
- package/dist/composables/useRecommendation.js +18 -21
- package/dist/enums/extensions/recommendationBlock.js +25 -29
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +72 -71
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +70 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +45 -44
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +108 -138
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +72 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +93 -84
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +54 -50
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +44 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/services/recommendationApi.d.ts +2 -1
- package/dist/src/stores/config.d.ts +322 -0
- package/dist/src/stores/onboarding.d.ts +421 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +74 -43
- package/dist/stores/config.js +74 -60
- package/dist/stores/onboarding.js +6 -1
- package/dist/utils/templatePreparation.js +50 -50
- 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
|
-
.
|
|
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
|
`;
|
package/dist/stores/config.js
CHANGED
|
@@ -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
|
|
5
|
-
const
|
|
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: (
|
|
15
|
-
var
|
|
16
|
-
return ((
|
|
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: (
|
|
22
|
-
var
|
|
23
|
-
return ((
|
|
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: (
|
|
29
|
-
var
|
|
30
|
-
return ((
|
|
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: (
|
|
36
|
-
var
|
|
37
|
-
return ((
|
|
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: (
|
|
43
|
-
var
|
|
44
|
-
return ((
|
|
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: (
|
|
50
|
-
var
|
|
51
|
-
return ((
|
|
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: (
|
|
57
|
-
var
|
|
58
|
-
return ((
|
|
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: (
|
|
64
|
-
var
|
|
65
|
-
return ((
|
|
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: (
|
|
71
|
-
var
|
|
72
|
-
return ((
|
|
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: (
|
|
78
|
-
var
|
|
79
|
-
return ((
|
|
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: (
|
|
85
|
-
var
|
|
86
|
-
return ((
|
|
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: (
|
|
92
|
-
var
|
|
93
|
-
return ((
|
|
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: (
|
|
99
|
-
var
|
|
100
|
-
return ((
|
|
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: (
|
|
106
|
-
var
|
|
107
|
-
return ((
|
|
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: (
|
|
113
|
-
var
|
|
114
|
-
return ((
|
|
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: (
|
|
120
|
-
var
|
|
121
|
-
return ((
|
|
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: (
|
|
127
|
-
var
|
|
128
|
-
return ((
|
|
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: (
|
|
137
|
-
var
|
|
138
|
-
return ((
|
|
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(
|
|
146
|
-
const
|
|
147
|
-
this.config =
|
|
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
|
-
|
|
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
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHtmlCompiler as
|
|
4
|
-
import {
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
import { mapLegacyStrategy as
|
|
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
|
|
9
|
-
import { useDynamicContentStore as
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { useUnsubscribeStore as
|
|
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
|
|
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
|
|
17
|
-
|
|
16
|
+
const o = s.getAttribute(A.PAGE_LIST);
|
|
17
|
+
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
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 =
|
|
24
|
+
const i = C();
|
|
25
25
|
n.forEach((t) => {
|
|
26
|
-
var l, g, f, c
|
|
27
|
-
const s = t.getAttribute("recommendation-id"),
|
|
28
|
-
if (!Number.isFinite(
|
|
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
|
|
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:
|
|
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: ((
|
|
55
|
-
currencyAlignment: ((
|
|
56
|
-
currencyDecimalCount: ((
|
|
57
|
-
currencyDecimalSeparator: ((
|
|
58
|
-
currencyThousandSeparator: ((
|
|
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(
|
|
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
|
|
72
|
-
const m =
|
|
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:
|
|
75
|
+
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
76
76
|
if (e("linkTrackingIds"))
|
|
77
77
|
try {
|
|
78
|
-
const { html:
|
|
79
|
-
u.trackIdSessionFloor = H,
|
|
80
|
-
} catch (
|
|
81
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
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:
|
|
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
|
|
88
|
-
const { compiledHtml: I, stats:
|
|
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:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
93
|
-
appliedRules:
|
|
94
|
-
executionTime: `${
|
|
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:
|
|
96
|
+
dynamicContentList: E,
|
|
97
97
|
compiledHtml: I,
|
|
98
|
-
rawHtml:
|
|
98
|
+
rawHtml: r,
|
|
99
99
|
css: l,
|
|
100
|
-
ampHtml:
|
|
101
|
-
ampErrors:
|
|
100
|
+
ampHtml: D,
|
|
101
|
+
ampErrors: T,
|
|
102
102
|
modules: g.map(Number),
|
|
103
103
|
recommendation: {
|
|
104
|
-
campaignUrls:
|
|
104
|
+
campaignUrls: P.recommendationCampaignUrls,
|
|
105
105
|
configs: {}
|
|
106
106
|
},
|
|
107
107
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
108
|
+
status: b.length > 0,
|
|
109
|
+
config: b
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
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.
|
|
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",
|