@useinsider/guido 3.17.0 → 3.18.0-beta.41e529d
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 +6 -5
- package/dist/@types/config/schemas.js +10 -7
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +86 -78
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +131 -0
- 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.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/composables/useCustomInterfaceAppearance.js +56 -38
- package/dist/composables/useLegacyStrategyConversion.js +52 -0
- package/dist/composables/useModuleRepair.js +33 -0
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +30 -29
- package/dist/composables/useStripo.js +15 -15
- package/dist/composables/useSyncModuleExtractor.js +15 -13
- package/dist/composables/validators/useSyncModuleBlockValidator.js +24 -0
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +31 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +4 -1
- package/dist/extensions/Blocks/Items/block.js +118 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +25 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Items/utils/constants.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +35 -29
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +242 -180
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +159 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +217 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +10 -6
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +81 -33
- package/dist/src/@types/config/schemas.d.ts +6 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/composables/useModuleRepair.d.ts +18 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/composables/useSyncModuleExtractor.d.ts +2 -0
- package/dist/src/composables/validators/useSyncModuleBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +35 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +43 -0
- package/dist/src/extensions/Blocks/Items/utils/constants.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +229 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +6 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +5 -1
- package/dist/src/stores/config.d.ts +178 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +17 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +220 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/stores/config.js +66 -59
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/itemsCurrencyRepair.js +39 -0
- package/dist/utils/pairProductVariables.js +58 -58
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +3 -2
- package/dist/composables/useModuleDynamicContentRepair.js +0 -37
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -13
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
const n = `.strategy-control-header {
|
|
2
|
+
padding: 16px 16px 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.strategy-control-title {
|
|
6
|
+
margin: 0;
|
|
7
|
+
color: var(--guido-color-gray-800);
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
line-height: 24px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.strategy-control-description-row {
|
|
14
|
+
padding: 8px 16px 16px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.strategy-control-description {
|
|
18
|
+
margin: 0;
|
|
19
|
+
color: var(--guido-color-gray-600);
|
|
20
|
+
font-size: 13px;
|
|
21
|
+
line-height: 16px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.strategy-control-description a {
|
|
25
|
+
color: var(--guido-color-primary-500);
|
|
26
|
+
text-decoration: underline;
|
|
27
|
+
}
|
|
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
|
+
.recommendation-controls-container .container.strategy-control-cta-row {
|
|
64
|
+
grid-template-columns: repeat(2, minmax(0, 180px));
|
|
65
|
+
justify-content: start;
|
|
66
|
+
gap: 16px;
|
|
67
|
+
padding: 0 16px 16px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.strategy-control-cta {
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.strategy-control-cta > .button {
|
|
75
|
+
display: flex;
|
|
76
|
+
gap: 8px;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 100%;
|
|
79
|
+
border: none;
|
|
80
|
+
font-size: 15px;
|
|
81
|
+
font-weight: 400;
|
|
82
|
+
line-height: 24px;
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.strategy-control-cta.primary > .button:disabled,
|
|
87
|
+
.strategy-control-cta.primary > .button.disabled {
|
|
88
|
+
opacity: 1;
|
|
89
|
+
color: var(--guido-color-gray-800);
|
|
90
|
+
cursor: default;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.strategy-control-name-band {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
min-height: 48px;
|
|
97
|
+
padding: 0 16px;
|
|
98
|
+
background-color: var(--guido-color-gray-0);
|
|
99
|
+
}
|
|
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
|
+
|
|
109
|
+
.strategy-control-name {
|
|
110
|
+
color: var(--guido-color-gray-800);
|
|
111
|
+
font-size: 15px;
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
line-height: 24px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.strategy-control-actions {
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
padding: 16px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.strategy-control-action {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
padding: 0;
|
|
126
|
+
border: none;
|
|
127
|
+
background: none;
|
|
128
|
+
font-size: 15px;
|
|
129
|
+
font-weight: 400;
|
|
130
|
+
line-height: 24px;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.strategy-control-action > span {
|
|
135
|
+
padding: 0 8px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.strategy-control-action::before,
|
|
139
|
+
.strategy-control-cta.on > .button::before {
|
|
140
|
+
content: '';
|
|
141
|
+
flex: none;
|
|
142
|
+
width: 24px;
|
|
143
|
+
height: 24px;
|
|
144
|
+
background-color: currentcolor;
|
|
145
|
+
mask-repeat: no-repeat;
|
|
146
|
+
mask-position: center;
|
|
147
|
+
mask-size: 24px 24px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.strategy-control-action--change::before {
|
|
151
|
+
mask-image: var(--guido-icon-line-change);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.strategy-control-action--remove::before {
|
|
155
|
+
mask-image: var(--guido-icon-line-delete);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.strategy-control-cta.on > .button::before {
|
|
159
|
+
mask-image: var(--guido-icon-line-plus);
|
|
160
|
+
}
|
|
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,
|
|
171
|
+
.strategy-control-action--change {
|
|
172
|
+
color: var(--guido-color-primary-500);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.strategy-control-action--remove {
|
|
176
|
+
color: var(--guido-color-danger-500);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.strategy-control-action:hover {
|
|
180
|
+
text-decoration: underline;
|
|
181
|
+
}
|
|
182
|
+
|
|
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,
|
|
191
|
+
.recommendation-controls-container.strategy-block .product-count-control-container,
|
|
192
|
+
.recommendation-controls-container.strategy-block .algorithm-control-container,
|
|
193
|
+
.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 {
|
|
199
|
+
display: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.recommendation-controls-container.strategy-block,
|
|
203
|
+
.recommendation-controls-container.legacy-strategy-block {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.recommendation-controls-container.strategy-block .price-placement-control-container,
|
|
209
|
+
.recommendation-controls-container.legacy-strategy-block .price-placement-control-container {
|
|
210
|
+
order: 1;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.recommendation-controls-container.strategy-block .product-layout-control-container,
|
|
214
|
+
.recommendation-controls-container.legacy-strategy-block .product-layout-control-container {
|
|
215
|
+
order: 2;
|
|
216
|
+
}
|
|
217
|
+
`;
|
|
218
|
+
export {
|
|
219
|
+
n as default
|
|
220
|
+
};
|
|
@@ -43,7 +43,9 @@ const n = `.esd-x,
|
|
|
43
43
|
.recommendation-block-v2 .product-omnibus-discount ue-node-actions,
|
|
44
44
|
.recommendation-block-v2 .product-omnibus-discount ue-node-panel,
|
|
45
45
|
.recommendation-block-v2 .product-button ue-node-actions,
|
|
46
|
-
.recommendation-block-v2 .product-button ue-node-panel
|
|
46
|
+
.recommendation-block-v2 .product-button ue-node-panel,
|
|
47
|
+
.recommendation-block-v2 .ins-recommendation-title ue-node-actions,
|
|
48
|
+
.recommendation-block-v2 .ins-recommendation-title ue-node-panel {
|
|
47
49
|
display: none !important;
|
|
48
50
|
}
|
|
49
51
|
|
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,128 @@ 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 ((n = (
|
|
77
|
+
templateId: (e) => {
|
|
78
|
+
var i, n;
|
|
79
|
+
return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.templateId) ?? "";
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
82
|
* Get the user ID
|
|
83
83
|
*/
|
|
84
|
-
userId: (
|
|
85
|
-
var
|
|
86
|
-
return ((n = (
|
|
84
|
+
userId: (e) => {
|
|
85
|
+
var i, n;
|
|
86
|
+
return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.userId) ?? "";
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
89
|
* Get the variation ID
|
|
90
90
|
*/
|
|
91
|
-
variationId: (
|
|
92
|
-
var
|
|
93
|
-
return ((n = (
|
|
91
|
+
variationId: (e) => {
|
|
92
|
+
var i, n;
|
|
93
|
+
return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.variationId) ?? "";
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Get the campaign ID
|
|
97
|
+
*/
|
|
98
|
+
campaignId: (e) => {
|
|
99
|
+
var i, n;
|
|
100
|
+
return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.campaignId) ?? "";
|
|
94
101
|
},
|
|
95
102
|
/**
|
|
96
103
|
* Get the partner name
|
|
97
104
|
*/
|
|
98
|
-
partnerName: (
|
|
99
|
-
var
|
|
100
|
-
return ((n = (
|
|
105
|
+
partnerName: (e) => {
|
|
106
|
+
var i, n;
|
|
107
|
+
return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.name) ?? "";
|
|
101
108
|
},
|
|
102
109
|
/**
|
|
103
110
|
* Get the product type
|
|
104
111
|
*/
|
|
105
|
-
productType: (
|
|
106
|
-
var
|
|
107
|
-
return ((n = (
|
|
112
|
+
productType: (e) => {
|
|
113
|
+
var i, n;
|
|
114
|
+
return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.productType) ?? 60;
|
|
108
115
|
},
|
|
109
116
|
/**
|
|
110
117
|
* Get the message type
|
|
111
118
|
*/
|
|
112
|
-
messageType: (
|
|
113
|
-
var
|
|
114
|
-
return ((n = (
|
|
119
|
+
messageType: (e) => {
|
|
120
|
+
var i, n;
|
|
121
|
+
return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.messageType) ?? 1;
|
|
115
122
|
},
|
|
116
123
|
/**
|
|
117
124
|
* Get the username
|
|
118
125
|
*/
|
|
119
|
-
username: (
|
|
120
|
-
var
|
|
121
|
-
return ((n = (
|
|
126
|
+
username: (e) => {
|
|
127
|
+
var i, n;
|
|
128
|
+
return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.username) ?? "Guido User";
|
|
122
129
|
},
|
|
123
130
|
/**
|
|
124
131
|
* Check if header should be shown
|
|
125
132
|
*/
|
|
126
|
-
showHeader: (
|
|
127
|
-
var
|
|
128
|
-
return ((n = (
|
|
133
|
+
showHeader: (e) => {
|
|
134
|
+
var i, n;
|
|
135
|
+
return ((n = (i = e.config) == null ? void 0 : i.ui) == null ? void 0 : n.showHeader) ?? !0;
|
|
129
136
|
},
|
|
130
137
|
/**
|
|
131
138
|
* Check if a specific feature is enabled.
|
|
@@ -133,18 +140,18 @@ const f = r("guido-config", {
|
|
|
133
140
|
* flash on during loading, then disappear once config resolves.
|
|
134
141
|
*/
|
|
135
142
|
// eslint-disable-next-line @stylistic/max-len
|
|
136
|
-
isFeatureEnabled: (
|
|
143
|
+
isFeatureEnabled: (e) => (i) => {
|
|
137
144
|
var n, t;
|
|
138
|
-
return ((t = (n =
|
|
145
|
+
return ((t = (n = e.config) == null ? void 0 : n.features) == null ? void 0 : t[i]) ?? !1;
|
|
139
146
|
}
|
|
140
147
|
},
|
|
141
148
|
actions: {
|
|
142
149
|
/**
|
|
143
150
|
* Initialize the config store with validated configuration
|
|
144
151
|
*/
|
|
145
|
-
init(
|
|
146
|
-
const
|
|
147
|
-
this.config =
|
|
152
|
+
init(e) {
|
|
153
|
+
const i = o(e);
|
|
154
|
+
this.config = i, this.initialized = !0;
|
|
148
155
|
},
|
|
149
156
|
/**
|
|
150
157
|
* Reset the config store
|
|
@@ -155,5 +162,5 @@ const f = r("guido-config", {
|
|
|
155
162
|
}
|
|
156
163
|
});
|
|
157
164
|
export {
|
|
158
|
-
|
|
165
|
+
s as useConfigStore
|
|
159
166
|
};
|
package/dist/utils/dateUtil.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { DEFAULT_LOCALE as
|
|
2
|
-
const
|
|
1
|
+
import { DEFAULT_LOCALE as n, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
|
|
2
|
+
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
|
|
3
3
|
const t = window.l10n;
|
|
4
|
-
return (t == null ? void 0 : t.locale) ===
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
return (t == null ? void 0 : t.locale) === a ? n : (t == null ? void 0 : t.locale) || n;
|
|
5
|
+
}, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
|
|
6
|
+
const t = window.l10n;
|
|
7
|
+
return (t == null ? void 0 : t.timezone) || u || c;
|
|
8
|
+
}, D = (t, e = s(), r = f()) => {
|
|
9
|
+
const o = {
|
|
10
|
+
year: "numeric",
|
|
11
|
+
month: "2-digit",
|
|
12
|
+
day: "2-digit",
|
|
13
|
+
timeZone: r
|
|
14
|
+
}, i = m(t);
|
|
15
|
+
return new Intl.DateTimeFormat(e, o).format(i);
|
|
16
|
+
}, T = (t) => {
|
|
8
17
|
if (!t)
|
|
9
18
|
return "";
|
|
10
19
|
const e = new Date(t);
|
|
@@ -16,9 +25,13 @@ const i = (t) => {
|
|
|
16
25
|
second: "2-digit",
|
|
17
26
|
hour12: !1
|
|
18
27
|
}).format(e);
|
|
19
|
-
},
|
|
28
|
+
}, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
20
29
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
m as convertToDateObject,
|
|
31
|
+
T as formatPatchDate,
|
|
32
|
+
D as formatShortDate,
|
|
33
|
+
h as isAfterDate,
|
|
34
|
+
u as localTz,
|
|
35
|
+
s as locale,
|
|
36
|
+
f as timezone
|
|
24
37
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
const o = (
|
|
2
|
-
const a =
|
|
3
|
-
text:
|
|
4
|
-
value:
|
|
1
|
+
const o = (t) => {
|
|
2
|
+
const a = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [s] = a, r = {
|
|
3
|
+
text: t.label,
|
|
4
|
+
value: s || ""
|
|
5
5
|
};
|
|
6
6
|
if (a.length >= 2) {
|
|
7
|
-
const [,
|
|
8
|
-
if (
|
|
9
|
-
let n =
|
|
7
|
+
const [, l, e] = a;
|
|
8
|
+
if (l.startsWith("default:")) {
|
|
9
|
+
let n = l.slice(8).trim();
|
|
10
10
|
n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
|
|
11
11
|
} else {
|
|
12
|
-
const n =
|
|
13
|
-
n ? r.format = n : e || (r.fallback =
|
|
12
|
+
const n = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
|
|
13
|
+
n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
return r;
|
|
17
|
-
}, f = (
|
|
17
|
+
}, f = (t, c = !1) => t.map((a) => {
|
|
18
18
|
if (a.format)
|
|
19
19
|
return {
|
|
20
20
|
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
21
21
|
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
22
22
|
};
|
|
23
|
-
if (
|
|
23
|
+
if (c) {
|
|
24
24
|
if (!a.fallback)
|
|
25
25
|
return {
|
|
26
26
|
label: a.text,
|
|
@@ -36,33 +36,34 @@ const o = (l) => {
|
|
|
36
36
|
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
37
|
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
38
|
};
|
|
39
|
-
}), b = (
|
|
40
|
-
const
|
|
41
|
-
Array.isArray(
|
|
39
|
+
}), b = (t) => {
|
|
40
|
+
const c = [], a = /* @__PURE__ */ new Set(), s = (l) => {
|
|
41
|
+
Array.isArray(l) && l.forEach((e) => {
|
|
42
42
|
const n = [...e.children ?? [], ...e.select_items ?? []];
|
|
43
43
|
if (n.length > 0) {
|
|
44
|
-
|
|
44
|
+
s(n);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
const u = e.text || e.tag_text;
|
|
48
|
-
u && e.value && !a.has(e.value) && (a.add(e.value),
|
|
48
|
+
u && e.value && !a.has(e.value) && (a.add(e.value), c.push({ text: u, value: e.value }));
|
|
49
49
|
});
|
|
50
|
-
}, [r] = Object.values(
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
const
|
|
50
|
+
}, [r] = Object.values(t ?? {});
|
|
51
|
+
return s(r), c;
|
|
52
|
+
}, i = (t, c, a = !1) => {
|
|
53
|
+
const s = new Set(t.map((l) => l.value)), r = c.filter((l) => s.has(l.value) ? !1 : (s.add(l.value), !0));
|
|
54
54
|
return [
|
|
55
|
-
...f(
|
|
55
|
+
...f(t, a),
|
|
56
56
|
...f(r, a)
|
|
57
57
|
];
|
|
58
|
-
},
|
|
59
|
-
var
|
|
60
|
-
return ((
|
|
61
|
-
};
|
|
58
|
+
}, v = () => {
|
|
59
|
+
var t;
|
|
60
|
+
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
61
|
+
}, k = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "";
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
k as asText,
|
|
64
|
+
i as buildMergeTagEntries,
|
|
64
65
|
f as dynamicContentToMergeTags,
|
|
65
66
|
b as flattenDynamicContentList,
|
|
66
|
-
|
|
67
|
+
v as getCsrfToken,
|
|
67
68
|
o as mergeTagToDynamicContent
|
|
68
69
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { currencyAttrTargets as u, ITEMS_CURRENCY_ATTR as c } from "../extensions/Blocks/Items/constants/currency.js";
|
|
2
|
+
import { ItemsBlockId as l } from "../extensions/Blocks/Items/enums/controlEnums.js";
|
|
3
|
+
const s = "items-block-v2";
|
|
4
|
+
function f(e) {
|
|
5
|
+
const i = e.getAttribute("esd-ext-config");
|
|
6
|
+
if (!i)
|
|
7
|
+
return !1;
|
|
8
|
+
let t, r;
|
|
9
|
+
try {
|
|
10
|
+
({ position: t, symbol: r } = u(JSON.parse(i)));
|
|
11
|
+
} catch {
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
let o = !1;
|
|
15
|
+
return e.querySelectorAll(`.${l.PRICE} p`).forEach((n) => {
|
|
16
|
+
t !== void 0 && n.getAttribute(c.POSITION) !== t && (n.setAttribute(c.POSITION, t), o = !0), r !== void 0 && n.getAttribute(c.SYMBOL) !== r && (n.setAttribute(c.SYMBOL, r), o = !0);
|
|
17
|
+
}), o;
|
|
18
|
+
}
|
|
19
|
+
function S(e) {
|
|
20
|
+
if (typeof e != "string" || !e.includes(s))
|
|
21
|
+
return e;
|
|
22
|
+
try {
|
|
23
|
+
const t = new DOMParser().parseFromString(
|
|
24
|
+
`<table><tbody><tr>${e}</tr></tbody></table>`,
|
|
25
|
+
"text/html"
|
|
26
|
+
).querySelector("tr"), r = t.querySelectorAll(`.${s}`);
|
|
27
|
+
if (r.length === 0)
|
|
28
|
+
return e;
|
|
29
|
+
let o = !1;
|
|
30
|
+
return r.forEach((n) => {
|
|
31
|
+
f(n) && (o = !0);
|
|
32
|
+
}), o ? t.innerHTML : e;
|
|
33
|
+
} catch (i) {
|
|
34
|
+
return console.error("Failed to repair items currency on module add:", i), e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
S as repairItemsCurrencyAttributes
|
|
39
|
+
};
|